diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 90825e2392b2d70e43c7a25b8a3752299a933894 (patch) | |
tree | e33aa27f02b74604afbfd0ea4f1cfca8833d882a /smoke | |
download | tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.tar.gz tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'smoke')
-rw-r--r-- | smoke/Makefile.am | 3 | ||||
-rw-r--r-- | smoke/README | 21 | ||||
-rw-r--r-- | smoke/configure.in.in | 9 | ||||
-rw-r--r-- | smoke/kde/Makefile.am | 24 | ||||
-rw-r--r-- | smoke/kde/configure.in.in | 23 | ||||
-rw-r--r-- | smoke/kde/generate.pl.in | 229 | ||||
-rwxr-xr-x | smoke/kde/generate_makefile_am.pl | 55 | ||||
-rw-r--r-- | smoke/kde/header_list | 351 | ||||
-rw-r--r-- | smoke/kde/hint_header_list.pl | 23 | ||||
-rw-r--r-- | smoke/kde/kde_header_list | 440 | ||||
-rw-r--r-- | smoke/kde/qt_smoke.h | 9 | ||||
-rw-r--r-- | smoke/kde/qtguess.pl.in | 501 | ||||
-rw-r--r-- | smoke/qt/Makefile.am | 24 | ||||
-rw-r--r-- | smoke/qt/configure.in.in | 82 | ||||
-rw-r--r-- | smoke/qt/generate.pl.in | 178 | ||||
-rwxr-xr-x | smoke/qt/generate_makefile_am.pl | 55 | ||||
-rw-r--r-- | smoke/qt/header_list | 351 | ||||
-rw-r--r-- | smoke/qt/hint_header_list.pl | 23 | ||||
-rw-r--r-- | smoke/qt/qscintilla_header_list | 22 | ||||
-rw-r--r-- | smoke/qt/qt_smoke.h | 9 | ||||
-rw-r--r-- | smoke/qt/qtguess.pl.in | 501 | ||||
-rw-r--r-- | smoke/qt/smokeqt.pro | 32 | ||||
-rw-r--r-- | smoke/smoke.h | 386 |
23 files changed, 3351 insertions, 0 deletions
diff --git a/smoke/Makefile.am b/smoke/Makefile.am new file mode 100644 index 00000000..b30c05d0 --- /dev/null +++ b/smoke/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = $(kde_build_libsmoke) + +include_HEADERS = smoke.h diff --git a/smoke/README b/smoke/README new file mode 100644 index 00000000..d38cdcb9 --- /dev/null +++ b/smoke/README @@ -0,0 +1,21 @@ +SMOKE stands for "Scripting Meta Object Kompiler Engine" - for instance ;) + +This directory compiles a smokeqt (and later a smokekde) library, which +contain interfaces to (almost) all Qt and KDE classes. +The next PerlQt/PerlKDE will be based on SMOKE. +However SMOKE is language-independent enough for other bindings (e.g. to +other scripting languages) to be based on it. + +Note that the .cpp source files are auto-generated by kalyptus, from reading +the Qt/KDE headers. + + +Regenerating +============ + +For SmokeQt: + cd qt + ./qtguess.pl + ./generate.pl + make + diff --git a/smoke/configure.in.in b/smoke/configure.in.in new file mode 100644 index 00000000..ab6a6942 --- /dev/null +++ b/smoke/configure.in.in @@ -0,0 +1,9 @@ +AC_ARG_WITH( + smoke, + [ --with-smoke@<:@=qt|kde@:>@ Smoke: build Smoke for qt+kde or qt only @<:@default:qt kde@:>@], + [ kde_build_libsmoke="$withval" ], + [ kde_build_libsmoke="qt kde" ] +) +AC_SUBST(kde_build_libsmoke) + + diff --git a/smoke/kde/Makefile.am b/smoke/kde/Makefile.am new file mode 100644 index 00000000..a7fc91a8 --- /dev/null +++ b/smoke/kde/Makefile.am @@ -0,0 +1,24 @@ +lib_LTLIBRARIES = libsmokekde.la + +# set the include path for X, qt and KDE +INCLUDES = -I$(srcdir)/.. $(all_includes) + +EXTRA_DIST=generate.pl.in qtguess.pl.in qt_smoke.h Makefile.am + +# the library search path. +libsmokekde_la_LDFLAGS = -version-info 3:2:2 -no-undefined $(all_libraries) $(GLINC) $(KDE_RPATH) + +# the libraries to link against. +libsmokekde_la_LIBADD = $(LIB_KHTML) -lkjs -lfontconfig $(LIB_KMDI) $(LIB_KNS) $(LIB_KSPELL) $(LIB_KUTILS) $(LIB_KDEPRINT) $(GLLIB) + +x_sources = x_1.cpp x_2.cpp x_3.cpp x_4.cpp x_5.cpp x_6.cpp x_7.cpp \ + x_8.cpp x_9.cpp x_10.cpp x_11.cpp x_12.cpp x_13.cpp x_14.cpp x_15.cpp \ + x_16.cpp x_17.cpp x_18.cpp x_19.cpp x_20.cpp + +# which sources should be compiled for perlqtkde +libsmokekde_la_SOURCES = $(x_sources) smokedata.cpp + +$(x_sources) smokedata.cpp: + perl generate.pl + +CLEANFILES = $(libsmokekde_la_SOURCES) diff --git a/smoke/kde/configure.in.in b/smoke/kde/configure.in.in new file mode 100644 index 00000000..04b58b33 --- /dev/null +++ b/smoke/kde/configure.in.in @@ -0,0 +1,23 @@ + +AC_HAVE_GL +KDE_HAVE_GL=yes; +if test "X$GLLIB" = "X"; then + KDE_HAVE_GL=no +fi + +AC_SUBST(KDE_HAVE_GL) + +KDE_PREFIX=`$KDECONFIG --prefix --expandvars` +AC_SUBST(KDE_PREFIX) + +if test "X$kde_build_libsmoke" = "Xkde" -o "X$kde_build_libsmoke" = "Xqt kde"; then + + AC_CONFIG_FILES([ smoke/kde/qtguess.pl ], [ + cd smoke/kde + perl qtguess.pl + cd ../.. + ]) + AC_CONFIG_FILES([ smoke/kde/generate.pl ], [ + ]) +fi + diff --git a/smoke/kde/generate.pl.in b/smoke/kde/generate.pl.in new file mode 100644 index 00000000..a628b731 --- /dev/null +++ b/smoke/kde/generate.pl.in @@ -0,0 +1,229 @@ +#!/usr/bin/perl -w + +## Run this first, to generate the x_*.cpp files from the Qt headers +## using kalyptus + +my $kalyptusdir = "@srcdir@/../../kalyptus"; + +use File::Basename; +use File::Copy qw|cp|; +use File::Compare; +use File::Find; +use Cwd; + +my $here = getcwd; +my $outdir = $here . "/generate.pl.tmpdir"; +my $finaloutdir = $here; +my $defines = "qtdefines"; +my $headerlist = "@srcdir@/header_list"; +my $kdeheaderlist = "@srcdir@/kde_header_list"; +my $definespath = "$here/$defines"; +my $headerlistpath = "$here/$headerlist"; +my $kdeheaderlistpath = "$here/$kdeheaderlist"; + +# If srcdir != builddir, then srcdir is probvably an absolute +# path, and it makes no sense to prepend $here. +$definespath = $defines if $defines =~ /^\//; +$headerlistpath = $headerlist if $headerlist =~ /^\//; +$kdeheaderlistpath = $kdeheaderlist if $kdeheaderlist =~ /^\//; + +## Note: outdir and finaloutdir should NOT be the same dir! + +# Delete all x_*.cpp files under outdir (or create outdir if nonexistent) +if (-d $outdir) { system "rm -f $outdir/x_*.cpp"; } else { mkdir $outdir; } + +mkdir $finaloutdir unless (-d $finaloutdir); + +# Load the QT_NO_* macros found in "qtdefines". They'll be passed to kalyptus +my $macros=""; +if ( -e $definespath ){ + print "Found '$defines'. Reading preprocessor symbols from there...\n"; + $macros = " --defines=$definespath "; +} + +# Need to cd to kalyptus's directory so that perl finds Ast.pm etc. +chdir "$kalyptusdir" or die "Couldn't go to $kalyptusdir (edit script to change dir)\n"; + +# Find out which header files we need to parse +# We don't want all of them - e.g. not template-based stuff +my %excludes = ( + 'qaccessible.h' => 1, # Accessibility support is not compiled by defaut + 'qassistantclient.h' => 1, # Not part of Qt (introduced in Qt-3.1) + 'qmotif.h' => 1, # + 'qmotifwidget.h' => 1, # Motif extension (introduced in Qt-3.1) + 'qmotifdialog.h' => 1, # + 'qxt.h' => 1, # Xt + 'qxtwidget.h' => 1, # Xt + 'qdns.h' => 1, # internal + 'qgl.h' => 1, # OpenGL + 'qglcolormap.h' => 1, # OpenGL + 'qnp.h' => 1, # NSPlugin + 'qttableview.h' => 1, # Not in Qt anymore... + 'qtmultilineedit.h' => 1, # Not in Qt anymore... + 'qwidgetfactory.h' => 1, # Just an interface + 'qsharedmemory.h' => 1, # "not part of the Qt API" they say + 'qwindowsstyle.h' => 1, # Qt windowsstyle, plugin + 'qmotifstyle.h' => 1, + 'qcompactstyle.h' => 1, + 'qinterlacestyle.h' => 1, + 'qmotifplusstyle.h' => 1, + 'qsgistyle.h' => 1, + 'qplatinumstyle.h' => 1, + 'qcdestyle.h' => 1, + 'qwindowsxpstyle.h' => 1 # play on the safe side +); + +# Some systems have a QTDIR = KDEDIR = PREFIX +# We need a complete list + +my %includes; +open(HEADERS, $headerlistpath) or die "Couldn't open $headerlistpath: $!\n"; +map { chomp ; $includes{$_} = 1 unless /^\s*#/ } <HEADERS>; +close HEADERS; + +# Find out which header files we need to parse +# We don't want all of them - e.g. not template-based stuff +my %kdeexcludes = ( +# These headers don't look suitable for inclusion: + 'kallocator.h' => 1, + 'kbookmarkimporter_crash.h' => 1, + 'kbookmarkimporter_ie.h' => 1, + 'kbookmarkimporter_opera.h' => 1, + 'kbookmarkimporter_ns.h' => 1, + 'kcrash.h' => 1, + 'kdebug.h' => 1, + 'kdebugclasses.h' => 1, + 'kde_terminal_interface.h' => 1, + 'kdirnotify_stub.h' => 1, + +# These headers currently give problems + 'kscreensaver.h' => 1, + 'kdirnotify_stub.h' => 1, + 'kio/uiserver_stub.h' => 1, + 'kio/uiserver.h' => 1, + 'kio/kdesasl.h' => 1, + 'kio/kpac.h' => 1, + 'kio/thumbcreator.h' => 1, + 'kio/file.h' => 1, + 'kio/chmodjob.h' => 1, + 'kparts/genericfactory.h' => 1, + 'kparts/pluginselectormodule.h' => 1, + 'kopenssl.h' => 1, + 'kautomount.h' => 1, + 'kimagefilepreview.h' => 1, + 'kpropertiesdialog.h' => 1, + 'knotifydialog.h' => 1, + 'ksockaddr.h' => 1, + 'knotifywidgetbase.h' => 1, +); + +# Some systems have a QTDIR = KDEDIR = PREFIX +# We need a complete list + +my %kdeincludes; +open(HEADERS, $kdeheaderlistpath) or die "Couldn't open $kdeheaderlistpath: $!\n"; +map { chomp ; $kdeincludes{$_} = 1 unless /^\s*#/ } <HEADERS>; +close HEADERS; + +# Can we compile the OpenGl module ? +if("@KDE_HAVE_GL@" eq "yes") +{ + open(DEFS, $definespath); + my @defs = <DEFS>; + close DEFS; + if(!grep(/QT_NO_OPENGL/, @defs)) + { + $excludes{'qgl.h'} = undef; + $excludes{'qglcolormap.h'} = undef; + } + else + { + print STDERR "Qt was not compiled with OpenGL support...\n Skipping QGL Classes.\n"; + } +} + +# List Qt headers, and exclude the ones listed above +my @headers = (); + +$qtinc= '@qt_includes@'; +opendir (QT, $qtinc) or die "Couldn't find $qtinc"; +foreach $filename (readdir(QT)) { + $entry = $qtinc."/".$filename; + if ( ( -e $entry or -l $entry ) # A real file or a symlink + && ( ! -d _ ) ) # Not a symlink to a dir though + { + push(@headers, $entry) + if ( !defined $excludes{$filename} # Not excluded + && $includes{$filename} # Known header + && $filename =~ /\.h$/ ); # Not a backup file etc. Only headers. + undef $includes{$filename} + } +} +closedir QT; + +my @kdeheaders = (); +$kdeprefix = "@KDE_PREFIX@"; +$kdeinc= '@kde_includes@'; +$kdeinc =~ s/\${prefix}/$kdeprefix/; # Remove ${prefix} in src != build +-d $kdeinc or die "Couldn't process $kdeinc: $!\n"; + +find( + { wanted => sub { + (-e || -l and !-d) and do { + $f = substr($_, 1 + length $kdeinc); + push ( @kdeheaders, $_ ) + if( !defined $kdeexcludes{$f} # Not excluded + && $kdeincludes{$f} # Known header + && /\.h$/); # Not a backup file etc. Only headers. + undef $kdeincludes{$f} + }; + }, + follow_fast => 1, + follow_skip => 2, + no_chdir => 1 + }, $kdeinc + ); + +# Launch kalyptus +system "perl kalyptus @ARGV --globspace -fsmoke --name=qt $macros --no-cache --allow_k_dcop_accessors --outputdir=$outdir @headers @kdeheaders"; +my $exit = $? >> 8; +exit $exit if ($exit); + +# Generate diff for smokedata.cpp +unless ( -e "$finaloutdir/smokedata.cpp" ) { + open( TOUCH, ">$finaloutdir/smokedata.cpp"); + close TOUCH; +} +system "diff -u $finaloutdir/smokedata.cpp $outdir/smokedata.cpp > $outdir/smokedata.cpp.diff"; + +# Copy changed or new files to finaloutdir +opendir (OUT, $outdir) or die "Couldn't opendir $outdir"; +foreach $filename (readdir(OUT)) { + next if ( -d "$outdir/$filename" ); # only files, not dirs + my $docopy = 1; + if ( -f "$finaloutdir/$filename" ) { + $docopy = compare("$outdir/$filename", "$finaloutdir/$filename"); # 1 if files are differents + } + if ($docopy) { + #print STDERR "Updating $filename...\n"; + cp("$outdir/$filename", "$finaloutdir/$filename"); + } +} +closedir OUT; + +# Check for deleted files and warn +my $deleted = 0; +opendir(FINALOUT, $finaloutdir) or die "Couldn't opendir $finaloutdir"; +foreach $filename (readdir(FINALOUT)) { + next if ( -d "$finaloutdir/$filename" ); # only files, not dirs + if ( $filename =~ /.cpp$/ && ! ($filename =~ /_la_closure.cpp/) && ! -f "$outdir/$filename" ) { + print STDERR "Removing obsolete file $filename\n"; + unlink "$finaloutdir/$filename"; + $deleted = 1; + } +} +closedir FINALOUT; + +# Delete outdir +system "rm -rf $outdir"; + diff --git a/smoke/kde/generate_makefile_am.pl b/smoke/kde/generate_makefile_am.pl new file mode 100755 index 00000000..03f51747 --- /dev/null +++ b/smoke/kde/generate_makefile_am.pl @@ -0,0 +1,55 @@ +#!/usr/bin/perl -w + +use File::Basename; + +my $here = `pwd`; +chomp $here; +my $outdir = $here; +my $tempfile = "$outdir/.Makefile.am.tmpfile"; + +# Update list of source files in $outdir/Makefile.am +open( MAKEFILE, "<$outdir/Makefile.am" ) or die; +my $makeFileData = ''; +my $found = 0; +while (<MAKEFILE>) { + if (/^libsmokeqt_la_SOURCES/) + { + $found = 1; + $makeFileData .= "libsmokeqt_la_SOURCES = smokedata.cpp"; + } + $makeFileData .= $_ if (!$found); +} +close MAKEFILE; + +die "libsmokeqt_la_SOURCES not found" if (!$found); + +open( MAKEFILE, ">$tempfile" ) or die; +print MAKEFILE $makeFileData; + +my $count = 0; +opendir (FILES, $outdir) or die; +foreach $filename (readdir(FILES)) { + if ( $filename =~ /^x_.*\.cpp$/ ) { + if ( $count++ == 7 ) { + $count = 0; + print MAKEFILE " \\\n"; + } + print MAKEFILE " $filename"; + } +} + +print MAKEFILE "\n"; +close MAKEFILE; +closedir FILES; + +system "cmp -s $tempfile $outdir/Makefile.am"; +if ($? >> 8) { + system "cp -f $tempfile $outdir/Makefile.am"; + print STDERR "Makefile.am updated.\n"; +} +else { + print STDERR "Makefile.am unchanged.\n"; +} +system "rm -f $tempfile"; + +exit 0; diff --git a/smoke/kde/header_list b/smoke/kde/header_list new file mode 100644 index 00000000..3e4979da --- /dev/null +++ b/smoke/kde/header_list @@ -0,0 +1,351 @@ +q1xcompatibility.h +qabstractlayout.h +qaccel.h +qaccessible.h +qaction.h +qapp.h +qapplication.h +qarray.h +qasciicache.h +qasciidict.h +qassistantclient.h +qasyncimageio.h +qasyncio.h +qbig5codec.h +qbitarray.h +qbitarry.h +qbitmap.h +qbrush.h +qbttngrp.h +qbuffer.h +qbuttongroup.h +qbutton.h +qcache.h +qcanvas.h +qcdestyle.h +qcheckbox.h +qchkbox.h +qcleanuphandler.h +qclipboard.h +qclipbrd.h +qcollect.h +qcollection.h +qcolordialog.h +qcolor.h +qcombobox.h +qcombo.h +qcommonstyle.h +qcompactstyle.h +qconfig-dist.h +qconfig.h +qconnect.h +qconnection.h +qcstring.h +qcursor.h +qdatabrowser.h +qdatastream.h +qdatatable.h +qdataview.h +qdatetimeedit.h +qdatetime.h +qdatetm.h +qdeepcopy.h +qdesktopwidget.h +qdial.h +qdialog.h +qdict.h +qdir.h +qdns.h +qdockarea.h +qdockwindow.h +qdom.h +qdragobject.h +qdrawutil.h +qdrawutl.h +qdropsite.h +qdstream.h +qeditorfactory.h +qerrormessage.h +qeucjpcodec.h +qeuckrcodec.h +qevent.h +qeventloop.h +qfeatures.h +qfiledef.h +qfiledialog.h +qfiledlg.h +qfile.h +qfileinf.h +qfileinfo.h +qfocusdata.h +qfontdatabase.h +qfontdialog.h +qfontdta.h +qfont.h +qfontinf.h +qfontinfo.h +qfontmet.h +qfontmetrics.h +qframe.h +qftp.h +qgarray.h +qgb18030codec.h +qgbkcodec.h +qgcache.h +qgdict.h +qgeneric.h +qgif.h +qglcolormap.h +qgl.h +qglist.h +qglobal.h +qgplugin.h +qgrid.h +qgridview.h +qgroupbox.h +qgrpbox.h +qguardedptr.h +qgvector.h +qhbox.h +qhbuttongroup.h +qheader.h +qhgroupbox.h +qhostaddress.h +qhttp.h +qiconset.h +qiconview.h +qimageformatplugin.h +qimage.h +qinputdialog.h +qintcache.h +qintcach.h +qintdict.h +qinterlacestyle.h +qiodev.h +qiodevice.h +qjiscodec.h +qjpunicode.h +qkeycode.h +qkeysequence.h +qlabel.h +qlayout.h +qlcdnumber.h +qlcdnum.h +qlocale.h +qlibrary.h +qlined.h +qlineedit.h +qlistbox.h +qlist.h +qlistview.h +qlocalfs.h +qmainwindow.h +qmap.h +qmemarray.h +qmenubar.h +qmenudata.h +qmenudta.h +qmessagebox.h +qmetaobject.h +qmetaobj.h +qmime.h +qmlined.h +qmodules.h +qmotifdialog.h +qmotif.h +qmotifplusstyle.h +qmotifstyle.h +qmotifwidget.h +qmovie.h +qmsgbox.h +qmultilinedit.h +qmultilineedit.h +qmutex.h +qnamespace.h +qnetwork.h +qnetworkprotocol.h +qobjcoll.h +qobjdefs.h +qobjectcleanuphandler.h +qobjectdefs.h +qobjectdict.h +qobject.h +qobjectlist.h +qpaintdc.h +qpaintdevicedefs.h +qpaintdevice.h +qpaintdevicemetrics.h +qpaintd.h +qpainter.h +qpair.h +qpalette.h +qpdevmet.h +qpen.h +qpicture.h +qpixmapcache.h +qpixmap.h +qplatinumstyle.h +qpmcache.h +qpntarry.h +qpointarray.h +qpoint.h +qpolygonscanner.h +qpopmenu.h +qpopupmenu.h +qprintdialog.h +qprinter.h +qprndlg.h +qprocess.h +qprogbar.h +qprogdlg.h +qprogressbar.h +qprogressdialog.h +qpsprn.h +qptrcollection.h +qptrdict.h +qptrlist.h +qptrqueue.h +qptrstack.h +qptrvector.h +qpushbt.h +qpushbutton.h +qqueue.h +qradiobt.h +qradiobutton.h +qrangecontrol.h +qrangect.h +qrect.h +qregexp.h +qregion.h +qremotefactory.h +qremoteplugin.h +qrtlcodec.h +qscopedptr.h +qscrbar.h +qscrollbar.h +qscrollview.h +qsemaphore.h +qsemimodal.h +qserversocket.h +qsession.h +qsessionmanager.h +qsettings.h +qsgistyle.h +qshared.h +qsignal.h +qsignalmapper.h +qsignalslotimp.h +qsimplerichtext.h +qsizegrip.h +qsize.h +qsizepolicy.h +qsjiscodec.h +qslider.h +qsocketdevice.h +qsocket.h +qsocketnotifier.h +qsocknot.h +qsortedlist.h +qsound.h +qspinbox.h +qsplashscreen.h +qsplitter.h +qsqlcursor.h +qsqldatabase.h +qsqldriver.h +qsqldriverplugin.h +qsqleditorfactory.h +qsqlerror.h +qsqlfield.h +qsqlform.h +qsql.h +qsqlindex.h +qsqlpropertymap.h +qsqlquery.h +qsqlrecord.h +qsqlresult.h +qsqlselectcursor.h +qstack.h +qstatusbar.h +qstring.h +qstringlist.h +qstrlist.h +qstrvec.h +qstylefactory.h +qstyle.h +qstyleplugin.h +qstylesheet.h +qsyntaxhighlighter.h +qtabbar.h +qtabdialog.h +qtabdlg.h +qtable.h +qtabwidget.h +qtextbrowser.h +qtextcodecfactory.h +qtextcodec.h +qtextcodecplugin.h +qtextedit.h +qtextstream.h +qtextview.h +qt.h +qthread.h +qtimer.h +qtl.h +qtmultilineedit.h +qtoolbar.h +qtoolbutton.h +qtoolbox.h +qtooltip.h +qtranslator.h +qtsciicodec.h +qtstream.h +qttableview.h +qurl.h +qurlinfo.h +qurloperator.h +qutfcodec.h +quuid.h +qvalidator.h +qvaluelist.h +qvaluestack.h +qvaluevector.h +qvariant.h +qvbox.h +qvbuttongroup.h +qvector.h +qvgroupbox.h +qwaitcondition.h +qwhatsthis.h +qwidcoll.h +qwidgetfactory.h +qwidget.h +qwidgetintdict.h +qwidgetlist.h +qwidgetplugin.h +qwidgetstack.h +qwindefs.h +qwindowdefs.h +qwindow.h +qwindowsstyle.h +qwizard.h +qwmatrix.h +qworkspace.h +qwsbeosdecoration_qws.h +qwscommand_qws.h +qwscursor_qws.h +qwsdecoration_qws.h +qwsdefaultdecoration_qws.h +qwsdisplay_qws.h +qwsevent_qws.h +qwshydrodecoration_qws.h +qwskde2decoration_qws.h +qwskdedecoration_qws.h +qwsmanager_qws.h +qwsmouse_qws.h +qwsproperty_qws.h +qwsregionmanager_qws.h +qwssocket_qws.h +qwsutils_qws.h +qwswindowsdecoration_qws.h +qxml.h diff --git a/smoke/kde/hint_header_list.pl b/smoke/kde/hint_header_list.pl new file mode 100644 index 00000000..ff9c86b7 --- /dev/null +++ b/smoke/kde/hint_header_list.pl @@ -0,0 +1,23 @@ + +# CVS admin : run this script to compare the set of Qt headers to +# the actual content of header_list + +$l = "header_list"; +$q = $ENV{'QTDIR'} || die "QTDIR not set\n"; +@h = <$q/include/*.h>; +grep s|.*/(.*\.h)|$1|, @h; +open(IN, $l) or die "$!: $l\n"; +@old = <IN>; +chomp @old; +map{ $h{$_}++ } @h; +map{ $old{$_}++ } @old; +map{ $diff{$_}++ unless $old{$_} } keys %h; +map{ delete $diff{$_} if /^qconfig.*/ or !/^q/ } keys %diff; +print "Check if any of the following headers should be added to $l:\n\n"; +print join "\n", keys %diff, "\n" + + + + + + diff --git a/smoke/kde/kde_header_list b/smoke/kde/kde_header_list new file mode 100644 index 00000000..f5bcbeb6 --- /dev/null +++ b/smoke/kde/kde_header_list @@ -0,0 +1,440 @@ +dcopclient.h +dcopobject.h +dcopref.h +dom/css_rule.h +dom/css_stylesheet.h +dom/css_value.h +dom/dom2_events.h +dom/dom2_range.h +dom/dom2_traversal.h +dom/dom2_views.h +dom/dom_core.h +dom/dom_doc.h +dom/dom_element.h +dom/dom_exception.h +dom/dom_html.h +dom/dom_misc.h +dom/dom_node.h +dom/dom_string.h +dom/dom_text.h +dom/dom_xml.h +dom/html_base.h +dom/html_block.h +dom/html_document.h +dom/html_element.h +dom/html_form.h +dom/html_head.h +dom/html_image.h +dom/html_inline.h +dom/html_list.h +dom/html_misc.h +dom/html_object.h +dom/html_table.h +kaboutapplication.h +kaboutdata.h +kaboutdialog.h +kaboutkde.h +kaccelgen.h +kaccel.h +kaccelmanager.h +kactionclasses.h +kactioncollection.h +kaction.h +kactionshortcutlist.h +kactivelabel.h +kallocator.h +kanimwidget.h +kapp.h +kapplication.h +karchive.h +kar.h +karrowbutton.h +kasyncio.h +kaudioplayer.h +kauthicon.h +kautomount.h +kbookmarkbar.h +kbookmarkdombuilder.h +kbookmarkdrag.h +kbookmarkexporter.h +kbookmark.h +kbookmarkimporter_crash.h +kbookmarkimporter.h +kbookmarkimporter_ie.h +kbookmarkimporter_kde1.h +kbookmarkimporter_ns.h +kbookmarkimporter_opera.h +kbookmarkmanager.h +kbookmarkmenu.h +kbookmarknotifier.h +kbufferedio.h +kbugreport.h +kbuttonbox.h +kcalendarsystemfactory.h +kcalendarsystem.h +kcatalogue.h +kcharselect.h +kcharsets.h +kclipboard.h +kcmdlineargs.h +kcmenumngr.h +kcmodule.h +kcmoduleinfo.h +kcmoduleloader.h +kcmultidialog.h +kcolorbtn.h +kcolorbutton.h +kcolorcombo.h +kcolordialog.h +kcolordlg.h +kcolordrag.h +kcombiview.h +kcombobox.h +kcommand.h +kcompletionbox.h +kcompletion.h +kconfigdialog.h +kconfigskeleton.h +kconfigbackend.h +kconfigbase.h +kconfigdata.h +kconfig.h +kcpuinfo.h +kcrash.h +kcursor.h +kcustommenueditor.h +kdatastream.h +kdatatool.h +kdatepicker.h +kdatepik.h +kdatetbl.h +kdatetimewidget.h +kdatewidget.h +kdcopactionproxy.h +kdcoppropertyproxy.h +kdcopservicestarter.h +kdebugclasses.h +kdebug.h +kdedmodule.h +kdesktopfile.h +kde_terminal_interface.h +kdeversion.h +kdialogbase.h +kdialog.h +kdirlister.h +kdirnotify.h +kdirnotify_stub.h +kdiroperator.h +kdirselectdialog.h +kdirsize.h +kdirwatch.h +kdiskfreesp.h +kdockwidget.h +kdockwindow.h +kdrawutil.h +kdualcolorbtn.h +kdualcolorbutton.h +keditcl.h +keditlistbox.h +kedittoolbar.h +kemailsettings.h +kextendedsocket.h +kextsock.h +kfiledetailview.h +kfiledialog.h +kfilefiltercombo.h +kfilefilter.h +kfile.h +kfileiconview.h +kfileitem.h +kfilemetainfo.h +kfilepreview.h +kfilesharedlg.h +kfileshare.h +kfiletreebranch.h +kfiletreeview.h +kfiletreeviewitem.h +kfileview.h +kfilterbase.h +kfilterdev.h +kfinddialog.h +kfind.h +kfontcombo.h +kfontdialog.h +kfontrequester.h +kgenericfactory.h +kglobalaccel.h +kglobal.h +kglobalsettings.h +kguiitem.h +khelpmenu.h +khtmldefaults.h +khtml_events.h +khtml_part.h +khtml_settings.h +khtmlview.h +kicondialog.h +kiconeffect.h +kiconloader.h +kicontheme.h +kiconview.h +kiconviewsearchline.h +kidna.h +kimageeffect.h +kimagefilepreview.h +kimageio.h +kinputdialog.h +kinstance.h +kipc.h +kjanuswidget.h +kkeybutton.h +kkeydialog.h +kkeynative.h +klargefile.h +kled.h +klibloader.h +klineeditdlg.h +klineedit.h +klistbox.h +klistview.h +klistviewsearchline.h +klocale.h +kmacroexpander.h +kmainwindow.h +kmainwindowiface.h +kmanagerselection.h +kmdcodec.h +kmdichildarea.h +kmdichildfrmcaption.h +kmdichildfrm.h +kmdichildview.h +kmdidefines.h +kmdiiterator.h +kmdilistiterator.h +kmdimainfrm.h +kmdinulliterator.h +kmditaskbar.h +kmditoolviewaccessor.h +kmenubar.h +kmessagebox.h +kmimemagic.h +kmimesourcefactory.h +kmimetype.h +kmimetyperesolver.h +kmountpoint.h +kmultipledrag.h +kmultitabbar.h +knotifyclient.h +knotifydialog.h +knuminput.h +knumvalidator.h +kopenssl.h +kopenwith.h +kpalette.h +kpanelapplet.h +kpanelappmenu.h +kpanelextension.h +kpanelmenu.h +kpassdlg.h +kpassivepopup.h +kpixmapeffect.h +kpixmap.h +kpixmapio.h +kpixmapprovider.h +kpixmapsplitter.h +kpluginselector.h +kplugininfo.h +kpopupmenu.h +kpreferencesdialog.h +kpreferencesmodule.h +kpreviewwidgetbase.h +kprintaction.h +kprinter.h +kdeprint/kpreloadobject.h +kprocctrl.h +kprocess.h +kprocio.h +kprogress.h +kpropertiesdialog.h +kpropsdlg.h +kprotocolinfo.h +kprotocolmanager.h +kpty.h +kpushbutton.h +krandomsequence.h +krecentdocument.h +kregexpeditorinterface.h +kregexp.h +kreplacedialog.h +kreplace.h +krestrictedline.h +krfcdate.h +krootpixmap.h +krootprop.h +kruler.h +krun.h +ksavefile.h +kscan.h +ksconfig.h +kscreensaver.h +kscreensaver_vroot.h +kselect.h +kseparator.h +kservicegroup.h +kservice.h +kservicetype.h +ksharedpixmap.h +ksharedptr.h +kshellcompletion.h +kshell.h +kshortcut.h +kshortcutlist.h +kshred.h +ksimpleconfig.h +ksmimecrypto.h +ksockaddr.h +ksock.h +ksocks.h +ksortablevaluelist.h +kspelldlg.h +kspell.h +ksqueezedtextlabel.h +ksslall.h +ksslcertchain.h +ksslcertdlg.h +ksslcertificatecache.h +ksslcertificatefactory.h +ksslcertificate.h +ksslcertificatehome.h +ksslconfig.h +ksslconnectioninfo.h +kssl.h +ksslinfodlg.h +ksslkeygen.h +ksslpeerinfo.h +ksslpemcallback.h +ksslpkcs12.h +ksslpkcs7.h +ksslsession.h +ksslsettings.h +ksslsigners.h +ksslutils.h +ksslx509map.h +ksslx509v3.h +kstandarddirs.h +kstartupinfo.h +kstaticdeleter.h +kstatusbar.h +kstdaccel.h +kstdaction.h +kstddirs.h +kstdguiitem.h +kstringhandler.h +kstringvalidator.h +kstyle.h +ksycocaentry.h +ksycoca.h +ksycocatype.h +ksyntaxhighlighter.h +ksystemtray.h +ktabbar.h +ktabctl.h +ktabwidget.h +ktar.h +ktempdir.h +ktempfile.h +ktextbrowser.h +ktextedit.h +ktimewidget.h +ktip.h +ktoolbarbutton.h +ktoolbar.h +ktoolbarradiogroup.h +ktrader.h +ktypelist.h +kuniqueapp.h +kuniqueapplication.h +kunload.h +kurifilter.h +kurlbar.h +kurlcombobox.h +kurlcompletion.h +kurldrag.h +kurl.h +kurllabel.h +kurlpixmapprovider.h +kurlrequesterdlg.h +kurlrequester.h +kuserprofile.h +kvmallocator.h +kwindowinfo.h +kwindowlistmenu.h +kwin.h +kwinmodule.h +kwizard.h +kwordwrap.h +kxmessages.h +kxmlguibuilder.h +kxmlguiclient.h +kxmlguifactory.h +kxmlgui.h +kzip.h +kparts/browserextension.h +kparts/browserinterface.h +kparts/browserrun.h +kparts/componentfactory.h +kparts/dockmainwindow.h +kparts/event.h +kparts/factory.h +kparts/genericfactory.h +kparts/historyprovider.h +kparts/mainwindow.h +kparts/part.h +kparts/partmanager.h +kparts/plugin.h +kparts/pluginselectormodule.h +kparts/statusbarextension.h +kio/authinfo.h +kio/chmodjob.h +kio/connection.h +kio/davjob.h +kio/defaultprogress.h +kio/file.h +kio/global.h +kio/http.h +kio/http_slave_defaults.h +kio/ioslave_defaults.h +kio/jobclasses.h +kio/job.h +kio/kdesasl.h +kio/kmdbase.h +kio/kmdcodec.h +kio/kpac.h +kio/metainfojob.h +kio/netaccess.h +kio/observer.h +kio/passdlg.h +kio/paste.h +kio/previewjob.h +kio/progressbase.h +kio/renamedlg.h +kio/scheduler.h +kio/sessiondata.h +kio/skipdlg.h +kio/slavebase.h +kio/slaveconfig.h +kio/slave.h +kio/slaveinterface.h +kio/statusbarprogress.h +kio/tcpslavebase.h +kio/thumbcreator.h +kio/uiserver.h +kio/uiserver_stub.h +netwm_def.h +netwm.h +knewstuff/knewstuff.h +knewstuff/knewstuffsecure.h +knewstuff/engine.h +knewstuff/entry.h +knewstuff/provider.h + diff --git a/smoke/kde/qt_smoke.h b/smoke/kde/qt_smoke.h new file mode 100644 index 00000000..22d8d231 --- /dev/null +++ b/smoke/kde/qt_smoke.h @@ -0,0 +1,9 @@ +#ifndef QT_SMOKE_H +#define QT_SMOKE_H + +// Defined in smokedata.cpp, initialized by init_qt_Smoke(), used by all .cpp files +extern Smoke* qt_Smoke; + +class QGlobalSpace { }; + +#endif diff --git a/smoke/kde/qtguess.pl.in b/smoke/kde/qtguess.pl.in new file mode 100644 index 00000000..389129d7 --- /dev/null +++ b/smoke/kde/qtguess.pl.in @@ -0,0 +1,501 @@ +#!/usr/bin/perl + +# qtguess.pl : check how Qt was compiled. Issue a list of all defined QT_NO_* macros, one per line. +# +# author: germain Garand <germain@ebooksfrance.com> +# licence: GPL v.2 + +# options: -q: be quieter +# -o file: redirect output to "file". (default: ./qtdefines) +# -t [0..15]: set the testing threshold (see below) +# -f "flags": additional compiler flags/parameters + +use Getopt::Std; + +use vars qw/$opt_f $opt_o $opt_p/; + +getopts('qo:f:t:'); + +# Threshold : +# 0 - test basic Qt types/classes +# 5 - test higher level, non-gui classes +# 8 - test options of the above (ex: QT_NO_IMAGE_SMOOTHSCALE) +# 10 - test basic widgets +# 12 - test composite widgets +# 13 - test widgets inheriting composite widgets +# 15 - test goodies (default) + +my $default_threshold = @qt_test_threshold@; +my $cc = "@CXX@"; +my $ccflags = $opt_f || "@CXXFLAGS@"; + +my $nspaces = 50; + +my %qtdefs=(); +my %qtundefs=(); + +my $tmp = gettmpfile(); +my $qtinc = '@qt_includes@'; +my $allinc = '@all_includes@'; +my $alllib = '@all_libraries@'; +my $qtflags ='@LIB_QT@'; +my %x; +$x{'LIBPNG'} = '@LIBPNG@'; +$x{'LIBJPEG'} = '@LIBJPEG@'; +$x{'LIBSM'} = '@LIBSM@'; +$x{'LIBSOCKET'} = '@LIBSOCKET@'; +$x{'LIBDL'} = '@LIBDL@'; +$x{'LIBRESOLV'} = '@LIBRESOLV@'; +$x{'LIB_X11'} = '@LIB_X11@'; +$x{'X_PRE_LIBS'} = '@X_PRE_LIBS@'; +$x{'LIB_X11'} =~ s/\$\((.*?)\)/$x{$1}/g; + +$qtflags =~ s/\$\((.*?)\)/$x{$1}/g; + + -e "$qtinc/qglobal.h" or die "Invalid Qt directory.\n"; + +my $ccmd = "$cc $ccflags $allinc $alllib -o $tmp $tmp.cpp $qtflags"; + +my $threshold = defined($opt_t)?$opt_t : $default_threshold; +$threshold >= 0 or die "invalid testing threshold: $threshold\n"; + +print "Checking how Qt was built... \n"; +print "Threshold is set to $threshold\n" unless $opt_q; + +my($count, $used, $total); +map{ $tests{$_}->[2]>=$threshold ? ($used++, $total++):$total++ } keys %tests; + +print "Number of defines to be tested : $used/$total\n\n" unless $opt_q; +open( QTDEFS, ">".($opt_o || "qtdefines") ) or die "Can't open output file: $!\n"; + +grab_qglobal_symbols(); +preliminary_test(); +perform_all_tests(); + +print +scalar(keys %qtdefs) . " defines found.\n"; + +print QTDEFS join("\n", keys %qtdefs), "\n"; +close; + +#--------------------------------------------------------------# + +sub gettmpfile +{ + my $tmpdir = $ENV{'TMP'} || "."; + my $tmpname = $$."-qtguess"; + while( -e "$tmpdir/$tmpname" || -e "$tmpdir/${tmpname}.cpp" ) + { + $tmpname .= int (rand * 9); + } + return "$tmpdir/$tmpname"; +} + +#--------------------------------------------------------------# + +sub grab_qglobal_symbols +{ + my $cmd = "$cc -E -D__cplusplus -dM -I$qtinc $qtinc/qglobal.h 2>/dev/null"; + my $symbols = `$cmd`; + for(0..1) + { + if( check_exit_status($?) ) + { + while( $symbols =~/^#\s*define\s*(QT_\S+)\s*$/gm ) + { + $qtdefs{$1} = 1; + } + print "Found ". scalar( keys %qtdefs )." predefined symbol".((scalar( keys %qtdefs ) -1)?"s":"")." in qglobal.h\n" unless ($opt_q or !(keys %qtdefs)); + while( $symbols =~/^#\s*define\s*QT_MODULE_(\S+)\s*$/gm ) + { + $qtundefs{"QT_NO_$1"} = 1; + } + print "Found ". scalar( keys %qtundefs )." undefined symbol".((scalar( keys %qtundefs ) -1)?"s":"")." in qglobal.h\n" unless ($opt_q or !(keys %qtundefs)); + last; + } + elsif(! $_) # first try + { + print "Failed to run $cmd.\nTrying without __cplusplus (might be already defined)\n"; + $cmd = "$cc -E -dM -I$qtinc $qtinc/qglobal.h 2>/dev/null"; + $symbols = `$cmd`; + next; + } + } +} + +#--------------------------------------------------------------# + +sub preliminary_test +{ + my $msg = "Trying to compile and link a small program..."; + print $msg, " " x ($nspaces - length($msg) + 8); + open( OUT, ">${tmp}.cpp" ) or die "Failed to open temp file ${tmp}.cpp: $!\n"; + my $simple=q£ + #include <qapplication.h> + int main( int argc, char **argv ) + { + QApplication foo( argc, argv ); + return 0; + } + £; + print OUT $simple; + close OUT; + my $out = `$ccmd 2>&1`; + if( !check_exit_status($?) ) + { + die <<"EOF"; + +FAILED : check your configuration. +Failed program was: +$simple +Compiled with: +$ccmd +Compiler output: +$out +EOF + } + else + { + print "OK\n"; + } +} + +#--------------------------------------------------------------# + +sub perform_all_tests +{ + foreach ( sort { $tests{$a}->[2] <=> $tests{$b}->[2]} keys %tests) + { + $tests{$_}->[2] < $threshold and next; + ($qtdefs{$_} || $qtundefs{$_}) and do + { + print "\rSkipping $_ (in qglobal.h)".( " " x (($nspaces-16) - length($_)) ).($qtundefs{$_}?"*Undefined*":" [Defined]").($opt_q?"":"\n"); + next + }; + print "\rTesting $_".( " " x ($nspaces - length($_)) ); + open( OUT, ">${tmp}.cpp" ) or die "Failed to open temp file ${tmp}.cpp: $!\n"; + foreach $def(keys %qtdefs) + { + print OUT "#define $def\n"; + } + foreach $inc(split /,\s*/, $tests{$_}->[0]) + { + print OUT "#include <$inc>\n"; + } + print OUT "#include <qfeatures.h>\n"; + print OUT $tests{$_}->[3] if $tests{$_}->[3]; # need to define some classes ? + print OUT qq£ + + int main( int argc, char **argv ) + { + $tests{$_}->[1] + return 0; + } + £; + close OUT; + + my $out = `$ccmd 2>&1`; + + my $ok = check_exit_status($?); + if( !$ok ) + { + $qtdefs{$_} = 1; + } + print +$opt_q ? ++$count."/$used" : ( $ok ? "*Undefined*\n" : " [Defined]\n" ); + } + $opt_q && print "\n"; +} + +#--------------------------------------------------------------# + +sub check_exit_status +{ + my $a = 0xFFFF & shift; + if( !$a ) + { + return 1; + } + elsif( $a == 0xFF00 ) + { + die "\nSystem call failed: $!\n"; + } + elsif( $a > 0x80 ) + { + # non-zero status. + } + else + { + if( $a & 0x80 ) + { + die "\n$cc coredumped with signal ". ($a & ~0x80); + } + die "\n$cc interrupted by signal $a\n"; + } + return 0; +} + +#--------------------------------------------------------------# + +END +{ + unlink $tmp if -e $tmp; + unlink "${tmp}.cpp" if -e "${tmp}.cpp"; +} + +#--------------------------------------------------------------# + +BEGIN { + +# "DEFINE" => ["header-1.h,... header-n.h", "main() code", priority, "Definitions (if needed)"] + +our %tests = ( + "QT_NO_ACCEL" => ["qaccel.h", "QAccel foo( (QWidget*)NULL );", 5], + "QT_NO_ACTION" => ["qaction.h", "QAction foo( (QObject*)NULL );", 5], + "QT_NO_ASYNC_IO" => ["qasyncio.h", "QAsyncIO foo();", 5], + "QT_NO_ASYNC_IMAGE_IO"=> ["qasyncimageio.h", "QImageDecoder foo( (QImageConsumer*) NULL );", 5], + "QT_NO_BIG_CODECS" => ["qbig5codec.h", "QBig5Codec foo();", 5], + "QT_NO_BUTTON" => ["qbutton.h", "QButton foo( (QWidget*)NULL );", 10], + "QT_NO_BUTTONGROUP" => ["qbuttongroup.h", "QButtonGroup foo( (QWidget*)NULL );", 12], + "QT_NO_CANVAS" => ["qcanvas.h", "QCanvas foo( (QObject*)NULL );", 10], + "QT_NO_CHECKBOX" => ["qcheckbox.h", "QCheckBox( (QWidget*)NULL );", 10], + "QT_NO_CLIPBOARD" => ["qapplication.h, qclipboard.h", q£ + QApplication foo( argc, argv ); + QClipboard *baz= foo.clipboard(); + £, 5], + "QT_NO_COLORDIALOG" => ["qcolordialog.h", "QColorDialog::customCount();", 12], + "QT_NO_COMBOBOX" => ["qcombobox.h", "QComboBox( (QWidget*)NULL );", 10], + "QT_NO_COMPAT" => ["qfontmetrics.h", q£ + QFontMetrics *foo= new QFontMetrics( QFont() ); + int bar = foo->width( 'c' ); + £, 0], + "QT_NO_COMPONENT" => ["qapplication.h", q£ + QApplication foo( argc, argv ); + foo.addLibraryPath( QString::null ); + £, 5], + "QT_NO_CURSOR" => ["qcursor.h", "QCursor foo;", 5], + "QT_NO_DATASTREAM" => ["qdatastream.h", "QDataStream foo;", 5], + "QT_NO_DATETIMEEDIT" => ["qdatetimeedit.h", "QTimeEdit foo;", 12], + "QT_NO_DIAL" => ["qdial.h", "QDial foo;", 10], + "QT_NO_DIALOG" => ["qdialog.h", "QDialog foo;", 12], + "QT_NO_DIR" => ["qdir.h", "QDir foo;", 5], + "QT_NO_DNS" => ["qdns.h", "QDns foo;", 5], + "QT_NO_DOM" => ["qdom.h", "QDomDocumentType foo;", 5], + "QT_NO_DRAGANDDROP" => ["qevent.h", "QDropEvent foo( QPoint(1,1) );", 5], + "QT_NO_DRAWUTIL" => ["qdrawutil.h, qcolor.h", "qDrawPlainRect( (QPainter *) NULL, 0, 0, 0, 0, QColor() );", 10], + "QT_NO_ERRORMESSAGE" => ["qerrormessage.h", "QErrorMessage foo( (QWidget*) NULL );", 13], + "QT_NO_FILEDIALOG" => ["qfiledialog.h", "QFileIconProvider foo;", 13], + + "QT_NO_FONTDATABASE" => ["qfontdatabase.h", "QFontDatabase foo;", 5], + "QT_NO_FONTDIALOG" => ["qfontdialog.h", "QFontDialog::getFont( (bool *)NULL );", 12], + "QT_NO_FRAME" => ["qframe.h", "QFrame foo;", 10], + "QT_NO_GRID" => ["qgrid.h", "QGrid foo(5);", 12], + "QT_NO_GRIDVIEW" => ["qgridview.h", "QFoo foo;", 13, q£ + class QFoo: public QGridView + { + public: + QFoo(){}; + ~QFoo(){}; + void paintCell(QPainter *, int, int){}; + }; + £], + "QT_NO_GROUPBOX" => ["qgroupbox.h", "QGroupBox foo;", 12], + "QT_NO_HBOX" => ["qhbox.h", "QHBox foo;", 12], + "QT_NO_HBUTTONGROUP" => ["qhbuttongroup.h", "QHButtonGroup foo;", 13], + "QT_NO_HEADER" => ["qheader.h", "QHeader foo;", 10], + "QT_NO_HGROUPBOX" => ["qhgroupbox.h", "QHGroupBox foo;", 13], + "QT_NO_ICONSET" => ["qiconset.h", "QIconSet foo;", 8], + + "QT_NO_ICONVIEW" => ["qiconview.h", "QIconView foo;", 13], + "QT_NO_IMAGEFORMATPLUGIN" => ["qimageformatplugin.h, qstringlist.h", "QFoo foo;", 5, q£ + + class QFoo: public QImageFormatPlugin + { + public: + QFoo() {}; + ~QFoo() {}; + QStringList keys() const { return QStringList(); }; + bool installIOHandler( const QString &format ) { return true; }; + }; + Q_EXPORT_PLUGIN( QFoo ) + £], + "QT_NO_IMAGE_DITHER_TO_1" => ["qimage.h", q£ + QImage *foo = new QImage; + foo->createAlphaMask(); + £, 8], + "QT_NO_IMAGE_HEURISTIC_MASK" => ["qimage.h", q£ + QImage *foo = new QImage; + foo->createHeuristicMask(); + £, 8], + "QT_NO_IMAGE_MIRROR" => ["qimage.h", q£ + QImage *foo = new QImage; + foo->mirror(); + £, 8], + "QT_NO_IMAGE_SMOOTHSCALE" => ["qimage.h", q£ + QImage *foo = new QImage; + foo->smoothScale( 10, 10); + £, 8], + "QT_NO_IMAGE_TEXT" => ["qimage.h", "QImageTextKeyLang foo;", 8], + "QT_NO_IMAGE_TRANSFORMATION" => ["qimage.h", q£ + QImage *foo = new QImage; + foo->scale( 10, 10); + £, 8], + "QT_NO_IMAGE_TRUECOLOR" => ["qimage.h", q£ + QImage *foo = new QImage; + foo->convertDepthWithPalette( 1, (QRgb*) NULL, 1 ); + £, 8], + "QT_NO_INPUTDIALOG" => ["qinputdialog.h, qstring.h", q£QInputDialog::getText( QString::null, QString::null);£, 13], + "QT_NO_IMAGEIO" => ["qbitmap.h, qstring.h", q£ + QBitmap foo( QString::fromLatin1("foobar") ); + £, 5], + "QT_NO_IMAGEIO_JPEG" => ["qjpegio.h", "qInitJpegIO();", 8], + "QT_NO_IMAGEIO_MNG" => ["qmngio.h", "qInitMngIO();", 8], + "QT_NO_IMAGEIO_PNG" => ["qpngio.h", "qInitPngIO();", 8], + "QT_NO_LABEL" => ["qlabel.h", "QLabel foo( (QWidget*) NULL );", 10], + "QT_NO_LAYOUT" => ["qlayout.h", "QFoo foo;", 10, q£ + + class QFoo: public QLayout + { + public: + QFoo() {}; + ~QFoo() {}; + void addItem( QLayoutItem * ) { }; + QSize sizeHint() const { return QSize(); } + QLayoutIterator iterator() { return QLayoutIterator( (QGLayoutIterator *) NULL ); }; + void setGeometry( const QRect & ) { }; + }; + £], + "QT_NO_LCDNUMBER" => ["qlcdnumber.h", "QLCDNumber foo;", 12], + "QT_NO_LINEEDIT" => ["qlineedit.h", "QLineEdit foo( (QWidget *) NULL );", 12], + "QT_NO_LISTBOX" => ["qlistbox.h", "QListBox foo;", 13], + "QT_NO_LISTVIEW" => ["qlistview.h", "QListView foo;", 13], + "QT_NO_MAINWINDOW" => ["qmainwindow.h", "QMainWindow foo;", 13], + "QT_NO_MENUBAR" => ["qmenubar.h", "QMenuBar foo;", 13], + "QT_NO_MOVIE" => ["qmovie.h", "QMovie foo;", 5], + "QT_NO_MENUDATA" => ["qmenudata.h", "QMenuData foo;", 9], + "QT_NO_MESSAGEBOX" => ["qmessagebox.h", "QMessageBox foo;", 13], + "QT_NO_MIME" => ["qmime.h", "QMimeSourceFactory foo;", 5], + "QT_NO_MIMECLIPBOARD" => ["qapplication.h, qclipboard.h", q£ + QApplication foo( argc, argv ); + QClipboard *baz= foo.clipboard(); + baz->data(); + £, 8], + + "QT_NO_MULTILINEEDIT" => ["qmultilineedit.h", "QMultiLineEdit foo;", 14], + "QT_NO_NETWORK" => ["qnetwork.h", "qInitNetworkProtocols();", 5], + "QT_NO_NETWORKPROTOCOL" => ["qnetworkprotocol.h", "QNetworkProtocol foo;", 8], + "QT_NO_NETWORKPROTOCOL_FTP" => ["qftp.h", "QFtp foo;", 9], + "QT_NO_PALETTE" => ["qpalette.h", "QColorGroup foo;", 5], + "QT_NO_PICTURE" => ["qpicture.h", "QPicture foo;", 5], + "QT_NO_PIXMAP_TRANSFORMATION" =>["qbitmap.h, qwmatrix.h", q£ + QBitmap *foo= new QBitmap(); + QWMatrix bar; + foo->xForm( bar ); + £, 5], + "QT_NO_POPUPMENU" => ["qpopupmenu.h", "QPopupMenu foo;", 12], + "QT_NO_PRINTER" => ["qprinter.h", "QPrinter foo;", 5], + "QT_NO_PRINTDIALOG" => ["qprintdialog.h", "QPrintDialog foo( (QPrinter*) NULL );", 13], + "QT_NO_PROCESS" => ["qprocess.h", "QProcess foo;", 5], + "QT_NO_PROGRESSBAR" => ["qprogressbar.h", "QProgressBar foo;", 12], + "QT_NO_PROGRESSDIALOG" => ["qprogressdialog.h", "QProgressDialog foo;", 13], + "QT_NO_PUSHBUTTON" => ["qpushbutton.h", "QPushButton foo( (QWidget *) NULL );", 12], + "QT_NO_PROPERTIES" => ["qmetaobject.h", "QMetaProperty foo;", 0], +# "QT_NO_QTMULTILINEEDIT" => ["qtmultilineedit.h", "QtMultiLineEdit foo;", 15], +# "QT_NO_QTTABLEVIEW" => ["qttableview.h", "QFoo foo;", 16, q£ +# class QFoo: public QtTableView +# { +# public: +# QFoo() {}; +# ~QFoo() {}; +# void paintCell( QPainter *, int, int) {}; +# }; +# £], + "QT_NO_QUUID_STRING" => ["quuid.h", "QUuid foo( QString::null );", 8], + "QT_NO_RANGECONTROL" => ["qrangecontrol.h", "QRangeControl foo;", 10], + "QT_NO_REGEXP" => ["qregexp.h", "QRegExp foo;", 5], + "QT_NO_REGEXP_WILDCARD" => ["qregexp.h", q£ + QRegExp foo; + foo.wildcard(); + £, 8], + "QT_NO_REMOTE" => ["qapplication.h", q£ + QApplication foo( argc, argv ); + foo.remoteControlEnabled(); + £, 15], + "QT_NO_RADIOBUTTON" => ["qradiobutton.h", "QRadioButton foo( (QWidget *) NULL );", 12], + "QT_NO_RICHTEXT" => ["qsimplerichtext.h, qstring.h, qfont.h", "QSimpleRichText foo( QString::null, QFont() );", 10], + "QT_NO_SCROLLBAR" => ["qscrollbar.h", "QScrollBar foo( (QWidget *) NULL );", 12], + "QT_NO_SCROLLVIEW" => ["qscrollview.h", "QScrollView foo;", 12], + "QT_NO_SEMIMODAL" => ["qsemimodal.h", "QSemiModal foo;", 10], + "QT_NO_SESSIONMANAGER" => ["qapplication.h", q£ + QApplication foo( argc, argv ); + foo.sessionId(); + £, 15], + "QT_NO_SETTINGS" => ["qsettings.h", "QSettings foo;", 5], + "QT_NO_SIGNALMAPPER" => ["qsignalmapper.h", "QSignalMapper foo( (QObject *) NULL );", 0], + "QT_NO_SIZEGRIP" => ["qsizegrip.h", "QSizeGrip foo( (QWidget *) NULL );", 10], + "QT_NO_SLIDER" => ["qslider.h", "QSlider foo( (QWidget *) NULL );", 12], + "QT_NO_SOUND" => ["qsound.h", "QSound foo( QString::null );", 5], + + + "QT_NO_SPINWIDGET" => ["qrangecontrol.h", "QSpinWidget foo;", 10], + "QT_NO_SPRINTF" => ["qcolor.h", q£ + QColor foo; + foo.name(); + £, 0], + + + + "QT_NO_SQL" => ["qsqlcursor.h", "QSqlCursor foo;", 5], + "QT_NO_STRINGLIST" => ["qstringlist.h", "QStringList foo;", 0], + "QT_NO_STYLE" => ["qapplication.h", q£ + QApplication foo( argc, argv ); + foo.style(); + £, 15], + +# "QT_NO_STYLE_CDE" => ["qcdestyle.h", "QCDEStyle foo;", 16], +# "QT_NO_STYLE_COMPACT" => ["qcompactstyle.h", "QCompactStyle foo;", 16], +# "QT_NO_STYLE_INTERLACE" => ["qinterlacestyle.h", "QInterlaceStyle foo;", 16], +# "QT_NO_STYLE_PLATINUM" => ["qplatinumstyle.h", "QPlatinumStyle foo;", 16], +# "QT_NO_STYLE_MOTIF" => ["qmotifstyle.h", "QMotifStyle foo;", 16], +# "QT_NO_STYLE_MOTIFPLUS" => ["qmotifplusstyle.h", "QMotifPlusStyle foo;", 16], +# "QT_NO_STYLE_SGI" => ["qsgistyle.h", "QSGIStyle foo;", 16], +# "QT_NO_STYLE_WINDOWS" => ["qwindowsstyle.h", "QWindowsStyle foo;", 16], + "QT_NO_TABBAR" => ["qtabbar.h", "QTabBar foo;", 10], + "QT_NO_TABDIALOG" => ["qtabdialog.h", "QTabDialog foo;", 12], + "QT_NO_TABLE" => ["qtable.h", "QTable foo;", 10], + "QT_NO_TABWIDGET" => ["qtabwidget.h", "QTabWidget foo;", 10], + "QT_NO_TEXTBROWSER" => ["qtextbrowser.h", "QTextBrowser foo;", 14], + "QT_NO_TEXTCODEC" => ["qtextcodec.h", "QTextCodec::codecForIndex(1);", 5], + "QT_NO_TEXTCODECPLUGIN" => ["qtextcodecplugin.h, qstringlist.h, qvaluelist.h, qtextcodec.h", "QFoo foo;", 6, q£ + + class QFoo: public QTextCodecPlugin + { + public: + QFoo() {}; + ~QFoo() {}; + QStringList names() const {return QStringList();} + QValueList<int>mibEnums() const {return QValueList<int>();} + QTextCodec *createForName( const QString & name ) {return (QTextCodec *)NULL;} + QTextCodec *createForMib( int mib ) {return (QTextCodec *)NULL;} + }; + Q_EXPORT_PLUGIN( QFoo ) + £], + "QT_NO_TEXTEDIT" => ["qtextedit.h", "QTextEdit foo;", 13], + "QT_NO_TEXTSTREAM" => ["qtextstream.h", "QTextStream foo;", 5], + "QT_NO_TEXTVIEW" => ["qtextview.h", "QTextView foo;", 14], #Obsolete + "QT_NO_TOOLBAR" => ["qtoolbar.h", "QToolBar foo;", 10], + "QT_NO_TOOLBUTTON" => ["qtoolbutton.h", "QToolButton foo((QWidget *) NULL );", 12], + "QT_NO_TOOLTIP" => ["qtooltip.h", "QToolTip::hide();", 10], + + "QT_NO_TRANSFORMATIONS" => ["qpainter.h", q£ + QPainter *foo= new QPainter(); + foo->setViewXForm( true );£, 5], + "QT_NO_VARIANT" => ["qvariant.h", "QVariant foo;", 0], + "QT_NO_WHATSTHIS" => ["qwhatsthis.h", "QWhatsThis::inWhatsThisMode();", 10], + "QT_NO_WHEELEVENT" => ["qevent.h", "QWheelEvent foo( QPoint(1,1), 1, 1 );", 5], + "QT_NO_WIDGET_TOPEXTRA" => ["qwidget.h", "QWidget foo; foo.caption();", 9], + "QT_NO_WIDGETSTACK" => ["qwidgetstack.h", "QWidgetStack foo;", 13], + "QT_NO_WIZARD" => ["qwizard.h", "QWizard foo;", 13], + "QT_NO_WMATRIX" => ["qwmatrix.h", "QWMatrix foo;", 0], + "QT_NO_XML" => ["qxml.h", "QXmlNamespaceSupport foo;", 5], + ); + +} diff --git a/smoke/qt/Makefile.am b/smoke/qt/Makefile.am new file mode 100644 index 00000000..343f7704 --- /dev/null +++ b/smoke/qt/Makefile.am @@ -0,0 +1,24 @@ +lib_LTLIBRARIES = libsmokeqt.la + +# set the include path for X, qt and KDE +INCLUDES = -I$(srcdir)/.. $(all_includes) + +EXTRA_DIST=generate.pl.in qtguess.pl.in qt_smoke.h Makefile.am + +# the library search path. +libsmokeqt_la_LDFLAGS = -version-info 3:2:2 -no-undefined $(all_libraries) $(GLINC) + +# the libraries to link against. +libsmokeqt_la_LIBADD = $(LIB_QT) $(GLLIB) $(LIBQSCINTILLA) + +x_sources = x_1.cpp x_2.cpp x_3.cpp x_4.cpp x_5.cpp x_6.cpp x_7.cpp \ + x_8.cpp x_9.cpp x_10.cpp x_11.cpp x_12.cpp x_13.cpp x_14.cpp x_15.cpp \ + x_16.cpp x_17.cpp x_18.cpp x_19.cpp x_20.cpp + +# which sources should be compiled for perlqtkde +libsmokeqt_la_SOURCES = $(x_sources) smokedata.cpp + +$(x_sources) smokedata.cpp: + perl generate.pl + +CLEANFILES = $(libsmokeqt_la_SOURCES) diff --git a/smoke/qt/configure.in.in b/smoke/qt/configure.in.in new file mode 100644 index 00000000..688e3c81 --- /dev/null +++ b/smoke/qt/configure.in.in @@ -0,0 +1,82 @@ + +AC_HAVE_GL +KDE_HAVE_GL=yes; +if test "X$GLLIB" = "X"; then + KDE_HAVE_GL=no +fi + +AC_SUBST(KDE_HAVE_GL) + +AC_ARG_WITH( + threshold, + [ --with-threshold@<:@=0..15@:>@ Smoke: Qt tests threshold Default:15 Lower=more tests], + [ qt_test_threshold="$withval" ], + [ qt_test_threshold=15 ] +) +AC_SUBST(qt_test_threshold) + +if test "X$kde_build_libsmoke" = "Xqt" -o "X$kde_build_libsmoke" = "Xqt kde"; then + + AC_CONFIG_FILES([ smoke/qt/qtguess.pl ], [ + cd smoke/qt + perl qtguess.pl + cd ../.. + ]) + AC_CONFIG_FILES([ smoke/qt/generate.pl ], [ + ]) +fi + +dnl ------- +dnl Test for libqscintilla (QScintilla support) +dnl ------- + +AC_ARG_ENABLE( + qscintilla, + [ --enable-qscintilla@<:@=yes|no@:>@ Smoke: build Smoke with QScintilla extention for qt @<:@default:no@:>@], + [ qtextscintilla="$enableval" ], + [ qtextscintilla="no" ] +) +AC_SUBST(qtextscintilla) + +AC_DEFUN([AC_FIND_QSCINTILLA], +[ +AC_MSG_CHECKING([for libqscintilla]) +AC_CACHE_VAL(ac_cv_lib_qscintilla, +[ + kde_ldflags_save="$LDFLAGS" + kde_libs_save="$LIBS" + kde_cxxflags_save="$CXXFLAGS" + + LIBS="-lqscintilla $LIBQT $LIBS" + CXXFLAGS="$CXXFLAGS $all_includes" + LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS" + +AC_TRY_LINK([ + #include <qextscintillabase.h> +], +[ + QextScintillaBase s; +], + eval "ac_cv_lib_qscintilla='-lqscintilla'", + eval "ac_cv_lib_qscintilla=no") + + LDFLAGS=$kde_ldflags_save + LIBS=$kde_libs_save + CXXFLAGS=$kde_cxxflags_save +]) + +if test ! "$ac_cv_lib_qscintilla" = no; then + AC_DEFINE_UNQUOTED(HAVE_LIBQSCINTILLA, 1, [Define if you have libqscintilla]) + LIBQSCINTILLA="$ac_cv_lib_qscintilla" + AC_MSG_RESULT($ac_cv_lib_qscintilla) +else + AC_MSG_ERROR(not found. + Check your installation and look into config.log) + LIBQSCINTILLA="" +fi +AC_SUBST(LIBQSCINTILLA) +]) + +if test "X$qtextscintilla" = "Xyes" ; then + AC_FIND_QSCINTILLA +fi diff --git a/smoke/qt/generate.pl.in b/smoke/qt/generate.pl.in new file mode 100644 index 00000000..82d8e5ee --- /dev/null +++ b/smoke/qt/generate.pl.in @@ -0,0 +1,178 @@ +#!/usr/bin/perl -w + +## Run this first, to generate the x_*.cpp files from the Qt headers +## using kalyptus + +my $kalyptusdir = "../../kalyptus"; + +use File::Basename; +use File::Copy qw|cp|; +use File::Compare; +use Cwd; + +my $here = getcwd; +my $outdir = $here . "/generate.pl.tmpdir"; +my $finaloutdir = $here; +my $defines = "qtdefines"; +my $headerlist = "@srcdir@/header_list"; +my $definespath = "$here/$defines"; +my $headerlistpath = "$here/$headerlist"; +my $qscintilla_headerlist = ""; +my $qscintilla_headerlistpath = ""; + +if("@qtextscintilla@" eq "yes") +{ + $qscintilla_headerlist = "./qscintilla_header_list"; + $qscintilla_headerlistpath = "$here/$qscintilla_headerlist"; +} + +## If srcdir != builddir, use headerlist from src +$headerlistpath = $headerlist if ($headerlist =~ /^\//); +if("@qtextscintilla@" eq "yes") +{ + $qscintilla_headerlistpath = $qscintilla_headerlist if ($qscintilla_headerlist =~ /^\//); +} +## Note: outdir and finaloutdir should NOT be the same dir! + +# Delete all x_*.cpp files under outdir (or create outdir if nonexistent) +if (-d $outdir) { system "rm -f $outdir/x_*.cpp"; } else { mkdir $outdir; } + +mkdir $finaloutdir unless (-d $finaloutdir); + +# Load the QT_NO_* macros found in "qtdefines". They'll be passed to kalyptus +my $macros=""; +if ( -e $definespath ){ + print "Found '$defines'. Reading preprocessor symbols from there...\n"; + $macros = " --defines=$definespath "; +} + +mkdir $kalyptusdir, 0777; +# Need to cd to kalyptus's directory so that perl finds Ast.pm etc. +chdir "$kalyptusdir" or die "Couldn't go to $kalyptusdir (edit script to change dir)\n"; + +# Find out which header files we need to parse +# We don't want all of them - e.g. not template-based stuff +my %excludes = ( + 'qaccessible.h' => 1, # Accessibility support is not compiled by defaut + 'qassistantclient.h' => 1, # Not part of Qt (introduced in Qt-3.1) + 'qmotif.h' => 1, # + 'qmotifwidget.h' => 1, # Motif extension (introduced in Qt-3.1) + 'qmotifdialog.h' => 1, # + 'qxt.h' => 1, # Xt + 'qxtwidget.h' => 1, # Xt + 'qdns.h' => 1, # internal + 'qgl.h' => 1, # OpenGL + 'qglcolormap.h' => 1, # OpenGL + 'qnp.h' => 1, # NSPlugin + 'qttableview.h' => 1, # Not in Qt anymore... + 'qtmultilineedit.h' => 1, # Not in Qt anymore... + 'qwidgetfactory.h' => 1, # Just an interface + 'qsharedmemory.h' => 1, # "not part of the Qt API" they say + 'qwindowsstyle.h' => 1, # Qt windowsstyle, plugin + 'qmotifstyle.h' => 1, + 'qcompactstyle.h' => 1, + 'qinterlacestyle.h' => 1, + 'qmotifplusstyle.h' => 1, + 'qsgistyle.h' => 1, + 'qplatinumstyle.h' => 1, + 'qcdestyle.h' => 1, + 'qworkspace.h' => 1, + 'qwindowsxpstyle.h' => 1 # play on the safe side +); + +# Some systems have a QTDIR = KDEDIR = PREFIX +# We need a complete list + +my %includes; +open(HEADERS, $headerlistpath) or die "Couldn't open $headerlistpath: $!\n"; +map { chomp ; $includes{$_} = 1 } <HEADERS>; +close HEADERS; + +if("@qtextscintilla@" eq "yes") +{ + open(HEADERS, $qscintilla_headerlistpath) or die "Couldn't open $qscintilla_headerlistpath: $!\n"; + map { chomp ; $includes{$_} = 1 } <HEADERS>; + close HEADERS; +} + +# Can we compile the OpenGl module ? +if("@KDE_HAVE_GL@" eq "yes") +{ + open(DEFS, $definespath); + my @defs = <DEFS>; + close DEFS; + if(!grep(/QT_NO_OPENGL/, @defs)) + { + $excludes{'qgl.h'} = undef; + $excludes{'qglcolormap.h'} = undef; + } + else + { + print STDERR "Qt was not compiled with OpenGL support...\n Skipping QGL Classes.\n"; + } +} + +# List Qt headers, and exclude the ones listed above +my @headers = (); + +$qtinc= '@qt_includes@'; +opendir (QT, $qtinc) or die "Couldn't find $qtinc"; +foreach $filename (readdir(QT)) { + $entry = $qtinc."/".$filename; + if ( ( -e $entry or -l $entry ) # A real file or a symlink + && ( ! -d _ ) ) # Not a symlink to a dir though + { + push(@headers, $entry) + if ( !defined $excludes{$filename} # Not excluded + && $includes{$filename} # Known header + && $filename =~ /\.h$/ ); # Not a backup file etc. Only headers. + undef $includes{$filename} + } +} +closedir QT; + +# Launch kalyptus +chdir "../smoke/qt"; +system "perl -I@top_srcdir@/kalyptus @top_srcdir@/kalyptus/kalyptus @ARGV --globspace -fsmoke --name=qt $macros --no-cache --outputdir=$outdir @headers"; +my $exit = $? >> 8; +exit $exit if ($exit); +chdir "$kalyptusdir"; + +# Generate diff for smokedata.cpp +unless ( -e "$finaloutdir/smokedata.cpp" ) { + open( TOUCH, ">$finaloutdir/smokedata.cpp"); + close TOUCH; +} +system "diff -u $finaloutdir/smokedata.cpp $outdir/smokedata.cpp > $outdir/smokedata.cpp.diff"; + +# Copy changed or new files to finaloutdir +opendir (OUT, $outdir) or die "Couldn't opendir $outdir"; +foreach $filename (readdir(OUT)) { + next if ( -d "$outdir/$filename" ); # only files, not dirs + my $docopy = 1; + if ( -f "$finaloutdir/$filename" ) { + $docopy = compare("$outdir/$filename", "$finaloutdir/$filename"); # 1 if files are differents + } + if ($docopy) { + #print STDERR "Updating $filename...\n"; + cp("$outdir/$filename", "$finaloutdir/$filename"); + } +} +closedir OUT; + +# Check for deleted files and warn +my $deleted = 0; +opendir(FINALOUT, $finaloutdir) or die "Couldn't opendir $finaloutdir"; +foreach $filename (readdir(FINALOUT)) { + next if ( -d "$finaloutdir/$filename" ); # only files, not dirs + if ( $filename =~ /.cpp$/ && ! ($filename =~ /_la_closure.cpp/) && ! -f "$outdir/$filename" ) { + print STDERR "Removing obsolete file $filename\n"; + unlink "$finaloutdir/$filename"; + $deleted = 1; + } +} +closedir FINALOUT; + +# Delete outdir +system "rm -rf $outdir"; + diff --git a/smoke/qt/generate_makefile_am.pl b/smoke/qt/generate_makefile_am.pl new file mode 100755 index 00000000..03f51747 --- /dev/null +++ b/smoke/qt/generate_makefile_am.pl @@ -0,0 +1,55 @@ +#!/usr/bin/perl -w + +use File::Basename; + +my $here = `pwd`; +chomp $here; +my $outdir = $here; +my $tempfile = "$outdir/.Makefile.am.tmpfile"; + +# Update list of source files in $outdir/Makefile.am +open( MAKEFILE, "<$outdir/Makefile.am" ) or die; +my $makeFileData = ''; +my $found = 0; +while (<MAKEFILE>) { + if (/^libsmokeqt_la_SOURCES/) + { + $found = 1; + $makeFileData .= "libsmokeqt_la_SOURCES = smokedata.cpp"; + } + $makeFileData .= $_ if (!$found); +} +close MAKEFILE; + +die "libsmokeqt_la_SOURCES not found" if (!$found); + +open( MAKEFILE, ">$tempfile" ) or die; +print MAKEFILE $makeFileData; + +my $count = 0; +opendir (FILES, $outdir) or die; +foreach $filename (readdir(FILES)) { + if ( $filename =~ /^x_.*\.cpp$/ ) { + if ( $count++ == 7 ) { + $count = 0; + print MAKEFILE " \\\n"; + } + print MAKEFILE " $filename"; + } +} + +print MAKEFILE "\n"; +close MAKEFILE; +closedir FILES; + +system "cmp -s $tempfile $outdir/Makefile.am"; +if ($? >> 8) { + system "cp -f $tempfile $outdir/Makefile.am"; + print STDERR "Makefile.am updated.\n"; +} +else { + print STDERR "Makefile.am unchanged.\n"; +} +system "rm -f $tempfile"; + +exit 0; diff --git a/smoke/qt/header_list b/smoke/qt/header_list new file mode 100644 index 00000000..3e4979da --- /dev/null +++ b/smoke/qt/header_list @@ -0,0 +1,351 @@ +q1xcompatibility.h +qabstractlayout.h +qaccel.h +qaccessible.h +qaction.h +qapp.h +qapplication.h +qarray.h +qasciicache.h +qasciidict.h +qassistantclient.h +qasyncimageio.h +qasyncio.h +qbig5codec.h +qbitarray.h +qbitarry.h +qbitmap.h +qbrush.h +qbttngrp.h +qbuffer.h +qbuttongroup.h +qbutton.h +qcache.h +qcanvas.h +qcdestyle.h +qcheckbox.h +qchkbox.h +qcleanuphandler.h +qclipboard.h +qclipbrd.h +qcollect.h +qcollection.h +qcolordialog.h +qcolor.h +qcombobox.h +qcombo.h +qcommonstyle.h +qcompactstyle.h +qconfig-dist.h +qconfig.h +qconnect.h +qconnection.h +qcstring.h +qcursor.h +qdatabrowser.h +qdatastream.h +qdatatable.h +qdataview.h +qdatetimeedit.h +qdatetime.h +qdatetm.h +qdeepcopy.h +qdesktopwidget.h +qdial.h +qdialog.h +qdict.h +qdir.h +qdns.h +qdockarea.h +qdockwindow.h +qdom.h +qdragobject.h +qdrawutil.h +qdrawutl.h +qdropsite.h +qdstream.h +qeditorfactory.h +qerrormessage.h +qeucjpcodec.h +qeuckrcodec.h +qevent.h +qeventloop.h +qfeatures.h +qfiledef.h +qfiledialog.h +qfiledlg.h +qfile.h +qfileinf.h +qfileinfo.h +qfocusdata.h +qfontdatabase.h +qfontdialog.h +qfontdta.h +qfont.h +qfontinf.h +qfontinfo.h +qfontmet.h +qfontmetrics.h +qframe.h +qftp.h +qgarray.h +qgb18030codec.h +qgbkcodec.h +qgcache.h +qgdict.h +qgeneric.h +qgif.h +qglcolormap.h +qgl.h +qglist.h +qglobal.h +qgplugin.h +qgrid.h +qgridview.h +qgroupbox.h +qgrpbox.h +qguardedptr.h +qgvector.h +qhbox.h +qhbuttongroup.h +qheader.h +qhgroupbox.h +qhostaddress.h +qhttp.h +qiconset.h +qiconview.h +qimageformatplugin.h +qimage.h +qinputdialog.h +qintcache.h +qintcach.h +qintdict.h +qinterlacestyle.h +qiodev.h +qiodevice.h +qjiscodec.h +qjpunicode.h +qkeycode.h +qkeysequence.h +qlabel.h +qlayout.h +qlcdnumber.h +qlcdnum.h +qlocale.h +qlibrary.h +qlined.h +qlineedit.h +qlistbox.h +qlist.h +qlistview.h +qlocalfs.h +qmainwindow.h +qmap.h +qmemarray.h +qmenubar.h +qmenudata.h +qmenudta.h +qmessagebox.h +qmetaobject.h +qmetaobj.h +qmime.h +qmlined.h +qmodules.h +qmotifdialog.h +qmotif.h +qmotifplusstyle.h +qmotifstyle.h +qmotifwidget.h +qmovie.h +qmsgbox.h +qmultilinedit.h +qmultilineedit.h +qmutex.h +qnamespace.h +qnetwork.h +qnetworkprotocol.h +qobjcoll.h +qobjdefs.h +qobjectcleanuphandler.h +qobjectdefs.h +qobjectdict.h +qobject.h +qobjectlist.h +qpaintdc.h +qpaintdevicedefs.h +qpaintdevice.h +qpaintdevicemetrics.h +qpaintd.h +qpainter.h +qpair.h +qpalette.h +qpdevmet.h +qpen.h +qpicture.h +qpixmapcache.h +qpixmap.h +qplatinumstyle.h +qpmcache.h +qpntarry.h +qpointarray.h +qpoint.h +qpolygonscanner.h +qpopmenu.h +qpopupmenu.h +qprintdialog.h +qprinter.h +qprndlg.h +qprocess.h +qprogbar.h +qprogdlg.h +qprogressbar.h +qprogressdialog.h +qpsprn.h +qptrcollection.h +qptrdict.h +qptrlist.h +qptrqueue.h +qptrstack.h +qptrvector.h +qpushbt.h +qpushbutton.h +qqueue.h +qradiobt.h +qradiobutton.h +qrangecontrol.h +qrangect.h +qrect.h +qregexp.h +qregion.h +qremotefactory.h +qremoteplugin.h +qrtlcodec.h +qscopedptr.h +qscrbar.h +qscrollbar.h +qscrollview.h +qsemaphore.h +qsemimodal.h +qserversocket.h +qsession.h +qsessionmanager.h +qsettings.h +qsgistyle.h +qshared.h +qsignal.h +qsignalmapper.h +qsignalslotimp.h +qsimplerichtext.h +qsizegrip.h +qsize.h +qsizepolicy.h +qsjiscodec.h +qslider.h +qsocketdevice.h +qsocket.h +qsocketnotifier.h +qsocknot.h +qsortedlist.h +qsound.h +qspinbox.h +qsplashscreen.h +qsplitter.h +qsqlcursor.h +qsqldatabase.h +qsqldriver.h +qsqldriverplugin.h +qsqleditorfactory.h +qsqlerror.h +qsqlfield.h +qsqlform.h +qsql.h +qsqlindex.h +qsqlpropertymap.h +qsqlquery.h +qsqlrecord.h +qsqlresult.h +qsqlselectcursor.h +qstack.h +qstatusbar.h +qstring.h +qstringlist.h +qstrlist.h +qstrvec.h +qstylefactory.h +qstyle.h +qstyleplugin.h +qstylesheet.h +qsyntaxhighlighter.h +qtabbar.h +qtabdialog.h +qtabdlg.h +qtable.h +qtabwidget.h +qtextbrowser.h +qtextcodecfactory.h +qtextcodec.h +qtextcodecplugin.h +qtextedit.h +qtextstream.h +qtextview.h +qt.h +qthread.h +qtimer.h +qtl.h +qtmultilineedit.h +qtoolbar.h +qtoolbutton.h +qtoolbox.h +qtooltip.h +qtranslator.h +qtsciicodec.h +qtstream.h +qttableview.h +qurl.h +qurlinfo.h +qurloperator.h +qutfcodec.h +quuid.h +qvalidator.h +qvaluelist.h +qvaluestack.h +qvaluevector.h +qvariant.h +qvbox.h +qvbuttongroup.h +qvector.h +qvgroupbox.h +qwaitcondition.h +qwhatsthis.h +qwidcoll.h +qwidgetfactory.h +qwidget.h +qwidgetintdict.h +qwidgetlist.h +qwidgetplugin.h +qwidgetstack.h +qwindefs.h +qwindowdefs.h +qwindow.h +qwindowsstyle.h +qwizard.h +qwmatrix.h +qworkspace.h +qwsbeosdecoration_qws.h +qwscommand_qws.h +qwscursor_qws.h +qwsdecoration_qws.h +qwsdefaultdecoration_qws.h +qwsdisplay_qws.h +qwsevent_qws.h +qwshydrodecoration_qws.h +qwskde2decoration_qws.h +qwskdedecoration_qws.h +qwsmanager_qws.h +qwsmouse_qws.h +qwsproperty_qws.h +qwsregionmanager_qws.h +qwssocket_qws.h +qwsutils_qws.h +qwswindowsdecoration_qws.h +qxml.h diff --git a/smoke/qt/hint_header_list.pl b/smoke/qt/hint_header_list.pl new file mode 100644 index 00000000..ff9c86b7 --- /dev/null +++ b/smoke/qt/hint_header_list.pl @@ -0,0 +1,23 @@ + +# CVS admin : run this script to compare the set of Qt headers to +# the actual content of header_list + +$l = "header_list"; +$q = $ENV{'QTDIR'} || die "QTDIR not set\n"; +@h = <$q/include/*.h>; +grep s|.*/(.*\.h)|$1|, @h; +open(IN, $l) or die "$!: $l\n"; +@old = <IN>; +chomp @old; +map{ $h{$_}++ } @h; +map{ $old{$_}++ } @old; +map{ $diff{$_}++ unless $old{$_} } keys %h; +map{ delete $diff{$_} if /^qconfig.*/ or !/^q/ } keys %diff; +print "Check if any of the following headers should be added to $l:\n\n"; +print join "\n", keys %diff, "\n" + + + + + + diff --git a/smoke/qt/qscintilla_header_list b/smoke/qt/qscintilla_header_list new file mode 100644 index 00000000..0da11cb6 --- /dev/null +++ b/smoke/qt/qscintilla_header_list @@ -0,0 +1,22 @@ +qextscintilla.h +qextscintillaapis.h +qextscintillabase.h +qextscintillacommand.h +qextscintillacommandset.h +qextscintilladocument.h +qextscintillaglobal.h +qextscintillalexer.h +qextscintillalexerbash.h +qextscintillalexercpp.h +qextscintillalexercsharp.h +qextscintillalexerhtml.h +qextscintillalexeridl.h +qextscintillalexerjava.h +qextscintillalexerjavascript.h +qextscintillalexerlua.h +qextscintillalexerperl.h +qextscintillalexerpython.h +qextscintillalexerruby.h +qextscintillalexersql.h +qextscintillamacro.h +qextscintillaprinter.h diff --git a/smoke/qt/qt_smoke.h b/smoke/qt/qt_smoke.h new file mode 100644 index 00000000..22d8d231 --- /dev/null +++ b/smoke/qt/qt_smoke.h @@ -0,0 +1,9 @@ +#ifndef QT_SMOKE_H +#define QT_SMOKE_H + +// Defined in smokedata.cpp, initialized by init_qt_Smoke(), used by all .cpp files +extern Smoke* qt_Smoke; + +class QGlobalSpace { }; + +#endif diff --git a/smoke/qt/qtguess.pl.in b/smoke/qt/qtguess.pl.in new file mode 100644 index 00000000..389129d7 --- /dev/null +++ b/smoke/qt/qtguess.pl.in @@ -0,0 +1,501 @@ +#!/usr/bin/perl + +# qtguess.pl : check how Qt was compiled. Issue a list of all defined QT_NO_* macros, one per line. +# +# author: germain Garand <germain@ebooksfrance.com> +# licence: GPL v.2 + +# options: -q: be quieter +# -o file: redirect output to "file". (default: ./qtdefines) +# -t [0..15]: set the testing threshold (see below) +# -f "flags": additional compiler flags/parameters + +use Getopt::Std; + +use vars qw/$opt_f $opt_o $opt_p/; + +getopts('qo:f:t:'); + +# Threshold : +# 0 - test basic Qt types/classes +# 5 - test higher level, non-gui classes +# 8 - test options of the above (ex: QT_NO_IMAGE_SMOOTHSCALE) +# 10 - test basic widgets +# 12 - test composite widgets +# 13 - test widgets inheriting composite widgets +# 15 - test goodies (default) + +my $default_threshold = @qt_test_threshold@; +my $cc = "@CXX@"; +my $ccflags = $opt_f || "@CXXFLAGS@"; + +my $nspaces = 50; + +my %qtdefs=(); +my %qtundefs=(); + +my $tmp = gettmpfile(); +my $qtinc = '@qt_includes@'; +my $allinc = '@all_includes@'; +my $alllib = '@all_libraries@'; +my $qtflags ='@LIB_QT@'; +my %x; +$x{'LIBPNG'} = '@LIBPNG@'; +$x{'LIBJPEG'} = '@LIBJPEG@'; +$x{'LIBSM'} = '@LIBSM@'; +$x{'LIBSOCKET'} = '@LIBSOCKET@'; +$x{'LIBDL'} = '@LIBDL@'; +$x{'LIBRESOLV'} = '@LIBRESOLV@'; +$x{'LIB_X11'} = '@LIB_X11@'; +$x{'X_PRE_LIBS'} = '@X_PRE_LIBS@'; +$x{'LIB_X11'} =~ s/\$\((.*?)\)/$x{$1}/g; + +$qtflags =~ s/\$\((.*?)\)/$x{$1}/g; + + -e "$qtinc/qglobal.h" or die "Invalid Qt directory.\n"; + +my $ccmd = "$cc $ccflags $allinc $alllib -o $tmp $tmp.cpp $qtflags"; + +my $threshold = defined($opt_t)?$opt_t : $default_threshold; +$threshold >= 0 or die "invalid testing threshold: $threshold\n"; + +print "Checking how Qt was built... \n"; +print "Threshold is set to $threshold\n" unless $opt_q; + +my($count, $used, $total); +map{ $tests{$_}->[2]>=$threshold ? ($used++, $total++):$total++ } keys %tests; + +print "Number of defines to be tested : $used/$total\n\n" unless $opt_q; +open( QTDEFS, ">".($opt_o || "qtdefines") ) or die "Can't open output file: $!\n"; + +grab_qglobal_symbols(); +preliminary_test(); +perform_all_tests(); + +print +scalar(keys %qtdefs) . " defines found.\n"; + +print QTDEFS join("\n", keys %qtdefs), "\n"; +close; + +#--------------------------------------------------------------# + +sub gettmpfile +{ + my $tmpdir = $ENV{'TMP'} || "."; + my $tmpname = $$."-qtguess"; + while( -e "$tmpdir/$tmpname" || -e "$tmpdir/${tmpname}.cpp" ) + { + $tmpname .= int (rand * 9); + } + return "$tmpdir/$tmpname"; +} + +#--------------------------------------------------------------# + +sub grab_qglobal_symbols +{ + my $cmd = "$cc -E -D__cplusplus -dM -I$qtinc $qtinc/qglobal.h 2>/dev/null"; + my $symbols = `$cmd`; + for(0..1) + { + if( check_exit_status($?) ) + { + while( $symbols =~/^#\s*define\s*(QT_\S+)\s*$/gm ) + { + $qtdefs{$1} = 1; + } + print "Found ". scalar( keys %qtdefs )." predefined symbol".((scalar( keys %qtdefs ) -1)?"s":"")." in qglobal.h\n" unless ($opt_q or !(keys %qtdefs)); + while( $symbols =~/^#\s*define\s*QT_MODULE_(\S+)\s*$/gm ) + { + $qtundefs{"QT_NO_$1"} = 1; + } + print "Found ". scalar( keys %qtundefs )." undefined symbol".((scalar( keys %qtundefs ) -1)?"s":"")." in qglobal.h\n" unless ($opt_q or !(keys %qtundefs)); + last; + } + elsif(! $_) # first try + { + print "Failed to run $cmd.\nTrying without __cplusplus (might be already defined)\n"; + $cmd = "$cc -E -dM -I$qtinc $qtinc/qglobal.h 2>/dev/null"; + $symbols = `$cmd`; + next; + } + } +} + +#--------------------------------------------------------------# + +sub preliminary_test +{ + my $msg = "Trying to compile and link a small program..."; + print $msg, " " x ($nspaces - length($msg) + 8); + open( OUT, ">${tmp}.cpp" ) or die "Failed to open temp file ${tmp}.cpp: $!\n"; + my $simple=q£ + #include <qapplication.h> + int main( int argc, char **argv ) + { + QApplication foo( argc, argv ); + return 0; + } + £; + print OUT $simple; + close OUT; + my $out = `$ccmd 2>&1`; + if( !check_exit_status($?) ) + { + die <<"EOF"; + +FAILED : check your configuration. +Failed program was: +$simple +Compiled with: +$ccmd +Compiler output: +$out +EOF + } + else + { + print "OK\n"; + } +} + +#--------------------------------------------------------------# + +sub perform_all_tests +{ + foreach ( sort { $tests{$a}->[2] <=> $tests{$b}->[2]} keys %tests) + { + $tests{$_}->[2] < $threshold and next; + ($qtdefs{$_} || $qtundefs{$_}) and do + { + print "\rSkipping $_ (in qglobal.h)".( " " x (($nspaces-16) - length($_)) ).($qtundefs{$_}?"*Undefined*":" [Defined]").($opt_q?"":"\n"); + next + }; + print "\rTesting $_".( " " x ($nspaces - length($_)) ); + open( OUT, ">${tmp}.cpp" ) or die "Failed to open temp file ${tmp}.cpp: $!\n"; + foreach $def(keys %qtdefs) + { + print OUT "#define $def\n"; + } + foreach $inc(split /,\s*/, $tests{$_}->[0]) + { + print OUT "#include <$inc>\n"; + } + print OUT "#include <qfeatures.h>\n"; + print OUT $tests{$_}->[3] if $tests{$_}->[3]; # need to define some classes ? + print OUT qq£ + + int main( int argc, char **argv ) + { + $tests{$_}->[1] + return 0; + } + £; + close OUT; + + my $out = `$ccmd 2>&1`; + + my $ok = check_exit_status($?); + if( !$ok ) + { + $qtdefs{$_} = 1; + } + print +$opt_q ? ++$count."/$used" : ( $ok ? "*Undefined*\n" : " [Defined]\n" ); + } + $opt_q && print "\n"; +} + +#--------------------------------------------------------------# + +sub check_exit_status +{ + my $a = 0xFFFF & shift; + if( !$a ) + { + return 1; + } + elsif( $a == 0xFF00 ) + { + die "\nSystem call failed: $!\n"; + } + elsif( $a > 0x80 ) + { + # non-zero status. + } + else + { + if( $a & 0x80 ) + { + die "\n$cc coredumped with signal ". ($a & ~0x80); + } + die "\n$cc interrupted by signal $a\n"; + } + return 0; +} + +#--------------------------------------------------------------# + +END +{ + unlink $tmp if -e $tmp; + unlink "${tmp}.cpp" if -e "${tmp}.cpp"; +} + +#--------------------------------------------------------------# + +BEGIN { + +# "DEFINE" => ["header-1.h,... header-n.h", "main() code", priority, "Definitions (if needed)"] + +our %tests = ( + "QT_NO_ACCEL" => ["qaccel.h", "QAccel foo( (QWidget*)NULL );", 5], + "QT_NO_ACTION" => ["qaction.h", "QAction foo( (QObject*)NULL );", 5], + "QT_NO_ASYNC_IO" => ["qasyncio.h", "QAsyncIO foo();", 5], + "QT_NO_ASYNC_IMAGE_IO"=> ["qasyncimageio.h", "QImageDecoder foo( (QImageConsumer*) NULL );", 5], + "QT_NO_BIG_CODECS" => ["qbig5codec.h", "QBig5Codec foo();", 5], + "QT_NO_BUTTON" => ["qbutton.h", "QButton foo( (QWidget*)NULL );", 10], + "QT_NO_BUTTONGROUP" => ["qbuttongroup.h", "QButtonGroup foo( (QWidget*)NULL );", 12], + "QT_NO_CANVAS" => ["qcanvas.h", "QCanvas foo( (QObject*)NULL );", 10], + "QT_NO_CHECKBOX" => ["qcheckbox.h", "QCheckBox( (QWidget*)NULL );", 10], + "QT_NO_CLIPBOARD" => ["qapplication.h, qclipboard.h", q£ + QApplication foo( argc, argv ); + QClipboard *baz= foo.clipboard(); + £, 5], + "QT_NO_COLORDIALOG" => ["qcolordialog.h", "QColorDialog::customCount();", 12], + "QT_NO_COMBOBOX" => ["qcombobox.h", "QComboBox( (QWidget*)NULL );", 10], + "QT_NO_COMPAT" => ["qfontmetrics.h", q£ + QFontMetrics *foo= new QFontMetrics( QFont() ); + int bar = foo->width( 'c' ); + £, 0], + "QT_NO_COMPONENT" => ["qapplication.h", q£ + QApplication foo( argc, argv ); + foo.addLibraryPath( QString::null ); + £, 5], + "QT_NO_CURSOR" => ["qcursor.h", "QCursor foo;", 5], + "QT_NO_DATASTREAM" => ["qdatastream.h", "QDataStream foo;", 5], + "QT_NO_DATETIMEEDIT" => ["qdatetimeedit.h", "QTimeEdit foo;", 12], + "QT_NO_DIAL" => ["qdial.h", "QDial foo;", 10], + "QT_NO_DIALOG" => ["qdialog.h", "QDialog foo;", 12], + "QT_NO_DIR" => ["qdir.h", "QDir foo;", 5], + "QT_NO_DNS" => ["qdns.h", "QDns foo;", 5], + "QT_NO_DOM" => ["qdom.h", "QDomDocumentType foo;", 5], + "QT_NO_DRAGANDDROP" => ["qevent.h", "QDropEvent foo( QPoint(1,1) );", 5], + "QT_NO_DRAWUTIL" => ["qdrawutil.h, qcolor.h", "qDrawPlainRect( (QPainter *) NULL, 0, 0, 0, 0, QColor() );", 10], + "QT_NO_ERRORMESSAGE" => ["qerrormessage.h", "QErrorMessage foo( (QWidget*) NULL );", 13], + "QT_NO_FILEDIALOG" => ["qfiledialog.h", "QFileIconProvider foo;", 13], + + "QT_NO_FONTDATABASE" => ["qfontdatabase.h", "QFontDatabase foo;", 5], + "QT_NO_FONTDIALOG" => ["qfontdialog.h", "QFontDialog::getFont( (bool *)NULL );", 12], + "QT_NO_FRAME" => ["qframe.h", "QFrame foo;", 10], + "QT_NO_GRID" => ["qgrid.h", "QGrid foo(5);", 12], + "QT_NO_GRIDVIEW" => ["qgridview.h", "QFoo foo;", 13, q£ + class QFoo: public QGridView + { + public: + QFoo(){}; + ~QFoo(){}; + void paintCell(QPainter *, int, int){}; + }; + £], + "QT_NO_GROUPBOX" => ["qgroupbox.h", "QGroupBox foo;", 12], + "QT_NO_HBOX" => ["qhbox.h", "QHBox foo;", 12], + "QT_NO_HBUTTONGROUP" => ["qhbuttongroup.h", "QHButtonGroup foo;", 13], + "QT_NO_HEADER" => ["qheader.h", "QHeader foo;", 10], + "QT_NO_HGROUPBOX" => ["qhgroupbox.h", "QHGroupBox foo;", 13], + "QT_NO_ICONSET" => ["qiconset.h", "QIconSet foo;", 8], + + "QT_NO_ICONVIEW" => ["qiconview.h", "QIconView foo;", 13], + "QT_NO_IMAGEFORMATPLUGIN" => ["qimageformatplugin.h, qstringlist.h", "QFoo foo;", 5, q£ + + class QFoo: public QImageFormatPlugin + { + public: + QFoo() {}; + ~QFoo() {}; + QStringList keys() const { return QStringList(); }; + bool installIOHandler( const QString &format ) { return true; }; + }; + Q_EXPORT_PLUGIN( QFoo ) + £], + "QT_NO_IMAGE_DITHER_TO_1" => ["qimage.h", q£ + QImage *foo = new QImage; + foo->createAlphaMask(); + £, 8], + "QT_NO_IMAGE_HEURISTIC_MASK" => ["qimage.h", q£ + QImage *foo = new QImage; + foo->createHeuristicMask(); + £, 8], + "QT_NO_IMAGE_MIRROR" => ["qimage.h", q£ + QImage *foo = new QImage; + foo->mirror(); + £, 8], + "QT_NO_IMAGE_SMOOTHSCALE" => ["qimage.h", q£ + QImage *foo = new QImage; + foo->smoothScale( 10, 10); + £, 8], + "QT_NO_IMAGE_TEXT" => ["qimage.h", "QImageTextKeyLang foo;", 8], + "QT_NO_IMAGE_TRANSFORMATION" => ["qimage.h", q£ + QImage *foo = new QImage; + foo->scale( 10, 10); + £, 8], + "QT_NO_IMAGE_TRUECOLOR" => ["qimage.h", q£ + QImage *foo = new QImage; + foo->convertDepthWithPalette( 1, (QRgb*) NULL, 1 ); + £, 8], + "QT_NO_INPUTDIALOG" => ["qinputdialog.h, qstring.h", q£QInputDialog::getText( QString::null, QString::null);£, 13], + "QT_NO_IMAGEIO" => ["qbitmap.h, qstring.h", q£ + QBitmap foo( QString::fromLatin1("foobar") ); + £, 5], + "QT_NO_IMAGEIO_JPEG" => ["qjpegio.h", "qInitJpegIO();", 8], + "QT_NO_IMAGEIO_MNG" => ["qmngio.h", "qInitMngIO();", 8], + "QT_NO_IMAGEIO_PNG" => ["qpngio.h", "qInitPngIO();", 8], + "QT_NO_LABEL" => ["qlabel.h", "QLabel foo( (QWidget*) NULL );", 10], + "QT_NO_LAYOUT" => ["qlayout.h", "QFoo foo;", 10, q£ + + class QFoo: public QLayout + { + public: + QFoo() {}; + ~QFoo() {}; + void addItem( QLayoutItem * ) { }; + QSize sizeHint() const { return QSize(); } + QLayoutIterator iterator() { return QLayoutIterator( (QGLayoutIterator *) NULL ); }; + void setGeometry( const QRect & ) { }; + }; + £], + "QT_NO_LCDNUMBER" => ["qlcdnumber.h", "QLCDNumber foo;", 12], + "QT_NO_LINEEDIT" => ["qlineedit.h", "QLineEdit foo( (QWidget *) NULL );", 12], + "QT_NO_LISTBOX" => ["qlistbox.h", "QListBox foo;", 13], + "QT_NO_LISTVIEW" => ["qlistview.h", "QListView foo;", 13], + "QT_NO_MAINWINDOW" => ["qmainwindow.h", "QMainWindow foo;", 13], + "QT_NO_MENUBAR" => ["qmenubar.h", "QMenuBar foo;", 13], + "QT_NO_MOVIE" => ["qmovie.h", "QMovie foo;", 5], + "QT_NO_MENUDATA" => ["qmenudata.h", "QMenuData foo;", 9], + "QT_NO_MESSAGEBOX" => ["qmessagebox.h", "QMessageBox foo;", 13], + "QT_NO_MIME" => ["qmime.h", "QMimeSourceFactory foo;", 5], + "QT_NO_MIMECLIPBOARD" => ["qapplication.h, qclipboard.h", q£ + QApplication foo( argc, argv ); + QClipboard *baz= foo.clipboard(); + baz->data(); + £, 8], + + "QT_NO_MULTILINEEDIT" => ["qmultilineedit.h", "QMultiLineEdit foo;", 14], + "QT_NO_NETWORK" => ["qnetwork.h", "qInitNetworkProtocols();", 5], + "QT_NO_NETWORKPROTOCOL" => ["qnetworkprotocol.h", "QNetworkProtocol foo;", 8], + "QT_NO_NETWORKPROTOCOL_FTP" => ["qftp.h", "QFtp foo;", 9], + "QT_NO_PALETTE" => ["qpalette.h", "QColorGroup foo;", 5], + "QT_NO_PICTURE" => ["qpicture.h", "QPicture foo;", 5], + "QT_NO_PIXMAP_TRANSFORMATION" =>["qbitmap.h, qwmatrix.h", q£ + QBitmap *foo= new QBitmap(); + QWMatrix bar; + foo->xForm( bar ); + £, 5], + "QT_NO_POPUPMENU" => ["qpopupmenu.h", "QPopupMenu foo;", 12], + "QT_NO_PRINTER" => ["qprinter.h", "QPrinter foo;", 5], + "QT_NO_PRINTDIALOG" => ["qprintdialog.h", "QPrintDialog foo( (QPrinter*) NULL );", 13], + "QT_NO_PROCESS" => ["qprocess.h", "QProcess foo;", 5], + "QT_NO_PROGRESSBAR" => ["qprogressbar.h", "QProgressBar foo;", 12], + "QT_NO_PROGRESSDIALOG" => ["qprogressdialog.h", "QProgressDialog foo;", 13], + "QT_NO_PUSHBUTTON" => ["qpushbutton.h", "QPushButton foo( (QWidget *) NULL );", 12], + "QT_NO_PROPERTIES" => ["qmetaobject.h", "QMetaProperty foo;", 0], +# "QT_NO_QTMULTILINEEDIT" => ["qtmultilineedit.h", "QtMultiLineEdit foo;", 15], +# "QT_NO_QTTABLEVIEW" => ["qttableview.h", "QFoo foo;", 16, q£ +# class QFoo: public QtTableView +# { +# public: +# QFoo() {}; +# ~QFoo() {}; +# void paintCell( QPainter *, int, int) {}; +# }; +# £], + "QT_NO_QUUID_STRING" => ["quuid.h", "QUuid foo( QString::null );", 8], + "QT_NO_RANGECONTROL" => ["qrangecontrol.h", "QRangeControl foo;", 10], + "QT_NO_REGEXP" => ["qregexp.h", "QRegExp foo;", 5], + "QT_NO_REGEXP_WILDCARD" => ["qregexp.h", q£ + QRegExp foo; + foo.wildcard(); + £, 8], + "QT_NO_REMOTE" => ["qapplication.h", q£ + QApplication foo( argc, argv ); + foo.remoteControlEnabled(); + £, 15], + "QT_NO_RADIOBUTTON" => ["qradiobutton.h", "QRadioButton foo( (QWidget *) NULL );", 12], + "QT_NO_RICHTEXT" => ["qsimplerichtext.h, qstring.h, qfont.h", "QSimpleRichText foo( QString::null, QFont() );", 10], + "QT_NO_SCROLLBAR" => ["qscrollbar.h", "QScrollBar foo( (QWidget *) NULL );", 12], + "QT_NO_SCROLLVIEW" => ["qscrollview.h", "QScrollView foo;", 12], + "QT_NO_SEMIMODAL" => ["qsemimodal.h", "QSemiModal foo;", 10], + "QT_NO_SESSIONMANAGER" => ["qapplication.h", q£ + QApplication foo( argc, argv ); + foo.sessionId(); + £, 15], + "QT_NO_SETTINGS" => ["qsettings.h", "QSettings foo;", 5], + "QT_NO_SIGNALMAPPER" => ["qsignalmapper.h", "QSignalMapper foo( (QObject *) NULL );", 0], + "QT_NO_SIZEGRIP" => ["qsizegrip.h", "QSizeGrip foo( (QWidget *) NULL );", 10], + "QT_NO_SLIDER" => ["qslider.h", "QSlider foo( (QWidget *) NULL );", 12], + "QT_NO_SOUND" => ["qsound.h", "QSound foo( QString::null );", 5], + + + "QT_NO_SPINWIDGET" => ["qrangecontrol.h", "QSpinWidget foo;", 10], + "QT_NO_SPRINTF" => ["qcolor.h", q£ + QColor foo; + foo.name(); + £, 0], + + + + "QT_NO_SQL" => ["qsqlcursor.h", "QSqlCursor foo;", 5], + "QT_NO_STRINGLIST" => ["qstringlist.h", "QStringList foo;", 0], + "QT_NO_STYLE" => ["qapplication.h", q£ + QApplication foo( argc, argv ); + foo.style(); + £, 15], + +# "QT_NO_STYLE_CDE" => ["qcdestyle.h", "QCDEStyle foo;", 16], +# "QT_NO_STYLE_COMPACT" => ["qcompactstyle.h", "QCompactStyle foo;", 16], +# "QT_NO_STYLE_INTERLACE" => ["qinterlacestyle.h", "QInterlaceStyle foo;", 16], +# "QT_NO_STYLE_PLATINUM" => ["qplatinumstyle.h", "QPlatinumStyle foo;", 16], +# "QT_NO_STYLE_MOTIF" => ["qmotifstyle.h", "QMotifStyle foo;", 16], +# "QT_NO_STYLE_MOTIFPLUS" => ["qmotifplusstyle.h", "QMotifPlusStyle foo;", 16], +# "QT_NO_STYLE_SGI" => ["qsgistyle.h", "QSGIStyle foo;", 16], +# "QT_NO_STYLE_WINDOWS" => ["qwindowsstyle.h", "QWindowsStyle foo;", 16], + "QT_NO_TABBAR" => ["qtabbar.h", "QTabBar foo;", 10], + "QT_NO_TABDIALOG" => ["qtabdialog.h", "QTabDialog foo;", 12], + "QT_NO_TABLE" => ["qtable.h", "QTable foo;", 10], + "QT_NO_TABWIDGET" => ["qtabwidget.h", "QTabWidget foo;", 10], + "QT_NO_TEXTBROWSER" => ["qtextbrowser.h", "QTextBrowser foo;", 14], + "QT_NO_TEXTCODEC" => ["qtextcodec.h", "QTextCodec::codecForIndex(1);", 5], + "QT_NO_TEXTCODECPLUGIN" => ["qtextcodecplugin.h, qstringlist.h, qvaluelist.h, qtextcodec.h", "QFoo foo;", 6, q£ + + class QFoo: public QTextCodecPlugin + { + public: + QFoo() {}; + ~QFoo() {}; + QStringList names() const {return QStringList();} + QValueList<int>mibEnums() const {return QValueList<int>();} + QTextCodec *createForName( const QString & name ) {return (QTextCodec *)NULL;} + QTextCodec *createForMib( int mib ) {return (QTextCodec *)NULL;} + }; + Q_EXPORT_PLUGIN( QFoo ) + £], + "QT_NO_TEXTEDIT" => ["qtextedit.h", "QTextEdit foo;", 13], + "QT_NO_TEXTSTREAM" => ["qtextstream.h", "QTextStream foo;", 5], + "QT_NO_TEXTVIEW" => ["qtextview.h", "QTextView foo;", 14], #Obsolete + "QT_NO_TOOLBAR" => ["qtoolbar.h", "QToolBar foo;", 10], + "QT_NO_TOOLBUTTON" => ["qtoolbutton.h", "QToolButton foo((QWidget *) NULL );", 12], + "QT_NO_TOOLTIP" => ["qtooltip.h", "QToolTip::hide();", 10], + + "QT_NO_TRANSFORMATIONS" => ["qpainter.h", q£ + QPainter *foo= new QPainter(); + foo->setViewXForm( true );£, 5], + "QT_NO_VARIANT" => ["qvariant.h", "QVariant foo;", 0], + "QT_NO_WHATSTHIS" => ["qwhatsthis.h", "QWhatsThis::inWhatsThisMode();", 10], + "QT_NO_WHEELEVENT" => ["qevent.h", "QWheelEvent foo( QPoint(1,1), 1, 1 );", 5], + "QT_NO_WIDGET_TOPEXTRA" => ["qwidget.h", "QWidget foo; foo.caption();", 9], + "QT_NO_WIDGETSTACK" => ["qwidgetstack.h", "QWidgetStack foo;", 13], + "QT_NO_WIZARD" => ["qwizard.h", "QWizard foo;", 13], + "QT_NO_WMATRIX" => ["qwmatrix.h", "QWMatrix foo;", 0], + "QT_NO_XML" => ["qxml.h", "QXmlNamespaceSupport foo;", 5], + ); + +} diff --git a/smoke/qt/smokeqt.pro b/smoke/qt/smokeqt.pro new file mode 100644 index 00000000..f49fc61b --- /dev/null +++ b/smoke/qt/smokeqt.pro @@ -0,0 +1,32 @@ +###################################################################### +# Automatically generated by qmake (1.04a) Tue May 25 03:20:31 2004 +###################################################################### + +TEMPLATE = lib +INCLUDEPATH += . .. + +# Input +HEADERS += qt_smoke.h +SOURCES += smokedata.cpp \ + x_1.cpp \ + x_10.cpp \ + x_11.cpp \ + x_12.cpp \ + x_13.cpp \ + x_14.cpp \ + x_15.cpp \ + x_16.cpp \ + x_17.cpp \ + x_18.cpp \ + x_19.cpp \ + x_2.cpp \ + x_20.cpp \ + x_3.cpp \ + x_4.cpp \ + x_5.cpp \ + x_6.cpp \ + x_7.cpp \ + x_8.cpp \ + x_9.cpp + +DESTDIR = /usr/lib diff --git a/smoke/smoke.h b/smoke/smoke.h new file mode 100644 index 00000000..29038602 --- /dev/null +++ b/smoke/smoke.h @@ -0,0 +1,386 @@ +#ifndef SMOKE_H +#define SMOKE_H + +#include <string.h> + +/* + Copyright (C) 2002, Ashley Winters <qaqortog@nwlink.com> + + BSD License + + Redistribution and use in source and binary forms, with or + without modification, are permitted provided that the following + conditions are met: + + Redistributions of source code must retain the above + copyright notice, this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution.> + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + THE POSSIBILITY OF SUCH DAMAGE. +*/ + +class SmokeBinding; + +class Smoke { +public: + union StackItem; // defined below + /** + * A stack is an array of arguments, passed to a method when calling it. + */ + typedef StackItem* Stack; + + enum EnumOperation { + EnumNew, + EnumDelete, + EnumFromLong, + EnumToLong + }; + + typedef short Index; + typedef void (*ClassFn)(Index method, void* obj, Stack args); + typedef void* (*CastFn)(void* obj, Index from, Index to); + typedef void (*EnumFn)(EnumOperation, Index, void*&, long&); + + enum ClassFlags { + cf_constructor = 0x01, // has a constructor + cf_deepcopy = 0x02, // has copy constructor + cf_virtual = 0x04, // has virtual destructor + cf_undefined = 0x10 // defined elsewhere + }; + /** + * Describe one class. + */ + struct Class { + const char *className; // Name of the class + Index parents; // Index into inheritanceList + ClassFn classFn; // Calls any method in the class + EnumFn enumFn; // Handles enum pointers + unsigned short flags; // ClassFlags + }; + + enum MethodFlags { + mf_static = 0x01, + mf_const = 0x02, + mf_copyctor = 0x04, // Copy constructor + mf_internal = 0x08, // For internal use only + mf_enum = 0x10, // An enum value + mf_ctor = 0x20, + mf_dtor = 0x40, + mf_protected = 0x80 + }; + /** + * Describe one method of one class. + */ + struct Method { + Index classId; // Index into classes + Index name; // Index into methodNames; real name + Index args; // Index into argumentList + unsigned char numArgs; // Number of arguments + unsigned char flags; // MethodFlags (const/static/etc...) + Index ret; // Index into types for the return type + Index method; // Passed to Class.classFn, to call method + }; + + /** + * One MethodMap entry maps the munged method prototype + * to the Method entry. + * + * The munging works this way: + * $ is a plain scalar + * # is an object + * ? is a non-scalar (reference to array or hash, undef) + * + * e.g. QApplication(int &, char **) becomes QApplication$? + */ + struct MethodMap { + Index classId; // Index into classes + Index name; // Index into methodNames; munged name + Index method; // Index into methods + }; + + enum TypeFlags { + // The first 4 bits indicate the TypeId value, i.e. which field + // of the StackItem union is used. + tf_elem = 0x0F, + + // Always only one of the next three flags should be set + tf_stack = 0x10, // Stored on the stack, 'type' + tf_ptr = 0x20, // Pointer, 'type*' + tf_ref = 0x30, // Reference, 'type&' + // Can | whatever ones of these apply + tf_const = 0x40 // const argument + }; + /** + * One Type entry is one argument type needed by a method. + * Type entries are shared, there is only one entry for "int" etc. + */ + struct Type { + const char *name; // Stringified type name + Index classId; // Index into classes. -1 for none + unsigned short flags; // TypeFlags + }; + + // We could just pass everything around using void* (pass-by-reference) + // I don't want to, though. -aw + union StackItem { + void* s_voidp; + bool s_bool; + signed char s_char; + unsigned char s_uchar; + short s_short; + unsigned short s_ushort; + int s_int; + unsigned int s_uint; + long s_long; + unsigned long s_ulong; + float s_float; + double s_double; + long s_enum; + void* s_class; + }; + enum TypeId { + t_voidp, + t_bool, + t_char, + t_uchar, + t_short, + t_ushort, + t_int, + t_uint, + t_long, + t_ulong, + t_float, + t_double, + t_enum, + t_class, + t_last // number of pre-defined types + }; + + // Passed to constructor + /** + * The classes array defines every class for this module + */ + Class *classes; + Index numClasses; + + /** + * The methods array defines every method in every class for this module + */ + Method *methods; + Index numMethods; + + /** + * methodMaps maps the munged method prototypes + * to the methods entries. + */ + MethodMap *methodMaps; + Index numMethodMaps; + + /** + * Array of method names, for Method.name and MethodMap.name + */ + const char **methodNames; + Index numMethodNames; + + /** + * List of all types needed by the methods (arguments and return values) + */ + Type *types; + Index numTypes; + + /** + * Groups of class IDs (-1 separated) used as super class lists. + * For classes with super classes: Class.parents = index into this array. + */ + Index *inheritanceList; + /** + * Groups of type IDs (-1 separated), describing the types of argument for a method. + * Method.args = index into this array. + */ + Index *argumentList; + /** + * Groups of method prototypes with the same number of arguments, but different types. + * Used to resolve overloading. + */ + Index *ambiguousMethodList; + /** + * Function used for casting from/to the classes defined by this module. + */ + CastFn castFn; + + // Not passed to constructor + SmokeBinding *binding; + + /** + * Constructor + */ + Smoke(Class *_classes, Index _numClasses, + Method *_methods, Index _numMethods, + MethodMap *_methodMaps, Index _numMethodMaps, + const char **_methodNames, Index _numMethodNames, + Type *_types, Index _numTypes, + Index *_inheritanceList, + Index *_argumentList, + Index *_ambiguousMethodList, + CastFn _castFn) : + classes(_classes), numClasses(_numClasses), + methods(_methods), numMethods(_numMethods), + methodMaps(_methodMaps), numMethodMaps(_numMethodMaps), + methodNames(_methodNames), numMethodNames(_numMethodNames), + types(_types), numTypes(_numTypes), + inheritanceList(_inheritanceList), + argumentList(_argumentList), + ambiguousMethodList(_ambiguousMethodList), + castFn(_castFn), + + binding(0) + {} + + inline void *cast(void *ptr, Index from, Index to) { + if(!castFn) return ptr; + return (*castFn)(ptr, from, to); + } + + // return classname directly + inline const char *className(Index classId) { + return classes[classId].className; + } + + inline int leg(Index a, Index b) { // ala Perl's <=> + if(a == b) return 0; + return (a > b) ? 1 : -1; + } + + inline Index idType(const char *t) { + if(!t) return 0; + Index imax = numTypes; + Index imin = 0; + Index icur = -1; + int icmp = -1; + + while(imax >= imin) { + icur = (imin + imax) / 2; + if(icur > 0) + icmp = strcmp(types[icur].name, t); + else + icmp = -1; + if(!icmp) break; + if(icmp > 0) + imax = icur - 1; + else + imin = icur + 1; + } + + return (!icmp) ? icur : 0; + } + + inline Index idClass(const char *c) { + if(!c) return 0; + Index imax = numClasses; + Index imin = 0; + Index icur = -1; + int icmp = -1; + + while(imax >= imin) { + icur = (imin + imax) / 2; + if(icur > 0) + icmp = strcmp(classes[icur].className, c); + else + icmp = -1; + if(!icmp) break; + if(icmp > 0) + imax = icur - 1; + else + imin = icur + 1; + } + + return (!icmp) ? icur : 0; + } + + inline Index idMethodName(const char *m) { + if(!m) return 0; + Index imax = numMethodNames; + Index imin = 0; + Index icur = -1; + int icmp = -1; + while(imax >= imin) { + icur = (imin + imax) / 2; + icmp = strcmp(methodNames[icur], m); + if(!icmp) break; + if(icmp > 0) + imax = icur - 1; + else + imin = icur + 1; + } + + return (!icmp) ? icur : 0; + } + + inline Index idMethod(Index c, Index name) { + Index imax = numMethodMaps; + Index imin = 0; + Index icur = -1; + int icmp = -1; + while(imax >= imin) { + icur = (imin + imax) / 2; + icmp = leg(methodMaps[icur].classId, c); + if(!icmp) { + icmp = leg(methodMaps[icur].name, name); + if(!icmp) break; + } + if(icmp > 0) + imax = icur - 1; + else + imin = icur + 1; + } + + return (!icmp) ? icur : 0; + } + + inline Index findMethod(Index c, Index name) { + // TODO: If method is in a parent module, forward the call from here + if(!c || !name) return 0; + Index mid = idMethod(c, name); + if(mid) return mid; + if(!classes[c].parents) return 0; + for(int p = classes[c].parents; inheritanceList[p] ; p++) { + mid = findMethod(inheritanceList[p], name); + if(mid) return mid; + } + return 0; + } + + inline Index findMethod(const char *c, const char *name) { + Index idc = idClass(c); + Index idname = idMethodName(name); + return findMethod(idc, idname); + } +}; + +class SmokeBinding { +protected: + Smoke *smoke; +public: + SmokeBinding(Smoke *s) : smoke(s) {} + virtual void deleted(Smoke::Index classId, void *obj) = 0; + virtual bool callMethod(Smoke::Index method, void *obj, Smoke::Stack args, bool isAbstract = false) = 0; + virtual char* className(Smoke::Index classId) = 0; + virtual ~SmokeBinding() {} +}; + +#endif |