diff --git a/3.4.0/.svnignore b/3.4.0/.svnignore deleted file mode 100644 index 0e25ab3654..0000000000 --- a/3.4.0/.svnignore +++ /dev/null @@ -1,31 +0,0 @@ -.xvpics -configure_pragma -autom4te.cache -Makefile.in -Makefile -*.ssexwsp -config.log -core -config.cache -config.status -acinclude.m4 -configure -aclocal.m4 -config.status -libtool -stamp-h -stamp.h.in -stamp-h.in -config.h -stamp-gc-h -*.tar.gz -*.tar.bz2 -*.spec -*.rpm -*.deb -.pics -.mospics -build_flags -build_number -make_pragma -cvs.log diff --git a/3.4.0/ChangeLog b/3.4.0/ChangeLog deleted file mode 100644 index a76a6e50c2..0000000000 --- a/3.4.0/ChangeLog +++ /dev/null @@ -1,2280 +0,0 @@ -02 May 2007 - 12 March 2008 - [KVIrc Development Team] - - A lot of changes documented in the svn log. See http://svn.kvirc.de/kvirc/ for the timeline. - -02 May 2007 - [Alexey] - - New KVS functions: $serialize and $unserialize to deal with JSON-serialized strings - -16 Apr 2007 - [Noldor] (with the input from Pragma and Iakko) - - Iakko's notifier is back. New in this version: - 1) QT4 compatible (on win and macos it is uses fast setWindowOpacity effect instead internal notifier blend()) - 2) Added Option to disable fadein/out effect useful on slow machine (need test) - 3) Fixed strange crash on QT4 and some minor bug in show/hide event. (it is a trick... need to debug) - This a w.i.p. and need some test on linux. - -12 Apr 2007 - [TheXception] - - Added $system.call to call functions of dll/so files via kvs. - -10 Apr 2007 - [Alexey] - - Configurable avatar scaling on load - - Human-redable file sized on dcc transfers - -12 Mar 2007 - [Alexey] - - Added support for remote dns on socks5 proxy - - Added option to configure identd output mode - -06 Mar 2007 - [Pragma] - - Added svg and generated png icons for kvs,kvc,kvt and kva files. - Added the KDE mimetypes too. - - Some fixes for Qt4 support - -26 Feb 2007 - [Alexey] - - Added Export/Import feature to channel list module - -25 Feb 2007 - [Alexey] - - Repainted reuser list - - Added search field for mask editors - -24 Feb 2007 - [Noldor] - - New QT4 win compiling projects: still unusable... kvilib and kvirc compile but only in release; - you need to compile qt libraries by yourself then try to compile kvilib and kvirc (use COMPILE_USE_QT4 in kvi_wincfg.h). - Some module compile without problem... others need to be ported. - -20 Feb 2007 - [Alexey] - - Completely reworked ignore system - - Implemented reguser match caching - - Implemented custom color for registered user caching - [Pragma] - - Yet more Qt4 port. - - We now require Qt >= 4.2.2 for Qt4 support to work. Older 4.x versions - have bugs that can't be worked around and tend to crash kvirc - in various circumstances (including displaying tooltips). - Qt 4.2 also re-adds the possibility to add QWidget objects to popup menus. - - Yet more modules ported. - - A fix for the KVS expression operator precedence. - - A couple of general fixes that I can't remember but have been reported on - the list. - - I'm thinking about qmake support (as suggested by Matteo Catanese some time ago) - ... will require some work ... what do you think about it ? - -18 Feb 2007 - [Alexey] - - Fixed dns resolver under win32 - - Fixed minimized channels open - - Added bot detection icon (who will write docs?) - - Fixed winamp plugin problem under win32 (removed msvcr80.dll dependency) - -08 Feb 2007 - [Pragma] - - More Qt 4.x port. - Solved the most disturbing problems: it looks a lot better now. - - Font metric cache values can no longer be computed directly from a - widget's font. We must use the painter idea of the font instead. - This complicates caching a bit. - - Some of the QPainter functions seem to behave in a bit different way - - QFrame::drawContents() is gone... we need to reimplement paintEvent() - - The setAutoFillBackground(false) setting seems to be propagated to children - in some way (?) (as opposed to backgroundMode(NoBackground) in Qt3) - - QToolButton::drawButton() is gone, need to directly drawPixmaps instead... - - ... - Ported also the first couple of modules. - - Qt 4 causes a lot of problems in porting but I'm starting to feel - like the new library is very cool :) - -05 Feb 2007 - [Pragma] - - The KVIrc executable now compiles and starts with Qt4. With Qt3 everythin - should work just like it did before. - - No modules are ported yet so a lot of functionality is not available... - ... but it CAN connect to a server :) - It tends to crash once in a while, has nasty problems with - graphics and size of certain widgets: will need some hours of debugging. - - When testing the Qt4 port make sure you (re)move your old binary - modules from /usr/local/share/kvirc/3.2/. KVIrc will attempt to load - some modules from there and since they're linked to Qt3 the runtime - (loader) is likely to go nuts with two Qt versions in memory. - You have been warned... :) - -30 Jan 2007 - [Alexey] - - Introduced option "using identd only on connect" - -29 Jan 2007 - [Alexey] - - Introduced search in log files - -25 Jan 2007 - [Pragma] - - Yet more Qt 4.x port - - Added the torrent interface module by Alexander Stillich - -21 Jan 2007 - [Pragma] - - More Qt 4.x port - - More multiple identities work - - Added the first considerations about the Qt 4.x port to hackers.guide.txt - -20 Jan 2007 - [Pragma] - - Another quick fix (for config values not saved correctly) - - Started the implementation of multiple identities. - -19 Jan 2007 - [Pragma] - - Added the fixes for a couple of bugs introduced with the yesterday commit. - Thnx to Alexander Stillich for the detailed report :) - -18 Jan 2007 - [Pragma] - - More Qt 4.x port. kvilib now compiles cleanly with both Qt 4.x and Qt 3.x. - Don't know if it really works since kvirc compilation still bails out. We'll see :) - -15 Jan 2007 - [Pragma] - - Fixed the smart encoders a bit more - - Theme management: rewritten the theme save dialog as a wizard, added screenshot management. - - Really first step to Qt 4.x support: added ./configure switches to handle qt4 and - fiddled the makefile variables to contain the right include and library paths. - Still have no idea if everything works correctly since compilation bails out - very early in kvilib. - You're likely to have problems with moc since the configure script tends - to find the Qt 3.x moc instead of the correct one. Use the --with-qt4-moc option - to force the right moc compiler path. - In Qt 4.x mode the COMPILE_USE_QT4 preprocessor variable is set: use it for conditionals... - an #ifdef COMPILE_USE_QT4 is more or less equivalent to #if QT_VERSION >= 0x040000. - We will need to "abstract" several collection classes to make everything - work with both Qt 3.x and Qt 4.x. The goal is (or better would be) to hide everything in - kvilib in order to have almost no conditional compilation in the kvirc core and in the modules. - - Added a discussion about the versioning scheme in the hackers.guide.txt. Give - it a read and make/add your comments :) - -12 Jan 2007 - [Pragma] - - Added a set of smart encoders that send in UTF-8 instead of the child encoding - - Fixed a nasty bug in KviQString::vsprintf() that caused KVIrc to crash in response - to certain messages from server - - Added corrections and null checks in some places to make KVIrc resist to - the ircfuzz.c attack. - - Committed the spanish translation by Roberto Ciria - -08 Jan 2007 - [Pragma] - - More work on the themeing engine. Nearly finished. - The theme packages created since Dec 28 aren't compatible anymore. - (nobody was able to load them yet anyway :D), sorry. - - Added support for the audacious media player, thnx to Alexander Stillich :) - - Added #kvirc channel links in the help menu. Please add your own localized #kvirc channel. - -06 Jan 2007 - [Alexey] - - Added gender info sharing tricks - -28 Dec 2006 - [Pragma] - - Added handling of unknown RPL_WHOIS* numeric replies by implementing a nice - "guessing" algorithm suggested by Elephantman - - Added a file with KVIrc file extension definitions. We should use the defs instead - of hardcoding extensions like .kvt, .kvs or .kvp. - - Added a fast generic packaging engine. A KVIrc package is a kind of zip archive - with an uncompressed metadata header. It can be used to distribute both themes and addons. - - First works on the theme exporting engine. Saving and packaging are now different operations. - One first saves his theme to disk, eventually edits it manually (maybe by adding a nice - splash screen or fixing some icons) and finally packages it by invoking a nice - wizard based procedure. Still need to write the installation dialog. - - Moved the whole theme management engine to a new module. It exports the - management dialogs and some utility commands. There is no reason to load - all this stuff at startup with the options dialog now. - -27 Dec 2006 - [Noldor] - - Alias editor module: - added the possibility to save a selection of aliases in separated files (every file will have the alias name); - fixed search function; - - Script editor module: - fixed replace command(in "replace all aliases" too); - now syntax highlighter recognize command "function" and "internal"; - - Objects module: - added objects.classes, objects.variables, objects.classAllHandlers; - fixed crash in listviewitem class; - fixed little bug in multilinnedit class (function $setWordWrap); - - -19 Dec 2006 - [Pragma] - - help.open: open only one help window unless -n is used - -17 Dec 2006 - [Pragma] - - Committed the new german translation file by Mihai "Ionic" Moldovan - - Switched the source control system to SVN: happy coding :) - -15 Dec 2006 - [Pragma] - - Yet more work on the options dialog - - Added an option for the "network name in taskbar": it's cool, but we want to choose :) - -12 Dec 2006 - [Alexey] - - Added option to create minimized channels - - Fixed nick selecting in userlist via ircview - - Fixed mouse hover link effect - - Network name now will be shown in the taskabr instead on server name - -07 Dec 2006 - [Pragma] - - Yet more work on the options dialog - - Fixed a crash related to the dialog.* module calls - -28 Nov 2006 - [Pragma] - - More work on the options dialogs - - Removed the duplicated kvc_ icon. - -19 Nov 2006 - [Alexey] - - New function - $chan.getUrl - - NickServ identity can now accept masks in nick field - -16 Nov 2006 - [Alexey] - - Added a simple browser-like address bar to console - - Clicking on nick in channel ircview now selects it in the userlist - - Avatar dcc send rejected if avatar size greater, then max filesize, setted in options - -15 Nov 2006 - [HelLViS69] - - Added a checkbox on AwayIndicator applet popup to choose to go away - on all IRC Contexts - -14 Nov 2006 - [Pragma] - - Moved the userlist feature options page to the theme option dialog - and splitted all the userlist options in tabs - - Corrected some typos around - - Reworked the output options page - - Updated the directory selection dialog under KDE - - Avatars bigger than 1024x768 make KVIrc complain when setting them - and are scaled to a saner size when they are received from others. - -13 Nov 2006 - [Pragma] - - Added $object.instances(): useful when implementing singletons. - - Fixed a small image dialog issue - -9 Nov 2006 - [Pragma] - - Added support for chunked HTTP transfer encoding as required by HTTP/1.1 - - A fix for object toolbar position not saved properly - - A fix for the addon management dialog not repainted correctly - - A fix for loading of files by the means of KviFileUtils::loadFile()... - /parse is one of them and it expects an utf8 encoded file. - (read: all *.kvs files must be utf8 encoded, there is no other decent - portable way to preserve the national characters...) - -8 Nov 2006 - [Pragma] - - A fix for KviStr handling incorrectly multibyte strings (fixes some localization issues) - - A simple hack-in for a protocol filter.. maybe msn ? - -6 Nov 2006 - [Pragma] - - Various minor fixes around - - Splitted the core small icons libraries in separate icons. - - Moved the small icons to a subdirectory to speed up the loading (we are already at more than 280 icons...) - -1 Nov 2006 - [Alexey] - - Added unreal NAMESX and UHNAMES support - - Fixed $hexToAscii function - - Make DCC File Open/Save dialogs have native look on windows - - Fixes in filesystem handling. Fixed bug when KVIrc unable to load translation from non-latin folders - - Fixed actions' accelerators - - CTCP Page dialog now stays on top of desktop - - Fixed in tray minimizing/restoring on win32 - -Oct 2006 - [Alexey] - - WIN32 compiling need QTTAG env var with "mtnc321" value for non-commercial QT 3.2.1 or "mt336" for QT 3.3.6 - - New win32 tray icon - - Added snd.mute, snd.unmute, $snd.isMuted to KVS - - Moved theme selection out from theme options to avoid partyally applying of themes - - Added some lost functions to "painter" class - - Fixed ignore system - - Fixed input themeing (black on black bug) - - "play" command is now alias for snd.play - - IMPORTANT: fixed proper soket closing on win32 - - Fixed crash after first run wizard on *nix - - Make possible installation on USB removable drives (WIN32). KVIrc can store settings in program folder - - Make pathes in configs system-independent - -23 Sep 2006 - [Zerg] (commited by Alexey) - - Change dock icon size to 22x22 on KDE. Fixed style of icon - - Better in-tray minimizing - [Alexey] - - Setted tray icon background to transparent - -18 Sep 2006 - [Noldor] - - Added alphablend in objects.blend - - Added doc to class image and function setOpacity() - ... now we can create some weird, cool effect :=D - -08 Sep 2006 - [Alexey] - - Fixed input line painting bug: cursor goes out of visible range - -25 Aug - 07 Sep 2006 - [Alexey] - - Fixed couple of bugs, include crashbug when applying a new theme - - Rewrited channel mode handling - - Rewrited setup wizard - - Corrected themeing of input - - Del key deletes selected transfer in filetransfers - - Changed trayicon bechaviour. Now it's configurable. - - -25 Aug 2006 - [Pragma] - - uparser is definitively gone: KVS is the reality. - - cleanups all around, removing unused code etc. - - documentation cleanups - -13 Aug 2006 - [Pragma] - - Fixed some docs about KVS - - $boolean(), $string(), $integer() casts. - -27 Jul 2006 - [Alexey] - - Classic taskbar now looks fine in os-style. It uses new frames and borders - - Make classic taskbar resizable - - Make Tree taskbar header hidable. Hide it by default - - Tree taskbar change cursor to hand while moving over an item - -27 Jul 2006 - [Alexey] - - New -a | --all-networks switch for away and back commands to apply their action to all connected networks - - Fixed bug with long channellins scrolling; removed horisontal scrollbar - -27 Jul 2006 - [Alexey] - - Timestamp format now can be configured via options - - Input saves string in history when it was send via Ctrl+Return - - Fixed case sensivity mode handling in usermode popup - -26 Jul 2006 - [Alexey] - - Added option to include MSGTYPE info in theme packs - - Added support fot ports, greater than 65536 - -25 Jul 2006 - [Pragma] - - Comparison operators now prefer numeric operands instead of strings. - - Added $str.printf() - [Alexey] - - Fixed bug in language seletor - - New XML load addon dialog - - Show progress bar while indexing help - -24 Jul 2006 - [Alexey] - - Added XML (single file) theme export/import - - Added ability to delete installed themes - -22 Jul 2006 - [Alexey] - - Fixed bugs in filetransfers window while operating with localized filenames - - Renamed "orphan_servers" to "Standalone Servers" - -21 Jul 2006 - [Alexey] - - Added e2k URL highlighting - -20 Jul 2006 - [Alexey] - - Implemented help topics and keywords caching - - Topic can be viewed via double-click for non-opers in read-only mode - - Fixed PageUp/PageDown in logviewer - - Fixed defsctipt. Kickban now uses mask from kvirc prefs - - Fixed avatar handling while it trnsfered via DCC, filename contains space, but replacing spaces with _ enabled - - Fixed connection to stupid win32 proxies - - Added HTTP Proxy error displaying - - New autojoin channel editor; fixed bugs in channel autojoining - -19 Jul 2006 - [Alexey] - - Fixed DCC non-latin filenames handling - - Fixed avatars with non-latin names handling - -07 Jul 2006 - [Alexey] - - Fixed proxy connection (HTTP proxy doesn't require Server ip resolving now) - - -28 Jun 2006 - [Pragma] - - Fixed some CTCP handling as suggested by CtrlAltCa - - foreach now doesn't iterate over empty variables unless the -a switch is used. - -23 Jun 2006 - [Ahinu] - - Work on the mediaplayer module: more linux support + cmd/fnc cleaning - -10 Jun 2006 - [Alexey] - - Added icons to some tooltips - - Added Alt+DIGIT hotkey for window switching. Removed Ctrl+End hotkey(changed to Ctrl+F4) - -05 Jun 2006 - [Alexey] - - Fixed join channels menu - - Added insert text icon submenu to input editor popup - - Added feature to autosave logs - -23 May 2006 - [Alexey] - - Channel/topic input lines now have a OS-style border - [Fiber^] - - Added hungarian translation - -21 May 2006 - [Alexey] - - Fixed crash while topic contains a text icon - - Fixed colorizing nick as in the userlist while custom color is set for the normal users - -20 May 2006 - [Alexey] - - Added automatic codepage select for servers, that doesn't insart "CODAPAGES" in RPL_ISUPPORT message - - Now recent channels are network-dependend. For example #kvirc@Freenode and #kvirc@Azzurra are the different channels - - Switched to 3.2.3 - - Fixed (finally?) window restoring from tray icon - - Fixes in mIRC color handling - -15 May 2006 - [Alexey] - - Fixed issues when IP specified instead of server name in server properties - -13 May 2006 - [Alexey] - - Added search and document index to the help system - -10 May 2006 - [Alexey] - - Added texticon module to manage text icon collection - - Added detection if the KVIrc running to the win32 insatll script (patch contributed by Zerg) - -02 May 2006 - - Improved win32 insatll script (patch contributed by Zerg) - -22 Apr 2006 - [Alexey] - - Now user can define position and/or tiling methood of backgrounds - -22 Apr 2006 - [Alexey] - - Added visual effects to the tree taskbar - -19 Apr 2006 - [Alexey] - - [WIN32] Added installer script for NSIS installer (nsis.sf.net). It can properly uninstall local data dir, automatically install Winamp plugin - - Added ability to bind sounds on some events via options dialog - -18 Apr 2006 - [Alexey] - - !KVIrc now can run from localized folder (generally WIN32 fix)! - - Added options to strip colors from logs - - Filelist retirned to the left in logviewer - - Restyled win32 tray icon (now it looks similar to the *nix tray icon) - - Added tray icon flashing - - Added $lang function to detect user language - - Updated default toolbars - -15 Apr 2006 - [Alexey] - - updated graphical emotions - - added ability to hide channel's tool buttons - - options dialog is now closable by escape button - - added ability to hide input tool buttons - - colors and msgtypes now can be saved into the logfiles - -07 Apr 2006 - [Alexey] - - added support for caculating md5, md4, md2, sha1, mdc2, ripemd160, dss1 digests via new $str.digest function - -01 Apr 2006 - [Alexey] - - changed KVS_PT_STRINGLIST type to QStringList - - added option to set default ban mask - - added options to set maximum width of classic taskbar button - -17 Mar 2006 - [Alexey] - - More intelligent word highlighting - -14 Mar 2006 - [Alexey] - - Added HTTP Auth compatability - - Redesigned log viewer - - Added ability to remove logs in log viewer - - Added nicer styling of Tool buttons - - Fixed bugs in logfiles naming - -07 Mar 2006 - [Alexey] - - Added ability to choose smyles from external file - - Fixed sorting bans (invites,exempts) by date - -05 Mar 2006 - [Alexey] - - Added option to sort received files by nicks - -26 Feb 2006 - [Pragma] - - KVS now uses 64 bit integers, if possible - - More work on zero port DCC handshakes (still a bit work in progress) - - Finally managed the KviListView to display a transparent background - picture (hopefully) without flickering. Does it work on windows ? - - Added $hptimestamp() for high(er) precision time intervals computation - - Recently also more work on the options dialog - - the theme options now have its own toplevel dialog - (some of the options still need to be moved around) - - added a (still primitive) search function - -26 Feb 2006 - [Alexey] - - added "away" section to the dockwidget menu - - tray icon now transparent under *nix - - added autohide indicator to notifier - -24 Feb 2006 - [Alexey] - - added option for closing in tray (patch by Zerg) - - added option for startup minimized - - added deeper nick change customization in away - - added "Quit" item to the main menu - - new tray icon under *nix, more selective tray tooltip - -22 Feb 2006 - [Alexey] - - improved nick colorization in KViIrcView: now registered nicks are colorised as in the userlist - - now it is possible to assign a comment to the registered user. Comment will be shown it tooltip and WATCH join/quit messages - - added option for colorizing own nick in different color - -21 Feb 2006 - [Alexey] - - added option to disable avatar scaling if it less that required size - -20 Feb 2006 - - registered users can be organazid into groups - - some fixes in maskeditor - -13 Feb 2006 - [Ahinu] - - regchan.list -> regchan.showlist, added $regchan.list - - Added $str.stripcolors - -05 Feb 2006 - [Pragma] - - Started the big cleanup of the options dialog. Identity options for now. - - Moved the translations of the options module to a specific po file. - This makes the job units smaller (for translators) and doesn't force - kvirc to load all these strings at startup. - The original translations are preserved and the translators should - remove the unused overlapping (and commented out) portions of the kvirc_*.po - and options_*.po at the next opportunity. - -03 Feb 2006 - - Improved maskedior. Now it can edit masks;) - - Fixed issues with [] symbols in Wildcard expressions - -02 Feb 2006 - [Pragma] - - Added zero port request handling also for DCC CHAT. - We support it also in outgoing requests now. - - Fixed the problems with execution of perl script that contain warnings. - -27 Jan 2006 - [Pragma] - - Again missed updated - - Initial support for shared double buffering (will reduce memory usage) - - Finished the cool listview initiated by Alexey (still needs testing on windows tough) - - Some other things I have forgot :D - -17 Jan 2006 - [Pragma] - - We now suppor the mIrc zero port DCC protocol both in incoming and *outgoing* transfers - The outgoing protocol is activated by /dcc.rsend -z - - A couple of fixes for the KVS engine - - Some fixes for the perlcore module (almost finished: it just needs a better warning handler...) - [Grifisx & Noldor] - - Some projects updated - - Fixed varius bug in object module (we hope less crashes ;) ) - - Deleted some old, unused objects classes function - - Added function $height() and $width() in class pixmap - - Fixed and optimized objects.blend command: now it is very cool and you can create some eyes candy effect - very easily =)(more new graphic commands will come in the near future) - - The porting of the module object is near to finish: only class socket is missing. - -14 Jan 2006 - [Grifisx & Noldor] - - Added the new class object named "image": at this moment it is in alpha state and without docs; - - Added command objects.blend. - [Pragma] - - Added the math.* module - - Fixed comparison of variables in KVS - -13 Jan 2006 - [Grifisx & Noldor] - - Fixed bugs in object classes - [Alexey] - - Window now saves logging state and userlist state - - CTCP VERSION reply now shows os version and QT version - - Added support for RPL_ENDOFSTATS (219) message - [Pragma] - - Missed to update this file for a while :D - - The object classes are now persistent: they are stored on disk so one does not need to always redeclare them in aliases - - Added the "user friendly commandline" button to the input widget and the global option to keep it automatically on/off - - Other small fixes that I can't remember - -11 Jan 2006 - [Alexey] - - Added an option to disable notifier window flashing - - Fixed doubleclick interval in ircview - - Added support for guessing max modes per line from RPL_ISUPPORT - - Now you must use // prefix in nput line to use full KVS syntax. The / prefix don't parse arguments at all - -10 Jan 2006 - [KVirc Development Team] - - Events now works in objects module - - Lots of other improvements in objects module - - Options to minimize in tray - - New styled checkboxes are fully functional now under all OS - - Fixed mIRC color handling - - Fixed file handling in snd module on localized filesystems - -4 Jan 2006 - [Pragma] - - Started porting events on new KVS - [Alexey] - - Added colors to the topic history widget - - Added ability to count total connection time for all connections for the connection timer applet - -25 Dec 2005 - 3 Jan 2006 - - Removed old KVS - - Added history to the topic editor - - Redisigned splash screen - -24 Dec 2005 - [Pragma] - - More modules ported to KVS: only dcc and dialog are partially missing - at this point. Prepare for the big cleanup :) - - Added JIS7 and euc-JP to the list of supported codecs (thnx hagabaka!) - - Some small fixes to the options dialog that was going nuts recently... - -20 Dec 2005 - [Pragma] - - Almost finished the work on alias namespaces: they should be usable now - - Ported the perl modules to the new KVS - - Ported the sharedfile module to the new KVS too, really few modules - are missing now - - Fixed a couple of buggies in KviCommandFormatter that prevented - aliases from being correctly removed - - Some work in the new KVS engine: the big cleanup is coming...be afraid! - -18 Dec 2005 - [Pragma] - - Alias namespaces and other curious thingies all around - -10 Dec 2005 - [Alexey] - - [Kernel] New theme package format. Now theme s\is a king of addon - - [KVS] Fixed crash while calling $tr("") in new KVS - - [Kernel] Other bugfixes - - [Pragma] - - [Kernel] Fixed crashbugs in KVS kernel - -09 Dec 2005 - [Alexey] - - [Kernel] Fixed bugs in handling modes. Now it is case sensivity - - [UI] Fixed bug with deleting selected text from input line or topic editor - - [UI] Pressing a key in userlist now selects the first nick with first letter, equal to the pressed key - - [UI] Now options splitted into 3 categories: for novice,normal and experienced users. Newbies should see really simple configuration dialog - -07 Dec 2005 - [Alexey] - - [Kernel] KVirc *hopefelly* supports now localized file names and file pathes! (but it really partially support it now:))) - - [UI] Added missed option to the irc option widget. Now user can specify number of maximum send channel modes per line - -06 Dec 2005 - [Alexey] - - [UI] Added themes previews to the setup wizard - -05 Dec 2005 - [Alexey] - - [Kernel] Added soma additional checks to KviRegisteredUser class. - - [Kernel] Mode work on filesystem interfave - - [Kernel] Much better filenames encoding function from internationalization point of view. Logfile names becomes not so ugly:) - -01 Dec 2005 - [Alexey] - - [UI] Fixed bug with nick completion - -26 Nov 2005 - [Alexey] - - [UI] Now it is a programm option to disable splash and no more --disable-splash configure option -27 Nov 2005 - [Alexey] - - [Kernel] Fixed crashes in action and toolbar modules under windows - - [Kernel] Added trick to resolve unmasked local hostname from 001 server message, even when you using +x mode - -26 Nov 2005 - [Alexey] - - [UI] Fixed bug with non-latin search in ircview. Now it works:) - - [UI] Improved \r handling in ircview. Now it can contain colors in the label title. - - [UI] Improved smart nick and channel highlighting. - - [UI] Escape hotkey (minimize window) replaced with Ctrl+Esc hotkey. - - [UI] Better code highlighting and code completion in scripteditor. - -25 Nov 2005 - [Alexey] - - [UI] Added smart nick and channel highlighting. Now most of channel names and nicknames are recognized and you can click on it by mouse:) - -24 Nov 2005 - [Alexey] - - [KVS] config module ported - - [KVS] mediaplayer module ported - - [KVS] fixed _tonns_ of crashes in objects module with new KVS - -23 Nov 2005 - [Alexey] - - [Kernel] Added ability to choose proxy server in irc server's preferences. You can choose different proxyes for different servers - -22 Nov 2005 - [Alexey] - - [KVS] Removed ugly $insertInInput function, added commands window.setInputText,window.insertInInputText and function $windos.inputText - - [KVS] Make new KVS allows to use '_' symbol in functions' names,commands' names and variables' names - - [Kernel] Added support for RPL_ADMINME, RPL_ADMINLOC1, RPL_ADMINLOC2, RPL_ADMINEMAIL, RPL_COMMANDSYNTAX, RPL_INVITING, RPL_INFO, RPL_INFOSTART, RPL_ENDOFINFO, RPL_TIME, ERR_NOSUCHSERVER, ERR_NOSUCHCHANNEL, ERR_CANNOTSENDTOCHAN, ERR_NOCOLORSONCHAN server messages - - [Kernel] Added support for gzipping logs and viewing gzipped logs - [Pragma] - - First step for the implementation of namespaces in aliases (new KVS only) - -21 Nov 2005 - [Alexey] - - [UI] Ctrl+Enter now sends text to the channel(query,dcc chat,etc..) even if it has "/" at beginning. - - [Kernel] Tuned output and string formatting functions. Really solves TONNS of internationalization problems:)) - - [Kernel] Code tuning: chack all sources to proper encodig data, sended to server. Make corrections. - - [Modules] Some other internationalization fixes in DCC module - - [UI] Added option to colorize nicks in channel messages the same, as they colorized in the userlist view - [Pragma] - - ported dialog.textinput - - more fixes around - -20 Nov 2005 - [Pragma] - - Started porting the dialog module - - Added the callback object KVS base class - - a small fix for KviInput (gcc warning) - -08 Nov 2005 - [Alexey] - - [KVS] Error and warning texts are now readable in localized versions - - [UI] Added option to enable or disable showing query information label - - [UI] Added some items into the main menu - - [UI] Added default menu on right click at url link - - [KVS] Added $str.fromClipboard function and str.toClipboard command - - [UI] Channel mode label now allows to edit chanmodes - - [UI] Added new information label into Query window - - [KVS] Fixed bug 0000270 with OnChannelModeChange event - - [Kernel] Fixed click vs double click bug - - [Kernel] Added parsing of 703(WeNet) and 020 messages - - [UI] New topic editor - - [Misc] Fixed some other bugs - - [UI] Fixed permission on topiceditor and mode editors(for ircOps and halfops) - - [Kernel] Fixed bug when message, that have raw event handlers decode 2 times - - [Modules] Fixed internationalization issues in avatar module - - [KVS] Window,reguser,url,term,toolbareditor,regchan modules are ported.. - - [KVS] Log module ported, porting logging system from KviStr to QString - - [kernel] Some fixes for COMPILE_ONLY_NEW_KVS - - [Pragma] - - More work on the KVS engine - - avatar module ported... - - Merged various small fixes done in the last days - -05 Nov 2005 - [Alexey] - - added 7 new events to hangle single clicks - - added 2 new functions to get/set/insert text in window's inut lineedit - - added 2 new options for the proper handling of winamp encoding and ID3 tags' encodings - - started dcc module porting from KviStr to QString - - resolved lot of internatiolization problems in DCC module - - improved defscript - -26 Oct 2005 - [Alexey] - - Added Ctrl+A shortcut for select all - - Total latin1() elemination - - Fixed bugs from bugtrack - - Improved usermode menu - - Resolved issues with encodings in DCC chat and transfer - - Editbox now has focus by default in search window - - Changed /ame and /amsg behaviour - - Make connect/disconnect button to reconnect to last used in this context server,not to last used globally - - Added WeNet network - - Fixed CTCP handling - - Fixed +e and +I chanmodes handling - - Fixed issues with non-latin symbols in scripts - - Fixed encodings in logfiles - - Fixed encodings in socket agent window - - Fixed logfile names - [Pragma] - - A quick fix for the connect button handling - - A fix for a crash in the listview KVS class (new parser) - - More KVS all around - -19 Jun 2005 - [Grifisx/Noldor] - - code improvements in the editor(...stil a work in progress): - added code completition (shift+insert keys), added a dynamic help: move over a command/function. - then right button and "help command/function" (... its in beta status, need some workaround :D) : - an help window will appear. - - added some options to hide graphic elements in the gui to build a very "minimalist" KVIrc. - -15 Jun 2005 - [Grifisx/Noldor] - - code improvements in the editor(...a work in progress): - added find/replace in alias editor, fixed some bugs and added some user friendly feature. - To do: code completition; - - win code improvements in the system module; - - added setBackground command in window module; - -24 May 2005 - [Pragma] - - Added queueing for slow paste - - Added http.asyncGet - -14 Apr 2005 - [Grifisx/Noldor] - - Add wrapper and wizard classes, - added parameters support to all classes, - some fix and changes in many objects classes. - Moved commands "connect","disconnect","clearobjects","killclass" in the module objects. -05 Apr 2005 - [Grifisx/Noldor] - - Added mediaplayer.setVol and mediaplayer.jumpTo commands for winamp, - painter and pixmap class optimization, - added 'Paste file' and 'Stop slow paste' on chan and query. -24 Mar 2005 - [Pragma] - - Added the CIA open source project tracing script to the cvs (only for - the kvirccvs module). Please write informative CVS comments from - now on :) - -23 Mar 2005 - [Grifisx/Noldor] - - added boolInputHistory option to disable Input History window and it's log memory - -20 Mar 2005 - [Grifisx/Noldor] - - added painter, textbrowser and pixmap classes and some extensions to widget class - - add minimize and close button to the iconstable's window - -13 Mar 2005 - [Grifisx/Noldor] - - added functions and signals to manage some event in the lineedit class: - $lostFocusEvent, $returnPressedEvent, $textChangedEvent - - added function $str.section(,,,) in 'str module' - -12 Mar 2005 - [Crissi] - - mp3player module updated: kde mediaplayers - -09 Mar 2005 - [Grifisx/Noldor] - - some new classes in the object module: - mainwindow, toolbar, toolbutton - -08 Mar 2005 - [Grifisx/Noldor] - - Fixed CTRL+K, CTRL+B, CTRL+U, CTRL+I...escapes in the topic widget - -27 Feb 2005 - [Pragma] - - Fixed the CTRL+D terminal window crash - - Fixed the Rijndael encryption module - -22 Feb 2004: 3.2.0 "Realia" released. - -20 Feb 2005 - [Pragma/Iakko/Noldor/Grifisx] - - Several fixes on the notifier - - A lot of enchancements in the objects module (some new classes - and some extensions to the existing ones) - - Improved auto-resume DCC handling: now files are not - auto-resumed when the incoming size is unknown or smaller - than the existing file. The auto-resume is disabled also - if there is a running transfer with the same loca file name. - - Fixed several bugtrack issues. - - Cleaned up the -ansi -pedantic compilation. It looks that - only one real warning remains and it is related to the "deprecated" - flags of KApplication constructor which will be removed - in KDE 4.0. We must live with it for a while. - All the other warnings are due to the system headers. - - Caught a couple of potential segmentation faults in the reguser - module. - - Committed the catalan translation by Marc Serra - -09 Feb 2005 - [Tom] - - Fixed several positioning issues for widgets with saved geometry - on MacOS X - -09 Feb 2005: - [Noldor/Grifisx] - - Added the KVS process class - - Several fixes for other object classes - - Added Drag&Drop support to the queries: now a drop operation - triggers the OnQueryFileDropped event - - Added support for CTRL+K, CTRL+B, CTRL+U, CTRL+I ... escapes - in the topic widget. - -08 Feb 2005: - [Noldor/Grifisx] - - Added the KVS radiobutton class - -08 Feb 2005: - [Pragma] - - Fixed the bug of KviIrcView that caused the background to be repainted - incorrectly when the mouse was hovering over the links - - Private background now has priority even over the global transparency - - Added a menu option to reset the private background pixmap when no longer needed - - Removed the "FrameCaption" option since it was only freaking the people - out when it wasn't updated on version change... - -07 Feb 2005: - [Pragma] - - Finally managed to handle correctly the IME events: text input for chinese/japanese - korean etc... should work now. - - Fixed the logging of emoticons: they are written to the log files now - - More tricks on KviHeapObject - - Added the fixes for the _horrible_ VC++ compiler bug that implicitly - creates helper functions (vftable entries) residing in code sections where - operator new is called on a class with a virtual destructor. This is - simply destructive when it happens in a module that can be unloaded - before the object allocated with new is destroyed: at delete time - the code flow obviously jumps into no man's land. - - Committed the ldcnumber class by Noldor and Griffisx - -04 Feb 2005: - [Pragma] - - Added the fixes for windows segfaults reported and bughunted by Noldor and Grifisx. - Maybe these KviHeapObject trick will help to solve the issue. - - Added a warning message about sending more than 20 lines of text - at once in a query or channel. The warning can be obviously disabled - forever by answering "Always". - - Added the XIM "hot spot" handling for the input window. - - -01 Feb 2005: - [Pragma] - - Bandwidth limits for DCC finished. They are configurable "on the fly" now. - - Fixed the Ctrl+Arrows and Ctrl+Shift+Arrows behaviour: now they skip/select - entire words in the input widget. Window switching has been moved to - Alt+Arrows and Alt+Shift+Arrows. - -31 Jan 2005: - [Noldor/Grifisx] - - Yet more object classes: time for spinbox and slider. - -30 Jan 2005: - [Pragma] - - DCC Bandwidth limit implemented, "on the fly setting" is still missing tough - -29 Jan 2005: - [Iakko] - - Added Notifier 2.0 in a more stable and usable version, now tabs and - "blinking onFocusOut/showing" are working. The Notifier is still on Beta version. - - Some kvi_sp_literal.cpp and kvi_sp_ctcp.cpp (under kvirccvs/kvirc/src/kvirc/sparser) changes - needed for notifier to work. A core recompilation is suggested even if - not strongly necessary.. it's a matter of string output on the notifier, nothing critical. - - Graphic features are waiting to be added asap. - -29 Jan 2005: - [Noldor/Grifisx] - - Added a new widget class "progressbar" with the following functions: - $setProgress, $setTotalSteps, $reset, $setCenterIndicator, - $setPercentageVisible, $isCenterIndicator, $isPercentageVisible - -28 Jan 2005: - [Pragma] - - Added the possibility of exporting toolbars from the toolbar - customization dialog. The export function can also export - the associated actions. - - Moved the toolbar customization dialog to a separate module - - Added the mircryption/blowfish crypt engine. It actually supports - both the standard ECB mode and the (really) new CBC mode. - - Fixed some remaining bugs in the action editor: now it should - be ready for the public :) - - Added a couple of object functions to the layout object class - to support the nice minesweeper script :D - - A full set of action.* and toolbar.* commands is now available - - Added compatibility loading functions for old toolbars - - Added handling of the ERROR server message. - - Added the support for actions that can be enabled only in - specified windows and only if there is a nonempty selection inside. - This allows to create user toolbars that perform quick actions - on the selected channel users. This is a *really* quick kick - for example. - - Fixed a couple of bugs related to the mask handling - - Fixed a possible bug related to acknowledges in the DCC send code - - Other small fixes all around as usual. - - -27 Jan 2005: - [Noldor/Grifisx] - - added $setFont to the class widget,$setDragEnabled and $setInputMask - to the lineedit class; - -20 Jan 2005: - [Noldor/Grifisx] - - added some new functions to the class widget: $setToolTip, - $setForegroundColor,... - - some code improvements in the win version of the filetransferwindow: - added context menu like open,open with,delete file,open destination folder - -8 Jan 2005: - [Pragma] - - Added handling for ERROR and the relevant OnError event. - -7 Jan 2005: - [Pragma] - - Again more than 20 days of changes to report. - - The action based toolbars are almost working and have replaced - completely the old scriptable toolbars. - - The toolbar customisation dialog is ready - - Actioneditor is almost ready too, needs just minor adjustments - - Added $chan.userJoinTime() and $chan.userLastActionTime() - - Added several new $mask() types: now it is possible to get different - host masks (only *.domain.ext or *.anything.anythingelse.domain.ext). - Another mask set tries to handle correctly the hidden hostnames (+x) - on some servers (this does not work 100% tough...) - - Added the initial stuff for the language recognition module. Still - don't know if it will end up in the official release: needs interfacing with - the core... but the standalone engine is starting to work. - - Added several "smart" encodings that will try to decode as UTF8 first - and then apply the local encoding rules. - - Added a couple of new emoticon images (Thnx Penny!, Thnx Sidhe! :) - - Created the "scripts" cvs module and added a first script example - (a simple ezbounce irc proxy interface) - - Fixed runtime localization of the action and toolbar names: they - should work fine now. - - Fixed some bugs in the objects module (still needs a lot of work) - signaled by Noldor. - - Bumped up libtool and ltmain.sh to 1.5.10 (hoping that it will stop - relinking the modules when installing... this is extremely annoying) - - Suggest installing the default script if no toolbars or popups are available - - Fixed http avatars not being correctly loaded after the transfer has finised. - - Iakko is working hard on the new (cool!) notifier interface :) - - Various other fixes all around - -15 Dec 2004: - [Pragma] - - Hacked the avatar cache to support masked ip addresses - (added some new parameter options to the $mask function by the way) - - Added the possibility of setting a temporary background for any IRC view. - This is still an experiment. - -12 Dec 2004: - [Pragma] - - Added minimal support for /DCC ALLOW - - Fixed config files loading that truncated lines longer than 32K - -8 Dec 2004: - [Pragma] - Yet another huge set of commits. - The major changes are: - - New "action" based toolbar and popup menu system. - Now the user can just drag & drop actions to customize toolbars :) - - The "big cleanup" has started: - - "Scripttoolbar" is gone: the functionality is completely superseeded by - the action based toolbars now. I already know that some people will want to kill - me for this but from now on the actions are the only method to create toolbars. - This is a good idea since the old method was a bit ugly (for example because - it needed overriding events to enable/disable the actions). - Moreover, another piece of the old non-unicode parser has been wiped out: this is Good(TM). - - Module extension toolbars are gone: replaced by the action stuff now (see above). - - Several structural changes to the default script that reflect the changes in the core. - It IS a good idea to reparse it (execute default script) once now. - -4 Nov 2004: - [Pragma] - - Fixed various minor bugs introduced with the last huge commit. - - Merged the Mirco Macrelli's patch that adds the chanowner flag - support. - -1 Nov 2004: - [Pragma] - I've missed to update this file for a while: my fault :/ - The major changes until now are: - - New statusbar showing the server informations. - This is intended to replace the irc context applet which - often has problems with space. - - 5 moveable statusbar applets - - Per network settings: nick,user,OnLogin,OnConnect,NickServ - authentication etc. as per-network settings. - - Both the servers and the networks can have a preferred - encoding now. - - More UNICODE support all around: the encodings are honored - almost anywhere with the exception of the scripting engine. - The scripting engine uses a hack that makes the encodings - survive through trivial scripts too. This will become yet - better when the new KVS core will be ready. - - Support for unicode nicks and channel names. - In fact almost anything that the server sends out may be unicode - data encoded with some 16->8bit scheme. - - A new rewritten lag meter that will avoid to ping the server - if possible (when other lag-check probes are spontaneously - being sent). The improved algorithm computes the lag better - and does not "hang up" when the server doesn't reply at all. - - The default quit and part messages can contain scripting identifiers - that are evaluated at quit or part time. - - The windows problem with keyboard input has been resolved - - Several enchancements to the actual scripting engine including - but not limited to echoprivmsg, query, notice, notifier.* , - perl.*, server, ... - - Added OnDisconnectRequest event - - Added support for /CODEPAGE - - Avoided unnecessary repaints when in SDI mode: this made - KVIrc a bit faster when switching windows and lowered - the overall cpu usage. - - The "unread" text in a window is now clearly marked by a horizontal - line in the text view. If the text line is out of the view - then a triangle in the upper corner of the view signals it. - - KviWStr stuff definitively removed :))) - - Several other minor bugtrack issues fixed. - - -6 Aug 2004: - [Juanjo] - - Make some pointer = 0 after delete assignations when: - Pointer is a member pointer or a global pointer. - The delete is not in a destructor. - It makes sense. - -1 Aug 2004: - [Juanjo] - - Added an autopackage dir with two (very initial) apsepc files to build a - .autopackage autoinstaller. - If you have not - checked autopackage (http://autopackage.org) DO IT NOW :) is the real - solution for Linux third party software installation across distributions - (somewhat like autoconf at the binary installation level, but without - damn M4 :) - -20 Jul 2004: - [Pragma] - - Now you can use perl from KVS and KVS from perl :) - See /help perl.begin - -13 Jul 2004: - [Pragma] - - Perl support has been widely requested. Added the initial modules - for that purpose. Needs more work tough. - - More work on the notifier: now it's fully working. - Added also the options to disable it in several ways (even completely). - - Fixed various bugs all around - -11 Jul 2004: - [Pragma] - - Added /AHOST command - - More work on the notifier, now it flashes, pops up only when really - needed and can be temporairly disabled. - - Hardwired the event manager of the new KVS engine and officially - killed the old uparser based event manager. We're getting closer and - closer... - -08 Jul 2004: - [Pragma] - - Added the notifier module: really nice! - Thnx to Penny for the images :) - -06 Jul 2004: - [Pragma] - - Added a Always/Yes/No message box that asks the user for confirmation - when attempting to close a connected console. - - Added the Always/Yes/No option to the "Quit-Kvirc-On-Close-Last-Console" - operation. - - Fixed the input history handling bug as reported by Soliton - - Added several fixes for UNICODE misbehaviours reported by Dusan - - Fixed the configuration files parsing: now the entries - and the keys have whitespace encoded separately and the UTF8 - encoding/decoding is done in the proper places. - - Added the code to make the translation of the tips possible. - The translations MUST be UTF8 encoded and use the - libkvitip_.kvc name. - - Finally fixed the copy&paste behaviour: - In the input the selection and the middle click - use QClipboard::Selection if supported by the operating system. - All the other methods use QClipboard::Clipboard. - The IRCView now copies to both QClipboard::Clipboard and - QClipboard::Selection (if supported) - - Again huge structural reorganizing in the networking stack - now I start to like it :) - - Committed several translation updates by Dusan - - The reconnect timer can now be stopped before it triggers - and on disconnect it uses the correct server entry. - (see Trisk's ChangeLog entry for 12 Mar 2004). - -26 Jun 2004: - [Pragma] - - Fixed a mismatched new[]/delete pair in kvi_locale.cpp - - More KviConsole->KviIrcConnection moving - - Fixed a couple of potential segvs related to the connection management - - More UNICODE fixes all around - -24 Jun 2004: - [Pragma] - - Yet more bug fixing - - Added the cs translations of the modules and fixed some unicode issues reported by Dusan - -21 Jun 2004: - [Pragma] - - Fixed a bug introduced by the previous fix about date encodings :D - - Fixed log files not being properly encoded to UTF-8 (question: should - the logs be UTF-8, use the local encoding or use the source window charset ?) - - Committed more work on kvirc_cs.po by Dusan Hokuv - -20 Jun 2004: - [Pragma] - - More reorganizing of the networking stack - - Fixed some bugs with encoding of the dates in non-english locales - -16 Jun 2004: - [Pragma] - - Fixed a crash in the /foreach command as reported by Ahinu (thnx ;) - - Added the OnNetsplit event - - More reorganizing of the networking stack - -12 Jun 2004: - [Pragma] - - A lot of UNICODE updates - - More reorganizing of the networking stack - - Added a lot of new text encodings including the missing ISO-8859-XX variants - and some CPXXX. - -4 Jun 2004: - [Pragma] - - Added first bulgarian translation by bugar@developer.bg - - Completly reorganized the - class set. Now it should become more usable/readable/manteinable/coherent ... - Really work in progress: expect misbehaviour and compile time warnings about - deprecated functions... - -2 Jun 2004: - [Pragma] - - Added profiling support (--enable-profiling) - -31 May 2004: 3.0.1 "System Virtue" released. - -11-30 May 2004: - [Pragma] - - More console splitting , still not finished - - Created the initial hackers guide document (this will be always work in progress) - - Fixed some online doc bugs - - Fixed a bug with popup menu prologues not being saved correctly - - Fixed a SEGV related to focus management - - Fixed a couple of translation related SEGVS - - Preserved UNICODE in the logs by encoding to UTF-8 - (maybe this should be the local 8 bit ? feedback will be needed later) - - Fixed several typos and dead links in the documentation signaled - by Klaus Weidenbach - - Added a couple of window.* module commands/functions - - Unicode fixes related to IrcView tooltips - - Added $msgtype function and fixed the related echo documentation - - Added the export function in the event editor - - Fixed a bug in the popup export function that caused extpopup entries - without icons to be exported as simple popups (thnx again Klaus). - - Added an option to redirect WHOIS replies to the active window (on by default) - - Added the /echoprivmsg command - - Added the "delete file" function to the file transfers window - - Various fixes all around - -10 May 2004: - [Pragma] - - Fixed the problem with tooltips displaying the wrong avatar image - - Started splitting KviConsole in smaller logical classes (irc context, irc connection) - -06 May 2004: - [Trisk] - - Changed parsing for 004 numeric, properly works with hybrid now. - -17 Apr 2004: 3.0.0 "Awakening" released. - -16 Apr 2004: - [Pragma] - - Fixed a bug with creation of KviWindow derived classes: the constructor - of the base class was calling virtual functions from subclasses (it is curious - that this was effectively failing only on Windows and not on Linux). - - Reworked a bit the str module to avoid compiler parameter passing problems - - Fixed a bug with $str.replacenocase - - Fixed a bug that prevented the color option selector buttons from - displaying the proper color - - Miscelaneous fixes for the release - -15 Apr 2004: - [Trisk] - - Miscellaneous minor stuff (set avatars to 0 width/height to disable). - - More reasonable defaults (seriously, the coloured nicks hurt people's - eyes =\ ). The fact that unrecognised commands result in parse errors - confuses new users (and annoys the heck out of me, too). Turned off - message icons too. Rationale is that it will disgust former - epic/BX/irssi/xchat users. - - And, I don't think most new users will use avatars regularly, so turning - the nicklist grid off by default, since it makes the nicklist more - cluttered. - * Forgot to add nick completion suffix. Oh well, the 3.0 series is just - beginning... - - Almost forgot to clean up really bad spelling in tip of the day. >< - -13 Apr 2004: - [Pragma] - - Added the default low-resolution (Minimalist) and high-resolution - (fancy) themes - - Added the selection of the default theme at first setup - - Added one time nickname generation at first startup - - Modified the Identity dialog to handle better the multiple - nickname alternatives. The combobox was not that intuitive - thus added a separate dialog for the alternatives. - - Removed the "Change now" button from the Identity dialog: it never - worked correctly. - - Fixed the "concurrency" crash reported on the mailing list - - Fixed a SEGV related to shared files - - Fixed an infinite loop in the toolbar editor - - Fixed a bug with the Color Selector not displaying the right color on windows - - Adjusted acinclude.m4.in to handle the new icons added by Trisk: still not - installed in the proper locations - - Added a couple of GUI option pages that were really missing (mdi captions - and toolbar applets) - - A couple of new icons added - - Fixed a couple of strange behaviours of the input widget - - Some source code rearrangements all around - - More things that I can't remember :D - -11 Apr 2004: - [Trisk] - - New application icon by Arty2 / Hercules Papatheodorou - , updated icon set. - * Too lazy to get icons installing in proper locations. - -08 Apr 2004: - [Pragma] - - Added the highly requested /exec command in the core - - Also added an example script that runs an interactive telnet - session and sends mail with the use of /exec: powerful :) - - Fixed a script editor highlighting bug - - Fixed another problem with overlapping dns queries... - ... it should have been written this way from the beginning :D - - Miscelaneous changes & fixes all around... - -06 Apr 2004: - [Trisk] - - Fixed null KviWStr problem. - - Fixed /$sw(e) crash. - -04 Apr 2004: - [Trisk] - - Hacked KviWStr to use QTextCodec instead of charset translation tables. =P - *** Chinese, Japanese, Korean seem to work! - - Fixed encoding names. - - Added ISO 8859-9 (Latin-5 Turkish, requested), Big5, GB18030, SJIS, - EUC-KR, TIS-620. - - Added options to not show tooltips in taskbar and userlist. - - Added option to disable taskbar sorting. - -02 Apr 2004: - [Trisk] - - DCC message changes. - - Use proper capitalisation in events, Irc->IRC. - - Hack to allow showing +e (and +I) when used for channel modes (not user - modes). - * Should implement better 005 parsing. - -31 Mar 2004: - [Pragma] - - Added the quit confirmation dialog when there are active connections in the - window being closed - - Added some descriptive messages to the setup dialog - - Fixed a crash related to received CTCP's - - Fixed the theme loading that was not updating all the icons - - Fixed some functionality of the theme selection dialog - - Added some message color presets - - Fixed a crash with overlapping dns queries - - Added updating of the KDE root pixmap when autochange is active - - Added the "execute script" menu entry - - ... - [Trisk] - - Some message changes. - - Added redirect to active window options for services notices, server - notices, broadcast/wallops, and renamed ToConsole options. - - Minor server parser changes. - -28 Mar 2004: - [Pragma] - - Added the default theme (useful to restore the default settings) to the distro - - Some bug-fixes and cleanups in the theme engine - - Added the themes section on www.kvirc.net and placed the first Marble theme by Sbrokka on ftp.kvirc.net - - Adjusted the menubar to dynamically setup the popup menus (it reloads the icons etc..) - - Fixed a crash in ctcp action - - Added the option to flash the KVirc's taskbar entry when new messages arrive in a query and KVIrc is - not the active application. Works only with KDE support and on Windows for now. - - Added the special "all" parameter to $active to return the application active window - - Forced eval to use the calling variable scope: in this way local variables can be passed too - - Fixed a bug in the servers dialog "recent servers" popup: now it finds the correct entry also - when two servers with the same name but different port are present - - Added the exporting of aliases to external files (single aliases and the whole alias set). - - Fixed the popup tester in the popupeditor: now it works again (it was totally disappeared :) - - Misc hacks that I can't remember... - -25 Mar 2004: - [Pragma] - - Code cleanups all around - - Updated various docs for the upcoming release - - Removed the obsoleted _c2q stuff and --with-local-8bit option - - Changed the close/maximize/restore/minimize icons to black ones: they look better - - Added a heap mess windows workaround class - - Re-implemented the shared files editing (still missing some code) - -24 Mar 2004: - [Trisk] - - Various input editor fixes. - - CTCP parser improved. - - Updated default script. - - Options dialog fixes. - -21 Mar 2004: - [Trisk] - - Many, many more options dialog changes. - -20 Mar 2004: - [Pragma] - - Added several window.* functions - - Redirected /whois output to the active window - - Options dialog fixes - - Added scripting toolbar - - Cleaned up some documentation and forced gendoc.pl to ignore the new kvs docs that are not "hardwired" yet - - Added some graphics for the final 3.0.0 release - - Added a couple of keyboard shortcuts (all described in doc_keyboard.html) - -20 Mar 2004: - [Trisk] - - Some parsing of 005/RPL_ISUPPORT added. Uses PREFIX and and CHANTYPES. - -18 Mar 2004: - [Trisk] - - KviUserListView API change: set[beI]Entries -> setMaskEntries(). - - KviUserListView minimum width is 100px (due to continuing annoyance of - mode editor resizing the thing... not a good solution, but whatever). - - Lots of options dialog changes. - - Classic taskbar now limits number of rows (when horizontal). - - KviChannel API change: banMask(), etc. removed in favour of setMask(). - - Mask editor requests new list when opened after a mode change. - * Fixes problem with CR ircd where -b messages may not match bans in list due to stupid inconsistent hostmasking. - -12 Mar 2004: - [Trisk] - - Auto-reconnect attempts are now counted, delay configurable. - * FIXME: Make it possible to stop the reconnect timer before it triggers. - - Several huge if() conditions replaced with switch() statements. - - Various minor issues fixed. - -07 Mar 2004: - [Trisk] - - Improved script editor cursor location tracking and configuration dialog. - - Input widget clean-ups, global input history fixed. - -03 Mar 2004: - [Pragma] - - Some work on the options dialog: moved some options to more appropriate places, - rearranged some options widget orders, fixed descriptions etc.. - - Fix for OnChannelNotice not passing the target argument - - More misc hacks that I can't remember :) - -02 Mar 2004: - [Pragma] - - Added OnQueryWindowRequest to catch and block the query window creation events. - - Added OnQueryTargetAdded - - Corrected a lot of bugs reported on bugtrack.kvirc.omnikron.net - - Corrected the $mask.nick() problem - - Removed the $ic warning when there was no current IRC context - - Moved the server database to unicode - - Misc hacks that I can't remember :D - -28 Feb 2004: - [Pragma] - - Fixed the "keep channels open on kick" crash - - Probably fixed a sort of a race condition based crash between - the socket and the console - - More fiddling with KVS events - -24 Feb 2004: - [Pragma] - - Yet more work on the KVS engine: events this time - - Temporairly removed the "force last server" hack since it was breaking the - servers dialog: one couldn't select a different server to connect to. - This is commented out until we find a more strict activation condition. - - Activated the $sw function, this time for real :) - -20 Feb 2004: - [Trisk] - Added $date function for formatted time strings. - -18 Feb 2004: - [Trisk] - - Added "all" target for $me and $server functions. - - Fixed possible $mask() problem, not sure why Pragma removed '*' from - *user. Behaviour should be consistent with docs now. - - Cleaned up channel prefix and nick mode prefix (considers invalid chars - in nick to be a mode prefix). - * Closes ID 200402112009267112 - * Somebody needs to update the bugtracker... - -14-17 Feb 2004: - [Pragma] - - Rewritten the script editor widget to use QTextEdit. Dropped - the whole internal editor since it was not unicode and simply - too huge for the feature it provided. - - Modularized and cleaned up the localisation of the editor module - - More work on KVS engine, module interface nearly estabilished - - Added support for changing the order of option items in the - options dialog tree display. Most common options should go at the top. - - Random fixes around :) - -14 Feb 2004: - [Trisk] - - Changed 005 numeric parser output a bit, fixes issues with skipping to - last word of messages. - * /me hugs Aeri ;) - - Removed check for KviProperty_FocusOwner. - -09 Feb 2004: - [Juanjo] - - Fixed a miscompilation --without-info-tips - - Added the lag to the irc context indicator tooltip. - - Make the irc context indicator a little bigger (but the correct way - would be to make it resize itself depending on the inside text size). - -06 Feb 2004: - [Pragma] - - More work on the KVS engine - - Added the IrcContextToolbar to the toolbars menu, now it can be hidden - should the TaskBar be there too ? - - Moved the TaskBar to be a toolbar like the other ones (and - thus inherit the toolbars menu on right click etc...) - -05 Feb 2004: - [istari] - - reformating ChangeLog - * please use current schema - * break lines after 80 chars - - intserting ChangeLog into website - -23 Jan 2004: - [Pragma] - - More work on the KVS engine : popups almost ready - - Fixed a regusers bug that didn't allow to register channels with a '@' - character in it - - More windows port: kvilib, kvirc and several modules are already working - - Fixed an expression parser bug related to string/number comparisons - - Added $sw() function for switch handling in aliases - -20 Jan 2004: - [Trisk] - - Dock icon menu bug fixed, new entries added. - * Problem with switching to console on frame window restore still present, - Pragma: Please fix - - Input right-click menu shows shortcut keys. - -19 Jan 2004: - [Trisk] - - Adding multiple servers wtih the same hostname (different port) works. - -17 Jan 2004: - [Trisk] - - Fixed some more encoding issues. - - mkprocinstances.sh doesn't use zsh/bash-specific variable arrays now. - -15 Jan 2004: - [Trisk] - * PragmaOff's been idle for a long time. =\ - - Made logfiles lowercase (helps sorting, if any issues contact me). - - Made channel and query windows's default logfile contain network name - instead of console #... makes more sense. - - Massive server parser changes to ensure text is converted to current - encoding (fixes issues displaying ISO 8859-1 extended ascii (127+) text). - - Changed all %d d %d h %d m %d s to %dd %dh %dm %ds. - -09 Jan 2004: - [Trisk] - - Lots of notify list message changes. - -08 Jan 2004: - [Trisk] - - More widget width problems fixed (presumably). - - WHO reply is more informative now. - - Shortened some taskbar button captions. - - KviConsole::createQuery() tries to prevent duplicate single-target queries. - -06 Jan 2003: - [Pragma] - - More work on the new KVS engine - - Added a -nosplash commandline argument to avoid showing the splash screen - - Reverted the kvi_activitymeter.png icon: the bars should eventually grow - from left to right (in the image) instead of top to bottom. - - Re-added $window to kvi_kvs_corefunctions_sz.cpp : it's the new parser - version and it will replace the old parser's version in the near future. - If you want to test the new parser capabilities then run the commands - by preceding them with a dash: - /- echo "This is the new parser's version of echo" - /- echo $window this is the new parser's version of echo \$window - ... - - Added four ways of painting the user list view grid. It is user selectable - now. - Please tell me which is the best one (to choose the default) - -04 Jan 2004: - [Trisk] - - Removed duplicate of $window from KviKvsCoreFunctions - (kvi_kvs_corefunctions_sz.cpp), original is in the uparser... - - Fixed all the "Jan 2003" dates in the ChangeLog. =) - - Fixed KviStringSelector etc. width problem. - -03 Jan 2004: - [Trisk] - - New images, help browser uses Bluecurve ones (temporarily). - - Taskbar now displays same number of buttons per row. - - Various spacing changes to selectors again. - - Fixes to identity dialog. - * For some reason, the 4th nickname stays blank... not sure why. - - Various QFrame::Panel -> QFrame::StyledPanel. - - Dead channels unset limit and key too. - - Window list shows same name for dead channels and queries. - -02 Jan 2004: - [Pragma] - - Solaris Forte 7 port (still needs hacking to compile and run flawlessly) - - Fix for Solaris dns resolver - - More work on the new KVS engine - - stdarg.h wrapper to accomodate ugly compilers - -01 Jan 2004: - [Trisk] - - Dotted line drawn next to nick/avatar in nicklist instead. - - Changed IP addy editor widget to properly accept '.' and ':'. - - Redid identity config dialog. - -New Years Eve, 2003: - [Trisk] - - Draw separator lines above and below avatar and nick. - - Join channels dialog cleanup. - - Dock widget minor header changes. - -30 Dec 2003: - [Trisk] - - Cleaned up some options dialog stuff. - - Added $version function. - - [Pragma] - - HTTP avatar option support - - More unicode porting all around - - Windows port (kvirc and kvilib projects nearly working) - -29 Dec 2003: - [Trisk] - - Fixed problem with toolbar options dialog command. - - Changed ident, proxy, SSL, and transport options pages to use QGroupBox to - organise options. Maybe add add*SelectorToGroupBox functions later. - -28 Dec 2003: - [Trisk] - - More new toolbar icons, currently using Bluecurve/Crystal mix. - - Recent channel, server, and nickname list removes duplicates even if case - differs. - -27 Dec 2003: - [Trisk] - - Possible fix for crash if m_pConnectionInfo->szNickName is not set when - server disconnects the client (before login). - - Sets AsyncServerCommand on disconnect only if nonexistant; /SERVER works - now (sorry about that, Pragma). - - New Connect/Connecting/Disconnected icons. - - Removed border from channel state and mode icons in user list view and - lined up icons with text when avatar is used. - - [Pragma] - - Added avatar caching - - Reworked the code that remembers the last irc server connected in each - console now it doesn't break the servers dialog. - After the commit I've discovered that it collided with the Trisk's solution: - merged the two solutions in something yet better. - - Obscure internals: reworked KviIrcMask interface a bit... - still needs QString porting - - Written a ChangeLog entry after months of "hidden changes" :D - -Christmas Eve (Western Hemisphere) 2003: - [Trisk] - - Modified window tooltips a bit... - - Unset channel mode for dead channels - - Fixed (hopefully) crash on closing dead channels if disconnected. - - Remove src/kvirc/kvs/moc_kvi_kvs_object.cpp from repository. - * Merry Christmas everyone! =) - -21 Dec 2003: - [Trisk] - - Output correct message when RPL_CHANNELMODEIS is used for user modes. - - URL highlighting matches only if followed by char greater than 46. - - Selected text includes control codes (this is a bit of a hack, gets them - from block attributes). Shift-select strips codes from the selection. - - Consoles remember last nick (correctly now). - - PART, TOPIC, and MODE messages will use current channel if no argument. - KICK will send proper command if no reason specified. - - Non-query notices and privmsgs go to active window if it is a common - channel, else to first common channel. - -16 Dec 2003: - [Trisk] - - GRAMMAR FIXES EVERYWHERE - * Breaks translations! - * Breaks stats program log parsers too (pisg) - - Cleaned up gendocs.pl link names. - - Rearranged menubar to conform to KDE style standard. - - Edit menus and buttons for "Book Title" style, changed some item names. - * PLEASE FELLOW THE KDE STYLE STANDARD, it looks better and is less confusing - - Made KviUIntSelector use QSpinBox instead of QLineEdit (again). - - Added uop/userop (+u) support. Currently uses +h icon, will change later. - - Removed many hardcoded font references. - - Made logfiles rotate at midnight to update date. - * Put timer in KviTimerManager for lack of a better place, somebody check - that this is correct, please... - - Changed tree window list to show server name for consoles of console caption - (too long to view). Set bold font for consoles. - - Fixed channel name showing up twice on part when no message is specified - - Made external messages (whois info, server notices, etc.) go to console by - default, added option ExternalMessagesToActiveWindow to override this. - - Also fixed opnotice (NOTICE @#chan) and made non-query private notices and - privmsg go to common channel. - - Replaced CPPFLAGS in all Makefile.am with AM_CPPFLAGS. - - Made channels missing request mask list when mask list editor is opened. - - Changed KviIrcMask::getHostDomainMaskPtr() to strip only first part of host; - user@x.y.z.tld.cc returns user@*.y.z.tld.cc, not user@*.tld.cc - much - more specific bans, same as getIpDomainMaskLen(). - * This code was already there, but commented out - why? - - Made console windows remember last server and nickname. - -21 Oct 2003: - [Crissi] - - 'Always highlight messages with my nick on them' added: Check - irc::output::highlight tab on options. - - 'Hightlight only at normal msg' added: Check irc::output::highlight - tab on options. - - 'Highlight at highlight msg too' added: Check irc::output::highlight - tab on options. - - 'Highlight at query msg too' added: Check irc::output::highlight - tab on options. - - 'Highlight only at costum alert level reached' added: Check - irc::output::highlight tab on options. - - Translation updated - - 'Old Tools' menu moved into 'Tools' menu. - - convert all source files to unix line end because bug in gettext for - extracting strings from window lineend - - -12 Oct 2003: - [Crissi] - - auto connect of servers after succuessful KVirc startup. Look into advanced - server info, connection tab. - For each server you can specify if should autoconnect. - -11 Oct 2003: - [Crissi] - - Channels can now stored for each server and then auto join them if - successfully connected to the server. Look into advanced server info, - 'After login join channels' tab. Simply check the channels (from history) - you want to join. Also you can add a new channel (current bug: after - adding close/reopen the dialog for showing new channel in list). - - Minimize console after successful login. Look into Preferences - Options - - Connection. - -12 Aug 2003: - [Crissi] - - 'Minimize all windows' and 'Restore all windows' added. Check Menu - - Window and window action toolbar. - -01 Aug 2003: - [Juanjo] - - I'm back, ahhh nothing like vacations to do some free software ;) - - The channel completion will also complete on the list of recent channels. - - New server completion, if the first four letters of something written on - the input are "irc." it will try to complete on the list of recent servers. - -18 Apr 2003: - [Crissi] - - exec module added. Check kvirccvs/modules/exec/README for more info. - -26 Mar 2003: - [Crissi] - - GUI option 'Use taskbar activity meter' added. - - GUI option 'Disable ban list request on join' added. - - GUI option 'Disable ban exception list request on join' added. - - GUI option 'Disable invite list request on join' added. - - GUI option 'Use taskbar activity meter' added. - - Translation extract script fixed - - Translations and translation template updated. - - Some comments in kvi_options.h added. - -26 Mar 2003: - [Pragma] - - Option 'Use taskbar activity meter' added. - -28 Feb 2003: - [Crissi] - - The width of the taskbar entries is now custoumizable. - - GUI option 'Minimal width of taskbar buttons' added. - -25 Feb 2003: - [Istari] - - Moved to the new CVS machine - -25 Feb 2003: - [Crissi] - - GUI options for symbols on taskbar and disabling global who added. - - Try to show emoticons with start not with : correctly (not from me...)... - tell me if you got problems with this... - -25 Feb 2003: - [Pragma] - - Option for disabling icons in taskbar added. - -21 Feb 2003: - [Crissi] - - Fixed text on first setup page, Translation possibility for buttons in - wizard added. - -20 Feb 2003: - [Pragma] - - Auto-resume transfers when auto-accepted (also GUI option) added. - -19 Feb 2003: - [Crissi] - - Password field for server shows now only stars instead not plain password. - -18 Feb 2003: - [Crissi] - - Size of toolbar icon fixed. Right size s now selected if toolbar size if - changed. - -18 Feb 2003: - [Pragma] - - Support for broken filename RESUME requests (mIrc's file.ext) added. - -15 Feb 2003: - [Crissi] - - $mp3player.getmp3tag_album added => get the album - -12 Feb 2003: - [Crissi] - - The mp3player module now supports reading of mp3 tags. - - New commands are: - - $mp3player.getmp3tag_artist => get the artist - - $mp3player.getmp3tag_comment => get the comment - - $mp3player.getmp3tag_copright => get the copyright - - $mp3player.getmp3tag_crc =) get the crc - - $mp3player.getmp3tag_date => get the year - - $mp3player.getmp3tag_emphasis => get the emphasis - - $mp3player.getmp3tag_genre => get the genre - - $mp3player.getmp3tag_layer => get the MPEG layer - - $mp3player.getmp3tag_original => get the orginal flag - - $mp3player.getmp3tag_title => get the title - - $mp3player.getmp3tag_tracknumber => get the track number - - $mp3player.getmp3tag_version => get MPEG version - - A example script was added (kvirccvs/kvirc/doc/scriptexamples/mp3info.kvs) - -4 November 2002: - [Juanjo] - - Added widgets to the identity an server dialogs to set a default user mode - after a conexion to the server. - -24 Oct 2002: - [Juanjo] - - Reworked a little the Tools menu. - - Spanish translation updates (only 1000 translations to go, hehe). - -19 Oct 2002: - [Juanjo] - - Added the alias 'lag' to the default script (it just returns the lag - using $lag.lag()). - - Added the event 'OnLagCheck' that get triggered every time there is a - new lag data. This should help scripters to write their own lagmeters - without having to poll KVIrc. - - Added an option to display the lag on the IRC context indicator, making - all those changes actually useful for the final user :) - -18 Oct 2002: - [Juanjo] - - Added a new (and very simple) Lagmeter (see the new 'lag' module - commands and functions), the 'Lag Options' dialog in the options/irc - window and the 'OnLagAlarmTimeUp' and 'OnLagAlarmTimeDown' events. I'll - add an applet displaying the lag to the lag module as soon as I figure - how to do it :) - - Added the OnPong event. - - Fixed bug 200210130200522026 - - -10 Oct 2002: - [Juanjo] - - I'm back, prepare your debuggers - - Added a 'Ignore' menu to the userlist users menu. - - New feature: User highlights (argh, I hate that word). Just update your - default.kvs and right-click on a user to see how it works. Very - usefull on very crowded channels with lots of parallel conversations - running and you trying to keep track of one (hello #debian). Also - added the pertinent commands on the module tmphighlight. - - The 'clear' command now also clears the message view on channels. - -06-24 Jun 2002: - [Pragma] - - Pre-release fixes all around - - SSL stuff.. - - About dialog - - Fixes for KviIrcView - - Windows porting - - uh... I forgot all the things I did :D - -29 May - 06 Jun 2002: - [Pragma] - - More SSL support - - A lot of bugfixes (see bugtrack.kvirc.omnikron.net) - - Arrays support in the whole user parser (uh...this was huge , but - necessary) a huge set of functions has been moved to the new array - interface WARNING: the dictionaries have a new syntax now! %dict{key} - %something[id] is now reserved to arrays (with numeric id).[br] - - FOR command added - - Updated all the example scripts to support the new syntax - -23-28 May 2002: - [Pragma] - - Preliminary SSL support (try /server -s) - - Fix for the messed default.kvs (dialog problem) - - A lot of mem-leaks catched with valgdind - - Various fixes - -22 May 2002: - [Pragma] - - KDE Terminal window fix - - Some new icons - -21 May 2002: - [Juanjo] - - Using Pragma's support for text icons, added the option to substitute - some icons (currently ':)', ':D', ':-)', ':-D' and ':-O') in the irc view - (Options -> Look & Feel -> Irc View). Still not finished. - -18-21 May 2002: - [Pragma] - - More fixes for windoze - - Some reguser hacks - - Command, channel, function and directory completion in the input widget - - Various thingies all around - - CTCP Page support (partial for now , need some more options) - -7-17 May 2002: - [Pragma] - - Tons of fixes for windoze - - More modules ported to windoze (snd, dockwidget) - - Text icons initial implementation (try CTRL+I and have fun :) - - On*Created and OnWindowActivated are now called in the correct order - - Various thingies all around - -6 May 2002: - [Juanjo] - - spaste module completed (spaste.setdelay,spaste.list,spaste.stop,etc) - - Workaround for the tooltips-following-desktops problem (close tooltips - on input widget keyevent). - -1-6 May 2002: - [Pragma] - - Fixes for Solaris compilation: thanks to Kenneth Larea for the hints :) - - Random fixes for make dist - - Support for anti-flood on CTCP DCC * - - Failed DCC Handshakes are now optionally reported to the sender with a - CTCP ERRMSG. The options in the dialog are still missing - - Fixes for the "bad console repainting" problem - - es.po charset fixed - - Added sr.po (thnx Prethorian :) - - Added auto-windows-tiling feature to the MDI manager - - Other cleanups here and there... - -27 Apr 2002: - [Juanjo] - - New module 'spaste' to send text slowly to a conversation window. - - New option for the input widget right button men in conversation - windows: 'Paste (slowly)'. - -25 Apr 2002: - [Juanjo] - - Now the log viewer can be also a MDI window - - Log viewer listview icons - -21 Apr 2002: - [Juanjo] - - snd module - -1-12 Apr 2002: - [Pragma] - - Minor fixes around - - Fix for the KDE style toolbars - - Fixes for the liquid KDE theme (transparency). - not everything works... some label stuff must be fixed in the theme - engine... - - Query user list view invisible by default (also saved in the window state) - - Same for the channel double view - - Removed /tbutton and /wbutton and added generic /button and /buttonctl - instead updated the example scripts accordingly - - Merged the libtool update patch and added more fixes for this - - Fixes for --with-local-8bit compilation - - Added kvi_list.h and the compatibility KviPtrList defines to work both - with qt2 and qt3 - -31 Mar 2002: - [Pragma] - - Mini-Fixes for the snd module (threading arguments) for gcc 3.0.0 - - Mini-fix for libaudiofile check in configure - - More work on window position saving - - More work on the offer list window stuff. - - General fixes for gcc 3.0.0 (can anybody test it ?) - -30 Mar 2002: - [Pragma] - - Added the beginning of the offer list window - - Preliminary window properties saving... now handling defaults too - - Minor utility-functions in the window popup menus - - Preliminary rearrangements of code for KviConsole.... the header is - becoming a mess need to order the code syntactically and then maybe extract - some code to be put in external classes. KviIrcConnection could be an idea. - - Beginning of code for the toolbar button management... need a module ? - -29 Mar 2002: - [Pragma] - - Will I ever start to use this ChangeLog ? :D - -7 Mar 2002: - [Juanjo] - - kvisounds script, the sound on OnMeNamed event is usefull, really ;) - -28 Feb 2002: - [Juanjo] - - Pragma branded str module optimizations, docs for all the implemented - functions. - -26 Feb 2002: - [Juanjo] - - More str functions, removed strFindFirst for str.findfirst and updated - the scripts using it (UPDATE YOUR SCRIPTS!!!) - -21 Feb 2002: - [Juanjo] - - More str functions (still no docs) - -19 Feb 2002: - [Juanjo] - - Some new functions in the str module - -13 Feb 2002: - [Juanjo] - - /IGNORE && /UNIGNORE support - BTW the other guys are also making things, they just don't update the - Changelog :P - -10 Feb 2002: - [Juanjo] - - $isOp() $isMeVoice() $isVoice() $isMeHalfOp() and $isHalfOp() added - -9 Feb 2002: - [Juanjo] - - New log viewer module (logview.open) - - Fix for the editor not saving his options - -4 Feb 2002: - [Juanjo] - - Fixes so pragma could add --with-qt-embedded to compile againt Qt Embedded - (wow!) - - Get rid of the 'commit' and 'discard' buttons on the user editor; now - all changes are synced with the local db. - -25 Jan 2002: - [Juanjo] - - New notify list editor - -21 Jan 2002: - [Juanjo] - - New identity button on the toolbar, posibility to change nick from the - identity dialog if we're connected and es.po work - -20 Jan 2002: - [Juanjo] - - Added the config widget for the create query on server notice option. - - Events and events doc: OnDCCChatConnected, OnDCCChatMessage, - OnDCCSendTransferComplete, OnDCCGetTransferComplete, OnCTCPFlood, - OnServerNotice, OnChannelNotice... - -19 Jan 2002: - [Juanjo] - - Added a 'close after join' checkbox to the join channels dialog & fixes. - -18 Jan 2002: - [Juanjo] - - Added OnAction event - - Fixes - -17 Jan 2002: - [balboy] - - updated po file - - anti idle script changed... but pragma's syntax he gave me is not working - yet :p - - [Juanjo, which is alive] - - Added the 'recent servers' Qlist to the servers dialog - - Added the 'Show after connecting to server' checkbox to the channelsjoin - widget - - Servers widget bug fixed - - Default nick link actions & men - - Config widget for the tree-taskbar minimum? width option - -07 Jan 2002: - [balboy] - - minor changes to the default script - -05 Jan 2002: - [balboy] - - anti idle script added - - dcc bug alias fixed - -22 Nov 2001: - [Juanjo] - - Added a bunch of events (On[me]ban/deban, On[me]op/deop, - On[me]voice/devoice, OnChannelMessage, OnQueryMessage, OnLimitSet/Unset, - OnKeySet/Unset, OnInvite, On[me]BanException, On[me]BanExceptionRemove, - etc). - -18 Nov 2001: - [Juanjo] - - Added a 'Connect to servers' dialog (serversjoin.open) -> update: - serversconnec.open - - Added scripted buttons for the channels and servers dialogs. - - Added $anyConsoleConnected() function. - - Fixes - -12 Nov 2001: - [YaP] - - Added DCC user defined port range - -10 Nov 2001: - [Juanjo] - - Now it has all the functionality ;) - - [YaP] - - IPv6 porting from Win XP to Win 2000 (Preprocessor definition: WIN2K) - -8 Nov 2001: - [Juanjo] - - Added a 'Join Channels' widget. It still don't have all the - funcionality. - -4 Nov 2001: - [Juanjo] - - Improved away system - - Option to always highlight own nick on messages - - Made the splash screen a managed window - - Added an 'apply' button to the general options dialog - -24 Sep 2001: - [Kristoff] - - Made Dcc Voice completely configurable, options dialog also added - - Volume slider for dcc voice added - - Fixed a bug in alt+arrows switching (sigsegv when window had no context - assigned) - -23 Sep 2001: - [Kristoff] - - Switching between windows using ctrl/alt + arrows - -13 Sep 2001: - [Balboy] - - some more changes to the defscript - -12 Sep 2001: - [Kristoff] - - Text selected in Help Browser window is now automagically copied into the - clipboard and can be pasted (Balboy's request). - - Pressing Enter in Help Browser's lineedit starts search. When the search - starts the cursor changes into waitCursor (cosmetical improvement :)) - - 22 Mar - 12 Sep... man... - - biff module added - not functional at all - adding some code not to mess - with makefiles anymore - -12 Sep 2001: - [Balboy] - - updated the changelog :p - - added some functions to the defscript - -30 Mar 2001: - [Balboy] - - quit function added - -22 Mar 2001: - [Kristoff] - - combobox object added - -17 Mar 2001: - [Pragma]: - - A lot of unreported changes again - - Added anti-aliased font support - -17 Feb 2001: - [Pragma] - - A lot of changes: removed the libkvigui, it was rather useless, and it is - better to have all the GUI code into the core executable...(for many - reasons). - - Added the first "shy" icq module. - -15 Feb 2001: - [Kristoff] - - Added urllabel object - Note: I'm proud to be the first person, that uses this file in the - year 2001 :-) - -05 Dec 2000: - [Number1] - - Cleaned up the about dialog, added some new entries and fixed the - background bug. - Note: Could people start using this log again please? ;) - -12 Sep 2000: - [Kristoff] - - started this ChangeLog (to avoid confusion: newset entries go above - this one ;)) - - added widget object diff --git a/3.4.0/FAQ b/3.4.0/FAQ deleted file mode 100644 index c9355dbfef..0000000000 --- a/3.4.0/FAQ +++ /dev/null @@ -1,712 +0,0 @@ -1. PROJECT RELATED QUESTIONS - -1.1 What is KVIrc ? What the "KVIrc" name stands for ? -1.2 Why KVIrc is not totally integrated in KDE ? - - -2. COMPILATION - -2.1 I can't compile kvirc from cvs, what's wrong? -2.2 Internal Compiler Errors ? -2.3 On Mandrake 10.0 (or other) KVIrc fails to start - saying that it can't find libkvisetup.so. -2.4 I got 'amarokInterface.cpp:29:31: amarokInterface.moc: No such file or directory'. Whats going wrong? -2.5 Configure complains about a missing libdl.so but I seem to have it - - -3. INSTALLATION - -3.1 There is a problem during package installation/creation - file /usr/share/services/irc.protocol from install - kvirc-version.package conflicts with file from package xxx - - -4. IRC - -4.1 How do i join a channel ? -4.2 How do i autojoin channels ? -4.3 How do I enable automatic NickServ identification ? -4.4 I can't see my national characters, what's wrong ? -4.5 I can't connect to an IPV6 server, what's wrong ? -4.6 /me doesn't support the '$' character, what's wrong ? -4.7 /me doesn't support the '"' (double quote) character, what's wrong ? -4.8 /me can't contain the ';' character, what's wrong ? -4.9 I try to do a /whois on nick blah\ but i get the reply for blah (without the slash) -4.10 What is AVATAR protocol ? Is there any documentation about it ? -4.11 The log files seem to be saved randomly, when I open a log - I can see only a part of the text that actually should be there -4.12 The DCC transfers seem to be interrupted after the first few bytes: - KVIrc says that the remote end has closed the connection. - - -5. ADVANCED IRC FEATURES - -5.1 How do I connect to an SSL-enabled IRC server ? -5.2 How do I use DCC over SSL ? -5.3 Do I need a SSL certificate ? -5.4 How do I create a SSL certificate ? -5.5 I can't get KVIrc to use my SSL certificate in a DCC, what's wrong ? -5.6 KVIrc crashes when a certificate is used under Windows, what's wrong ? -5.7 How do I enable mircryption (encryption in general) for a specific channel ? -5.8 How do I execute a process and send its output to a channel ? -5.9 How do I keep channels and queries open after a disconnect ? -5.10 I have an unreliable ISP connection but KVIrc takes a really long - time to detect a disconnection and reconnect. -5.11 I'm in a LAN and KVIrc uses a wrong IP address in dcc transfers - -6. APPAREANCE - -6.1 On Windows KVIrc seems to slow-down sometimes, what's wrong ? -6.2 I don't see the channel popup menus anymore, what's wrong ? -6.3 Does KVIrc support Themes? -6.4 I hate all that colors, what can I do about it ? -6.5 On Windows, how do I use firefox/opera/any_other_browser to open links instead of explorer ? - - -7. CRASHES - -7.1 KVIrc crashes when the multiline text input is opened (obsolete) -7.2 What the heck is a gdb stack trace and how do I get it ? -7.3 KVIrc hangs up, but doesn't crash. How do i report debug informations ? -7.4 KVIrc exits by itself or simply "disappears" without any apparent reason. -7.5 KVIrc dies randomly and "Alarm Clock" is printed in the console -7.6 KVIrc dies when using alias(identify){ identify password; } - --------------------------------------------------------------------------------- -1. PROJECT RELATED QUESTIONS --------------------------------------------------------------------------------- - - -1.1 What is KVIrc ? - - KVIrc is a cross-platform Internet Relay Chat client. - The name stands for K Visual Internet Relay Chat client. - The K prefix comes from the old times, when KVIrc was bound to the - KDE project and depended on the KDE libraries to run. Actually this - is not true anymore since KVIrc depends only on the Qt library from - TrollTech and runs also on platforms where KDE can't run. - - -1.2 Why KVIrc is not totally integrated in KDE ? - - First of all read the answer for question 1.1. - We could provide a more complete integration by the means of conditional - compilation but since it would require additional efforts to synchronize - the KVIrc sources with the KDE library changes we choose not to do it. - If you wish to contribute some code that better integrates KVIrc with - KDE you're welcome to do so: we will happily accept your patches as long - as you promise to mantain them :) - - --------------------------------------------------------------------------------- -2. COMPILATION --------------------------------------------------------------------------------- - -2.1 I can't compile kvirc from svn, what's wrong? - - Have you checked the requirements ? - *Carefully* read the INSTALL file that comes with the distribution: - it contains the informations to solve 95% of the problems that - you may encounter. You may also try digging in our mailing list - archive: many problems have been solved there. - If you still can't get it to work please either subscribe to the KVIrc - mailing list (see www.kvirc.net) and report the problem there or join #kvirc - on IRCNet and ask the channel members for a hint. - - -2.2 Internal Compiler Errors ? - - Compile errors like this: - In file [somefile]:[someline] internal error: - Segmentation fault - Please submit a full bug report, - with preprocessed source if appropriate. - See for instructions. - - This error can have multiple reasons. - 1) A compiler bug: my GCC 3.2 20020903 (default on RH 8.0) spits - out 5-6 of them daily. Usually it is solved by simply restarting the "make" command. - If it doesn't go away or if it gets really frequent and annoying you might try to upgrade the compiler. - 2) A memory corruption: this is really frequent: one of your memory banks is spitting random bytes - sometimes. Usually the problems come out under heavy system load (kernel, KDE or kvirc compilation for example). - You can check for memory corruption by trying different RAM modules (or removing them one at a time to discover - the broken bank). You can also try a program called memtest and a kernel - patch that can force the broken memory banks to be ignored by the kernel (allocated permanently to a dummy kernel task). - These tools can be found by digging the web with your favorite search engine. - 3) A deeper hardware problem: if upgrading the compiler and changing memory banks doesn't help then - it *might* be a deeper hardware problem: bus errors , faulty IDE (or SCSI) controller or even buggy CPU... - Well.... - - -2.3 On Mandrake 10.0 (or other) KVIrc fails to start - saying that it can't find libkvisetup.so. - - Mandrake 10.0 default libtool package is broken. Either upgrade - the libtool package or try to run ./autogen.sh --bundled-libtool - and then recompile (./configure, make, make install). - This *might* apply to other systems too. - - -2.4 I got 'amarokInterface.cpp:29:31: amarokInterface.moc: No such file or directory'. Whats going wrong? - - You have to install qt3 devel tools which include uic and moc. If installed, be sure that uic and moc are in PATH. - - -2.5 Configure complains about a missing libdl.so but I seem to have it - - The most common causes are two: - - 1) You have libdl.so.X (where X is usually a number or a set of numbers) but not libdl.so - - You need to do a symbolic link from libdl.so.X to libdl.so. You do it by entering the directory - where libdl.so.X is and issuing a ln -s command, for example: - - # cd /lib - # ls libdl* - # ln -s libdl.so.2 libdl.so - - Then try to ./configure again - - 2) You don't have a c++ compiler installed - - The libdl test is the first ./configure test made with a c++ compiler. - The confirmation for this error can be found in the config.log file - where you can find lines similar to the following: - - configure:21637: g++ -o conftest conftest.cc -rdynamic -ldl >&5 - ./configure: line 1: g++: command not found - configure:21643: $? = 127 - configure: failed program was: - ... - - Your distribution probably ships the c++ frontend to gcc in a package - separated from gcc itself. The package might be also named g++. - Look it up on your installation CD and install it, then ./configure again. - -------------------------------------------------------------------------------- -3. INSTALLATION -------------------------------------------------------------------------------- - -3.1 There is a problem during package installation/creation - file /usr/share/services/irc.protocol from install - kvirc-version.package conflicts with file from package xxx - - This is a known issue with all types of packages that handle - file conflicts. KVIrc installs the irc protocol handler for KDE - and the same is done by ksirc and kopete (and maybe others). - There is no particular reason for KVIrc to fix it in the core - distribution (and there is also no simple way to do it). - Either the package maker must exclude the irc.protocol - file from installation or mark it as "optional" in some way or the - users must use some sort of "force" flag during the installation. - - -------------------------------------------------------------------------------- -4. IRC -------------------------------------------------------------------------------- - -4.1 How do i join a channel ? - - Type "/join #channelname" - - -4.2 How do i autojoin channels? - - There are many ways to do it. - For example: - Select "Scripting/Events" from the KVIrc menu. - Lookup the "OnIrc" entry in the left pane of the window that pops up. - Right-click on that entry and select "Add handler". - A "default" handler will be created. In the right pane write: - join #kvirc - join #kde-users - join #somechannel - .... - Now click OK and you're done: you have just created a handler for an event. - Reconnect to a server and KVIrc will autojoin the channels that you have selected. - Another option (nicer, if you use several servers) is to go to the servers options - page and click the button labeled 'Advanced' on the entry for the single server. - There is a server-specific "On connect execute..." event. - - -4.3 How do I enable automatic NickServ identification ? - - KVIrc supports two kind of NickServ identification rules: per-network and global. - The per-network rules can be accessed from the server options page. - You need to select a network in the list view (not a server!) and then click - "Advanced...". In the dialog that appears there is a NickServ tab - on that you can add your identification rules. Adding a rule - should be straightforward (if you stop the mouse over an item you will likely get a small - tool tip with the explaination). Each rule is composed of: - - the nickname that is being identified: the rule will be applied only - when your current nickname corresponds to this one. - - a nick server user mask that must be matched by the NickServ user - in order for him to be recognized as the real NickServ asking for - identification. You will probably use something like NickServ!service@* - - a message regular expression that must be matched by the message - that the NickServ sends when requesting the identification. - You will probably use something like "If this is your nick, - identify yourself with /ns IDENTIFY password" - - an identification command that will be executed when all the rules - above match. You will probably use something like "ns IDENTIFY yourpassword" - The global rules can be created in the IRC::NickServ page of the options dialog - (accessible from the Settings/Configure KVIrc... menu). The main difference - is that each rule has a server mask that must be matched by the current - server name for the rule to be applied. - KVIrc first looks in the per-network rules and if none matches it looks - in the global rules. - - -4.4 I can't see my national characters, what's wrong ? - - There are several ways to fix your national characters display. - General encoding: - Open the options dialog and go to the "Encoding" page. - You can set explicitly the encoding to be used for the whole application. - If you choose "Use Language Encoding" KVIrc will try to guess the - encoding from your system settings. If this doesn't work then the reasons - may be: - - Your system settings are wrong - You need to fix them - - Your server applies some specific encoding to the data - See "Server encoding" - - You're chatting with people that have different system settings - See "Channel & Query encoding" - Server encoding - Besides the general encoding you can set one encoding per server. - This is done in the server options dialog (Click Advanced...). - The encoding will be applied to all the text that comes from - and goes to the server. If you choose "Use system encoding" - then the server will inherit the "General encoding" value above. - If this doesn't work then you have either set it incorrectly or - you are chatting with people that use different encodings. - In this case see "Channel & Query encoding" - The server encoding is used also to decode nicknames and - channel names on servers that support it. - Channel & Query encoding - Besides the general and server encoding you can set also per-window - encoding in channels and queries. This encoding will be applied - ONLY to the text sent to or received from that channel or query. - This feature is useful when chatting over a non unicode aware - IRC server (nearly all at the time of writing) with people - that have settings different than your general defaults or - the server default. - - Keep in mind that IRC has a MAJOR problem with character encoding - and in fact the formal definition of the protocol requires it - to be only 7bit safe. This means that on some servers you may - see your national characters eaten by the IRC network and there - is almost nothing you can do about that... - - UTF-8 is the best encoding we can get on IRC. Try to convince - other people to use it :) - - -4.5 I can't connect to an IPV6 server, what's wrong ? - - First of all make sure that your IPV6 stack is setup correctly. - Can you ping6 other IPV6 other machines ? - - # ping6 www.6bone.net - - Is the IPV6 support enabled in your kvirc executable ? - To find it out , try - - /echo $features - - in the KVIrc commandline. You should get a comma separated list of - features compiled in the executable. If the list contains "IPv6" then - the support is compiled in, otherwise you must check your compilation - stage to guess what went wrong. - To connect to an IPV6 server you can use /server -i - If you can ping other IPV6 machines, the IPv6 support is compiled in your - executable and you still can't connect to an *existing* IPv6 server then - you may have found a bug :) Report it. - - -4.6 /me doesn't support the '$' character, what's wrong ? - - This is NOT a bug : this is a feature : kvirc supports (and substitutes!) variables in all the commands. - You can escape your $ sign by using the backslash character: /me has gained \$100 will work correctly - - -4.7 /me doesn't support the '"' (double quote) character, what's wrong ? - - This is NOT a bug : this is a feature : a string enclosed in double quotes will have its whitespace preserved - while the other strings will have the whitespace simplified. This is valid for ANY command. - You can escape your " sign by using the backslash character: /me feels a bit \"foo\" will work correctly - - -4.8 /me can't contain the ';' character, what's wrong ? - - This is NOT a bug : this is a feature : kvirc supports multiple commands on a single line and uses ';' as a command - separator. You can escape your ';' sign by using the backslash character: /me is hungry \;) will work correctly. - - -4.9 I try to do a /whois on nick blah\ but i get the reply for blah (without the slash) - - In KVIrc /whois is a scripting command and the nickname is a command parameter. - In scripting commands the backslash is a special character with several "escape" - meanings. To include a literal backslash inside a parameter you MUST double it, - thus the correct command to issue is /whois blah\\ - - -4.10 What is AVATAR protocol? Is there any documentation about it ? - - AVATAR is a simple CTCP based protocol that allows associating images (avatars) - to IRC users. The protocol definition is simple: - - - CTCP AVATAR QUERY: - : PRIVMSG :<0x01>AVATAR<0x01> - Queries the avatar of the . - - CTCP AVATAR REPLY: - : NOTICE :<0x01>AVATAR <0x01> - Asserts that the user's avatar is located at - that usually will be something like http://server.domain.top/avatarimage.jpg. - - KVIrc supports also DCC based avatars that are simply "offered" to the - remote users. In this case the does not contain the http:// - prefix but is a simple file name. The remote users request the avatars - by issuing a DCC GET command. This is an useful but secondary extension - and can be ignored by simple implementations. If you need more informations - about this method please write to pragma at kvirc dot net. - - -4.11 The log files seem to be saved randomly, when I open a log - I can see only a part of the text that actually should be there - - KVIrc does not explicitly flush the log files while writing them. The OS - (or the underlying C library) does the flush operation when necessary. - This means that blocks of the log file will be added to the file on disk - only once in a while. If you really need to see the logs in real time - then you can explicitly flush the log files by scripting. - Just add a script like this to your OnKVIrcStartup event: - - timer(flushlogfiles,30000) - { - foreach(%x,$window.list(all,any)) - { - if($log.file(%x)) - { - echo -w=%x "Flushing log file..."; - log.flush -w=%x; - } - } - } - - The script above will flush all the log files every 30 seconds. You may - remove the echo statement if you're annoyed by the output :) - - -4.12 The DCC transfers seem to be interrupted after the first few bytes: - KVIrc says that the remote end has closed the connection. - - Make sure that you don't have activated the "Send ACK for byte 0" - option in "Options->DCC->File Transfer->Advanced". - This option should be used ONLY IF you have problems without. - - - - -------------------------------------------------------------------------------- -5. ADVANCED IRC FEATURES -------------------------------------------------------------------------------- - - -5.1 How do I connect to an SSL-enabled IRC server ? - - Use /server -s - It should work also over IPV6. - If it doesn't work then your executable might have no SSL support compiled in. - To find it out type - - /echo $features - - in the KVIrc commandline. If "SSL" is not in the list then you must go back - to the compilation phase and see what went wrong. - - -5.1 How do I use DCC over SSL ? - - /dcc.chat -s should work - - -5.3 Do I need a SSL certificate ? - - No you shouldn't need it, but you can use it if you want. - - -5.4 How do I create a SSL certificate ? - - A test self-signed certificate can be created by using the CA.pl perl script included - in the OpenSSL distribution. It will be something like CA.pl -newcert - - -5.5 I can't get KVIrc to use my SSL certificate in a DCC, what's wrong ? - - The SSL protocol doesn't require the "client" to send the certificate: it is - sent only if the "server side" requests it (it is not the KVIrc case). - The server side may have a certificate and you can set it in the SSL options page. - If your Private Key is stored in the certificate file pass the same filename - to both Certificate and PrivateKey option. - Remember to set the password if needed. - - -5.6 KVIrc crashes when a certificate is used under Windows, what's wrong ? - - This is probably a bug of the SSL dll shipped with the windows version of KVIrc. - You might try with a different version of this dll. - - -5.7 Can I encrypt my messages? -(or: How do I enable mircryption (encryption in general) for a specific channel?) - - KVIrc supports encryption for channels, queries and dcc chats by the means - of text transformation engines. You can access the list of the engines - by clicking the button with the yellow lock in the upper right corner - of the window. In the pane that will appear select "use text transformation" - and then choose one of the available engines. - The Mircryption engine is an implementation of the mircryption protocol and - supports both ECB and CBC mode. There is also a wide variety of Rijndael based encryption - engies as well as some funky other text transform tricks. - Most of the engines will need a pair of keys to encrypt and decrypt text - and in most cases you will use the same key for both encrypting and - decrypting. In the particular case of Mircryption you can enable - CBC mode by prefixing your key(s) with the "cbc:" string. - Once you have entered the keys just click on OK and start "talking" in the - window. Any encrypted text will have a "lock" overlay in his icon. - If you want to avoid encrypting a particular text line (maybe because - you want to allow everyone on a channel to read it) you can start - the line with a CTRL+P character. - - -5.8 How do I execute a process and send its output to a channel ? - - The straight way to do this is - - /exec("your command here"){ say $1; } - - Since it is not too much "user friendly", you can alias it in - the following way: - - alias(runandsay) - { - exec($0-){ say $1; } - } - - Then you would simply run - - /runandsay cat /proc/cpuinfo - - in the channel window you want the output sent to. - - Keep in mind that this is a "brute" approach and I'm sure that after - reading some documentation (start from /help exec) you will be able to - find more elaborate and nice ways to send a process output to a channel/query. - - -5.9 How do I keep channels and queries open after a disconnect ? - - KVIrc can keep your channels and queries open when the connection terminates - unexpectedly. This will probably make sense only if you plan to - reconnect to the same server or at least the same network (either manually - or automatically). - - An "unexpected disconnect" is a connection termination not explicitly caused by - the KVIrc user. This means that the connection is interrupted, either - by the networking stack or by the remote server, without the user - having sent a QUIT message (by the means of the /quit command or by pressing - the "disconnect" button in the toolbar). - - All this because the normal behaviour of a /QUIT command is, yes, to quit - your current connection without leaving traces of it. - - To keep the channels and queries open you just need to select the - relative options in the "Connection" page of the options dialog - (on unexpected disconnect: "Keep channels open" an/or "Keep queries open"). - - Then you might also select "Automatically reconnect", "Rejoin channels - after reconnect" and "Reopen queries after reconnect" to bring your - "dead windows" to life again :) - - Finally, you can simulate an "unexpected disconnection" by using the -u switch - of the /quit command. This might be useful when you want to explicitly - quit your connection while leaving the channels and queries open... maybe - because you need to renew the connection to your ISP before reconnecting ;) - - -5.10 I have an unreliable ISP connection but KVIrc takes a really long - time to detect a disconnection and reconnect. - - KVIrc doesn't detect itself that the connection has dropped until your - kernel explicitly times out. KVIrc measures lag, instead, that will - probably grow up a lot when the connection has dropped. - You can write a handler for the OnLagCheck event that will detect - the lag growing over a certain threshold and reconnect. - This involves opening the event editor, selecting OnLagCheck - and choosing "Add handler" from the right mouse menu. - In the handler write: - - if($1 > 30000){ quit -f -u; } - - 30000 is just a sample threshold (it means 30000 milliseconds!), replace - it with a value of your choice. - quit -f -u will close the current connection immediately (-f = force) - and will simulate an "unexpected disconnection" condition (-u = unexpected). - If you then enable automatic reconnection (see answer for question 5.9) - in the options dialog, KVIrc will automatically reconnect and rejoin channels. - - -5.11 I'm in a LAN and KVIrc uses a wrong IP address in dcc transfers - - KVIrc supports a couple of methods for guessing the right IP address for - DCC transfers: you only have to guide it a bit :) - - The first thing to try is "Guess address from IRC when unroutable" (Options->DCC). - This will perform a lookup on your own IRC mask once you connect - to an IRC server and use the address as source in DCC transfers. - (You need to reconnect to the server to make this option work!) - This trick will fail when your hostmask is cloaked (mode +x on recent IRC servers): - KVIrc will tell you that it couldn't look up the hostname and give up. - - In this case you might try to set a fixed address to be sent as source - in the DCC transfers: you just need to fill in the *IP address* of your - router in the option field. This field doesn't support hostname lookups - and it won't update automatically when you router's IP changes. - However, if you router's IP has a dns entry, you can ask KVIrc to fill - this field with a simple script to be performed at every connection. - - event(OnIRCConnectionEstabilished,updatedccsource) - { - ahost(yourrouterhostname.dyndns.org) - { - option boolDCCSendFakeAddressByDefault 1 - if($1)option stringDefaultDCCFakeAddress $2 - else echo "Couldn't look up the router's hostname" - } - } - - When transferring files to other KVIrc clients you may also try the - DCC RSEND protocol instead of DCC SEND. It will ask the remote end - to listen instead. - -------------------------------------------------------------------------------- -6. APPAREANCE -------------------------------------------------------------------------------- - -6.1 On Windows KVIrc seems to slow-down sometimes, what's wrong ? - - This is usually caused by the heavy graphics: try removing some graphic effects like the - pseudo-transparency. I have experimented that it happens almost always on 32-bit displays. - Switching to 16 or 24 bits may also help. - - -6.2 I don't see the channel popup menus anymore, what's wrong ? - - If something went wrong with KVIrc settings (a crash when the script settings - were saved ?) or if you have messed with the scripting options and you - want to get back the original behaviour (default script) you can choose - "Scripting/Restore default script" from the KVIrc menu. - (WARNING: It will erase any script modification you have made!) - Update: starting with the cvs of 2005.01.17, KVIrc should be able to - detect such situations and automatically suggest the re-installation of the - default script. - -6.3 Does KVIrc support Themes? - - Yes, KVIrc now has introduced a Theme Manager. You can find it in the Option dialog. - From there you can change the way KVIrc looks: fonts, colors, windows behaviour, - icons, taskbars, and so on. - Once you have changed the theme, you can save it, archive it (tar.bz2 or zip) and share with your friends, - or send it to the KVIrc staff to see it published on the web site. - - -6.4 I hate all that colors, what can I do about it ? - - By fiddling with the options you can make KVIrc appear even monochromatic. - Go to Options/Theme and select the minimalist theme: it will set white text - on black background and will disable the displaying of a lot of icons. - This is a good starting point for you console addicted hackerz :D - - -6.5 On Windows, how do I use firefox/opera/any_other_browser to open links instead of explorer ? - - Go to the "URL Handlers" options page and set - - run "C:\\path\\to\\your\\browser.exe" "$0" - - as url handler for the protocol you're interested in (maybe in all). - - Suepahfly suggests to use - - rundll32 url.dll,FileProtocolHandler "$0" - - as url handler to open the url in the default windows browser. - - -------------------------------------------------------------------------------- -7. CRASH -------------------------------------------------------------------------------- - -7.1 KVIrc crashes when the multiline text input is opened (obsolete) - - If you have installed a new version of KVIrc over a previous installation - br if you have changed the Qt libraries that KVIrc is linked to then - it might be caused by a broken multiline text editor config. - Try removing $HOME/.kvircssexeditorrc and starting KVIrc again. - Update: this problem has been completely removed during late 2004 developments - by completely rewriting the multiline input. - - -7.2 What the heck is a gdb stack trace and how do I get it ? - - A gdb stack trace is a "photography" of the state of the KVIrc internals - taken when a certain event has occured. The most common event - is a program crash (Segmentation Fault). - The stack trace helps (or even allows) the developers to locate the - crash cause in the program sources. - To obtain a gdb stack trace you must: - - - Compile KVIrc with the --enable-debug ./configure option. - Without this switch the stack trace is USELESS. - - Have a working installation of gdb (the gnu debugger) - This is usually available on your distribution cd - and you may already have it installed. - - Run KVirc: - # gdb kvirc - When the gdb prompt appears write: - # (gdb) run -f - Make KVIrc crash: gdb will tell something about - a signal received by the program. Write then: - # (gdb) bt - The text you see is the stack trace you wanted :) - Copy+Paste+Send it to pragma at kvirc dot net or the mailing list. - - -7.3 KVIrc hangs up, but doesn't crash. How do i report debug informations ? - - Use gdb to get a stack trace as in answer to question 7.2. - Since your KVIrc doesn't crash you will have to interrupt the execution - manually while it is hung up. You can do it by pressing CTRL+C in gdb. - - -7.4 KVIrc exits by itself or simply "disappears" without any apparent reason. - - Yes. It probably crashed but you haven't noticed that. - We NEED a gdb stack trace or a working procedure to reproduce the - behaviour in order to hunt it. - - -7.5 KVIrc dies randomly and "Alarm Clock" is printed in the console - - Try recompiling kvirc by adding the --with-ignore-sigalarm switch to - ./configure. (Note: the reason of the incoming SIGALARM signals - on certain systems is acually unknown. Please send hints to pragma at kvirc dot net). - - -7.6 KVIrc dies when using alias(identify){ identify password; }; - - This is infinite recursion: a programming error. - Take a look at http://en.wikipedia.org/wiki/Infinite_loop , learn - that once for all and fix your script. - diff --git a/3.4.0/INSTALL b/3.4.0/INSTALL deleted file mode 100644 index fc7caf6829..0000000000 --- a/3.4.0/INSTALL +++ /dev/null @@ -1,753 +0,0 @@ -Szymon Stefanek Mon Mar 04 2008 -############################################################################### -General notes for the installation of the 3.4.0 release of KVIrc -############################################################################### - - This document contains the procedures to compile and install - the version 3.4.0 of KVIrc. - -############################################################################### -# 0. Table of contents -############################################################################### - - 1. Introduction - 2. Guru-level installation - 3. Hacker-level installation - 4. Human (detailed) installation instructions - 5. How to compile KVIrc with Qt-embedded - 6. Compiling KVIrc on Mac OS X - 7. A note about Windows 95/98/ME - -############################################################################### -# 1. Introduction -############################################################################### - - This document contains the procedures to compile and install - the version 3.4.0 of KVIrc. - - If you have found this document in a binary distribution then - KVIrc has been probably already installed by your favorite package - manager and maybe something is not working as expected. In this case - this document and the accompanying FAQ can help you in guessing - what's wrong. - - If you have found this document in a source distribution or you - have downloaded it by using the svn then well... - this is a standard INSTALL file :) - -############################################################################### -# 2. Guru installation: -############################################################################### - - # ./configure - # make install - -############################################################################### -# 3. Hacker installation: -############################################################################### - - If you're compiling the svn version of KVirc run ./autogen.sh - (You NEED automake >= 1.5 for autogen.sh to run). - - # export QTDIR="your qtlibrary path" - - eventually: - - # export KDEDIR="your kde library path" - - We're using GNU tools here. - - # ./configure --help - # ./configure [your options] - # make - # make install - -############################################################################### -# 4. Human (detailed) installation: -############################################################################### - - If you're not a guru, or have problems with the installation - read these instructions carefully. - - ### - ### Step 0 (ONLY FOR THE SVN VERSION) - ### - - If (*** AND ONLY IF ***) you're compiling the svn version of kvirc - you need to generate the configure script. If you're compiling - a downloaded tar.gz (or tar.bz2) package or you don't know what - svn is then jump directly to step 1! - - You need a recent automake and autoconf installed on your system. - It is also reccomended to have a recent (matching) libtool installed - (libtool is not strictly necessary since KVIrc has a bundled one, - but a libtool matching your automake/autoconf versions will probably - run better on your system). - - Anyway, run: - - # ./autogen.sh - - If it runs without any error (it will tell you "Done") then - you may skip to step 1, otherwise read on. - - First of all check your auomake version. - You need automake >= 1.5: older versions will NOT WORK. - You can check the automake version with the command - - # automake --version - - If your automake version is lower than 1.5 upgrade it. - You can find it at http://www.gnu.org/software/automake/ (source) - or on your favorite distribution site as auto-installing package. - - Automake installation tip: automake installs in /usr/local/ - by default. If you have an older automake installation that - resides in /usr/ it's better to remove it or (better) overwrite it - with the new installation. - If you choose to overwrite the old installation with the new - one then just use "./configure --prefix=/usr" as the automake's - configure command. - If you choose to remove the old version then the files to be - removed are /usr/bin/automake /usr/bin/aclocal /usr/share/automake - /usr/share/aclocal. If you feel unsure about removing it, rename it. - - If the script fails to run then you might try - - # ./autogen.sh --bundled-libtool - - to force the usage of the bundled libtool version. - If you later have unexplicable problems with the compilation tools - you might also try the bundled libtool. - - ### - ### Step 1 : Matching the requirements - ### - - - You NEED a fully working C++ compiler. - - Most linux distributions have it pre-installed and if you have - already compiled other programs before then you're probably ok, - so actually skip this check and go ahead. If anything fails - in the following steps then this is the very first thing to verify. - A broken compiler installation usually manifests itself - in failed ./configure tests (dlopen capabilities). - Try - - # gcc -v - # g++ -v - - on the commandline. If it says something about "command not found" - then you miss some gcc related package. Install it from the distro cd. - - - - You NEED the Qt library. - - You can download the latest version from ftp://ftp.trolltech.com. - The main Qt www site is http://www.trolltech.com. - Note for the GPL maniacs: Qt IS GPL. - The minimum required version is 3.1.2 (older versions *might* work) - Download and install it by following the rules - explained in the excellent documentation that comes with the library. - - - - You need a decent pthread implementation. - - This is usually included in your distribution and is probably - already installed. The library is called libpthread.so. - You can look for it with the "find" command: - - # find / -name libpthread.so - - On my system the output is: - - # /usr/lib/libpthread.so - - If you don't have it (the configure script will tell you) - you can download it from your favorite GNU mirror. - - On Solaris you can use the native libthread.so library instead - but you will have to pass the specific option to configure (see below). - FreeBSD has a native implementation of pthreads in libc_r and - the gcc compiler has a special -pthread flag to link to it. - If you're on FreeBSD, use the --with-freebsd-pthread configure - option and make sure that you don't have other pthread wrappers - installed (that might collide with the native header files). - - The configure script will also fail if the library is - hidden somewhere on your system (eg. not in /lib , /usr/lib or - /usr/local/lib): you should probably move it. - - - - You need the dynamic linker interface library libdl.so. - - This is usually installed on your system , so don't care until - configure complatins about it. Some system have the interface - builtin in libc. The configure script can detect it. - - - - (Optional) If you want to compile the KDE integration support - you obviousy need KDE. The kdelibs package should suffice. - - - - (Optional) If you want the translations to non-english languages to work - then you need the GNU gettext package. In particular KVIrc uses - the msgfmt program. - - This is usually included in your distribution and is probably - already installed. You can check it by running - - # msgfmt --version - - KVIrc will not complain if the command above is missing: it will - just skip the creation of the translation files. - If the command above fails then you need to install the gettext package - if you want any language other than english. - - - - (Optional) If you want DCC VOICE to support the gsm codec, - you need a recent copy of libgsm. This is not strictly required - at compile time since KVIrc will look for the library at run-time, - and only if the DCC VOICE with the gsm codec is requested. - You can check for libgsm using the 'find' command. - - # find / -name libgsm* - - The output should be sometihg like - - # /usr/lib/libgsm.so - - This library is included in most distributions. Some distros ship - only the static version of the library "libgsm.a": if the previous - find returned only something similar to "/usr/lib/libgsm.a" , you might - create manually the shared archive by running: - - # cd /usr/lib - # ld --whole-archive -shared -o libgsm.so.1 libgsm.a - # ln -s libgsm.so.1 libgsm.so - # ldconfig - - If you don't have it installed at all, you might have a look in your - distribution CD, or download it from the web. - - - - (Optional) If you want the /snd plugin to play various audio formats - you either need a running artsd, a running esd or a reasonably recent - audiofile library. Without these KVIrc will be only able to play *.au - files. - - - - (Optional) If you want to generate the on-line documentation - you also need perl: any version will do (I guess). - - - - (Optional) If you want the secure socket layer support to be compiled - you need the OpenSSL library and headers. (libssl.so and openssl/ssl.h) - - - - (Optional) If you want perl scripting support to be compiled - you need a working perl installation. Your libperl.so MUST be compiled - with the MULTIPLICITY option. (You can check it with perl -V). - - ### - ### Step 2 : Running the configure script (mandatory) - ### - - First of all you must run the configure script that will guess some - info about your system and prepare the compilation. - You may try to "simply run" it and check if it works...the configure - script tries to be smart , but in some cases it will fail. - - So before running the script make sure that the enviroinement - variable $QTDIR points to the right location. This will help - in finding the correct version of Qt. - You might eventually set it with the command: - - # export QTDIR="your qt dir" - - On my system qt is installed in /usr/local/kde/qt - so I actually execute - - # export QTDIR="/usr/local/kde/qt" - - If you want to compile the KDE support you might want to do the same - with KDEDIR - - # export KDEDIR="your kde dir" - - In my case KDE is installed in /usr/local/kde so I use - - # export KDEDIR="/usr/local/kde" - - The configure script has a lot of options that can be listed by using - - # ./configure --help - - Here's a list with explainations (the most common are at the top): - - --enable-debug - This is for debugging and reporting problems. - It sets the compiler options in order to leave the debugging - informations into the kvirc executable and the libraries. - In this way you will be able to produce a gdb backtrace - in case of a crash. - YOU NEED THIS OPTION IF YOU WANT TO REPORT A PROGRAM CRASH. - - --enable-pipes - Asks the compiler to use pipes instead of files for the - compilation stage. The pipes will help in reducing disk usage and - will probably shorten the compilation a bit. Use this option if - your platform supports it. - - --with-qt-library-dir= - Look for the qt library in . - You might want to use this if the configure script has trouble - in finding the qt library. - You should have no problems if you use export QTDIR="" - before launching the configure script, but it might help you - if you have a non standard Qt installation. - - --with-qt-include-dir= - Look for the qt headers in . - You might want to use this if the configure script has trouble - in finding the qt headers. It may especially help if your headers - are in a place different than $QTDIR/include (and thus you have - a non standard installation) - - --with-qt-moc= - Use the qt meta-object compiler found in - The path is usually $QTDIR/bin/moc , and the - configure script will find it if you have a standard - Qt installation and $QTDIR points to the right directory. - Thus should have no problems if you use export QTDIR="" - before launching the configure script, but it might help you - if you have a non standard Qt installation. - This will also help if you have the moc compiler renamed - in some way: like "moc2" or sth... - in this case is a FULL path: directory/program_name! - - --disable-qt-check - This disables Qt checking at compilation time. - If this is the only way to compile and run - the kvirc executable , then there is something - wrong with the configure script. - - --without-kde-support - The configure script will look for the KDE headers and libraries - and if found it will enable the KDE support. If you don't want - the KDE support even if KDE is detected, just use this switch. - - --with-kde-library-dir= - Look for the KDE libraries in - If $KDEDIR points to the right place, you shouldn't need this. - - --with-kde-include-dir= - Look for the KDE headers in - If $KDEDIR points to the right place, you shouldn't need this. - - --with-kde-services-dir= - Install the kde service protocol files in - If $KDEDIR points to the right place, you shouldn't need this. - This is also non-critical for kvirc: if the configure script - can't find this directory, you will only looose the support for - irc:// urls in konqueror - - --without-kde-check - Similar to --without-qt-check but for KDE. - - --enable-optimisation= - Enables the compiler optimisation flag -o. - Possible values are 0 , 1, 2 and 3 (but if you compiler supports - more optimisation levels , you might use other numbers here). - Increases compilation time but may produce a slightly faster - executable. - - --with-other-libs= - Explicitly link to the specified libraries. - Example: --with-other-libs="-lmylib -lstrangesystemsupport" - - --with-other-ldirs= - Explicitly add the specified library search paths - Example: --with-other-ldirs="-L/home/pippo/lib/ -L/my/library/" - - --with-other-idirs - Explicitly add the specified include search path - Example: --with-other-idirs="-I/home/pippo/include/ -I/tmp/inc/" - - --enable-objprelink - This is an experimental support for object prelinking that improves - significantly the executable startup time. In order to use it you - need to have the "objprelink" program in the PATH. The objprelink - program is included in the distribution in the admin directory. - In order to use it, you will need to: - - # cd admin - # make objprelink - # cp objprelink /somewhere_on_your_path - - All this AFTER running ./configure and BEFORE running make. - - --with-no-pthread-check - Do not check if the pthread stuff works. - If configure fails in the pthread library check , you might want to - try this...(but then you will have really to "pray" that - the check has been broken by some "unusual" conditions and the - compilation will succeed). - - --x-includes=DIR - Specifies explicitly the path to the X header files. - You might want to use this if the configure script - has trouble in finding it. - - --x-libraries=DIR - Specifies explicitly the path to the X libraries. - You might want to use this if the configure script - has trouble in finding it. - - --with-qt-name= - Use instead of "qt" as the Qt library name. - This is useful on systems where Qt has been installed with - a name different than the default "qt". - It happens often that to allow multiple copies of qt to work - the newest have the version name appended to it. - For example, on FreeBSD I have found "qt" being Qt1.* and - "qt2" being Qt 2.*. Since you need Qt 2.* for kvirc to work, - you will need to use --with-qt-name=qt2. - If you use this option, you will probably also need to remap - the moc compiler path/name with --with-qt-moc. - - --disable-qt-mt - Disable checking for the multithreaded version of Qt. - By default , KVIrc will try to link to the multithreaded version - if found on the system. - NOTE: if you enable the KDE support , KVIrc MUST be linked to the - qt library that KDE is linked to. - - --with-ix86-asm - KVIrc contains some ix86 assembly routines that *could* - performs some things faster (this is not always true, depends - on the compiler). You might want to try it if your kvirc seems to - be really slow... - - --without-ipv6-support - The IPV6 support is compiled by default on the platforms that - support it: this option disables it. - Even if you have a plain IPV4-only connection, you might want to - keep the IPV6 support: you will be able to lookup IPV6 hostnames. - - --without-system-memmove - This will disable the use of the system memmove() memcpy() and - memset() functions and enable the bundled implementations. Use - it if you have undefined references to these functions while - compiling. - - --with-ignore-sigalarm - This is a hack mainly for Solaris. - Use this option if kvirc exits with no apparent reason and - the system prints a message related to an "Alarm" :) - - This is a mail that suggests an explaination for the SIGALARM fault. - If you experience the problem please drop me a mail at pragma at kvirc dot net - and we'll try to look for a solution. - - From: "Andre Stechert" (astechert at email dot com) - Date: 26/7/2005 09:36 - - Hi, -         I noticed in your readme that you were having problems with sigalarm - in your solaris port and you weren't sure why.  I quickly scanned your - source code and noticed that you use usleep and threads.  That's the problem, - if you haven't already figured it out. On Solaris, usleep is implemented with - SIGALARM. So is threading. So if you the active thread changes while - a usleep is in progress, bang, the process is dead. - - --without-crypt-support - Disables the cryptographic engines and the whole - cryptography/text-transformation support. Produces a slightly - smaller executable. Anyway, if you don't know what the - ctryptography/text-transformation - support is ,I suggest you to avoid using this option. - - --enable-new-kvs - Developers only! - This enables the compilation of the new KVS parser, currently - under heavy development. This will produce a bigger and possibly - unstable executable: do not use if you don't know what you're doing. - - --enable-new-kvs-only - Developers only! - This hardwires the new KVS parser to be used as the main scripting - engine in KVIrc. Be aware that the new KVS engine is NOT YET 100% COMPLETE - so some scripts will simply fail. - - --without-transparency - This option disables pseudo-transparency support. - The pseudo transparency support makes the KVirc windows - look like semi-transparent (this is NOT real transparency: this is - just a nice-looking hack). - If KDE support is enabled, KVirc will have an option that - makes all windows use a faded KDE desktop background image - as background. Without KDE support you will be able to choose - a fake background image and use it as background. (You can still - choose your desktop wallpaper: this will (more-or-less) work in - all the window managers). - It is cool-looking but usually eats some memory when enabled. - It also eats some executable size. - So this option allows to disable the pseudo-transparency. - - --with-solaris-lthread - If you're on Solaris and don't have the pthread library (A wrapper - I guess) you might try this option: it attempts to use the native - Solaris threading support. - - --with-freebsd-pthread - If you're on FreeBSD, you NEED this option. This enables the usage - of the native FreeBSD pthread implementation found in libc_r. - This requires you to use the native gcc compiler: it has a special - -pthread flag that enables the linkage to libc_r instead - of plain libc. - - --with-libresolv - Link to libresolv. I guess that this is required for Solaris - - --with-libsocket - Link to libsocket. I guess that this is required for Solaris - - --with-libnsl - Link to libnsl. I guess that this is required for Solaris - - --with-libcompat - Link to libcompat. This might be required for some systems... - but I have no idea which ones. If you find it useful: mail me. - - --enable-fno-rtti - Disables compiler runtime type information generation. - This is probably needed only with qt-embedded. - DON'T use it if you don't exactly know what it does. - Actually this may even make KVIrc crash in some situations. - For example the KDE sources use __dynamic_cast... - - --disable-x-support - Disables completely the X Windows support. - This is useful in environments where X is not needed to compile KVIrc - such as Qt-Mac on MacOSX, QtEmbedded or Windows. - This switch implies also --without-x-bell - - --without-x-bell - Disables the usage of the XBell function (needed if you want to - compile KVIrc with qt-embedded (no X at all)) - This is implied by --disable-x-support - - --with-qt-embedded - You need this to compile KVIrc with qt-embedded - - --without-ipc - Disables support for inter-process communication. - You will be not able to send remote commands to running - kvirc sessions: this basically means that every time you run - the kvirc executable , a new session will be started. - If you don't use this switch, a new session will be started - only if no session is running on the same display or - "new session" has been forced by a commandline switch. - If a session is already running, the commandline will be - passed to that session via IPC (X-event-based communication). - This option saves some KB of the KVIrc executable, - so if you're really short in memory , you might use it, - otherwise, IPC is a nice feature. - - --without-dyn-labels - You should not need this option. - It disables compilation of code that relies on a particular - compiler feature (jumping to a dynamic label with a goto). - Not all compilers support this , but configure shoud detect - it automatically. Anyway , if you get compilation errors on - kvi_ircview.cpp, you may try this option... - This may also help if the configure script seems to hang - when checking for the "compiler dynamic label support". - - --without-splash-screen - Do not compile the splash screen code. - This will remove you that nice "banner" image that pops up - while kvirc is starting up. It will maybe help in making an - executable smaller by a couple of KB and save a couple - of extra milliseconds during the startup. Use it if you're - tring to build a performance critical executable and you're - short both in memory and CPU time :) - - --without-gsm - Explicitly disable the usage of the GSM library. This will - disable the DCC VOICE gsm codec but might help when the - compilation stops complaining of something related to GSM :) - - --without-dcc-sound - Explicitly disable the DCC VOICE sound support. This might help - if you have problems in compilation of src/modules/dcc/voice.cpp. - It will disable the sound support - (and thus make DCC VOICE not usable). - - --disable-ssl - Disables the secure socket layer support. The SSL support is - automatically enabled if OpenSSL is detected at ./configure time. - This option forces it to be left out. - - --with-memory-profile - Debug stuff...enables memory allocation profiling (don't use it :) - - --with-memory-checks - Enables malloc() memory checks. This will print a nice message - if your system goes out of memory... - It can't save you from buying new RAM, - but at least you will know that your system went out of memory - and it is not a proper kvirc fault. Actually you probably have - no reason in using it. - - --with-big-channels - Minor hash table optimisations: higher memory usage but - faster user lookups. Use it if you often stay in channels with - a lot of users. (this is not critical anyway) - - --enable-profiling - Asks the compiler/linker to include profiling informations in the - executable. This is useful only if you want to profile KVIrc by - using the gprof program. Note that this will generate a bigger - and slower executable. - - --disable-perl - Forcibly disable perl support. - - So finally you have to run - - # ./configure - - For example , my common options are: - - # ./configure --enable-pipes --enable-debug - - On FreeBSD I have found useful this command line: - - # ./configure --with-qt-name=qt2 --with-qt-moc=//moc2 \ - --with-freebsd-pthread - - Once the configure script ran succesfully you can go to the next step. - - ### - ### Step 3 : Compiling (mandatory) - ### - - This step is easy: - Cross your fingers and run - - # make kvirc - - If your make is not a GNU make (this happens on FreeBSD for example) - you should use "gmake" instead. - The compilation process will take from 6-7 minutes to several hours - depending on the machine capabilities and load. - If you have a slow cpu but have a couple of computers in a lan you - might consider using distcc to distribute the compilation. - - Once the compilation has been succesfull, run - - # make install - - Same as above: use "gmake install" if your make is not GNU make. - - This will install the executable in /usr/local/bin - (if you don't have specified a different --prefix option in - the configure script) , the libraries in /usr/local/lib - and the shared data in /usr/local/share/kvirc. - If you had a previous kvirc installation , the default prefix - will be referring to the directory where the old kvirc - executable was found. - - Make sure that /usr/local/lib is in your /etc/ld.so.conf , - if it isn't there , put it there and run - - # ldconfig - - If you have decided to use the KDE support the installation - might have placed all these files in your $KDEDIR tree - instead of /usr/local. In this case you should be OK since - KDE requires its library dir to be in /etc/ld.so.conf - - ### - ### Step 4: Having fun - ### - - # kvirc & - - That's all folks. - - -############################################################################### -# 5. Compiling KVIrc on qt-embedded -############################################################################### - - Do you want KVIrc 3 on your hand computer ? - On your Nokia 9999910 ? - On your LINUX CONSOLE? - - Well, for the third it's really easy, just follow carefully those steps: - - 1. Install qt-embedded libraries (including the development files). - This can be as easy as: apt-get install libqt-emb-dev on Debian. - - 2. cd to the KVIrc3 source directory - - 3. run configure with the following parameters: - - # ./configure --with-qt-name=qte --with-fno-rtti --without-x-calls - --without-ipc --without-splash-screen --without-transparency - --with-qt-embedded --without-x-bell - - then run make and make install as usual - - 4. Try to have a life for the next minutes while kvirc3 compiles - - 5. You need your kernel with framebuffer support (it's under 'Console') - so if your kernel don't have it reconfigure and recompile your kernel. - - 6. switch to a console - - 7. export QTDIR=[path] On Debian is '/usr' - - 8. Read http://doc.trolltech.com/3.0/envvars.html and configure your - environment vars until kvirc3-emb loads (it will give you an error - indicating what went wrong else). Pay especial attention to - QWS_MOUSE_PROTO, QWS_CARD_SLOT and QWS_DISPLAY - - 9. Enjoy :) - -############################################################################### -# 6. Compiling KVIrc on MacOSX -############################################################################### - - There is a detailed compilation and installation HOWTO for MacOSX systems - located in the doc dorectory. - -############################################################################### -# 7. A note about Windows 95/98/ME -############################################################################### - - On Windows versions prior to 2000 the KVIrc binary may refuse to start - because of an incompatible msvcrt.dll included in the distribution. - - If this happens to you then you may try the following tricks: - - - Find msvcrt.dll in your C:\Windows directory. It may also be - in C:\Windows\System or C:\Windows\System32 - Copy it to the KVIrc installation folder overwriting the existing - msvcrt.dll shipped with kvirc. - - - Find msvcrt.dll somewhere on the net. An url hint might be: - http://www.dll-files.com/dllindex/dll-files.shtml?msvcrt - Download the file and copy it to the KVIrc installation folder - overwriting the existing msvcrt.dll shipped with kvirc. - - If none of the two steps work for you please write a mail to - pragma at kvirc dot net reporting your exact Windows version and build - and including the exact messages that the system reports when trying - to run the KVIrc executable. - - Thanx to Dusan Hokuv for reporting this and suggesting the fixes. - diff --git a/3.4.0/LICENSE b/3.4.0/LICENSE deleted file mode 100644 index 20a98663b8..0000000000 --- a/3.4.0/LICENSE +++ /dev/null @@ -1 +0,0 @@ -See doc/COPYING diff --git a/3.4.0/Makefile.am b/3.4.0/Makefile.am deleted file mode 100644 index c451931bb6..0000000000 --- a/3.4.0/Makefile.am +++ /dev/null @@ -1,95 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek -############################################################################### - -EXTRA_DIST = autogen.sh README FAQ - -SUBDIRS = admin data doc po scripts src - -AUTOMAKE_OPTIONS = foreign - -############################################################################### -# Delete moc files all around -############################################################################### - -delmoc: - rm -f $(topdir)/src/*/*/*.moc - rm -f $(topdir)/src/*/*/moc_*.cpp - -############################################################################### -# Main make command -############################################################################### - -kvirc-intro: - @echo "################################################################################" - @echo "### Ok..." - @echo "### The compilation process will take a while..." - @echo "### Have a cold beer in the meantime..." - @echo "################################################################################" - -kvirc-outro: - @echo "################################################################################" - @echo "### Finished..." - @echo "### Now type 'make install'" - @echo "################################################################################" - -kvirc: kvirc-intro all kvirc-outro - -install: install-recursive docs banner - -install-devel: install-recursive banner - -messages: - cd $(topdir)/po/kvirc && make messages - cd $(topdir)/po/modules/about && make messages - cd $(topdir)/po/modules/dcc && make messages - cd $(topdir)/po/modules/editor && make messages - cd $(topdir)/po/modules/logview && make messages - cd $(topdir)/po/modules/mediaplayer && make messages - cd $(topdir)/po/modules/notifier && make messages - cd $(topdir)/po/modules/options && make messages - cd $(topdir)/po/modules/perl && make messages - cd $(topdir)/po/modules/perlcore && make messages - cd $(topdir)/po/modules/sharedfileswindow && make messages - cd $(topdir)/po/modules/theme && make messages - -############################################################################### -# Generate documentation -############################################################################### - -docs: - $(mkinstalldirs) $(DESTDIR)$(helpdir) - perl admin/gendoc.pl -v $(VERSION) $(DESTDIR)$(helpdir) \ - data/doctemplates/*.template \ - `find ./ -name "*.cpp" -print` \ - `find ./ -name "*.h" -print` - -############################################################################### -# Rule for developer documentation -############################################################################### - -devdocs: - cd admin && doxygen - -############################################################################### -# Finished :) -############################################################################### - -banner: - @echo "################################################################################" - @echo "### INSTALLATION COMPLETE" - @echo "################################################################################" - @echo "###" - @echo "### KVIrc is now installed and ready to run." - @echo "###" - @echo "### Please send bug reports and suggestions" - @echo "### to pragma at kvirc dot net" - @echo "### You can use the mail report form on" - @echo "###" - @echo "### http://www.kvirc.net" - @echo "###" - @echo "### We hope that you will enjoy KVIrc." - @echo "###" - @echo "### Szymon Stefanek and the KVIrc Development Team" - @echo "###" - @echo "################################################################################" diff --git a/3.4.0/README b/3.4.0/README deleted file mode 100644 index 6d383c8a3f..0000000000 --- a/3.4.0/README +++ /dev/null @@ -1,387 +0,0 @@ -23.03.2008: Release 3.4.0 "Virgo" -############################################################################### - -Here we go with another release :) - -This one took a very long time but, well, finally it's here. - -Notable new features of this release include: - - - improved themeing support - - better desktop integration - - nicer support for many different IRC servers - - a totally revised option layout - - basic support for script "addons" - - improved help subsystem - - new nice statusbar applets - - improved scripting engine - - improved windows and macosx support - - .... - -There is also a lot of small new details that you will -find out by yourself while playing around and finally -we obviously also have a huge number of bugfixes. - -This will be the last stable release of the 3.* series and also the last -one using Qt3. From now on we'll be working on major version 4 and -switching completly to Qt4. This release actually contains a preliminary -Qt4 support and if you feel brave you might test it by passing -the "hidden" --enable-qt swtich to configure. - -Have fun :) -Szymon Stefanek and The KVIrc Development Team - - - - - - -############################################################################### -General notes for the 3.4.0 release of the KVIrc IRC client -############################################################################### - -- Installation - -The detailed installation instructions for the unix source distribution -are in the INSTALL file. - -The Windows version needs no installation: you just need to run the -installer executable and follow the proposed steps. - -Other documentation can be found in the doc subdirectory. - -- Reporting problems - -You are encouraged to "mess" with all the KVIrc options and features, -and to report bugs and misbehaviours to the author. -Anyway , before reporting a bug , ask yourself if it can be caused -by some other part of your system: KVIrc uses many external libraries -and (as all programs) relies on a correct system behaviour. -Make sure that the libraries you use are the correct ones (!!!). - -When you encounter a problem please read the FAQ that is found -in the distribution and also take a look at http://www.kvirc.net -for a more recent version. If nothing helps to solve your problem -then you might consider issuing a bug report. - -The best way to report a bug is to use the bugtrack system at -http://svn.kvirc.de/kvirc/. Another way is to subscribe -to the kvirc mailing list (see http://www.kvirc.net for instructions) -and report the problem there. In both cases your bug report -should be written in english and should contain most informations -possible about the problem. If you have encountered a crash -on an unix platform you should include a gdb backtrace (stack dump). -The more gdb info you send, the biggest is the possibility for us -to find the problem and maybe a solution. There is a FAQ entry -that explains how to produce a suitable gdb backtrace. -If you can't obtain a gdb backtrace (maybe because you're on -a platform where gdb is not available) or if the problem -is not related to a program crash then you should include -a detailed procedure that leads to the manifestation of your problem. -You should always include a short description of the platform you -are running on: the operating system, the cpu (if not an x86), -the version of the Qt library and the KDE environment (if relevant). -You should also mention the relevant version of KVIrc and where -you got it from (cvs, kvirc site, other sites). - - - - - - - - - - - - - - - - - - -############################################################################### -# Historic entries : just for the curious -############################################################################### - - -22.02.2005: Release 3.2.0 "Realia" -############################################################################### - -Here we go again: 3.2.0 is out! - -The long road to stability has reached an important milestone. The previous -releases of the 3.* series were the first ones after a huge codebase rewrite. -3.2.0 is a result of several months of testing, debugging and improving. -You will surely find it more stable, fast and user friendly. - -The old scripting toolbars have been replaced by the new "action" based -approach. Besides the scripting flexibility of the actions we have also -gained "drag & drop" toolbar editing. Just select "Settings -> Toolbars --> Customize" from the menu and drag your favorite actions (buttons!) to the -toolbars you wish. You can obviously create new toolbars on the fly and destroy -old ones. There is a set of builtin actions and new ones can be added -by the means of the action editor (another new feature) accessible from -the Scripting menu. Play with it :) - -The UNICODE support has been improved yet more. Now you can set global, -per-network, per-server and per-window encodings! There is also a new -set of "smart" encoding engines that first try to decode the text as UTF8 -and in case of failure fallback to your standard encoding. - -The translators did a really good (and hard) job: we actually have KVIrc -translated in 14 languages. I'm really happy about that. - -There is a new nice Instant-Messager-like notifier window that pops up when -a query message arrives and KVIrc is not the active application. Yes, -you can disable it, but I'm sure you will not. The notifier is also fully -scriptable and we're working on a simple skinning engine for it. - -We also have perl support: now you can use perl from KVS and -KVS from perl. The engine is still quite essential but with some hacking -you can obtain really good results from it. - -The small IRC-Context-Display has been removed from the toolbar and has been -replaced by a real status bar that is capable of displaying the same -informations in a much cleaner way. The IRC-Context-Display is still -available as an action so you can just drag it back in its place -and hide the status bar to return to the previous release configuration. -The statusbar also supports applets that can be added/dragged/removed by the -means of the mouse: just try the right click. - -The scripting engine has been improved and there are several new object -classes. An interesting new feature here is the $tr() function that allows -your scripts to be translated with the standard gettext mechanism. The -widely requested DCOP communication function has been implemented too. - -Out-of-the-box mircryption support has been added. The KVIrc's mircryption -engine supports the standard ECB mode and the new CBC mode - -The DCC transfers have been improved and seveal related bugs have been -fixed. It is also possible to limit the bandwidth for each transfer. - -There is a lot of minor new features that will make your IRC sessions funnier -and more exciting: some of them are described in the ChangeLog file and -other can be found by exploring the user interface. - -The small one-man-project has grown to the level of a small community. -People from around the world have joined our development efforts and are -constantly donating their time, eyes and bandwidth in order to make KVIrc -a really good IRC client. Besides of simply giving you a free (as in freedom!) -and nice program for chatting, they are giving you the great opportunity to see -what's behind the scenes: you have the source code for the whole application. -In practical terms this means more or less 300.000 lines of tested, debugged and -commented C++ code, several perl scripts, dozens of makefiles and all the means -that you need to produce a working KVIrc executable on all the supported platforms. -There is a lot of knowledge (some people call it "technology" because it sells better) -inside, ready to be acquired by an attentive reader. Don't forget that the freedom of -building your own executable from the sources gives you the opportunity -of verifying the source itself: for example you might be interested in verifying -that KVIrc will not run any malware code on your machine nor will collect -your private data and sell it to someone while you're happily chatting with a friend. -We call it freedom, please respect it :) - -Our community is contantly growing and this release was possible thanks to the -contribution of really many people. There are new mighty developers, new addicted -fans and we have seen a lot of new users. The list of the major contributors -can be found on the KVIrc site, in the about dialog and all around the sources. -If you want to meet them please join the #kvirc channel on your favorite -IRC network or subscribe to our mailing list. - -Ah, I was going to forget it: you might have noticed that there is -a version bump from 3.0.1 to 3.2.0. It's a typo that we arbitrairly -decided not to fix :) - -Have fun :) -Szymon Stefanek and The KVIrc Development Team - - - - -31.05.2004: Release 3.0.1 "System Virtue" -############################################################################### - -Here we go again: 3.0.1 is out! - -3.0.1 is mainly a bugfix release. 3.0.0 was the first public release -after long time and even if we have tested it for a very long time -some bugs didn't miss to jump out. 3.0.1 contains the fixes for these -problems and adds some minor functionality. The detailed list of -changes is in the ChangeLog file. - -The bugs for this release should be reported by using the bugtrack system available -at http://bugtrack.kvirc.omnikron.net - -Have fun :) -Szymon Stefanek and The KVIrc Development Team - - -17.04.2004: Release 3.0.0 "Awakening" -############################################################################### - -After a couple of years from the last stable release, here we go again :) - -Since the 2.* releases the KVIrc source code has been almost completely -rewritten. The major differences are summarized in the following list: - - - Multiserver: you can have multiple IRC connections in a single window - - IPV6 support, also for DCC transfers - - SSL support (also over IPV6) - - UNICODE support for the user interface - - Better scripting language - - A basic Theme Engine - -The first major goal of the rewrite was "user-friendliness": you should be -able to start an IRC session by selecting a server and clicking "Connect Now" -just after the installation. -The second major goal was "extreme-flexibility": you can customize the way KVIrc -looks and the scripting language allows you to implement complex responses -to IRC generated events. - -There is a lot of minor new features that will make your IRC sessions funnier -and more exciting: some of them are described in the ChangeLog file and -other can be found by exploring the user interface. - -This release was possible thanks to the contribution of many people. -The list includes but is not limited to: Triskelios, Jan Wagner (spion), -Juanjo Alvarez (Kane), Andrea Parrella (Yap), Luk De Ketelaere (Balboy), -Sara D'Alia (Sbrokka), Ted Podgurski (alch3m1st), Ciro Guariglia (d3vah), -Christoph Thielecke (Crissi), Eva Schaller (Penny), Niklas Luerßen (Tequila) -Olle Hallnas (Crocodile), Francesco Meloni (Princo), Alessandro Rossini (Aronnax), -Alex Grijalba Martinez (SuD), SuperbepS, Thilo Schulz (Thilo), Dworf, -Jorma Tuomainen (Wiza), Michele Pinassi (O-Zone), Paolo Sammicheli (XDatap1), -Ahinu, xevilstar, The Siena Linux Users Group, cyco & samweis, -The Firenze Linux Users Group, all the subscribers of the KVIrc public mailing -list and finally all the people from #kvirc on IRCNet and Freenode. - -Have fun :) -Szymon Stefanek and The KVIrc Development Team - -############################################################################### -General notes for the 3.0.0 release of the KVIrc IRC client -############################################################################### - -- Installation - -The detailed installation instructions for the unix source distribution -are in the INSTALL file. - -The Windows version needs no installation: just unzip the archive in -a suitable directory (such as C:\Program Files\) and run kvirc.exe from there. - -Other documentation can be found in the doc subdirectory. - -- Reporting problems - -In this release , the changes are so huge that it was not possible -to test them in all the possible conditions. A 'normal' irc session -should give you no problems. -You are encouraged to "mess" with all the KVIrc options and features, -and to report bugs and misbehaviours to the author. -Anyway , before reporting a bug , ask yourself if it can be caused -by some other part of your system: KVIrc uses many external libraries -and (as all programs) relies on a correct system behaviour. -Make sure that the libraries you use are the correct ones (!!!). - -- Contents of a good bug report: - -- A gdb backtrace in case of a segfault. - The more gdb info you send , the biggest is the possibility - for me to find the problem and maybe a solution. -- A detailed description (read : procedure) to reproduce the bug - Obviously if possible... -- All informations on your system that you think that may be - related to KVIrc and to the problem itself. - -To enable the gdb debugging you must compile kvirc with -the --enable-debug configure option. - - - -03.01.2003: Release 3.0.0 beta2 -############################################################################### - - -Here we go again! -Yes , this is still called "beta" , but it should be stable on most machines. -We're simply still missing some features planned for the final 3.0.0. - -Beta2 is being released as a source package. -Binary packages (for windows and other platforms) might be available soon -so check out the download section once in a while. - -90% of the 2.* branch features have been already re-implemented and there are -many new things to play with. - -There is a preliminary UNICODE port: KVIrc UI starts to "speak" foreign (non Latin1) based languages. -IRC character set mapping has been implemented (with 8 commonly used codepages for now). -You should be able to use the Euro sign (ISO-8859-15), write Cyrillic (KOI-8-R , CP-1251 , ISO-8859-5), -Greek (ISO-8859-7) and even use ideograms with the UTF-8 encoding. -Character mapping selection is window based thus you should be able to write Cyrillic on #russian, -Greek on #athens and write plain English on #kvirc in the same IRC session. - -Some modules have been removed from the main distribution. This is because the source -tree has been growing too much: we are removing the non-strictly-necessary features -and we will release them as separate packages. - -On the CVS you can already find the "nap" module that allows chatting (no file sharing yet) -on OpenNap networks. - -The scriptcenter dialog has been splitted in smaller "pieces" and a GUI toolbar editor has been added. - -Finally there are tons of bugfixes and improvements: just play with it :) - -The bugs for this release should be reported by using the bugtrack system available -at http://bugtrack.kvirc.omnikron.net. - -Have fun :) -Szymon Stefanek and The KVIrc Development Team - -############################################################################### - - - -25.06.2002 -############################################################################### - -3.0.0 beta1 (Codename: "Eve's Avatar") - -This release is "floating around" since a couple of months... -Well... finally... here we go :) -This is not stable yet, but many people use it and we get a really small number of -critical reports: this means that you probably can use it for your daily chatting. - -Beta1 is being released as a source package and a binary distro for the windows platform. -Binary packages for other platforms might be available soon so check out the download section once in a while. - -If you had previous KVIrc installations and you experience problems (missing menus for example) -try to remove (or better just rename) the old local configuration directory (locaed -in your home dir probably) and to restart KVIrc. - -80% of the 2.* branch features have been already re-implemented and there is a whole -bunch of new things to play with. One of the greates "ChangeLog" entries is the preliminary -SSL support that works for IRC and DCC CHAT (both over IPv4 and IPv6). -CTCP PAGE support has been added and there were some major changes to the variable -management in the scripting language (added "real" array support and changed the syntax for the dictionaries). -Those of you that like colors can now enable the icon-like display of emoticons -and play with icons in the text sent through the server (a new escape code). -The documentation has been reworked a little bit more, there are some new modules and -a lot of new options to try. - -The windows version is not completely in sync with the linux one thus you might find -that it lacks some features (mainly advanced scripting language, sound support etc...). -We hope to have a completely synchronized versions on both platforms for the time -of 3.0.0 final. - -The bugs for this release should be reported by using our new shiny bugtrack system available -at http://bugtrack.kvirc.omnikron.net. - -Well.. -That's all folks! - -Have fun :) -Szymon Stefanek and The KVIrc Development Team - -############################################################################### - diff --git a/3.4.0/TODO b/3.4.0/TODO deleted file mode 100644 index 06c966be42..0000000000 --- a/3.4.0/TODO +++ /dev/null @@ -1,50 +0,0 @@ -Update TODO file, if something is implemented, it should be removed in the TODO file. -Mantain TODO file as clear as possible - -- Pragma should read this file :D -- Events, events, events. There are lots of them pending (see TODO.Events). -- Multiple identities (and identity associations for servers) -- Port the speech module! -- /timer as a module -- It would be cool if KVIrc could to delete old log files automatically - (configurable, of course), to avoid disk ocupation. For example, delete (or - move to trash) 15-days old log files automatically (configurable by user). -- html colored logs (with icons ? configurable with an option) -- Check away status from the /WHO message ? (this would involve requesting WHO often) -- Handle more uncommon channel modes in the channel mode box ? - SHould get the available modes from RPL_ISUPPORT and show them in the box -- On-line charset guessing: - KviWindow should have the possibility of setting a KVI_CHARSET_AUTO - The KviWindow::decodeText() should contain an algorithm that - would use the best "guess" charset based on the window output - history , the actually detected charset and the text to decode - - /charset ISO-8859-15 -- When user clicks search in the help window there should be some kind of - notification when the search starts... The way it is now you can't tell if the - search button even worked, until the search process is finished -- Channel mode-field - The channel mode field should be dynamical, it should be able to change width according to what it needs, - today it's way too long. -- Userlist - The userlist should be dynamical after how many characters the server lets you use in a nickname, today it's - way too wide, this makes it look ugly. -- Text-hints - Text hints doesn't dissapear after changing desktop under KDE, and you have to change back to the - desktop where KVIrc is to remove the hint. -- CService support - We already have nickserv support, why not CService/X support? This should be much much easier to - implement as it's only on one net (Undernet), and with a static host and command that never changes, we - only need to specify password. -- Option to save & restore sessions (session = opened irc connections, channels & queries) -- Group messages: -         * Add predefined groups -         -         As kvirc3 now supports the ability to send msg's to more than one person at -         a time, I would have liked to see -         a way of making predefined groups.  For example if I often send the same msg -         to both user1, user3, user9 and -         user31, then I would like to add these to a group called "Friends", and then -         just do a "/gquery Friends hi :) what's up?" - -- Add commands for playing PCM WAV files (using the DCC voice code). diff --git a/3.4.0/TODO.Events b/3.4.0/TODO.Events deleted file mode 100644 index daf41fd12c..0000000000 --- a/3.4.0/TODO.Events +++ /dev/null @@ -1,58 +0,0 @@ -WRITE DOCS!!! :P - -This is a list of KVIrc 2.x events that are not present yet on KVIRC 3. -Please remove as you implement them. - -OnCTCPMultimedia -OnError -OnEventError -OnIdleStart -OnIdleStop -OnLogin? -OnUnhandedNumeric -OnUserWindowFileDrop -OnUserWindowInput -OnWhoisReply -> kvi_sp_numeric.cpp 851 - -(10) - - -Commands (Pragma please review, maybe remove ircop commands?) --------- - -CD -CTTPREPLY -DIR -FINDTEXT -GEOMETRY -KILLPROC -LOCOPS -MULTIMEDIA -OPNOTICE -OPERSERV -OS -OWNER -PROCLIST -REHASH -STATSERV -STATUS -UNEXCEPT - -(17) - -Functions ---------- -DurationToString -GetEnv -Icon -InetAton -InetNtoa -IsMe -IsValidIp -New needs documentation! -NumTimeToString -Range -StrCat -Uname - -(12) diff --git a/3.4.0/admin/.svnignore b/3.4.0/admin/.svnignore deleted file mode 100644 index e9abcece86..0000000000 --- a/3.4.0/admin/.svnignore +++ /dev/null @@ -1,11 +0,0 @@ -Makefile.in -Makefile -config.guess -config.sub -depcomp -install-sh -missing -mkinstalldirs -core -objprelink -ltmain.sh diff --git a/3.4.0/admin/Doxyfile b/3.4.0/admin/Doxyfile deleted file mode 100644 index 833a3012c3..0000000000 --- a/3.4.0/admin/Doxyfile +++ /dev/null @@ -1,1252 +0,0 @@ -# Doxyfile 1.4.7 - -# 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 = KVIrc - -# 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 = 3.2.6 - -# 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 = YES - -# 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 = - -# 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 = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# 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 = YES - -# 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 = YES - -# 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 = NO - -# 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 = NO - -# 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 = NO - -# 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 = YES - -# 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 = NO - -# 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 = "$file:$line: $text" - -# 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 = kvi*.h kvi*.cpp - -# 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 = YES - -# 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 = ../src/kvilib/include ../src/kvirc/include - -# 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 = - -# 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 = - -# 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 = NO - -# 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 REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. Otherwise they will link to the documentstion. - -REFERENCES_LINK_SOURCE = 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 = NO - -# 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 = - -#--------------------------------------------------------------------------- -# 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 = html - -# 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 = latex - -# 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 = rtf - -# 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 = .3 - -# 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 = NO - -#--------------------------------------------------------------------------- -# 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 = YES - -#--------------------------------------------------------------------------- -# 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 = NO - -# 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 = NO - -# 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 = - -# 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 = - -# 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 = /usr/bin/perl - -#--------------------------------------------------------------------------- -# 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 = NO - -# 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 CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a caller 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 caller graphs for selected -# functions only using the \callergraph command. - -CALLER_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 = 1024 - -# 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/3.4.0/admin/Makefile.am b/3.4.0/admin/Makefile.am deleted file mode 100644 index 0924d2ceec..0000000000 --- a/3.4.0/admin/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -SUBDIRS = libtool - -EXTRA_DIST = acinclude.m4.in libtool.m4.in gendoc.pl gensrc.pl \ - depcomp config.guess config.sub install-sh ltmain.sh \ - missing objprelink.c sedfiles.sh \ - searchmetaob.sh mkcvstag.sh src_cvstag src_date - -objprelink: objprelink.c - $(CC) -o $@ -O2 $< /usr/lib/libbfd.a /usr/lib/libiberty.a - diff --git a/3.4.0/admin/acinclude.m4.in b/3.4.0/admin/acinclude.m4.in deleted file mode 100644 index bcb1ce1445..0000000000 --- a/3.4.0/admin/acinclude.m4.in +++ /dev/null @@ -1,2760 +0,0 @@ -dnl # // ################################################################################################################## -dnl # // ## Initialization -dnl # // ################################################################################################################## - -AC_DEFUN([AC_SS_INIT_VARIABLES], -[ - SS_BUILD_FLAGS="" - SS_BUILD_NUMBER="" - - dnl # // X Stuff - - SS_X_INCDIR="" - SS_X_LIBDIR="" - SS_X_LDFLAGS="" - SS_X_CPPFLAGS="" - - dnl # // Qt Stuff - - SS_QT3_GENERAL_DIR="" - SS_QT3_INCDIR="" - SS_QT3_LIBDIR="" - SS_QT3_MOC="" - - dnl # // KDE Stuff - - SS_KDE_REQUESTED="no" - SS_KDE_GENERAL_DIR="" - SS_KDE_INCDIR="" - SS_KDE_LIBDIR="" - SS_KDE_SERVICESDIR="" - SS_KDE_ICONS32DIR="" - - dnl # // Perl stuff - - SS_PERL_ENABLE="no" - SS_PERL_CCFLAGS="" - SS_PERL_LDFLAGS="" - SS_PERL_BINARY="true" - - - dnl # // CXXFLAGS, will be set by AC_SS_CXXFLAGS - - dnl # CXXFLAGS="" - - dnl Build flags: - dnl g - Debug version - dnl h - Memory checks - dnl m - Memory profiling - dnl s - System memmove - dnl S - splash screen - dnl o = openssl support - dnl b - Big channels - dnl x - ix86 asm - dnl T - tips - dnl c - crypt - dnl I - IPC - dnl G - GSM codec - dnl 8 - local 8 bit - dnl A - dcc sound audio support - dnl a - ignore sigalarm - dnl i - ipv6 - dnl B - big endian - dnl k - KDE - dnl p - pseudo transparency - dnl e - Esound daemon support - dnl r - Arts daemon support - dnl f - Audiofile support - dnl P - profiling support - dnl p - perl scripting support -]) - -dnl # // ################################################################################################################## -dnl # // ## OUTPUT MACROS -dnl # // ################################################################################################################## -AC_DEFUN([AC_CROSS_COLOR], -[ - - TPUT=0 - PRINTF=0 - COLOR=0 - IFS_OLD=$IFS - IFS=":" - - for i in $PATH; do - if test -x "$i/tput"; then - TPUT=1 - fi - done - - type printf >/dev/null 2>&1 && PRINTF=1 - - for i in $PATH; do - if test -x "$i/printf"; then - PRINTF=1 - fi - done - - if test "$TPUT" = "1" -o "$PRINTF" = "1"; then - COLOR=1 - fi - - if test "$COLOR" = 1; then - if test "$TPUT" = "1"; then - if test "$1" = "1"; then - tput bold - else - tput sgr0 - fi - if test "$2" != ""; then - tput setaf $2 - fi - elif test "$PRINTF" = "1"; then - if test "$2" != ""; then - printf "\033\1330$1;3$2m" - fi - fi - fi - - IFS=$IFS_OLD -]) - -AC_DEFUN([AC_SS_HEADER], -[ - AC_CROSS_COLOR([1],[2]) - echo "################################################################################" - echo "### $1" - echo "################################################################################" - AC_CROSS_COLOR([0],[9]) -]) - -AC_DEFUN([AC_SS_SECTION], -[ - AC_CROSS_COLOR([1],[3]) - echo "### $1" - AC_CROSS_COLOR([0],[9]) -]) - -AC_DEFUN([AC_SS_SET_REDINK], -[ - AC_CROSS_COLOR([1],[1]) -]) - -AC_DEFUN([AC_SS_SET_GREENINK], -[ - AC_CROSS_COLOR([1],[2]) -]) - -AC_DEFUN([AC_SS_SET_NORMALINK], -[ - AC_CROSS_COLOR([0],[9]) -]) - -dnl # // ################################################################################################################## -dnl # // ## FILE LOOKUP MACROS -dnl # // ################################################################################################################## - -AC_DEFUN([AC_SS_FIND_FILE_PATH], -[ - $3="FAILED" - for a_dir in $2; do - for a_file in $1; do - if test -r "$a_dir/$a_file"; then - $3=$(echo "$a_dir" | sed -e 's/\/\.\//\//g' | sed -e 's/\/\//\//g' | sed -e 's/\/\.\//\//g' | sed -e 's/\/\//\//g') - break 2 - fi - done - done -]) - -AC_DEFUN([AC_SS_FIND_FILE_PATH_EXT], -[ - $4="FAILED" - - for a_dir in $2; do - for a_semidir in $3; do - for a_file in $1; do - if test -r "$a_dir/$a_semidir/$a_file"; then - $4=$(echo "$a_dir/$a_semidir" | sed -e 's/\/\.\//\//g' | sed -e 's/\/\//\//g' | sed -e 's/\/\.\//\//g' | sed -e 's/\/\//\//g') - break 3 - fi - done - done - done -]) - -dnl # // ################################################################################################################## -dnl # // ## BASIC COMPILER FLAGS -dnl # // ################################################################################################################## - - -AC_DEFUN([AC_SS_CXXFLAGS_DEBUG_SYMBOLS], -[ - dnl # // Checks if the --with-debug-symbols option has been passed to configure - dnl # // adds -g to SS_CXXFLAGS - dnl # // adds g to SS_BUILD_FLAGS - - AC_MSG_CHECKING([if you want the debug symbols]) - - SS_LOCAL_ADD_DEBUG_SYMBOLS="" - - AC_ARG_ENABLE(debug, - AC_HELP_STRING([--enable-debug],[Compile an executable suitable for debugging]), - [SS_LOCAL_ADD_DEBUG_SYMBOLS="true"]) - - if test -n "$SS_LOCAL_ADD_DEBUG_SYMBOLS"; then - AC_MSG_RESULT([yes]) - if test -n "$SS_CXXFLAGS"; then - SS_CXXFLAGS="$SS_CXXFLAGS -g" - else - SS_CXXFLAGS="-g" - fi - SS_BUILD_FLAGS="g$SS_BUILD_FLAGS" - else - AC_MSG_RESULT([no]) - fi -]) - -AC_DEFUN([AC_SS_CXXFLAGS_PIPES], -[ - dnl # // Checks if the --with-pipes option has been passed to configure - dnl # // adds -pipe to CXXFLAGS - - AC_MSG_CHECKING([if you want to use pipes for compilation]) - - SS_LOCAL_USE_PIPES="" - AC_ARG_ENABLE(pipes, - AC_HELP_STRING([--enable-pipes],[Use pipes instead of files for the compilation]), - [SS_LOCAL_USE_PIPES="true"]) - - if test -n "$SS_LOCAL_USE_PIPES"; then - AC_MSG_RESULT([yes]) - if test -n "$SS_CXXFLAGS"; then - SS_CXXFLAGS="$SS_CXXFLAGS -pipe" - else - SS_CXXFLAGS="-pipe" - fi - else - AC_MSG_RESULT([no]) - fi -]) - - -AC_DEFUN([AC_SS_CXXFLAGS_PROFILING], -[ - AC_MSG_CHECKING([if you want the profiling information]) - - SS_LOCAL_ADD_PROFILING="" - - AC_ARG_ENABLE(profiling, - AC_HELP_STRING([--enable-profiling],[Compile an executable suitable for profiling]), - [SS_LOCAL_ADD_PROFILING="true"]) - - if test -n "$SS_LOCAL_ADD_PROFILING"; then - AC_MSG_RESULT([yes]) - if test -n "$SS_CXXFLAGS"; then - SS_CXXFLAGS="$SS_CXXFLAGS -pg" - else - SS_CXXFLAGS="-pg" - fi - if test -n "$SS_LDFLAGS"; then - SS_LDFLAGS="$SS_LDFLAGS -pg" - else - SS_LDFLAGS="-pg" - fi - SS_BUILD_FLAGS="P$SS_BUILD_FLAGS" - else - AC_MSG_RESULT([no]) - fi -]) - -AC_DEFUN([AC_SS_CXXFLAGS_FNORTTI], -[ - AC_MSG_CHECKING([if you want to use -fno-rtti]) - - SS_LOCAL_FNORTTI="" - AC_ARG_ENABLE(fno-rtti, - AC_HELP_STRING([--enable-fno-rtti],[Disable runtime type information (dangerous)]), - SS_LOCAL_FNORTTI="true") - - if test -n "$SS_LOCAL_FNORTTI"; then - AC_MSG_RESULT([yes]) - if test -n "$SS_CXXFLAGS"; then - SS_CXXFLAGS="$SS_CXXFLAGS -fno-rtti" - else - SS_CXXFLAGS="-fno-rtti" - fi - else - AC_MSG_RESULT([no]) - fi -]) - -AC_DEFUN([AC_SS_CXXFLAGS_ANSI], -[ - SS_ANSI_COMPILATION="" - AC_MSG_CHECKING([if you want a strict ansi compilation]) - AC_ARG_ENABLE(ansi, - AC_HELP_STRING([--enable-ansi],[Strict ansi compilation (might not compile)]), - SS_ANSI_COMPILATION="true") - - if test -n "$SS_ANSI_COMPILATION"; then - AC_MSG_RESULT([yes]) - if test -n "$SS_CXXFLAGS"; then - SS_CXXFLAGS="$SS_CXXFLAGS -ansi" - else - SS_CXXFLAGS="-ansi" - fi - else - AC_MSG_RESULT([no]) - fi -]) - - -AC_DEFUN([AC_SS_CXXFLAGS_WALL], -[ - SS_WALL_COMPILATION="" - AC_MSG_CHECKING([if you want gcc to be paranoic]) - AC_ARG_ENABLE(wall, - AC_HELP_STRING([--enable-wall],[Make gcc be paranoic (might not compile)]), - SS_WALL_COMPILATION="true") - - if test -n "$SS_WALL_COMPILATION"; then - AC_MSG_RESULT([yes]) - if test -n "$SS_CXXFLAGS"; then - SS_CXXFLAGS="$SS_CXXFLAGS -Wall" - else - SS_CXXFLAGS="-Wall" - fi - else - AC_MSG_RESULT([no]) - fi -]) - - -AC_DEFUN([AC_SS_CXXFLAGS_PEDANTIC], -[ - SS_PEDANTIC_COMPILATION="" - AC_MSG_CHECKING([if you want a strict ansi compilation]) - - AC_ARG_ENABLE(pedantic, - AC_HELP_STRING([--enable-pedantic],[Pedantic compilation (might not compile)]), - SS_PEDANTIC_COMPILATION="true") - - if test -n "$SS_PEDANTIC_COMPILATION"; then - AC_MSG_RESULT([yes]) - if test -n "$SS_CXXFLAGS"; then - SS_CXXFLAGS="$SS_CXXFLAGS -pedantic" - else - SS_CXXFLAGS="-pedantic" - fi - else - AC_MSG_RESULT([no]) - fi -]) - -AC_DEFUN([AC_SS_CXXFLAGS_OPTIMISATION], -[ - AC_MSG_CHECKING([for the optimisation level]) - - SS_LOCAL_OPTIMISATION="" - AC_ARG_ENABLE(optimisation, - AC_HELP_STRING([--enable-optimisation=N],[Use optimisation level N when compiling]), - SS_LOCAL_OPTIMISATION="$enableval") - - if test -n "$SS_LOCAL_OPTIMISATION"; then - AC_MSG_RESULT([using -O$SS_LOCAL_OPTIMISATION]) - if test -n "$SS_CXXFLAGS"; then - SS_CXXFLAGS="$SS_CXXFLAGS -O$SS_LOCAL_OPTIMISATION" - else - SS_CXXFLAGS="-O$SS_LOCAL_OPTIMISATION" - fi - SS_BUILD_FLAGS="$SS_LOCAL_OPTIMISATION$SS_BUILD_FLAGS" - else - AC_MSG_RESULT([using no optimisation flag]) - fi -]) - - - -AC_DEFUN([AC_SS_CXXFLAGS], -[ - SS_CXXFLAGS="" - - AC_SS_CXXFLAGS_DEBUG_SYMBOLS - AC_SS_CXXFLAGS_PROFILING - AC_SS_CXXFLAGS_PIPES - AC_SS_CXXFLAGS_OPTIMISATION - AC_SS_CXXFLAGS_FNORTTI - AC_SS_CXXFLAGS_ANSI - AC_SS_CXXFLAGS_PEDANTIC - AC_SS_CXXFLAGS_WALL - - if test -n "$SS_CXXFLAGS"; then - if test -n "$CXXFLAGS"; then - CXXFLAGS="$CXXFLAGS $SS_CXXFLAGS" - else - CXXFLAGS="$SS_CXXFLAGS" - fi - fi -]) - - -dnl ################################################################################################################### -dnl ### HEADERS AND FUNCTIONS -dnl ################################################################################################################### - -AC_DEFUN([AC_SS_HEADER_CHECKS], -[ - SS_HAS_OSS_SUPPORT="false" - AC_CHECK_HEADER(strings.h) - AC_CHECK_HEADERS(linux/soundcard.h sys/soundcard.h soundcard.h,SS_HAS_OSS_SUPPORT="true") - - if test "$SS_HAS_OSS_SUPPORT" = "true"; then - AC_DEFINE([COMPILE_OSS_SUPPORT], 1, [define if you want to enable OSS sound support]) - fi - -]) - -AC_DEFUN([AC_SS_FUNCTION_CHECKS], -[ - SS_HAVE_IPV6_FUNCTIONS="true" - - AC_CHECK_FUNCS(getenv strerror) - AC_CHECK_FUNCS(inet_ntoa inet_aton) - AC_CHECK_FUNCS(setenv unsetenv putenv) - AC_CHECK_FUNCS(gmtime_r localtime_r) - - AC_CHECK_FUNC(inet_ntop,SS_HAVE_IPV6_FUNCTIONS="true",SS_HAVE_IPV6_FUNCTIONS="false") - AC_CHECK_FUNC(inet_pton,SS_HAVE_IPV6_FUNCTIONS="true",SS_HAVE_IPV6_FUNCTIONS="false") - AC_CHECK_FUNC(getaddrinfo,SS_HAVE_IPV6_FUNCTIONS="true",SS_HAVE_IPV6_FUNCTIONS="false") - - AC_CHECK_FUNCS(getnameinfo) -]) - - - -dnl ################################################################################################################### -dnl ### MISC OPTIONS -dnl ################################################################################################################### - - -AC_DEFUN([AC_SS_MISC_OPTIONS], -[ - AC_MSG_CHECKING([if you want the memory profiling]) - AC_ARG_WITH(memory-profile, [ --with-memory-profile Compile the memory profile],SS_COMPILE_MEMORY_PROFILE="true") - if test "$SS_COMPILE_MEMORY_PROFILE" = "true"; then - AC_MSG_RESULT(yes) - AC_DEFINE([COMPILE_MEMORY_PROFILE], 1, [define if you want the gcc memory profile]) - SS_BUILD_FLAGS="m$SS_BUILD_FLAGS" - else - AC_MSG_RESULT(no) - fi - - AC_MSG_CHECKING([how to waste your time]) - AC_MSG_RESULT(by performing senseless checks) - - AC_MSG_CHECKING([if you want memory checking in malloc]) - AC_ARG_WITH(memory-checks, [ --with-memory-checks Enable malloc memory checks],SS_COMPILE_MEMORY_CHECKS="true") - if test "$SS_COMPILE_MEMORY_CHECKS" = "true"; then - AC_MSG_RESULT(yes) - AC_DEFINE([COMPILE_MEMORY_CHECKS], 1, [define if you want the memory checks]) - SS_BUILD_FLAGS="h$SS_BUILD_FLAGS" - else - AC_MSG_RESULT(no) - fi - - - AC_MSG_CHECKING([if you want to use system memmove]) - AC_ARG_WITH(system-memmove, [ --without-system-memmove Do not use system memmove and memcpy],SS_DO_NOT_USE_SYSTEM_MEMMOVE="true") - if test "$SS_DO_NOT_USE_SYSTEM_MEMMOVE" = "true"; then - AC_MSG_RESULT(no) - else - AC_DEFINE([COMPILE_WITH_SYSTEM_MEMMOVE], 1, [define if you trust your memmove() function]) - AC_MSG_RESULT(yes) - SS_BUILD_FLAGS="s$SS_BUILD_FLAGS" - fi - - AC_MSG_CHECKING([if you want to optimize for big channels]) - AC_ARG_WITH(big-channels, [ --with-big-channels Optimize for big irc channels],SS_OPTIMIZE_BIG_CHANNELS="true") - if test "$SS_OPTIMIZE_BIG_CHANNELS" = "true"; then - AC_MSG_RESULT(yes: using 349 as dict size) - AC_DEFINE_UNQUOTED([AVERAGE_CHANNEL_USERS],349, [define this to the number of average channel users]) - SS_BUILD_FLAGS="b$SS_BUILD_FLAGS" - else - AC_MSG_RESULT(no: using 101 as dict size) - AC_DEFINE_UNQUOTED([AVERAGE_CHANNEL_USERS],101, [define this to the number of average channel users]) - fi - - AC_MSG_CHECKING([if you want ix86 assembly optimisations]) - AC_ARG_WITH(ix86-asm, [ --with-ix86-asm Compile ix86 assembly optimisations],SS_COMPILE_ix86_ASM="true") - if test "$SS_COMPILE_ix86_ASM" = "true"; then - AC_MSG_RESULT(yes) - AC_MSG_CHECKING(target system CPU) - if test "$target_cpu" = "i386"; then - AC_MSG_RESULT(i386 : compiling asm code) - else - if test "$target_cpu" = "i486"; then - AC_MSG_RESULT(i486 : compiling asm code) - else - if test "$target_cpu" = "i586"; then - AC_MSG_RESULT(i586 : compiling asm code) - else - if test "$target_cpu" = "i686"; then - AC_MSG_RESULT(i686 : compiling asm code) - else - AC_MSG_RESULT($target_cpu , no i386 optimisations) - unset SS_COMPILE_ix86_ASM - fi - fi - fi - fi - - if test "$SS_COMPILE_ix86_ASM" = "true"; then - AC_DEFINE([COMPILE_ix86_ASM], 1, [define if you want the i386 asm code]) - SS_BUILD_FLAGS="x$SS_BUILD_FLAGS" - fi - else - AC_MSG_RESULT(no) - fi - - AC_PATH_PROG(SS_MSGFMT,msgfmt,":",$PATH:/bin:/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin:/usr/lib/qt/bin:/usr/local/qt/bin:/usr/X11R6/qt/bin:/usr/qt/bin:/usr/build/qt/bin) - if test -z "SS_MSGFMT"; then - SS_MSGFMT=":" - fi - AC_SUBST(SS_MSGFMT) - - AC_MSG_CHECKING([if you want the DCC VOICE sound support]) - AC_ARG_WITH(dcc-sound,[ --without-dcc-sound Do not compile the DCC VOICE sound support],SS_NO_SOUND="true") - if test "$SS_NO_SOUND" = "true"; then - AC_MSG_RESULT(no) - AC_DEFINE([COMPILE_DISABLE_DCC_VOICE], 1, [define if you want to disable DCC VOICE sound support]) - else - AC_MSG_RESULT(yes) - SS_BUILD_FLAGS="A$SS_BUILD_FLAGS" - fi - - SS_BUILD_FLAGS="T$SS_BUILD_FLAGS" - AC_DEFINE([COMPILE_INFO_TIPS], 1, [define if you want the info tips to be compiled in]) - - AC_MSG_CHECKING([if you want to disable the ipV6 support]) - AC_ARG_WITH(ipv6-support,[ --without-ipv6-support Do not compile the IpV6 support],SS_NOIPV6_SUPPORT="true") - if test "$SS_NOIPV6_SUPPORT" = "true"; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi - - AC_MSG_CHECKING([if you want to disable the cryptography support]) - AC_ARG_WITH(crypt-support,[ --without-crypt-support Do not compile the cryptography support],SS_NOCRYPT_SUPPORT="true") - if test "$SS_NOCRYPT_SUPPORT" = "true"; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - AC_DEFINE([COMPILE_CRYPT_SUPPORT], 1, [define if you want to compile the crypt support]) - SS_BUILD_FLAGS="c$SS_BUILD_FLAGS" - fi - - AC_MSG_CHECKING([if you want to disable the X bell support]) - AC_ARG_WITH(x-bell,[ --without-x-bell Disable the X bell support],SS_NO_X_BELL="true") - if test "$SS_NO_X_BELL" = "true"; then - AC_MSG_RESULT(yes) - AC_DEFINE([COMPILE_NO_X_BELL], 1, [define if you want to disable the X bell support]) - else - AC_MSG_RESULT(no) - fi - - AC_DEFINE([COMPILE_NEW_KVS], 1, [define if you want to enable the new KVS parser]) - AC_DEFINE([COMPILE_ONLY_NEW_KVS], 1, [define if you want to use only the new KVS parser]) - - AC_MSG_CHECKING([if you want to link to the embedded version of qt]) - AC_ARG_WITH(qt-embedded,[ --with-qt-embedded Link to qt-embedded (see INSTALL)],SS_QT3_EMBEDDED="true") - if test "$SS_QT3_EMBEDDED" = "true"; then - AC_MSG_RESULT(yes) - SS_BUILD_FLAGS="E$SS_BUILD_FLAGS" - else - AC_MSG_RESULT(no) - fi - - - AC_MSG_CHECKING([if you want to disable inter-process communication]) - AC_ARG_WITH(ipc,[ --without-ipc Disable inter-process communication support],SS_NO_IPC="true") - if test "$SS_NO_IPC" = "true"; then - AC_MSG_RESULT(yes) - SS_BUILD_FLAGS="I$SS_BUILD_FLAGS" - AC_DEFINE([COMPILE_NO_IPC], 1, [define this if you want to disable the inter-process communication support]) - else - AC_MSG_RESULT(no) - fi - - AC_MSG_CHECKING([if you want to explicitly disable the gsm codec support]) - AC_ARG_WITH(gsm,[ --without-gsm Disable gsm codec support],SS_NO_GSM="true") - if test "$SS_NO_GSM" = "true"; then - AC_MSG_RESULT(yes) - else - AC_DEFINE([COMPILE_USE_GSM], 1, [define if you have libgsm and want the GSM code to be compiled]) - SS_BUILD_FLAGS="G$SS_BUILD_FLAGS" - AC_MSG_RESULT(no) - fi - - - AC_MSG_CHECKING([if you want to ignore SIGALARM]) - AC_ARG_WITH(ignore-sigalarm, [ --with-ignore-sigalarm Ignore SIGALARM in all threads],SS_IGNORE_SIGALARM="true") - if test "$SS_IGNORE_SIGALARM" = "true"; then - AC_MSG_RESULT(yes) - AC_DEFINE([COMPILE_IGNORE_SIGALARM], 1, [define this if you want to ignore the SIGALARM signal]) - SS_BUILD_FLAGS="a$SS_BUILD_FLAGS" - else - AC_MSG_RESULT(no) - fi - - AC_MSG_CHECKING([if you want the pseudo-transparency support]) - AC_ARG_WITH(transparency, [ --without-transparency Do NOT compile the pseudo-transparency support],SS_NO_PSEUDO_TRANSPARENCY="true") - if test "$SS_NO_PSEUDO_TRANSPARENCY" = "true"; then - AC_MSG_RESULT(no) - else - AC_MSG_RESULT(yes) - AC_DEFINE([COMPILE_PSEUDO_TRANSPARENCY], 1, [define if you have the KDE support and want the pseudo transparency]) - SS_BUILD_FLAGS="p$SS_BUILD_FLAGS" - fi - - AC_ARG_WITH(pizza,[ --with-pizza Use this when hungry],SS_PIZZA="true") - -]) - - -dnl ################################################################################################################### -dnl ### DYNAMIC LABELS -dnl ################################################################################################################### - -AC_DEFUN([AC_SS_CHECK_DYNAMIC_LABELS], -[ - AC_MSG_CHECKING([if the compiler supports dynamic labels]) - AC_ARG_WITH(dyn-labels, [ --without-dyn-labels Disable usage of the dynamic label jumps],SS_DISABLE_DYNAMIC_LABELS="true") - if test "$SS_DISABLE_DYNAMIC_LABELS" = "true"; then - AC_MSG_RESULT("no: trusting you") - else - AC_TRY_RUN([ - int main(int argc,char ** argv) - { - int retVal = 10; - void * label = &&action4; - goto action2; - action1: - retVal -= 4; - label = &&endofcode; - goto *label; - action2: - retVal -= 5; - goto *label; - action3: - retVal += 40; - action4: - retVal -= 1; - label = &&action1; - goto *label; - endofcode: - return retVal; - } - ],SS_DISABLE_DYNAMIC_LABELS="false",SS_DISABLE_DYNAMIC_LABELS="true",SS_DISABLE_DYNAMIC_LABELS="true") - - if test "$SS_DISABLE_DYNAMIC_LABELS" = "true"; then - AC_MSG_RESULT("no") - else - AC_MSG_RESULT("yes") - AC_DEFINE([COMPILE_USE_DYNAMIC_LABELS], 1, [define if your compiler supports gotos do dynamic labels]) - fi - fi -]) - -dnl ################################################################################################################### -dnl ### BIG_ENDIAN -dnl ################################################################################################################### - -AC_DEFUN([AC_SS_CHECK_BIG_ENDIAN], -[ - AC_MSG_CHECKING([if this system is big endian]) - AC_TRY_RUN([ - int main(int argc,char ** argv) - { - int nl; - unsigned char * nlc; - nl = 0x12CAFE34; - nlc = (unsigned char *)(&nl); - if((nlc[0] == 0x12) && (nlc[1] == 0xCA) && (nlc[2] == 0xFE) && (nlc[3] == 0x34))return 0; - return 1; - } - ],SS_BIG_ENDIAN_MACHINE="true",SS_BIG_ENDIAN_MACHINE="false",SS_BIG_ENDIAN_MACHINE="false") - - dnl # This will fail if we're cross compiling... - - if test "$SS_BIG_ENDIAN_MACHINE" = "true"; then - AC_MSG_RESULT([yes]) - SS_BUILD_FLAGS="B$SS_BUILD_FLAGS" - AC_DEFINE([BIG_ENDIAN_MACHINE_BYTE_ORDER], 1, [define this if you are on a big endian machine]) - else - AC_MSG_RESULT([no]) - fi -]) - -dnl ################################################################################################################### -dnl ### DLOPEN -dnl ################################################################################################################### - - -AC_DEFUN([AC_SS_CHECK_DL], -[ - AC_MSG_CHECKING([for dlopen capabilities]) - - SS_LINK_TO_LIBDL="no" - - SS_SAVE_LIBS="$LIBS" - LIBS="-rdynamic" - AC_TRY_LINK([ - #include - ],[ - /* sparc-unknown-openbsd3.0 hack */ - #ifndef RTLD_NOW - #define RTLD_NOW RTLD_LAZY - #endif - dlopen("/lib/libc.so.6",RTLD_NOW); - ], - eval "SS_DLOPEN_OK=yes" - , - eval "SS_DLOPEN_OK=no" - ) - LIBS="$SS_SAVE_LIBS" - - if test "$SS_DLOPEN_OK" = "yes"; then - AC_MSG_RESULT([builtin in libc]) - else - - SS_SAVE_LIBS="$LIBS" - LIBS="-rdynamic -ldl" - AC_TRY_LINK([ - #include - ],[ - /* sparc-unknown-openbsd3.0 hack */ - #ifndef RTLD_NOW - #define RTLD_NOW RTLD_LAZY - #endif - dlopen("/usr/lib/libdl.so",RTLD_NOW); - ], - eval "SS_DLOPEN_OK=yes", - eval "SS_DLOPEN_OK=no" - ) - LIBS="$SS_SAVE_LIBS" - - if test "$SS_DLOPEN_OK" = "yes"; then - SS_LINK_TO_LIBDL="yes" - AC_MSG_RESULT([external in libdl]) - else - AC_MSG_RESULT([FAILED]) - AC_SS_SET_REDINK - echo "################################################################################" - echo "### CONFIGURE ERROR:" - echo "### No dlopen capabilities found." - echo "### It looks that your system has no interface to the dynamic linker ?" - echo "### If you're on linux, you either miss libdl , or the linker is not" - echo "### able to find it. Make sure that libdl is in /lib or /usr/lib." - echo "### If you're sure you have libdl, make sure you have also g++ installed." - echo "### If you're not on linux, please drop a mail to pragma at kvirc dot net" - echo "### describing your system and I'll try to fix it." - echo "################################################################################" - AC_SS_SET_NORMALINK - AC_MSG_ERROR(["This was fatal...aborting"]) - fi - fi -]) - - -dnl ################################################################################################################### -dnl ### PERL -dnl ################################################################################################################### - - -AC_DEFUN([AC_SS_CHECK_PERL], -[ - SS_PERL_ENABLE="yes" - SS_PERL_CCFLAGS="" - SS_PERL_LDFLAGS="" - SS_PERL_BINARY="true" - SS_PERL_RESULT_MESSAGE="" - - AC_ARG_ENABLE(perl,AC_HELP_STRING([--enable-perl],[Enable perl scripting support (default=detect)]),eval "SS_PERL_ENABLE=$enableval") - - if test "$SS_PERL_ENABLE" = "yes"; then - AC_PATH_PROG(SS_PERL_BINARY,perl,":",$PATH:/bin:/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin:/usr/lib/qt/bin:/usr/local/qt/bin:/usr/X11R6/qt/bin:/usr/qt/bin:/usr/build/qt/bin) - if test -z "SS_PERL_BINARY"; then - SS_PERL_RESULT_MESSAGE="disabled: can't find the perl binary" - SS_PERL_ENABLE="no" - SS_PERL_BINARY="true" - fi - else - SS_PERL_RESULT_MESSAGE="disabled by user" - fi - - if test "$SS_PERL_ENABLE" = "yes"; then - AC_MSG_CHECKING([if perl il compiled with MULTIPLICITY option]) - SS_PERL_TEMP=$($SS_PERL_BINARY -V | grep MULTIPLICITY) - if test -z "$SS_PERL_TEMP"; then - AC_MSG_RESULT([no]) - SS_PERL_ENABLE="no" - SS_PERL_BINARY="true" - SS_PERL_RESULT_MESSAGE="disabled: MULTIPLICITY not defined" - fi - fi - - if test "$SS_PERL_ENABLE" = "yes"; then - AC_MSG_CHECKING([for the system perl directory]) - SS_PERL_DIR=$($SS_PERL_BINARY -MConfig -e 'print $Config{archlib}') - SS_PERL_DIR="$SS_PERL_DIR/CORE" - AC_MSG_RESULT([got $SS_PERL_DIR]) - AC_MSG_CHECKING([for the perl ccflags]) - SS_PERL_CCFLAGS=$($SS_PERL_BINARY -MConfig -e 'print $Config{ccflags}') - AC_MSG_RESULT([got $SS_PERL_CCFLAGS]) - AC_MSG_CHECKING([for the perl ldflags]) - SS_PERL_LDFLAGS=$($SS_PERL_BINARY -MExtUtils::Embed -e ldopts) - AC_MSG_RESULT([got $SS_PERL_LDFLAGS]) - - AC_MSG_CHECKING([if we can compile a perl application]) - SS_SAVED_LIBS="$LIBS" - SS_SAVED_CFLAGS="$CFLAGS" - SS_SAVED_CCFLAGS="$CCFLAGS" - SS_SAVED_LDFLAGS="$LDFLAGS" - SS_SAVED_CXXFLAGS="$CXXFLAGS" - SS_SAVED_CPPFLAGS="$CPPFLAGS" - - LIBS="$SS_PERL_LDFLAGS" - LDFLAGS="$LIBS" - CFLAGS="$SS_PERL_CCFLAGS -I$SS_PERL_DIR" - CCFLAGS="$CFLAGS" - CXXFLAGS="$CFLAGS" - CPPFLAGS="$CFLAGS" - - AC_TRY_LINK([ - #include - #include - #include - - extern "C" void boot_DynaLoader(pTHX_ CV* cv); - - extern "C" void xs_init(pTHX) - { - char * file = __FILE__; - newXS("DynaLoader::boot_DynaLoader",boot_DynaLoader,file); - } - - ],[ - PerlInterpreter *my_perl; - my_perl = perl_alloc(); - perl_construct(my_perl); - perl_parse(my_perl,xs_init, 0, 0, (char **)NULL); - perl_run(my_perl); - perl_destruct(my_perl); - perl_free(my_perl); - ], - eval "SS_PERL_ENABLE=yes", - eval "SS_PERL_ENABLE=no" - ) - - SS_PERL_LDFLAGS="$LDFLAGS" - SS_PERL_CCFLAGS="$CCFLAGS" - - LIBS="$SS_SAVED_LIBS" - CFLAGS="$SS_SAVED_CFLAGS" - LDFLAGS="$SS_SAVED_LDFLAGS" - CXXFLAGS="$SS_SAVED_CXXFLAGS" - CPPFLAGS="$SS_SAVED_CPPFLAGS" - CCFLAGS="$SS_SAVED_CCFLAGS" - - if test "$SS_PERL_ENABLE" = "yes"; then - AC_MSG_RESULT([seems ok]) - AC_DEFINE([COMPILE_PERL_SUPPORT], 1, [define if you have perl and want the perl scripting support in kvirc]) - SS_BUILD_FLAGS="p$SS_BUILD_FLAGS" - SS_PERL_RESULT_MESSAGE="enabled" - else - AC_MSG_RESULT([seems broken]) - SS_PERL_RESULT_MESSAGE="disabled: failed to compile the test program" - SS_PERL_LDFLAGS="" - SS_PERL_CCFLAGS="" - fi - fi - - AC_SUBST(SS_PERL_CCFLAGS) - AC_SUBST(SS_PERL_LDFLAGS) - AC_SUBST(SS_PERL_BINARY) - - AC_MSG_CHECKING([for perl scripting support]) - AC_MSG_RESULT([$SS_PERL_RESULT_MESSAGE]) -]) - -dnl ################################################################################################################### -dnl ### OPENSSL -dnl ################################################################################################################### - - -AC_DEFUN([AC_SS_CHECK_OPENSSL], -[ - SS_LINK_TO_LIBSSL="false" - SS_SSL_RESULT_MESSAGE="" - SS_ENABLE_SSL_SUPPORT="yes" - - AC_ARG_ENABLE(ssl,AC_HELP_STRING([--disable-ssl],[Disable OpenSSL support]),eval "SS_ENABLE_SSL_SUPPORT=$enableval") - - if test "$SS_ENABLE_SSL_SUPPORT" = "yes"; then - AC_MSG_CHECKING([If we can compile and link a small SSL test application]) - SS_SAVED_LIBS="$LIBS" - LIBS="-lcrypto -lssl" - AC_TRY_LINK([ - #include - ],[ - SSL_new(0); - ], - eval "SS_ENABLE_SSL_SUPPORT=yes", - eval "SS_ENABLE_SSL_SUPPORT=no" - ) - LIBS="$SS_SAVED_LIBS" - if test "$SS_ENABLE_SSL_SUPPORT" = "yes"; then - AC_MSG_RESULT([yes]) - - AC_CHECK_HEADER(openssl/ssl.h,SS_DUMMY="yes",SS_ENABLE_SSL_SUPPORT="no") - AC_CHECK_HEADER(openssl/err.h,SS_DUMMY="yes",SS_ENABLE_SSL_SUPPORT="no") - AC_CHECK_HEADER(openssl/asn1.h,SS_DUMMY="yes",SS_ENABLE_SSL_SUPPORT="no") - AC_CHECK_HEADER(openssl/evp.h,SS_DUMMY="yes",SS_ENABLE_SSL_SUPPORT="no") - - if test "$SS_ENABLE_SSL_SUPPORT" = "yes"; then - AC_DEFINE([COMPILE_SSL_SUPPORT], 1, [define if you have openssl and want the ssl support in kvirc]) - SS_LINK_TO_LIBSSL="true" - SS_BUILD_FLAGS="o$SS_BUILD_FLAGS" - SS_SSL_RESULT_MESSAGE="enabled" - else - SS_SSL_RESULT_MESSAGE="disabled: missing header files" - fi - else - AC_MSG_RESULT([no]) - SS_SSL_RESULT_MESSAGE="disabled: failed to compile the test program" - fi - else - SS_SSL_RESULT_MESSAGE="disabled by user" - fi - - AC_MSG_CHECKING([for secure connections support]) - AC_MSG_RESULT([$SS_SSL_RESULT_MESSAGE]) -]) - - -dnl ################################################################################################################### -dnl ### ESD -dnl ################################################################################################################### - -AC_DEFUN([AC_SS_CHECK_ESD], -[ - SS_LINK_TO_LIBESD="false" - SS_DISABLE_ESD_SUPPORT="true" - SS_SAVED_LIBS=$LIBS - LIBS="$LIBS -lesd" - AC_CHECK_LIB(esd,esd_play_file,SS_DISABLE_ESD_SUPPORT="false") - LIBS="$SS_SAVED_LIBS" - - if test "$SS_DISABLE_ESD_SUPPORT" = "false"; then - SS_DISABLE_ESD_SUPPORT="true" - AC_CHECK_HEADER(esd.h,SS_DISABLE_ESD_SUPPORT="false") - fi - - AC_MSG_CHECKING([for Esound daemon support]) - AC_ARG_WITH(esd-support, [ --without-esd-support Disable Esound daemon support],SS_DISABLE_ESD_SUPPORT="true") - - if test "$SS_DISABLE_ESD_SUPPORT" = "true"; then - AC_MSG_RESULT(disabled by user) - else - AC_MSG_RESULT(yes: have libs and headers) - AC_DEFINE([COMPILE_ESD_SUPPORT], 1, [define if you want to enable the Esound daemon support]) - SS_LINK_TO_LIBESD="true" - SS_BUILD_FLAGS="e$SS_BUILD_FLAGS" - fi - -]) - -dnl ################################################################################################################### -dnl ### ZLIB -dnl ################################################################################################################### - -AC_DEFUN([AC_SS_CHECK_ZLIB], -[ - SS_LINK_TO_LIBZLIB="no" - SS_DISABLE_ZLIB_SUPPORT="true" - SS_SAVED_LIBS=$LIBS - LIBS="$LIBS -lz" - AC_CHECK_LIB(z,gzopen,SS_DISABLE_ZLIB_SUPPORT="false") - LIBS="$SS_SAVED_LIBS" - - if test "$SS_DISABLE_ZLIB_SUPPORT" = "false"; then - SS_DISABLE_ZLIB_SUPPORT="true" - AC_CHECK_HEADER(zlib.h,SS_DISABLE_ZLIB_SUPPORT="false") - fi - - AC_MSG_CHECKING([for GZip support]) - AC_ARG_WITH(zlib-support, [ --without-zlib-support Disable ZLIB support],SS_DISABLE_ZLIB_SUPPORT="true") - - if test "$SS_DISABLE_ZLIB_SUPPORT" = "true"; then - AC_MSG_RESULT(disabled by user) - else - AC_MSG_RESULT(yes: have libs and headers) - AC_DEFINE([COMPILE_ZLIB_SUPPORT], 1, [define if you want to enable the ZLib library support]) - SS_LINK_TO_LIBZ="yes" - SS_BUILD_FLAGS="Z$SS_BUILD_FLAGS" - fi -]) - -dnl ################################################################################################################### -dnl ### XSS -dnl ################################################################################################################### - -AC_DEFUN([AC_SS_CHECK_XSS], -[ - SS_LINK_TO_XSS="no" - SS_COMPILE_XSS_SUPPORT="false" - SS_SAVED_LIBS=$LIBS - LIBS="$LIBS -lXss" - AC_CHECK_LIB(Xss,XScreenSaverAllocInfo,SS_COMPILE_XSS_SUPPORT="true") - LIBS="$SS_SAVED_LIBS" - - AC_MSG_CHECKING([for Xss support]) - - if test "$SS_COMPILE_XSS_SUPPORT" = "false"; then - AC_MSG_RESULT(disabled) - else - AC_MSG_RESULT(yes: lib is ok) - AC_DEFINE([COMPILE_XSS_SUPPORT], 1, [define if you want to enable the ZLib library support]) - SS_LINK_TO_XSS="yes" - SS_BUILD_FLAGS="$SS_BUILD_FLAGS" - fi -]) - -dnl ################################################################################################################### -dnl ### Audiofile library -dnl ################################################################################################################### - -AC_DEFUN([AC_SS_CHECK_AUDIOFILE], -[ - SS_LINK_TO_LIBAUDIOFILE="false" - SS_DISABLE_AUDIOFILE_SUPPORT="true" - SS_SAVED_LIBS=$LIBS - LIBS="$LIBS -laudiofile" - AC_CHECK_LIB(audiofile,afOpenFile,SS_DISABLE_AUDIOFILE_SUPPORT="false") - - if test "$SS_DISABLE_AUDIOFILE_SUPPORT" = "false"; then - SS_DISABLE_AUDIOFILE_SUPPORT="true" - AC_CHECK_LIB(audiofile,afGetVirtualFrameSize,SS_DISABLE_AUDIOFILE_SUPPORT="false") - fi - - LIBS="$SS_SAVED_LIBS" - - if test "$SS_DISABLE_AUDIOFILE_SUPPORT" = "false"; then - SS_DISABLE_AUDIOFILE_SUPPORT="true" - AC_CHECK_HEADER(audiofile.h,SS_DISABLE_AUDIOFILE_SUPPORT="false") - fi - - AC_MSG_CHECKING([for audiofile support]) - - if test "$SS_DISABLE_AUDIOFILE_SUPPORT" = "true"; then - AC_MSG_RESULT(missing header or libs or wrong version) - else - - if test "$SS_HAS_OSS_SUPPORT" = "false"; then - SS_DISABLE_AUDIOFILE_SUPPORT="true" - AC_MSG_RESULT(no oss support at all) - else - AC_ARG_WITH(af-support, [ --without-af-support Disable Audiofile library for playing files to OSS support], SS_DISABLE_AUDIOFILE_SUPPORT="true") - - if test "$SS_DISABLE_AUDIOFILE_SUPPORT" = "true"; then - AC_MSG_RESULT(disabled by user) - else - AC_MSG_RESULT(yes: have libs and headers) - AC_DEFINE([COMPILE_AUDIOFILE_SUPPORT], 1, [define if you want to enable the Audiofile library support]) - SS_LINK_TO_LIBAUDIOFILE="true" - SS_BUILD_FLAGS="f$SS_BUILD_FLAGS" - fi - fi - fi -]) - -dnl ################################################################################################################### -dnl ### ARTS -dnl ################################################################################################################### - - -AC_DEFUN([AC_SS_CHECK_ARTS], -[ - SS_LINK_TO_LIBARTS="false" - SS_DISABLE_ARTS_SUPPORT="false" - - AC_MSG_CHECKING([if Arts support is requested]) - AC_ARG_WITH(arts-support, [ --without-arts-support Disable Arts daemon support],SS_DISABLE_ARTS_SUPPORT="true") - - if test "$SS_KDE_REQUESTED" = "yes"; then - if test "$SS_DISABLE_ARTS_SUPPORT" = "true"; then - AC_MSG_RESULT(disabled by user) - else - AC_MSG_RESULT([yes]) - AC_MSG_CHECKING(if we can compile a simple Arts application) - AC_LANG_CPLUSPLUS - ss_save_CPPFLAGS="$CPPFLAGS" - ss_save_CXXFLAGS="$CXXFLAGS" - ss_save_LDFLAGS="$LDFLAGS" - ss_save_LIBS="$LIBS" - CPPFLAGS="-I$SS_X_INCDIR -I$SS_QT3_INCDIR -I$SS_KDE_INCDIR $CPPFLAGS $X_CFLAGS" - CXXFLAGS="-O2 -Wall $CXXFLAGS" - LIBS="-L$SS_KDE_LIBDIR -L$SS_X_LIBDIR $SS_X_LDFLAGS $SS_X_LIBLINK -L$SS_QT3_LIBDIR $LIBS -lsoundserver_idl -lkdecore -l$SS_QTLIB_NAME -Wl,-rpath $SS_KDE_LIBDIR" - if test "$SS_LINK_TO_LIBDL" = "yes"; then - LIBS="$LIBS -ldl"; - fi - LDFLAGS="-s $LDFLAGS" - AC_TRY_LINK([ - #include - ],[ - Arts::Dispatcher * d = new Arts::Dispatcher(); - Arts::SimpleSoundServer *server = new Arts::SimpleSoundServer(Arts::Reference("global:Arts_SimpleSoundServer")); - ], - SS_ARTS_LINKED_OK="TRUE", - SS_ARTS_LINKED_OK="FALSE" - ) - if test "$SS_ARTS_LINKED_OK" = "FALSE"; then - AC_MSG_RESULT(failed) - else - AC_MSG_RESULT(success) - AC_DEFINE([COMPILE_ARTS_SUPPORT], 1, [define if you want to enable the Arts daemon support]) - SS_LINK_TO_LIBARTS="true" - SS_BUILD_FLAGS="r$SS_BUILD_FLAGS" - fi - LIBS="$ss_save_LIBS" - LDFLAGS="$ss_save_LDFLAGS" - CXXFLAGS="$ss_save_CXXFLAGS" - CPPFLAGS="$ss_save_CPPFLAGS" - fi - else - SS_DISABLE_ARTS_SUPPORT="true" - AC_MSG_RESULT([no KDE so no Arts]) - fi -]) - - -dnl ################################################################################################################### -dnl ### INTERFACE ADDRESS STUFF -dnl ################################################################################################################### - -AC_DEFUN([AC_SS_CHECK_IFADDR_STUFF], -[ - AC_MSG_CHECKING([if we can get interface addresses]) - - AC_TRY_LINK([ - #include - #include - #include - #include - #include - #include - ],[ - struct ifreq ifr; - int ret; - struct sockaddr * sa; - ret = IFNAMSIZ; - ret = ioctl(ret,SIOCGIFADDR,&ifr); - if(ifr.ifr_name != 0)sa = (struct sockaddr *)&(ifr.ifr_addr); - ], - eval "SS_DISABLE_IFADDR=false" - , - eval "SS_DISABLE_IFADDR=true" - ) - - if test "$SS_DISABLE_IFADDR" = "true"; then - AC_MSG_RESULT("no") - else - AC_MSG_RESULT("yes") - AC_DEFINE([COMPILE_GET_INTERFACE_ADDRESS], 1, [define if you have the SIOCGIFADDR ioctl and the related headers]) - fi -]) - -dnl ################################################################################################################### -dnl ### PTHREAD -dnl ################################################################################################################### - -AC_DEFUN([AC_SS_CHECK_THREAD_STUFF], -[ - SS_THREAD_LIBLINK="" - - AC_MSG_CHECKING([if you want to use the solaris lthread]) - SS_DO_IT="false" - AC_ARG_WITH(solaris-lthread, [ --with-solaris-lthread Use the Solaris native libthread],SS_DO_IT="true") - if test "$SS_DO_IT" = "true"; then - AC_MSG_RESULT(yes) - SS_THREAD_LIBLINK="-lthread" - AC_DEFINE([COMPILE_THREADS_USE_SOLARIS_LIBTHREAD], 1, [define if you want to use the solaris libthread]) - else - AC_MSG_RESULT(no) - - AC_MSG_CHECKING([if you want to use freebsd native pthread support]) - SS_DO_IT="false" - - AC_ARG_WITH(freebsd-pthread, [ --with-freebsd-pthread Use the FreeBSD native libc_r for threading],SS_DO_IT="true") - if test "$SS_DO_IT" = "true"; then - AC_MSG_RESULT(yes) - SS_THREAD_LIBLINK="-pthread" - AC_DEFINE([COMPILE_THREADS_USE_POSIX], 1, [define if you want to use the pthreads library]) - else - AC_MSG_RESULT(no..using lpthread) - SS_THREAD_LIBLINK="-lpthread" - AC_DEFINE([COMPILE_THREADS_USE_POSIX], 1, [define if you want to use the pthreads library]) - fi - - AC_MSG_CHECKING([if your pthread implementation works]) - SS_DO_IT="false" - AC_ARG_WITH(no-pthread-check, [ --with-no-pthread-check Do not check if pthreads stuff compiles],SS_DO_IT="true") - - if test "$SS_DO_IT" = "true"; then - AC_MSG_RESULT(yes, trusting you) - else - SS_SAVE_LIBS="$LIBS" - LIBS="$SS_THREAD_LIBLINK" - AC_TRY_LINK([ - #include - ],[ - pthread_mutex_lock(0); - ], - eval "SS_PTHREAD_OK=yes" - , - eval "SS_PTHREAD_OK=no" - ) - LIBS="$SS_SAVE_LIBS" - - if test "$SS_PTHREAD_OK" = "yes"; then - AC_MSG_RESULT(yes, it seems to) - else - AC_MSG_RESULT(["FAILED"]) - AC_SS_SET_REDINK - if test "$SS_THREAD_LIBLINK" = "-pthread"; then - echo "################################################################################" - echo "### CONFIGURE ERROR:" - echo "### Failed to compile the pthread test program." - echo "### You have specified to use the native FreeBSD libc_r for threading" - echo "### but it looks that this does not work." - echo "### Make sure that you have libc_r floating around your system" - echo "### and that the -pthread special gcc flag works." - echo "### (You need to use the native FreeBSD gcc compiler for this to work)" - echo "################################################################################" - else - echo "################################################################################" - echo "### CONFIGURE ERROR:" - echo "### Failed to compile the pthread test program." - echo "### It looks that you either don't have libpthread installed or" - echo "### it is not reachable by the linker." - echo "### Make sure that libpthread is in /lib or /usr/lib." - echo "### If you're on solaris you might try the --with-solaris-lthread" - echo "### configure option. If you're on FreeBSD you should use" - echo "### --with-freebsd-pthread." - echo "### Good luck :)" - echo "################################################################################" - fi - AC_SS_SET_NORMALINK - AC_MSG_ERROR(["This was fatal...aborting"]) - fi - fi - fi -]) - -dnl ################################################################################################################### -dnl ### X -dnl ################################################################################################################### - - -AC_DEFUN([AC_SS_FIND_X], -[ - SS_DISABLE_X_SUPPORT="false" - - AC_MSG_CHECKING([if you want to ignore X at all]) - AC_ARG_ENABLE(x-support, [ --disable-x-support Ignore X Windows completely],SS_DISABLE_X_SUPPORT="true") - - if test $SS_DISABLE_X_SUPPORT = "true"; then - AC_DEFINE([COMPILE_NO_X], 1, [define if you want to ignore X Windows completely]) - SS_X_INCDIR="/usr/include" - SS_X_LIBDIR="/usr/lib" - SS_X_LDFLAGS="" - SS_X_CPPFLAGS="" - SS_X_LIBLINK="" - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no, proceeding with checks) - AC_PATH_XTRA - - if test -n "$no_x"; then - AC_SS_SET_REDINK - echo "################################################################################" - echo "### CONFIGURE ERROR:" - echo "### Can not find the X libraries." - echo "### Make sure that X is installed on your system and try to run configure again," - echo "### this time passing the --x-includes and --x-libraries options." - echo "### You may also take a look at the config.log file in this directory," - echo "### that will tell you which checks have failed and maybe more about the" - echo "### reason of the failure." - echo "###" - echo "### If you use an environment that does not require X support such as Qt-Mac" - echo "### you may try to rerun configure with --disable-x-support" - echo "################################################################################" - AC_SS_SET_NORMALINK - AC_MSG_ERROR([This was a fatal one...aborting]) - else - # Set the X include and lib dir - SS_X_INCDIR="$x_includes" - SS_X_LIBDIR="$x_libraries" - SS_X_LIBLINK="-lX11 -lXext" - - if test -z "$SS_X_INCDIR"; then - # Ops... X headers not found ? - AC_TRY_COMPILE([ - #include - ],[ - Display * d = XOpenDisplay(0); - XCloseDisplay(d); - ], - eval "ss_x_incdir_found=yes" - , - eval "ss_x_incdir_found=no" - ) - - if test "$ss_x_incdir_found" = "no"; then - AC_SS_SET_REDINK - echo "################################################################################" - echo "### CONFIGURE ERROR:" - echo "### Can not find the X headers." - echo "### Possible reasons:" - echo "### 1) You miss the X server development files (Xlib.h for example)" - echo "###" - echo "### 2) Autoconf/Automake wasn't able to find the headers" - echo "### for some ugly reason." - echo "###" - echo "### You might try looking for a file named Xlib.h in your hard-drive" - echo "### and try passing the --x-includes option to ./configure" - echo "### Remember that if you find Xlib.h in /somepath/include/X11/Xlib.h" - echo "### Then you must pass --x-includes=/somepath/include to ./configure" - echo "### For example, my Xlib.h is in /usr/X11R6/include/X11/Xlib.h" - echo "### then i would try: ./configure --x-includes=/usr/X11R6/include" - echo "### If you can't find Xlib.h on your hard drive then install the X-devel" - echo "### package from your distribution." - echo "### If Xlib.h is there and --x-includes doesn't help, well , there is something" - echo "### wrong with X , autoconf or automake." - echo "### You may also take a look at the config.log file in this directory," - echo "### that will tell you which checks have failed and maybe more about the" - echo "### reason of the failure." - echo "###" - echo "### If you use an environment that does not require X support such as Qt-Mac" - echo "### you may try to rerun configure with --disable-x-support" - echo "################################################################################" - AC_SS_SET_NORMALINK - AC_MSG_ERROR([This was a fatal one...aborting]) - else - # We can compile X programs without any additional path... use a dummy include path then - # Should we print a warning ? - SS_X_INCDIR="/usr/include" - fi - fi - - - if test -z "$SS_X_LIBDIR"; then - # Ops... X libs not found ? - SS_SAVE_LIBS="$LIBS" - SS_SAVE_CFLAGS="$CFLAGS" - SS_SAVE_CPPFLAGS="$CPPFLAGS" - SS_SAVE_CXXFLAGS="$CXXFLAGS" - - CFLAGS="-I$SS_X_INCDIR" - CPPFLAGS="$CFLAGS" - CXXFLAGS="$CFLAGS" - LIBS="$SS_X_LIBLINK" - AC_TRY_LINK([ - #include - ],[ - Display * d = XOpenDisplay(0); - XCloseDisplay(d); - ], - eval "ss_x_libdir_found=yes" - , - eval "ss_x_libdir_found=no" - ) - LIBS="$SS_SAVE_LIBS" - CFLAGS="$SS_SAVE_CFLAGS" - CPPFLAGS="$SS_SAVE_CPPFLAGS" - CXXFLAGS="$SS_SAVE_CXXFLAGS" - - if test "$ss_x_libdir_found" = "no"; then - AC_SS_SET_REDINK - echo "################################################################################" - echo "### CONFIGURE ERROR:" - echo "### Can not find the X libraries." - echo "### Possible reasons:" - echo "### 1) You have no X server : KVIrc can't run on this system" - echo "###" - echo "### 2) Autoconf/Automake wasn't able to find the libraries" - echo "### for some ugly reason." - echo "###" - echo "### You might try looking for a file named libX11.so in your hard-drive" - echo "### and try passing the --x-libraries option to ./configure" - echo "### Remember that if you find libX11.so in /somepath/lib/libX11.so" - echo "### Then you must pass --x-libraries=/somepath/lib to ./configure" - echo "### For example, my libX11.so is in /usr/X11R6/lib/libX11.so" - echo "### then i would try: ./configure --x-libraries=/usr/X11R6/lib" - echo "### If you can't find libX11.so on your hard drive then install the X server" - echo "### package from your distribution." - echo "### If libX11.so is there and --x-libraries doesn't help, well , there is something" - echo "### wrong with X , autoconf or automake." - echo "### You may also take a look at the config.log file in this directory," - echo "### that will tell you which checks have failed and maybe more about the" - echo "### reason of the failure." - echo "###" - echo "### If you use an environment that does not require X support such as Qt-Mac" - echo "### you may try to rerun configure with --disable-x-support" - echo "################################################################################" - AC_SS_SET_NORMALINK - AC_MSG_ERROR([This was a fatal one...aborting]) - else - # We can link X programs without any additional path... use a dummy lib path then - # Should we print a warning ? - SS_X_LIBDIR="/usr/lib" - fi - fi - - # Add any extra libs needed - SS_X_LDFLAGS="" - - if test -n "$X_PRE_LIBS"; then - SS_X_LDFLAGS="$X_PRE_LIBS $SS_X_LDFLAGS" - fi - - if test -n "$X_EXTRA_LIBS"; then - SS_X_LDFLAGS="$SS_X_LDFLAGS $X_EXTRA_LIBS" - fi - - if test -n "$X_LIBS"; then - SS_X_LDFLAGS="$SS_X_LDFLAGS $X_LIBS" - fi - - # Add any extra gcc flags - SS_X_CPPFLAGS=$X_CFLAGS - fi - fi -]) - -dnl ################################################################################################################### -dnl ### QT -dnl ################################################################################################################### - -AC_DEFUN([AC_SS_FIND_QT], -[ - AC_ARG_ENABLE(qt-check, - AC_HELP_STRING([--disable-qt-check],[Do not check if Qt and X compile]), - SS_CHECK_QTX_COMPILE="$withval",SS_CHECK_QTX_COMPILE="NOTGIVEN") - - AC_ARG_ENABLE(qt4, - AC_HELP_STRING([--enable-qt4],[Enable WORK IN PROGRESS Qt4 support]), - SS_USE_QT4="$withval",SS_USE_QT4="no") - - if test "$SS_USE_QT4" = "no"; then - - AC_SS_FIND_QT3_NAME - AC_SS_FIND_QT3_GENERAL_DIR - AC_SS_FIND_QT3_LIBRARY_DIR - AC_SS_FIND_QT3_INCLUDE_DIR - AC_SS_FIND_QT3_MOC - AC_SS_FIND_QT3_MT - - if test "$SS_CHECK_QTX_COMPILE" = "NOTGIVEN"; then - AC_SS_ENSURE_CAN_COMPILE_X_AND_QT3 - fi - else - - AC_SS_FIND_QT4_GENERAL_DIR - AC_SS_FIND_QT4_LIBRARY_DIR - AC_SS_FIND_QT4_INCLUDE_DIR - AC_SS_FIND_QT4_MOC - - - if test "$SS_CHECK_QTX_COMPILE" = "NOTGIVEN"; then - AC_SS_ENSURE_CAN_COMPILE_X_AND_QT4 - fi - - fi -]) - -AC_DEFUN([AC_SS_FIND_QT3_NAME], -[ - AC_MSG_CHECKING([for the Qt library name]) - AC_ARG_WITH(qt-name,[ --with-qt-name=NAME Use NAME instead of \"qt\" as Qt library name],SS_QTLIB_NAME="$withval",SS_QTLIB_NAME="qt") - AC_MSG_RESULT("$SS_QTLIB_NAME") -]) - -AC_DEFUN([AC_SS_FIND_QT3_GENERAL_DIR], -[ - AC_MSG_CHECKING([for the general Qt3.x directory]) - - ss_qt_general_test_dirs="/usr/local /usr /usr/X11R6 /usr/lib /opt /opt/kde /kde /usr/kde /usr/build /usr/src /usr/local/lib /" - ss_qt_general_test_dirs="$ss_qt_general_test_dirs /usr/local/kde /usr/opt/kde" - - if test -n "$HOME"; then - ss_qt_general_test_dirs="$ss_qt_general_test_dirs $HOME $HOME/lib" - fi - - if test -n "$QTDIR"; then - ss_qt_general_test_dirs="$QTDIR $ss_qt_general_test_dirs" - fi - - ss_qt_general_test_path_suffix="qt$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT3_MAJOR_VERSION_REQUIRED$SS_QT3_MINOR_VERSION_REQUIRED$SS_QT3_PATCH_LEVEL_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT3_MAJOR_VERSION_REQUIRED$SS_QT3_MINOR_VERSION_REQUIRED$SS_QT3_PATCH_LEVEL_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT3_MAJOR_VERSION_REQUIRED$SS_QT3_MINOR_VERSION_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT3_MAJOR_VERSION_REQUIRED$SS_QT3_MINOR_VERSION_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt$SS_QT3_MAJOR_VERSION_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT3_MAJOR_VERSION_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT3_MAJOR_VERSION_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix lib" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt ." - - AC_SS_FIND_FILE_PATH_EXT($SS_QT3_GENERAL_FILE_TO_SEARCH,$ss_qt_general_test_dirs,$ss_qt_general_test_path_suffix,SS_QT3_GENERAL_DIR) - if test "$SS_QT3_GENERAL_DIR" = "FAILED"; then - AC_MSG_RESULT([failed...continuing with normal checks]) - unset SS_QT3_GENERAL_DIR - else - AC_MSG_RESULT([Seems to be $SS_QT3_GENERAL_DIR]) - fi -]) - -AC_DEFUN([AC_SS_FIND_QT4_GENERAL_DIR], -[ - AC_MSG_CHECKING([for the general Qt4.x directory]) - - ss_qt_general_test_dirs="/usr/local /usr /usr/X11R6 /usr/lib /opt /opt/kde /kde /usr/kde /usr/build /usr/src /usr/local/lib /" - ss_qt_general_test_dirs="$ss_qt_general_test_dirs /usr/local/kde /usr/opt/kde /usr/lib/qt4 /usr/local/lib/qt4" - - if test -n "$HOME"; then - ss_qt_general_test_dirs="$ss_qt_general_test_dirs $HOME $HOME/lib" - fi - - if test -n "$QTDIR"; then - ss_qt_general_test_dirs="$QTDIR $ss_qt_general_test_dirs" - fi - - ss_qt_general_test_path_suffix="qt$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.$SS_QT4_PATCH_LEVEL_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.$SS_QT4_PATCH_LEVEL_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT4_MAJOR_VERSION_REQUIRED$SS_QT4_MINOR_VERSION_REQUIRED$SS_QT4_PATCH_LEVEL_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.$SS_QT4_PATCH_LEVEL_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT4_MAJOR_VERSION_REQUIRED$SS_QT4_MINOR_VERSION_REQUIRED$SS_QT4_PATCH_LEVEL_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT4_MAJOR_VERSION_REQUIRED$SS_QT4_MINOR_VERSION_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT4_MAJOR_VERSION_REQUIRED$SS_QT4_MINOR_VERSION_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt$SS_QT4_MAJOR_VERSION_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT4_MAJOR_VERSION_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT4_MAJOR_VERSION_REQUIRED" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix lib" - ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt ." - - AC_SS_FIND_FILE_PATH_EXT($SS_QT4_GENERAL_FILE_TO_SEARCH,$ss_qt_general_test_dirs,$ss_qt_general_test_path_suffix,SS_QT4_GENERAL_DIR) - if test "$SS_QT4_GENERAL_DIR" = "FAILED"; then - AC_MSG_RESULT([failed...continuing with normal checks]) - unset SS_QT4_GENERAL_DIR - else - AC_MSG_RESULT([Seems to be $SS_QT4_GENERAL_DIR]) - fi -]) - - -AC_DEFUN([AC_SS_FIND_QT3_INCLUDE_DIR], -[ - AC_ARG_WITH(qt-include-dir,[ --with-qt-include-dir path to the Qt 3.x headers ],SS_QT3_INCDIR="$withval",SS_QT3_INCDIR="NOTGIVEN") - if test "$SS_QT3_INCDIR" = "NOTGIVEN"; then - - AC_MSG_CHECKING([for the Qt 3.x header files]) - - ss_qt_include_test_dirs="$SS_QT3_GENERAL_DIR/include /include /usr/include /usr/local/include /usr/qt/include /usr/local/qt/include /usr/X11R6/include /usr/lib/qt/include /usr/lib/qt /usr/include/X11" - test -n "$QTDIR" && ss_qt_include_test_dirs="$QTDIR/include $QTDIR $ss_qt_include_test_dirs" - ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/qt /usr/include/qt3 /usr/local/include/qt /include/qt /usr/X11R6/include/qt /usr/build/qt/include" - ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/qt$SS_QT3_MAJOR_VERSION_REQUIRED /usr/include/qt-$SS_QT3_MAJOR_VERSION_REQUIRED /usr/local/include/qt$SS_QT3_MAJOR_VERSION_REQUIRED" - ss_qt_include_test_dirs="$ss_qt_include_test_dirs /include/qt$SS_QT3_MAJOR_VERSION_REQUIRED /usr/X11R6/include/qt$SS_QT3_MAJOR_VERSION_REQUIRED" - ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/X11/qt$SS_QT3_MAJOR_VERSION_REQUIRED /opt/qt /opt/kde/qt" - - AC_SS_FIND_FILE_PATH($SS_QT3_INCLUDE_FILE_TO_SEARCH,$ss_qt_include_test_dirs,SS_QT3_INCDIR) - - if test "$SS_QT3_INCDIR" = "FAILED"; then - AC_MSG_RESULT([FAILED]) - AC_SS_SET_REDINK - echo "################################################################################" - echo "### CONFIGURE ERROR:" - echo "### Can not find the qt 3.x header files." - echo "### Make sure that qt is correctly installed on your system," - echo "### and the qt version is the one requested by this version of kvirc." - echo "### Try to run configure again, this time passing the --with-qt-include-dir" - echo "### option (see ./configure --help)." - echo "### You may also take a look at the config.log file in this directory," - echo "### that will tell you which check has failed and maybe more about the reason" - echo "### of the failure." - echo "### If you're feeling that this may be a bug in this configure script" - echo "### and want to report this to me , please include your configure script," - echo "### the config.log file as well as the complete configure output." - echo "################################################################################" - AC_SS_SET_NORMALINK - AC_MSG_ERROR([This was a fatal one...aborting]) - else - AC_MSG_RESULT([found in $SS_QT3_INCDIR]) - fi - - else - AC_MSG_RESULT([using user supplied path for the Qt 3.x include files $SS_QT3_INCDIR]) - fi -]) - - -AC_DEFUN([AC_SS_FIND_QT4_INCLUDE_DIR], -[ - AC_ARG_WITH(qt4-include-dir,[ --with-qt4-include-dir path to the Qt 4.x headers ],SS_QT4_INCDIR="$withval",SS_QT4_INCDIR="NOTGIVEN") - if test "$SS_QT4_INCDIR" = "NOTGIVEN"; then - - AC_MSG_CHECKING([for the Qt 4.x header files]) - - ss_qt_include_test_dirs="$SS_QT4_GENERAL_DIR/include /include /usr/include /usr/local/include /usr/qt/include /usr/include/qt4 /usr/qt4/include /usr/local/qt/include /usr/X11R6/include /usr/lib/qt/include /usr/lib/qt /usr/include/X11" - test -n "$QTDIR" && ss_qt_include_test_dirs="$QTDIR/include $QTDIR $ss_qt_include_test_dirs" - ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/qt /usr/include/qt4 /usr/local/include/qt /include/qt /usr/X11R6/include/qt /usr/build/qt/include" - ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED /usr/include/qt-$SS_QT4_MAJOR_VERSION_REQUIRED /usr/local/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED" - ss_qt_include_test_dirs="$ss_qt_include_test_dirs /include/qt$SS_QT4_MAJOR_VERSION_REQUIRED /usr/X11R6/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED" - ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/X11/qt$SS_QT4_MAJOR_VERSION_REQUIRED /opt/qt /opt/kde/qt" - - AC_SS_FIND_FILE_PATH($SS_QT4_INCLUDE_FILE_TO_SEARCH,$ss_qt_include_test_dirs,SS_QT4_INCDIR) - - if test "$SS_QT4_INCDIR" = "FAILED"; then - AC_MSG_RESULT([FAILED]) - AC_SS_SET_REDINK - echo "################################################################################" - echo "### CONFIGURE ERROR:" - echo "### Can not find the qt 4.x header files." - echo "### Make sure that qt is correctly installed on your system," - echo "### and the qt version is the one requested by this version of kvirc." - echo "### Try to run configure again, this time passing the --with-qt4-include-dir" - echo "### option (see ./configure --help)." - echo "### You may also take a look at the config.log file in this directory," - echo "### that will tell you which check has failed and maybe more about the reason" - echo "### of the failure." - echo "### If you're feeling that this may be a bug in this configure script" - echo "### and want to report this to me , please include your configure script," - echo "### the config.log file as well as the complete configure output." - echo "################################################################################" - AC_SS_SET_NORMALINK - AC_MSG_ERROR([This was a fatal one...aborting]) - else - AC_MSG_RESULT([found in $SS_QT4_INCDIR]) - fi - - else - AC_MSG_RESULT([using user supplied path for the Qt 4.x include files $SS_QT4_INCDIR]) - fi - - SS_QT4_INCDIRECTORIES="-I$SS_QT4_INCDIR -I$SS_QT4_INCDIR/Qt/ -I$SS_QT4_INCDIR/QtCore/ -I$SS_QT4_INCDIR/QtGui/"; -]) - - -AC_DEFUN([AC_SS_FIND_QT3_LIBRARY_DIR], -[ - AC_ARG_WITH(qt-library-dir,[ --with-qt-library-dir path to the Qt 3.x library ],SS_QT3_LIBDIR="$withval",SS_QT3_LIBDIR="NOTGIVEN") - if test "$SS_QT3_LIBDIR" = "NOTGIVEN"; then - AC_MSG_CHECKING([for the Qt library]) - - ss_qt_library_test_dirs="$SS_QT3_GENERAL_DIR/lib /lib /usr/lib /usr/local/lib /usr/qt/lib /usr/local/qt/lib /usr/X11R6/lib /usr/lib/qt/lib /usr/lib/qt /usr/local/lib/qt/lib" - test -n "$QTDIR" && ss_qt_library_test_dirs="$QTDIR/lib $QTDIR $ss_qt_library_test_dirs" - ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/local/lib/qt /usr/X11R6/lib/qt /usr/build/qt/lib /opt/lib /opt/qt/lib" - - ss_qt_libs_to_find="lib$SS_QTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.so" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.so.$SS_QT3_MAJOR_VERSION_REQUIRED" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.so" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED.dylib" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.dylib" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.dylib" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.dylib" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED.dylib" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.dylib" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.$SS_QT3_MAJOR_VERSION_REQUIRED.dylib" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.dylib" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.a" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.a" - - AC_SS_FIND_FILE_PATH($ss_qt_libs_to_find,$ss_qt_library_test_dirs,SS_QT3_LIBDIR) - - if test "$SS_QT3_LIBDIR" = "FAILED"; then - AC_MSG_RESULT([FAILED]) - AC_SS_SET_REDINK - echo "################################################################################" - echo "### CONFIGURE ERROR:" - echo "### Can not find the qt 3.x library file." - echo "### Make sure that qt is correctly installed on your system," - echo "### and the qt version is the one requested by this version of kvirc." - echo "### (Usually a greater version is OK too)" - echo "### Try to run configure again, this time passing the --with-qt-library-dir" - echo "### option (see ./configure --help)." - echo "### You may also take a look at the config.log file in this directory," - echo "### that will tell you which check has failed and maybe more about the reason" - echo "### of the failure." - echo "### If you're feeling that this may be a bug in this configure script" - echo "### and want to report this to me , please include your configure script," - echo "### the config.log file as well as the complete configure output." - echo "################################################################################" - AC_SS_SET_NORMALINK - AC_MSG_ERROR([This was a fatal one...aborting]) - else - AC_MSG_RESULT([found in $SS_QT3_LIBDIR]) - fi - else - AC_MSG_RESULT([using user supplied path for the Qt library $SS_QT3_LIBDIR]) - fi -]) - - -AC_DEFUN([AC_SS_FIND_QT4_LIBRARY_DIR], -[ - AC_ARG_WITH(qt4-library-dir,[ --with-qt4-library-dir path to the Qt 4.x library ],SS_QT4_LIBDIR="$withval",SS_QT4_LIBDIR="NOTGIVEN") - if test "$SS_QT4_LIBDIR" = "NOTGIVEN"; then - AC_MSG_CHECKING([for the Qt 4.x libraries]) - - ss_qt_library_test_dirs="$SS_QT4_GENERAL_DIR/lib /lib /usr/lib /usr/local/lib /usr/qt/lib /usr/local/qt/lib /usr/X11R6/lib /usr/lib/qt/lib /usr/lib/qt /usr/local/lib/qt/lib" - test -n "$QTDIR" && ss_qt_library_test_dirs="$QTDIR/lib $QTDIR $ss_qt_library_test_dirs" - ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/local/lib/qt /usr/X11R6/lib/qt /usr/build/qt/lib /opt/lib /opt/qt/lib" - ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/lib/qt4 /usr/local/lib/qt4 /usr/X11R6/lib/qt4" - ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/build/qt4/lib /opt/qt4/lib" - - ss_qt_libs_to_find="libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.$SS_QT4_PATCH_LEVEL_REQUIRED" - ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED" - ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED" - ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so" - ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.dylib" - ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.dylib" - ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.dylib" - ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.a" - - AC_SS_FIND_FILE_PATH($ss_qt_libs_to_find,$ss_qt_library_test_dirs,SS_QT4_LIBDIR) - - if test "$SS_QT4_LIBDIR" = "FAILED"; then - AC_MSG_RESULT([FAILED]) - AC_SS_SET_REDINK - echo "################################################################################" - echo "### CONFIGURE ERROR:" - echo "### Can not find the qt 4.x library files." - echo "### Make sure that qt is correctly installed on your system," - echo "### and the qt version is the one requested by this version of kvirc." - echo "### (Usually a greater version is OK too)" - echo "### Try to run configure again, this time passing the --with-qt4-library-dir" - echo "### option (see ./configure --help)." - echo "### You may also take a look at the config.log file in this directory," - echo "### that will tell you which check has failed and maybe more about the reason" - echo "### of the failure." - echo "### If you're feeling that this may be a bug in this configure script" - echo "### and want to report this to me , please include your configure script," - echo "### the config.log file as well as the complete configure output." - echo "################################################################################" - AC_SS_SET_NORMALINK - AC_MSG_ERROR([This was a fatal one...aborting]) - else - AC_MSG_RESULT([found in $SS_QT4_LIBDIR]) - fi - else - AC_MSG_RESULT([using user supplied path for the Qt 4.x library $SS_QT4_LIBDIR]) - fi -]) - - -AC_DEFUN([AC_SS_FIND_QT3_MOC], -[ - AC_ARG_WITH(qt-moc,[ --with-qt-moc filename of the Qt 3.x meta object compiler ],SS_QT3_MOC="$withval",SS_QT3_MOC="NOTGIVEN") - - if test "$SS_QT3_MOC" = "NOTGIVEN"; then - AC_MSG_CHECKING([for the Qt 3.x moc]) - - unset SS_QT3_MOC - ss_moc_test_dirs="$QTDIR/bin $PATH /usr/bin /bin /usr/local/bin /usr/X11R6/bin /usr/lib/qt/bin /usr/local/qt/bin /usr/X11R6/qt/bin /usr/qt/bin /usr/build/qt/bin" - if test -n "$SS_QT3_GENERAL_DIR"; then - ss_moc_test_dirs="$SS_QT3_GENERAL_DIR/bin $ss_moc_test_dirs" - fi - - AC_SS_FIND_FILE_PATH(moc,$ss_moc_test_dirs,SS_QT3_MOC) - - if test "$SS_QT3_MOC" = "FAILED"; then - AC_MSG_RESULT([FAILED]) - AC_SS_SET_REDINK - echo "################################################################################" - echo "### CONFIGURE ERROR:" - echo "### The Qt meta object compiler can not be found." - echo "### Make sure that qt is correctly installed on your system, it is on your path," - echo "### and the qt version is the one requested by this version of kvirc." - echo "### Try to run configure again, this time passing the --with-qt-moc" - echo "### option (see ./configure --help)." - echo "### You may also take a look at the config.log file in this directory," - echo "### that will tell you which check has failed and maybe more about the reason" - echo "### of the failure." - echo "### If you're feeling that this may be a bug in this configure script" - echo "### and want to report this to me , please include your configure script," - echo "### the config.log file as well as the complete configure output." - echo "################################################################################" - AC_SS_SET_NORMALINK - AC_MSG_ERROR([This was a fatal one...aborting]) - else - SS_QT3_MOC="$SS_QT3_MOC/moc" - AC_MSG_RESULT([found as $SS_QT3_MOC]) - fi - else - AC_MSG_RESULT([trusting you: using $SS_QT3_MOC]) - fi -]) - - -AC_DEFUN([AC_SS_FIND_QT4_MOC], -[ - AC_ARG_WITH(qt4-moc,[ --with-qt4-moc filename of the Qt 4.x meta object compiler ],SS_QT4_MOC="$withval",SS_QT4_MOC="NOTGIVEN") - - if test "$SS_QT4_MOC" = "NOTGIVEN"; then - AC_MSG_CHECKING([for the Qt 4.x moc]) - - unset SS_QT4_MOC - ss_moc_test_dirs="$QTDIR/bin $PATH /usr/bin /bin /usr/local/bin /usr/X11R6/bin /usr/lib/qt/bin /usr/local/qt/bin /usr/X11R6/qt/bin /usr/qt/bin /usr/build/qt/bin" - if test -n "$SS_QT4_GENERAL_DIR"; then - ss_moc_test_dirs="$SS_QT4_GENERAL_DIR/bin $ss_moc_test_dirs" - fi - - AC_SS_FIND_FILE_PATH(moc,$ss_moc_test_dirs,SS_QT4_MOC) - - if test "$SS_QT4_MOC" = "FAILED"; then - AC_MSG_RESULT([FAILED]) - AC_SS_SET_REDINK - echo "################################################################################" - echo "### CONFIGURE ERROR:" - echo "### The Qt 4.x meta object compiler can not be found." - echo "### Make sure that qt is correctly installed on your system, it is on your path," - echo "### and the qt version is the one requested by this version of kvirc." - echo "### In particular you should make sure that the moc compiler is NOT the one" - echo "### shipped with Qt 3.x." - echo "### Try to run configure again, this time passing the --with-qt4-moc" - echo "### option (see ./configure --help)." - echo "### You may also take a look at the config.log file in this directory," - echo "### that will tell you which check has failed and maybe more about the reason" - echo "### of the failure." - echo "### If you're feeling that this may be a bug in this configure script" - echo "### and want to report this to me , please include your configure script," - echo "### the config.log file as well as the complete configure output." - echo "################################################################################" - AC_SS_SET_NORMALINK - AC_MSG_ERROR([This was a fatal one...aborting]) - else - SS_QT4_MOC="$SS_QT4_MOC/moc" - AC_MSG_RESULT([found as $SS_QT4_MOC]) - fi - else - AC_MSG_RESULT([trusting you: using $SS_QT4_MOC]) - fi -]) - - -AC_DEFUN([AC_SS_FIND_QT3_MT], -[ - AC_ARG_ENABLE(qt-mt,[ --disable-qt-mt ignore the threaded version of Qt],SS_QT3_NOMT="$withval",SS_QT3_NOMT="NOTGIVEN") - - AC_MSG_CHECKING([for the multithreaded version of Qt]) - - if test "$SS_QT3_NOMT" = "NOTGIVEN"; then - ss_qt_libs_to_find="lib$SS_QTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.so" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED.dylib" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.dylib" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.dylib" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.dylib" - ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.a" - - AC_SS_FIND_FILE_PATH($ss_qt_libs_to_find,$SS_QT3_LIBDIR,SS_QTMTLIBDIR) - if test "$SS_QTMTLIBDIR" = "FAILED"; then - AC_MSG_RESULT([not found]) - else - AC_MSG_RESULT([seems to be available]) - SS_QTLIB_NAME="$SS_QTLIB_NAME-mt" - fi - else - AC_MSG_RESULT([disabled by user]) - fi -]) - -AC_DEFUN([AC_SS_ENSURE_CAN_COMPILE_X_AND_QT3], -[ - - AC_MSG_CHECKING([if we can compile an X-Qt 3.x application]) - AC_LANG_CPLUSPLUS - ss_save_CPPFLAGS="$CPPFLAGS" - ss_save_CXXFLAGS="$CXXFLAGS" - ss_save_LDFLAGS="$LDFLAGS" - ss_save_LIBS="$LIBS" - if test -n "$SS_X_INCDIR"; then - CPPFLAGS="-I$SS_X_INCDIR" - else - CPPFLAGS="" - fi - CPPFLAGS="$CPPFLAGS -I$SS_QT3_INCDIR" - CXXFLAGS="-O2 -Wall $CXXFLAGS" - if test -n "$SS_X_LIBDIR"; then - LIBS="-L$SS_X_LIBDIR" - else - LIBS="" - fi - LIBS="$LIBS -L$SS_QT3_LIBDIR -l$SS_QTLIB_NAME" - if test -n "$SS_X_LDFLAGS"; then - LIBS="$LIBS $SS_X_LDFLAGS" - fi - if test -n "$SS_X_LIBLINK"; then - LIBS="$LIBS $SS_X_LIBLINK" - fi - LDFLAGS="-s $LDFLAGS" - AC_TRY_LINK([ - #include - #if (QT_VERSION < 221) - #error "Bad qt version: too old" - #endif - ],[return 0; ],SS_QTX_LINKED_OK="TRUE",SS_QTX_LINKED_OK="FALSE") - if test "$SS_QTX_LINKED_OK" = "FALSE"; then - AC_MSG_RESULT([FAILED]); - AC_SS_SET_REDINK - echo "################################################################################" - echo "### CONFIGURE ERROR:" - echo "### Failed to compile the Qt library test program." - echo "### This may be a bad sign :)" - echo "### First of all, make sure that qt is correctly installed on your system," - echo "### and the qt version is the one requested by this version of kvirc." - echo "### Ensure that you have only one copy of qt visible at a time." - echo "### You may also take a look at the config.log file in this directory," - echo "### that will tell you which check has failed and maybe more about the reason" - echo "### of the failure." - echo "### The CPPFLAGS used were:" - for a_flag in $CPPFLAGS ; do - echo "### $a_flag" - done - echo "### The CXXFLAGS used were:" - for a_flag in $CXXFLAGS ; do - echo "### $a_flag" - done - echo "### The LIBS used were:" - for a_flag in $LIBS ; do - echo "### $a_flag" - done - echo "### The LDFLAGS used were:" - for a_flag in $LDFLAGS ; do - echo "### $a_flag" - done - echo "### If you're sure that qt is correctly installed , you may force configure" - echo "### to skip this check and try to compile kvirc anyway." - echo "### Try using the --without-qt-check option." - echo "### If you're feeling that this may be a bug in this configure script" - echo "### and want to report this to me , please include your configure script," - echo "### the config.log file as well as the complete configure output." - echo "################################################################################" - AC_SS_SET_NORMALINK - AC_MSG_ERROR([This was a fatal one...aborting]) - fi - LIBS="$ss_save_LIBS" - LDFLAGS="$ss_save_LDFLAGS" - CXXFLAGS="$ss_save_CXXFLAGS" - CPPFLAGS="$ss_save_CPPFLAGS" - AC_MSG_RESULT([success]) -]) - - -AC_DEFUN([AC_SS_ENSURE_CAN_COMPILE_X_AND_QT4], -[ - - AC_MSG_CHECKING([if we can compile an X-Qt 4.x application]) - AC_LANG_CPLUSPLUS - ss_save_CPPFLAGS="$CPPFLAGS" - ss_save_CXXFLAGS="$CXXFLAGS" - ss_save_LDFLAGS="$LDFLAGS" - ss_save_LIBS="$LIBS" - if test -n "$SS_X_INCDIR"; then - CPPFLAGS="-I$SS_X_INCDIR" - else - CPPFLAGS="" - fi - CPPFLAGS="$CPPFLAGS $SS_QT4_INCDIRECTORIES" - CXXFLAGS="-O2 -Wall $CXXFLAGS" - if test -n "$SS_X_LIBDIR"; then - LIBS="-L$SS_X_LIBDIR" - else - LIBS="" - fi - LIBS="$LIBS -L$SS_QT4_LIBDIR -lQtCore" - if test -n "$SS_X_LDFLAGS"; then - LIBS="$LIBS $SS_X_LDFLAGS" - fi - if test -n "$SS_X_LIBLINK"; then - LIBS="$LIBS $SS_X_LIBLINK" - fi - LDFLAGS="-s $LDFLAGS" - AC_TRY_LINK([ - #include - #if (QT_VERSION < 0x040000) - #error "Bad qt version: too old" - #endif - ],[return 0; ],SS_QTX_LINKED_OK="TRUE",SS_QTX_LINKED_OK="FALSE") - if test "$SS_QTX_LINKED_OK" = "FALSE"; then - AC_MSG_RESULT([FAILED]); - AC_SS_SET_REDINK - echo "################################################################################" - echo "### CONFIGURE ERROR:" - echo "### Failed to compile the Qt 4.x library test program." - echo "### This may be a bad sign :)" - echo "### First of all, make sure that qt is correctly installed on your system," - echo "### and the qt version is the one requested by this version of kvirc." - echo "### Ensure that you have only one copy of qt visible at a time." - echo "### You may also take a look at the config.log file in this directory," - echo "### that will tell you which check has failed and maybe more about the reason" - echo "### of the failure." - echo "### The CPPFLAGS used were:" - for a_flag in $CPPFLAGS ; do - echo "### $a_flag" - done - echo "### The CXXFLAGS used were:" - for a_flag in $CXXFLAGS ; do - echo "### $a_flag" - done - echo "### The LIBS used were:" - for a_flag in $LIBS ; do - echo "### $a_flag" - done - echo "### The LDFLAGS used were:" - for a_flag in $LDFLAGS ; do - echo "### $a_flag" - done - echo "### If you're sure that qt is correctly installed , you may force configure" - echo "### to skip this check and try to compile kvirc anyway." - echo "### Try using the --without-qt-check option." - echo "### If you're feeling that this may be a bug in this configure script" - echo "### and want to report this to me , please include your configure script," - echo "### the config.log file as well as the complete configure output." - echo "################################################################################" - AC_SS_SET_NORMALINK - AC_MSG_ERROR([This was a fatal one...aborting]) - fi - LIBS="$ss_save_LIBS" - LDFLAGS="$ss_save_LDFLAGS" - CXXFLAGS="$ss_save_CXXFLAGS" - CPPFLAGS="$ss_save_CPPFLAGS" - AC_MSG_RESULT([success]) -]) - - -dnl ################################################################################################################### -dnl ### KDE -dnl ################################################################################################################### - -AC_DEFUN([AC_SS_FIND_KDE], -[ - AC_SS_CHECK_IF_KDE_IS_REQUESTED - if test "$SS_KDE_REQUESTED" = "yes"; then - AC_SS_FIND_KDE_GENERAL_DIR - if test "$SS_KDE_REQUESTED" = "yes"; then - AC_SS_FIND_KDE_SERVICES_DIR - AC_SS_FIND_KDE_LIBRARY_DIR - if test "$SS_KDE_REQUESTED" = "yes"; then - AC_SS_FIND_KDE_INCLUDE_DIR - if test "$SS_KDE_REQUESTED" = "yes"; then - AC_SS_ENSURE_CAN_COMPILE_X_QT3_AND_KDE - fi - fi - fi - fi -]) - -AC_DEFUN([AC_SS_CHECK_IF_KDE_IS_REQUESTED], -[ - AC_MSG_CHECKING([if KDE support is requested]) - if test "$SS_USE_QT4" = "no"; then - SS_KDE_REQUESTED="yes" - AC_ARG_WITH(kde-support,[ --without-kde-support Disable the KDE support even if it is detected ],SS_KDE_REQUESTED="$withval") - if test "$SS_KDE_REQUESTED" = "yes"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - else - SS_KDE_REQUESTED="no" - AC_MSG_RESULT([unsupported with qt 4.x]) - fi -]) - -AC_DEFUN([AC_SS_FIND_KDE_GENERAL_DIR], -[ - AC_MSG_CHECKING([for the general KDE directory]) - ss_kde_general_test_dirs="/usr /usr/local /usr /usr/local /usr/build /usr/X11R6 /opt /usr/opt /usr/lib /usr/lib /usr/src /usr/lib /usr/local/lib" - if test -n "$HOME"; then - ss_kde_general_test_dirs="$ss_kde_general_test_dirs $HOME $HOME/lib" - fi - if test -n "$KDEDIR"; then - ss_kde_general_test_dirs="$KDEDIR $ss_kde_general_test_dirs" - fi - ss_kde_general_test_path_suffix="kde kde3.0 kde3 KDE Kde KDE3 kde3 ." - - AC_SS_FIND_FILE_PATH_EXT($SS_KDE_GENERAL_FILE_TO_SEARCH,$ss_kde_general_test_dirs,$ss_kde_general_test_path_suffix,SS_KDE_GENERAL_DIR) - - if test "$SS_KDE_GENERAL_DIR" = "FAILED"; then - AC_MSG_RESULT([failed...continuing with normal checks]) - unset SS_KDE_GENERAL_DIR - else - AC_MSG_RESULT([Seems to be $SS_KDE_GENERAL_DIR]) - fi -]) - - -AC_DEFUN([AC_SS_FIND_KDE_SERVICES_DIR], -[ - AC_ARG_WITH(kde-services-dir,[ --with-kde-services-dir path to the KDE protocol services dir ],SS_KDE_SERVICESDIR="$withval",SS_KDE_SERVICESDIR="NOTGIVEN") - if test "$SS_KDE_SERVICESDIR" = "NOTGIVEN"; then - - AC_MSG_CHECKING([for KDE services directory]) - - ss_kde_services_test_dirs="/usr/share/services /usr/local/share/services /usr/kde/share/services /usr/local/kde/share/services /usr/X11R6/share/services /opt/kde/share/services /usr/lib/kde/share/services" - test -n "$KDEDIR" && ss_kde_services_test_dirs="$KDEDIR/share/services $ss_kde_services_test_dirs" - ss_kde_services_test_dirs="$ss_kde_services_test_dirs /usr/share/kde/services" - test -n "$SS_KDE_GENERAL_DIR" && ss_kde_services_test_dirs="$SS_KDE_GENERAL_DIR/share/services $ss_kde_services_test_dirs" - - AC_SS_FIND_FILE_PATH("http.protocol",$ss_kde_services_test_dirs,SS_KDE_SERVICESDIR) - - if test "$SS_KDE_SERVICESDIR" = "FAILED"; then - SS_KDE_SERVICESDIR="" - AC_MSG_RESULT([unknown]) - else - AC_MSG_RESULT([found in $SS_KDE_SERVICESDIR]) - fi - - else - AC_MSG_RESULT([using user supplied path for the KDE services dir $SS_KDE_SERVICESDIR]) - fi -]) - - -AC_DEFUN([AC_SS_FIND_KDE_INCLUDE_DIR], -[ - AC_ARG_WITH(kde-include-dir,[ --with-kde-include-dir path to the KDE headers ],SS_KDE_INCDIR="$withval",SS_KDE_INCDIR="NOTGIVEN") - if test "$SS_KDE_INCDIR" = "NOTGIVEN"; then - - AC_MSG_CHECKING([for KDE header files]) - - ss_kde_include_test_dirs="/include /usr/include /usr/local/include /usr/kde/include /usr/local/kde/include /usr/X11R6/include /opt/kde/include /usr/lib/kde/include /usr/lib/kde /usr/include/X11" - test -n "$KDEDIR" && ss_kde_include_test_dirs="$KDEDIR/include $KDEDIR $ss_kde_include_test_dirs" - ss_kde_include_test_dirs="$ss_kde_include_test_dirs /usr/include/kde /usr/local/include/kde /include/kde /usr/X11R6/include/kde /usr/build/kde/include" - ss_kde_include_test_dirs="$ss_kde_include_test_dirs /usr/include/kde2 /usr/local/include/kde2 /include/kde2 /usr/X11R6/include/kde2 /usr/include/X11/kde2" - test -n "$SS_KDE_GENERAL_DIR" && ss_kde_include_test_dirs="$SS_KDE_GENERAL_DIR/include $ss_kde_include_test_dirs" - - AC_SS_FIND_FILE_PATH($SS_KDE_INCLUDE_FILE_TO_SEARCH,$ss_kde_include_test_dirs,SS_KDE_INCDIR) - - if test "$SS_KDE_INCDIR" = "FAILED"; then - AC_MSG_RESULT("FAILED") - SS_KDE_REQUESTED="no" - SS_KDE_INCDIR="" - else - AC_MSG_RESULT([found in $SS_KDE_INCDIR]) - fi - - else - AC_MSG_RESULT([using user supplied path for the KDE include files $SS_KDE_INCDIR]) - fi - - if test -z "$SS_KDE_GENERAL_DIR"; then - # Set it.... we need it :)... - SS_KDE_GENERAL_DIR=`echo $SS_KDE_INCDIR | sed -e 's/\/include\$//'` - fi -]) - -AC_DEFUN([AC_SS_FIND_KDE_LIBRARY_DIR], -[ - AC_ARG_WITH(kde-library-dir,[ --with-kde-library-dir path to the KDE libraries ],SS_KDE_LIBDIR="$withval",SS_KDE_LIBDIR="NOTGIVEN") - if test "$SS_KDE_LIBDIR" = "NOTGIVEN"; then - AC_MSG_CHECKING([for the KDE libraries]) - - ss_kde_library_test_dirs="/lib /usr/lib /usr/local/lib /usr/kde/lib /opt/kde/lib /opt/lib /usr/opt/kde/lib /usr/local/kde/lib /usr/X11R6/lib /usr/lib/kde/lib /usr/lib/kde /usr/local/lib/kde/lib" - test -n "$KDEDIR" && ss_kde_library_test_dirs="$KDEDIR/lib $KDEDIR $ss_kde_library_test_dirs" - ss_kde_library_test_dirs="$ss_kde_library_test_dirs /usr/local/lib/kde /usr/X11R6/lib/kde /usr/build/kde/lib" - if test -n "$SS_KDE_GENERAL_DIR"; then - ss_kde_library_test_dirs="$SS_KDE_GENERAL_DIR/lib $ss_kde_library_test_dirs" - fi - - - AC_SS_FIND_FILE_PATH(libkdecore.so.6 libkdecore.so.5 libkdecore.so.4 libkdecore.so.3 libkdecore.so,$ss_kde_library_test_dirs,SS_KDE_LIBDIR) - if test "$SS_KDE_LIBDIR" = "FAILED"; then - AC_SS_FIND_FILE_PATH(libkdecore.so.8 libkdecore.so.7 libkdecore.so.4.0.0 libkdecore.so.4.1.0 libkdecore.so.4.2.0 ,$ss_kde_library_test_dirs,SS_KDE_LIBDIR) - if test "$SS_KDE_LIBDIR" = "FAILED"; then - # Try the senseless too - AC_SS_FIND_FILE_PATH(libkdecore.so.4.0.0 libkdecore.so.4.1.0 libkdecore.so.4.2.0 libkdecore.so.4.3.0,$ss_kde_library_test_dirs,SS_KDE_LIBDIR) - if test "$SS_KDE_LIBDIR" = "FAILED"; then - AC_SS_FIND_FILE_PATH(libkdecore.so.4.4.0 libkdecore.so.4.5.0 libkdecore.so.4.6.0 libkdecore.so.4.7.0 libkdecore.a,$ss_kde_library_test_dirs,SS_KDE_LIBDIR) - fi - fi - fi - - if test "$SS_KDE_LIBDIR" = "FAILED"; then - AC_MSG_RESULT("FAILED") - SS_KDE_REQUESTED="no" - SS_KDE_LIBDIR="" - else - AC_MSG_RESULT([found in $SS_KDE_LIBDIR]) - fi - else - AC_MSG_RESULT([using user supplied path for the KDE libraries $SS_KDE_LIBDIR]) - fi - - if test -z "$SS_KDE_GENERAL_DIR"; then - # Set it.... we need it :)... - SS_KDE_GENERAL_DIR=`echo $SS_KDE_LIBDIR | sed -e 's/\/lib\$//'` - fi -]) - -AC_DEFUN([AC_SS_ENSURE_CAN_COMPILE_X_QT3_AND_KDE], -[ - AC_ARG_WITH(kde-check,[ --without-kde-check Do not check if Qt,KDE and X compile ],SS_CHECK_QTX_COMPILE="$withval",SS_CHECK_KQTX_COMPILE="yes") - if test "$SS_CHECK_KQTX_COMPILE" = "yes"; then - AC_MSG_CHECKING(if we can compile an X-Qt-KDE application) - AC_LANG_CPLUSPLUS - ss_save_CPPFLAGS="$CPPFLAGS" - ss_save_CXXFLAGS="$CXXFLAGS" - ss_save_LDFLAGS="$LDFLAGS" - ss_save_LIBS="$LIBS" - if test -n "$SS_X_INCDIR"; then - CPPFLAGS="-I$SS_X_INCDIR" - else - CPPFLAGS="" - fi - CPPFLAGS="$CPPFLAGS -I$SS_X_INCDIR -I$SS_QT3_INCDIR -I$SS_KDE_INCDIR" - CXXFLAGS="-O2 -Wall $CXXFLAGS" - if test -n "$SS_X_LIBDIR"; then - LIBS="-L$SS_X_LIBDIR" - else - LIBS="" - fi - if test -n "$SS_X_LDFLAGS"; then - LIBS="$SS_X_LDFLAGS $LIBS" - fi - if test -n "$SS_X_LIBLINK"; then - LIBS="$LIBS $SS_X_LIBLINK" - fi - LIBS="-L$SS_KDE_LIBDIR -L$SS_QT3_LIBDIR -lkdecore -l$SS_QTLIB_NAME $LIBS -Wl,-rpath $SS_KDE_LIBDIR" - if test "$SS_LINK_TO_LIBDL" = "yes"; then - LIBS="$LIBS -ldl"; - fi - LDFLAGS="-s $LDFLAGS" - AC_TRY_LINK([ - #include "kapp.h" - #include "kwin.h" - ],[ - int a = KWin::currentDesktop(); - KApplication app(a,0,"kvirc"); - ], - SS_KQTX_LINKED_OK="TRUE", - SS_KQTX_LINKED_OK="FALSE" - ) - if test "$SS_KQTX_LINKED_OK" = "FALSE"; then - AC_MSG_RESULT(failed) - AC_MSG_ERROR([This was a fatal one...aborting]) - else - AC_MSG_RESULT(success) - fi - LIBS="$ss_save_LIBS" - LDFLAGS="$ss_save_LDFLAGS" - CXXFLAGS="$ss_save_CXXFLAGS" - CPPFLAGS="$ss_save_CPPFLAGS" - fi -]) - - - - - - -AC_DEFUN([AC_SS_CHECK_OTHER_LIBS], -[ - SS_OTHER_LIBDIRS="" - SS_OTHER_LIBLINK="" - SS_OTHER_INCDIRS="" - - - AC_MSG_CHECKING([if you want to link to libresolv]) - SS_DO_IT="false" - AC_ARG_WITH(libresolv, [ --with-libresolv Link to libresolv],SS_DO_IT="true") - if test "$SS_DO_IT" = "true"; then - AC_MSG_RESULT(yes) - SS_OTHER_LIBLINK="$SS_OTHER_LIBLINK -lresolv" - else - AC_MSG_RESULT(no) - fi - - AC_MSG_CHECKING([if you want to link to libsocket]) - SS_DO_IT="false" - AC_ARG_WITH(libsocket, [ --with-libsocket Link to libsocket],SS_DO_IT="true") - if test "$SS_DO_IT" = "true"; then - AC_MSG_RESULT(yes) - SS_OTHER_LIBLINK="$SS_OTHER_LIBLINK -lsocket" - else - AC_MSG_RESULT(no) - fi - - AC_MSG_CHECKING([if you want to link to libnsl]) - SS_DO_IT="false" - AC_ARG_WITH(libnsl, [ --with-libnsl Link to libnsl],SS_DO_IT="true") - if test "$SS_DO_IT" = "true"; then - AC_MSG_RESULT(yes) - SS_OTHER_LIBLINK="$SS_OTHER_LIBLINK -lnsl" - else - AC_MSG_RESULT(no) - fi - - AC_MSG_CHECKING([if you want to link to libcompat]) - SS_DO_IT="false" - AC_ARG_WITH(libnsl, [ --with-libcompat Link to libcompat],SS_DO_IT="true") - if test "$SS_DO_IT" = "true"; then - AC_MSG_RESULT(yes) - SS_OTHER_LIBLINK="$SS_OTHER_LIBLINK -lcompat" - else - AC_MSG_RESULT(no) - fi - - AC_MSG_CHECKING([if you want to link to other libraries]) - SS_DO_IT="false" - AC_ARG_WITH(other-libs, [ --with-other-libs=... Link to the specified libraries],SS_DO_IT="$withval") - if test "$SS_DO_IT" != "false"; then - AC_MSG_RESULT([yes]) - SS_OTHER_LIBLINK="$SS_OTHER_LIBLINK $SS_DO_IT" - else - AC_MSG_RESULT([no]) - fi - - AC_MSG_CHECKING([if you want to add other library search paths]) - SS_DO_IT="false" - AC_ARG_WITH(other-ldirs, [ --with-other-ldirs=... Add the specified library paths],SS_DO_IT="$withval") - if test "$SS_DO_IT" != "false"; then - AC_MSG_RESULT([yes]) - SS_OTHER_LIBDIRS="$SS_OTHER_LIBDIRS $SS_DO_IT" - else - AC_MSG_RESULT([no]) - fi - - AC_MSG_CHECKING([if you want to add other include search paths]) - SS_DO_IT="false" - AC_ARG_WITH(other-idirs, [ --with-other-idirs=... Add the specified include search paths],SS_DO_IT="$withval") - if test "$SS_DO_IT" != "false"; then - AC_MSG_RESULT([yes]) - SS_OTHER_INCDIRS="$SS_OTHER_INCDIRS $SS_DO_IT" - else - AC_MSG_RESULT([no]) - fi - -]) - - - -AC_DEFUN([AC_SS_FINAL_CONFIG], -[ - AC_MSG_CHECKING([if we finally have to compile the IpV6 support]) - - if test "$SS_NOIPV6_SUPPORT" = "true"; then - AC_MSG_RESULT([no: disabled by user]) - else - if test "$SS_HAVE_IPV6_FUNCTIONS" = "true"; then - AC_MSG_RESULT([yes]) - AC_DEFINE([COMPILE_IPV6_SUPPORT], 1, [define if you want the IpV6 support]) - SS_BUILD_FLAGS="i$SS_BUILD_FLAGS" - else - AC_MSG_RESULT([no: the system lacks support]) - fi - fi - - dnl # // Toplevel source directory - - SS_TOPSRCDIR=`pwd` - - AC_SUBST(SS_TOPSRCDIR) - - SS_CPPFLAGS="-D_REENTRANT -DREENTRANT" - if test -n "$SS_X_CPPFLAGS"; then - SS_CPPFLAGS="$SS_CPPFLAGS $SS_X_CPPFLAGS" - fi - - if test "$SS_USE_QT4" = "no"; then - SS_INCDIRS="-I$SS_QT3_INCDIR -I$SS_X_INCDIR" - else - AC_DEFINE([COMPILE_USE_QT4], 1, [define if you want to compile the Qt 4.x support]) - SS_INCDIRS="$SS_QT4_INCDIRECTORIES -I$SS_X_INCDIR" - SS_CPPFLAGS="$SS_CPPFLAGS -DQT3_SUPPORT" - fi - - if test -n "$SS_X_INCDIR"; then - SS_INCDIRS="$SS_INCDIRS -I$SS_X_INCDIR" - fi - - if test -n "$SS_X_LDFLAGS"; then - SS_LDFLAGS="$SS_X_LDFLAGS" - else - SS_LDFLAGS="" - fi - - if test "$SS_USE_QT4" = "no"; then - SS_RPATH="-rpath $SS_QT3_LIBDIR -rpath $libdir" - else - SS_RPATH="-rpath $SS_QT4_LIBDIR -rpath $libdir" - fi - - if test -n "$SS_X_LIBDIR"; then - SS_RPATH="$SS_RPATH -rpath $SS_X_LIBDIR" - fi - - if test "$SS_USE_QT4" = "no"; then - SS_LIBDIRS="-L$SS_TOPSRCDIR/src/kvilib/build/ -L$SS_QT3_LIBDIR" - else - SS_LIBDIRS="-L$SS_TOPSRCDIR/src/kvilib/build/ -L$SS_QT4_LIBDIR" - fi - - if test -n "$SS_X_LIBDIR"; then - SS_LIBDIRS="$SS_LIBDIRS -L$SS_X_LIBDIR" - fi - - if test "$SS_USE_QT4" = "no"; then - SS_LIBLINK="-l$SS_QTLIB_NAME" - else - #if test -n "SS_LOCAL_ADD_DEBUG_SYMBOLS"; then - # SS_LIBLINK="-lQtCore_debug -lQtGui_debug -lQt3Support_debug" - #else - - SS_LIBLINK="-lQtCore -lQtGui -lQt3Support" - - #fi - fi - - if test -n "$SS_X_LIBLINK"; then - SS_LIBLINK="$SS_LIBLINK $SS_X_LIBLINK" - fi - SS_LIBLINK="$SS_LIBLINK $SS_THREAD_LIBLINK" - if test "$SS_LINK_TO_LIBSSL" = "true"; then - SS_LIBLINK="$SS_LIBLINK -lssl -lcrypto" - fi - if test "$SS_LINK_TO_LIBESD" = "true"; then - SS_LIBLINK="$SS_LIBLINK -lesd" - fi - if test "$SS_LINK_TO_LIBARTS" = "true"; then - SS_LIBLINK="$SS_LIBLINK -lsoundserver_idl" - fi - if test "$SS_LINK_TO_LIBAUDIOFILE" = "true"; then - SS_LIBLINK="$SS_LIBLINK -laudiofile -lm" - fi - - if test "$SS_LOCAL_8BIT" = "true"; then - SS_CPPFLAGS="$SS_CPPFLAGS -DQT3_NO_ASCII_CAST -DQT3_NO_COMPAT" - fi - - if test "$SS_QT3_EMBEDDED" = "true"; then - SS_CPPFLAGS="$SS_CPPFLAGS -DQWS" - fi - - if test "$SS_KDE_REQUESTED" = "yes"; then - SS_INCDIRS="$SS_INCDIRS -I$SS_KDE_INCDIR" - SS_RPATH="$SS_RPATH -rpath $SS_KDE_LIBDIR" - SS_LIBDIRS="$SS_LIBDIRS -L$SS_KDE_LIBDIR" - SS_LIBLINK="-lkdecore -lkdeui -lkparts $SS_LIBLINK" - AC_DEFINE([COMPILE_KDE_SUPPORT], 1, [define if you want to compile the KDE 3.x support]) - SS_BUILD_FLAGS="k$SS_BUILD_FLAGS" - fi - - if test -n "$SS_OTHER_LIBLINK"; then - SS_LIBLINK="$SS_LIBLINK $SS_OTHER_LIBLINK" - fi - - if test -n "$SS_OTHER_LIBDIRS"; then - SS_LIBDIRS="$SS_LIBDIRS $SS_OTHER_LIBDIRS" - $SS_OTHER_LIBDIRS=`echo "$SS_OTHER_LIBDIRS" | sed -e s/-L//g` - SS_RPATH="$SS_RPATH -rpath $SS_OTHER_LIBDIRS" - fi - - if test -n "$SS_OTHER_INCDIRS"; then - SS_INCDIRS="$SS_INCDIRS $SS_OTHER_INCDIRS" - fi - - if test "$SS_LINK_TO_LIBDL" = "yes"; then - SS_LIBLINK="$SS_LIBLINK -ldl" - fi - - if test "$SS_LINK_TO_LIBZ" = "yes"; then - SS_LIBLINK="$SS_LIBLINK -lz" - fi - if test "$SS_LINK_TO_XSS" = "yes"; then - SS_LIBLINK="$SS_LIBLINK -lXss" - fi - - AC_SUBST(SS_CPPFLAGS) - AC_SUBST(SS_INCDIRS) - AC_SUBST(SS_LDFLAGS) - AC_SUBST(SS_RPATH) - AC_SUBST(SS_LIBDIRS) - AC_SUBST(SS_LIBLINK) - - if test "$SS_USE_QT4" = "no"; then - SS_QT_MOC=$SS_QT3_MOC - SS_QT_MOC_FLAGS="" - else - SS_QT_MOC=$SS_QT4_MOC - SS_QT_MOC_FLAGS="-DCOMPILE_USE_QT4" - fi - - AC_SUBST(SS_QT_MOC) - AC_SUBST(SS_QT_MOC_FLAGS) - - build_date=`date -u` - - if test -z "$build_date"; then - build_date=`date` - fi - - if test -z "$build_date"; then - build_date="unknown" - fi - - AC_DEFINE_UNQUOTED([BUILD_DATE],"$build_date", [this is the build date (configure date rather)]) - - dnl # Let's sort the build flags - - SS_AUX_CHARS="a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9" - - buid_flags="" - - for achar in $SS_AUX_CHARS; do - tmp_val=`echo "$SS_BUILD_FLAGS" | grep $achar` - if test "$tmp_val"; then - build_flags="$build_flags$achar" - fi - done - - SS_DIRTAG=`echo $VERSION | cut -d . -f 1,2` - - AC_DEFINE_UNQUOTED([VERSION_BRANCH], "$SS_DIRTAG", [MAJOR.MINOR part of version]) - AC_DEFINE_UNQUOTED([BUILD_FLAGS],"$target_cpu-$build_flags", [these are the build flags]) - - globalkvircdir="\${datadir}/kvirc/$SS_DIRTAG" - AC_SUBST(globalkvircdir) - - configdir="\${globalkvircdir}/config" - AC_SUBST(configdir) - - picsdir="\${globalkvircdir}/pics" - AC_SUBST(picsdir) - - helpdir="\${globalkvircdir}/help/en" - AC_SUBST(helpdir) - - pluglibdir="\${globalkvircdir}/modules" - AC_SUBST(pluglibdir) - - modulelibdir="\${globalkvircdir}/modules" - AC_SUBST(modulelibdir) - - defscriptdir="\${globalkvircdir}/defscript" - AC_SUBST(defscriptdir) - - themedir="\${globalkvircdir}/themes" - AC_SUBST(themedir) - - msgcolorsdir="\${globalkvircdir}/msgcolors" - AC_SUBST(msgcolorsdir) - - if test -z "$mandir"; then - mandir="\${exec_prefix}/man/man1" - fi - AC_SUBST(mandir) - - - licensedir="\${globalkvircdir}/license" - AC_SUBST(licensedir) - - if test -n "$SS_KDE_SERVICESDIR"; then - kdeservicesdir="$SS_KDE_SERVICESDIR" - else - kdeservicesdir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/protocols" - fi - AC_SUBST(kdeservicesdir) - - if test "$SS_KDE_REQUESTED" = "yes"; then - iconapps16datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/16x16/apps" - iconapps32datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/32x32/apps" - iconapps48datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/48x48/apps" - iconapps64datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/64x64/apps" - iconapps128datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/128x128/apps" - iconappsscalabledatadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/scalable/apps" - iconmime16datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/16x16/mimetypes" - iconmime32datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/32x32/mimetypes" - iconmime48datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/48x48/mimetypes" - iconmime64datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/64x64/mimetypes" - iconmime128datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/128x128/mimetypes" - iconmimescalabledatadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/scalable/mimetypes" - applnkdir="$SS_KDE_GENERAL_DIR/share/applnk/Internet" - mimelnkdir="$SS_KDE_GENERAL_DIR/share/mimelnk/text" - else - iconapps16datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/16x16" - iconapps32datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/32x32" - iconapps48datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/48x48" - iconapps64datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/64x64" - iconapps128datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/128x128" - iconappsscalabledatadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/scalable" - iconmime16datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/16x16" - iconmime32datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/32x32" - iconmime48datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/48x48" - iconmime64datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/64x64" - iconmime128datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/128x128" - iconmimescalabledatadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/scalable" - applnkdir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/applnk" - mimelnkdir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/mimelnk" - fi - AC_SUBST(iconapps16datadir) - AC_SUBST(iconapps32datadir) - AC_SUBST(iconapps48datadir) - AC_SUBST(iconapps64datadir) - AC_SUBST(iconapps128datadir) - AC_SUBST(iconappsscalabledatadir) - AC_SUBST(iconmime16datadir) - AC_SUBST(iconmime32datadir) - AC_SUBST(iconmime48datadir) - AC_SUBST(iconmime64datadir) - AC_SUBST(iconmime128datadir) - AC_SUBST(iconmimescalabledatadir) - AC_SUBST(applnkdir) - AC_SUBST(mimelnkdir) - - localedir="\${globalkvircdir}/locale" - AC_SUBST(localedir) - - headersdir="\${exec_prefix}/include/kvirc/$VERSION" - AC_SUBST(headersdir) - - - configmodulesdir="\${globalkvircdir}/config/modules" - AC_SUBST(configmodulesdir) - - - topdir=`pwd` - AC_SUBST(topdir) - - AC_SS_HEADER([Configuration status:]) - AC_SS_SET_GREENINK - echo "### The kvirc binary will be installed in:" - echo "### $bindir" - echo "### The libraries will be installed in:" - echo "### $libdir" - echo "### Modules will be installed in:" - echo "### $pluglibdir" - AC_SS_SET_NORMALINK - AC_SS_HEADER([Take a look at the paths above just to be sure that they're correct]) -]) - -dnl just a wrapper to clean up configure.in -AC_DEFUN([KVIRC_PROG_LIBTOOL], -[ - AM_PROG_LIBTOOL - - LIBTOOL_SHELL="/bin/sh ./libtool" - # LIBTOOL="$LIBTOOL --silent" - - AC_ARG_ENABLE(objprelink, [ --enable-objprelink prelink apps (experimental, needs objprelink in path)], - kvirc_use_objprelink=$enableval, kvirc_use_objprelink=no) - if test "x$kvirc_use_objprelink" = "xyes"; then - echo Patching libtool to run objprelink. - mv libtool libtool.orig - cat > libtool <<\EOF -#! /bin/sh - -ALREADYPRELINKED="" - -for n -do - case $n in - *.o) k=$n - if test -r $k; then - ISELF=`file $k | grep ELF` - if test -n "$ISELF"; then - ALREADY=`echo $ALREADYPRELINKED | grep "!!!$k"` - if test -z "$ALREADY"; then - echo objprelink $k - objprelink $k - ALREADYPRELINKED="$ALREADYPRELINKED !!!$k" - fi - fi - fi - ;; - *.lo) k=$n - if test -r $k; then - ISELF=`file $k | grep ELF` - if test -n "$ISELF"; then - ALREADY=`echo $ALREADYPRELINKED | grep "!!!$k"` - if test -z "$ALREADY"; then - echo objprelink $k - objprelink $k - ALREADYPRELINKED="$ALREADYPRELINKED !!!$k" - fi - fi - fi - ASHORTNAME=`echo $n | sed -e 's/\.lo$//'` - k=".libs/$ASHORTNAME.o" - if test -r $k; then - ISELF=`file $k | grep ELF` - if test -n "$ISELF"; then - ALREADY=`echo $ALREADYPRELINKED | grep "!!!$k"` - if test -z "$ALREADY"; then - echo objprelink $k - objprelink $k - ALREADYPRELINKED="$ALREADYPRELINKED !!!$k" - fi - fi - fi - k=".libs/$ASHORTNAME.lo" - if test -r $k; then - ISELF=`file $k | grep ELF` - if test -n "$ISELF"; then - ALREADY=`echo $ALREADYPRELINKED | grep "!!!$k"` - if test -z "$ALREADY"; then - echo objprelink $k - objprelink $k - ALREADYPRELINKED="$ALREADYPRELINKED !!!$k" - fi - fi - fi - k="$ASHORTNAME.o" - if test -r $k; then - ISELF=`file $k | grep ELF` - if test -n "$ISELF"; then - ALREADY=`echo $ALREADYPRELINKED | grep "!!!$k"` - if test -z "$ALREADY"; then - echo objprelink $k - objprelink $k - ALREADYPRELINKED="$ALREADYPRELINKED !!!$k" - fi - fi - fi - ;; - esac -done - -EOF - cat >> libtool libtool.orig - rm libtool.orig - chmod a+x libtool - fi -]) diff --git a/3.4.0/admin/config.guess b/3.4.0/admin/config.guess deleted file mode 100755 index 917bbc50f3..0000000000 --- a/3.4.0/admin/config.guess +++ /dev/null @@ -1,1463 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - -timestamp='2005-07-08' - -# This file 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. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerppc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit ;; - frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #ifdef __INTEL_COMPILER - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - *86) UNAME_PROCESSOR=i686 ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/3.4.0/admin/config.sub b/3.4.0/admin/config.sub deleted file mode 100755 index 1c366dfde9..0000000000 --- a/3.4.0/admin/config.sub +++ /dev/null @@ -1,1579 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - -timestamp='2005-07-08' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file 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. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ - kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | ms1 \ - | msp430 \ - | ns16k | ns32k \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b \ - | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m32c) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | ms1-* \ - | msp430-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - m32c-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16c) - basic_machine=cr16c-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/3.4.0/admin/convert.sh b/3.4.0/admin/convert.sh deleted file mode 100755 index af4cef57f8..0000000000 --- a/3.4.0/admin/convert.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -for aa in $*; do -file: $aa -dos2unix $aa -done \ No newline at end of file diff --git a/3.4.0/admin/convert2unix.sh b/3.4.0/admin/convert2unix.sh deleted file mode 100755 index 975f89cc97..0000000000 --- a/3.4.0/admin/convert2unix.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -admin/convert.sh `find -name "*.h"` -admin/convert.sh `find -name "*.cpp"` -admin/convert.sh `find -name "*.cc"` \ No newline at end of file diff --git a/3.4.0/admin/depcomp b/3.4.0/admin/depcomp deleted file mode 100755 index 04701da536..0000000000 --- a/3.4.0/admin/depcomp +++ /dev/null @@ -1,530 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2005-07-09.11 - -# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. - -# 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, 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. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. - "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory -## that the space means something, we add a space to the output as -## well. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the - # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> $depfile - echo >> $depfile - - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> $depfile - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` - tmpdepfile="$stripped.u" - if test "$libtool" = yes; then - "$@" -Wc,-M - else - "$@" -M - fi - stat=$? - - if test -f "$tmpdepfile"; then : - else - stripped=`echo "$stripped" | sed 's,^.*/,,'` - tmpdepfile="$stripped.u" - fi - - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - - if test -f "$tmpdepfile"; then - outname="$stripped.o" - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" - sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mecanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. - "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no - for arg in "$@"; do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix="`echo $object | sed 's/^.*\././'`" - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o, - # because we must use -o when running libtool. - "$@" || exit $? - IFS=" " - for arg - do - case "$arg" in - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/3.4.0/admin/gendoc.pl b/3.4.0/admin/gendoc.pl deleted file mode 100755 index 700ed23f33..0000000000 --- a/3.4.0/admin/gendoc.pl +++ /dev/null @@ -1,1351 +0,0 @@ -#!/usr/bin/perl - -################################################################################################# -# GLOBAL CONFIGS -################################################################################################# - -$g_currenttime=gmtime; -$g_currentuser = getlogin || getpwuid($<) || "Unknown"; -$g_notetablebgcolor="#F0F0F0"; -$g_notetextcolor="#909090"; -$g_syntaxcolor="#802000"; - -$g_kvssyntaxcolor="#802000"; -$g_kvstypenamecolor="#808080"; -$g_kvstypedelimiterscolor="#8080a0"; - -$g_bodybgcolor="#FFFFFF"; -$g_bodytextcolor="#000000"; -$g_bodylinkcolor="#000000"; -$g_tablebgcolor="#B4B4C8"; -#$g_titletablebgcolor="#999999"; -$g_titletextcolor="#31507B"; -#$g_titletablebgcolor="#68838B"; #LightBlue4 -$g_titletablebgcolor="#BEBEF0"; -#$g_subtitletablebgcolor="#C5C5C5"; -$g_subtitletablebgcolor="#D2D2D2"; -$g_internaltablecolor="#D5D5D5"; -$g_classfnctablecolor="#D5D5D5"; -$g_classfncbodytablecolor="#E0E0E0"; -$g_switchbodytablecolor="#D5D5D5"; -$g_switchnametablecolor="#E0E0E0"; -$g_bodytablebgcolor="#EAEAEA"; -$g_commentcolor="#207500"; -$g_fileextension=".html"; -#$g_headerborderlightcolor="#A0A0A0"; -#$g_headerborderdarkcolor="#000000"; -$g_headerbgcolor="#FFFFFF"; - - -$g_prefixes{'command'}="cmd"; -$g_prefixes{'function'}="fnc"; -$g_prefixes{'event'}="event"; -$g_prefixes{'language'}="doc"; -$g_prefixes{'class'}="class"; -$g_prefixes{'module'}="module"; -$g_prefixes{'widget'}="widget"; - -$g_version = "3.2.0.99"; -$g_filehandle=""; -$g_shortsIdx{"keyterms"}=0; -$g_directory = ""; - -################################################################################################# -# PARSE ARGS -################################################################################################# - - -sub usage -{ - print "\n"; - print "Usage:\n"; - print " gendoc.pl [-v ] ...\n"; - print "Parameters:\n"; - print " : directory where the doc files should be written\n"; - print " ...: a list of files from which to extract docs\n"; - print "Options:\n"; - print " -v forces the specified version to be displayed in the\n"; - print " generated documents\n"; - print "\n"; -} - -$i = 0; -$cont = 1; -while($cont) -{ - if($ARGV[$i] eq "--version") - { - print "gendoc.pl 2.0.0: KVIrc documentation generator\n"; - exit(0); - } elsif($ARGV[$i] eq "-v") - { - $i++; - if($ARGV[$i] eq "") - { - usage(); - die "Switch -v requires a parameter" - } - $g_version = $ARGV[$i]; - $i++; - } else { - $cont = 0; # stop processing - } -} - -$g_directory = $ARGV[$i]; -$i++; - -if($g_directory eq "") -{ - usage(); - die "Missing target directory"; -} - -$j = 0; -while($ARGV[$i] ne "") -{ - $g_filesToProcess[$j] = $ARGV[$i]; - $j++; - $i++; -} - - -################################################################################################# -# SUBS -################################################################################################# - -sub print_header -{ - print $g_filehandle "\n"; - print $g_filehandle "\n"; - print $g_filehandle "$_[0]\n"; - - print $g_filehandle "\n"; - print $g_filehandle "\n"; - print $g_filehandle "\n"; - print $g_filehandle "\n"; - - print $g_filehandle "\n"; - print $g_filehandle " \n"; - print $g_filehandle " \n"; - print $g_filehandle " \n"; - print $g_filehandle " \n"; - print $g_filehandle "
\n"; - print $g_filehandle " \n"; - print $g_filehandle " \n"; - print $g_filehandle " \n"; - print $g_filehandle "
\n"; -} - -sub print_footer -{ - print $g_filehandle "
KVIrc $g_version Documentation
Generated by $g_currentuser at $g_currenttime\n"; - print $g_filehandle "\n"; - print $g_filehandle "\n"; -} - -sub print_tablestart -{ - print $g_filehandle "\n"; - #print $g_filehandle "\n"; - print $g_filehandle "
\n"; -} - -sub print_tableend -{ - #print $g_filehandle "
\n"; -} - -sub print_title -{ - print $g_filehandle " \n"; - print $g_filehandle " \n"; - print $g_filehandle " \n"; - - print $g_filehandle "

$_[0]

\n"; - if($_[1] ne "") - { - print $g_filehandle "$_[1]\n"; - } else { - print $g_filehandle "\n"; - } - - print $g_filehandle "
\n"; - print $g_filehandle " \n"; - print $g_filehandle " \n"; -} - -sub print_twocolumntitle -{ - print $g_filehandle " \n"; - print $g_filehandle " \n"; - print $g_filehandle " \n"; - - print $g_filehandle "

$_[0]

\n"; - if($_[1] ne "") - { - print $g_filehandle "$_[1]\n"; - } else { - print $g_filehandle "\n"; - } - - print $g_filehandle "
\n"; - print $g_filehandle " \n"; - print $g_filehandle " \n"; -} - - -sub print_subtitle -{ - print $g_filehandle " \n"; - print $g_filehandle " $_[0]\n"; - print $g_filehandle " \n"; -} - -sub print_twocolumnsubtitle -{ - print $g_filehandle " \n"; - print $g_filehandle " $_[0]\n"; - print $g_filehandle " \n"; -} - -sub print_body -{ - print $g_filehandle " \n"; - print $g_filehandle " $_[0]\n"; - print $g_filehandle " \n"; -} - -sub print_twocolumnbody -{ - print $g_filehandle "\n"; - print $g_filehandle " $_[0]\n"; - print $g_filehandle " $_[1]\n"; - print $g_filehandle "\n"; -} - -sub print_entry -{ - if($_[1] ne "") - { - if($_[0] ne "") - { - print_subtitle($_[0]); - } - print_body($_[1]); - } -} - -sub make_single_token -{ - $_[0] =~ s/^[ ]*//g; - $_[0] =~ s/[ ]*$//g; - $_[0] =~ s/\n//g; -} - -sub make_single_line -{ - $_[0] =~ s/^[ \n]*//g; - $_[0] =~ s/[ \n]*$//gs; -} - -sub make_syntax -{ - $_[0] =~ s/^[ \n]*//g; - $_[0] =~ s/[ \n]*$//gs; - my @arry; - @arry = split('\n',$_[0]); - $_[0] = ""; - foreach(@arry) - { - $_ =~ s/^[ \n]*//g; - if($_ ne "") - { - if($_[0] ne "") - { - $_[0] = "$_[0]\n$_"; - } else { - $_[0] = "$_"; - } - } - } -} - -sub extract_keyterms -{ - my($docfilename); - my(%parts); - my($part); # Part title - my($partbody); - my($tabblock); - my($tmp); - my($type); - - if(!open(CPPFILE,"$_[0]")) - { - return; - } - # Process the entire file - - while() - { - if(/^[ ]*\@doc:[ a-z_]*/) - { - # Process a single document block - - $docfilename="$_"; - $docfilename=~ s/[ ]*//g; - $docfilename=~ s/\@doc://g; - $docfilename=~ s/\n//g; - $docfilename=~ s/\r//g; - $docfilename=~ s/([a-zA-Z_]*)/\L\1/g; - - undef %parts; - $part = ""; - - INNERLOOP: while() - { - - if(/^[ ]*\*\/[ ]*/) - { - # End of comment - if(($part ne "") && ($partbody ne "") && ($partbody ne "\n")) - { - # We have an entire part to store - $parts{$part}="$partbody"; - } - last INNERLOOP; - } else { - # Inside a part - if(/^[ ]*\@[a-z]*:[ ]*/) - { - # A part title - if(($part ne "") && ($partbody ne "") && ($partbody ne "\n")) - { - # We have an entire part to store - $parts{$part}="$partbody"; - } - # Start of the part - # Extract the title - $part="$_"; - $part=~ s/[ ]*//g; - $part=~ s/\@//g; - $part=~ s/://g; - $part=~ s/\n//g; - # Clear the body (begin) - $partbody=""; - } else { - # Somewhere in a part body - if(($_ ne "") && ($_ ne "\n")) - { - if($partbody eq "") - { - # If it is the first line of the part body - # Extract the amount of tabs that the part has - # We will use it to remove the C++ indentation - $tabblock = "$_"; - $tabblock =~ s/^([ ]*).*/\1/g; - $tabblock =~ s/\n//g; - } - - if($tabblock ne "") - { - # If we have the initial tabblock , remove it from the line (remove indentation) - $_ =~ s/^$tabblock//g; - } - - process_body_line($_); - - $partbody="$partbody$_"; - } - } - } - } - - # Ok...we have a document in $parts - make_single_line($parts{'short'}); - make_single_token($parts{'title'}); - make_single_token($parts{'type'}); - - $parts{'type'}=~ s/\@//g; - $parts{'type'}=~ s/://g; - - if($parts{'type'} eq "") - { - $parts{'type'}="generic"; - } - - $type = $parts{'type'}; - - $tmp = $g_prefixes{$type}; - if($tmp eq "") - { - $tmp="doc"; - } - - $docfilename="$tmp\_$docfilename"; - - $zzz="keyterms"; - - if($parts{'keyterms'} ne "") - { - $keyterms = $parts{'keyterms'}; - $keyterms =~ s/\n//gs; - - for $term (split(/,/,$keyterms)) - { - make_single_token($term); - if($term ne "") - { - $termx=$term; - $termx=~ s/([\+\(\)\?\.\:\*\|\=\;\^\!\~])/\\$1/g; - - $g_keyterms{$term} = "$docfilename$g_fileextension"; - $g_keytermsclean{$term} = "$termx"; - - $tmp="keyterms_$g_shortsIdx{$zzz}"; - $g_shorts{$tmp}="$term$parts{'short'}$docfilename$g_fileextension"; - #print "GOT $g_shorts{$tmp} ($tmp)"; - $g_shortsIdx{$zzz}++; - } - } - } - - $tmp="keyterms_$g_shortsIdx{$zzz}"; - $g_shorts{$tmp}="$parts{'title'}$parts{'short'}$docfilename$g_fileextension"; - #print "GOT $g_shorts{$tmp} ($tmp)"; - $g_shortsIdx{$zzz}++; - } - } - - close(CPPFILE); -} - - - -sub substitute_keyterms -{ - my(@lines); - my(@tmp); - my($left); - my($right); - my($line); - my($term); - - # Kinda complex keyword substitution routine - - - # For each keyterm we have - for $term (@g_keytermsSorted) - { - # If the doc we're scanning isn't the keyword target - if($_[1] ne $g_keyterms{$term}) - { - $termclean=$g_keytermsclean{$term}; - - # If the doc matches the keyterm at least once - if($_[0] =~ /$termclean/) - { - $ref=$g_keyterms{$term}; - $ref =~ s/([a-zA-Z_]*)/\L\1/g; - - @tmp = split(//) - { - $skipIt=0 if /^[ ]*\/a[ ]*>/; - } - } - - if($skipIt) - { - $_[0]="$_[0]<$_"; - } else { - if(/[A-Za-z0-9\"]>/) - { - if(/^[ ]*a[ ][ ]*h/) - { - $skipIt=1; - $first ? $_[0] .= $_ : $_[0] .= "<$_"; - } else { - ($left,$right) = split(/>/,$_); - $right=~s/([^A-Za-z0-9<>\+\-\=_])($termclean)([^A-Za-z0-9<>\+\-\=_])/$1$2<\/a>$3/ig; - $_[0] .= "<$left>$right"; - } - } else { - $_=~s/([^A-Za-z0-9<>\+\-\=_\.])($termclean)([^A-Za-z0-9<>\+\-\=_\.])/$1$2<\/a>$3/ig; - $_[0] .= $_; - } - $first=0; - } - } - } - } - } -} - - -sub build_usage_from_kvs_syntax_line -{ - $_[0] =~ s/\<\;([A-Za-z0-9_]+):([A-Za-z0-9_]+)\>\;/\<\;\1\>\;/g; - $_[0] =~ s/\[([A-Za-z0-9_]+):([A-Za-z0-9_]+)\]/\[;\1\]/g; - $_[0] =~ s/^\<\;([A-Za-z0-9_]+)\>\;//g; -} - -sub build_usage_from_kvs_syntax -{ - my @arry; - @arry = split('\n',$_[0]); - $tmp = ""; - foreach(@arry) - { - build_usage_from_kvs_syntax_line($_); - if($tmp ne "") - { - $tmp = "$tmp\n$_"; - } else { - $tmp = "$_"; - } - } - return $tmp; -} - -sub process_kvs_syntax_line -{ - $_[0] =~ s/\<\;([A-Za-z0-9_]+):([A-Za-z0-9_]+)\>\;/\<\;\1\:\2\<\/font\>\>\;/g; - $_[0] =~ s/\[([A-Za-z0-9_]+):([A-Za-z0-9_]+)\]/\[\1\:\2\<\/font\>\]/g; - $_[0] =~ s/^\<\;([A-Za-z0-9_]+)\>\;/\<\;\\1\<\/font\>\>\;/g; - $_[0] =~ s/^([A-Za-z0-9_\.]+)/\\1\<\/b\>/g; - $_[0] =~ s/(\$[A-Za-z0-9_\.]*)/\\1\<\/b\>/g; - $_[0] =~ s/\(/\\(<\/b\>/g; - $_[0] =~ s/\)/\\)<\/b\>/g; - $_[0] =~ s/\<\;/\\<\;\<\/font\>/g; - $_[0] =~ s/\>\;/\\>\;\<\/font\>/g; - $_[0] =~ s/\[/\\[\<\/font\>/g; - $_[0] =~ s/\]/\\]\<\/font\>/g; -} - -sub process_kvs_syntax -{ - my @arry; - @arry = split('\n',$_[0]); - $_[0] = ""; - foreach(@arry) - { - process_kvs_syntax_line($_); - if($_[0] ne "") - { - $_[0] = "$_[0]\n$_"; - } else { - $_[0] = "$_"; - } - } -} - - - - -sub process_body_line -{ - $_[0] =~ s/ /\ \;\ \;\ \;\ \;/g; - $_[0] =~ s/\/\>\;/g; - $_[0] =~ s/\[br\]/\/g; - $_[0] =~ s/\[b\]/\/g; - $_[0] =~ s/\[p\]/\/g; - $_[0] =~ s/\[\/p\]/\<\/p\>/g; - $_[0] =~ s/\[\/b\]/\<\/b\>/g; - # [big][/big] is an alias to [title][/title] - $_[0] =~ s/\[big\]/\<\/td\>\<\/tr\>\\\
/g; - $_[0] =~ s/\[\/big\]/\<\/div\>\<\/td\>\<\/tr\>\\/g; -# $_[0] =~ s/\[title\]/\<\/td\>\<\/tr\>\\\
/g; -# $_[0] =~ s/\[\/title\]/\<\/div\>\<\/td\>\<\/tr\>\\/g; - $_[0] =~ s/\[title\]/\<\/td\>\<\/tr\>\\\
/g; - $_[0] =~ s/\[\/title\]/\<\/div\>\<\/td\>\<\/tr\>\\/g; -# $_[0] =~ s/\[title\]/\\\\
\\\
/g; -# $_[0] =~ s/\[\/title\]/\<\/div\>\<\/td\>\<\/tr\>\<\/table\>\<\/td\>\<\/tr\>\<\/table\>/g; - $_[0] =~ s/\[subtitle\]/\<\/td\>\<\/tr\>\\
\
/g; - $_[0] =~ s/\[\/subtitle\]/\<\/div\>\<\/td\>\<\/tr\>\\
/g; -# $_[0] =~ s/\[subtitle\]/\\\\
\\\
/g; -# $_[0] =~ s/\[\/subtitle\]/\<\/div\>\<\/td\>\<\/tr\>\<\/table\>\<\/td\>\<\/tr\>\<\/table\>/g; - $_[0] =~ s/\[pre\]/\/g; - $_[0] =~ s/\[\/pre\]/\<\/pre\>/g; - $_[0] =~ s/\[center\]/\/g; - $_[0] =~ s/\[\/center\]/\<\/center\>/g; - $_[0] =~ s/\[i\]/\/g; - $_[0] =~ s/\[\/i\]/\<\/i\>/g; - $_[0] =~ s/\[ul\]/\/g; - $_[0] =~ s/\[\/ul\]/\<\/ul\>/g; - $_[0] =~ s/\[li\]/\/g; - $_[0] =~ s/\[\/li\]/\<\/li\>/g; - $_[0] =~ s/\[table\]/\
/g; - $_[0] =~ s/\[\/table\]/\<\/table\>/g; - $_[0] =~ s/\[tr\]/\/g; - $_[0] =~ s/\[\/tr\]/\<\/tr\>/g; - $_[0] =~ s/\[td\]/\/g; - $_[0] =~ s/\[\/td\]/\<\/td\>/g; -# $_[0] =~ s/\[example\][ \n]*/

\\\\\/g; -# $_[0] =~ s/\[\/example\]/<\/font><\/code><\/pre><\/td><\/tr><\/table><\/td><\/tr><\/table><\/p>/g; - $_[0] =~ s/\[example\][ \n]*/

\\
\\\/g; - $_[0] =~ s/\[\/example\]/<\/font><\/code><\/pre><\/td><\/tr><\/table><\/p>/g; - $_[0] =~ s/\[comment\]/\/g; - $_[0] =~ s/\[\/comment\]/\<\/font\>/g; - $_[0] =~ s/\[doc\]([a-zA-Z0-9_]*)\[\/doc\]/\\1\<\/a\>/g; - $_[0] =~ s/\[doc:([a-zA-Z0-9_]*)\]([a-zA-Z0-9_\-\&\;\. ]*)\[\/doc\]/\\2\<\/a\>/g; - $_[0] =~ s/\[cmd\]([a-zA-Z0-9_\.]*)\[\/cmd\]/\\1\<\/a\>/g; - $_[0] =~ s/\[cmd:([a-zA-Z0-9_\.]*)\]([a-zA-Z0-9_\-\&\;\. ]*)\[\/cmd\]/\\2\<\/a\>/g; - $_[0] =~ s/\[fnc\]\$([a-zA-Z0-9_\.]*)\[\/fnc\]/\\$\1\<\/a\>/g; - $_[0] =~ s/\[fnc\]\$([a-zA-Z0-9_\.]*)\(\)\[\/fnc\]/\\$\1()\<\/a\>/g; - $_[0] =~ s/\[fnc\]([a-zA-Z0-9_\.]*)\[\/fnc\]/\\$\1\<\/a\>/g; - $_[0] =~ s/\[fnc:\$([a-zA-Z0-9_\.]*)\]\$([a-zA-Z0-9_\-\&\;\. ]*)\[\/fnc\]/\\$\2\<\/a\>/g; - $_[0] =~ s/\[event\]\$([a-zA-Z0-9_]*)\[\/event\]/\\$\1\<\/a\>/g; - $_[0] =~ s/\[event:([a-zA-Z0-9_]*)\]([a-zA-Z0-9_]*)\[\/event\]/\\2\<\/a\>/g; - $_[0] =~ s/\[class\]([a-zA-Z0-9_]*)\[\/class\]/\\1\<\/a\>/g; - $_[0] =~ s/\[class:([a-zA-Z0-9_]*)\]([a-zA-Z0-9_ ]*)\[\/class\]/\\2\<\/a\>/g; - $_[0] =~ s/\[module:([a-zA-Z0-9_]*)\]([a-zA-Z0-9_ ]*)\[\/module\]/\\2\<\/a\>/g; - $_[0] =~ s/\[widget:([a-zA-Z0-9_]*)\]([a-zA-Z0-9_ ]*)\[\/widget\]/\\2\<\/a\>/g; - $_[0] =~ s/\[classfnc:([a-zA-Z0-9_]*)\]\$([a-zA-Z0-9_]*)\[\/classfnc\]/\\$\2\<\/a\>/g; - $_[0] =~ s/\[classfnc\]\$([a-zA-Z0-9_]*)\[\/classfnc\]/\\$\1\<\/a\>/g; - $_[0] =~ s/\[classsignal:([a-zA-Z0-9_]*)\]([a-zA-Z0-9_]*)\[\/classsignal\]/\\2\<\/a\>/g; - $_[0] =~ s/\[classsignal\]([a-zA-Z0-9_]*)\[\/classsignal\]/\\1\<\/a\>/g; - $_[0] =~ s/\[anchorlink:([a-zA-Z0-9_]*)\]/\/g; - $_[0] =~ s/\[\/anchorlink\]/\<\/a\>/g; - $_[0] =~ s/\[anchor:([a-zA-Z0-9_]*)\]/\/g; - $_[0] =~ s/\[\/anchor\]/\<\/a\>/g; - $_[0] =~ s/\[note\][ \n]*/

\\\\/g; - $_[0] =~ s/\[\/note\]/\<\/font\>\<\/td\>\<\/tr\>\<\/table\><\/p>/g; -} - -sub process_file -{ - my($docfilename); - my(%parts); - my($part); # Part title - my($partbody); - my($tabblock); - my($tmp); - my($type); - - - if(!open(CPPFILE,"$_[0]")) - { - return; - } - # Process the entire file - - while() - { - if(/^[ ]*\@doc:[ a-z_]*/) - { - # Process a single document block - - $docfilename="$_"; - $docfilename=~ s/[ ]*//g; - $docfilename=~ s/\@doc://g; - $docfilename=~ s/\n//g; - $docfilename=~ s/([a-zA-Z_]*)/\L\1/g; - - undef %parts; - $part = ""; - - INNERLOOP: while() - { - - if(/^[ ]*\*\/[ ]*/) - { - # End of comment - if(($part ne "") && ($partbody ne "") && ($partbody ne "\n")) - { - # We have an entire part to store - $parts{$part}="$partbody"; - } - last INNERLOOP; - } else { - # Inside a part - if(/^[ ]*\@[a-z]*:[ ]*/) - { - # A part title - if(($part ne "") && ($partbody ne "") && ($partbody ne "\n")) - { - # We have an entire part to store - $parts{$part}="$partbody"; - } - # Start of the part - # Extract the title - $part="$_"; - $part=~ s/[ ]*//g; - $part=~ s/\@//g; - $part=~ s/://g; - $part=~ s/\n//g; - # Clear the body (begin) - $partbody=""; - } else { - # Somewhere in a part body - if(($_ ne "") && ($_ ne "\n")) - { - if($partbody eq "") - { - # If it is the first line of the part body - # Extract the amount of tabs that the part has - # We will use it to remove the C++ indentation - $tabblock = "$_"; - $tabblock =~ s/^([ ]*).*/\1/g; - $tabblock =~ s/\n//g; - } - - if($tabblock ne "") - { - # If we have the initial tabblock , remove it from the line (remove indentation) - $_ =~ s/^$tabblock//g; - } - - process_body_line($_); - - $partbody="$partbody$_"; - } - } - } - } - - # Ok...we have a document in $parts - - # Process the title - if($parts{'title'} eq "") - { - print "Warning: no title specified for $docfilename\n"; - $parts{'title'}="No title specified"; - } - - make_single_token($parts{'title'}); - if($parts{'syntax'} ne "") - { - if($parts{'usage'} eq "") - { - $parts{'usage'} = build_usage_from_kvs_syntax($parts{'syntax'}) - } - } - make_syntax($parts{'usage'}); - make_syntax($parts{'syntax'}); - make_single_line($parts{'parameters'}); - make_single_line($parts{'inherits'}); - make_single_token($parts{'short'}); - make_single_token($parts{'window'}); - make_single_token($parts{'type'}); - - $parts{'type'}=~ s/\@//g; - $parts{'type'}=~ s/://g; - - if($parts{'type'} eq "") - { - $parts{'type'}="generic"; - } - - $type = $parts{'type'}; - - $tmp = $g_prefixes{$type}; - if($tmp eq "") - { - $tmp="doc"; - } - $docfilename="$tmp\_$docfilename"; - - if($g_shortsIdx{$type} eq "") - { - $g_shortsIdx{$type} = 0; - } - - $tmp="$type\_$g_shortsIdx{$type}"; - $g_shorts{$tmp}="$parts{'title'}$parts{'short'}$docfilename$g_fileextension"; - #print "$tmp, $g_shorts{$tmp}\n"; - $g_shortsIdx{$type}++; - - if($parts{'body'} ne "") - { - substitute_keyterms($parts{'body'},"$docfilename$g_fileextension"); - } - if($parts{'description'} ne "") - { - substitute_keyterms($parts{'description'},"$docfilename$g_fileextension"); - } - if($parts{'switches'} ne "") - { - substitute_keyterms($parts{'switches'},"$docfilename$g_fileextension"); - } - if(open(DOCFILE,">$g_directory/$docfilename$g_fileextension")) - { - $g_filehandle=DOCFILE; - - print_header($parts{'title'}); - print_tablestart(); - - print_title($parts{'title'},$parts{'short'}); - if($parts{'usage'} ne "") - { - print_entry("Usage","
$parts{'usage'}
"); - } - if($parts{'parameters'} ne "") - { - print_entry("Parameters","
$parts{'parameters'}
"); - } - - print_entry("Inherits","$parts{'inherits'}"); - print_entry("Window","$parts{'window'}"); - print_entry("","$parts{'body'}"); - print_entry("Description","$parts{'description'}"); - - if($parts{'switches'} ne "") - { - print_subtitle("Switches"); - - print DOCFILE "
\n"; - print DOCFILE " \n"; - print DOCFILE " \n"; - } - - - if($parts{'functions'} ne "") - { - print_subtitle("Functions"); - - print DOCFILE " \n"; - print DOCFILE " \n"; - print DOCFILE " \n"; - } - - if($parts{'signals'} ne "") - { - print_subtitle("Signals"); - - print DOCFILE " \n"; - print DOCFILE " \n"; - print DOCFILE " \n"; - } - - if($parts{'syntax'} ne "") - { - process_kvs_syntax($parts{'syntax'}); - print_entry("Syntax Specification","
$parts{'syntax'}
"); - } - - print_entry("Examples","$parts{'examples'}"); - print_entry("See also","$parts{'seealso'}"); - print_tableend(); - - - if($parts{'type'} eq "command") - { - print DOCFILE "
Index, Commands\n"; - } elsif($parts{'type'} eq "function") - { - print DOCFILE "
Index, Functions\n"; - } elsif($parts{'type'} eq "event") - { - print DOCFILE "
Index, Events\n"; - } elsif($parts{'type'} eq "generic") - { - print DOCFILE "
Index, Miscellaneous\n"; - } elsif($parts{'type'} eq "language") - { - print DOCFILE "
Index, Language Overview\n"; - } elsif($parts{'type'} eq "class") - { - print DOCFILE "
Index, Object Classes\n"; - } elsif($parts{'type'} eq "module") - { - print DOCFILE "
Index, Modules\n"; - } elsif($parts{'type'} eq "widget") - { - print DOCFILE "
Index, Features\n"; - } - - print_footer(DOCFILE); - - close(DOCFILE); - } else { print "Can't open $g_directory/$docfilename$g_fileextension for writing\n"; } - } - } - - close(CPPFILE); -} - - -################################################################################################# -# COMMAND/FUNCTION.... INDEXES -################################################################################################# - -sub generate_indexes -{ - my(@oldCommands); - my(@commands); - my(@sortedCommands); - my(@chars); - my($alllinks); - my($upcase); - my($count); - - my($doctitle); - my($category); - my($number); - - $doctitle = $_[0]; - $category = $_[1]; - $number = $_[2]; - - #print("Generating indexes for $doctitle $category $number\n"); - - ###################################################### - # generate some helper stuff (alphabetic index links) - - @chars=("\$","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"); - - $i = 0; - - $alllinks="
\n"; - print DOCFILE " \n"; - - @lines = split("\n","$parts{'switches'}"); - $swbody = ""; - for(@lines) - { - if(/!sw:.*/) - { - if("$swbody" ne "") - { - print DOCFILE "\n"; - $swbody = ""; - } - $_ =~ s/!sw:[ ]*//g; - $_ =~ s/^[ ]*//g; - $_ =~ s/\n//gs; - $tmp = $_; - $tmp =~ s/\(.*\)//g; - $tmp =~ s/\$//g; - print DOCFILE "\n"; - } else { - if($swbody ne "") - { - $swbody="$swbody $_"; - } else { - $swbody="$_"; - } - } - - } - if("$swbody" ne "") - { - print DOCFILE "\n"; - } - - print DOCFILE "
$swbody
$_
$swbody
\n"; - print DOCFILE "
\n"; - print DOCFILE " \n"; - - @lines = split("\n","$parts{'functions'}"); - $fncbody = ""; - for(@lines) - { - if(/!fn:.*/) - { - if("$fncbody" ne "") - { - print DOCFILE "\n"; - $fncbody = ""; - } - $_ =~ s/!fn:[ ]*//g; - $_ =~ s/^[ ]*//g; - $_ =~ s/\n//gs; - $tmp = $_; - $tmp =~ s/\(.*\)//g; - $tmp =~ s/\$//g; - print DOCFILE "\n"; - } else { - if($fncbody ne "") - { - $fncbody="$fncbody $_"; - } else { - $fncbody="$_"; - } - } - - } - if("$fncbody" ne "") - { - print DOCFILE "\n"; - } - - print DOCFILE "
$fncbody
$_
$fncbody
\n"; - print DOCFILE "
\n"; - print DOCFILE " \n"; - - @lines = split("\n","$parts{'signals'}"); - $sigbody = ""; - for(@lines) - { - if(/!sg:.*/) - { - if("$sigbody" ne "") - { - print DOCFILE "\n"; - $sigbody = ""; - } - $_ =~ s/!sg:[ ]*//g; - $_ =~ s/^[ ]*//g; - $_ =~ s/\n//gs; - $tmp = $_; - $tmp =~ s/\(.*\)//g; - $tmp =~ s/\$//g; - print DOCFILE "\n"; - } else { - if($sigbody ne "") - { - $sigbody="$sigbody $_"; - } else { - $sigbody="$_"; - } - } - - } - if("$sigbody" ne "") - { - print DOCFILE "\n"; - } - - print DOCFILE "
$sigbody
$_
$sigbody
\n"; - print DOCFILE "
"; - - for(@chars) - { - $alllinks = "$alllinks \n"; - $i++; - if($i > 13) - { - $i = 0; - $alllinks = "$alllinks\n"; - } - } - - $alllinks ="$alllinks
$_
All
"; - - ##################################### - # Simple plain long index - - $i=0; - - undef %terms; - - while($i < $g_shortsIdx{$category}) - { - $tmp="$category\_$i"; - ($cmd,$short,$link) = split("",$g_shorts{$tmp}); - $terms{$cmd} = "1"; - $commands[$i]=$g_shorts{$tmp}; - $commands[$i] =~ s/\n//g; - $i++; - } - - ##################################### - # Load the other terms from the db (if there) - # Make sure that we do not overwrite the current entries - if(open(OLDDB,"$g_directory/_db_$category.idx")) - { - while() - { - $_ =~ s/\n//g; - if($_ ne "") - { - ($cmd,$short,$link) = split("",$_); - if($terms{$cmd} ne "1") - { - $terms{$cmd} = "1"; - $commands[$i]=$_; - $i++; - } - } - } - close(OLDDB); - } - - $count = $i; - - - ##################################### - # Re-dump them - if(open(OLDDB,"> $g_directory/_db_$category.idx")) - { - $i = 0; - while($i < $count) - { - print OLDDB "$commands[$i]\n"; - $i++; - } - close(OLDDB); - } - - @sortedCommands = sort @commands; - - if(open(CMDINDEX,">$g_directory/doc_$category\_index_all$g_fileextension")) - { - $g_filehandle=CMDINDEX; - - print_header("$doctitle: All"); - print_tablestart(); - print_title("$doctitle: All",""); - print_tableend(); - - print_tablestart(); - print_body($alllinks); - print_tableend(); - - print_tablestart(); - - $i=0; - - while($i < $count) - { - ($cmd,$short,$link) = split("",$sortedCommands[$i]); - $link =~ s/([a-zA-Z_]*)/\L\1/g; - print_twocolumnbody("$cmd",$short); - $i++; - } - - print_tableend(); - - print_tablestart(); - print_body($alllinks); - print_tableend(); - - print_footer(); - - close(CMDINDEX); - } else { - print "Can't open $g_directory/doc_$category\_index_all$g_fileextension for writing\n"; - } - - - ####################### - # Alphabetic - - for(@chars) - { - if(open(CMDINDEX,">$g_directory/doc_$category\_alphabetic_$_$g_fileextension")) - { - - $upcase=$_; - $upcase=~ tr/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/; - - - $g_filehandle=CMDINDEX; - - print_header("$doctitle: $_"); - print_tablestart(); - print_title("$doctitle: $_",""); - print_tableend(); - - print_tablestart(); - print_body($alllinks); - print_tableend(); - - print_tablestart(); - - $i=0; - $j=0; - if($number > 0) - { - #print("NUMBER > 0,COUNT = $count\n"); - while($i < $count) - { - ($cmd,$short,$link) = split("",$sortedCommands[$i]); - #$left=substr($cmd,0,$number); - #$right=$cmd; - #$right=~ s/^$left//; - $left = substr($cmd,0,$number); - $right = substr($cmd,$number); - $link =~ s/([a-zA-Z_]*)/\L\1/g; - - - #print("RIGHT=$right,_=$_,LEFT=$left,UPCASE=$upcase\n"); - - if(($right =~ /^$_/) or ($right =~ /^$upcase/) or ($right eq $_)) - { - $j++; - print_twocolumnbody("$left$right",$short); - } - $i++; - } - - } else { - #print("NUMBER == 0,COUNT = $count\n"); - while($i < $count) - { - ($cmd,$short,$link) = split("",$sortedCommands[$i]); - $link =~ s/([a-zA-Z_]*)/\L\1/g; - if(($cmd =~ /^$_/) || ($cmd =~ /^$upcase/)) - { - $j++; - print_twocolumnbody("$cmd",$short); - } - $i++; - } - } - - if($j == 0) - { - print_body("No matches"); - } - - print_tableend(); - - print_tablestart(); - print_body($alllinks); - print_tableend(); - - print_footer(); - - close(CMDINDEX); - } else { - print "Can't open $g_directory/doc_$category\_alphabetic_$_$g_fileextension for writing\n"; - } - } -} - -################################################################################################# -# MAIN -################################################################################################# - -# Force flusing of STDOUT -$|=1; - -print "*\n"; -print "* Generating documentation, this may take a while :)\n"; -print "*\n"; -print "* Extracting keyterms\n"; -# Extract the keywords to generate the crossreferences -$i = 0; - -while($g_filesToProcess[$i] ne "") -{ - print "."; - extract_keyterms($g_filesToProcess[$i]); - $i++; -} - -$g_files=$i - 1; - -print "\n"; -print "* Extracting documents and generating crossreferences\n"; - -# Sort them -@g_keytermsSorted = sort {length($b) <=> length($a)} keys(%g_keyterms); - -# Process the files now -$i = 0; - -while($g_filesToProcess[$i] ne "") -{ - print "."; - process_file($g_filesToProcess[$i]); - $i++; -} - -print "\n"; -print "* Generating indexes\n"; - -print "."; -generate_indexes("Commands","command",0); -print "."; -generate_indexes("Functions","function",1); -print "."; -generate_indexes("Modules","module",0); -print "."; -generate_indexes("Classes","class",0); -print "."; -generate_indexes("Events","event",2); -print "."; -generate_indexes("Language Documentation","language",0); -print "."; -generate_indexes("Features","widget",0); -print "."; -generate_indexes("Misc. Documentation","generic",0); -print "."; -generate_indexes("Keyterms & Concepts","keyterms",0); -print "."; - -if(open(DOCINDEX,">$g_directory/index$g_fileextension")) -{ - $g_filehandle=DOCINDEX; - print_header("Documentation Index"); - print_tablestart(); - print_twocolumntitle("Index",""); - print_twocolumnsubtitle("Fundamentals"); - print_twocolumnbody("Introduction to IRC","A \"must read\" for beginners"); - print_twocolumnbody("Introduction to KVIrc","A couple of words about KVIrc"); - - print_twocolumnsubtitle("Scripting Concepts: The KVS Manual"); - print_twocolumnbody("Introduction to KVS","Introduction to the KVIrc Scripting Language"); - print_twocolumnbody("Basic KVS Concepts","The first steps in the KVS world"); - print_twocolumnbody("Aliases and Functions","How to write aliases/functions"); - print_twocolumnbody("Variables","Which types of variables are available and how to handle them"); - print_twocolumnbody("Operators","Describes simple operations with variables"); - print_twocolumnbody("Events","How to handle network events in KVS ?"); - print_twocolumnbody("Objects","Object oriented scripting"); - print_twocolumnbody("Addons","How to write nice addons for KVIrc"); - print_twocolumnbody("Coding Tips","Some tips that may help you"); - print_twocolumnbody("All the language documents","All the documents related to KVS"); - - print_twocolumnsubtitle("Scripting Reference"); - print_twocolumnbody("Commands","The listing of available commands"); - print_twocolumnbody("Functions","The listing of available functions"); - print_twocolumnbody("Events","The listing of available events"); - print_twocolumnbody("Object Classes","The listing of available object classes"); - print_twocolumnsubtitle("Other Documents"); - print_twocolumnbody("Keyboard shortcuts","Map of the global keyboard shortcuts"); - print_twocolumnbody("Modules","Documentation related to specific modules"); - print_twocolumnbody("Features"," "); - print_twocolumnbody("Miscellaneous","Misc documentation that didn't find any other place"); - print_twocolumnbody("Keyterms","The (long) listing of all the keyterms"); - print_tableend(); - print_footer(); - - close(DOCINDEX); -} else { - print "Can't open $g_directory/index$g_fileextension for writing\n"; -} - -if(open(NOHELP,">$g_directory/nohelpavailable$g_fileextension")) -{ - $g_filehandle=NOHELP; - print_header("No help available"); - - print_tablestart(); - print_title("No help available",""); - print_tableend(); - - print $g_filehandle "

Sorry :(
Unfortunately there is no documentation related to the item you have selected


\n"; - print $g_filehandle "Please try a different search term or take a look at the documentation index "; - print $g_filehandle "and try to locate the topic manually.


"; - print_footer(); - close(NOHELP); -} else { - printf "Can't open $g_directory/nohelpavailable$g_fileextension for writing\n"; -} - -print "\n"; -print "*\n"; -print "* Done! (Processed $g_files files)\n"; -print "*\n"; diff --git a/3.4.0/admin/gensrc.pl b/3.4.0/admin/gensrc.pl deleted file mode 100644 index 2668cbdea4..0000000000 --- a/3.4.0/admin/gensrc.pl +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/perl - -$name = $ARGV[0]; - -if($name eq "") -{ - print "Usage: gensrc \n"; - exit; -} - -$bIsHeader = 0; -$ifdefname = $name; -$ifdefname =~ tr/a-z/A-Z/; -$ifdefname =~ s/\./_/; -$ifdefname = "_$ifdefname\_"; - -if(open(THEFILE,">$name")) -{ - $_ = $name; - if(/[A-Za-z_]*.h/) - { - $bIsHeader = 1; - } - - - if($bIsHeader) - { - print THEFILE "#ifndef $ifdefname\n"; - print THEFILE "#define $ifdefname\n"; - } - - $thetime = gmtime; - - print THEFILE "//\n"; - print THEFILE "// File : $name\n"; - print THEFILE "// Creation date : $thetime GMT by Szymon Stefanek\n"; - print THEFILE "//\n"; - print THEFILE "// This file is part of the KVirc irc client distribution\n"; - print THEFILE "// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)\n"; - print THEFILE "//\n"; - print THEFILE "// This program is FREE software. You can redistribute it and/or\n"; - print THEFILE "// modify it under the terms of the GNU General Public License\n"; - print THEFILE "// as published by the Free Software Foundation; either version 2\n"; - print THEFILE "// of the License, or (at your opinion) any later version.\n"; - print THEFILE "//\n"; - print THEFILE "// This program is distributed in the HOPE that it will be USEFUL,\n"; - print THEFILE "// but WITHOUT ANY WARRANTY; without even the implied warranty of\n"; - print THEFILE "// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"; - print THEFILE "// See the GNU General Public License for more details.\n"; - print THEFILE "//\n"; - print THEFILE "// You should have received a copy of the GNU General Public License\n"; - print THEFILE "// along with this program. If not, write to the Free Software Foundation,\n"; - print THEFILE "// Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"; - print THEFILE "//\n"; - print THEFILE "\n"; - - if($bIsHeader) - { - print THEFILE "\n"; - print THEFILE "#endif //$ifdefname\n"; - } - - close(THEFILE); -} else { - print "No way to open the file $name\n"; -} - diff --git a/3.4.0/admin/install-sh b/3.4.0/admin/install-sh deleted file mode 100755 index 4d4a9519ea..0000000000 --- a/3.4.0/admin/install-sh +++ /dev/null @@ -1,323 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2005-05-14.22 - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -chmodcmd="$chmodprog 0755" -chowncmd= -chgrpcmd= -stripcmd= -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src= -dst= -dir_arg= -dstarg= -no_target_directory= - -usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: --c (ignored) --d create directories instead of installing files. --g GROUP $chgrpprog installed files to GROUP. --m MODE $chmodprog installed files to MODE. --o USER $chownprog installed files to USER. --s $stripprog installed files. --t DIRECTORY install into DIRECTORY. --T report an error if DSTFILE is a directory. ---help display this help and exit. ---version display version info and exit. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG -" - -while test -n "$1"; do - case $1 in - -c) shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - --help) echo "$usage"; exit $?;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -s) stripcmd=$stripprog - shift - continue;; - - -t) dstarg=$2 - shift - shift - continue;; - - -T) no_target_directory=true - shift - continue;; - - --version) echo "$0 $scriptversion"; exit $?;; - - *) # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - test -n "$dir_arg$dstarg" && break - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dstarg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dstarg" - shift # fnord - fi - shift # arg - dstarg=$arg - done - break;; - esac -done - -if test -z "$1"; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src ;; - esac - - if test -n "$dir_arg"; then - dst=$src - src= - - if test -d "$dst"; then - mkdircmd=: - chmodcmd= - else - mkdircmd=$mkdirprog - fi - else - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dstarg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dstarg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst ;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dstarg: Is a directory" >&2 - exit 1 - fi - dst=$dst/`basename "$src"` - fi - fi - - # This sed command emulates the dirname command. - dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` - - # Make sure that the destination directory exists. - - # Skip lots of stat calls in the usual case. - if test ! -d "$dstdir"; then - defaultIFS=' - ' - IFS="${IFS-$defaultIFS}" - - oIFS=$IFS - # Some sh's can't handle IFS=/ for some reason. - IFS='%' - set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` - shift - IFS=$oIFS - - pathcomp= - - while test $# -ne 0 ; do - pathcomp=$pathcomp$1 - shift - if test ! -d "$pathcomp"; then - $mkdirprog "$pathcomp" - # mkdir can fail with a `File exist' error in case several - # install-sh are creating the directory concurrently. This - # is OK. - test -d "$pathcomp" || exit - fi - pathcomp=$pathcomp/ - done - fi - - if test -n "$dir_arg"; then - $doit $mkdircmd "$dst" \ - && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } - - else - dstfile=`basename "$dst"` - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - trap '(exit $?); exit' 1 2 13 15 - - # Copy the file name to the temp name. - $doit $cpprog "$src" "$dsttmp" && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && - - # Now rename the file to the real destination. - { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ - || { - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - if test -f "$dstdir/$dstfile"; then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ - || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ - || { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit 1 - } - else - : - fi - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" - } - } - fi || { (exit 1); exit 1; } -done - -# The final little trick to "correctly" pass the exit status to the exit trap. -{ - (exit 0); exit 0 -} - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/3.4.0/admin/libtool-norelink.diff b/3.4.0/admin/libtool-norelink.diff deleted file mode 100644 index cab6261f6d..0000000000 --- a/3.4.0/admin/libtool-norelink.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- libtool.orig 2005-01-08 20:19:50.000000000 +0100 -+++ libtool 2005-01-08 20:30:14.000000000 +0100 -@@ -5777,6 +5777,9 @@ - */* | *\\*) . $file ;; - *) . ./$file ;; - esac -+ -+ echo "Pragma: killing the relink command" -+ relink_command= - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then diff --git a/3.4.0/admin/libtool.m4.in b/3.4.0/admin/libtool.m4.in deleted file mode 100644 index c3b71e8932..0000000000 --- a/3.4.0/admin/libtool.m4.in +++ /dev/null @@ -1,6000 +0,0 @@ -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 -## Free Software Foundation, Inc. -## Originally by Gordon Matzigkeit , 1996 -## -## 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. -## -## As a special exception to the GNU General Public License, if you -## distribute this file as part of a program that contains a -## configuration script generated by Autoconf, you may include it under -## the same distribution terms that you use for the rest of that program. - -# serial 47 AC_PROG_LIBTOOL - - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -m4_ifdef([AC_PROVIDE_IFELSE], - [], - [m4_define([AC_PROVIDE_IFELSE], - [m4_ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) -dnl And a similar setup for Fortran 77 support - AC_PROVIDE_IFELSE([AC_PROG_F77], - [AC_LIBTOOL_F77], - [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], - defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -])])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.50)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] - -# Same as above, but do not quote variable references. -[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" - ;; - *) - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -AC_ARG_WITH([pic], - [AC_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP - - -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_AC_SYS_COMPILER - - -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX - - -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT - - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null 2>&1 && unset CDPATH - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string="`eval $cmd`") 2>/dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; - ]) -esac - -need_locks="$enable_libtool_lock" - -])# _LT_AC_LOCK - - -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_REQUIRE([LT_AC_PROG_SED]) -AC_CACHE_CHECK([$1], [$2], - [$2=no - ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then - $2=yes - fi - fi - $rm conftest* -]) - -if test x"[$]$2" = xyes; then - ifelse([$5], , :, [$5]) -else - ifelse([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION - - -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - else - $2=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - ifelse([$4], , :, [$4]) -else - ifelse([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION - - -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* ) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for *BSD - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - ;; - - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -])# AC_LIBTOOL_SYS_MAX_CMD_LEN - - -# _LT_AC_CHECK_DLFCN -# -------------------- -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h)dnl -])# _LT_AC_CHECK_DLFCN - - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ------------------------------------------------------------------ -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_unknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - - -# AC_LIBTOOL_DLOPEN_SELF -# ------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -])# AC_LIBTOOL_DLOPEN_SELF - - -# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) -# --------------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler -AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s out/conftest.err; then - _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* -]) -])# AC_LIBTOOL_PROG_CC_C_O - - -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- -# Check to see if we can do hard links to lock some files if needed -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([_LT_AC_LOCK])dnl - -hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS - - -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -])# AC_LIBTOOL_OBJDIR - - -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- -# Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH - - -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -])# AC_LIBTOOL_SYS_LIB_STRIP - - -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- -# PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_MSG_CHECKING([dynamic linker characteristics]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case "$host_cpu" in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER - - -# _LT_AC_TAGCONFIG -# ---------------- -AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_ARG_WITH([tags], - [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], - [include additional configurations @<:@automatic@:>@])], - [tagnames="$withval"]) - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - AC_MSG_WARN([output file `$ofile' does not exist]) - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) - else - AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) - fi - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in - "") ;; - *) AC_MSG_ERROR([invalid tag name: $tagname]) - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - AC_MSG_ERROR([tag name \"$tagname\" already exists]) - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_LIBTOOL_LANG_CXX_CONFIG - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - AC_LIBTOOL_LANG_F77_CONFIG - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - AC_LIBTOOL_LANG_GCJ_CONFIG - else - tagname="" - fi - ;; - - RC) - AC_LIBTOOL_LANG_RC_CONFIG - ;; - - *) - AC_MSG_ERROR([Unsupported tag name: $tagname]) - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - AC_MSG_ERROR([unable to update list of available tagged configurations.]) - fi -fi -])# _LT_AC_TAGCONFIG - - -# AC_LIBTOOL_DLOPEN -# ----------------- -# enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], - [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_DLOPEN - - -# AC_LIBTOOL_WIN32_DLL -# -------------------- -# declare package support for building win32 dll's -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_WIN32_DLL - - -# AC_ENABLE_SHARED([DEFAULT]) -# --------------------------- -# implement the --enable-shared flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([shared], - [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]AC_ENABLE_SHARED_DEFAULT) -])# AC_ENABLE_SHARED - - -# AC_DISABLE_SHARED -# ----------------- -#- set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no) -])# AC_DISABLE_SHARED - - -# AC_ENABLE_STATIC([DEFAULT]) -# --------------------------- -# implement the --enable-static flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([static], - [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]AC_ENABLE_STATIC_DEFAULT) -])# AC_ENABLE_STATIC - - -# AC_DISABLE_STATIC -# ----------------- -# set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no) -])# AC_DISABLE_STATIC - - -# AC_ENABLE_FAST_INSTALL([DEFAULT]) -# --------------------------------- -# implement the --enable-fast-install flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([fast-install], - [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) -])# AC_ENABLE_FAST_INSTALL - - -# AC_DISABLE_FAST_INSTALL -# ----------------------- -# set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no) -])# AC_DISABLE_FAST_INSTALL - - -# AC_LIBTOOL_PICMODE([MODE]) -# -------------------------- -# implement the --with-pic flag -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default) -])# AC_LIBTOOL_PICMODE - - -# AC_PROG_EGREP -# ------------- -# This is predefined starting with Autoconf 2.54, so this conditional -# definition can be removed once we require Autoconf 2.54 or later. -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], -[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], - [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi]) - EGREP=$ac_cv_prog_egrep - AC_SUBST([EGREP]) -])]) - - -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -])# AC_PATH_TOOL_PREFIX - - -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# AC_PATH_MAGIC - - -# AC_PROG_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], - [AC_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case "$host_cpu" in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown -])# AC_DEPLIBS_CHECK_METHOD - - -# AC_PROG_NM -# ---------- -# find the pathname to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/${ac_tool_prefix}nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - esac - fi - done - IFS="$lt_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -])# AC_PROG_NM - - -# AC_CHECK_LIBM -# ------------- -# check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -])# AC_CHECK_LIBM - - -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL -# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If -# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will -# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE - - -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that LIBLTDL -# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If -# DIRECTORY is not provided and an installed libltdl is not found, it is -# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' -# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single -# quotes!). If your package is not flat and you're not using automake, -# define top_builddir and top_srcdir appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, lt_dlinit, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE - - -# AC_LIBTOOL_CXX -# -------------- -# enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], -[AC_REQUIRE([_LT_AC_LANG_CXX]) -])# AC_LIBTOOL_CXX - - -# _LT_AC_LANG_CXX -# --------------- -AC_DEFUN([_LT_AC_LANG_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) -])# _LT_AC_LANG_CXX - -# _LT_AC_PROG_CXXCPP -# --------------- -AC_DEFUN([_LT_AC_PROG_CXXCPP], -[ -AC_REQUIRE([AC_PROG_CXX]) -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -fi -])# _LT_AC_PROG_CXXCPP - -# AC_LIBTOOL_F77 -# -------------- -# enable support for Fortran 77 libraries -AC_DEFUN([AC_LIBTOOL_F77], -[AC_REQUIRE([_LT_AC_LANG_F77]) -])# AC_LIBTOOL_F77 - - -# _LT_AC_LANG_F77 -# --------------- -AC_DEFUN([_LT_AC_LANG_F77], -[AC_REQUIRE([AC_PROG_F77]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) -])# _LT_AC_LANG_F77 - - -# AC_LIBTOOL_GCJ -# -------------- -# enable support for GCJ libraries -AC_DEFUN([AC_LIBTOOL_GCJ], -[AC_REQUIRE([_LT_AC_LANG_GCJ]) -])# AC_LIBTOOL_GCJ - - -# _LT_AC_LANG_GCJ -# --------------- -AC_DEFUN([_LT_AC_LANG_GCJ], -[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], - [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], - [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], - [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) -])# _LT_AC_LANG_GCJ - - -# AC_LIBTOOL_RC -# -------------- -# enable support for Windows resource files -AC_DEFUN([AC_LIBTOOL_RC], -[AC_REQUIRE([LT_AC_PROG_RC]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) -])# AC_LIBTOOL_RC - - -# AC_LIBTOOL_LANG_C_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -AC_DEFUN([_LT_AC_LANG_C_CONFIG], -[lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - -_LT_AC_SYS_COMPILER - -# -# Check for any special shared library compilation flags. -# -_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= -if test "$GCC" = no; then - case $host_os in - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' - ;; - esac -fi -if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then - AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) - if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : - else - AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) - _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no - fi -fi - - -# -# Check to make sure the static flag actually works. -# -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) - - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF($1) - -# Report which librarie types wil actually be built -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -AC_MSG_CHECKING([whether to build shared libraries]) -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case "$host_os" in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) - -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_C_CONFIG - - -# AC_LIBTOOL_LANG_CXX_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -[AC_LANG_PUSH(C++) -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= - -# Source file extension for C++ test sources. -ac_ext=cc - -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - AC_PROG_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -_LT_AC_TAGVAR(ld_shlibs, $1)=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds it's shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - darwin* | rhapsody*) - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case "$cc_basename" in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[12]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd* | kfreebsd*-gnu) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC) - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case "$host_cpu" in - ia64*|hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - irix5* | irix6*) - case $cc_basename in - CC) - # SGI C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - linux*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - cxx) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ - $rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sco*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$GXX" -_LT_AC_TAGVAR(LD, $1)="$LD" - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -AC_LIBTOOL_POSTDEP_PREDEP($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -])# AC_LIBTOOL_LANG_CXX_CONFIG - -# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -# ------------------------ -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" -ifelse([$1], [], -[#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# 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. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG], -[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) - -# Is the compiler the GNU C compiler? -with_gcc=$_LT_AC_TAGVAR(GCC, $1) - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_[]_LT_AC_TAGVAR(LD, $1) - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) - -# Must we lock files when doing compilation ? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) - -# Commands used to build and install a shared archive. -archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" - -# Set to yes if exported symbols are required. -always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) - -# The commands to list exported symbols. -export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) - -# Symbols that must always be exported. -include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) - -ifelse([$1],[], -[# ### END LIBTOOL CONFIG], -[# ### END LIBTOOL TAG CONFIG: $tagname]) - -__EOF__ - -ifelse([$1],[], [ - case $host_os in - aix3*) - cat <<\EOF >> "$cfgfile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -]) -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi -])# AC_LIBTOOL_CONFIG - - -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl - -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI - - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux*) - if test "$host_cpu" = ia64; then - symcode='[[ABCDGIRSTW]]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris* | sysv5*) - symcode='[[BDRT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - - -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) - ifelse([$1],[CXX],[ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case "$cc_basename" in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - cxx) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx) - # Digital/Compaq C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - sco*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - *) - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - unixware*) - ;; - vxworks*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case "$cc_basename" in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - linux*) - case $CC in - icc* | ecc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - ccc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' - ;; - - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -case "$host_os" in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" - ;; -esac -]) - - -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -],[ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_AC_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds" - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - if test $supports_anon_versioning = yes; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ -cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ -$echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds" - fi - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds it's shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - bsdi[[45]]*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case "$cc_basename" in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - sco3.2v5*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4.2uw2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv5*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac -])# AC_LIBTOOL_PROG_LD_SHLIBS - - -# _LT_AC_FILE_LTDLL_C -# ------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ -])# _LT_AC_FILE_LTDLL_C - - -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) - - -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) - -AC_DEFUN([LT_AC_PROG_GCJ], -[AC_CHECK_TOOL(GCJ, gcj, no) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS) -]) - -AC_DEFUN([LT_AC_PROG_RC], -[AC_CHECK_TOOL(RC, windres, no) -]) - -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ -# LT_AC_PROG_SED -# -------------- -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([LT_AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && break - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_MSG_RESULT([$SED]) -]) diff --git a/3.4.0/admin/libtool/.svnignore b/3.4.0/admin/libtool/.svnignore deleted file mode 100644 index 3dda72986f..0000000000 --- a/3.4.0/admin/libtool/.svnignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile.in -Makefile diff --git a/3.4.0/admin/libtool/Makefile.am b/3.4.0/admin/libtool/Makefile.am deleted file mode 100644 index 800f1f5fca..0000000000 --- a/3.4.0/admin/libtool/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST = ltmain.sh config.guess config.sub diff --git a/3.4.0/admin/libtool/config.guess b/3.4.0/admin/libtool/config.guess deleted file mode 100755 index 500ee74b04..0000000000 --- a/3.4.0/admin/libtool/config.guess +++ /dev/null @@ -1,1410 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - -timestamp='2003-10-03' - -# This file 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. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mipseb-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha*:OpenVMS:*:*) - echo alpha-hp-vms - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit 0;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit 0 ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7 && exit 0 ;; - esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c \ - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && exit 0 - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit 0 ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit 0 ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - *:UNICOS/mp:*:*) - echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) - # Determine whether the default compiler uses glibc. - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #if __GLIBC__ >= 2 - LIBC=gnu - #else - LIBC= - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - # GNU/FreeBSD systems have a "k" prefix to indicate we are using - # FreeBSD's kernel, but not the complete OS. - case ${LIBC} in gnu) kernel_only='k' ;; esac - echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit 0 ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit 0 ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit 0 ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit 0 ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit 0 ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit 0 ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit 0 ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit 0 ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #ifdef __INTEL_COMPILER - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit 0 ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit 0 ;; - i*86:*:5:[78]*) - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit 0 ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit 0 ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit 0 ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Darwin:*:*) - case `uname -p` in - *86) UNAME_PROCESSOR=i686 ;; - powerpc) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit 0 ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit 0 ;; - NSR-[DGKLNPTVWY]:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit 0 ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit 0 ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit 0 ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit 0 ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit 0 ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit 0 ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit 0 ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit 0 ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit 0 ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/3.4.0/admin/libtool/config.sub b/3.4.0/admin/libtool/config.sub deleted file mode 100755 index 1f31816b97..0000000000 --- a/3.4.0/admin/libtool/config.sub +++ /dev/null @@ -1,1510 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - -timestamp='2003-08-18' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file 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. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit 0;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32r | m68000 | m68k | m88k | mcore \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | msp430 \ - | ns16k | ns32k \ - | openrisc | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ - | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xscale | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ - | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32r-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | msp430-* \ - | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - crds | unos) - basic_machine=m68k-crds - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - mmix*) - basic_machine=mmix-knuth - os=-mmixware - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nv1) - basic_machine=nv1-cray - os=-unicosmp - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - or32 | or32-*) - basic_machine=or32-unknown - os=-coff - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv9 | sparcv9b) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-ibm) - os=-aix - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/3.4.0/admin/libtool/ltmain.sh b/3.4.0/admin/libtool/ltmain.sh deleted file mode 100644 index 761e1fd509..0000000000 --- a/3.4.0/admin/libtool/ltmain.sh +++ /dev/null @@ -1,6402 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 -# Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# 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. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -basename="s,^.*/,,g" - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - -# The name of this program: -progname=`echo "$progpath" | $SED $basename` -modename="$progname" - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION=1.5.10 -TIMESTAMP=" (1.1220.2.130 2004/09/19 12:13:49)" - -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes. -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" - -##################################### -# Shell function definitions: -# This seems to be the best place for them - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -func_win32_libid () { - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ - $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | \ - sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` - if test "X$win32_nmres" = "Ximport" ; then - win32_libid_type="x86 archive import" - else - win32_libid_type="x86 archive static" - fi - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $echo $win32_libid_type -} - - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () { - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case "$@ " in - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit $EXIT_FAILURE -# else -# $echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - fi -} - - -# func_extract_archives gentop oldlib ... -func_extract_archives () { - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - my_status="" - - $show "${rm}r $my_gentop" - $run ${rm}r "$my_gentop" - $show "$mkdir $my_gentop" - $run $mkdir "$my_gentop" - my_status=$? - if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then - exit $my_status - fi - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` - my_xdir="$my_gentop/$my_xlib" - - $show "${rm}r $my_xdir" - $run ${rm}r "$my_xdir" - $show "$mkdir $my_xdir" - $run $mkdir "$my_xdir" - status=$? - if test "$status" -ne 0 && test ! -d "$my_xdir"; then - exit $status - fi - case $host in - *-darwin*) - $show "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - if test -z "$run"; then - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`basename $darwin_archive` - darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` - if test -n "$darwin_arches"; then - darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - $show "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - # Remove the table of contents from the thin files. - $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true - $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - $AR -xo "${darwin_base_archive}" - rm "${darwin_base_archive}" - cd "$darwin_curdir" - done # $darwin_arches - ## Okay now we have a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` - lipo -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - rm -rf unfat-$$ - cd "$darwin_orig_dir" - else - cd $darwin_orig_dir - (cd $my_xdir && $AR x $my_xabs) || exit $? - fi # $darwin_arches - fi # $run - ;; - *) - # We will extract separately just the conflicting names and we will - # no longer touch any unique names. It is faster to leave these - # extract automatically by $AR in one run. - $show "(cd $my_xdir && $AR x $my_xabs)" - $run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $? - if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 - $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 - $AR t "$my_xabs" | sort | uniq -cd | while read -r count name - do - i=1 - while test "$i" -le "$count" - do - # Put our $i before any first dot (extension) - # Never overwrite any file - name_to="$name" - while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to" - do - name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` - done - $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')" - $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $? - i=`expr $i + 1` - done - done - fi - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - - func_extract_archives_result="$my_oldobjs" -} -# End of Shell function definitions -##################################### - -# Darwin sucks -eval std_shrext=\"$shrext_cmds\" - -# Parse our command line options once, thoroughly. -while test "$#" -gt 0 -do - arg="$1" - shift - - case $arg in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; - tag) - tagname="$arg" - preserve_args="${preserve_args}=$arg" - - # Check whether tagname contains only valid characters - case $tagname in - *[!-_A-Za-z0-9,/]*) - $echo "$progname: invalid tag name: $tagname" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $tagname in - CC) - # Don't test for the "default" C tag, as we know, it's there, but - # not specially marked. - ;; - *) - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then - taglist="$taglist $tagname" - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" - else - $echo "$progname: ignoring unknown tag $tagname" 1>&2 - fi - ;; - esac - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case $arg in - --help) - show_help=yes - ;; - - --version) - $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - $echo - $echo "Copyright (C) 2003 Free Software Foundation, Inc." - $echo "This is free software; see the source for copying conditions. There is NO" - $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - exit $EXIT_SUCCESS - ;; - - --config) - ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath - # Now print the configurations for the tags. - for tagname in $taglist; do - ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" - done - exit $EXIT_SUCCESS - ;; - - --debug) - $echo "$progname: enabling shell trace mode" - set -x - preserve_args="$preserve_args $arg" - ;; - - --dry-run | -n) - run=: - ;; - - --features) - $echo "host: $host" - if test "$build_libtool_libs" = yes; then - $echo "enable shared libraries" - else - $echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - $echo "enable static libraries" - else - $echo "disable static libraries" - fi - exit $EXIT_SUCCESS - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --preserve-dup-deps) duplicate_deps="yes" ;; - - --quiet | --silent) - show=: - preserve_args="$preserve_args $arg" - ;; - - --tag) prevopt="--tag" prev=tag ;; - --tag=*) - set tag "$optarg" ${1+"$@"} - shift - prev=tag - preserve_args="$preserve_args --tag" - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE -fi - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 - $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 - case $nonopt in - *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) - mode=link - for arg - do - case $arg in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case $mode in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - - for arg - do - case "$arg_mode" in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - if test -n "$libobj" ; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit $EXIT_FAILURE - fi - arg_mode=target - continue - ;; - - -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - lastarg="$lastarg $arg" - done - IFS="$save_ifs" - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - - # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" - continue - ;; - - * ) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - case $lastarg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - lastarg="\"$lastarg\"" - ;; - esac - - base_compile="$base_compile $lastarg" - done # for arg - - case $arg_mode in - arg) - $echo "$modename: you must specify an argument for -Xcompile" - exit $EXIT_FAILURE - ;; - target) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit $EXIT_FAILURE - ;; - *) - # Get the name of the library object. - [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSifmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.ii) xform=ii ;; - *.class) xform=class ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; - *.java) xform=java ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case $libobj in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -static) - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir= - else - xdir=$xdir/ - fi - lobj=${xdir}$objdir/$objname - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $run ln "$progpath" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $echo "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - $echo $srcfile > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - - $run $rm "$libobj" "${libobj}T" - - # Create a libtool object file (analogous to a ".la" file), - # but don't create it if we're doing a dry run. - test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then - $echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - $show "$mv $output_obj $lobj" - if $run $mv $output_obj $lobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the PIC object to the libtool object file. - test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then - $echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - else - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - fi - build_libtool_libs=no - build_old_libs=yes - prefer_static_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test - ;; - *) qarg=$arg ;; - esac - libtool_args="$libtool_args $qarg" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit $EXIT_FAILURE - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat $save_arg` - do -# moreargs="$moreargs $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - done - else - $echo "$modename: link input file \`$save_arg' does not exist" - exit $EXIT_FAILURE - fi - arg=$save_arg - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" - prev= - compile_command="$compile_command $wl$qarg" - finalize_command="$finalize_command $wl$qarg" - continue - ;; - xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: more than one -exported-symbols argument is not allowed" - exit $EXIT_FAILURE - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; - esac - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - exit $EXIT_FAILURE - fi - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-pw32* | *-*-beos*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-mingw* | *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs -framework System" - continue - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - deplibs="$deplibs $arg" - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - deplibs="$deplibs $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # gcc -m* arguments should be passed to the linker via $compiler_flags - # in order to pass architecture information to the linker - # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo - # but this is not reliable with gcc because gcc may use -mfoo to - # select a different linker, different libraries, etc, while - # -Wl,-mfoo simply passes -mfoo to the linker. - -m*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - if test "$with_gcc" = "yes" ; then - compiler_flags="$compiler_flags $arg" - fi - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # The PATH hackery in wrapper scripts is required on Windows - # in order for the loader to find any dlls it needs. - $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 - $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Wl,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $wl$flag" - linker_flags="$linker_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - - *.$objext) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done # argument parsing loop - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. - if test ! -d "$output_objdir"; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test "$status" -ne 0 && test ! -d "$output_objdir"; then - exit $status - fi - fi - - # Determine the type of output - case $output in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - case $host in - *cygwin* | *mingw* | *pw32*) - # don't eliminate duplications in $postdeps and $predeps - duplicate_compiler_generated_deps=yes - ;; - *) - duplicate_compiler_generated_deps=$duplicate_deps - ;; - esac - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if test "X$duplicate_deps" = "Xyes" ; then - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - libs="$libs $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; - esac - pre_post_deps="$pre_post_deps $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - case $linkmode in - lib) - passes="conv link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - for pass in $passes; do - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 - continue - fi - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` - for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if (${SED} -e '2q' $lib | - grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - library_names= - old_library= - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - *) - $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - if eval $echo \"$deplib\" 2>/dev/null \ - | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - $echo - $echo "*** Warning: Trying to link with static lib archive $deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because the file extensions .$libext of this argument makes me believe" - $echo "*** that it is just a static archive that I should not used here." - else - $echo - $echo "*** Warning: Linking the shared library $output against the" - $echo "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - if test "$found" = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - - # Read the .la file - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit $EXIT_FAILURE - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" - else - newdlfiles="$newdlfiles $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - abs_ladir="$ladir" - fi - ;; - esac - laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - $echo "$modename: warning: library \`$lib' was moved." 1>&2 - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi - fi # $installed = yes - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var"; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *" $absdir "*) ;; - *) temp_rpath="$temp_rpath $dir" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi - # This is a shared library - - # Warn about portability, can't link against -module's on - # some systems (darwin) - if test "$shouldnotlink" = yes && test "$pass" = link ; then - $echo - if test "$linkmode" = prog; then - $echo "*** Warning: Linking the executable $output against the loadable module" - else - $echo "*** Warning: Linking the shared library $output against the loadable module" - fi - $echo "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - realname="$2" - shift; shift - libname=`eval \\$echo \"$libname_spec\"` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw*) - major=`expr $current - $age` - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - soname=`$echo $soroot | ${SED} -e 's/^.*\///'` - newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - $show "extracting exported symbol list from \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$extract_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - $show "generating import library for \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$old_archive_from_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5* ) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a module then we can not link against - # it, someone is ignoring the new warnings I added - if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then - $echo "** Warning, lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - $echo - $echo "** And there doesn't seem to be a static archive available" - $echo "** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case "$libdir" in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit $EXIT_FAILURE - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && \ - test "$hardcode_minus_L" != yes && \ - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case "$libdir" in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - $echo - $echo "*** Warning: This system can not link to static lib archive $lib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - $echo "*** But as you try to build a module library, libtool will still create " - $echo "*** a static module, that should work as long as the dlopening application" - $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - convenience="$convenience $dir/$old_library" - old_convenience="$old_convenience $dir/$old_library" - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$newlib_search_path $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$deplib" && dir="." - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - fi - ;; - esac - if grep "^installed=no" $deplib > /dev/null; then - path="$absdir/$objdir" - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi - path="$absdir" - fi - depdepl= - case $host in - *-*-darwin*) - # we do not want to link against static libs, - # but need to link against shared - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$path/$depdepl" ; then - depdepl="$path/$depdepl" - fi - # do not add paths which are already there - case " $newlib_search_path " in - *" $path "*) ;; - *) newlib_search_path="$newlib_search_path $path";; - esac - fi - path="" - ;; - *) - path="-L$path" - ;; - esac - ;; - -l*) - case $host in - *-*-darwin*) - # Again, we only want to link against shared libraries - eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` - for tmp in $newlib_search_path ; do - if test -f "$tmp/lib$tmp_libs.dylib" ; then - eval depdepl="$tmp/lib$tmp_libs.dylib" - break - fi - done - path="" - ;; - *) continue ;; - esac - ;; - *) continue ;; - esac - case " $deplibs " in - *" $depdepl "*) ;; - *) deplibs="$depdepl $deplibs" ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$deplibs $path" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - tmp_libs="$tmp_libs $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 - exit $EXIT_FAILURE - else - $echo - $echo "*** Warning: Linking the shared library $output against the non-libtool" - $echo "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - if test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test "$#" -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$2" - number_minor="$3" - number_revision="$4" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - darwin|linux|osf|windows) - current=`expr $number_major + $number_minor` - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - current=`expr $number_major + $number_minor - 1` - age="$number_minor" - revision="$number_minor" - ;; - esac - ;; - no) - current="$2" - revision="$3" - age="$4" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; - *) - $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $revision in - 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; - *) - $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $age in - 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; - *) - $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test "$age" -gt "$current"; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - minor_current=`expr $current + 1` - verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - irix | nonstopux) - major=`expr $current - $age + 1` - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=.`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - major=`expr $current - $age` - versuffix="-$major" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - fi - - if test "$mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$echo "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - removelist="$removelist $p" - ;; - *) ;; - esac - done - if test -n "$removelist"; then - $show "${rm}r $removelist" - $run ${rm}r $removelist - fi - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - for path in $notinst_path; do - lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` - deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` - dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` - done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs -framework System" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c </dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for file magic test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a file magic. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name="`expr $a_deplib : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval $echo \"$potent_lib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a regex pattern. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` - done - fi - if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ - | grep . >/dev/null; then - $echo - if test "X$deplibs_check_method" = "Xnone"; then - $echo "*** Warning: inter-library dependencies are not supported in this platform." - else - $echo "*** Warning: inter-library dependencies are not known to be supported." - fi - $echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - $echo - $echo "*** Warning: libtool could not satisfy all declared inter-library" - $echo "*** dependencies of module $libname. Therefore, libtool will create" - $echo "*** a static module, that should work as long as the dlopening" - $echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - $echo "*** The inter-library dependencies that have been dropped here will be" - $echo "*** automatically added whenever a program is linked with this library" - $echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - $echo - $echo "*** Since this library must not contain undefined symbols," - $echo "*** because either the platform does not support them or" - $echo "*** it was explicitly requested with -no-undefined," - $echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - for link - do - linknames="$linknames $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - if len=`expr "X$cmd" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - $show "$cmd" - $run eval "$cmd" || exit $? - skipped_export=false - else - # The command line is too long to execute in one step. - $show "using reloadable object file for export list..." - skipped_export=: - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then - $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - tmp_deplibs="$tmp_deplibs $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise. - $echo "creating reloadable object files..." - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - delfiles= - last_robj= - k=1 - output=$output_objdir/$save_output-${k}.$objext - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - eval test_cmds=\"$reload_cmds $objlist $last_robj\" - if test "X$objlist" = X || - { len=`expr "X$test_cmds" : ".*"` && - test "$len" -le "$max_cmd_len"; }; then - objlist="$objlist $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" - fi - last_robj=$output_objdir/$save_output-${k}.$objext - k=`expr $k + 1` - output=$output_objdir/$save_output-${k}.$objext - objlist=$obj - len=1 - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" - - if ${skipped_export-false}; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - libobjs=$output - # Append the command to create the export file. - eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" - fi - - # Set up a command to remove the reloadale object files - # after they are used. - i=0 - while test "$i" -lt "$k" - do - i=`expr $i + 1` - delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" - done - - $echo "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - - # Append the command to remove the reloadable object files - # to the just-reset $cmds. - eval cmds=\"\$cmds~\$rm $delfiles\" - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case $output in - *.lo) - if test -n "$objs$old_deplibs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit $EXIT_FAILURE - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${obj}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $run eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - case $host in - *darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - if test "$tagname" = CXX ; then - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" - fi - ;; - esac - - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case $dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$output.exp" - $run $rm $export_symbols - $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - else - $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' - $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` - $run eval '$echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - $echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[] = -{\ -" - - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $run $rm $output - # Link the executable and exit - $show "$link_command" - $run eval "$link_command" || exit $? - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - cwrappersource=`$echo ${objdir}/lt-${output}.c` - cwrapper=`$echo ${output}.exe` - $rm $cwrappersource $cwrapper - trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - cat > $cwrappersource <> $cwrappersource<<"EOF" -#include -#include -#include -#include -#include -#include - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef DIR_SEPARATOR -#define DIR_SEPARATOR '/' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -#define HAVE_DOS_BASED_FILE_SYSTEM -#ifndef DIR_SEPARATOR_2 -#define DIR_SEPARATOR_2 '\\' -#endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -const char *program_name = NULL; - -void * xmalloc (size_t num); -char * xstrdup (const char *string); -char * basename (const char *name); -char * fnqualify(const char *path); -char * strendzap(char *str, const char *pat); -void lt_fatal (const char *message, ...); - -int -main (int argc, char *argv[]) -{ - char **newargz; - int i; - - program_name = (char *) xstrdup ((char *) basename (argv[0])); - newargz = XMALLOC(char *, argc+2); -EOF - - cat >> $cwrappersource <> $cwrappersource <<"EOF" - newargz[1] = fnqualify(argv[0]); - /* we know the script has the same name, without the .exe */ - /* so make sure newargz[1] doesn't end in .exe */ - strendzap(newargz[1],".exe"); - for (i = 1; i < argc; i++) - newargz[i+1] = xstrdup(argv[i]); - newargz[argc+1] = NULL; -EOF - - cat >> $cwrappersource <> $cwrappersource <<"EOF" -} - -void * -xmalloc (size_t num) -{ - void * p = (void *) malloc (num); - if (!p) - lt_fatal ("Memory exhausted"); - - return p; -} - -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL -; -} - -char * -basename (const char *name) -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha (name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return (char *) base; -} - -char * -fnqualify(const char *path) -{ - size_t size; - char *p; - char tmp[LT_PATHMAX + 1]; - - assert(path != NULL); - - /* Is it qualified already? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha (path[0]) && path[1] == ':') - return xstrdup (path); -#endif - if (IS_DIR_SEPARATOR (path[0])) - return xstrdup (path); - - /* prepend the current directory */ - /* doesn't handle '~' */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ - p = XMALLOC(char, size); - sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); - return p; -} - -char * -strendzap(char *str, const char *pat) -{ - size_t len, patlen; - - assert(str != NULL); - assert(pat != NULL); - - len = strlen(str); - patlen = strlen(pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp(str, pat) == 0) - *str = '\0'; - } - return str; -} - -static void -lt_error_core (int exit_status, const char * mode, - const char * message, va_list ap) -{ - fprintf (stderr, "%s: %s: ", program_name, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); - va_end (ap); -} -EOF - # we should really use a build-platform specific compiler - # here, but OTOH, the wrappers (shell script and this C one) - # are only useful if you want to execute the "real" binary. - # Since the "real" binary is built for $host, then this - # wrapper might as well be built for $host, too. - $run $LTCC -s -o $cwrapper $cwrappersource - ;; - esac - $rm $output - trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $echo >> $output "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - $echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $echo \"\$relink_command_output\" >&2 - $rm \"\$progdir/\$file\" - exit $EXIT_FAILURE - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - $echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $echo >> $output "\ - exec \$progdir\\\\\$program \${1+\"\$@\"} -" - ;; - - *) - $echo >> $output "\ - exec \$progdir/\$program \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" - exit $EXIT_FAILURE - fi - else - # The program doesn't exist. - \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 - \$echo \"This script is just a wrapper for \$program.\" 1>&2 - $echo \"See the $PACKAGE documentation for more information.\" 1>&2 - exit $EXIT_FAILURE - fi -fi\ -" - chmod +x $output - fi - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - eval cmds=\"$old_archive_cmds\" - - if len=`expr "X$cmds" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - $echo "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - # GNU ar 2.10+ was changed to match POSIX; thus no paths are - # encoded into archives. This makes 'ar r' malfunction in - # this piecewise linking case whenever conflicting object - # names appear in distinct ar calls; check, warn and compensate. - if (for obj in $save_oldobjs - do - $echo "X$obj" | $Xsed -e 's%^.*/%%' - done | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 - $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 - AR_FLAGS=cq - fi - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - for obj in $save_oldobjs - do - oldobjs="$objlist $obj" - objlist="$objlist $obj" - eval test_cmds=\"$old_archive_cmds\" - if len=`expr "X$test_cmds" : ".*"` && - test "$len" -le "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - eval cmd=\"$cmd\" - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - - # Only create the output if not a dry run. - if test -z "$run"; then - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlfiles="$newdlfiles $libdir/$name" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlprefiles="$newdlprefiles $libdir/$name" - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlfiles="$newdlfiles $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlprefiles="$newdlprefiles $abs" - done - dlprefiles="$newdlprefiles" - fi - $rm $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $echo >> $output "\ -relink_command=\"$relink_command\"" - fi - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? - ;; - esac - exit $EXIT_SUCCESS - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg="$nonopt" - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest="$arg" - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) prev="-f" ;; - -g) prev="-g" ;; - -m) prev="-m" ;; - -o) prev="-o" ;; - -s) - stripme=" -s" - continue - ;; - -*) ;; - - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest="$arg" - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test "$#" -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - library_names= - old_library= - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - if test "$inst_prefix_dir" = "$destdir"; then - $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - $echo "$modename: warning: relinking \`$file'" 1>&2 - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - exit $EXIT_FAILURE - fi - fi - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$srcname $destdir/$realname" - $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? - if test -n "$stripme" && test -n "$striplib"; then - $show "$striplib $destdir/$realname" - $run eval "$striplib $destdir/$realname" || exit $? - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - for linkname - do - if test "$linkname" != "$realname"; then - $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - cmds=$postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - file=`$echo $file|${SED} 's,.exe$,,'` - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin*|*mingw*) - wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` - ;; - *) - wrapper=$file - ;; - esac - if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then - notinst_deplibs= - relink_command= - - # To insure that "foo" is sourced, and not "foo.exe", - # finese the cygwin/MSYS system by explicitly sourcing "foo." - # which disallows the automatic-append-.exe behavior. - case $build in - *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; - *) wrapperdot=${wrapper} ;; - esac - # If there is no directory component, then add one. - case $file in - */* | *\\*) . ${wrapperdot} ;; - *) . ./${wrapperdot} ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then - $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 - exit $EXIT_FAILURE - fi - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - relink_command= - # To insure that "foo" is sourced, and not "foo.exe", - # finese the cygwin/MSYS system by explicitly sourcing "foo." - # which disallows the automatic-append-.exe behavior. - case $build in - *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; - *) wrapperdot=${wrapper} ;; - esac - # If there is no directory component, then add one. - case $file in - */* | *\\*) . ${wrapperdot} ;; - *) . ./${wrapperdot} ;; - esac - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir="/tmp" - test -n "$TMPDIR" && tmpdir="$TMPDIR" - tmpdir="$tmpdir/libtool-$$" - save_umask=`umask` - umask 0077 - if $mkdir "$tmpdir"; then - umask $save_umask - else - umask $save_umask - $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 - continue - fi - file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyways - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` - ;; - esac - ;; - esac - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - if test -n "$stripme" && test -n "$old_striplib"; then - $show "$old_striplib $oldlib" - $run eval "$old_striplib $oldlib" || exit $? - fi - - # Do each command in the postinstall commands. - cmds=$old_postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - cmds=$finish_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = : && exit $EXIT_SUCCESS - - $echo "----------------------------------------------------------------------" - $echo "Libraries have been installed in:" - for libdir in $libdirs; do - $echo " $libdir" - done - $echo - $echo "If you ever happen to want to link against installed libraries" - $echo "in a given directory, LIBDIR, you must either use libtool, and" - $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - $echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - $echo " during execution" - fi - if test -n "$runpath_var"; then - $echo " - add LIBDIR to the \`$runpath_var' environment variable" - $echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - $echo - $echo "See any operating system documentation about shared libraries for" - $echo "more information, such as the ld(1) and ld.so(8) manual pages." - $echo "----------------------------------------------------------------------" - exit $EXIT_SUCCESS - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit $EXIT_FAILURE - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit $EXIT_FAILURE - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" - fi - $echo "$cmd$args" - exit $EXIT_SUCCESS - fi - ;; - - # libtool clean and uninstall mode - clean | uninstall) - modename="$modename: $mode" - rm="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) rm="$rm $arg"; rmforce=yes ;; - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - rmdirs= - - origobjdir="$objdir" - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$file"; then - dir=. - objdir="$origobjdir" - else - objdir="$dir/$origobjdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if (test -L "$file") >/dev/null 2>&1 \ - || (test -h "$file") >/dev/null 2>&1 \ - || test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - - if test "$mode" = uninstall; then - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - cmds=$postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - cmds=$old_postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - # FIXME: should reinstall the best remaining shared library. - fi - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - - # Read the .lo file - . $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" \ - && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" \ - && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$mode" = clean ; then - noexename=$name - case $file in - *.exe) - file=`$echo $file|${SED} 's,.exe$,,'` - noexename=`$echo $name|${SED} 's,.exe$,,'` - # $file with .exe has already been added to rmfiles, - # add $file without .exe - rmfiles="$rmfiles $file" - ;; - esac - # Do a test to see if this is a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$noexename - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - $show "$rm $rmfiles" - $run $rm $rmfiles || exit_status=1 - done - objdir="$origobjdir" - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - $show "rmdir $dir" - $run rmdir $dir >/dev/null 2>&1 - fi - done - - exit $exit_status - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test -z "$exec_cmd"; then - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - fi -fi # test -z "$show_help" - -if test -n "$exec_cmd"; then - eval exec $exec_cmd - exit $EXIT_FAILURE -fi - -# We need to display help for each of the modes. -case $mode in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - --version print version information - -MODE must be one of the following: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE. - -Report bugs to ." - exit $EXIT_SUCCESS - ;; - -clean) - $echo \ -"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo \ -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; -esac - -$echo -$echo "Try \`$modename --help' for more information about other modes." - -exit $EXIT_SUCCESS - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/3.4.0/admin/ltmain.sh b/3.4.0/admin/ltmain.sh deleted file mode 100644 index b4583e7e26..0000000000 --- a/3.4.0/admin/ltmain.sh +++ /dev/null @@ -1,6930 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# 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. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -basename="s,^.*/,,g" - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - -# The name of this program: -progname=`echo "$progpath" | $SED $basename` -modename="$progname" - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION=1.5.24 -TIMESTAMP=" (1.1220.2.455 2007/06/24 02:13:29)" - -# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -duplicate_deps=no -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 - -##################################### -# Shell function definitions: -# This seems to be the best place for them - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $mkdir "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || { - $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 - exit $EXIT_FAILURE - } - fi - - $echo "X$my_tmpdir" | $Xsed -} - - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -func_win32_libid () -{ - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ - $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | \ - $SED -n -e '1,100{ - / I /{ - s,.*,import, - p - q - } - }'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $echo $win32_libid_type -} - - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case "$@ " in - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit $EXIT_FAILURE -# else -# $echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - - $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" - $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 - exit $EXIT_FAILURE - fi -} - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - my_status="" - - $show "${rm}r $my_gentop" - $run ${rm}r "$my_gentop" - $show "$mkdir $my_gentop" - $run $mkdir "$my_gentop" - my_status=$? - if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then - exit $my_status - fi - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - extracted_serial=`expr $extracted_serial + 1` - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" - - $show "${rm}r $my_xdir" - $run ${rm}r "$my_xdir" - $show "$mkdir $my_xdir" - $run $mkdir "$my_xdir" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then - exit $exit_status - fi - case $host in - *-darwin*) - $show "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - if test -z "$run"; then - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` - darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` - if test -n "$darwin_arches"; then - darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - $show "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we have a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` - lipo -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - ${rm}r unfat-$$ - cd "$darwin_orig_dir" - else - cd "$darwin_orig_dir" - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - fi # $run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - func_extract_archives_result="$my_oldobjs" -} -# End of Shell function definitions -##################################### - -# Darwin sucks -eval std_shrext=\"$shrext_cmds\" - -disable_libs=no - -# Parse our command line options once, thoroughly. -while test "$#" -gt 0 -do - arg="$1" - shift - - case $arg in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; - tag) - tagname="$arg" - preserve_args="${preserve_args}=$arg" - - # Check whether tagname contains only valid characters - case $tagname in - *[!-_A-Za-z0-9,/]*) - $echo "$progname: invalid tag name: $tagname" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $tagname in - CC) - # Don't test for the "default" C tag, as we know, it's there, but - # not specially marked. - ;; - *) - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then - taglist="$taglist $tagname" - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" - else - $echo "$progname: ignoring unknown tag $tagname" 1>&2 - fi - ;; - esac - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case $arg in - --help) - show_help=yes - ;; - - --version) - echo "\ -$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP - -Copyright (C) 2007 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - exit $? - ;; - - --config) - ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath - # Now print the configurations for the tags. - for tagname in $taglist; do - ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" - done - exit $? - ;; - - --debug) - $echo "$progname: enabling shell trace mode" - set -x - preserve_args="$preserve_args $arg" - ;; - - --dry-run | -n) - run=: - ;; - - --features) - $echo "host: $host" - if test "$build_libtool_libs" = yes; then - $echo "enable shared libraries" - else - $echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - $echo "enable static libraries" - else - $echo "disable static libraries" - fi - exit $? - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --preserve-dup-deps) duplicate_deps="yes" ;; - - --quiet | --silent) - show=: - preserve_args="$preserve_args $arg" - ;; - - --tag) - prevopt="--tag" - prev=tag - preserve_args="$preserve_args --tag" - ;; - --tag=*) - set tag "$optarg" ${1+"$@"} - shift - prev=tag - preserve_args="$preserve_args --tag" - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE -fi - -case $disable_libs in -no) - ;; -shared) - build_libtool_libs=no - build_old_libs=yes - ;; -static) - build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` - ;; -esac - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 - $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 - case $nonopt in - *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) - mode=link - for arg - do - case $arg in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case $mode in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - if test -n "$libobj" ; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit $EXIT_FAILURE - fi - arg_mode=target - continue - ;; - - -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - lastarg="$lastarg $arg" - done - IFS="$save_ifs" - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - - # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" - continue - ;; - - * ) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - case $lastarg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, and some SunOS ksh mistreat backslash-escaping - # in scan sets (worked around with variable expansion), - # and furthermore cannot handle '|' '&' '(' ')' in scan sets - # at all, so we specify them separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - lastarg="\"$lastarg\"" - ;; - esac - - base_compile="$base_compile $lastarg" - done # for arg - - case $arg_mode in - arg) - $echo "$modename: you must specify an argument for -Xcompile" - exit $EXIT_FAILURE - ;; - target) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit $EXIT_FAILURE - ;; - *) - # Get the name of the library object. - [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSifmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.ii) xform=ii ;; - *.class) xform=class ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.[fF][09]?) xform=[fF][09]. ;; - *.for) xform=for ;; - *.java) xform=java ;; - *.obj) xform=obj ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case $libobj in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -static) - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` - case $qlibobj in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qlibobj="\"$qlibobj\"" ;; - esac - test "X$libobj" != "X$qlibobj" \ - && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." - objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir= - else - xdir=$xdir/ - fi - lobj=${xdir}$objdir/$objname - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $run ln "$progpath" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $echo "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - $echo "$srcfile" > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` - case $qsrcfile in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qsrcfile="\"$qsrcfile\"" ;; - esac - - $run $rm "$libobj" "${libobj}T" - - # Create a libtool object file (analogous to a ".la" file), - # but don't create it if we're doing a dry run. - test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then - $echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - $show "$mv $output_obj $lobj" - if $run $mv $output_obj $lobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the PIC object to the libtool object file. - test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then - $echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test - ;; - *) qarg=$arg ;; - esac - libtool_args="$libtool_args $qarg" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit $EXIT_FAILURE - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat $save_arg` - do -# moreargs="$moreargs $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - done - else - $echo "$modename: link input file \`$save_arg' does not exist" - exit $EXIT_FAILURE - fi - arg=$save_arg - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" - prev= - compile_command="$compile_command $wl$qarg" - finalize_command="$finalize_command $wl$qarg" - continue - ;; - xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - darwin_framework|darwin_framework_skip) - test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - prev= - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: more than one -exported-symbols argument is not allowed" - exit $EXIT_FAILURE - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework|-arch|-isysroot) - case " $CC " in - *" ${arg} ${1} "* | *" ${arg} ${1} "*) - prev=darwin_framework_skip ;; - *) compiler_flags="$compiler_flags $arg" - prev=darwin_framework ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; - esac - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - notinst_path="$notinst_path $dir" - fi - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs -framework System" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - deplibs="$deplibs $arg" - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - -model) - compile_command="$compile_command $arg" - compiler_flags="$compiler_flags $arg" - finalize_command="$finalize_command $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m* pass through architecture-specific compiler args for GCC - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC - # -F/path gives path to uninstalled frameworks, gcc on darwin - # @file GCC response files - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) - - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - compiler_flags="$compiler_flags $arg" - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) - # The PATH hackery in wrapper scripts is required on Windows - # and Darwin in order for the loader to find any dlls it needs. - $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 - $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Wl,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $wl$flag" - linker_flags="$linker_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - - *.$objext) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done # argument parsing loop - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. - if test ! -d "$output_objdir"; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then - exit $exit_status - fi - fi - - # Determine the type of output - case $output in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - case $host in - *cygwin* | *mingw* | *pw32*) - # don't eliminate duplications in $postdeps and $predeps - duplicate_compiler_generated_deps=yes - ;; - *) - duplicate_compiler_generated_deps=$duplicate_deps - ;; - esac - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if test "X$duplicate_deps" = "Xyes" ; then - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - libs="$libs $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; - esac - pre_post_deps="$pre_post_deps $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - case $linkmode in - lib) - passes="conv link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - for pass in $passes; do - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - compiler_flags="$compiler_flags $deplib" - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 - continue - fi - name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` - for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if (${SED} -e '2q' $lib | - grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - library_names= - old_library= - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - *) - $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - if eval $echo \"$deplib\" 2>/dev/null \ - | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - $echo - $echo "*** Warning: Trying to link with static lib archive $deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because the file extensions .$libext of this argument makes me believe" - $echo "*** that it is just a static archive that I should not used here." - else - $echo - $echo "*** Warning: Linking the shared library $output against the" - $echo "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - if test "$found" = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 - exit $EXIT_FAILURE - fi - - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit $EXIT_FAILURE - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" - else - newdlfiles="$newdlfiles $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - abs_ladir="$ladir" - fi - ;; - esac - laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - $echo "$modename: warning: library \`$lib' was moved." 1>&2 - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi - fi # $installed = yes - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *" $absdir "*) ;; - *) temp_rpath="$temp_rpath $absdir" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes ; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi - # This is a shared library - - # Warn about portability, can't link against -module's on - # some systems (darwin) - if test "$shouldnotlink" = yes && test "$pass" = link ; then - $echo - if test "$linkmode" = prog; then - $echo "*** Warning: Linking the executable $output against the loadable module" - else - $echo "*** Warning: Linking the shared library $output against the loadable module" - fi - $echo "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - realname="$2" - shift; shift - libname=`eval \\$echo \"$libname_spec\"` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw*) - major=`expr $current - $age` - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - soname=`$echo $soroot | ${SED} -e 's/^.*\///'` - newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - $show "extracting exported symbol list from \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$extract_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - $show "generating import library for \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$old_archive_from_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a module then we can not link against - # it, someone is ignoring the new warnings I added - if /usr/bin/file -L $add 2> /dev/null | - $EGREP ": [^:]* bundle" >/dev/null ; then - $echo "** Warning, lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - $echo - $echo "** And there doesn't seem to be a static archive available" - $echo "** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit $EXIT_FAILURE - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && \ - test "$hardcode_minus_L" != yes && \ - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - $echo - $echo "*** Warning: This system can not link to static lib archive $lib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - $echo "*** But as you try to build a module library, libtool will still create " - $echo "*** a static module, that should work as long as the dlopening application" - $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$newlib_search_path $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$deplib" && dir="." - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - fi - ;; - esac - if grep "^installed=no" $deplib > /dev/null; then - path="$absdir/$objdir" - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - #if test "$absdir" != "$libdir"; then - # $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - #fi - path="$absdir" - fi - depdepl= - case $host in - *-*-darwin*) - # we do not want to link against static libs, - # but need to link against shared - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$path/$depdepl" ; then - depdepl="$path/$depdepl" - fi - # do not add paths which are already there - case " $newlib_search_path " in - *" $path "*) ;; - *) newlib_search_path="$newlib_search_path $path";; - esac - fi - path="" - ;; - *) - path="-L$path" - ;; - esac - ;; - -l*) - case $host in - *-*-darwin*) - # Again, we only want to link against shared libraries - eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` - for tmp in $newlib_search_path ; do - if test -f "$tmp/lib$tmp_libs.dylib" ; then - eval depdepl="$tmp/lib$tmp_libs.dylib" - break - fi - done - path="" - ;; - *) continue ;; - esac - ;; - *) continue ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - case " $deplibs " in - *" $depdepl "*) ;; - *) deplibs="$depdepl $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - tmp_libs="$tmp_libs $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 - exit $EXIT_FAILURE - else - $echo - $echo "*** Warning: Linking the shared library $output against the non-libtool" - $echo "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - if test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test "$#" -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$2" - number_minor="$3" - number_revision="$4" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - darwin|linux|osf|windows|none) - current=`expr $number_major + $number_minor` - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - current=`expr $number_major + $number_minor` - age="$number_minor" - revision="$number_minor" - lt_irix_increment=no - ;; - esac - ;; - no) - current="$2" - revision="$3" - age="$4" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test "$age" -gt "$current"; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - minor_current=`expr $current + 1` - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then - major=`expr $current - $age` - else - major=`expr $current - $age + 1` - fi - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=.`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - major=`expr $current - $age` - versuffix="-$major" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - fi - - if test "$mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$echo "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - removelist="$removelist $p" - ;; - *) ;; - esac - done - if test -n "$removelist"; then - $show "${rm}r $removelist" - $run ${rm}r $removelist - fi - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` - # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` - # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs -framework System" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c </dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for file magic test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a file magic. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name=`expr $a_deplib : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval $echo \"$potent_lib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a regex pattern. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` - done - fi - if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ - | grep . >/dev/null; then - $echo - if test "X$deplibs_check_method" = "Xnone"; then - $echo "*** Warning: inter-library dependencies are not supported in this platform." - else - $echo "*** Warning: inter-library dependencies are not known to be supported." - fi - $echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - $echo - $echo "*** Warning: libtool could not satisfy all declared inter-library" - $echo "*** dependencies of module $libname. Therefore, libtool will create" - $echo "*** a static module, that should work as long as the dlopening" - $echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - $echo "*** The inter-library dependencies that have been dropped here will be" - $echo "*** automatically added whenever a program is linked with this library" - $echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - $echo - $echo "*** Since this library must not contain undefined symbols," - $echo "*** because either the platform does not support them or" - $echo "*** it was explicitly requested with -no-undefined," - $echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - deplibs="$new_libs" - - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - case $archive_cmds in - *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;; - *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;; - esac - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - linknames= - for link - do - linknames="$linknames $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - if len=`expr "X$cmd" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - $show "$cmd" - $run eval "$cmd" || exit $? - skipped_export=false - else - # The command line is too long to execute in one step. - $show "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then - $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - tmp_deplibs="$tmp_deplibs $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && - len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise. - $echo "creating reloadable object files..." - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - output_la=`$echo "X$output" | $Xsed -e "$basename"` - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - delfiles= - last_robj= - k=1 - output=$output_objdir/$output_la-${k}.$objext - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - eval test_cmds=\"$reload_cmds $objlist $last_robj\" - if test "X$objlist" = X || - { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len"; }; then - objlist="$objlist $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - k=`expr $k + 1` - output=$output_objdir/$output_la-${k}.$objext - objlist=$obj - len=1 - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" - - if ${skipped_export-false}; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - libobjs=$output - # Append the command to create the export file. - eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" - fi - - # Set up a command to remove the reloadable object files - # after they are used. - i=0 - while test "$i" -lt "$k" - do - i=`expr $i + 1` - delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" - done - - $echo "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - - # Append the command to remove the reloadable object files - # to the just-reset $cmds. - eval cmds=\"\$cmds~\$rm $delfiles\" - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case $output in - *.lo) - if test -n "$objs$old_deplibs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit $EXIT_FAILURE - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` - else - gentop="$output_objdir/${obj}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $run eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - case $host in - *darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - if test "$tagname" = CXX ; then - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" - fi - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case $dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $run $rm $export_symbols - $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* ) - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - else - $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* ) - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` - $run eval '$echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - $echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -" - - case $host in - *cygwin* | *mingw* ) - $echo >> "$output_objdir/$dlsyms" "\ -/* DATA imports from DLLs on WIN32 can't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs */ -struct { -" - ;; - * ) - $echo >> "$output_objdir/$dlsyms" "\ -const struct { -" - ;; - esac - - - $echo >> "$output_objdir/$dlsyms" "\ - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[] = -{\ -" - - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - case $host in - *cygwin* | *mingw* ) - if test -f "$output_objdir/${outputname}.def" ; then - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` - else - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - fi - ;; - * ) - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - ;; - esac - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` - fi - - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - exit_status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $exit_status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $run $rm $output - # Link the executable and exit - $show "$link_command" - $run eval "$link_command" || exit $? - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - output_name=`basename $output` - output_path=`dirname $output` - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $rm $cwrappersource $cwrapper - trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - cat > $cwrappersource <> $cwrappersource<<"EOF" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -/* -DDEBUG is fairly common in CFLAGS. */ -#undef DEBUG -#if defined DEBUGWRAPPER -# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) -#else -# define DEBUG(format, ...) -#endif - -const char *program_name = NULL; - -void * xmalloc (size_t num); -char * xstrdup (const char *string); -const char * base_name (const char *name); -char * find_executable(const char *wrapper); -int check_executable(const char *path); -char * strendzap(char *str, const char *pat); -void lt_fatal (const char *message, ...); - -int -main (int argc, char *argv[]) -{ - char **newargz; - int i; - - program_name = (char *) xstrdup (base_name (argv[0])); - DEBUG("(main) argv[0] : %s\n",argv[0]); - DEBUG("(main) program_name : %s\n",program_name); - newargz = XMALLOC(char *, argc+2); -EOF - - cat >> $cwrappersource <> $cwrappersource <<"EOF" - newargz[1] = find_executable(argv[0]); - if (newargz[1] == NULL) - lt_fatal("Couldn't find %s", argv[0]); - DEBUG("(main) found exe at : %s\n",newargz[1]); - /* we know the script has the same name, without the .exe */ - /* so make sure newargz[1] doesn't end in .exe */ - strendzap(newargz[1],".exe"); - for (i = 1; i < argc; i++) - newargz[i+1] = xstrdup(argv[i]); - newargz[argc+1] = NULL; - - for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" - return 127; -} - -void * -xmalloc (size_t num) -{ - void * p = (void *) malloc (num); - if (!p) - lt_fatal ("Memory exhausted"); - - return p; -} - -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL -; -} - -const char * -base_name (const char *name) -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha ((unsigned char)name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return base; -} - -int -check_executable(const char * path) -{ - struct stat st; - - DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); - if ((!path) || (!*path)) - return 0; - - if ((stat (path, &st) >= 0) && - ( - /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ -#if defined (S_IXOTH) - ((st.st_mode & S_IXOTH) == S_IXOTH) || -#endif -#if defined (S_IXGRP) - ((st.st_mode & S_IXGRP) == S_IXGRP) || -#endif - ((st.st_mode & S_IXUSR) == S_IXUSR)) - ) - return 1; - else - return 0; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise */ -char * -find_executable (const char* wrapper) -{ - int has_slash = 0; - const char* p; - const char* p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char* concat_name; - - DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char* path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char* q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR(*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen(tmp); - concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen(tmp); - concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - return NULL; -} - -char * -strendzap(char *str, const char *pat) -{ - size_t len, patlen; - - assert(str != NULL); - assert(pat != NULL); - - len = strlen(str); - patlen = strlen(pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp(str, pat) == 0) - *str = '\0'; - } - return str; -} - -static void -lt_error_core (int exit_status, const char * mode, - const char * message, va_list ap) -{ - fprintf (stderr, "%s: %s: ", program_name, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); - va_end (ap); -} -EOF - # we should really use a build-platform specific compiler - # here, but OTOH, the wrappers (shell script and this C one) - # are only useful if you want to execute the "real" binary. - # Since the "real" binary is built for $host, then this - # wrapper might as well be built for $host, too. - $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource - ;; - esac - $rm $output - trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $echo >> $output "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - $echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $echo \"\$relink_command_output\" >&2 - $rm \"\$progdir/\$file\" - exit $EXIT_FAILURE - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - $echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $echo >> $output "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $echo >> $output "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \$*\" - exit $EXIT_FAILURE - fi - else - # The program doesn't exist. - \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$echo \"This script is just a wrapper for \$program.\" 1>&2 - $echo \"See the $PACKAGE documentation for more information.\" 1>&2 - exit $EXIT_FAILURE - fi -fi\ -" - chmod +x $output - fi - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - $echo "X$obj" | $Xsed -e 's%^.*/%%' - done | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "copying selected object files to avoid basename conflicts..." - - if test -z "$gentop"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$gentop"; then - exit $exit_status - fi - fi - - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - counter=`expr $counter + 1` - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - $run ln "$obj" "$gentop/$newobj" || - $run cp "$obj" "$gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" - ;; - *) oldobjs="$oldobjs $obj" ;; - esac - done - fi - - eval cmds=\"$old_archive_cmds\" - - if len=`expr "X$cmds" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - $echo "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - for obj in $save_oldobjs - do - oldobjs="$objlist $obj" - objlist="$objlist $obj" - eval test_cmds=\"$old_archive_cmds\" - if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - eval cmd=\"$cmd\" - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - - # Only create the output if not a dry run. - if test -z "$run"; then - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlfiles="$newdlfiles $libdir/$name" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlprefiles="$newdlprefiles $libdir/$name" - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlfiles="$newdlfiles $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlprefiles="$newdlprefiles $abs" - done - dlprefiles="$newdlprefiles" - fi - $rm $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $echo >> $output "\ -relink_command=\"$relink_command\"" - fi - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? - ;; - esac - exit $EXIT_SUCCESS - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - $echo "X$nonopt" | grep shtool > /dev/null; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac - ;; - -g | -m | -o) prev=$arg ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test "$#" -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - library_names= - old_library= - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - if test "$inst_prefix_dir" = "$destdir"; then - $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` - else - relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` - fi - - $echo "$modename: warning: relinking \`$file'" 1>&2 - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - exit $EXIT_FAILURE - fi - fi - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$srcname $destdir/$realname" - $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? - if test -n "$stripme" && test -n "$striplib"; then - $show "$striplib $destdir/$realname" - $run eval "$striplib $destdir/$realname" || exit $? - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - if test "$linkname" != "$realname"; then - $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - cmds=$postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - file=`$echo $file|${SED} 's,.exe$,,'` - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin*|*mingw*) - wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` - ;; - *) - wrapper=$file - ;; - esac - if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then - notinst_deplibs= - relink_command= - - # Note that it is not necessary on cygwin/mingw to append a dot to - # foo even if both foo and FILE.exe exist: automatic-append-.exe - # behavior happens only for exec(3), not for open(2)! Also, sourcing - # `FILE.' does not work on cygwin managed mounts. - # - # If there is no directory component, then add one. - case $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then - $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 - exit $EXIT_FAILURE - fi - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - relink_command= - # Note that it is not necessary on cygwin/mingw to append a dot to - # foo even if both foo and FILE.exe exist: automatic-append-.exe - # behavior happens only for exec(3), not for open(2)! Also, sourcing - # `FILE.' does not work on cygwin managed mounts. - # - # If there is no directory component, then add one. - case $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir=`func_mktempdir` - file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` - ;; - esac - ;; - esac - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - if test -n "$stripme" && test -n "$old_striplib"; then - $show "$old_striplib $oldlib" - $run eval "$old_striplib $oldlib" || exit $? - fi - - # Do each command in the postinstall commands. - cmds=$old_postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - cmds=$finish_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = : && exit $EXIT_SUCCESS - - $echo "X----------------------------------------------------------------------" | $Xsed - $echo "Libraries have been installed in:" - for libdir in $libdirs; do - $echo " $libdir" - done - $echo - $echo "If you ever happen to want to link against installed libraries" - $echo "in a given directory, LIBDIR, you must either use libtool, and" - $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - $echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - $echo " during execution" - fi - if test -n "$runpath_var"; then - $echo " - add LIBDIR to the \`$runpath_var' environment variable" - $echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - $echo - $echo "See any operating system documentation about shared libraries for" - $echo "more information, such as the ld(1) and ld.so(8) manual pages." - $echo "X----------------------------------------------------------------------" | $Xsed - exit $EXIT_SUCCESS - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit $EXIT_FAILURE - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - if test ! -f "$dir/$dlname"; then - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit $EXIT_FAILURE - fi - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - fi" - done - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" - fi - $echo "$cmd$args" - exit $EXIT_SUCCESS - fi - ;; - - # libtool clean and uninstall mode - clean | uninstall) - modename="$modename: $mode" - rm="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) rm="$rm $arg"; rmforce=yes ;; - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - rmdirs= - - origobjdir="$objdir" - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$file"; then - dir=. - objdir="$origobjdir" - else - objdir="$dir/$origobjdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if (test -L "$file") >/dev/null 2>&1 \ - || (test -h "$file") >/dev/null 2>&1 \ - || test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - - case "$mode" in - clean) - case " $library_names " in - # " " in the beginning catches empty $dlname - *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; - esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - cmds=$postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - cmds=$old_postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - - # Read the .lo file - . $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" \ - && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" \ - && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$mode" = clean ; then - noexename=$name - case $file in - *.exe) - file=`$echo $file|${SED} 's,.exe$,,'` - noexename=`$echo $name|${SED} 's,.exe$,,'` - # $file with .exe has already been added to rmfiles, - # add $file without .exe - rmfiles="$rmfiles $file" - ;; - esac - # Do a test to see if this is a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$noexename - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - $show "$rm $rmfiles" - $run $rm $rmfiles || exit_status=1 - done - objdir="$origobjdir" - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - $show "rmdir $dir" - $run rmdir $dir >/dev/null 2>&1 - fi - done - - exit $exit_status - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test -z "$exec_cmd"; then - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - fi -fi # test -z "$show_help" - -if test -n "$exec_cmd"; then - eval exec $exec_cmd - exit $EXIT_FAILURE -fi - -# We need to display help for each of the modes. -case $mode in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - --version print version information - -MODE must be one of the following: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE. - -Report bugs to ." - exit $EXIT_SUCCESS - ;; - -clean) - $echo \ -"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo \ -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; -esac - -$echo -$echo "Try \`$modename --help' for more information about other modes." - -exit $? - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -disable_libs=shared -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -disable_libs=static -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/3.4.0/admin/missing b/3.4.0/admin/missing deleted file mode 100755 index 894e786e16..0000000000 --- a/3.4.0/admin/missing +++ /dev/null @@ -1,360 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. - -scriptversion=2005-06-08.21 - -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. - -# 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, 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. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -run=: - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -msg="missing on your system" - -case "$1" in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] - -Send bug reports to ." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - -esac - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). -case "$1" in - lex|yacc) - # Not GNU programs, they don't have --version. - ;; - - tar) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case "$1" in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case "$f" in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` - test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if [ ! -f y.tab.h ]; then - echo >y.tab.h - fi - if [ ! -f y.tab.c ]; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if [ ! -f lex.yy.c ]; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` - fi - if [ -f "$file" ]; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit 1 - fi - ;; - - makeinfo) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - tar) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case "$firstarg" in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case "$firstarg" in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/3.4.0/admin/mkcvstag.sh b/3.4.0/admin/mkcvstag.sh deleted file mode 100755 index 3fcb87864b..0000000000 --- a/3.4.0/admin/mkcvstag.sh +++ /dev/null @@ -1,19 +0,0 @@ -OLDTAG=`cat admin/src_cvstag` - -echo "Old CVSTAG is $OLDTAG" - -if test -f configure.in; then - echo "Requesting cvs log in the current directory" -else - echo "This script must be called from the top source directory" - exit -1 -fi - -cvs log > cvs.log - -CVSTAG=`cat cvs.log | grep revision | grep -v total | wc -l` - -echo $CVSTAG > admin/src_cvstag - - -echo "CVSTAG is $CVSTAG" \ No newline at end of file diff --git a/3.4.0/admin/objprelink.c b/3.4.0/admin/objprelink.c deleted file mode 100644 index 319bd68049..0000000000 --- a/3.4.0/admin/objprelink.c +++ /dev/null @@ -1,530 +0,0 @@ -/* objprelink -- prelinks c++ files for producing a more efficient dynlink. - Copyright 2001, Leon Bottou - - This program is free software; you can redistribute it and/or modify ait - 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. - - Compile with: - gcc -O2 -o objprelink objprelink.c /usr/lib/libbfd.a /usr/lib/libiberty.a - - This is i386 only. - There is very experimental PPC support (totally unproven). -*/ - -#include -#include -#include -#include -#include -#include -#include -#include "bfd.h" - -static int verbose = 0; -static int replace = 1; -static const char *target = 0; -static const char *program_name = "objprelink"; -static const char *enomem = "out of memory"; -static const char *eassert = "assertion failed"; - -static void -fatal(const char *fname, int lineno, const char *msg) -{ - if (program_name) - fprintf(stderr,"%s ", program_name); - if (fname) - fprintf(stderr,"(%s:%d) ", fname, lineno); - if (program_name || fname) - fprintf(stderr," : "); - if (bfd_get_error() != bfd_error_no_error) - bfd_perror(msg); - else if (errno) - perror(msg); - else - fprintf(stderr,"%s\n", msg); - exit(5); -} - -#define FATAL(s) \ - do{fatal(__FILE__,__LINE__,s);}while(0) -#define ASSERT(x,s) \ - do{if(!(x))fatal(__FILE__,__LINE__,s);}while(0) -#define CLEARERR() \ - do{errno=0;bfd_set_error(bfd_error_no_error);}while(0) - -static const char * -M(const char *format, ...) -{ - static char buffer[256*256]; - va_list ap; - va_start(ap, format); - vsprintf(buffer, format, ap); - va_end(ap); - return buffer; -} - -static void -usage(FILE *stream, int status) -{ - fprintf(stream, - "Usage: %s [-v] [-n] \n" - "-- \"prelink\" c++ virtual tables\n" - "\n" - "This program massages object files in order to accelerate the loading\n" - "of shared object files (.so files) created by linking these object files.\n" - "This is intel specific at the moment\n" - "\n" - "The program scans the specified object file for linkonce sections\n" - "containing virtual tables with 32 bit absolute relocations (R_386_32)\n" - "to undefined procedures. For each such procedure, it creates a linkonce\n" - "text section containing a relay jump. All absolute relocations to this\n" - "procedure are then redirected to the single relay jump.\n" - "\n" - "Program objprelink should be called on all object files before linking.\n" - "\n" - "Option -v selects verbose mode\n" - "Option -n does not change the object files but generates a new object\n" - "whose name is composed by appending \".new\" to the original filename.\n", - program_name); - exit(status); -} - - -/* ---------------- MACHINE DEPENDENT PART ---- */ - -static char *stub; -static int stub_size; -static int stub_alignment; -static void (*stub_install)(bfd*, asection*, asymbol**); - -static reloc_howto_type *howto_32; - - -/* I386 */ - -static char stub_i386[] = { - 0xb8, 0, 0, 0, 0, /* mov $0,%eax */ - 0xff, 0xe0 /* jmp *(%eax) */ -}; - -static void -stub_install_i386(bfd *obfd, asection *p, asymbol **jumpto) -{ - int status; - int relcount = 1; - arelent **reloc = (arelent**)bfd_alloc(obfd, sizeof(arelent*)*relcount); - arelent *relent = (arelent*)bfd_alloc(obfd, sizeof(arelent)*relcount); - ASSERT(reloc, enomem); - ASSERT(relent, enomem); - reloc[0] = &relent[0]; - reloc[0]->sym_ptr_ptr = jumpto; - reloc[0]->address = 1; - reloc[0]->addend = 0; - reloc[0]->howto = howto_32; - bfd_set_reloc(obfd, p, reloc, relcount); - status = bfd_set_section_contents(obfd, p, stub, (file_ptr) 0, stub_size); - ASSERT(status, eassert); -} - -/* PPC */ - -static char stub_ppc[] = { - 0x48, 0, 0, 0 -}; - -static reloc_howto_type *howto_ppc_pltrel24; -static reloc_howto_type *howto_ppc_rel24; - -static void -stub_install_ppc(bfd *obfd, asection *p, asymbol **jumpto) -{ - int status; - int relcount = 1; - arelent **reloc = (arelent**)bfd_alloc(obfd, sizeof(arelent*)*relcount); - arelent *relent = (arelent*)bfd_alloc(obfd, sizeof(arelent)*relcount); - ASSERT(reloc, enomem); - ASSERT(relent, enomem); - reloc[0] = &relent[0]; - reloc[0]->sym_ptr_ptr = jumpto; - reloc[0]->address = 0; - reloc[0]->addend = 0; - reloc[0]->howto = howto_ppc_pltrel24; /* Second choice: howto_ppc_rel24 */ - bfd_set_reloc(obfd, p, reloc, relcount); - status = bfd_set_section_contents(obfd, p, stub, (file_ptr) 0, stub_size); - ASSERT(status, eassert); -} - -/* ALPHA */ - -/* ALL */ - -static void -prepare_stub_data(bfd *obfd, asymbol **syms, int symcount) -{ - switch (bfd_get_arch(obfd)) - { - case bfd_arch_i386: - stub = stub_i386; - stub_size = sizeof(stub_i386); - stub_install = stub_install_i386; - stub_alignment = 1; - break; - - case bfd_arch_powerpc: - fprintf(stderr,"Warning: PPC support is experimental\n"); - howto_ppc_pltrel24 = bfd_reloc_type_lookup(obfd, BFD_RELOC_24_PLT_PCREL); - howto_ppc_rel24 = bfd_reloc_type_lookup(obfd, BFD_RELOC_PPC_B26); - ASSERT(howto_ppc_pltrel24, eassert); - ASSERT(howto_ppc_rel24, eassert); - stub = stub_ppc; - stub_size = sizeof(stub_ppc); - stub_install = stub_install_ppc; - stub_alignment = 2; - break; - - default: - FATAL("This cpu architecture is not supported (yet)"); - break; - } - howto_32 = bfd_reloc_type_lookup(obfd, BFD_RELOC_32); - ASSERT(howto_32, eassert); -} - - -/* ---------- END OF MACHINE DEPENDENT PART ---- */ - - - -/* Symbol hash table */ - -typedef struct symbol_entry_s { - struct bfd_hash_entry root; - struct symbol_entry_s *next; - asection *relay; - asymbol *sym; -} symbol_entry; - -static struct bfd_hash_entry * -init_symbol_entry(struct bfd_hash_entry *entry, - struct bfd_hash_table *table, - const char *string) -{ - symbol_entry *ret = (symbol_entry*)entry; - if (! ret) - ret = (symbol_entry*)bfd_hash_allocate(table, sizeof(symbol_entry)); - ASSERT(ret,eassert); - memset(ret, 0, sizeof(symbol_entry)); - return bfd_hash_newfunc((struct bfd_hash_entry*)ret, table, string); -} - -static symbol_entry * -lookup_symbol(struct bfd_hash_table *table, const char *id, boolean create) -{ - return (symbol_entry*) bfd_hash_lookup(table, id, create, true); -} - -/* Cached relocations stored - in section userdata field */ - -struct section_userdata { - int relcount; - arelent **reloc; -}; - -/* Check if section is a virtual table */ - -static const char * -is_vt_section(bfd *abfd, asection *p) -{ - const char *name = bfd_section_name(abfd, p); - static const char prefix[] = ".gnu.linkonce.d.__vt_"; - static flagword w = (SEC_ALLOC|SEC_LOAD|SEC_RELOC|SEC_DATA|SEC_LINK_ONCE); - flagword f = bfd_get_section_flags (abfd, p); - if (f & w == w) - if (!strncmp(name, prefix, sizeof(prefix)-1)) - return name + sizeof(prefix)-6; - return false; -} - -/* Process one object file. - Returns true if a new file has been successfully created. */ - -static boolean -process(char *iname, char *oname) -{ - - bfd *ibfd = 0; - bfd *obfd = 0; - int isymcount = 0; - asymbol **isyms = 0; - struct bfd_hash_table vtsymtab; - symbol_entry *vtsyms = 0; - int vtcount = 0; - - int relcount; - arelent **reloc; - asection *p; - symbol_entry *hsym; - int storage_needed; - int status; - int i; - - if (verbose) - printf("processing file %s\n", iname); - - /* --- open bfds */ - ibfd = bfd_openr (iname, target); - ASSERT(ibfd, M("cannot read file \"%s\"", iname)); - if (! bfd_check_format(ibfd, bfd_object)) - FATAL(M("file \"%s\" is not a regular object file", iname)); - CLEARERR(); - - /* --- get input symbols */ - storage_needed = bfd_get_symtab_upper_bound(ibfd); - ASSERT(storage_needed>=0, eassert); - isyms = (asymbol**) bfd_alloc(ibfd, storage_needed); - ASSERT(isyms, enomem); - isymcount = bfd_canonicalize_symtab(ibfd, isyms); - ASSERT(isymcount>=0, eassert); - CLEARERR(); - - /* --- prepare variables required for stub generation */ - prepare_stub_data(ibfd, isyms, isymcount); - - /* --- cache all relocation entries */ - for (p=ibfd->sections; p; p=p->next) - { - const char *name = bfd_section_name(ibfd, p); - if (! strncmp(name, ".gnu.linkonce.t.stub.", 21)) - { - if (verbose) - printf(" file has already been processed\n"); - bfd_close(ibfd); - return false; - } - p->userdata = 0; - storage_needed = bfd_get_reloc_upper_bound(ibfd, p); - if (storage_needed > 0) - { - struct section_userdata *u = (void*)bfd_alloc(ibfd, sizeof(*u)); - ASSERT(u, enomem); - memset(u, 0, sizeof(*u)); - reloc = (arelent**)bfd_alloc(ibfd, storage_needed); - ASSERT(reloc, enomem); - relcount = bfd_canonicalize_reloc(ibfd, p, reloc, isyms); - ASSERT(relcount>=0, M("Problem with relocations for section %s in file %s", - bfd_section_name(ibfd,p), bfd_get_filename(ibfd))); - u->relcount = relcount; - u->reloc = reloc; - p->userdata = u; - } - } - - /* --- construct hash table of vt undefined symbols */ - memset(&vtsymtab, 0, sizeof(vtsymtab)); - status = bfd_hash_table_init(&vtsymtab, init_symbol_entry); - ASSERT(status, eassert); - for (p=ibfd->sections; p; p=p->next) - { - const char *vtname = is_vt_section(ibfd, p); - if (vtname) - { - if (verbose) - printf(" scanning section \"%s\"\n", vtname); - reloc = (p->userdata) ? ((struct section_userdata*)p->userdata)->reloc : 0; - relcount = (p->userdata) ? ((struct section_userdata*)p->userdata)->relcount : 0; - for (i=0; isym_ptr_ptr ? *rel->sym_ptr_ptr : 0); - if (sym && - rel->howto->type == howto_32->type && - !lookup_symbol(&vtsymtab, sym->name, false)) - { - hsym = lookup_symbol(&vtsymtab, sym->name, true); - ASSERT(hsym, eassert); - hsym->next = vtsyms; - hsym->sym = sym; - vtsyms = hsym; - vtcount += 1; - } - } - } - } - if (verbose) - printf(" found %d symbols in need for a stub\n", vtcount); - if (! vtcount) - { - bfd_hash_table_free(&vtsymtab); - bfd_close(ibfd); - return false; - } - - /* --- create output bfd */ - obfd = bfd_openw (oname, bfd_get_target (ibfd)); - ASSERT(obfd, M("cannot create file \"%s\"", iname)); - bfd_set_format (obfd, bfd_get_format (ibfd)); - bfd_set_start_address (obfd, bfd_get_start_address(ibfd)); - bfd_set_file_flags (obfd, (bfd_get_file_flags (ibfd) & bfd_applicable_file_flags (obfd))); - bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd)); - - /* --- create copied sections */ - for (p=ibfd->sections; p; p=p->next) - { - const char *err = M("cannot replicate section %s from file %s", - bfd_section_name (ibfd, p), iname); - asection *isection = p; - asection *osection = bfd_make_section_anyway (obfd, bfd_section_name (ibfd, isection)); - ASSERT(osection, err); - status = bfd_set_section_size (obfd, osection, bfd_section_size (ibfd, isection)); - ASSERT(status, err); - status = bfd_set_section_vma (obfd, osection, bfd_section_vma (ibfd, isection)); - ASSERT(status, err); - osection->lma = isection->lma; - status = bfd_set_section_alignment(obfd, osection, bfd_section_alignment (ibfd, isection)); - ASSERT(status, err); - status = bfd_set_section_flags(obfd, osection, bfd_get_section_flags (ibfd, isection)); - ASSERT(status, err); - isection->output_section = osection; - isection->output_offset = 0; - status = bfd_copy_private_section_data (ibfd, isection, obfd, osection); - ASSERT(status, err); - } - - /* --- create stub sections */ - if (verbose) - printf(" defining stub sections\n"); - for (hsym=vtsyms; hsym; hsym=hsym->next) - { - asection *osection; - asymbol *sym; - char *name; - /* new section */ - name = (char*)bfd_alloc(obfd, strlen(hsym->sym->name) + 28); - ASSERT(name, enomem); - strcpy(name,".gnu.linkonce.t.stub."); - strcat(name,hsym->sym->name); - hsym->relay = osection = bfd_make_section_anyway (obfd, name); - ASSERT(osection, enomem); - bfd_set_section_size(obfd, osection, stub_size); - bfd_set_section_alignment(obfd, osection, stub_alignment); - bfd_set_section_flags(obfd, osection, - SEC_HAS_CONTENTS|SEC_ALLOC|SEC_LOAD| - SEC_RELOC|SEC_READONLY|SEC_CODE|SEC_LINK_ONCE); - } - - /* --- copy symbols */ - bfd_set_symtab (obfd, isyms, isymcount); - - /* --- copy section relocs and data */ - if (verbose) - printf(" copying section data from %s\n", iname); - for (p=ibfd->sections; p; p=p->next) - { - const char *sname; - const char *err = M("cannot copy data from section %s in file %s", - bfd_section_name (ibfd, p), iname); - asection *isection = p; - asection *osection = p->output_section; - bfd_size_type size = bfd_get_section_size_before_reloc (isection); - /* copy relocs */ - reloc = (p->userdata) ? ((struct section_userdata*)isection->userdata)->reloc : 0; - relcount = (p->userdata) ? ((struct section_userdata*)isection->userdata)->relcount : 0; - sname = is_vt_section(ibfd, isection); - if (sname) - { - if (verbose) - printf(" patching relocs for %s\n", sname); - for (i=0; isym_ptr_ptr ? *rel->sym_ptr_ptr : 0); - ASSERT(sym, eassert); - hsym = lookup_symbol(&vtsymtab, sym->name, false); - if (hsym) - rel->sym_ptr_ptr = hsym->relay->symbol_ptr_ptr; - } - } - bfd_set_reloc(obfd, osection, (relcount) ? reloc : 0, relcount); - /* copy data */ - if (bfd_get_section_flags (ibfd, isection) & SEC_HAS_CONTENTS) - { - void *memchunk = malloc(size); - ASSERT(memchunk, enomem); - status = bfd_get_section_contents (ibfd, isection, memchunk, (file_ptr) 0, size); - ASSERT(status, eassert); - status = bfd_set_section_contents(obfd, osection, memchunk, (file_ptr) 0, size); - ASSERT(status, eassert); - free(memchunk); - } - } - - /* --- generate relocs and data for stub sections */ - for (hsym=vtsyms; hsym; hsym=hsym->next) - { - asection *osection = hsym->relay; - (*stub_install)(obfd, osection, &hsym->sym); - } - - /* --- copy private data */ - status = bfd_copy_private_bfd_data (ibfd, obfd); - ASSERT(status, M("error copying private data for %s", iname)); - - /* --- close bfds */ - if (verbose) - printf(" finishing %s\n", iname); - status = bfd_close(obfd); - ASSERT(status, M("error while writing %s", oname)); - bfd_close(ibfd); - - /* --- cleanup */ - bfd_hash_table_free(&vtsymtab); - return true; -} - - - -/* Main */ - -int -main(int argc, char **argv) -{ - int i; - int status = 0; - program_name = strrchr(argv[0],'/'); - program_name = (program_name) ? program_name + 1 : argv[0]; - if (argc < 2) - usage(stderr, 5); - bfd_init(); - bfd_set_error_program_name(program_name); - for (i=1; i $afile - - if grep "$SEARCH" $afile; then - echo "Ops.. maybe it didn't work..." - else - echo "Ok, it worked." - fi - fi - -done diff --git a/3.4.0/admin/src_cvstag b/3.4.0/admin/src_cvstag deleted file mode 100644 index 1cc988a9b4..0000000000 --- a/3.4.0/admin/src_cvstag +++ /dev/null @@ -1 +0,0 @@ -12746 diff --git a/3.4.0/admin/src_date b/3.4.0/admin/src_date deleted file mode 100644 index 24bbf1009a..0000000000 --- a/3.4.0/admin/src_date +++ /dev/null @@ -1 +0,0 @@ -2005.02.26 diff --git a/3.4.0/admin/svn_fixsvnignore.sh b/3.4.0/admin/svn_fixsvnignore.sh deleted file mode 100644 index db3d2f883e..0000000000 --- a/3.4.0/admin/svn_fixsvnignore.sh +++ /dev/null @@ -1,10 +0,0 @@ -export BASEDIR=$(pwd) - -for a in $(find ./ -name ".svnignore"); do - DADIR=$(echo $a | sed -e 's/[a-z\.-]*[^/]$//g') - echo $BASEDIR/$DADIR - cd $BASEDIR/$DADIR - svn propset svn:ignore -F .svnignore ./ -done - - diff --git a/3.4.0/autogen.sh b/3.4.0/autogen.sh deleted file mode 100755 index 186884d001..0000000000 --- a/3.4.0/autogen.sh +++ /dev/null @@ -1,164 +0,0 @@ -#! /bin/bash - -############################################################################### -# -# Run this to generate the Makefile templates, etc. -# -############################################################################### - -THIS_PROGGIE_EXECUTABLE="./autogen.sh" -THIS_PROGGIE_NAME="KVIrc autogen.sh" -THIS_PROGGIE_VERSION="1.0.0" -PKG_NAME="kvirc" -DIE=0 -GEN_FILES="configure.in" - -USE_BUNDLED_LIBTOOL=0 - -# Handle arguments - - -while test "$#" -gt 0 -do - arg="$1" - shift - - case $arg in - --help) - echo $THIS_PROGGIE_NAME $THIS_PROGGIE_VERSION - echo "Usage:" - echo $THIS_PROGGIE_EXECUTABLE "[options]" - echo "Options:" - echo " --bundled-libtool : use the bundled libtool instead" - echo " of the system one" - exit 0 - ;; - - --version) - echo $THIS_PROGGIE_NAME $THIS_PROGGIE_VERSION - exit 0 - ;; - - --bundled-libtool) - USE_BUNDLED_LIBTOOL=1 - ;; - - *) - echo "Unrecognized option $arg" - echo "See $THIS_PROGGIE_EXECUTABLE --help" - exit -1 - ;; - esac -done - - -set -e - -function RUN_TOOL() -{ - if [ -z "$*" ]; then return; fi - echo "... Running $*" - $* -} - - -############################################################################### -# -# - - -echo "... Generating build files for $PKG_NAME" - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have GNU \`autoconf' installed." - DIE=1 -} - -(test "$USE_BUNDLED_LIBTOOL" -eq 0) && { - (libtool --version) < /dev/null > /dev/null 2>&1 || { - echo "*Warning*: You don't have GNU \`libtool' installed." - echo "*Warning*: Using the buindled libtool instead." - USE_BUNDLED_LIBTOOL=1 - } -} - -(automake --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have GNU \`automake' installed." - DIE=1 - NO_AUTOMAKE=yes -} - -# if no automake, do not bother testing for aclocal -test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: Missing \`aclocal'. The version of \`automake'" - echo "installed does not appear recent enough." - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -case $CC in -xlc) - am_opt=--include-deps;; -esac - -for coin in $GEN_FILES -do - dr=`dirname $coin` - if test -f $dr/NO-AUTO-GEN; then - echo "... skipping $dr -- flagged as no auto-gen" - else - echo "... processing \"$dr\"" - macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin` - ( - cd $dr - aclocalinclude="$ACLOCAL_FLAGS" - for k in $macrodirs; do - if test -d $k; then - aclocalinclude="$aclocalinclude -I $k" - fi - done - - MACRO_FILES="admin/acinclude.m4.in admin/libtool.m4.in" - - cat $MACRO_FILES > acinclude.m4 - - if test "$USE_BUNDLED_LIBTOOL" -eq 0; then - echo "... Using system libtool" - echo "... Re-run with --bundled-libtool to use" - echo "... the libtool shipped with the KVIrc svn" - RUN_TOOL libtoolize --copy --force - else - echo "... Using bundled libtool" - rm -f admin/ltmain.sh - rm -f admin/config.guess - rm -f admin/config.sub - cp admin/libtool/ltmain.sh admin/ltmain.sh - cp admin/libtool/config.guess admin/config.guess - cp admin/libtool/config.sub admin/config.sub - fi - - RUN_TOOL aclocal $aclocalinclude - if grep "^AM_CONFIG_HEADER" $coin > /dev/null; then - RUN_TOOL autoheader - fi - RUN_TOOL automake --add-missing --force-missing --copy $am_opt - RUN_TOOL autoconf - touch stamp-h.in - ) - fi -done - -echo "###" -echo "### Done. The next step is ./configure --help" -echo "### Take a look at the options (eventually read the INSTALL file)" -echo "### and run ./configure " -echo "###" - -# -############################################################################### diff --git a/3.4.0/autogen_freebsd.sh b/3.4.0/autogen_freebsd.sh deleted file mode 100755 index f9da58e9e1..0000000000 --- a/3.4.0/autogen_freebsd.sh +++ /dev/null @@ -1,170 +0,0 @@ -#! /bin/bash - -############################################################################### -# -# Run this to generate the Makefile templates, etc. -# -############################################################################### - -THIS_PROGGIE_EXECUTABLE="./autogen.sh" -THIS_PROGGIE_NAME="KVIrc autogen.sh" -THIS_PROGGIE_VERSION="1.0.0" -PKG_NAME="kvirc" -DIE=0 -GEN_FILES="configure.in" - -USE_BUNDLED_LIBTOOL=0 - -# Handle arguments - -# FreeBSD -automake=automake19 -autoconf=autoconf259 -autoheader=autoheader259 -aclocal=aclocal19 -# - -while test "$#" -gt 0 -do - arg="$1" - shift - - case $arg in - --help) - echo $THIS_PROGGIE_NAME $THIS_PROGGIE_VERSION - echo "Usage:" - echo $THIS_PROGGIE_EXECUTABLE "[options]" - echo "Options:" - echo " --bundled-libtool : use the bundled libtool instead" - echo " of the system one" - exit 0 - ;; - - --version) - echo $THIS_PROGGIE_NAME $THIS_PROGGIE_VERSION - exit 0 - ;; - - --bundled-libtool) - USE_BUNDLED_LIBTOOL=1 - ;; - - *) - echo "Unrecognized option $arg" - echo "See $THIS_PROGGIE_EXECUTABLE --help" - exit -1 - ;; - esac -done - - -set -e - -function RUN_TOOL() -{ - if [ -z "$*" ]; then return; fi - echo "... Running $*" - $* -} - - -############################################################################### -# -# - - -echo "... Generating build files for $PKG_NAME" - -($autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have GNU \`autoconf' installed." - DIE=1 -} - -(test "$USE_BUNDLED_LIBTOOL" -eq 0) && { - (libtool --version) < /dev/null > /dev/null 2>&1 || { - echo "*Warning*: You don't have GNU \`libtool' installed." - echo "*Warning*: Using the buindled libtool instead." - USE_BUNDLED_LIBTOOL=1 - } -} - -($automake --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have GNU \`automake' installed." - DIE=1 - NO_AUTOMAKE=yes -} - -# if no automake, do not bother testing for aclocal -test -n "$NO_AUTOMAKE" || ($aclocal --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: Missing \`aclocal'. The version of \`automake'" - echo "installed does not appear recent enough." - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -case $CC in -xlc) - am_opt=--include-deps;; -esac - -for coin in $GEN_FILES -do - dr=`dirname $coin` - if test -f $dr/NO-AUTO-GEN; then - echo "... skipping $dr -- flagged as no auto-gen" - else - echo "... processing \"$dr\"" - macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin` - ( - cd $dr - aclocalinclude="$ACLOCAL_FLAGS" - for k in $macrodirs; do - if test -d $k; then - aclocalinclude="$aclocalinclude -I $k" - fi - done - - MACRO_FILES="admin/acinclude.m4.in admin/libtool.m4.in" - - cat $MACRO_FILES > acinclude.m4 - - if test "$USE_BUNDLED_LIBTOOL" -eq 0; then - echo "... Using system libtool" - echo "... Re-run with --bundled-libtool to use" - echo "... the libtool shipped with the KVIrc svn" - RUN_TOOL libtoolize --copy --force - else - echo "... Using bundled libtool" - rm -f admin/ltmain.sh - rm -f admin/config.guess - rm -f admin/config.sub - cp admin/libtool/ltmain.sh admin/ltmain.sh - cp admin/libtool/config.guess admin/config.guess - cp admin/libtool/config.sub admin/config.sub - fi - - RUN_TOOL $aclocal $aclocalinclude - if grep "^AM_CONFIG_HEADER" $coin > /dev/null; then - RUN_TOOL $autoheader - fi - RUN_TOOL $automake --add-missing --force-missing --copy $am_opt - RUN_TOOL $autoconf - touch stamp-h.in - ) - fi -done - -echo "###" -echo "### Done. The next step is ./configure --help" -echo "### Take a look at the options (eventually read the INSTALL file)" -echo "### and run ./configure " -echo "###" - -# -############################################################################### diff --git a/3.4.0/configure.in b/3.4.0/configure.in deleted file mode 100755 index 8dffa43f6e..0000000000 --- a/3.4.0/configure.in +++ /dev/null @@ -1,268 +0,0 @@ -#------------------------------------------------------------------ -# configure.in for the KVIrc IRC client -# Szymon Stefanek (07-04-2000) -#------------------------------------------------------------------ - -AC_INIT(README) - -AC_SS_HEADER([Trying to find out where I am]) - -AC_CONFIG_AUX_DIR(admin) - -AC_CANONICAL_SYSTEM - -AC_SS_HEADER([Initializing automake]) - -AC_PREREQ(2.52) - -AM_INIT_AUTOMAKE(kvirc,3.4.0) - -AC_PREFIX_DEFAULT(/usr/local) -AM_CONFIG_HEADER(src/config.h) - -#------------------------------------------------------------------ -# HERE starts your real configure script -#------------------------------------------------------------------ - -AC_SS_INIT_VARIABLES - -AC_SS_HEADER([Checking the compilation mode]) - -AC_SS_CXXFLAGS - -AC_SS_HEADER([Checking the C++ environment]) - -AC_PROG_CC -AC_AIX -AC_MINIX -AC_EXEEXT -AC_LANG_CPLUSPLUS -AC_PROG_CXX - -AC_SS_HEADER([Initializing libtool]) - -AM_DISABLE_STATIC -AC_LIBTOOL_DLOPEN -KVIRC_PROG_LIBTOOL - -AC_SS_HEADER([Checking system properties]) - -AC_SS_HEADER_CHECKS -AC_SS_FUNCTION_CHECKS - -AC_SS_CHECK_IFADDR_STUFF -AC_SS_CHECK_DYNAMIC_LABELS -AC_SS_CHECK_BIG_ENDIAN -AC_SS_MISC_OPTIONS - -AC_CHECK_SIZEOF(short int) -AC_CHECK_SIZEOF(unsigned short int) -AC_CHECK_SIZEOF(int) -AC_CHECK_SIZEOF(unsigned int) -AC_CHECK_SIZEOF(long int) -AC_CHECK_SIZEOF(unsigned long int) -AC_CHECK_SIZEOF(long long int) -AC_CHECK_SIZEOF(unsigned long long int) -AC_CHECK_SIZEOF(void *) - -#AC_SS_CHECK_KVISOCKLEN_T -#AC_SS_CHECK_BOOL -#AC_SS_LIBRARY_CHECKS -#AC_SS_FIND_JPEG - -AC_SS_HEADER([Looking for required libraries]) - -AC_SS_CHECK_DL -AC_SS_CHECK_THREAD_STUFF - -AC_SS_HEADER([Looking for X]) - -AC_SS_FIND_X -AC_SS_CHECK_XSS -AC_SS_HEADER([Looking for Qt]) - -SS_QT3_MAJOR_VERSION_REQUIRED="3" -SS_QT3_MINOR_VERSION_REQUIRED="0" -SS_QT3_PATCH_LEVEL_REQUIRED="0" -SS_QT3_GENERAL_FILE_TO_SEARCH="include/qinputdialog.h" -SS_QT3_INCLUDE_FILE_TO_SEARCH="qiconview.h" - -SS_QT4_MAJOR_VERSION_REQUIRED="4" -SS_QT4_MINOR_VERSION_REQUIRED="0" -SS_QT4_PATCH_LEVEL_REQUIRED="0" -SS_QT4_GENERAL_FILE_TO_SEARCH="include/QtCore/QtPlugin" -SS_QT4_INCLUDE_FILE_TO_SEARCH="QtCore/QtPlugin" - - -AC_SS_FIND_QT - -AC_SS_HEADER([Checking KDE]) - -SS_KDE_GENERAL_FILE_TO_SEARCH="include/kwin.h" -SS_KDE_INCLUDE_FILE_TO_SEARCH="kwin.h" - -AC_SS_FIND_KDE - -AC_SS_HEADER([Checking additional compilation options]) -AC_SS_CHECK_OPENSSL -AC_SS_CHECK_ESD -AC_SS_CHECK_ARTS -AC_SS_CHECK_ZLIB -AC_SS_CHECK_AUDIOFILE -AC_SS_CHECK_OTHER_LIBS -AC_SS_CHECK_PERL -AC_SS_HEADER([Working out the final configuration]) - -AC_SS_FINAL_CONFIG - -AC_SS_HEADER([Creating Makefiles]) - -AC_OUTPUT( \ - Makefile \ - admin/Makefile \ - admin/libtool/Makefile \ - data/Makefile \ - data/applnk/Makefile \ - data/config/Makefile \ - data/defscript/Makefile \ - data/deftheme/Makefile \ - data/deftheme/silverirc/Makefile \ - data/doctemplates/Makefile \ - data/helppics/Makefile \ - data/icons/Makefile \ - data/icons/16x16/Makefile \ - data/icons/32x32/Makefile \ - data/icons/48x48/Makefile \ - data/icons/64x64/Makefile \ - data/icons/128x128/Makefile \ - data/icons/scalable/Makefile \ - data/man/Makefile \ - data/mimelnk/Makefile \ - data/msgcolors/Makefile \ - data/pics/Makefile \ - data/pics/coresmall/Makefile \ - data/protocols/Makefile \ - data/resources/Makefile \ - data/resources_mac/Makefile \ - doc/Makefile \ - doc/scriptexamples/Makefile \ - doc/scriptexamples/antiidle/Makefile \ - doc/scriptexamples/minesweeper/Makefile \ - doc/scriptexamples/mp3share/Makefile \ - doc/scriptexamples/playing/Makefile \ - doc/scriptexamples/runmenu/Makefile \ - doc/scriptexamples/simplehttp/Makefile \ - doc/scriptexamples/tutorial/Makefile \ - po/Makefile \ - po/kvirc/Makefile \ - po/modules/Makefile \ - po/modules/about/Makefile \ - po/modules/dcc/Makefile \ - po/modules/editor/Makefile \ - po/modules/filetransferwindow/Makefile \ - po/modules/logview/Makefile \ - po/modules/mediaplayer/Makefile \ - po/modules/notifier/Makefile \ - po/modules/options/Makefile \ - po/modules/perl/Makefile \ - po/modules/perlcore/Makefile \ - po/modules/sharedfileswindow/Makefile \ - po/modules/torrent/Makefile \ - po/modules/theme/Makefile \ - scripts/Makefile \ - scripts/browser/Makefile \ - scripts/config/Makefile \ - scripts/config/kvirc-config \ - scripts/helpsearch/Makefile \ - src/Makefile \ - src/kvilib/Makefile \ - src/kvilib/build/Makefile \ - src/kvilib/config/Makefile \ - src/kvilib/core/Makefile \ - src/kvilib/ext/Makefile \ - src/kvilib/file/Makefile \ - src/kvilib/include/Makefile \ - src/kvilib/irc/Makefile \ - src/kvilib/net/Makefile \ - src/kvilib/system/Makefile \ - src/kvilib/tal/Makefile \ - src/kvirc/Makefile \ - src/kvirc/build/Makefile \ - src/kvirc/include/Makefile \ - src/kvirc/kernel/Makefile \ - src/kvirc/kvs/Makefile \ - src/kvirc/module/Makefile \ - src/kvirc/sparser/Makefile \ - src/kvirc/ui/Makefile \ - src/modules/Makefile \ - src/modules/about/Makefile \ - src/modules/action/Makefile \ - src/modules/actioneditor/Makefile \ - src/modules/addon/Makefile \ - src/modules/addon/pics/Makefile \ - src/modules/aliaseditor/Makefile \ - src/modules/avatar/Makefile \ - src/modules/chan/Makefile \ - src/modules/channelsjoin/Makefile \ - src/modules/clock/Makefile \ - src/modules/codetester/Makefile \ - src/modules/config/Makefile \ - src/modules/context/Makefile \ - src/modules/dialog/Makefile \ - src/modules/dcc/Makefile \ - src/modules/dockwidget/Makefile \ - src/modules/editor/Makefile \ - src/modules/eventeditor/Makefile \ - src/modules/file/Makefile \ - src/modules/filetransferwindow/Makefile \ - src/modules/filetransferwindow/caps/Makefile \ - src/modules/help/Makefile \ - src/modules/http/Makefile \ - src/modules/ident/Makefile \ - src/modules/iograph/Makefile \ - src/modules/lamerizer/Makefile \ - src/modules/links/Makefile \ - src/modules/list/Makefile \ - src/modules/log/Makefile \ - src/modules/logview/Makefile \ - src/modules/logview/caps/Makefile \ - src/modules/mask/Makefile \ - src/modules/math/Makefile \ - src/modules/mediaplayer/Makefile \ - src/modules/mircimport/Makefile \ - src/modules/mircimport/caps/Makefile \ - src/modules/mircimport/pics/Makefile \ - src/modules/my/Makefile \ - src/modules/notifier/Makefile \ - src/modules/notifier/pics/Makefile \ - src/modules/objects/Makefile \ - src/modules/options/Makefile \ - src/modules/perl/Makefile \ - src/modules/perlcore/Makefile \ - src/modules/popupeditor/Makefile \ - src/modules/raweditor/Makefile \ - src/modules/regchan/Makefile \ - src/modules/reguser/Makefile \ - src/modules/rijndael/Makefile \ - src/modules/rijndael/caps/Makefile \ - src/modules/setup/Makefile \ - src/modules/sharedfile/Makefile \ - src/modules/sharedfileswindow/Makefile \ - src/modules/sharedfileswindow/caps/Makefile \ - src/modules/snd/Makefile \ - src/modules/socketspy/Makefile \ - src/modules/spaste/Makefile \ - src/modules/str/Makefile \ - src/modules/system/Makefile \ - src/modules/term/Makefile \ - src/modules/texticons/Makefile \ - src/modules/theme/Makefile \ - src/modules/tip/Makefile \ - src/modules/tmphighlight/Makefile \ - src/modules/toolbar/Makefile \ - src/modules/toolbareditor/Makefile \ - src/modules/torrent/Makefile \ - src/modules/url/Makefile \ - src/modules/url/caps/Makefile \ - src/modules/window/Makefile \ -) diff --git a/3.4.0/data/.svnignore b/3.4.0/data/.svnignore deleted file mode 100644 index 12db6445fc..0000000000 --- a/3.4.0/data/.svnignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile.in -Makefile -core \ No newline at end of file diff --git a/3.4.0/data/Makefile.am b/3.4.0/data/Makefile.am deleted file mode 100644 index 1d329f150b..0000000000 --- a/3.4.0/data/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek -############################################################################### - -SUBDIRS = applnk config defscript deftheme doctemplates \ -helppics icons man mimelnk msgcolors pics protocols resources resources_mac diff --git a/3.4.0/data/applnk/.svnignore b/3.4.0/data/applnk/.svnignore deleted file mode 100644 index bc419568af..0000000000 --- a/3.4.0/data/applnk/.svnignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile.in -Makefile -core -.pics -.mospics \ No newline at end of file diff --git a/3.4.0/data/applnk/Makefile.am b/3.4.0/data/applnk/Makefile.am deleted file mode 100644 index cf7c6f3d0a..0000000000 --- a/3.4.0/data/applnk/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -tmpdir = $(applnkdir) - -tmp_DATA = kvirc.desktop - -EXTRA_DIST = $(tmp_DATA) diff --git a/3.4.0/data/applnk/kvirc.desktop b/3.4.0/data/applnk/kvirc.desktop deleted file mode 100644 index 0b53189906..0000000000 --- a/3.4.0/data/applnk/kvirc.desktop +++ /dev/null @@ -1,18 +0,0 @@ -[Desktop Entry] -BinaryPattern= -GenericName=IRC Client -Comment=Connect to Internet Relay Chat -MimeType=application/x-kva;application/x-kvt -Exec=kvirc -m %u -Icon=kvirc -MapNotify=true -Name=KVIrc 3 -SwallowExec= -SwallowTitle= -Terminal=false -TerminalOptions= -Path= -Type=Application -X-KDE-SubstituteUID=false -X-KDE-Username= -X-KDE-StartupNotify=true diff --git a/3.4.0/data/config/.svnignore b/3.4.0/data/config/.svnignore deleted file mode 100644 index bc419568af..0000000000 --- a/3.4.0/data/config/.svnignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile.in -Makefile -core -.pics -.mospics \ No newline at end of file diff --git a/3.4.0/data/config/Makefile.am b/3.4.0/data/config/Makefile.am deleted file mode 100644 index 4b41fbd97b..0000000000 --- a/3.4.0/data/config/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -tmpdir = $(configdir) - -tmp_DATA = serverdb.kvc texticons.kvc - -EXTRA_DIST = $(tmp_DATA) diff --git a/3.4.0/data/config/preinstalled.kvc.win32-example b/3.4.0/data/config/preinstalled.kvc.win32-example deleted file mode 100644 index f825cc2be1..0000000000 --- a/3.4.0/data/config/preinstalled.kvc.win32-example +++ /dev/null @@ -1,25 +0,0 @@ -## This file must be renamed to "preinstalled.kvc" -## and placed in global KVIrc folder! - - -## This config file needed to make custom KVIrc packages -## for Windows with custom preferences. You can tell -## KVIrc to skip some pages in setup wizard. For -## example, you can use custom serverlist, or tell -## KVIrc to not show directody selection dialog, if -## you think, that it is confusing users. - -#[Setup] - -## Hide server list if you include a new one - -#hideServerList = true - -## Set to 1 if you want KVIrc to place settings in default -## folder -## Set to 2 if you want to make KVIrc portable by default - -## If this option will be setted, KVIrc will skip directory -## selection page - -#settingsDir = 2 \ No newline at end of file diff --git a/3.4.0/data/config/serverdb.kvc b/3.4.0/data/config/serverdb.kvc deleted file mode 100644 index f1c6266afd..0000000000 --- a/3.4.0/data/config/serverdb.kvc +++ /dev/null @@ -1,1611 +0,0 @@ -# KVIrc configuration file - -[Accessirc] -0_Hostname=irc.accessirc.net -0_Description=Accessirc:%20Random%20server -NServers=1 -[Acestar] -0_Hostname=irc.acestar.org -0_Description=Acestar:%20Random%20server -NServers=1 -[Action-IRC] -0_Hostname=irc.action-irc.net -0_Description=Action-IRC:%20Random%20server -NServers=1 -[AlternativeNet] -0_Hostname=irc.altnet.org -0_Description=Alternativenet:%20Random%20server -NServers=1 -[Afternet] -0_Hostname=irc.afternet.org -0_Description=Afternet:%20Random%20server -NServers=1 -[Anothernet] -0_Hostname=irc.another.net -0_Description=AnotherNet:%20Random%20server -NServers=1 -[ArabChat] -0_Hostname=irc.arabchat.org -0_Description=ArabChat:%20Random%20server -NServers=1 -[AsiaTalk] -0_Hostname=irc.asiatalk.org -0_Description=AsiaTalk:%20Random%20server -NServers=1 -[AstroLink] -0_Hostname=irc.astrolink.org -0_Description=AstroLink:%20Random%20server -NServers=1 -[Asylumnet] -0_Hostname=irc.asylum-net.org -0_Description=Asylumnet:%20Random%20server -NServers=1 -[Austnet] -0_Hostname=au.austnet.org -0_Description=Austnet:%20Random%20AU%20server -1_Hostname=nz.austnet.org -1_Description=Austnet:%20Random%20NZ%20server -2_Hostname=sg.austnet.org -2_Description=Austnet:%20Random%20SG%20server -3_Hostname=us.austnet.org -3_Description=Austnet:%20Random%20US%20server -NServers=4 -[AwesomeChat] -0_Hostname=irc.awesomechat.net -0_Description=AwesomeChat:%20Random%20server -NServers=1 -[Axenet] -0_Hostname=irc.axenet.org -0_Description=Axenet:%20Random%20server -NServers=1 -[Azzurra] -0_Hostname=irc.azzurra.org -0_Description=Main%20Random%20Server -1_Hostname=atlantis.azzurra.org -1_Description=HUB%20Routing%20Server -2_Hostname=twilight.azzurra.org -2_Description=HUB%20Routing%20Server -3_Hostname=vogon.azzurra.org -3_Description=HUB%20Routing%20Server -4_Hostname=b-network.azzurra.org -4_Description=B-Network%20Leaf%20Server -5_Hostname=caltanet.azzurra.org -5_Description=Caltanet%20Leaf%20Server -6_Hostname=cheapnet.azzurra.org -6_Description=Cheapnet%20Leaf%20Server -7_Hostname=libero.azzurra.org -7_Description=Libero%20Leaf%20Server -8_Hostname=oltrelinux.azzurra.org -8_Description=Oltrelinux%20Leaf%20Server -9_Hostname=nexlab.azzurra.org -9_Description=Nexlab%20Leaf%20Server -10_Hostname=penguin.azzurra.org -10_Description=Penguin%20Leaf%20Server -11_Hostname=radiomarte.azzurra.org -11_Description=RadioMarte%20Leaf%20Server -12_Hostname=sashimi.azzurra.org -12_Description=Sashimi%20Leaf%20Server -13_Hostname=sbrize.azzurra.org -13_Description=Sbrize%20Leaf%20Server -14_Hostname=tin.azzurra.org -14_Description=Tin%20Leaf%20Server -15_Hostname=unina.azzurra.org -15_Description=Unina%20Leaf%20Server -16_Hostname=wmgitalia.azzurra.org -16_Description=WMG%20Leaf%20Server -17_Hostname=fastweb.azzurra.org -17_Description=Fastweb%20Routing%20Server -18_Hostname=gamma.azzurra.org -18_Description=Gamma%20Fastweb%20Server -19_Hostname=orion.azzurra.org -19_Description=Orion%20Fastweb%20Server -20_Hostname=ssitalia.azzurra.org -20_Description=SSItalia%20Fastweb%20Server -21_Hostname=stealth.azzurra.org -21_Description=Stealth%20Fastweb%20Server -22_Hostname=irc6.azzurra.org -22_Description=IPv6%20Routing%20Server -23_Hostname=itgate.azzurra.org -23_Description=ITgate%20IPv6%20Server -24_Hostname=ngnet.azzurra.org -24_Description=Ngnet%20IPv6%20Server -NServers=25 -Description=Italian%20Main%20Network -[Beirut] -0_Hostname=irc.beirut.com -0_Description=Random%20server -1_Hostname=us.beirut.com -1_Description=Random%20US%20server -2_Hostname=eu.beirut.com -2_Description=Random%20EU%20server -3_Hostname=downtown.beirut.com -3_Description=Fullerton -4_Hostname=verdun.beirut.com -4_Description=Chicago -5_Hostname=hamra.beirut.com -5_Description=New%20York -6_Hostname=achrafieh.beirut.com -6_Description=Hamburg -7_Hostname=port.beirut.com -7_Description=London -8_Hostname=sinelfil.beirut.com -8_Description=Frankfurt -9_Hostname=irc.dikt.no -9_Description=Oslo -NServers=10 -[Beyondirc] -0_Hostname=irc.beyondirc.net -0_Description=BeyondIRC:%20Random%20server -NServers=1 -[Bitlbee] -0_Hostname=im.bitlbee.org -0_Description=InterLAB%20BV,%20Netherlands -1_Hostname=im.uk.bitlbee.org -1_Description=SSInternet,%20UK -2_Hostname=im.starkast.net -2_Description=TeleFortress,%20Sweden -3_Hostname=bitlbee.hensema.net -3_Description=HostingXS,%20Amsterdam -4_Hostname=im.okkernoot.net -4_Description=Almere,%20Netherlands -5_Hostname=im.fr.bitlbee.org -5_Description=ProXad,%20France -6_Hostname=im.sixxs.net -6_Description=SixXS,%20Netherlands -7_Hostname=bitlbee.extreme-players.de -7_Description=Global%20Access,%20Germany -8_Hostname=irc2im.picasa.hu -8_Description=Hungary,%20Budapest -9_Hostname=bitlbee.salooo.org -9_Description=Berlin,%20Germany -NServers=10 -Description=IRC%20%3C--%3E%20MSN%20gateway -[Blabbernet] -0_Hostname=irc.blabber.net -0_Description=Blabbernet:%20Random%20server -NServers=1 -[Blitzed] -0_Hostname=irc.blitzed.org -0_Description=Blitzed:%20Random%20server -NServers=1 -[Brasilchat] -0_Hostname=irc.brasilchat.org -0_Description=Brasilchat:%20Random%20server -NServers=1 -[Brasirc] -0_Hostname=irc.brasirc.net -0_Description=Brasirc:%20Random%20server -1_Hostname=irc.libnet.com.br -1_Description=Brasirc:%20BR,%20PA,%20Belem -2_Hostname=irc.matrix.net.br -2_Description=Brasirc:%20BR,%20SC,%20Florianopolis -NServers=3 -[Brasnet] -0_Hostname=irc.brasnet.org -0_Description=Brasnet:%20Random%20server -1_Hostname=eu.brasnet.org -1_Description=Brasnet:%20Random%20European%20server -2_Hostname=us.brasnet.org -2_Description=Brasnet:%20Random%20US%20server -NServers=3 -[Bulgaria] -0_Hostname=irc.bulgaria.org -0_Description=Bulgaria:%20Random%20server -NServers=1 -[CCnet] -0_Hostname=irc.cchat.net -0_Description=CCnet:%20Random%20server -1_Hostname=irc2.cchat.net -1_Description=CCnet:%20US,%20TX,%20Dallas -NServers=2 -[Chat-Net] -0_Hostname=irc.chat-net.org -0_Description=Chat-Net:%20Random%20server -NServers=1 -[ChatArea] -0_Hostname=irc.chatarea.net -0_Description=ChatArea:%20Random%20server -NServers=1 -[Chatcafe] -0_Hostname=irc.chatcafe.net -0_Description=Chatcafe:%20Random%20server -NServers=1 -[ChatCentral2] -0_Hostname=irc.cc2.org -0_Description=ChatCentral2:%20Random%20server -NServers=1 -[ChatCircuit] -0_Hostname=irc.chatcircuit.com -0_Port=6668 -0_Description=ChatCircuit:%20Random%20server -NServers=1 -[ChatFactory] -0_Hostname=irc.chatfactory.net -0_Description=ChatFactory:%20Random%20server -1_Hostname=power.chatfactory.net -1_Description=ChatFactory:%20Brussels,%20EU -NServers=2 -[Chatlink] -0_Hostname=irc.chatlink.org -0_Description=Chatlink:%20Random%20server -NServers=1 -[Chatnet] -0_Hostname=au.chatnet.org -0_Description=Chatnet:%20Random%20AU%20server -1_Hostname=eu.chatnet.org -1_Description=Chatnet:%20Random%20EU%20server -2_Hostname=us.chatnet.org -2_Description=Chatnet:%20Random%20US%20server -NServers=3 -[ChatPR] -0_Hostname=irc.chatpr.org -0_Description=ChatPR:%20Random%20server -NServers=1 -[Chatpinoy] -0_Hostname=irc.chatpinoy.com -0_Description=Chatpinoy:%20Random%20server -NServers=1 -[Chatroom] -0_Hostname=irc.chatroom.org -0_Description=Chatroom:%20Random%20server -NServers=1 -[Chatsolutions] -0_Hostname=irc.chatsolutions.org -0_Description=Chatsolutions:%20Random%20server -NServers=1 -[Chatster] -0_Hostname=irc.chatster.org -0_Description=Chatster:%20Random%20server -NServers=1 -[ChatX] -0_Hostname=irc.chatx.net -0_Description=ChatX:%20Random%20server -NServers=1 -[CNN] -0_Hostname=chat.cnn.com -0_Description=CNN:%20CNN%20News%20discussions -NServers=1 -[Coolchat] -0_Hostname=irc.coolchat.net -0_Description=Coolchat:%20Random%20server -NServers=1 -[Criten] -0_Hostname=irc.criten.net -0_Description=Criten:%20Random%20server -NServers=1 -[Cyberchat] -0_Hostname=irc.cyberchat.org -0_Description=Cyberchat:%20Random%20server -NServers=1 -[CyGanet] -0_Hostname=irc.cyga.net -0_Description=CyGanet:%20Random%20server -NServers=1 -[DALnet] -0_Hostname=irc.dal.net -0_Description=Main%20Random%20Server -1_Hostname=as.dal.net -1_Description=Asia%20Random%20Server -2_Hostname=hotspeed.sg.as.dal.net -2_Description=Singapore%20Server -3_Hostname=mesra.kl.my.dal.net -3_Description=Malaysia%20Server -4_Hostname=ca.dal.net -4_Description=Canada%20Random%20Server -5_Hostname=maple.ix.ca.dal.net -5_Description=Maple%20Server -6_Hostname=toronto.on.ca.dal.net -6_Description=Toronto%20Server -7_Hostname=eu.dal.net -7_Description=Europe%20Random%20Server -8_Hostname=arcor.de.eu.dal.net -8_Description=Germany%20Server -9_Hostname=brain.hub.eu.dal.net -9_Description=HUB%20Server -10_Hostname=gaston.se.eu.dal.net -10_Description=Sweden%20Server -11_Hostname=genesis-r.uk.eu.dal.net -11_Description=UK%20Server -12_Hostname=matrix.de.eu.dal.net -12_Description=Germany%20Server -13_Hostname=mozilla.se.eu.dal.net -13_Description=Sweden%20Server -14_Hostname=powertech.no.eu.dal.net -14_Description=Norway%20Server -15_Hostname=waffle.ix.eu.dal.net -15_Description=Waffle%20Server -16_Hostname=us.dal.net -16_Description=USA%20Random%20Server -17_Hostname=aeon.nj.us.dal.net -17_Description=USA%20Server -18_Hostname=broadway.ny.us.dal.net -18_Description=USA%20Server -19_Hostname=hollywood.ix.us.dal.net -19_Description=USA%20Server -20_Hostname=jade.va.us.dal.net -20_Description=USA%20Server -21_Hostname=jingo.ix.us.dal.net -21_Description=USA%20Server -22_Hostname=loyalty.ix.us.dal.net -22_Description=USA%20Server -23_Hostname=masters.ix.us.dal.net -23_Description=USA%20Server -24_Hostname=novel.fl.us.dal.net -24_Description=USA%20Server -25_Hostname=punch.va.us.dal.net -25_Description=USA%20Server -26_Hostname=rangers.ix.us.dal.net -26_Description=USA%20Server -27_Hostname=redemption.ix.us.dal.net -27_Description=USA%20Server -28_Hostname=riga-r.ca.us.dal.net -28_Description=USA%20Server -29_Hostname=rumble.fl.us.dal.net -29_Description=USA%20Server -30_Hostname=serenity.ix.us.dal.net -30_Description=USA%20Server -31_Hostname=soho.ix.us.dal.net -31_Description=USA%20Server -32_Hostname=swiftco.wa.us.dal.net -32_Description=USA%20Server -NServers=33 -[Darkfire] -0_Hostname=irc.darkfire.net -0_Description=Darkfire:%20Random%20server -NServers=1 -[Darkfyre] -0_Hostname=irc.darkfyre.net -0_Description=Darkfyre:%20Random%20server -NServers=1 -[DarkMyst] -0_Hostname=irc.darkmyst.org -0_Description=DarkMyst:%20Random%20server -NServers=1 -[DarkServ] -0_Hostname=irc.darkserv.net -0_Description=DarkServ:%20Random%20server -NServers=1 -[Darktree] -0_Hostname=irc.darktree.net -0_Description=Darktree:%20Random%20server -NServers=1 -[Deepspace] -0_Hostname=irc.deepspace.org -0_Description=Deepspace:%20Disability%20network -NServers=1 -[Different] -0_Hostname=irc.different.net -0_Description=Different:%20Random%20server -NServers=1 -[Digarix] -0_Hostname=irc.digarix.net -0_Description=Digarix:%20Random%20server -NServers=1 -[Digatech] -0_Hostname=irc.digatech.net -0_Description=Digatech:%20Random%20server -NServers=1 -[Digitalirc] -0_Hostname=irc.digitalirc.net -0_Description=Digitalirc:%20Random%20server -NServers=1 -[Discussioni] -0_Hostname=irc.discussioni.org -0_Description=Discussioni%20random%20server -1_Hostname=ipv6.discussioni.org -1_Description=Experimental%20IPv6%20Server -1_Port=5776 -2_Hostname=Bolzano1.IT.Discussioni.Org -2_Description=Blozano1 -3_Hostname=Bolzano2.IT.Discussioni.Org -3_Description=Bolzano2 -4_Hostname=Chieti.IT.Discussioni.Org -4_Description=SSL%20ready%20server -4_Port=9999 -4_SSL=true -5_Hostname=Milano.IT.Discussioni.Org -5_Description=Milano -5_Port=6669 -6_Hostname=Roma.IT.Discussioni.Org -6_Description=Roma -6_Port=6669 -7_Hostname=Roma2.IT.Discussioni.Org -7_Description=Roma2 -7_Port=6668 -8_Hostname=Torino.IT.Discussioni.Org -8_Description=Torino -8_Port=6669 -NServers=9 -Description=Italian%20Network -[Dobbernet] -0_Hostname=irc.dobber.net -0_Description=Dobbernet:%20Random%20server -NServers=1 -[DogmNet] -0_Hostname=irc.dogm.net -0_Description=Main%20network%20server -1_Hostname=irc.rovno.ua -1_Description=Main%20UA%20server -2_Hostname=irc.chat.uz -2_Description=Main%20UZ%20server -NServers=3 -Description=Russian%20Network -Encoding=CP-1251 -[DragonLynk] -0_Hostname=irc.dragonlynk.net -0_Description=DragonLynk:%20Random%20server -NServers=1 -[Dreamcast] -0_Hostname=irc0.dreamcast.com -0_Description=Dreamcast:%20Random%20server -NServers=1 -[Dreamnet] -0_Hostname=irc.dreamnet.org -0_Description=Dreamnet:%20Random%20server -NServers=1 -[Dwarfstar] -0_Hostname=irc.dwarfstar.net -0_Description=DwarfStar:%20Random%20server -NServers=1 -[Dynastynet] -0_Hostname=irc.dynastynet.net -0_Description=Dynastynet:%20Random%20server -NServers=1 -[EFnet] -0_Hostname=irc.efnet.org -0_Description=Main%20Random%20Server -1_Hostname=irc.efnet.ca -1_Description=Canada%20Random%20Server -2_Hostname=irc.arcti.ca -2_Description=Calgary%20Server -3_Hostname=efnet.teleglobe.net -3_Description=Montreal%20Server -4_Hostname=irc.dks.ca -4_Description=Toronto%20Server -5_Hostname=ircd.arcti.ca -5_Description=Calgary%20HUB%20Server -6_Hostname=irc.igs.ca -6_Description=Toronto%20Server -7_Hostname=irc.efnet.eu -7_Description=Europe%20Random%20Server -8_Hostname=irc.dkom.at -8_Description=Vienna%20Server -9_Hostname=irc.efnet.pl -9_Description=Warsaw%20Server -10_Hostname=efnet.ipv6.xs4all.nl -10_Description=Amsterdam%20IPv6%20Server -11_Hostname=irc.du.se -11_Description=Borlange%20Server -12_Hostname=efnet.cs.hut.fi -12_Description=Helsinki%20Server -13_Hostname=irc.inter.net.il -13_Description=Tel%20Aviv%20Server -14_Hostname=irc.inet.tele.dk -14_Description=Aarhus%20Server -15_Hostname=irc.ipv6.inter.net.il -15_Description=Tel%20Aviv%20IPv6%20Server -16_Hostname=irc.homelien.no -16_Description=Oslo%20IPv6%20Server -17_Hostname=ircd.efnet.no -17_Description=Oslo%20HUB%20Server -18_Hostname=efnet.xs4all.nl -18_Description=Amsterdam%20Server -19_Hostname=hub.il -19_Description=EFnet%20Israel%20HUB%20Server -20_Hostname=irc.efnet.ru -20_Description=Moscow%20Server -21_Hostname=irc.efnet.no -21_Description=Oslo%20Server -22_Hostname=irc.daxnet.no -22_Description=Oslo%20Server -23_Hostname=irc.efnet.fr -23_Description=Paris%20Server -24_Hostname=hub.se -24_Description=EFnet%20Sweden%20HUB%20Server -25_Hostname=hub.efnet.nl -25_Description=EFnet%20Netherlands%20HUB%20Server -26_Hostname=irc.ac.za -26_Description=South%20Africa%20IPv6%Server -27_Hostname=efnet.port80.se -27_Description=Stockholm%20IPv6%20Server -28_Hostname=irc.dataphone.se -28_Description=Stockholm%20Server -29_Hostname=irc.efnet.nl -29_Description=Ede%20Server -30_Hostname=efnet.demon.co.uk -30_Description=London%20Server -31_Hostname=hub.uk -31_Description=EFnet%20UK%20HUB%20Server -32_Hostname=hub.dk -32_Description=EFnet%20Denmark%20HUB%20Server -33_Hostname=irc.pte.hu -33_Description=Pecs%20Server -34_Hostname=irc.efnet.us -34_Description=USA%20Random%20Server -35_Hostname=irc.colosolutions.net -35_Description=Orlando%20Server -36_Hostname=irc.umich.edu -36_Description=Ann%20Arbor%20Server -37_Hostname=irc.desync.com -37_Description=Tampa%20Server -38_Hostname=irc.easynews.com -38_Description=Phoenix%20Server -39_Hostname=chat.efnet.org -39_Description=Chicago%20Server -40_Hostname=irc.servercentral.net -40_Description=Chicago%20Server -41_Hostname=ircd.he.net -41_Description=Fremont%20HUB%20Server -42_Hostname=irc.umn.edu -42_Description=Minneapolis%20Server -43_Hostname=irc.mzima.net -43_Description=Los%20Angeles%20Server -44_Hostname=irc.eversible.com -44_Description=Miami%20Server -45_Hostname=ircd.desync.com -45_Description=Tampa%20HUB%20Server -46_Hostname=irc.SHOUTcast.com -46_Description=Dulles%20Server -47_Hostname=irc.vel.net -47_Description=Los%20Angeles%20Server -48_Hostname=irc.ptptech.com -48_Description=Ashburn%20IPv6%20Server -49_Hostname=hub.efnet.us -49_Description=USA%20HUB%20Server -50_Hostname=irc2.choopa.net -50_Description=New%20York%20Server -51_Hostname=ircd.llnw.net -51_Description=Phoenix%20HUB%20Server -52_Hostname=irc.blackened.com -52_Description=Phoenix%20Server -53_Hostname=irc.choopa.net -53_Description=New%20York%20IPv6%20Server -54_Hostname=ircd.nac.net -54_Description=New%20York%20HUB%20Server -55_Hostname=irc.nac.net -55_Description=New%20York%20Server -56_Hostname=ircd.choopa.net -56_Description=New%20York%20HUB%20Server -57_Hostname=irc.blessed.net -57_Description=Maitland%20Server -58_Hostname=irc.prison.net -58_Description=San%20Francisco%20Server -59_Hostname=irc.wh.verio.net -59_Description=Reston%20Server -60_Hostname=irc.mindspring.com -60_Description=Atlanta%20Server -61_Hostname=irc.he.net -61_Description=Fremont%20Server -NServers=62 -[EgyptianIRC] -0_Hostname=irc.egyptianirc.net -0_Description=EgyptianIRC:%20Random%20server -NServers=1 -[Eleethal] -0_Hostname=irc.eleethal.com -0_Description=Eleethal:%20Random%20server -NServers=1 -[EnterTheGame] -0_Hostname=irc.enterthegame.com -0_Description=EntertheGame:%20Random%20server -NServers=1 -[Escaped] -0_Hostname=irc.escaped.net -0_Description=Escaped:%20Random%20server -NServers=1 -[Esprit] -0_Hostname=irc.esprit.net -0_Description=Esprit:%20Random%20server -NServers=1 -[euIRC] -0_Hostname=irc.euirc.net -0_Description=euIRC:%20Random%20server -NServers=1 -[EuropNet] -0_Hostname=irc.europnet.org -0_Description=EuropNet round robin -1_Hostname=irc.free.fr -1_Description=Free irc server -2_Hostname=irc.librenet.net -2_Description=Librenet network server -3_Hostname=irc.global-irc.net -3_Description=Global-irc server -NServers=4 -Description=French%20Network -[ExodusIRC] -0_Hostname=irc.exodusirc.net -0_Description=ExodusIRC:%20Random%20server -NServers=1 -[FDFnet] -0_Hostname=irc.fdf.net -0_Description=FDFnet:%20Random%20server -NServers=1 -[FEFnet] -0_Hostname=irc.fef.net -0_Description=FEFnet:%20Random%20server -NServers=1 -[Forestnet] -0_Hostname=irc.forestnet.org -0_Description=Forestnet:%20Random%20server -NServers=1 -[FreedomChat] -0_Hostname=chat.freedomchat.net -0_Description=FreedomChat:%20Random%20server -NServers=1 -[Freenode] -0_Hostname=irc.freenode.org -0_Description=Main Freenode router -1_Hostname=chat.ap.freenode.net -1_Description=Main%20Asia-Pacific%20router -2_Hostname=tolkien.freenode.net -2_Description=Taoyuan,%20Taiwan -3_Hostname=chat.au.freenode.net -3_Description=Main%20Australia%20router -4_Hostname=asimov.freenode.net -4_Description=Brisbane,%20Australia -5_Hostname=chat.eu.freenode.net -5_Description=Main%20Europe%20router -6_Hostname=kornbluth.freenode.net -6_Description=Frankfurt,%20Germany -7_Hostname=orwell.freenode.net -7_Description=Helsinki,%20Finland -8_Hostname=sterling.freenode.net -8_Description=Hoofddorp,%20Netherland -9_Hostname=calvino.freenode.net -9_Description=Milano,%20Italy -10_Hostname=adams.freenode.net -10_Description=Oslo,%20Norway -11_Hostname=gibson.freenode.net -11_Description=Oslo,%20Norway -12_Hostname=leguin.freenode.net -12_Description=Umea,%20Sweden -13_Hostname=lem.freenode.net -13_Description=Moscow,%20Russia -14_Hostname=pratchett.freenode.net -14_Description=London,%20United%20Kingdom -15_Hostname=ipv6.chat.eu.freenode.net -15_Description=Main%20Europe%20IPv6%20router -16_Hostname=goethe.freenode.net -16_Description=Hoofddorp,%20Netherland -17_Hostname=calkins.freenode.net -17_Description=Milano,%20Italy -18_Hostname=crichton.freenode.net -18_Description=Oslo,%20Norway -19_Hostname=chat.us.freenode.net -19_Description=Main%20USA%20router -20_Hostname=einstein.freenode.net -20_Description=Corvallis,%20OR,%20USA -21_Hostname=niven.freenode.net -21_Description=Corvallis,%20OR,%20USA -22_Hostaname=zelazny.freenode.net -22_Description=Corvallis,%20OR,%20USA -23_Hostname=zahn.freenode.net -23_Description=Corvallis,%20OR,%20USA -24_Hostname=brown.freenode.net -24_Description=Madison,%20WI,%20USA -25_Hostname=anthony.freenode.net -25_Description=Irvine,%20CA,%20USA -NServers=26 -Description=The%20FOSS%20Network -[FunNet] -0_Hostname=irc.funnet.org -0_Description=FunNet:%20Random%20server -NServers=1 -[GalaxyNet] -0_Hostname=irc.galaxynet.org -0_Description=Galaxynet:%20Random%20server -1_Hostname=auckland.nz.galaxynet.org -1_Description=Galaxynet:%20AU,%20NZ,%20Auckland -2_Hostname=freei.us.galaxynet.org -2_Description=Galaxynet:%20US,%20WA,%20Seattle -3_Hostname=gymnet.us.galaxynet.org -3_Description=Galaxynet:%20US,%20FL,%20Florida -4_Hostname=online.be.galaxynet.org -4_Description=Galaxynet:%20EU,%20BE,%20Online -5_Hostname=vltmedia.se.galaxynet.org -5_Description=Galaxynet:%20EU,%20SE,%20Vltmedia -NServers=6 -[Gamesnet] -0_Hostname=east.gamesnet.net -0_Description=Gamesnet:%20Random%20east%20US%20server -1_Hostname=west.gamesnet.net -1_Description=Gamesnet:%20Random%20west%20US%20server -NServers=2 -[Gameznet] -0_Hostname=irc.gameznet.com -0_Description=Gameznet:%20Random%20server -NServers=1 -[GizNet] -0_Hostname=irc.giznet.com -0_Description=GizNet:%20Random%20server -NServers=1 -[Globalchat] -0_Hostname=irc.globalchat.org -0_Description=Globalchat:%20Random%20server -NServers=1 -[GRnet] -0_Hostname=srv.irc.gr -0_Description=Grnet:%20Random%20server -1_Hostname=gr.irc.gr -1_Description=Grnet:%20Random%20EU%20server -2_Hostname=us.irc.gr -2_Description=Grnet:%20Random%20US%20server -NServers=3 -[HabberNet] -0_Hostname=irc.habber.net -0_Description=HabberNet:%20Random%20server -NServers=1 -[HanIRC] -0_Hostname=irc.hanirc.org -0_Description=HanIRC:%20Random%20server -NServers=1 -[Hellenicnet] -0_Hostname=irc.mirc.gr -0_Description=Hellenicnet:%20Random%20server -NServers=1 -[Hybnet] -0_Hostname=irc.hybnet.net -0_Description=Hybnet:%20Random%20server -NServers=1 -[ICQnet] -0_Hostname=irc.icq.com -0_Description=ICQnet:%20Random%20server -NServers=1 -[Infatech] -0_Hostname=irc.infatech.net -0_Description=Infatech:%20Random%20server -NServers=1 -[Infinity] -0_Hostname=irc.infinity-irc.org -0_Description=Infinity:%20Random%20server -NServers=1 -[Infomatrix] -0_Hostname=irc.infomatrix.net -0_Description=Infomatrix:%20Random%20server -NServers=1 -[IRC.by] -0_Hostname=irc.by -0_Description=Random%20server -NServers=1 -Description=The%20Biggest%20Belarus%20Network -Encoding=CP-1251 -[IRC-Hispano] -0_Hostname=irc.irc-hispano.org -0_Description=IRC-Hispano:%20Random%20server -NServers=1 -Description=Spanish%20Network -[IRCGnet] -0_Hostname=irc.ircgnet.net -0_Description=IRCGNet:%20Main%20service -1_Hostname=irc.ircgnet.net -1_Description=IRCGNet:%20SSL%20service -1_Port=6697 -2_Hostname=ops.ircgnet.net -2_Description=IRCGnet:%20Alternate%20service -NServers=3 -[IRChat] -0_Hostname=irc.irchat.net -0_Description=IRChat:%20Random%20server -NServers=1 -[IRChat-br] -0_Hostname=irc.irchat.com.br -0_Description=IRChat-br:%20Random%20server -NServers=1 -[IRCItalia] -0_Hostname=cagliari.ircitalia.net -0_Description=IRCItalia%20network -1_Hostname=campania.italiachat.net -1_Description=ItaliaChat%20network -2_Hostname=cosenza.ircitalia.net -2_Description=IRCItalia%20network -3_Hostname=lazio.italiachat.net -3_Description=ItaliaChat%20network%20main%20server -4_Hostname=pagana.italiachat.net -4_Description=Pagana%20IPv6%20server%20(SSL%20ready) -4_Port=7000 -5_Hostname=palermo.ircitalia.net -5_Description=IRCItalia%20network -6_Hostname=roma.italiachat.net -6_Description=ItaliaChat%20network -7_Hostname=trapani.ircitalia.net -7_Description=IRCItalia%20network -NServers=8 -[IRCLand] -0_Hostname=irc.ircland.org -0_Description=IRCLand%20random%20server -1_Hostname=maverick.ircland.org -1_Description=maverick -2_Hostname=power.ircland.org -2_Description=power -3_Hostname=white.ircland.org -3_Description=white -NServers=4 -[IRCLink] -0_Hostname=alesund.no.eu.irclink.net -0_Description=IRCLink:%20EU,%20NO,%20Alesund -1_Hostname=frogn.no.eu.irclink.net -1_Description=IRCLink:%20EU,%20NO,%20Oslo -2_Hostname=rockhill.sc.us.irclink.net -2_Description=IRCLink:%20US,%20SC,%20Rock%20Hill -NServers=3 -[IRCnet] -0_Hostname=irc.ircnet.org -0_Description=Main%20Random%20Server -1_Hostname=eu.ircnet.org -1_Description=Europe%20Random%20Server -2_Hostname=ix.irc.at -2_Description=IX%20Server -3_Hostname=linz.irc.at -3_Description=Linz%20Server -4_Hostname=vienna.irc.at -4_Description=Vienna%20Server -5_Hostname=ircnet.realroot.be -5_Description=RealROOT%20Server -6_Hostname=irc.datacomm.ch -6_Description=Datacomm%20Server -7_Hostname=irc.osanet.cz -7_Description=OSANET%20Server -8_Hostname=irc.i.cz -8_Description=ICZ%20Server -9_Hostname=irc.felk.cvut.cz -9_Description=Prague%20Server -10_Hostname=irc.leo.org -10_Description=LEO%20Server -11_Hostname=irc.belwue.de -11_Description=BelWue%20Server -12_Hostname=irc.freenet.de -12_Description=Freenet%20Server -13_Hostname=uni-erlangen.de -13_Description=University%20Of%20Nurnberg%20Server -14_Hostname=uni-karlsruhe.de -14_Description=University%20Of%20Karlsruhe%20Server -15_Hostname=tu-ilmenau.de -15_Description=University%20Of%20Ilmenau%20Server -16_Hostname=fu-berlin.de -16_Description=University%20Of%20Berlin%20Server -17_Hostname=irc.estpak.ee -17_Description=Elion%20Server -18_Hostname=irc.datanet.ee -18_Description=Linxtelecom%20Server -19_Hostname=irc.starman.ee -19_Description=Starman%20Server -20_Hostname=irc.opoy.fi -20_Description=Oulu%20Telephone%20Server -21_Hostname=irc.cs.hut.fi -21_Description=University%20Of%20Helsinki%20Server -22_Hostname=irc.elisa.fi -22_Description=Elisa%20Oyj%20Server -23_Hostname=irc.utu.fi -23_Description=University%20Of%20Turku%20Server -24_Hostname=irc.song.fi -24_Description=TDC%20Song%20Server -25_Hostname=irc1.inet.fi -25_Description=iNET%20Server -26_Hostname=irc.oulu.fi -26_Description=University%20Of%20Olutensin%20Server -27_Hostname=irc.jyu.fi -27_Description=University%20Of%20Jyvaskyla%20Server -28_Hostname=hub.cc.tut.fi -28_Description=Tampere%20Server -29_Hostname=irc.lut.fi -29_Description=University%20Of%20Ranta%20Server -30_Hostname=irc.cc.tut.fi -30_Description=Tampere%20Server -31_Hostname=irc.oamk.fi -31_Description=OuluNet%20Server -32_Hostname=ircnet.club-internet.fr -32_Description=T-Online%20France%20Server -33_Hostname=ircnet.nerim.fr -33_Description=Nerim%20Server -34_Hostname=elte.irc.hu -34_Description=University%20Of%20Budapest -35_Hostname=atw.irc.hu -35_Description=ATW%20Server -36_Hostname=extra.irc.hu -36_Description=Extra%20Server -37_Hostname=ssl.atw.irc.hu -37_Description=ATW%20Server -38_Hostname=hub.irc.hu -38_Description=Godollo%20HUB%20Server -39_Hostname=ircnet.netvision.net.il -39_Description=NetVision%20Server -40_Hostname=irc.simnet.is -40_Description=Iceland%20Telecom%20Server -41_Hostname=irc.hi.is -41_Description=University%20Of%20Iceland%20Server -42_Hostname=ircd.simnet.is -42_Description=Iceland%20Telecom%20HUB%20Server -43_Hostname=irc1.tiscali.it -43_Description=Tiscali%20Server -44_Hostname=javairc.tiscali.it -44_Description=Tiscali%20Server -45_Hostname=javairc2.tiscali.it -45_Description=Tiscali%20Server -46_Hostname=irc.flashnet.it -46_Description=Cybernet%20Italia%20Server -47_Hostname=irc.eutelia.it -47_Description=Eutelia%20Server -48_Hostname=irc.excite.it -48_Description=Excite%20Italia%20Server -49_Hostname=irc1.tin.it -49_Description=Telecom%20Italia%20Server -50_Hostname=irc2.tin.it -50_Description=Telecom%20Italia%20Server -51_Hostname=irc3.tin.it -51_Description=Telecom%20Italia%20Server -52_Hostname=ircd.tin.it -52_Description=Telecom%20Italia%20HUB%20Server -53_Hostname=irc.huie.hokudai.ac.jp -53_Description=University%20Of%20Hokkaido -54_Hostname=irc.nara.wide.ad.jp -54_Description=WIDE%20Project%20Nara%20NOC%20Server -55_Hostname=irc.tokyo.wide.ad.jp -55_Description=WIDE%20Project%20Tokyo%20NOC%20Server -56_Hostname=irc.fujisawa.wide.ad.jp -56_Description=WIDE%20Project%20Fujisawa%20NOC%20Server -57_Hostname=irc.media.kyoto-u.ac.jp -57_Description=Kyoto%20Server -58_Hostname=irc-new.media.kyoto-u.ac.jp -58_Description=Kyoto%20Server -59_Hostname=irc.apollo.lv -59_Description=Apollo%20Server -60_Hostname=ircd.snt.utwente.nl -60_Description=University%20Of%20Twente%20HUB%20Server -61_Hostname=irc.snt.utwente.nl -61_Description=University%20Of%20Twente%20Server -62_Hostname=irc.sci.kun.nl -62_Description=University%20Of%20Nijmegen%20Server -63_Hostname=irc.uunet.nl -63_Description=UUNET%20NL%20Server -64_Hostname=irc.xs4all.nl -64_Description=XS4ALL%20Server -65_Hostname=irc.ifi.uio.no -65_Description=University%20Of%20Oslo%20Server -66_Hostname=irc.pvv.ntnu.no -66_Description=IRCNO%20Server -67_Hostname=irc.hitos.no -67_Description=Tromsoe%20Server -68_Hostname=irc.powertech.no -68_Description=PowerTech%20Server -69_Hostname=irc.uib.no -69_Description=University%20Of%20Bergen -70_Hostname=uk.ircnet.org -70_Description=UK%20Random%20Server -71_Hostname=ircnet.demon.co.uk -71_Description=THUS%20Server -72_Hostname=irc.aau.dotsrc.org -72_Description=AAU%20DotSrc%20Server -73_Hostname=irc.dotsrc.org -73_Description=DotSrc%20Server -74_Hostname=warszawa.irc.pl -74_Description=ICM%20Server -75_Hostname=poznan.irc.pl -75_Description=UAM%20Server -76_Hostname=krakow.irc.pl -76_Description=AGH%20Server -77_Hostname=lublin.irc.pl -77_Description=UMCS%20Server -78_Hostname=irc.swipnet.se -78_Description=Tele2%20Sweden%20Server -79_Hostname=irc.desync.se -79_Description=IRCnet%20Project%20Server -80_Hostname=irc.okit.se -80_Description=OK%20IT%20AB%20Server -81_Hostname=irc.ludd.luth.se -81_Description=Lulea%20Server -82_Hostname=irc.arnes.si -82_Description=ARNES%20Server -83_Hostname=irc.triera.si -83_Description=Triera%20Server -84_Hostname=irc.fei.tuke.sk -84_Description=TUKE%20Server -85_Hostname=irc.nextra.sk -85_Description=Nextra%20Server -86_Hostname=irc.seed.net.tw -86_Description=Seednet%20Server -87_Hostname=irc.freebsd.org.tw -87_Description=FreeBSD.org%20Server -88_Hostname=us.ircnet.org -88_Description=USA%20Random%20Server -89_Hostname=ircnet.choopa.net -89_Description=Choopa,%20Inc%20Server -90_Hostname=temphub.choopa.net -90_Description=Choopa,%20Inc%20Server -91_Hostname=au.ircnet.org -91_Description=Australia%20Random%20Server -92_Hostname=eu.irc6.net -92_Description=Europe%20Random%20IPv6%20Server -93_Hostname=irc.ipv6.cesnet.cz -93_Description=CESNET2%20IPv6%20Server -94_Hostname=ircs.ircnet.ee -94_Description=IPv6%20Server -95_Hostname=irc.estpak.ee -95_Description=Elion%20Enterprises%20IPv6%20Server -96_Hostname=irc.datanet.ee -96_Description=Linxtelecom%20IPv6%20Server -97_Hostname=irc.starman.ee -97_Description=Starman%20IPv6%20Server -98_Hostname=irc6.ngnet.it -98_Description=Telecom%20Italia%20IPv6%20Server -99_Hostname=irc.eutelia.it -99_Description=Eutelia%20IPv6%20Server -100_Hostname=irc.powertech.no -100_Description=PowerTech%20IPv6%20Server -NServers=101 -[Irctoo] -0_Hostname=irc.irctoo.net -0_Description=Irctoo:%20Random%20server -NServers=1 -[IRCworld] -0_Hostname=irc.ircworld.org -0_Description=IRCworld:%20Random%20server -NServers=1 -[IsraelNet] -0_Hostname=irc.israel.net -0_Description=Israelnet:%20Random%20server -NServers=1 -[K0wNet] -0_Hostname=irc.k0w.net -0_Description=K0wNet:%20Random%20server -NServers=1 -[KewlOrg] -0_Hostname=irc.kewl.org -0_Description=Kewl.org:%20Random%20server -1_Hostname=london.uk.eu.kewl.org -1_Description=Kewl.org:%20EU,%20UK,%20London -2_Hostname=nanterre.fr.eu.kewl.org -2_Description=Kewl.org:%20EU,%20FR,%20Nanterre -NServers=3 -[Kreynet] -0_Hostname=irc.krey.net -0_Description=KreyNet:%20Random%20server -NServers=1 -[Krushnet] -0_Hostname=irc.krushnet.org -0_Description=Krushnet:%20Random%20server -NServers=1 -[LagNet] -0_Hostname=irc.lagnet.org.za -0_Description=LagNet:%20Random%20server -1_Hostname=mystery.lagnet.org.za -1_Description=LagNet:%20AF,%20ZA,%20Johannesburg -2_Hostname=reaper.lagnet.org.za -2_Description=LagNet:%20AF,%20ZA,%20Cape%20Town -NServers=3 -[Librenet] -0_Hostname=irc.librenet.net -0_Description=Librenet:%20Random%20server -NServers=1 -[Lunatics] -0_Hostname=irc.lunatics.net -0_Description=Lunatics:%20Random%20server -NServers=1 -[KidsWorld] -0_Hostname=irc.kidsworld.org -0_Description=Kidsworld:%20Random%20server -NServers=1 -[Knightnet] -0_Hostname=goldengate.ca.us.knightnet.net -0_Description=Knightnet:%20US,%20CA,%20Goldengate -1_Hostname=orc.dbn.za.knightnet.net -1_Description=Knightnet:%20AF,%20ZA,%20Durban -NServers=2 -[MagicStar] -0_Hostname=irc.magicstar.net -0_Description=MagicStar:%20Random%20server -NServers=1 -[MediaDriven] -0_Hostname=irc.mediadriven.com -0_Description=MediaDriven:%20Random%20server -NServers=1 -[Messique] -0_Hostname=irc.messique.org -0_Description=Messique:%20Random%20server -NServers=1 -[Mysteria] -0_Hostname=irc.mysteria.net -0_Description=Mysteria:%20Random%20server -NServers=1 -[Mystical] -0_Hostname=irc.mystical.net -0_Description=Mystical:%20Random%20server -NServers=1 -[NdrsNet] -0_Hostname=irc.ndrsnet.com -0_Description=NdrsNet:%20Random%20server -NServers=1 -[Net-France] -0_Hostname=irc.net-france.com -0_Description=Net-France:%20Random%20server -NServers=1 -[Nevernet] -0_Hostname=irc.nevernet.net -0_Description=Nevernet:%20Random%20server -NServers=1 -[NewIRC] -0_Hostname=irc.newirc.org -0_Description=NewIRC:%20Random%20server -NServers=1 -[Newnet] -0_Hostname=irc.chelmsford.com -0_Description=Newnet:%20US,%20MA,%20Chelmsford -1_Hostname=irc.fragglerock.org -1_Description=Newnet:%20US,%20CA,%20Flagglerock -2_Hostname=irc.newnet.net -2_Description=Newnet:%20Random%20server -3_Hostname=irc.oasis-net.net -3_Description=Newnet:%20EU,%20UK,%20Oasis -4_Hostname=irc.rma.edu -4_Description=Newnet:%20US,%20VA,%20Randolph -5_Hostname=irc.trusted-network.de -5_Description=Newnet:%20EU,%20DE,%20Trusted -6_Hostname=irc.uplink.net.nz -6_Description=Newnet:%20NZ,%20Auckland -NServers=7 -[Nexusirc] -0_Hostname=irc.nexusirc.org -0_Description=Nexusirc:%20Random%20server -NServers=1 -[NightStar] -0_Hostname=irc.nightstar.net -0_Description=Nightstar:%20Random%20server -NServers=1 -[NitroNet] -0_Hostname=irc.nitro.net -0_Description=NitroNet:%20Random%20server -NServers=1 -[Novernet] -0_Hostname=irc.novernet.com -0_Description=Novernet:%20Random%20server -1_Hostname=chat.novernet.com -1_Description=Novernet:%20US,%20MN,%20Minneapolis -2_Hostname=irc.c-plusnet.com -2_Description=Novernet:%20US,%20GA,%20Augusta -NServers=3 -[Oddnet] -0_Hostname=irc.oddnet.org -0_Description=Oddnet:%20Random%20server -NServers=1 -[Othernet] -0_Hostname=irc.othernet.org -0_Description=Othernet:%20Random%20server -1_Hostname=miami.fl.us.othernet.org -1_Description=Othernet:%20US,%20FL,%20Miami -2_Hostname=stlouis.mo.us.othernet.org -2_Description=Othernet:%20US,%20MO,%20StLouis -NServers=3 -[OtherSide] -0_Hostname=irc.othersideirc.net -0_Description=Otherside:%20Random%20server -NServers=1 -[Outsiderz] -0_Hostname=irc.outsiderz.com -0_Description=Outsiderz:%20Random%20server -NServers=1 -[OzOrg] -0_Hostname=aussie.sydney.oz.org -0_Description=OzOrg:%20AU,%20Sydney -1_Hostname=chariot.adelaide.oz.org -1_Description=OzOrg:%20AU,%20Adelaide -2_Hostname=iinet.perth.oz.org -2_Description=OzOrg:%20AU,%20Perth -NServers=3 -Description=Australian%20Network -[Philchat] -0_Hostname=irc.philchat.net -0_Description=Philchat:%20Random%20server -NServers=1 -[Pinoycentral] -0_Hostname=chat.abs-cbn.com -0_Description=Pinoycentral:%20Random%20server -NServers=1 -[Planetarion] -0_Hostname=irc.planetarion.com -0_Description=Planetarion:%20Random%20server -NServers=1 -[PortalX] -0_Hostname=irc.portalx.org -0_Description=PortalX:%20Random%20server -1_Hostname=aphrodite.portalx.org -1_Description=PortalX:%20Aphrodite -2_Hostname=apollo.portalx.org -2_Description=PortalX:%20Apollo -3_Hostname=ares.portalx.org -3_Description=PortalX:%20Ares -4_Hostname=athena.portalx.org -4_Description=PortalX:%20Athena -5_Hostname=demeter.portalx.org -5_Description=PortalX:%20Demeter -6_Hostname=eos.portalx.org -6_Description=PortalX:%20Eos -7_Hostname=thor.portalx.org -7_Description=PortalX:%20Thor -8_Hostname=zeus.portalx.org -8_Description=PortalX:%20Zeus -NServers=9 -[Psionics] -0_Hostname=chat.psionics.net -0_Description=Psionics:%20CA,%20PQ,%20Montreal -NServers=1 -[PTlink] -0_Hostname=irc.ptlink.net -0_Description=PTlink:%20Random%20server -NServers=1 -[PTnet] -0_Hostname=telepac2.ptnet.org -0_Description=PTnet:%20EU,%20PT,%20Lisboa -1_Hostname=ualg.ptnet.org -1_Description=PTnet:%20EU,%20PT,%20Faro -NServers=2 -[QChat] -0_Hostname=irc.qchat.net -0_Description=QChat:%20Random%20server -NServers=1 -[QuakeNet] -0_Hostname=irc.quakenet.org -0_Description=Main%20Random%20Server -1_Hostname=irc.quakenet.eu.org -1_Description=Europe%20Random%20Server -2_Hostname=jubiigames.dk.quakenet.org -2_Description=Denmark%20Server -3_Hostname=mediatraffic.fi.quakenet.org -3_Description=Finland%20Server -4_Hostname=euroserv.fr.quakenet.org -4_Description=France%20Server -5_Hostname=splatterworld.de.quakenet.org -5_Description=Germany%20Server -6_Hostname=ign.ie.quakenet.org -6_Description=Ireland%20Server -7_Hostname=ngi.it.quakenet.org -7_Description=Italy%20Server -8_Hostname=xs4all.nl.quakenet.org -8_Description=Netherlands%20Server -9_Hostname=online.no.quakenet.org -9_Description=Norway%20Server -10_Hostname=underworld.no.quakenet.org -10_Description=Norway%20Server -11_Hostname=port80.se.quakenet.org -11_Description=Sweden%20Server -12_Hostname=stockholm.se.quakenet.org -12_Description=Sweden%20Server -13_Hostname=wineasy.se.quakenet.org -13_Description=Sweden%20Server -14_Hostname=b0rk.uk.quakenet.org -14_Description=UK%20Server -15_Hostname=blueyonder.uk.quakenet.org -15_Description=UK%20Server -16_Hostname=demon.uk.quakenet.org -16_Description=UK%20Server -17_Hostname=freddyshouse.uk.quakenet.org -17_Description=UK%20Server -18_Hostname=multiplay.uk.quakenet.org -18_Description=UK%20Server -19_Hostname=gameservers.il.us.quakenet.org -19_Description=USA%20Server -20_Hostname=gameservers.nj.us.quakenet.org -20_Description=USA%20Server -21_Hostname=netfire.tx.us.quakenet.org -21_Description=USA%20Server -22_Hostname=netfire.va.us.quakenet.org -22_Description=USA%20Server -23_Hostname=servercentral.il.us.quakenet.org -23_Description=USA%20Server -NServers=24 -[Raptornet] -0_Hostname=irc.raptornet.org -0_Description=Raptornet:%20Random%20server -NServers=1 -[Realirc] -0_Hostname=irc.realirc.org -0_Description=Realirc:%20Random%20server -NServers=1 -[Rebelchat] -0_Hostname=irc.rebelchat.org -0_Description=Rebelchat:%20Random%20server -NServers=1 -[RedeSul] -0_Hostname=irc.braznet.com.br -0_Description=RedeSul:%20BR,%20SC,%20Blumenau -1_Description=RedeSul:%20BR,%20PR,%20Maringa -1_Hostname=irc.wnet.com.br -NServers=2 -[Red-Latina] -0_Hostname=irc.red-latina.org -0_Description=Red-Latina:%20Random%20server -1_Hostname=irc.dalsom.net -1_Description=Red-Latina:%20NA,%20MX,%20SanJose -NServers=2 -[RedLatona] -0_Hostname=irc.redlatona.net -0_Description=RedLatona:%20Random%20server -NServers=1 -[Relicnet] -0_Hostname=irc.relic.net -0_Description=Relicnet:%20Random%20server -NServers=1 -[Rezosup] -0_Hostname=irc.rezosup.org -0_Description=Rezosup:%20Random%20server -NServers=1 -[Risanet] -0_Hostname=irc.risanet.com -0_Description=Risanet:%20Random%20server -NServers=1 -[Rusnet] -0_Hostname=irc.rinet.ru -0_Description=Rusnet:%20EU,%20RU,%20Moscow -1_Hostname=irc.tomsk.net -1_Description=Rusnet:%20EU,%20RU,%20Tomsk -2_Hostname=irc.primorye.ru -2_Description=Rusnet:%20EU,%20RU,%20Vladivostok -NServers=3 -Description=Russian%20Network -Encoding=CP-1251 -[Sandnet] -0_Hostname=irc.sandnet.net -0_Description=Sandnet:%20Random%20server -NServers=1 -[Scunc] -0_Hostname=irc.scunc.net -0_Description=Scunc:%20Random%20server -NServers=1 -[SexNet] -0_Hostname=irc.sexnet.org -0_Description=SexNet:%20Random%20server -NServers=1 -[ShadowFire] -0_Hostname=irc.shadowfire.org -0_Description=ShadowFire:%20Random%20server -NServers=1 -[ShadowWorld] -0_Hostname=irc.shadowworld.net -0_Description=ShadowWorld:%20Random%20server -NServers=1 -[Skyyenet] -0_Hostname=arlington.va.us.skyyenet.org -0_Description=Skyyenet:%20US,%20VA,%20Arlington -NServers=1 -[Slashnet] -0_Hostname=irc.slashnet.org -0_Description=Slashnet:%20Random%20server -NServers=1 -[SolarNet] -0_Hostname=irc.solarnet.ru -0_Description=Main%20network%20server -NServers=1 -Description=Russian%20Network -Encoding=CP-1251 -[SolidIRC] -0_Hostname=irc.solidirc.com -0_Description=SolidIRC:%20Random%20server -NServers=1 -[Sorcery] -0_Hostname=irc.sorcery.net -0_Description=Sorcerynet:%20Random%20server -1_Hostname=kechara.sorcery.net -1_Description=Sorcerynet:%20US,%20CA,%20Palo%20Alto -2_Hostname=nexus.sorcery.net -2_Description=Sorcerynet:%20EU,%20SE,%20Karlskrona -NServers=3 -[Spamnet] -0_Hostname=irc.spamnet.org -0_Description=Spamnet:%20Random%20server -NServers=1 -[StarChat] -0_Hostname=irc.starchat.net -0_Description=StarChat:%20Random%20server -1_Hostname=boomer.qld.au.starchat.net -1_Description=StarChat:%20AU,%20QLD,%20SouthernCross -2_Hostname=reality.no.eu.starchat.net -2_Description=StarChat:%20EU,%20NO,%20Asker -3_Hostname=sand.ca.us.starchat.net -3_Description=StarChat:%20US,%20CA,%20San%20Jose -NServers=4 -[StarLink] -0_Hostname=irc.starlink.org -0_Description=StarLink%20Org:%20Random%20server -NServers=1 -[StarLink-irc] -0_Hostname=irc.starlink-irc.org -0_Description=StarLink-irc:%20Random%20server -NServers=1 -[StarWars-IRC] -0_Hostname=irc.starwars-irc.net -0_Description=StarWars-IRC:%20Random%20server -NServers=1 -[Stormdancing] -0_Hostname=irc.stormdancing.net -0_Description=Stormdancing:%20Random%20server -NServers=1 -[Sub-city] -0_Hostname=irc.sub-city.net -0_Description=Sub-city:%20Random%20server -NServers=1 -[Superchat] -0_Hostname=irc.superchat.org -0_Description=Superchat:%20Random%20server -NServers=1 -[SyrolNet] -0_Hostname=irc.syrolnet.org -0_Description=SyrolNet%20round%20robin -1_Hostname=ipv6.syrolnet.org -1_Description=IPv6%20round%20robin -2_Hostname=moon.syrolnet.org -2_Description=Moon%20irc%20server -3_Hostname=phobos.syrolnet.org -3_Description=IPv6/IPv4%20server -NServers=4 -Description=Italian%20Network -[Sysopnet] -0_Hostname=irc.sysopnet.org -0_Description=Sysopnet:%20Random%20server -NServers=1 -[Techdreams] -0_Hostname=irc.techdreams.net -0_Description=Techdreams:%20Random%20server -NServers=1 -[Telstra] -0_Hostname=irc.telstra.com -0_Description=Telstra:%20Random%20server -NServers=1 -[Terra] -0_Hostname=irc.terra.cl -0_Description=Terra%20Chile -1_Hostname=irc.terra.com -1_Description=Terra%20USA -2_Hostname=irc.terra.es -2_Description=Terra%20Spain -NServers=3 -[TR-net] -0_Hostname=irc.dominet.com.tr -0_Description=TR-net:%20EU,%20TR,%20Ankara -1_Hostname=irc.teklan.com.tr -1_Description=TR-net:%20EU,%20Tr,%20Istanbul -NServers=2 -[Tri-net] -0_Hostname=irc.tri-net.org -0_Description=Tri-net:%20Random%20server -NServers=1 -[UltraIRC] -0_Hostname=irc.ultrairc.net -0_Description=UltraIRC:%20Random%20server -NServers=1 -[UnderNet] -0_Hostname=irc.undernet.org -0_Description=Main%20Random%20Server -1_Hostname=eu.undernet.org -1_Description=Europe%20Random%20Server -2_Hostname=bucharest.ro.eu.undernet.org -2_Description=Romania%20Server -3_Hostname=Carouge.ch.eu.undernet.org -3_Description=Switzerland%20Server -4_Hostname=diemen.nl.eu.undernet.org -4_Description=Netherlands%20Server -5_Hostname=ede.nl.eu.undernet.org -5_Description=Netherlands%20Server -6_Hostname=elsene.be.eu.undernet.org -6_Description=Belgium%20Server -7_Hostname=graz.at.eu.undernet.org -7_Description=Austria%20Server -8_Hostname=helsinki.fi.eu.undernet.org -8_Description=Finland%20Server -9_Hostname=lelystad.nl.eu.undernet.org -9_Description=Netherlands%20Server -10_Hostname=london.uk.eu.undernet.org -10_Description=UK%20Server -11_Hostname=london2.uk.eu.undernet.org -11_Description=UK%20Server -12_Hostname=oslo1.no.eu.undernet.org -12_Description=Norway%20Server -13_Hostname=oslo2.no.eu.undernet.org -13_Description=Norway%20Server -14_Hostname=zagreb.hr.eu.undernet.org -14_Description=Croatia%20Server -15_Hostname=us.undernet.org -15_Description=USA%20Random%20Server -16_Hostname=losangeles.ca.us.undernet.org -16_Description=USA%20Server -17_Hostname=mesa.az.us.undernet.org -17_Description=USA%20Server -18_Hostname=newyork.ny.us.undernet.org -18_Description=USA%20Server -NServers=19 -[UnderZ] -0_Hostname=irc.underz.org -0_Description=UnderZ:%20Random%20server -NServers=1 -[UnionLatina] -0_Hostname=irc.unionlatina.org -0_Description=UnionLatina:%20Random%20server -NServers=1 -[Univers] -0_Hostname=irc.univers.org -0_Description=Univers:%20Random%20server -NServers=1 -[Vidgamechat] -0_Hostname=irc.vidgamechat.com -0_Description=Vidgamechat:%20Random%20server -NServers=1 -[Vitamina] -0_Hostname=irc-rr.vitamina.ca -0_Description=Vitamina:%20Random%20server -NServers=1 -[Orange/Voila] -0_Hostname=chat14.x-echo.com -0_Description=Chat14 server -NServers=1 -Description=French%20Orange/Voila%20network%20(old%20name:%20Wanadoo/Voila) -[Warpednet] -0_Hostname=irc.warped.net -0_Description=Warpednet:%20Random%20server -NServers=1 -[Webnet] -0_Hostname=irc.webchat.org -0_Description=Webnet:%20Random%20server -1_Hostname=greennet.ma.us.webchat.org -1_Description=Webnet:%20US,%20MA,%20Boston -2_Hostname=webmaster.ca.us.webchat.org -2_Description=Webnet:%20US,%20CA,%20Santa%20Clara -3_Hostname=wiregrass.al.us.webchat.org -3_Description=Webnet:%20US,%20AL,%20Dothan -NServers=4 -[WeNet] -0_Hostname=irc.wenet.ru -0_Description=Primary%20WeNet%20server -NServers=1 -Encoding=CP-1251 -Description=Russian%20Network -[WorldIRC] -0_Hostname=irc.worldirc.org -0_Description=WorldIRC:%20Random%20server -NServers=1 -[Xevion] -0_Hostname=irc.xevion.net -0_Description=Xevion:%20Random%20server -NServers=1 -[XNet] -0_Hostname=irc.xnet.org -0_Description=XNet:%20Random%20server -NServers=1 -[XWorld] -0_Hostname=irc.xworld.org -0_Description=XWorld:%20Random%20server -NServers=1 -[ZAnetNet] -0_Hostname=lia.zanet.net -0_Description=ZAnet%20Net:%20AF,%20ZA,%20CI%20(lia) -1_Hostname=timewiz.zanet.net -1_Description=ZAnet%20Net:%20AF,%20ZA,%20MWeb%20(timewiz) -NServers=2 -[ZAnetOrg] -0_Hostname=ethereal.zanet.org.za -0_Description=ZAnet%20Org:%20AF,%20ZA,%20Midrand%20(ethereal) -1_Hostname=gaspode.zanet.org.za -1_Description=ZAnet%20Org:%20AF,%20ZA,%20Cape%20Town%20(gaspode) -2_Hostname=is.zanet.org.za -2_Description=ZAnet%20Org:%20AF,%20ZA,%20Johannesburg%20(is) -NServers=3 -[ZiRC] -0_Hostname=irc.zirc.org -0_Description=ZiRC:%20Random%20server -NServers=1 -[ZUHnet] -0_Hostname=irc.zuh.net -0_Description=ZUHnet:%20Random%20server -NServers=1 -[Zurna] -0_Hostname=irc.zurna.net -0_Description=Zurna:%20Random%20server -NServers=1 -[PenguinFriends] -0_Hostname=irc.penguinfriends.org -0_Description=PenguinFriends:%20Random%20server -1_Hostname=pf-gaming.penguinfriends.org -1_Description=pf-gaming.penguinfriends.org -2_Hostname=onlyfreaks.penguinfriends.org -2_Description=onlyfreaks.penguinfriends.org -3_Hostname=irc.penguinfriends.org -3_Description=PenguinFriends:%20Random%20server SSL -3_SSL=true -3_Port=6670 -NServers=4 diff --git a/3.4.0/data/config/style.css b/3.4.0/data/config/style.css deleted file mode 100644 index 893d86c292..0000000000 --- a/3.4.0/data/config/style.css +++ /dev/null @@ -1,16 +0,0 @@ -/* Customize tooltips. */ -QToolTip { - background-color: rgb(200,200,255); - border-color: darkslategray; - border-width: 1px; - border-style: solid; - padding: 2px; - border-radius: 7px; - opacity: 230; -} - -/* Make text in message boxes selectable. */ -QMessageBox { - /* LinksAccessibleByMouse | TextSelectableByMouse */ - messagebox-text-interaction-flags: 5; -} diff --git a/3.4.0/data/config/texticons.kvc b/3.4.0/data/config/texticons.kvc deleted file mode 100644 index 09d45c8217..0000000000 --- a/3.4.0/data/config/texticons.kvc +++ /dev/null @@ -1,39 +0,0 @@ -[Manager] -# Default configuration of texticons. -# If you add any entry then please increase this number both here -# and in kvi_texticonmanager.cpp (they MUST match) -ConfigUpdate=3 -[TextIcons] -smile=94 -sad=95 -heart=214 -irc=208 -bomb=82 -spy=109 -home=107 -heartbreak=215 -rose=216 -biggrin=217 -smileglasses=218 -surprise=219 -idea=148 -penguin=111 -linux=111 -flower=124 -love=214 -lol=217 -exclamation=220 -!=220 -dots=221 -...=221 -?=49 -question=49 -kiss=222 -finger=268 -prrr=265 -time=93 -shy=271 -oooh=223 -cafe=273 -hum=282 -slurp=283 diff --git a/3.4.0/data/defscript/.svnignore b/3.4.0/data/defscript/.svnignore deleted file mode 100644 index bc419568af..0000000000 --- a/3.4.0/data/defscript/.svnignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile.in -Makefile -core -.pics -.mospics \ No newline at end of file diff --git a/3.4.0/data/defscript/Makefile.am b/3.4.0/data/defscript/Makefile.am deleted file mode 100644 index 768c9b8fb1..0000000000 --- a/3.4.0/data/defscript/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -tmpdir = $(defscriptdir) - -tmp_DATA = default.kvs \ - aliases.kvs \ - events.kvs \ - popups.kvs \ - toolbars.kvs \ - installer.kvs \ - theme-install.kvs - -EXTRA_DIST = $(tmp_DATA) diff --git a/3.4.0/data/defscript/aliases.kvs b/3.4.0/data/defscript/aliases.kvs deleted file mode 100644 index 5d8d72999c..0000000000 --- a/3.4.0/data/defscript/aliases.kvs +++ /dev/null @@ -1,706 +0,0 @@ -# Default aliases file - -# -# TODO: -# ignore, notify and unignore should go in the core -# -# If possible, get rid of $str.* from the default popups -# avoiding to load the module at every channel popup open action... -# (Find a core function that retrieves the number of nicknames passed ?) -# Another solution would be to increase the str.module core lock-time ? -# - -# -# Backward compatibility stuff -# -alias(avatar) -{ - # avatar target file - if(!$0) - { - echo "Missing target, no action taken" - return - } - if($1) - { - avatar.set $1 - } - avatar.notify $0 -} - -alias(clear) -{ - window.clearOutput -} - -alias(connect) -{ - objects.connect $0 $1 $2 $3 -} - -alias(disconnect) -{ - objects.disconnect $0 $1 $2 $3 -} - -alias(killclass) -{ - objects.killclass $0 -} - -alias(clearobjects) -{ - objects.clear $0 -} - -alias(nickserv) -{ - # Silent - raw -q NickServ $0- -} - -alias(chanserv) -{ - # Silent - raw -q ChanServ $0- -} - -alias(memoserv) -{ - # Silent - raw -q MemoServ $0- -} - -alias(ns) -{ - # Silent - raw -q nickserv $0- -} - -alias(cs) -{ - # Silent - raw -q chanserv $0- -} - -alias(ms) -{ - # Silent - raw -q memoserv $0- -} - -alias(gnotice) -{ - # Global notice - - #Check null notice - if(!$0){ - echo $tr("Usage"): /gnotice [-waohvq] <$tr("message")> - echo $tr("-m: send a message instead of a notice") - echo $tr("-w: send notice to all channel owners") - echo $tr("-a: send notice to all channel admins") - echo $tr("-o: send notice to all channel ops") - echo $tr("-h: send notice to all channel halfops") - echo $tr("-v: send notice to all channel voices") - echo $tr("-q: quiet mode") - halt - } - - # Detect message type - if($sw(m)) %cmd="msg" - else %cmd="notice" - - # Check for quiet message - if($sw(q)) %cmd=$str.append(%cmd," -q") - - # Check null switches - if((!$sw(w))&&(!$sw(a))&&(!$sw(o))&&(!$sw(h))&&(!$sw(v))){ - eval %cmd $chan.name($active) $0- - halt - } - - # Check switches passed - if($sw(w)) eval %cmd \~$chan.name($active) $0- - if($sw(a)) eval %cmd \!$chan.name($active) $0- - if($sw(o)) eval %cmd \@$chan.name($active) $0- - if($sw(h)) eval %cmd \%$chan.name($active) $0- - if($sw(v)) eval %cmd \+$chan.name($active) $0- -} - -alias(wallop) -{ - if(!$0){ - echo $tr("Usage"): /wallop <$tr("message")> - halt - } - - # Due to server flood, timing may be very high - echo -w=$active $tr("Sending wallop to") $chan.name($active) - timer(wallop,5000,$chan.users(,,o),$0-){ - if(%:localOps == ""){ %:localOps = $chan.users(,,o); %:curIndex = 0; } - if(%:curIndex == %:localOps[]#){ killtimer wallop; return; } - - for(%i=0;%i<1;%i++){ - if(%:localOps[%:curIndex] != $my.nick){ - if(%:curIndex == %:localOps[]#){ killtimer wallop; return; } - msg -q %:localOps[%:curIndex] $1- - %:curIndex++ - } - } - } -} - -alias(kill){ - raw -q kill $0 :$1- -} - -alias(ms) -{ - # Silent - quote ms $0- -} - -# j: This is a really common one -alias(j) -{ - #first we do a test if a chan is given as parameter - if(!$0) - { - echo $tr("Usage:") - echo " /j " - } else { - join $0- - } -} - -# s: This too -alias(s) -{ - if(!$0) - { - echo $tr("Usage:") - echo " /s " - } else { - server $0- - } -} - -# q: Ok, I am lazy :P -alias(q) -{ - if(!$0) - { - echo $tr("Usage:") - echo " /q " - } else { - query $0- - } -} - - -# names: maybe this should be implemented on the core? -alias(names) -{ - if(!$0) - { - if($window.type($active)!="channel") - { - echo $tr("Usage:") "/names " - } else { - raw names $active - } - } else { - raw names $0- - } -} - -# kickban -alias(kb) -{ - if(!$0) - { - echo $tr("Usage:") - echo " /kb [" $tr("reason") "]" - halt; - } - - if(!$channel) - { - echo "[KB]: " $tr("This is not a channel window") - halt; - } - - foreach(%nick,$str.split(",",$0)) - { - if(%nick) - { - %mask = $mask(%nick,$option(uintDefaultBanType)); - - if(!%mask)%mask = %nick; # plain ban - - %reason = $1- - #if(!%reason)%reason = "You're not welcome here!" - - # This is tricky : we send everything - # as a single raw message just because - # we do not want delays between kick and ban - # if anti-server-flood is enabled - - %raw = "kick $target %nick :%reason" - - # kick %nick %reason - - if($chan.isOp(%nick))%raw2 = "mode $target -o+b %nick %mask" - else %raw2 = "mode $target +b %mask" - - raw -q %raw2$cr$lf%raw - } - } -} - -# chanowner -alias(chanowner) -{ - if(!$0) - { - echo $tr("Usage:") - echo " /chanowner " - halt; - } - if(!$channel) - { - echo "[CHANOWNER]: " $tr("This is not a channel window") - halt; - } - - foreach(%nick,$str.split(",",$0)) - { - if(%nick) - { - mode $chan.name() +q %nick - } - } -} - -# chanadmin -alias(chanadmin) -{ - if(!$0) - { - echo $tr("Usage:") - echo " /chanadmin " - halt; - } - if(!$channel) - { - echo "[CHANADMIN]: " $tr("This is not a channel window") - halt; - } - - foreach(%nick,$str.split(",",$0)) - { - if(%nick) - { - mode $chan.name() +a %nick - } - } -} - -# dechanowner -alias(dechanowner) -{ - if(!$0) - { - echo $tr("Usage:") - echo " /dechanowner " - halt; - } - if(!$channel) - { - echo "[DECHANOWNER]: " $tr("This is not a channel window") - halt; - } - - foreach(%nick,$str.split(",",$0)) - { - if(%nick) - { - mode $chan.name() -q %nick - } - } -} - -# dechanadmin -alias(dechanadmin) -{ - if(!$0) - { - echo $tr("Usage:") - echo " /dechanadmin " - halt; - } - if(!$channel) - { - echo "[DECHANADMIN]: " $tr("This is not a channel window") - halt; - } - - foreach(%nick,$str.split(",",$0)) - { - if(%nick) - { - mode $chan.name() -a %nick - } - } -} - -# halfop -alias(halfop) -{ - if(!$0) - { - echo $tr("Usage:") - echo " /halfop " - halt; - } - if(!$channel) - { - echo "[HALFOP]: " $tr("This is not a channel window") - halt; - } - - foreach(%nick,$str.split(",",$0)) - { - if(%nick) - { - mode $chan.name() +h %nick - } - } -} - -# dehalfop -alias(dehalfop) -{ - if(!$0) - { - echo $tr("Usage:") - echo " /dehalfop " - halt; - } - if(!$channel) - { - echo "[DEHALFOP]: " $tr("This is not a channel window") - halt; - } - - foreach(%nick,$str.split(",",$0)) - { - if(%nick) - { - mode $chan.name() -h %nick - } - } -} - -# userop -alias(userop) -{ - if(!$0) - { - echo $tr("Usage:") - echo " /userop " - halt; - } - if(!$channel) - { - echo "[USEROP]: " $tr("This is not a channel window") - halt; - } - - foreach(%nick,$str.split(",",$0)) - { - if(%nick) - { - mode $chan.name() +u %nick - } - } -} - -# deuserop -alias(deuserop) -{ - if(!$0) - { - echo $tr("Usage:") - echo " /deuserop " - halt; - } - if(!$channel) - { - echo "[DEUSEROP]: " $tr("This is not a channel window") - halt; - } - - foreach(%nick,$str.split(",",$0)) - { - if(%nick) - { - mode $chan.name() -u %nick - } - } -} - -# ame and amsg -alias(ame) -{ - foreach(%i,$window.list(channel))if(%i!="") me -r=%i $0- -} - -alias(amsg) -{ - foreach(%i,$window.list(channel))msg $target(%i) $0- -} - -alias(amsgall) -{ - foreach(%i,$window.list(channel),$window.list(query))msg $target(%i) $0- -} - -alias(ameall) -{ - foreach(%i,$window.list(channel),$window.list(query)){ - if(%i!="") me -r=%i $0- - } -} - -alias(awayall) -{ - foreach(%w,$window.list(console,all))away -r=%w $0-; -} - -# notify: this is a bit more complex -# We want to add an user to the notify list with a single command -# The notify lists are handled thru the registered users database -alias(notify) -{ - # This one adds a registered users database entry - # For the specified nick and uses the specified mask - # If no mask is specified , a default one is constructed - # Then the "notify" property is set for the user - - if(!$0) - { - echo $tr("Usage:") - echo " /notify [mask]" - halt - } - - # Get the mask - - %mask = $1 - - # no mask specified ? build it - - if(!%mask)%mask = $0!*@* - - # Now add the user (but do not replace old entries) - - reguser.add -f -q $0 %mask - - # Merge the notify property part with the old one (if any) - - %oldNicks = $reguser.property($0,notify) - - # It would be a good idea to check if the nikckname is already in the %oldNicks list - # but this is left as exercise for the reader. - - %oldNicks << $0 - - # And finally set the property (use -n so the notify lists will be restarted) - - reguser.setproperty -n $0 notify $0 - - # done...the notify list should be restarted now -} - -alias(ignore) -{ - # This one adds a registered users database entry - # For the specified nick and uses the specified mask - # If no mask is specified , a default one is constructed - # Then the "ignore" property is set for the user to 1 - - if(!$0) - { - echo $tr("Usage:") - echo " /ignore [-r] " - halt - } - - # Now add the user (but do not replace old entries) - - reguser.add $0 $mask($0,15); - - # And finally set the property (use -n so the notify lists will be restarted) - # Check if ignore or unignore the user - - if(!$sw(r,remove)) - { - reguser.setIgnoreEnabled $0 1 - reguser.setIgnoreFlags -p -c -n -t -i -d $0 - } else reguser.setIgnoreEnabled $0 0 -} - -# Dcc...people commonly use "dcc send" instead of "dcc.send" -alias(dcc) -{ - switch($0) - { - case(send): - { - dcc.send $1- - break - } - case(chat): - { - dcc.chat $1- - break - } - case(voice): - { - dcc.voice $1- - break - } - case(allow): - { - quote dccallow $1- - break - } - default: - { - echo "[DCC]: " $tr("Unsupported type: $0") - } - } -} - -# -# return a string with the name of the curerent usermode -# -alias(usermodename) -{ - if(!$0) - { - echo $tr("Usage:") - echo " /usermodename " - halt; - } - if(!$channel) - { - echo "[USERMODENAME]: " $tr("This is not a channel window") - halt; - } - - if($chan.isOwner($0,$channel)){ - return $tr("Channel Owner") - } elseif($chan.isAdmin($0,$channel)){ - return $tr("Channel Administrator") - } elseif($chan.isOp($0,$channel)){ - return $tr("Channel Operator") - } elseif($chan.isHalfOp($0,$channel)){ - return $tr("Half Operator") - } elseif($chan.isVoice($0,$channel)){ - return $tr("Voice") - } elseif($chan.isUserOp($0,$channel)){ - return $tr("User Operator") - } else { - return $tr("Normal User") - } -} - -alias(dccallow) -{ - quote dccallow \+$0 -} - -#shortcut for commonly called algorithm -alias(md5) -{ - return $str.digest($0-,md5) -} - -alias(sha1) -{ - return $str.digest($0-,sha1) -} - -# DNS : people like it -alias(dns) -{ - if(!$context) - { - echo "[DNS]: " $tr("You must use DNS in an IRC context") - halt - } - - if(!$server) - { - echo "[DNS]: " $tr("You must be connected to a server") - halt - } - - if(!$0) - { - echo $tr("Usage:") - echo echo " /dns " - halt - } - - if($isWellKnown($0))host -a $hostname($0) - else { - awhois($0) - { - if(!$2) - { - echo "[DNS]: " $tr("No such user: $0") - } else { - host -a $2 - } - } - } -} - -alias(ss) -{ - # Silent - quote ss $0- -} - -alias(seenserv) -{ - # Silent - msg -q SeenServ $0- -} - -alias(hs) -{ - #Silent - quote hs $0- -} - -alias(hop) -{ - // Retrieve channel - %chan=$0 - if(!%chan) %chan=$chan.name($active) - - // Retrieve channel key - %key=$chan.key($channel(%chan)) - - // Exit channel - if($window.type($channel(%chan))=="channel") - part --keep %chan $option(stringPartMessage) - - // Rejoin channel - if(!%key) join %chan - else join %chan %key -} diff --git a/3.4.0/data/defscript/default.kvs b/3.4.0/data/defscript/default.kvs deleted file mode 100644 index fb270da6de..0000000000 --- a/3.4.0/data/defscript/default.kvs +++ /dev/null @@ -1,37 +0,0 @@ -################################################################################################# -# -# This is the default script for KVIrc -# Feel free to use it as base for writing your own scripts -# It is a good starting point; I have tried to add as many comments as possible. -# -# Have fun :) -# Szymon Stefanek -# -################################################################################################# - -%mypath = "$file.extractpath($0)$file.ps" - -# Fetch default scripts data -include "aliases.kvs" %mypath -include "events.kvs" %mypath -include "popups.kvs" %mypath -include "toolbars.kvs" %mypath - -# -# Set the default spam words...(for the anti-spam) detector -# - -# FIXME: these should be MERGED!!!! - -#%tmp = $option(stringlistSpamWords) -#%tmp[] = $array() ??? - -option stringlistSpamWords "http:","#","www.","auto","query","ftp:","sex","free","msg","chat","dynamirc","script" - -options.save - -echo $tr("The default script has been successfully installed.") -echo $tr("To connect to a server, type /server ") -echo "---" -echo $tr("Happy ircing :)") -echo "- Szymon Stefanek $tr("and the KVIrc Development Team")" diff --git a/3.4.0/data/defscript/events.kvs b/3.4.0/data/defscript/events.kvs deleted file mode 100644 index 575cfc3938..0000000000 --- a/3.4.0/data/defscript/events.kvs +++ /dev/null @@ -1,105 +0,0 @@ -# Default events file - -event(OnDccChatPopupRequest,default) -{ - popup dccchat $0; -} - -event(OnChannelPopupRequest,default) -{ - popup channeltextview $target; -} - -event(OnConsolePopupRequest,default) -{ - popup consoletextview; -} - -event(OnChannelLinkPopupRequest,default) -{ - if($0 != "") popup channelpopup $0; -} - -event(OnQueryPopupRequest,default) -{ - if($target) popup querytextview $target; -} - -event(OnQueryNickPopupRequest,default) -{ - if($0 != "") popup querytextview $0; -} - -event(OnQueryFileDropped,default) -{ - if($0 != "") dcc.send $target $0; -} - -event(OnNickLinkDefaultActionRequest,default) -{ - if($0 != "") whois $0; -} - -event(OnNickLinkPopupRequest,default) -{ - if($0 != "") popup defaulttextview $0; -} - -event(OnNotifyListDefaultActionRequest,default) -{ - if($0 != "") - { - query $0; whois $0 $0; - } -} - -event(OnNotifyListPopupRequest,default) -{ - if($0 != "") popup defaulttextview $0; -}; - -event(OnWindowPopupRequest,default) -{ - popup windowpopup; -} - -event(OnChannelWindowCreated,default) -{ - button(w,Logging,119,Logging) - { - popup -p=$0,$1 logging; - } -} - -event(OnQueryWindowCreated,default) -{ - button(w,Logging,119,Logging) - { - popup -p=$0,$1 logging; - } -} - -event(OnChannelNickLinkClick,default) -{ - if($0 != "") window.insertInInputText $window $0$option(stringNickCompletionPostfix); -} - -event(OnChannelNickPopupRequest,default) -{ - if($0 != "") popup channel $0; -} - -event(OnChannelNickDefaultActionRequest,default) -{ - if(!$isEmpty($0)) query $0; -} - -event(OnURLLinkPopupRequest,URL popup) -{ - popup urlpopup $0 -} - -event(OnHostLinkPopupRequest,default) -{ - popup hostpopup $0; -} diff --git a/3.4.0/data/defscript/installer.kvs b/3.4.0/data/defscript/installer.kvs deleted file mode 100644 index f974b7eda5..0000000000 --- a/3.4.0/data/defscript/installer.kvs +++ /dev/null @@ -1,169 +0,0 @@ -/* - A helper class for installing and parsing files, - and generating an uninstallation alias on the fly. - - Example : - include "utils/installer.kvs" - %installer = $new(installer,0,myinstaller) - %installer->$copyFiles(pics,*.png,$file.localdir(pics)) - %installer->$includeFiles(src,*.kvs) - %installer->generateUninstallAlias("foo::uninstall") - delete %installer - Here, "foo::uninstall" must be called in you uninstall - callback script. - - Warnings: - 1) Declaration of aliases, popups, etc, in source files - (.kvs) must be in a similar format - as when you export them directly from kvirc. - Example: - alias(myalias) - defpopup(mypopup) - 2) If you use a "defpopup -m" to add an item to an - existing popup,this item won't be registered - automatically for uninstallation by this installer script. - You should typically identify the item you added using - the "id" parameter. See this example where the id is - "myaddon::myitem": - defpopup -m (channeltextview) - { - item(MyItem)(myaddon::myitem) - { - ... - } - } - Then, you add this line to you uninstall callback - script: - delpopupitem channeltextview myaddon::myitem -*/ -class(installer,object) -{ - constructor() - { - } - - copyFiles($0 = source dir,$1 = file regexp,$2 = target dir) - { - if(!$file.exists($0))return - if($isempty($0)) - { - echo $tr("[Installer] The first argument to \%installer->\$copyfiles must be a source directory") - halt - } - - if($isempty($1)) - { - echo $tr("[Installer] The second argument to \%installer->\$copyfiles must be a file name or file regexp") - halt - } - - if($isempty($2)) - { - echo $tr("[Installer] The third argument to \%installer->\$copyfiles must be a destination directory") - halt - } - - if($file.exists($0)) - { - %files = $file.ls($file.fixpath($0),f,$1) - if($length(%files)) - { - @$mkdir($2) - foreach(%file,%files) - { - $this->%lFiles <+ $str.replace($file.fixpath("$2/%file"),"\\\\","\\") - file.copy -o $file.fixpath($0/%file) $file.fixpath($2/%file) - } - } - } - } - - // Recursive creation of directory - mkdir($0 = directory) - { - if($isempty($0) || $file.exists($0)) return - foreach -a (%subdir,$str.split("/",$file.fixpath($0))) - { - %p <+ %subdir - %path = $str.join("/",%p) - if(!$file.exists(%path)) - file.mkdir -q %path - } - if(!$file.exists($0)) - { - echo $tr("[Installer] Failed to create directory") \"$0\" - return - } - } - - // Parse source files and get what will need to be uninstalled - includeFiles($0 = dir, $1 = file regexp) - { - if($isempty($0)) - { - echo $tr("[Installer] The first argument to \%installer->\$includefiles must be a source directory") - halt - } - - @$mkdir($0) - - if($1 == "") - %szRe = "*.kvs" - else - %szRe = $1 - - %files = $file.ls($file.fixpath($0),f,$1) - if($length(%files)) - { - foreach(%file,%files) - { - $this->%lSources <+ $str.replace($file.fixpath("$0/%file"),"\\\\","\\") - include $file.fixpath("$0/%file") - } - } - } - - - generateUninstallAlias($0 = alias name) - { - %c = "alias($0)$lf" - %c .= "{$lf" - if($isset($this->%lFiles)) - { - foreach(%file,$this->%lFiles) - { - %file =~ s/"^$file.localdir()/(.*)$"/"\$file.localdir(\\1)"/ - %c .= " file.remove -q \"%file\"$lf"; - } - } - if($isset($this->%lSources)) - { - foreach(%file,$this->%lSources){ - foreach(%line,$file.readlines(%file)) - if(!$str.isempty(%line)){ - if($str.match("event(*)",%line,e)) - %c .= " event -q ("$str.token(1,"()",%line)"){}$lf" - else if($str.match("alias(*)",%line,e)) - %aliases<+$str.token(1,"()",%line) - else if($str.match("defpopup(*)",%line,e)) - %c .= " defpopup("$str.token(1,"()",%line)"){}$lf" - else if($str.match("toolbar.create * *",%line,e)) - %c .= " toolbar.destroy -q "$str.word(1,%line)"$lf" - else if($str.match("action.create* (*)",%line,e)) - %c .= " action.destroy -q "$str.replace($str.token(1,"(,)",%line),,\")"$lf" - else if($str.match("class(*)*",%line,e)) - %c .= " objects.killclass -q "$str.token(1,"(,)",%line)"$lf" - } - } - if($isset(%aliases)) - foreach(%alias,%aliases) - %c .= " alias -q (%alias){}$lf" - %c .= " alias -q ($0){}$lf" - } - %c .= "}" - eval %c - } -} - - - diff --git a/3.4.0/data/defscript/popups.kvs b/3.4.0/data/defscript/popups.kvs deleted file mode 100644 index 7197c92336..0000000000 --- a/3.4.0/data/defscript/popups.kvs +++ /dev/null @@ -1,1381 +0,0 @@ -# Default popups file - -# -# Here comes a nice part... -# The popups. KVIrc has a lot of events that merely ask for a popup to be shown :) -# -defpopup(highlight) -{ - prologue - { - if($0!=""){ - %:regName = $reguser.match($mask($0)) - %:beingHl = $reguser.property(%:regName,highlight) - %:beingHlTmp = $tmphighlight.ishighlighted($0) - } - } - - item($tr("Stop Highlighting (Local)")) (%:beingHlTmp && !%:beingHl) - { - tmphighlight.remove $0 - } - - item($tr("Start Highlighting (Local)")) (!%:beingHlTmp && !%:beingHl) - { - tmphighlight.add $0 - } - - popup($tr("Always Highlight")) (!%:beingHl && !%:regName) - { - item($tr("Highlight as") $0 "("$mask($0,11)")") ("$reguser.exactMatch($mask($0,11))" == "") - { - reguser.add $0 $mask($0,11); reguser.setproperty $0 highlight 1; - } - - item($tr("Highlight as") $0 "("$mask($0,12)")") ("$reguser.exactMatch($mask($0,12))" == "") - { - reguser.add $0 $mask($0,12); reguser.setproperty $0 highlight 1; - } - - item($tr("Highlight as") $0 "("$mask($0,13)")") ("$reguser.exactMatch($mask($0,13))" == "") - { - reguser.add $0 $mask($0,13); reguser.setproperty $0 highlight 1; - } - - item($tr("Highlight as") $0 "("$mask($0,3)")") ("$reguser.exactMatch($mask($0,3))" == "") - { - reguser.add $0 $mask($0,3); reguser.setproperty $0 highlight 1; - } - - item($tr("Highlight as") $0 "("$mask($0,4)")") ("$reguser.exactMatch($mask($0,4))" == "") - { - reguser.add $0 $mask($0,4); reguser.setproperty $0 highlight 1; - } - - item($tr("Highlight as") $0 "("$mask($0,5)")") ("$reguser.exactMatch($mask($0,5))" == "") - { - reguser.add $0 $mask($0,5); reguser.setproperty $0 highlight 1; - } - } - - item($tr("Always Highlight")) (!%:beingHl && %:regName) - { - reguser.setproperty $0 highlight 1 - } - - item($tr("Stop Highlighting")) (%:beingHl) - { - reguser.setproperty $0 highlight 0 - } -} - -defpopup(ignore) -{ - prologue - { - %:inIgnoreList = 0 - %:regName = $reguser.match($mask($0)) - %:ignLabelText = "

$0 " - if(%:regName) - { - %:inIgnoreList = $reguser.isIgnoreEnabled(%:regName); - if(%:inIgnoreList) %:ignLabelText << $tr("is being ignored") - else %:ignLabelText << $tr("is not being ignored") - - %:ignLabelText << "

" - } else { - %:ignLabelText << $tr("is not being ignored")"

" - } - } - - label(%:ignLabelText) - - item($tr("Enable Ignore"),168) (!%:inIgnoreList && %:regName) - { - reguser.setIgnoreEnabled %:regName 1; - } - - popup($tr("Ignore as..."),44) (!%:inIgnoreList) - { - item($tr("Ignore as") $0 "("$mask($0,0)")") ("$reguser.exactMatch($mask($0,0))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,0); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,1)")") ("$reguser.exactMatch($mask($0,1))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,1); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,2)")") ("$reguser.exactMatch($mask($0,2))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,2); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,3)")") ("$reguser.exactMatch($mask($0,3))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,3); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,4)")") ("$reguser.exactMatch($mask($0,4))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,4); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,5)")") ("$reguser.exactMatch($mask($0,5))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,5); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,6)")") ("$reguser.exactMatch($mask($0,6))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,6); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,7)")") ("$reguser.exactMatch($mask($0,7))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,7); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,8)")") ("$reguser.exactMatch($mask($0,8))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,8); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,9)")") ("$reguser.exactMatch($mask($0,9))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,9); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,10)")") ("$reguser.exactMatch($mask($0,10))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,10); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,11)")") ("$reguser.exactMatch($mask($0,11))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,11); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,12)")") ("$reguser.exactMatch($mask($0,12))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,12); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,13)")") ("$reguser.exactMatch($mask($0,13))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,13); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,14)")") ("$reguser.exactMatch($mask($0,14))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,14); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,15)")") ("$reguser.exactMatch($mask($0,15))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,15); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,16)")") ("$reguser.exactMatch($mask($0,16))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,16); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,17)")") ("$reguser.exactMatch($mask($0,17))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,17); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,18)")") ("$reguser.exactMatch($mask($0,18))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,18); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,19)")") ("$reguser.exactMatch($mask($0,19))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,19); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,20)")") ("$reguser.exactMatch($mask($0,20))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,20); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,21)")") ("$reguser.exactMatch($mask($0,21))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,21); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,22)")") ("$reguser.exactMatch($mask($0,22))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,22); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,23)")") ("$reguser.exactMatch($mask($0,23))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,23); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,24)")") ("$reguser.exactMatch($mask($0,24))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,24); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,25)")") ("$reguser.exactMatch($mask($0,25))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,25); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - - item($tr("Ignore as") $0 "("$mask($0,26)")") ("$reguser.exactMatch($mask($0,26))" == "") - { - if(!%:regName) reguser.add $0 $mask($0,26); - reguser.setIgnoreEnabled $0 1; - reguser.setIgnoreFlags -p -c -n -t -i -d $0; - } - } - - item($tr("Unignore"),217) (%:inIgnoreList) - { - reguser.setIgnoreEnabled %:regName 0; - } -} - -defpopup(registration) -{ - prologue - { - - # This is really smart...we are loading - # the reguser module only if this popup is being requested (the user effectively - # puts the mouse on the "Registration" item and the sub-popup is being shown) - %:regName = $reguser.match($mask($0)) - %:labelText = "

$0"; - if(%:regName) - { - %:labelText << $tr("is registered as") ": "%:regName"" - # We want to display masks here!!! - %:inNotifyList = $reguser.property(%:regName,notify); - if(%:inNotifyList)%:labelText << "
$0" $tr("is in the notify list") - %:curAvatar = $avatar.name($0); - %:defAvatar = $reguser.property(%:regName,avatar); - if(%:defAvatar)%:labelText << "
$0" $tr("has a default avatar") - %:labelText << "

" - } else { - %:labelText << $tr("is not registered")"

" - } - } - - label(%:labelText) - - item($tr("Register")"...") (!%:regName) - { - reguser.wizard $mask($0) - } - - popup($tr("Quick Registration")) (!%:regName) - { - item($tr("Register as") $0 "("$mask($0,11)")") ("$reguser.exactMatch($mask($0,11))" == "") - { - reguser.add $0 $mask($0,11) - } - - item($tr("Register as") $0 "("$mask($0,12)")") ("$reguser.exactMatch($mask($0,12))" == "") - { - reguser.add $0 $mask($0,12) - } - - item($tr("Register as") $0 "("$mask($0,13)")") ("$reguser.exactMatch($mask($0,13))" == "") - { - reguser.add $0 $mask($0,13) - } - - item($tr("Register as") $0 "("$mask($0,3)")") ("$reguser.exactMatch($mask($0,3))" == "") - { - reguser.add $0 $mask($0,3) - } - - item($tr("Register as") $0 "("$mask($0,4)")") ("$reguser.exactMatch($mask($0,4))" == "") - { - reguser.add $0 $mask($0,4) - } - - item($tr("Register as") $0 "("$mask($0,5)")") ("$reguser.exactMatch($mask($0,5))" == "") - { - reguser.add $0 $mask($0,5) - } - } - - item($tr("Edit Registration")"...",113) (%:regName) - { - reguser.edit "%:regName" - } - - item($tr("Unregister") %:regName) (%:regName) - { - reguser.remove "%:regName" - } - - separator - - item($tr("Add to Notify")) (%:regName && !%:inNotifyList) - { - reguser.setproperty -n "%:regName" notify $0 - } - - item($tr("Remove from Notify")) (%:regName && %:inNotifyList) - { - reguser.setproperty -n "%:regName" notify - } - - popup($tr("Avatar")) (%:regName) - { - item($tr("Choose")"...") (%:regName) - { - dialog.image(f,$tr("Choose Avatar Image File"),"","",$0,"%:regName") - { - if($0) - { - reguser.setproperty -a $2 avatar $0; - } - } - } - - item($tr("Set as Default")) (%:curAvatar && ("%:curAvatar" != "%:defAvatar")) - { - reguser.setproperty "%:regName" avatar %:curAvatar - } - - item($tr("Clear Default")) (%:defAvatar) - { - reguser.setproperty %:regName avatar - # Force the avatar to update - # if("%:curAvatar" == "")who $0 - } - } -} - -defpopup("urlpopup") -{ - item($tr("Copy To Clipboard"),259) - { - str.toClipboard $0 - } -} - -# This code adds a channel popup that accepts -# a comma separated list of nicknames as parameter (to the /popup command) - -defpopup(channel) -{ - prologue - { - # we use the extended scope variables: they are visible in the entire defpopup scope - # %:visible is the string that we will "show to the user" in the popup widget - # for multiple users the string might become long so we are going to change it in "multiple users" - %:visible = $0 - # %:multiple is an internal flag: set to 1 if the parameter passed to the popup contains a list - # of multiple nicknames rather than a single nick - %:multiple = 0 - # finally , set these variables - %:itemBanName = $tr("Ban") - if($str.findfirst(%:visible,",") != -1) - { - # found a comma in the $0 parameter...we have multiple nicknames - %:visible = "("$tr("Multiple Users")")" - %:multiple = 1 - %:itemBanMask = "*!user@*.host.tld" - %:itemBanNick = "nick" - } else { - %:itemBanMask = $mask(%:visible,$option(uintDefaultBanType)) - if("%:itemBanMask" == "*!*@*")%:itemBanName = $tr("&Ban") - %:itemBanNick = %:visible - } - # speed it up - - %:isMeHalfOp = $chan.isMeHalfOp() - %:isMeOp = $chan.isMeOp() - %:isMeOwner = $chan.isMeOwner() - %:isMeAdmin = $chan.isMeAdmin() - %:bCanKB = 0; - - if(%:isMeHalfOp) - { - foreach(%nick,$str.split(",",$0)) - { - if($chan.usermodelevel(%nick) <= $chan.usermodelevel($me)) - { - %:bCanKB = 1; - break; - } - } - } - } - - item("/WHOIS" %:visible "("$tr("idle time")")",75,whois_item) - { - foreach(%i,$str.split(",",$0)) - whois %i %i - } - - separator - - popup($tr("&Information"),49,"information_popup") - { - item("/WHOIS" %:visible,75,"whois_item") - { - whois $0 - } - - item(/WHOWAS %:visible,92) - { - whowas $0 - } - - item(/WHO %:visible,75) - { - who $0 - } - - separator - - item($tr("DNS for") %:visible,75) - { - foreach(%i,$str.split(",",$0))dns %i - } - - item($tr("Mask for") %:visible,75) (!%:multiple) - { - echo $mask($0,11) - } - } - - popup($tr("&Control"),9,"control_popup") (%:isMeHalfOp) - { - label($usermodename($me())) - - item($tr("O&wner") %:visible,260) (%:isMeOwner) - { - chanowner $0 - } - - item($tr("&Deowner") %:visible,261) (%:isMeOwner) - { - dechanowner $0 - } - - item($tr("&Administrator") %:visible,242) (%:isMeAdmin) - { - chanadmin $0 - } - - item($tr("&Deadministrator") %:visible,243) (%:isMeAdmin) - { - dechanadmin $0 - } - - item($tr("&Op") %:visible,34) (%:isMeOp) - { - op $0 - } - - item($tr("&Deop") %:visible,62) (%:isMeOp) - { - deop $0 - } - - item($tr("&Halfop") %:visible,174) (%:isMeOp) - { - halfop $0 - } - - item($tr("&Dehalfop") %:visible,175) (%:isMeOp) - { - dehalfop $0 - } - - item($tr("&Voice") %:visible,35) (%:isMeHalfOp) - { - voice $0 - } - - item($tr("D&evoice") %:visible,63) (%:isMeHalfOp) - { - devoice $0 - } - - separator - - item($tr("&Kick") %:visible,110) (%:bCanKB) - { - foreach(%i,$str.split(",",$0))kick %i - } - - item($tr("K&ick") %:visible $tr("With..."),110) (%:bCanKB) - { - dialog.textinput -d="$me" -i=110 ($tr("Kick Reason"),$tr("Enter a kick reason"),$tr("&Kick"),$tr("Cancel"),,$0) - { - if($0 == 0) - { - foreach(%i,$str.split(",",$2))kick %i $1 - } - } - } - - item($tr("&Ban") %:visible "("%:itemBanMask")",67) (("%:itemBanMask" != "*!*@*") && %:bCanKB) - { - ban $mask($0,$option(uintDefaultBanType)) - } - - item(%:itemBanName %:visible "("%:itemBanNick!*@*")",67) (%:bCanKB) - { - ban $0 - } - - item($tr("Kick/Ban") %:visible,110) (%:bCanKB) - { - kb $0 - } - - item($tr("Kick/Ban") %:visible $tr("With..."),110) (%:bCanKB) - { - dialog.textinput -d="$me" -i=110 ($tr("Kick/Ban Reason"),$tr("Enter a kick/ban reason"),$tr("&Kick/Ban"),$tr("Cancel"),,$0) - { - if($0 == 0) - { - kb $2 $1 - } - } - } - separator - - item($tr("Configure ban mask..."),20) - { - options.edit KviChannelAdvancedOptionsWidget - } - } - - separator - - item($tr("&Query") %:visible,47) - { - query $0 - } - - separator - - extpopup(C&TCP,ctcp,51) - - extpopup(&DCC,dcc,77) (!%:multiple) - - separator - - extpopup($tr("&Registration"),registration,111) (!%:multiple) - - extpopup($tr("&Highlight"),highlight,181) (!%:multiple) - - extpopup($tr("Ig&nore"),ignore,203) (!%:multiple) - - item($tr("Notify Avatar"),57) - { - avatar.notify $0 - } -} - -# Popup to show on right-clicking channel links -# -defpopup(channelpopup) -{ - item($tr("&Join") $0,145) - { - hop $0 - } - - item($tr("&Part") $0,40) - { - if($channel($0)) part $0 $option(stringPartMessage); - } - - separator - - item(/NAMES $0,75) - { - names $0; - } - - item(/WHO $0,75) - { - who $0; - } - separator - - item($tr("Copy Channel Address"),259) - { - str.toClipboard $chan.getUrl($0) - } - -} - -defpopup(channels) -{ - item(#KVirc,46) - { - j #KVirc - } - - item(#MDE,46) - { - j #MDE - } - - item(#kde,46) - { - j #kde - } -} - -defpopup(channeltextview) -{ - extpopup($tr("Channels"),channels,46) - - item($tr("&Join Channels..."),46) ($server) - { - if($option(boolShowChannelsJoinDialogAsToplevel))channelsjoin.open -t;else channelsjoin.open - } - - separator - - item($tr("&Hop") $0,145) - { - hop $0 - } - - item($tr("&Part") $0,40) - { - if($channel($0)) part $0 $option(stringPartMessage); - } - - separator - - extpopup(C&TCP,ctcp,51) - - separator - - item(/NAMES $0,75) - { - names $0; - } - - item(/WHO $0,75) - { - who $0; - } - - item($tr("Notify Avatar"),57) - { - avatar.notify $0 - } - - separator - - item($tr("Copy Channel URL to Clipboard"),259) - { - str.toClipboard $chan.getUrl - } - - item($tr("Clear Buffer"),121) - { - clear; - } - -} - -defpopup(consoletextview) -{ - label($tr("You're not connected to a server")) (!$server) - - extpopup($tr("Channels"),channels,46) - - separator - - item($tr("&Join Channels..."),46) ($server) - { - if($option(boolShowChannelsJoinDialogAsToplevel))channelsjoin.open -t;else channelsjoin.open - } - - popup($tr("&Information"),13) ($server) - { - item(/MOTD,30) - { - motd - } - - item(/INFO,29) - { - info - } - - item(/LUSERS,57) - { - lusers - } - - popup(/STATS,22) - { - item(d "(Debug/DNS?)") - { - stats d - } - - item($tr("l (Connections)")) - { - stats l - } - - item($tr("m (Command Usage)")) - { - stats m - } - - item($tr("o (Operators)")) - { - stats o - } - - item($tr("t (Connection stats ?)"),23) - { - stats t - } - - item($tr("u (Uptime)"),93) - { - stats u - } - - item($tr("y (y-Lines)")) - { - stats y - } - - item($tr("z (Debug Stats?)"),11) - { - stats z - } - } - - item(/TIME,93) - { - time - } - - item(/ADMIN,29) - { - admin - } - - item(/VERSION,16) - { - version - } - - item(/HELP,49) - { - raw help - } - } - - separator - - item($tr("Clear Buffer"),121) - { - clear; - } -} - -# This is a common popup , accepts a list of nicknames as parameter -defpopup(ctcp) -{ - item(PING,36) - { - ctcp $0 PING - } - - item(FINGER,53) - { - ctcp $0 FINGER - } - - item(VERSION,16) - { - ctcp $0 VERSION - } - - item(USERINFO,57) - { - ctcp $0 USERINFO - } - - item(CLIENTINFO,52) - { - ctcp $0 CLIENTINFO - } - - item(SOURCE,14) - { - ctcp $0 SOURCE - } - - item(TIME,93) - { - ctcp $0 TIME - } - - item(PAGE...,223) - { - #dialog.textinput -d="Wakeup!" ($tr("CTCP Page to") $0,$tr("Enter the message text"),$tr("Ok"),$tr("Cancel")) - dialog.textinput(CTCP Page $0,Enter the message text,&Page,Cancel,"",$0) - { - if($0 == 0)ctcp $2 PAGE $1 - } - } - - item(AVATAR,57) - { - ctcp $0 AVATAR - } -} - -defpopup(dcc) -{ - prologue - { - - if($features("SSL"))%:bHaveSSL=1 - else %:bHaveSSL=0 - } - - item($tr("Chat with") $0,78) - { - dcc.chat $0 - } - - item($tr("Reverse Chat with") $0,78) - { - dcc.chat -z $0 - } - - item($tr("Secure Chat with") $0,78) (%:bHaveSSL) - { - dcc.chat -s $0 - } - - separator - - item($tr("Send to") $0,79) - { - dcc.send $0 - } - - item($tr("Secure send to") $0,79) - { - dcc.send -s $0 - } - - item($tr("Reverse Send to") $0,79) - { - dcc.rsend -z $0 - } - - item($tr("Secure Reverse Send to") $0,79) - { - dcc.rsend -z -s $0 - } - - separator - - item($tr("TDCC Send to") $0,77) - { - dcc.send -t $0 - } - - item($tr("TDCC Reverse Send to") $0,77) - { - dcc.rsend -t $0 - } - - separator - - popup($tr("Voice Chat"),166) - { - item($tr("Default")": ADPCM 8 KHz (32 kbps)") - { - dcc.voice $0 - } - - separator - - item("ADPCM 11.025 KHz (44.1 kbps)") - { - dcc.voice -h=11025 $0 - } - - item("ADPCM 16 KHz (64 kbps)") - { - dcc.voice -h=16000 $0 - } - - item("ADPCM 22.05 KHz (88.2 kbps)") - { - dcc.voice -h=22050 $0 - } - - item("GSM 8 KHz (13.2 kbps)") - { - dcc.voice -g=gsm $0 - } - - item("GSM 11.025 KHz (18.1 kbps)") - { - dcc.voice -g=gsm -h=11025 $0 - } - - item("GSM 16 KHz (26.4 kbps)") - { - dcc.voice -g=gsm -h=16000 $0 - } - - item("GSM 22.05 KHz (36.2 kbps)") - { - dcc.voice -g=gsm -h=22050 $0 - } - - item("GSM 44.1 KHz (72.4 kbps)") - { - dcc.voice -g=gsm -h=44100 $0 - } - - item("NULL 8 KHz (128 kbps)") - { - dcc.voice -g=null $0 - } - - item("NULL 11.025 KHz (176.4 kbps)") - { - dcc.voice -g=null -h=11025 $0 - } - } -} - -defpopup(dccchat) -{ - prologue - { - - # we use the extended scope variables: they are visible in the entire defpopup scope - # %:visible is the string that we will "show to the user" in the popup widget - # for multiple users the string might become long so we are going to change it in "multiple users" - %:visible = $0 - # %:multiple is an internal flag: set to 1 if the parameter passed to the popup contains a list - # of multiple nicknames rather than a single nick - %:multiple = 0 - # finally , set these variables - if($str.findfirst(%:visible,",") != -1) - { - # found a comma in the $0 parameter...we have multiple nicknames - %:visible = "("$tr("Multiple Users")")" - %:multiple = 1 - } - } - - separator - - extpopup(C&TCP,ctcp,51) - - extpopup(&DCC,dcc,77) - - separator - - item($tr("Notify Avatar"),57) - { - avatar.notify $0 - } - - separator - - item($tr("Clear Buffer"),121) - { - clear - } -} - -# -# Some minimal work on the query -# A text view popup (right click on a query view) -# - -defpopup(querytextview) -{ - prologue - { - - # we use the extended scope variables: they are visible in the entire defpopup scope - # %:visible is the string that we will "show to the user" in the popup widget - # for multiple users the string might become long so we are going to change it in "multiple users" - %:visible = $0 - # %:multiple is an internal flag: set to 1 if the parameter passed to the popup contains a list - # of multiple nicknames rather than a single nick - %:multiple = 0 - # finally , set these variables - if($str.findfirst(%:visible,",") != -1) - { - # found a comma in the $0 parameter...we have multiple nicknames - %:visible = "("$tr("Multiple Users")")" - %:multiple = 1 - } - } - - item(/WHOIS $0 "("$tr("idle time")")",75) (!%:multiple) - { - whois $0 $0 - } - - separator - - popup($tr("&Information"),49) - { - item(/WHOIS $0,75) - { - whois $0 - } - - item(/WHOWAS $0,92) - { - whowas $0 - } - - item(/WHO $0,75) - { - who $0 - } - - separator - - item($tr("DNS for") $0,75) - { - foreach(%i,$str.split(",",$0))dns %i - } - - item($tr("Mask for") $0,75) (!%:multiple) - { - echo $mask($0,11) - } - } - - separator - - extpopup(C&TCP,ctcp,51) - - extpopup(&DCC,dcc,77) - - separator - - extpopup($tr("&Ignore"),ignore,203) (!%:multiple) - - extpopup($tr("&Registration"),registration,111) (!%:multiple) - - item($tr("Notify Avatar"),57) - { - avatar.notify $0 - } - - separator - - item($tr("Clear Buffer"),121) - { - clear - } -} - - -# -# Logging popup for the windows -# -defpopup(logging) -{ - prologue - { - - # If this window is being logged actually , $log.file will be non empty - # and pointing to the log file actually open. - %:logfile = $str.replace($log.file,,$file.localdir) - } - - label($tr("Logging to"):
%:logfile) ("%:logfile" != "") - - item($tr("Flush Log File"),19) (%:logfile) - { - log.flush - } - - separator - - item($tr("Stop Logging"),58) (%:logfile) - { - log.stop - } - - label($tr("Not Logging")) (!%:logfile) - - item($tr("Log To Default File"),119) (!%:logfile) - { - log.start - } - - item($tr("Log To Default File") "("$tr("Include Existing Buffer")")",119) (!%:logfile) - { - log.start -p - } - - item($tr("Log To..."),119) (!%:logfile) - { - dialog.file(save,$tr("Choose Log Filename")) - { - if($0)log.start $0 - } - } - - item($tr("Log To...") "("$tr("Include Existing Buffer"),119) (!%:logfile) - { - dialog.file(save,$tr("Choose Log Filename")) - { - if($0)log.start -p $0 - } - } -} - -defpopup(defaulttextview) -{ - prologue - { - - # we use the extended scope variables: they are visible in the entire defpopup scope - # %:visible is the string that we will "show to the user" in the popup widget - # for multiple users the string might become long so we are going to change it in "multiple users" - %:visible = $0 - # %:multiple is an internal flag: set to 1 if the parameter passed to the popup contains a list - # of multiple nicknames rather than a single nick - %:multiple = 0 - # finally , set these variables - if($str.findfirst(%:visible,",") != -1) - { - # found a comma in the $0 parameter...we have multiple nicknames - %:visible = "("$tr("Multiple Users")")" - %:multiple = 1 - } - } - - item(/WHOIS $0 "("$tr("idle time")")",75) (!%:multiple) - { - whois $0 $0 - } - - separator - - popup($tr("&Information"),49) - { - item(/WHOIS $0,75) - { - whois $0 - } - - item(/WHOWAS $0,92) - { - whowas $0 - } - - item(/WHO $0,75) - { - who $0 - } - - separator - - item(DNS $0,75) - { - foreach(%i,$str.split(",",$0))dns %i - } - } - - separator - - item($tr("&Query") %:visible,47) - { - query $0 - } - - separator - - extpopup(C&TCP,ctcp,51) - - extpopup(&DCC,dcc,77) - - separator - - extpopup($tr("&Registration"),registration,111) (!%:multiple) - - extpopup($tr("&Highlight"),highlight,181) (!%:multiple) - - extpopup($tr("Ig&nore"),ignore,203) (!%:multiple) - - item($tr("Notify avatar"),57) - { - avatar.notify $0 - } - - separator - - item($tr("Clear Buffer"),121) - { - clear - } -} - -file.addimagepath %mypath/pics/ - -# -# FIXME: Add uninstall part: -# file.delimagepath -# - - -# -# A default popup for the middle click in a text view -# This should manage logging , buffer saving and other -# stuff common to ALL windows -# - -defpopup(windowpopup) -{ - extpopup(Logging,logging,119) - -# popup(Buffer) -# { -# item("Save to file...")window.savebuffer -# item("Clear")window.clear -# item("Find...")window.findtext -# } -# popup(View) -# { -# item("Show images")($window.images == 0)window.images 1 -# item("Enable timestamps")($window.timestamp == 0)window.timestamp 1 -# item("Disable timestamps")($window.timestam == 1)window.timestamp 0 -# item("Set font...")$window.setfont -# item("Set background...")$window.setbackground -# } -# popup(Mdi) -# { -# item("Minimize")window.minimize -# item("Maximize")window.maximize -# } -} - -# Host link popup - -defpopup(hostpopup) -{ - item(Look Up $0,13) - { - host -a $0 - } - - separator - - item(Open ftp://$0/,145) ("$system.ostype" == "unix") - { - openurl ftp://$0/ - } - - item(Telnet to $0,25) - { - if("$system.ostype" == "unix")run xterm -e telnet $0 - else run telnet $0 - } - - separator - - item(Traceroute $0,42) - { - if("$system.ostype" == "unix")run xterm -e /bin/sh -c "echo \"Traceroute to $0...\" && traceroute $0 && cat" - else run tracert $0 - } - - item(Traceroute6 $0,42) - { - if("$system.ostype" == "unix")run xterm -e /bin/sh -c "echo \"Traceroute (inet6) to $0...\" && traceroute6 $0 && cat" - else run tracert6 $0 - } - - item(Ping $0,147) - { - if("$system.ostype" == "unix")run xterm -e /bin/sh -c "echo \"Ping $0...\" && ping $0 && cat" - else run ping $0 - } - - item(Ping6 $0,147) - { - if("$system.ostype" == "unix")run xterm -e /bin/sh -c "echo \"Ping (inet6) $0...\" && ping6 $0 && cat" - else run ping6 $0 - } -} \ No newline at end of file diff --git a/3.4.0/data/defscript/theme-install.kvs b/3.4.0/data/defscript/theme-install.kvs deleted file mode 100644 index febbbbc07f..0000000000 --- a/3.4.0/data/defscript/theme-install.kvs +++ /dev/null @@ -1,30 +0,0 @@ -addon.register("Theme: @THEMENAME@","@THEMEVERSION@",$tr("@THEMENAME@"),$tr("@THEMEDESCRIPTION@"),"3.2.0.99") -{ - # This is our uninstall callback: it will be called by KVIrc when addon.uninstall is invoked - - # This is an automatically generated alias that will erase the installed files - @ALIASNAME@_uninstallfiles - file.rmdir $file.localdir("themes/@SUBDIR@") - alias(@ALIASNAME@_uninstallfiles) {} - # Done -} - -# Ok, addon.register succeeded. We can go on with the installation. - -# Get the path that this script was launched from -%mypath = $file.extractPath($0) - -# get the installer helper class (this is pretty standard and included in the distro) -parse %mypath/utils/installer.kvs - -# The installer will copy our files and generate automatically -# an uninstallation alias for them -%installer = $new(installer,0,myinstaller) - -# copy files in each subdirectory -# the pics - -%installer->$copyFiles("%mypath/files/","*",$file.localdir("themes/@SUBDIR@")) -%installer->$generateUninstallAlias("@ALIASNAME@_uninstallfiles") -# finally kill the installer helper -delete %installer diff --git a/3.4.0/data/defscript/toolbars.kvs b/3.4.0/data/defscript/toolbars.kvs deleted file mode 100644 index 84e7b93a15..0000000000 --- a/3.4.0/data/defscript/toolbars.kvs +++ /dev/null @@ -1,43 +0,0 @@ -# Default toolbars file - -toolbar.create irccontext $tr("IRC Context") $icon("irc4") -# toolbar.additem irccontext kvirc.irccontextdisplay - info dublicated with te status line -toolbar.additem irccontext kvirc.connect -toolbar.additem irccontext kvirc.servermenu -toolbar.additem irccontext kvirc.newirccontext -toolbar.additem irccontext kvirc.separator -toolbar.additem irccontext kvirc.nicknamemenu -toolbar.additem irccontext kvirc.irctools -toolbar.additem irccontext kvirc.ircactions -toolbar.additem irccontext kvirc.usermodemenu -toolbar.show irccontext - -toolbar.create options $tr("Options") $icon("options") -toolbar.additem irccontext kvirc.serveroptions -toolbar.additem options kvirc.identityoptions -toolbar.additem options kvirc.generaloptions -toolbar.additem options kvirc.themeoptions -toolbar.show options - -toolbar.create help $tr("Help") 49 -toolbar.additem help kvirc.helpindex -if($lang(short)==ru) - toolbar.additem help kvirc.kvircruhomepage -else - toolbar.additem help kvirc.kvirchomepage -toolbar.show help - -toolbar.create scripting $tr("Scripting") $icon("binarytext") -toolbar.additem scripting kvirc.actioneditor -toolbar.additem scripting kvirc.aliaseditor -toolbar.additem scripting kvirc.eventeditor -toolbar.additem scripting kvirc.popupeditor -toolbar.additem scripting kvirc.raweditor -toolbar.additem scripting kvirc.codetester -toolbar.additem scripting kvirc.separator -toolbar.additem scripting kvirc.executekvs - -toolbar.create winops $tr("Window operations") $icon("cascadewindows") -toolbar.additem winops kvirc.cascadewindows -toolbar.additem winops kvirc.tilewindows -toolbar.additem winops kvirc.minimizeallwindows \ No newline at end of file diff --git a/3.4.0/data/deftheme/.svnignore b/3.4.0/data/deftheme/.svnignore deleted file mode 100644 index bc419568af..0000000000 --- a/3.4.0/data/deftheme/.svnignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile.in -Makefile -core -.pics -.mospics \ No newline at end of file diff --git a/3.4.0/data/deftheme/Makefile.am b/3.4.0/data/deftheme/Makefile.am deleted file mode 100644 index c6ce91e6da..0000000000 --- a/3.4.0/data/deftheme/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -SUBDIRS = silverirc - diff --git a/3.4.0/data/deftheme/hires/Makefile b/3.4.0/data/deftheme/hires/Makefile deleted file mode 100644 index cbc0bb58eb..0000000000 --- a/3.4.0/data/deftheme/hires/Makefile +++ /dev/null @@ -1,388 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# data/deftheme/hires/Makefile. Generated from Makefile.in by configure. - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - - -srcdir = . -top_srcdir = ../../.. - -pkgdatadir = $(datadir)/kvirc -pkglibdir = $(libdir)/kvirc -pkgincludedir = $(includedir)/kvirc -top_builddir = ../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = /usr/bin/install -c -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = x86_64-unknown-linux-gnu -host_triplet = x86_64-unknown-linux-gnu -target_triplet = x86_64-unknown-linux-gnu -subdir = data/deftheme/hires -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/src/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(tmpdir)" -tmpDATA_INSTALL = $(INSTALL_DATA) -DATA = $(tmp_DATA) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /usr/build/kvirccvs/kvirc/admin/missing --run aclocal-1.9 -AMDEP_FALSE = # -AMDEP_TRUE = -AMTAR = ${SHELL} /usr/build/kvirccvs/kvirc/admin/missing --run tar -AR = ar -AUTOCONF = ${SHELL} /usr/build/kvirccvs/kvirc/admin/missing --run autoconf -AUTOHEADER = ${SHELL} /usr/build/kvirccvs/kvirc/admin/missing --run autoheader -AUTOMAKE = ${SHELL} /usr/build/kvirccvs/kvirc/admin/missing --run automake-1.9 -AWK = gawk -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -CPP = gcc -E -CPPFLAGS = -CXX = g++ -CXXCPP = g++ -E -CXXDEPMODE = depmode=gcc3 -CXXFLAGS = -g -CYGPATH_W = echo -DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps -ECHO = echo -ECHO_C = -ECHO_N = -n -ECHO_T = -EGREP = grep -E -EXEEXT = -F77 = -FFLAGS = -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s -LDFLAGS = -LIBOBJS = -LIBS = -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LN_S = ln -s -LTLIBOBJS = -MAKEINFO = ${SHELL} /usr/build/kvirccvs/kvirc/admin/missing --run makeinfo -OBJEXT = o -PACKAGE = kvirc -PACKAGE_BUGREPORT = -PACKAGE_NAME = -PACKAGE_STRING = -PACKAGE_TARNAME = -PACKAGE_VERSION = -PATH_SEPARATOR = : -RANLIB = ranlib -SET_MAKE = -SHELL = /bin/sh -SS_CPPFLAGS = -D_REENTRANT -DREENTRANT -SS_INCDIRS = -I/usr/qt/3/include -I/usr/include -I/usr/include -I/usr/kde/3.5/include -SS_LDFLAGS = -lSM -lICE -L/usr/lib64 -SS_LIBDIRS = -L/usr/build/kvirccvs/kvirc/src/kvilib/build/ -L/usr/qt/3/lib -L/usr/lib64 -L/usr/kde/3.5/lib -SS_LIBLINK = -lkdecore -lkdeui -lkparts -lqt-mt -lX11 -lXext -lpthread -lssl -lcrypto -lesd -laudiofile -lm -ldl -lz -lXss -SS_MSGFMT = /usr/bin/msgfmt -SS_PERL_BINARY = /usr/bin/perl -SS_PERL_CCFLAGS = -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -SS_PERL_LDFLAGS = -rdynamic -L/usr/local/lib64 /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/DynaLoader/DynaLoader.a -L/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc -SS_QT_MOC = /usr/qt/3/bin/moc -SS_RPATH = -rpath /usr/qt/3/lib -rpath ${exec_prefix}/lib -rpath /usr/lib64 -rpath /usr/kde/3.5/lib -SS_TOPSRCDIR = /usr/build/kvirccvs/kvirc -STRIP = strip -VERSION = 3.2.4 -X_CFLAGS = -X_EXTRA_LIBS = -X_LIBS = -L/usr/lib64 -X_PRE_LIBS = -lSM -lICE -ac_ct_AR = ar -ac_ct_CC = gcc -ac_ct_CXX = g++ -ac_ct_F77 = -ac_ct_RANLIB = ranlib -ac_ct_STRIP = strip -am__fastdepCC_FALSE = # -am__fastdepCC_TRUE = -am__fastdepCXX_FALSE = # -am__fastdepCXX_TRUE = -am__include = include -am__leading_dot = . -am__quote = -am__tar = ${AMTAR} chof - "$$tardir" -am__untar = ${AMTAR} xf - -applnkdir = /usr/kde/3.5/./share/applnk/Internet -bindir = ${exec_prefix}/bin -build = x86_64-unknown-linux-gnu -build_alias = -build_cpu = x86_64 -build_os = linux-gnu -build_vendor = unknown -configdir = ${globalkvircdir}/config -configmodulesdir = ${globalkvircdir}/config/modules -datadir = ${prefix}/share -defscriptdir = ${globalkvircdir}/defscript -exec_prefix = ${prefix} -globalkvircdir = ${datadir}/kvirc/3.2 -headersdir = ${exec_prefix}/include/kvirc/3.2.4 -helpdir = ${globalkvircdir}/help/en -host = x86_64-unknown-linux-gnu -host_alias = -host_cpu = x86_64 -host_os = linux-gnu -host_vendor = unknown -iconapps16datadir = /usr/kde/3.5/./share/icons/hicolor/16x16/apps -iconapps32datadir = /usr/kde/3.5/./share/icons/hicolor/32x32/apps -iconapps48datadir = /usr/kde/3.5/./share/icons/hicolor/48x48/apps -iconapps64datadir = /usr/kde/3.5/./share/icons/hicolor/64x64/apps -iconmime16datadir = /usr/kde/3.5/./share/icons/hicolor/16x16/mimetypes -iconmime32datadir = /usr/kde/3.5/./share/icons/hicolor/32x32/mimetypes -iconmime48datadir = /usr/kde/3.5/./share/icons/hicolor/48x48/mimetypes -iconmime64datadir = /usr/kde/3.5/./share/icons/hicolor/64x64/mimetypes -includedir = ${prefix}/include -infodir = ${prefix}/info -install_sh = /usr/build/kvirccvs/kvirc/admin/install-sh -kdeservicesdir = /usr/kde/3.5/share/services -libdir = ${exec_prefix}/lib -libexecdir = ${exec_prefix}/libexec -licensedir = ${globalkvircdir}/license -localedir = ${globalkvircdir}/locale -localstatedir = ${prefix}/var -mandir = ${prefix}/man -mimelnkdir = /usr/kde/3.5/./share/mimelnk/text -mkdir_p = mkdir -p -- -modulelibdir = ${globalkvircdir}/modules -msgcolorsdir = ${globalkvircdir}/msgcolors -oldincludedir = /usr/include -picsdir = ${globalkvircdir}/pics -pluglibdir = ${globalkvircdir}/modules -prefix = /usr/local -program_transform_name = s,x,x, -sbindir = ${exec_prefix}/sbin -sharedstatedir = ${prefix}/com -sysconfdir = ${prefix}/etc -target = x86_64-unknown-linux-gnu -target_alias = -target_cpu = x86_64 -target_os = linux-gnu -target_vendor = unknown -themedir = ${globalkvircdir}/themes -topdir = /usr/build/kvirccvs/kvirc -tmpdir = $(themedir)/default.hires -tmp_DATA = themeinfo.kvc themedata.kvc -EXTRA_DIST = $(tmp_DATA) -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/deftheme/hires/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu data/deftheme/hires/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-tmpDATA: $(tmp_DATA) - @$(NORMAL_INSTALL) - test -z "$(tmpdir)" || $(mkdir_p) "$(DESTDIR)$(tmpdir)" - @list='$(tmp_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(tmpDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(tmpdir)/$$f'"; \ - $(tmpDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(tmpdir)/$$f"; \ - done - -uninstall-tmpDATA: - @$(NORMAL_UNINSTALL) - @list='$(tmp_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(tmpdir)/$$f'"; \ - rm -f "$(DESTDIR)$(tmpdir)/$$f"; \ - done -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(DATA) -installdirs: - for dir in "$(DESTDIR)$(tmpdir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-tmpDATA - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am uninstall-tmpDATA - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - install-tmpDATA installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am uninstall-info-am uninstall-tmpDATA - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3.4.0/data/deftheme/lores/Makefile b/3.4.0/data/deftheme/lores/Makefile deleted file mode 100644 index da7fc96c90..0000000000 --- a/3.4.0/data/deftheme/lores/Makefile +++ /dev/null @@ -1,388 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# data/deftheme/lores/Makefile. Generated from Makefile.in by configure. - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - - -srcdir = . -top_srcdir = ../../.. - -pkgdatadir = $(datadir)/kvirc -pkglibdir = $(libdir)/kvirc -pkgincludedir = $(includedir)/kvirc -top_builddir = ../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = /usr/bin/install -c -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = x86_64-unknown-linux-gnu -host_triplet = x86_64-unknown-linux-gnu -target_triplet = x86_64-unknown-linux-gnu -subdir = data/deftheme/lores -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/src/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(tmpdir)" -tmpDATA_INSTALL = $(INSTALL_DATA) -DATA = $(tmp_DATA) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /usr/build/kvirccvs/kvirc/admin/missing --run aclocal-1.9 -AMDEP_FALSE = # -AMDEP_TRUE = -AMTAR = ${SHELL} /usr/build/kvirccvs/kvirc/admin/missing --run tar -AR = ar -AUTOCONF = ${SHELL} /usr/build/kvirccvs/kvirc/admin/missing --run autoconf -AUTOHEADER = ${SHELL} /usr/build/kvirccvs/kvirc/admin/missing --run autoheader -AUTOMAKE = ${SHELL} /usr/build/kvirccvs/kvirc/admin/missing --run automake-1.9 -AWK = gawk -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -CPP = gcc -E -CPPFLAGS = -CXX = g++ -CXXCPP = g++ -E -CXXDEPMODE = depmode=gcc3 -CXXFLAGS = -g -CYGPATH_W = echo -DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps -ECHO = echo -ECHO_C = -ECHO_N = -n -ECHO_T = -EGREP = grep -E -EXEEXT = -F77 = -FFLAGS = -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s -LDFLAGS = -LIBOBJS = -LIBS = -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LN_S = ln -s -LTLIBOBJS = -MAKEINFO = ${SHELL} /usr/build/kvirccvs/kvirc/admin/missing --run makeinfo -OBJEXT = o -PACKAGE = kvirc -PACKAGE_BUGREPORT = -PACKAGE_NAME = -PACKAGE_STRING = -PACKAGE_TARNAME = -PACKAGE_VERSION = -PATH_SEPARATOR = : -RANLIB = ranlib -SET_MAKE = -SHELL = /bin/sh -SS_CPPFLAGS = -D_REENTRANT -DREENTRANT -SS_INCDIRS = -I/usr/qt/3/include -I/usr/include -I/usr/include -I/usr/kde/3.5/include -SS_LDFLAGS = -lSM -lICE -L/usr/lib64 -SS_LIBDIRS = -L/usr/build/kvirccvs/kvirc/src/kvilib/build/ -L/usr/qt/3/lib -L/usr/lib64 -L/usr/kde/3.5/lib -SS_LIBLINK = -lkdecore -lkdeui -lkparts -lqt-mt -lX11 -lXext -lpthread -lssl -lcrypto -lesd -laudiofile -lm -ldl -lz -lXss -SS_MSGFMT = /usr/bin/msgfmt -SS_PERL_BINARY = /usr/bin/perl -SS_PERL_CCFLAGS = -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -SS_PERL_LDFLAGS = -rdynamic -L/usr/local/lib64 /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/DynaLoader/DynaLoader.a -L/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc -SS_QT_MOC = /usr/qt/3/bin/moc -SS_RPATH = -rpath /usr/qt/3/lib -rpath ${exec_prefix}/lib -rpath /usr/lib64 -rpath /usr/kde/3.5/lib -SS_TOPSRCDIR = /usr/build/kvirccvs/kvirc -STRIP = strip -VERSION = 3.2.4 -X_CFLAGS = -X_EXTRA_LIBS = -X_LIBS = -L/usr/lib64 -X_PRE_LIBS = -lSM -lICE -ac_ct_AR = ar -ac_ct_CC = gcc -ac_ct_CXX = g++ -ac_ct_F77 = -ac_ct_RANLIB = ranlib -ac_ct_STRIP = strip -am__fastdepCC_FALSE = # -am__fastdepCC_TRUE = -am__fastdepCXX_FALSE = # -am__fastdepCXX_TRUE = -am__include = include -am__leading_dot = . -am__quote = -am__tar = ${AMTAR} chof - "$$tardir" -am__untar = ${AMTAR} xf - -applnkdir = /usr/kde/3.5/./share/applnk/Internet -bindir = ${exec_prefix}/bin -build = x86_64-unknown-linux-gnu -build_alias = -build_cpu = x86_64 -build_os = linux-gnu -build_vendor = unknown -configdir = ${globalkvircdir}/config -configmodulesdir = ${globalkvircdir}/config/modules -datadir = ${prefix}/share -defscriptdir = ${globalkvircdir}/defscript -exec_prefix = ${prefix} -globalkvircdir = ${datadir}/kvirc/3.2 -headersdir = ${exec_prefix}/include/kvirc/3.2.4 -helpdir = ${globalkvircdir}/help/en -host = x86_64-unknown-linux-gnu -host_alias = -host_cpu = x86_64 -host_os = linux-gnu -host_vendor = unknown -iconapps16datadir = /usr/kde/3.5/./share/icons/hicolor/16x16/apps -iconapps32datadir = /usr/kde/3.5/./share/icons/hicolor/32x32/apps -iconapps48datadir = /usr/kde/3.5/./share/icons/hicolor/48x48/apps -iconapps64datadir = /usr/kde/3.5/./share/icons/hicolor/64x64/apps -iconmime16datadir = /usr/kde/3.5/./share/icons/hicolor/16x16/mimetypes -iconmime32datadir = /usr/kde/3.5/./share/icons/hicolor/32x32/mimetypes -iconmime48datadir = /usr/kde/3.5/./share/icons/hicolor/48x48/mimetypes -iconmime64datadir = /usr/kde/3.5/./share/icons/hicolor/64x64/mimetypes -includedir = ${prefix}/include -infodir = ${prefix}/info -install_sh = /usr/build/kvirccvs/kvirc/admin/install-sh -kdeservicesdir = /usr/kde/3.5/share/services -libdir = ${exec_prefix}/lib -libexecdir = ${exec_prefix}/libexec -licensedir = ${globalkvircdir}/license -localedir = ${globalkvircdir}/locale -localstatedir = ${prefix}/var -mandir = ${prefix}/man -mimelnkdir = /usr/kde/3.5/./share/mimelnk/text -mkdir_p = mkdir -p -- -modulelibdir = ${globalkvircdir}/modules -msgcolorsdir = ${globalkvircdir}/msgcolors -oldincludedir = /usr/include -picsdir = ${globalkvircdir}/pics -pluglibdir = ${globalkvircdir}/modules -prefix = /usr/local -program_transform_name = s,x,x, -sbindir = ${exec_prefix}/sbin -sharedstatedir = ${prefix}/com -sysconfdir = ${prefix}/etc -target = x86_64-unknown-linux-gnu -target_alias = -target_cpu = x86_64 -target_os = linux-gnu -target_vendor = unknown -themedir = ${globalkvircdir}/themes -topdir = /usr/build/kvirccvs/kvirc -tmpdir = $(themedir)/default.lores -tmp_DATA = themeinfo.kvc themedata.kvc -EXTRA_DIST = $(tmp_DATA) -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/deftheme/lores/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu data/deftheme/lores/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-tmpDATA: $(tmp_DATA) - @$(NORMAL_INSTALL) - test -z "$(tmpdir)" || $(mkdir_p) "$(DESTDIR)$(tmpdir)" - @list='$(tmp_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(tmpDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(tmpdir)/$$f'"; \ - $(tmpDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(tmpdir)/$$f"; \ - done - -uninstall-tmpDATA: - @$(NORMAL_UNINSTALL) - @list='$(tmp_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(tmpdir)/$$f'"; \ - rm -f "$(DESTDIR)$(tmpdir)/$$f"; \ - done -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(DATA) -installdirs: - for dir in "$(DESTDIR)$(tmpdir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-tmpDATA - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am uninstall-tmpDATA - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - install-tmpDATA installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am uninstall-info-am uninstall-tmpDATA - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3.4.0/data/deftheme/silverirc/.svnignore b/3.4.0/data/deftheme/silverirc/.svnignore deleted file mode 100644 index 3dda72986f..0000000000 --- a/3.4.0/data/deftheme/silverirc/.svnignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile.in -Makefile diff --git a/3.4.0/data/deftheme/silverirc/Makefile.am b/3.4.0/data/deftheme/silverirc/Makefile.am deleted file mode 100644 index e4f01a62a9..0000000000 --- a/3.4.0/data/deftheme/silverirc/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -tmpdir = $(themedir)/silverirc - -tmp_DATA = themeinfo.kvc themedata.kvc pixmapIrcViewBackground.png pixmapInputBackground.png pixmapUserListViewBackground.png - -EXTRA_DIST = $(tmp_DATA) \ No newline at end of file diff --git a/3.4.0/data/deftheme/silverirc/pixmapInputBackground.png b/3.4.0/data/deftheme/silverirc/pixmapInputBackground.png deleted file mode 100644 index 0350abdc02..0000000000 Binary files a/3.4.0/data/deftheme/silverirc/pixmapInputBackground.png and /dev/null differ diff --git a/3.4.0/data/deftheme/silverirc/pixmapIrcViewBackground.png b/3.4.0/data/deftheme/silverirc/pixmapIrcViewBackground.png deleted file mode 100644 index b5d0368cb3..0000000000 Binary files a/3.4.0/data/deftheme/silverirc/pixmapIrcViewBackground.png and /dev/null differ diff --git a/3.4.0/data/deftheme/silverirc/pixmapUserListViewBackground.png b/3.4.0/data/deftheme/silverirc/pixmapUserListViewBackground.png deleted file mode 100644 index 28f4b42872..0000000000 Binary files a/3.4.0/data/deftheme/silverirc/pixmapUserListViewBackground.png and /dev/null differ diff --git a/3.4.0/data/deftheme/silverirc/themedata.kvc b/3.4.0/data/deftheme/silverirc/themedata.kvc deleted file mode 100644 index a83296b817..0000000000 --- a/3.4.0/data/deftheme/silverirc/themedata.kvc +++ /dev/null @@ -1,273 +0,0 @@ -# KVIrc configuration file -[ThemeData] -pixmapUserListViewBackground=pixmapUserListViewBackground.png -msgtypeSearch=206,14,100,1,1 -msgtypeMeBanExcept=197,3,100,1,5 -msgtypeNickServ=164,5,100,1,2 -msgtypeChanPrivmsgCrypted=101,1,100,1,3 -msgtypeNotifyOffLine=95,2,100,1,1 -msgtypeSocketMessage=21,14,100,1,1 -boolDisablePopupIcons=false -boolUseExtendedPrivmsgView=false -msgtypeMeChanAdmin=244,3,100,1,1 -msgtypeMeBanUnExcept=198,3,100,1,5 -msgtypeMeBan=195,5,100,1,5 -msgtypeMeOp=189,3,100,1,5 -msgtypeWallops=139,5,100,1,3 -msgtypeQueryTrace=181,15,100,1,1 -msgtypeHalfDeOp=175,3,100,1,2 -msgtypeIcq=122,5,100,1,1 -msgtypeOwnPrivmsgCrypted=100,1,100,1,3 -uintUserListPixmapAlign=1 -colorInputSelectionForeground=0,0,0 -colorCaptionTextInactive=0,0,0 -stringExtendedPrivmsgPrefix=[ -boolShowTreeTaskbarHeader=false -boolShowUserChannelIcons=true -boolUseGlobalPseudoTransparency=false -msgtypeMeDeVoice=192,3,100,1,5 -msgtypeBroadcastPrivmsg=183,1,100,1,3 -msgtypeChanServ=165,5,100,1,2 -msgtypeWhoisOther=92,2,100,1,1 -msgtypeWhoisChannels=89,2,100,1,1 -msgtypeWhoisUser=88,2,100,1,1 -msgtypeOp=34,3,100,1,2 -msgtypeParserError=11,4,100,1,1 -colorIrcViewMarkLine=40,40,40 -colorUserListViewNormalForeground=0,0,0 -boolUseDifferentColorForOwnNick=true -boolScaleAvatars=true -msgtypeServerError=272,14,100,1,1 -msgtypeMeInviteExcept=199,3,100,1,5 -msgtypeChannelNoticeCrypted=154,5,100,1,3 -msgtypeIrc=105,3,100,1,0 -msgtypeCtcpRequestUnknown=55,5,100,1,2 -msgtypeCtcpRequestReplied=52,5,100,1,2 -colorUserListViewChanOwnerForeground=81,87,111 -colorUserListViewUserOpForeground=0,127,178 -colorUserListViewVoiceForeground=0,0,200 -colorInputForeground=0,0,0 -colorCaptionTextActive2=0,0,0 -colorMdiCaptionActive=113,125,190 -colorTaskBarNormalText=0,0,0 -boolIrcViewUrlHighlighting=true -stringIconThemeSubdir=silverirc -msgtypeAway=170,3,100,1,4 -msgtypeIcqMessage=128,5,100,1,1 -msgtypeLinks=112,2,100,1,1 -msgtypeBan=67,5,100,1,1 -msgtypeVoice=35,3,100,1,1 -msgtypeQuit=58,14,100,1,2 -msgtypeQueryPrivateMessage=48,1,100,1,4 -msgtypeTopic=42,3,100,1,1 -msgtypeHostLookup=13,2,100,1,1 -fontIrcToolBarApplet=Verdana,10,5,50,i -uintToolBarAppletPixmapAlign=0 -uintUserListViewGridType=3 -colorTreeTaskBarProgress=150,150,150 -colorGlobalTransparencyFade=255,255,255 -colorTaskBarHighlight2Text=32,0,255 -boolUseTreeWindowListTaskBar=true -pixmapInputBackground=pixmapInputBackground.png -mirccolor0=255,255,255 -msgtypeMeChanOwner=262,3,100,1,2 -msgtypeChanOwner=260,3,100,1,2 -msgtypeUserDeOp=175,3,100,1,1 -msgtypeGenericError=135,4,100,1,1 -msgtypeStats=205,1,100,1,1 -msgtypeIcqMessageSent=129,5,100,1,1 -msgtypeQueryPrivmsgCrypted=102,1,100,1,3 -msgtypeAvatarChange=57,15,100,1,2 -msgtypeUnrecognized=41,5,100,1,1 -msgtypeSocketWarning=22,5,100,1,3 -msgtypeSelection=0,0,15,1,1 -uintIrcViewPixmapAlign=34 -colorTreeTaskBarHighlight2Foreground=167,222,163 -colorTreeTaskBarActiveForeground=0,0,0 -colorIrcToolBarAppletForegroundMidContrast=110,110,110 -colorUserListViewBackground=255,255,255 -colorTaskBarHighlight1Text=0,16,144 -colorTaskBarMinimizedText=60,60,60 -boolStripMircColorsInUserMessages=false -boolIrcViewShowImages=true -mirccolor1=0,0,0 -msgtypeIgnore=203,15,100,1,1 -msgtypeMeInviteUnexcept=200,3,100,1,5 -msgtypeMultimedia=177,5,100,1,2 -msgtypeServerNotice=141,5,100,1,1 -msgtypeDccChatMsg=103,1,100,1,3 -msgtypeCreationTime=93,15,100,1,1 -msgtypeWhoisServer=91,2,100,1,1 -msgtypeInviteUnexcept=72,15,100,1,1 -msgtypeSplit=59,15,100,1,2 -msgtypeCtcpRequestIgnored=53,5,100,1,1 -msgtypeSystemError=24,4,100,1,4 -msgtypeHighlight=0,7,100,1,5 -fontTaskbar=Sans%20Serif,10,5,50 -uintTreeTaskBarPixmapAlign=0 -uintGlobalTransparencyParentFadeFactor=10 -colorTreeTaskBarHighlight3Foreground=128,0,255 -colorTaskBarHighlight4Text=220,0,255 -colorTaskBarProgressBar=180,180,180 -colorMdiBackground=0,0,0 -boolUseTaskBarActivityMeter=false -boolColorNicks=false -mirccolor2=0,0,140 -msgtypeMeChanUnAdmin=245,3,100,1,1 -msgtypeWho=75,2,100,1,1 -msgtypeDeop=62,3,100,1,1 -msgtypeRaw=25,2,100,1,1 -uintTimeStampBackground=100 -colorUserListViewChanAdminForeground=83,54,5 -colorTreeTaskBarHighlight4Foreground=220,0,255 -colorTaskBarHighlight3Text=128,20,255 -colorTreeTaskBarActiveBackground=200,200,200 -colorLabelForeground=0,0,0 -colorUserListViewSelectionForeground=0,0,0 -colorInputBackgroundColor=255,255,255 -boolDisableUserListLabel=false -mirccolor10=0,150,180 -mirccolor3=0,100,0 -msgtypeGenericSuccess=136,14,100,1,3 -msgtypeDccChatMsgCrypted=104,1,100,1,3 -msgtypeAction=56,13,100,1,3 -msgtypeSystemWarning=26,4,100,1,3 -uintTimeStampForeground=14 -colorTreeTaskBarHighlight5Foreground=255,0,0 -colorTreeTaskBarForeground=0,0,0 -colorIrcViewBackground=255,255,255 -boolUseFlatClassicTaskbarButtons=true -boolDisableAvatars=false -boolUserListViewDrawGrid=false -boolUseGlobalApplicationFont=false -iccolor0=250,250,0 -mirccolor11=170,170,255 -mirccolor4=230,0,0 -msgtypeChanUnOwner=261,3,100,1,2 -msgtypeVerbose=259,15,100,1,0 -msgtypeMeDeHalfOp=194,3,100,1,5 -msgtypeBroadcastNotice=184,5,100,1,3 -msgtypeBanExcept=69,15,100,1,1 -msgtypeNick=61,2,100,1,1 -msgtypeOwnPrivateMessage=45,1,100,1,3 -msgtypeLink=0,2,100,1,0 -uintGlobalTransparencyChildFadeFactor=50 -colorTaskBarHighlight5Text=255,0,0 -colorTreeTaskBarBackground=255,255,255 -colorIrcToolBarAppletForegroundHighContrastInactive1=40,40,40 -colorLabelBackground=255,255,255 -colorInputSelectionBackground=198,198,198 -boolObtainGlobalBackgroundFromKde=false -pixmapLabelBackground= -iccolor1=0,0,0 -mirccolor12=15,15,255 -mirccolor5=150,0,0 -msgtypeChanAdmin=242,3,100,1,1 -msgtypeGenericStatus=133,14,100,1,1 -msgtypeHalfOp=174,3,100,1,1 -msgtypeDevoice=63,3,100,1,1 -msgtypeJoin=39,14,100,1,2 -msgtypeMotd=30,1,100,1,0 -fontIrcView=Trebuchet%20MS,10,5,50 -colorIrcToolBarAppletForegroundHighContrastInactive2=40,40,40 -colorIrcToolBarAppletForegroundLowContrast=180,180,180 -pixmapGlobalTransparencyBackground= -pixmapTreeTaskBarBackground= -iccolor2=0,0,200 -mirccolor13=200,0,200 -mirccolor6=80,0,80 -msgtypeMeChanUnOwner=263,3,100,1,2 -msgtypeMeUserOp=193,3,100,1,1 -msgtypeWhoisIdle=90,2,100,1,1 -msgtypeNicknameProblem=87,3,100,1,1 -msgtypeDccError=79,5,100,1,1 -msgtypeInviteExcept=71,15,100,1,1 -msgtypeConnection=14,5,100,1,1 -msgtypeParserWarning=12,5,100,1,0 -colorUserListViewOwnForeground=126,74,131 -colorUserListViewHalfOpForeground=119,0,178 -colorIrcToolBarAppletForegroundHighContrastActive1=0,0,0 -colorMdiCaptionInactive=180,180,180 -stringExtendedPrivmsgPostfix=]%20 -boolDrawEmoticons=false -boolIrcViewWrapMargin=true -iccolor3=200,0,0 -mirccolor14=80,80,80 -mirccolor7=255,90,0 -msgtypeUserOp=174,3,100,1,1 -msgtypeGenericVerbose=137,14,100,1,1 -msgtypeMeUnban=196,5,100,1,5 -msgtypeMeHalfOp=193,3,100,1,5 -msgtypeInvite=176,7,100,1,4 -msgtypeIdent=171,2,100,1,3 -msgtypeChanMode=73,15,100,1,1 -msgtypeBanUnexcept=70,15,100,1,1 -msgtypeKey=65,15,100,1,2 -msgtypeServerInfo=29,1,100,1,1 -fontInput=Trebuchet%20MS,10,5,50 -colorUserListViewAwayForeground=143,143,143 -colorIrcToolBarAppletForegroundHighContrastActive2=0,60,0 -colorInputCursor=72,216,72 -boolUseSpecialColorForTimestamp=true -pixmapIrcToolBarAppletBackground= -iccolor4=255,255,255 -mirccolor15=170,170,170 -mirccolor8=255,255,0 -msgtypeSSL=229,2,100,1,0 -msgtypeMeVoice=190,3,100,1,5 -msgtypeChannelNotice=153,5,100,1,3 -msgtypeNotifyOnLine=94,2,100,1,1 -msgtypeCtcpReply=51,5,100,1,2 -msgtypeUnhandledReply=28,2,100,1,1 -msgtypeSystemMessage=27,2,100,1,1 -fontApplication=Sans%20Serif,10,5,50 -colorUserListViewGrid=216,216,216 -colorTreeTaskBarHighlight1Foreground=165,165,165 -colorCaptionTextActive=255,255,255 -pixmapIrcViewBackground=pixmapIrcViewBackground.png -iccolor5=0,150,190 -mirccolor9=0,255,0 -msgtypeTextEncoding=236,1,100,1,0 -msgtypeMeDeOp=191,3,100,1,5 -msgtypeJoinError=182,5,100,1,4 -msgtypeQueryNotice=155,5,100,1,3 -msgtypeSpam=120,14,100,1,3 -msgtypeKick=110,4,100,1,2 -msgtypeDccRequest=77,5,100,1,3 -msgtypeUnban=68,5,100,1,1 -msgtypeLimit=66,15,100,1,1 -msgtypeMode=64,15,100,1,1 -msgtypePart=40,14,100,1,2 -msgtypeServerPing=36,15,100,1,0 -colorUserListViewOpForeground=200,0,0 -colorInputControl=200,100,0 -colorCaptionTextInactive2=30,30,30 -pixmapMdiBackground= -iccolor6=0,130,0 -msgtypeHelp=49,3,100,1,1 -msgtypeMeDeUserOp=194,3,100,1,1 -msgtypeChanUnAdmin=243,3,100,1,1 -msgtypeMeKick=188,4,100,1,5 -msgtypeList=173,1,100,1,1 -msgtypeQueryNoticeCrypted=156,5,100,1,3 -msgtypeChannelPrivateMessage=46,1,100,1,3 -msgtypeSocketError=23,4,100,1,4 -msgtypeEcho=0,1,100,1,1 -uintInputPixmapAlign=32 -colorIrcToolBarAppletBackground=255,255,255 -boolShowUserChannelState=false -boolBoldedNicks=false -boolShowUserAndHostInPrivmsgView=false -iccolor7=150,0,170 -msgtypeGenericCritical=134,4,100,1,4 -msgtypeGenericWarning=132,5,100,1,0 -msgtypeCtcpReplyUnknown=162,5,100,1,1 -msgtypeDccMsg=78,5,100,1,2 -msgtypeQuitSplit=60,14,100,1,2 -msgtypeCtcpRequestFlood=54,5,100,1,1 -msgtypeUrl=0,2,100,1,1 -fontLabel=Sans%20Serif,10,5,50 -fontUserListView=Sans%20Serif,10,5,50,i -uintClassicTaskBarMaximumButtonWidth=100 -colorUserListViewSelectionBackground=194,194,194 -boolClassicTaskBarSetMaximumButtonWidth=true diff --git a/3.4.0/data/deftheme/silverirc/themeinfo.kvc b/3.4.0/data/deftheme/silverirc/themeinfo.kvc deleted file mode 100644 index 14fbdcc8f3..0000000000 --- a/3.4.0/data/deftheme/silverirc/themeinfo.kvc +++ /dev/null @@ -1,10 +0,0 @@ -# KVIrc configuration file -[ThemeInfo] -Author=Alexey -Version=0.7 -Name=SilverIRC -MinimumKvircVersion=3.2.4 -Date=08.01.2007 -Description=Default KVIrc Theme -ThemeInfoFileVersion=1.0.0 -Application=KVIrc 3.2.4 diff --git a/3.4.0/data/doctemplates/.svnignore b/3.4.0/data/doctemplates/.svnignore deleted file mode 100644 index bc419568af..0000000000 --- a/3.4.0/data/doctemplates/.svnignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile.in -Makefile -core -.pics -.mospics \ No newline at end of file diff --git a/3.4.0/data/doctemplates/Makefile.am b/3.4.0/data/doctemplates/Makefile.am deleted file mode 100644 index edd4722444..0000000000 --- a/3.4.0/data/doctemplates/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST = rfc2812.template kvircintro.template ircintro.template diff --git a/3.4.0/data/doctemplates/ircintro.template b/3.4.0/data/doctemplates/ircintro.template deleted file mode 100644 index 9b51485629..0000000000 --- a/3.4.0/data/doctemplates/ircintro.template +++ /dev/null @@ -1,60 +0,0 @@ -/* - @doc: ircintro - @title: - Introduction to IRC - @short: - Introduction to IRC - @keyterms: - irc,channel,channels,channel operator,irc server,server,irc network,irc user,irc users,irc client,internet relay chat,nickname,nicknames,irc etiquette - @body: - [big]What is IRC ?[/big][br] - Internet Relay Chat (IRC) is one of the most popular and most interactive services on the Internet. - When you've been wondering 'where the others are?', then IRC is what you're looking for. - IRC allows real-time conversations with people from the whole planet, 24-hours a day, worldwide. - [br] - [big]How does it work ?[/big][br] - IRC consists of various separate networks (or "nets") of IRC servers: machines that allow users to connect to IRC. - The largest nets are EFnet (the original IRC net, often having more than 32,000 people at once), Undernet, IRCnet, DALnet, and NewNet. - Generally, the user (such as you) runs a program (called "irc client") to connect to a server on one of the IRC nets. - The server will relay the informations between you and the "rest" of the network (obviously including the other irc users). - Each user is known on IRC by a nickname (or "nick"), such as smartgal or FunGuy. - To avoid conflicts with other users, it is best to use a nick that is not too common, e.g., "john" is a poor choice. - Some networks allow the registration of nicknames: once you have registered a nickname noone else will be able to use it. - Once connected to an IRC server on an IRC network, you will usually join one or more [b]channels[/b] and converse with other irc users. - On EFnet, there often are more than 12,000 channels, each one devoted to a different topic. - [br] - [big]Channels[/big][br] - Channel names usually begin with a #, as in #irchelp. - The same channels are shared among all IRC servers on the same net, so you do not have to be on the same IRC server as your friends. - Each channel can be joined by a "virtually" unlimited number of users and every word spoken "to the channel" is - seen by all the users that have joined it. - Each channel has a topic that usually describes the ideas being exchanged between users in that moment. - It is a good idea to take a look at the topic before starting to talk "randomly" :). - Channels are run by channel operators, or just "ops" for short, who can control the channel by choosing who may join (by "banning" some users), - who must leave (by "kicking" them out), and even who may speak (by making the channel "moderated")! - Channel ops have complete control over their channel, and their decisions are final. - If you are banned from a channel, send a /msg to a channel op and ask nicely to be let in - (see the /who command in the next section to learn how to find ops). - If they ignore you or /who gives no response because the channel is in secret mode (+s), - just go somewhere else where you are more welcome. - Some IRC networks have a richer hierarchy of channel users and you may find half-operators, channel administrators or - channel owners. - [br] - [big]Just a bit of IRC Etiquette...[/big][br] - You'll find all kinds of people on IRC. Some nice, and some not so nice. - Simply behave as you would in the real world. Most people will be friendly and considerate, if you are as well. - When you join a channel, say hello. Don't expect to get hello's back from everyone, - especially when there are lots of people on the channel. - If you've never visited the channel before and have no idea what to expect, - just sit back and watch for awhile to get a feel for the flow of the channel (thats called "lurking"). - [br] - [big]Finding more info[/big][br] - The web is full of informations about IRC: it's just a matter of typing "IRC" in a search engine. - An user-friendly site to start from might be www.irchelp.org: you will find a huge list of - documents and links that will hopefully answer to all your questions. - You may also give a short read to the [doc:kvircintro]Introduction to KVIrc[/doc] which will - give you an idea of what an IRC client is. - [br] - [big]Well...[/big][br] - Have fun :) -*/ diff --git a/3.4.0/data/doctemplates/kvircintro.template b/3.4.0/data/doctemplates/kvircintro.template deleted file mode 100644 index 149590af99..0000000000 --- a/3.4.0/data/doctemplates/kvircintro.template +++ /dev/null @@ -1,67 +0,0 @@ -/* - @doc: kvircintro - @title: - Introduction to KVIrc - @short: - Introduction to KVIrc - @keyterms: - KVIrc - @body: - [big]Introduction[/big] - - In really simple words KVIrc is a Chat client: you use it to talk to other - people over the internet. More specifically KVIrc is an IRC client - and if you haven't readed it yet please take a look at the [doc:ircintro]IRC introduction[/doc] - then come back here. Now that you know what IRC is then you already know - that an IRC client acts as a relay for the informations that you - exchange with your IRC server. KVIrc also acts as a filter and provides - an user-friendly interface for the communication protocol that is a bit complex - and rude when seen in its original form (by using telnet for example). - KVIrc also contains a sophisticated scripting language that allows you to - implement automated reactions to the network events. This is something similar - to creating a robot that acts spontaneously after you have told him what to do. - The scripting language allows you to enchance the KVIrc's interface and - to handle special IRC network features that KVIrc itself isn't aware of. - - [big]History[/big] - - The original meaning of the name "KVIrc" was, more or less, "K Visual IRC Client". - The initial K is a common prefix for the applications written for the KDE - desktop environment: this was the case of the initial versions of KVIrc. - Starting from version 2.0.0 the absolute KDE dependancy has been dropped (for several - valid reasons) and the support became optional.[br] - "Visual" was (and is) one of the client goals: having an user-friendly interface to the IRC world. - Many extreme-unix users have misinterpreted the "user-friendly" interface and have tagged - KVIrc as a client for "newbies". Well... that is partially true: KVIrc is ALSO a client for newbies: - A total IRC novice should be able to "chat" in few minutes after installing the program, - preferably without bothering to read any manual. Yes ,I know that it is not in "unix"-style. - On the other side, KVIrc contains a whole bunch of compex features that can be discovered - only by reading the documentation and experimenting. I bet that you can also - find a lot of undocumented tricks :) - - [big]A bit of "philosophy"[/big] - - At the time of writing (Feb 2005) KVIrc approaches release 3.2.0. The small - [b]one-man-project[/b] has grown to the level of a small [b]community[/b]. - People from around the world have joined our development efforts and are - constantly donating their time, eyes and bandwidth in order to make KVIrc - a really good IRC client. Besides of simply giving you a free (as in freedom!) and nice - program for chatting, they are giving you the great opportunity to see what's behind - the scenes: you have the source code for the whole application. - In practical terms this means more or less 300.000 lines of tested, debugged and - commented C++ code, several perl scripts, dozens of makefiles and all the means - that you need to produce a working KVIrc executable on all the supported platforms. - There is a lot of knowledge (some people call it "technology" because it sells better) - inside, ready to be acquired by an attentive reader. Don't forget that the freedom of - building your own executable from the sources gives you the opportunity - of verifying the source itself: for example you might be interested in verifying - that KVIrc will not run any malware code on your machine nor will collect - your private data and sell it to someone while you're happily chatting with a friend. - [b]We call it freedom, please respect it.[/b] - - [big]Well...[/big] - - Have fun :)[br] - [br] - Szymon Stefanek and The KVIrc Development Team -*/ diff --git a/3.4.0/data/doctemplates/rfc2812.template b/3.4.0/data/doctemplates/rfc2812.template deleted file mode 100644 index 9d81a1c801..0000000000 --- a/3.4.0/data/doctemplates/rfc2812.template +++ /dev/null @@ -1,3312 +0,0 @@ -/* - @doc: rfc2812 - @title: - RFC2812 - @short: - The IRC protocol specification (revised) - @keyterms: - irc, protocol, bnf, irc user, irc channel, server protocol, - server messages, server replies, numeric messages - @body: - -[table] - -[tr][td][pre] -Network Working Group, C.Kalt, April 2000 -Request for Comments: 2812 -Updates: 1459 -Category: Informational -[/pre][/td][/tr] - -[tr][td] -[center][big]Internet Relay Chat: Client Protocol[/big][/center] -[/td][/tr] - -[tr][td] -[b]Status of this Memo[/b] -[/td][/tr] - -[tr][td] -This memo provides information for the Internet community. It does -not specify an Internet standard of any kind. Distribution of this -memo is unlimited. -[/td][/tr] - -[tr][td] -[b]Copyright Notice[/b] -[/td][/tr] - -[tr][td] -Copyright (C) The Internet Society (2000). All Rights Reserved. -[/td][/tr] - -[tr][td] -[b]IESG NOTE:[/b] -[/td][/tr] - -[tr][td] -The IRC protocol itself enables several possibilities of transferring -data between clients, and just like with other transfer mechanisms -like email, the receiver of the data has to be careful about how the -data is handled. For more information on security issues with the IRC -protocol, see for example http://www.irchelp.org/irchelp/security/. -[/td][/tr] - -[tr][td] -[b]Abstract[/b] -[/td][/tr] - -[tr][td] -The IRC (Internet Relay Chat) protocol is for use with text based -conferencing; the simplest client being any socket program capable of -connecting to the server. -[p] -This document defines the Client Protocol, and assumes that the -reader is familiar with the IRC Architecture [IRC-ARCH]. -[/td][/tr] - -[tr][td] -[b]Table of Contents[/b] -[/td][/tr] - -[tr][td] -[ul] -[li]1. Labels[/li] -[ul] -[li]1.1 Servers[/li] -[li]1.2 Clients[/li] -[ul] -[li]1.2.1 Users[/li] -[ul] -[li]1.2.1.1 Operators[/li] -[/ul] -[li]1.2.2 Services[/li] -[/ul] -[li]1.3 Channels[/li] -[/ul] -[li]2. The IRC Client Specification[/li] -[ul] -[li]2.1 Overview[/li] -[li]2.2 Character codes[/li] -[li]2.3 Messages[/li] -[ul] -[li]2.3.1 Message format in Augmented BNF[/li] -[/ul] -[li]2.4 Numeric replies[/li] -[li]2.5 Wildcard expressions[/li] -[/ul] -[li]3. Message Details[/li] -[ul] -[li]3.1 Connection Registration[/li] -[ul] -[li]3.1.1 Password message[/li] -[li]3.1.2 Nick message[/li] -[li]3.1.3 User message[/li] -[li]3.1.4 Oper message[/li] -[li]3.1.5 User mode message[/li] -[li]3.1.6 Service message[/li] -[li]3.1.7 Quit[/li] -[li]3.1.8 Squit[/li] -[/ul] -[li]3.2 Channel operations[/li] -[ul] -[li]3.2.1 Join message[/li] -[li]3.2.2 Part message[/li] -[li]3.2.3 Channel mode message[/li] -[li]3.2.4 Topic message[/li] -[li]3.2.5 Names message[/li] -[li]3.2.6 List message[/li] -[li]3.2.7 Invite message[/li] -[li]3.2.8 Kick command[/li] -[/ul] -[li]3.3 Sending messages[/li] -[ul] -[li]3.3.1 Private messages[/li] -[li]3.3.2 Notice[/li] -[/ul] -[li]3.4 Server queries and commands[/li] -[ul] -[li]3.4.1 Motd message[/li] -[li]3.4.2 Lusers message[/li] -[li]3.4.3 Version message[/li] -[li]3.4.4 Stats message[/li] -[li]3.4.5 Links message[/li] -[li]3.4.6 Time message[/li] -[li]3.4.7 Connect message[/li] -[li]3.4.8 Trace message[/li] -[li]3.4.9 Admin command[/li] -[li]3.4.10 Info command[/li] -[/ul] -[li]3.5 Service Query and Commands[/li] -[ul] -[li]3.5.1 Servlist message[/li] -[li]3.5.2 Squery[/li] -[/ul] -[li]3.6 User based queries[/li] -[ul] -[li]3.6.1 Who query[/li] -[li]3.6.2 Whois query[/li] -[li]3.6.3 Whowas[/li] -[/ul] -[li]3.7 Miscellaneous messages[/li] -[ul] -[li]3.7.1 Kill message[/li] -[li]3.7.2 Ping message[/li] -[li]3.7.3 Pong message[/li] -[li]3.7.4 Error[/li] -[/ul] -[/ul] -[li]4. Optional features[/li] -[ul] -[li]4.1 Away[/li] -[li]4.2 Rehash message[/li] -[li]4.3 Die message[/li] -[li]4.4 Restart message[/li] -[li]4.5 Summon message[/li] -[li]4.6 Users[/li] -[li]4.7 Operwall message[/li] -[li]4.8 Userhost message[/li] -[li]4.9 Ison message[/li] -[/ul] -[li]5. Replies[/li] -[ul] -[li]5.1 Command responses[/li] -[li]5.2 Error Replies[/li] -[li]5.3 Reserved numerics[/li] -[/ul] -[li]6. Current implementations[/li] -[li]7. Current problems[/li] -[ul] -[li]7.1 Nicknames[/li] -[li]7.2 Limitation of wildcards[/li] -[li]7.3 Security considerations[/li] -[/ul] -[li]8. Current support and availability[/li] -[li]9. Acknowledgements[/li] -[li]10. References[/li] -[li]11. Author's Address[/li] -[li]12. Full Copyright Statement[/li] -[/ul] -[/td][/tr] - -[tr][td] -[b]1. Labels[/b] -[/td][/tr] - -[tr][td] -This section defines the identifiers used for the various components -of the IRC protocol. -[/td][/tr] - -[tr][td] -[b]1.1 Servers[/b] -[/td][/tr] - -[tr][td] -Servers are uniquely identified by their name, which has a maximum -length of sixty three (63) characters. See the protocol grammar -rules (section 2.3.1) for what may and may not be used in a server -name. -[/td][/tr] - -[tr][td] -[b]1.2 Clients[/b] -[/td][/tr] - -[tr][td] -For each client all servers MUST have the following information: a -netwide unique identifier (whose format depends on the type of -client) and the server which introduced the client. -[/td][/tr] - -[tr][td] -[b]1.2.1 Users[/b] -[/td][/tr] - -[tr][td] -Each user is distinguished from other users by a unique nickname -having a maximum length of nine (9) characters. See the protocol -grammar rules (section 2.3.1) for what may and may not be used in a -nickname. -[p] -While the maximum length is limited to nine characters, clients -SHOULD accept longer strings as they may become used in future -evolutions of the protocol. -[/td][/tr] - -[tr][td] -[b]1.2.1.1 Operators[/b] -[/td][/tr] - -[tr][td] -To allow a reasonable amount of order to be kept within the IRC -network, a special class of users (operators) is allowed to perform -general maintenance functions on the network. Although the powers -granted to an operator can be considered as 'dangerous', they are -nonetheless often necessary. Operators SHOULD be able to perform -basic network tasks such as disconnecting and reconnecting servers as -needed. In recognition of this need, the protocol discussed herein -provides for operators only to be able to perform such functions. -See sections 3.1.8 (SQUIT) and 3.4.7 (CONNECT).[br] -[p] -A more controversial power of operators is the ability to remove a -user from the connected network by 'force', i.e., operators are able -to close the connection between any client and server. The -justification for this is very delicate since its abuse is both -destructive and annoying, and its benefits close to inexistent. For -further details on this type of action, see section 3.7.1 (KILL). -[/td][/tr] - -[tr][td] -[b]1.2.2 Services[/b] -[/td][/tr] - -[tr][td] -Each service is distinguished from other services by a service name -composed of a nickname and a server name. As for users, the nickname -has a maximum length of nine (9) characters. See the protocol -grammar rules (section 2.3.1) for what may and may not be used in a -nickname. -[/td][/tr] - -[tr][td] -[b]1.3 Channels[/b] -[/td][/tr] - -[tr][td] -Channels names are strings (beginning with a '&', '#', '+' or '!' -character) of length up to fifty (50) characters. Apart from the -requirement that the first character is either '&', '#', '+' or '!', -the only restriction on a channel name is that it SHALL NOT contain -any spaces (' '), a control G (^G or ASCII 7), a comma (','). Space -is used as parameter separator and command is used as a list item -separator by the protocol). A colon (':') can also be used as a -delimiter for the channel mask. Channel names are case insensitive. -See the protocol grammar rules (section 2.3.1) for the exact syntax -of a channel name.[br] -[p] -Each prefix characterizes a different channel type. The definition -of the channel types is not relevant to the client-server protocol -and thus it is beyond the scope of this document. More details can -be found in "Internet Relay Chat: Channel Management" [IRC-CHAN]. -[/td][/tr] - -[tr][td] -[b]2. The IRC Client Specification[/b] -[/td][/tr] - -[tr][td] -[b]2.1 Overview[/b] -[/td][/tr] - -[tr][td] -The protocol as described herein is for use only with client to -server connections when the client registers as a user. -[/td][/tr] - -[tr][td] -[b]2.2 Character codes[/b] -[/td][/tr] - -[tr][td] -No specific character set is specified. The protocol is based on a -set of codes which are composed of eight (8) bits, making up an -octet. Each message may be composed of any number of these octets; -however, some octet values are used for control codes, which act as -message delimiters.[br] -[p] -Regardless of being an 8-bit protocol, the delimiters and keywords -are such that protocol is mostly usable from US-ASCII terminal and a -telnet connection. -[p] -Because of IRC's Scandinavian origin, the characters {}|^ are -considered to be the lower case equivalents of the characters []\~, -respectively. This is a critical issue when determining the -equivalence of two nicknames or channel names. -[/td][/tr] - -[tr][td] -[b]2.3 Messages[/b] -[/td][/tr] - -[tr][td] -Servers and clients send each other messages, which may or may not -generate a reply. If the message contains a valid command, as -described in later sections, the client should expect a reply as -specified but it is not advised to wait forever for the reply; client -to server and server to server communication is essentially -asynchronous by nature. -[p] -Each IRC message may consist of up to three main parts: the prefix -(OPTIONAL), the command, and the command parameters (maximum of -fifteen (15)). The prefix, command, and all parameters are separated -by one ASCII space character (0x20) each. -[p] -The presence of a prefix is indicated with a single leading ASCII -colon character (':', 0x3b), which MUST be the first character of the -message itself. There MUST be NO gap (whitespace) between the colon -and the prefix. The prefix is used by servers to indicate the true -origin of the message. If the prefix is missing from the message, it -is assumed to have originated from the connection from which it was -received from. Clients SHOULD NOT use a prefix when sending a -message; if they use one, the only valid prefix is the registered -nickname associated with the client. -[p] -The command MUST either be a valid IRC command or a three (3) digit -number represented in ASCII text. -[p] -IRC messages are always lines of characters terminated with a CR-LF -(Carriage Return - Line Feed) pair, and these messages SHALL NOT -exceed 512 characters in length, counting all characters including -the trailing CR-LF. Thus, there are 510 characters maximum allowed -for the command and its parameters. There is no provision for -continuation of message lines. See section 6 for more details about -current implementations. -[/td][/tr] - -[tr][td] -[b]2.3.1 Message format in Augmented BNF[/b] -[/td][/tr] - -[tr][td] -The protocol messages must be extracted from the contiguous stream of -octets. The current solution is to designate two characters, CR and -LF, as message separators. Empty messages are silently ignored, -which permits use of the sequence CR-LF between messages without -extra problems. -[p] -The extracted message is parsed into the components , - and list of parameters (). -[p] -[pre] - The Augmented BNF representation for this is: - - message = [ ":" prefix SPACE ] command [ params ] crlf - prefix = servername / ( nickname [ [ "!" user ] "@" host ] ) - command = 1*letter / 3digit - params = *14( SPACE middle ) [ SPACE ":" trailing ] - =/ 14( SPACE middle ) [ SPACE [ ":" ] trailing ] - - nospcrlfcl = %x01-09 / %x0B-0C / %x0E-1F / %x21-39 / %x3B-FF - ; any octet except NUL, CR, LF, " " and ":" - middle = nospcrlfcl *( ":" / nospcrlfcl ) - trailing = *( ":" / " " / nospcrlfcl ) - - SPACE = %x20 ; space character - crlf = %x0D %x0A ; "carriage return" "linefeed" - - NOTES: - 1) After extracting the parameter list, all parameters are equal - whether matched by or . is just a - syntactic trick to allow SPACE within the parameter. - - 2) The NUL (%x00) character is not special in message framing, and - basically could end up inside a parameter, but it would cause - extra complexities in normal C string handling. Therefore, NUL - is not allowed within messages. - - Most protocol messages specify additional semantics and syntax for - the extracted parameter strings dictated by their position in the - list. For example, many server commands will assume that the first - parameter after the command is the list of targets, which can be - described with: - - target = nickname / server - msgtarget = msgto *( "," msgto ) - msgto = channel / ( user [ "%" host ] "@" servername ) - msgto =/ ( user "%" host ) / targetmask - msgto =/ nickname / ( nickname "!" user "@" host ) - channel = ( "#" / "+" / ( "!" channelid ) / "&" ) chanstring - [ ":" chanstring ] - servername = hostname - host = hostname / hostaddr - hostname = shortname *( "." shortname ) - shortname = ( letter / digit ) *( letter / digit / "-" ) - *( letter / digit ) - ; as specified in RFC 1123 [HNAME] - hostaddr = ip4addr / ip6addr - ip4addr = 1*3digit "." 1*3digit "." 1*3digit "." 1*3digit - ip6addr = 1*hexdigit 7( ":" 1*hexdigit ) - ip6addr =/ "0:0:0:0:0:" ( "0" / "FFFF" ) ":" ip4addr - nickname = ( letter / special ) *8( letter / digit / special / "-" ) - targetmask = ( "$" / "#" ) mask - ; see details on allowed masks in section 3.3.1 - chanstring = %x01-07 / %x08-09 / %x0B-0C / %x0E-1F / %x21-2B - chanstring =/ %x2D-39 / %x3B-FF - ; any octet except NUL, BELL, CR, LF, " ", "," and ":" - channelid = 5( %x41-5A / digit ) ; 5( A-Z / 0-9 ) - - Other parameter syntaxes are: - - user = 1*( %x01-09 / %x0B-0C / %x0E-1F / %x21-3F / %x41-FF ) - ; any octet except NUL, CR, LF, " " and "@" - key = 1*23( %x01-05 / %x07-08 / %x0C / %x0E-1F / %x21-7F ) - ; any 7-bit US_ASCII character, - ; except NUL, CR, LF, FF, h/v TABs, and " " - letter = %x41-5A / %x61-7A ; A-Z / a-z - digit = %x30-39 ; 0-9 - hexdigit = digit / "A" / "B" / "C" / "D" / "E" / "F" - special = %x5B-60 / %x7B-7D - ; "[", "]", "\", "`", "_", "^", "{", "|", "}" - - NOTES: - 1) The syntax is given here for the sole purpose of - indicating the format to follow for IP addresses. This - reflects the fact that the only available implementations of - this protocol uses TCP/IP as underlying network protocol but is - not meant to prevent other protocols to be used. - - 2) has a maximum length of 63 characters. This is a - limitation of the protocol as internet hostnames (in - particular) can be longer. Such restriction is necessary - because IRC messages are limited to 512 characters in length. - Clients connecting from a host which name is longer than 63 - characters are registered using the host (numeric) address - instead of the host name. - - 3) Some parameters used in the following sections of this - documents are not defined here as there is nothing specific - about them besides the name that is used for convenience. - These parameters follow the general syntax defined for - . -[/pre] -[/td][/tr] - -[tr][td] -[b]2.4 Numeric replies[/b] -[/td][/tr] - -[tr][td] -Most of the messages sent to the server generate a reply of some -sort. The most common reply is the numeric reply, used for both -errors and normal replies. The numeric reply MUST be sent as one -message consisting of the sender prefix, the three-digit numeric, and -the target of the reply. A numeric reply is not allowed to originate -from a client. In all other respects, a numeric reply is just like a -normal message, except that the keyword is made up of 3 numeric -digits rather than a string of letters. A list of different replies -is supplied in section 5 (Replies). -[/td][/tr] - -[tr][td] -[b]2.5 Wildcard expressions[/b] -[/td][/tr] - -[tr][td] -When wildcards are allowed in a string, it is referred as a "mask". -[p] -For string matching purposes, the protocol allows the use of two -special characters: '?' (%x3F) to match one and only one character, -and '*' (%x2A) to match any number of any characters. These two -characters can be escaped using the character '\' (%x5C). -[p] -[pre] - The Augmented BNF syntax for this is: - - mask = *( nowild / noesc wildone / noesc wildmany ) - wildone = %x3F - wildmany = %x2A - nowild = %x01-29 / %x2B-3E / %x40-FF - ; any octet except NUL, "*", "?" - noesc = %x01-5B / %x5D-FF - ; any octet except NUL and "\" - matchone = %x01-FF - ; matches wildone - matchmany = *matchone - ; matches wildmany - - Examples: - - a?c ; Matches any string of 3 characters in length starting - with "a" and ending with "c" - - a*c ; Matches any string of at least 2 characters in length - starting with "a" and ending with "c" -[/pre] -[/td][/tr] - -[tr][td] -[b]3. Message Details[/b] -[/td][/tr] - -[tr][td] -On the following pages there are descriptions of each message -recognized by the IRC server and client. All commands described in -this section MUST be implemented by any server for this protocol. -[p] -Where the reply ERR_NOSUCHSERVER is returned, it means that the -target of the message could not be found. The server MUST NOT send -any other replies after this error for that command. -[p] -The server to which a client is connected is required to parse the -complete message, and return any appropriate errors. -[p] -If multiple parameters is presented, then each MUST be checked for -validity and appropriate responses MUST be sent back to the client. -In the case of incorrect messages which use parameter lists with -comma as an item separator, a reply MUST be sent for each item. -[/td][/tr] - -[tr][td] -[b]3.1 Connection Registration[/b] -[/td][/tr] - -[tr][td] -The commands described here are used to register a connection with an -IRC server as a user as well as to correctly disconnect. -[p] -A "PASS" command is not required for a client connection to be -registered, but it MUST precede the latter of the NICK/USER -combination (for a user connection) or the SERVICE command (for a -service connection). The RECOMMENDED order for a client to register -is as follows: -[p] -[pre] - 1. Pass message - 2. Nick message 2. Service message - 3. User message -[/pre] -[p] -Upon success, the client will receive an RPL_WELCOME (for users) or -RPL_YOURESERVICE (for services) message indicating that the -connection is now registered and known the to the entire IRC network. -The reply message MUST contain the full client identifier upon which -it was registered. -[/td][/tr] - -[tr][td] -[b]3.1.1 Password message[/b] -[/td][/tr] - -[tr][td][pre] -Command: PASS -Parameters: - -The PASS command is used to set a 'connection password'. The -optional password can and MUST be set before any attempt to register -the connection is made. Currently this requires that user send a -PASS command before sending the NICK/USER combination. - - Numeric Replies: - - ERR_NEEDMOREPARAMS ERR_ALREADYREGISTRED - - Example: - - PASS secretpasswordhere -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.1.2 Nick message[/b] -[/pre][/td][/tr] - - -[tr][td][pre] -Command: NICK -Parameters: - -NICK command is used to give user a nickname or change the existing -one. - - Numeric Replies: - - ERR_NONICKNAMEGIVEN ERR_ERRONEUSNICKNAME - ERR_NICKNAMEINUSE ERR_NICKCOLLISION - ERR_UNAVAILRESOURCE ERR_RESTRICTED - - Examples: - - NICK Wiz ; Introducing new nick "Wiz" if session is - still unregistered, or user changing his - nickname to "Wiz" - - :WiZ!jto@tolsun.oulu.fi NICK Kilroy - ; Server telling that WiZ changed his - nickname to Kilroy. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.1.3 User message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: USER -Parameters: - -The USER command is used at the beginning of connection to specify -the username, hostname and realname of a new user. - -The parameter should be a numeric, and can be used to -automatically set user modes when registering with the server. This -parameter is a bitmask, with only 2 bits having any signification: if -the bit 2 is set, the user mode 'w' will be set and if the bit 3 is -set, the user mode 'i' will be set. (See Section 3.1.5 "User -Modes"). - -The may contain space characters. - - Numeric Replies: - - ERR_NEEDMOREPARAMS ERR_ALREADYREGISTRED - - Example: - - USER guest 0 * :Ronnie Reagan ; User registering themselves with a - username of "guest" and real name - "Ronnie Reagan". - - USER guest 8 * :Ronnie Reagan ; User registering themselves with a - username of "guest" and real name - "Ronnie Reagan", and asking to be set - invisible. -[/pre][/td][/tr] - - -[tr][td][pre] -[b]3.1.4 Oper message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: OPER -Parameters: - -A normal user uses the OPER command to obtain operator privileges. -The combination of and are REQUIRED to gain -Operator privileges. Upon success, the user will receive a MODE -message (see section 3.1.5) indicating the new user modes. - - Numeric Replies: - - ERR_NEEDMOREPARAMS RPL_YOUREOPER - ERR_NOOPERHOST ERR_PASSWDMISMATCH - - Example: - - OPER foo bar ; Attempt to register as an operator - using a username of "foo" and "bar" - as the password. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.1.5 User mode message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: MODE -Parameters: -*( ( "+" / "-" ) *( "i" / "w" / "o" / "O" / "r" ) ) - -The user MODE's are typically changes which affect either how the -client is seen by others or what 'extra' messages the client is sent. - -A user MODE command MUST only be accepted if both the sender of the -message and the nickname given as a parameter are both the same. If -no other parameter is given, then the server will return the current -settings for the nick. - - The available modes are as follows: - - a - user is flagged as away; - i - marks a users as invisible; - w - user receives wallops; - r - restricted user connection; - o - operator flag; - O - local operator flag; - s - marks a user for receipt of server notices. - -Additional modes may be available later on. -The flag 'a' SHALL NOT be toggled by the user using the MODE command, -instead use of the AWAY command is REQUIRED. - -If a user attempts to make themselves an operator using the "+o" or -"+O" flag, the attempt SHOULD be ignored as users could bypass the -authentication mechanisms of the OPER command. There is no -restriction, however, on anyone `deopping' themselves (using "-o" or -"-O"). - -On the other hand, if a user attempts to make themselves unrestricted -using the "-r" flag, the attempt SHOULD be ignored. There is no -restriction, however, on anyone `deopping' themselves (using "+r"). -This flag is typically set by the server upon connection for -administrative reasons. While the restrictions imposed are left up -to the implementation, it is typical that a restricted user not be -allowed to change nicknames, nor make use of the channel operator -status on channels. - -The flag 's' is obsolete but MAY still be used. - - Numeric Replies: - - ERR_NEEDMOREPARAMS ERR_USERSDONTMATCH - ERR_UMODEUNKNOWNFLAG RPL_UMODEIS - - Examples: - - MODE WiZ -w ; Command by WiZ to turn off - reception of WALLOPS messages. - - MODE Angel +i ; Command from Angel to make herself - invisible. - - MODE WiZ -o ; WiZ 'deopping' (removing operator - status). -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.1.6 Service message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: SERVICE -Parameters: - - -The SERVICE command to register a new service. Command parameters -specify the service nickname, distribution, type and info of a new -service. -The parameter is used to specify the visibility of a -service. The service may only be known to servers which have a name -matching the distribution. For a matching server to have knowledge -of the service, the network path between that server and the server -on which the service is connected MUST be composed of servers which -names all match the mask. - -The parameter is currently reserved for future usage. - - Numeric Replies: - - ERR_ALREADYREGISTRED ERR_NEEDMOREPARAMS - ERR_ERRONEUSNICKNAME - RPL_YOURESERVICE RPL_YOURHOST - RPL_MYINFO - - Example: - - SERVICE dict * *.fr 0 0 :French Dictionary ; Service registering - itself with a name of "dict". This - service will only be available on - servers which name matches "*.fr". -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.1.7 Quit[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: QUIT -Parameters: [ ] - -A client session is terminated with a quit message. The server -acknowledges this by sending an ERROR message to the client. - - Numeric Replies: - - None. - - Example: - - QUIT :Gone to have lunch ; Preferred message format. - - :syrk!kalt@millennium.stealth.net QUIT :Gone to have lunch ; User - syrk has quit IRC to have lunch. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.1.8 Squit[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: SQUIT -Parameters: - -The SQUIT command is available only to operators. It is used to -disconnect server links. Also servers can generate SQUIT messages on -error conditions. A SQUIT message may also target a remote server -connection. In this case, the SQUIT message will simply be sent to -the remote server without affecting the servers in between the -operator and the remote server. - -The SHOULD be supplied by all operators who execute a SQUIT -for a remote server. The server ordered to disconnect its peer -generates a WALLOPS message with included, so that other -users may be aware of the reason of this action. - - Numeric replies: - - ERR_NOPRIVILEGES ERR_NOSUCHSERVER - ERR_NEEDMOREPARAMS - - Examples: - - SQUIT tolsun.oulu.fi :Bad Link ? ; Command to uplink of the server - tolson.oulu.fi to terminate its - connection with comment "Bad Link". - - :Trillian SQUIT cm22.eng.umd.edu :Server out of control ; Command - from Trillian from to disconnect - "cm22.eng.umd.edu" from the net with - comment "Server out of control". -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.2 Channel operations[/b] -[/pre][/td][/tr] - -[tr][td][pre] -This group of messages is concerned with manipulating channels, their -properties (channel modes), and their contents (typically users). -For this reason, these messages SHALL NOT be made available to -services. - -All of these messages are requests which will or will not be granted -by the server. The server MUST send a reply informing the user -whether the request was granted, denied or generated an error. When -the server grants the request, the message is typically sent back -(eventually reformatted) to the user with the prefix set to the user -itself. - -The rules governing how channels are managed are enforced by the -servers. These rules are beyond the scope of this document. More -details are found in "Internet Relay Chat: Channel Management" [IRC- -CHAN]. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.2.1 Join message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: JOIN -Parameters: ( *( "," ) [ *( "," ) ] ) -/ "0" - -The JOIN command is used by a user to request to start listening to -the specific channel. Servers MUST be able to parse arguments in the -form of a list of target, but SHOULD NOT use lists when sending JOIN -messages to clients. - -Once a user has joined a channel, he receives information about -all commands his server receives affecting the channel. This -includes JOIN, MODE, KICK, PART, QUIT and of course PRIVMSG/NOTICE. -This allows channel members to keep track of the other channel -members, as well as channel modes. - -If a JOIN is successful, the user receives a JOIN message as -confirmation and is then sent the channel's topic (using RPL_TOPIC) and -the list of users who are on the channel (using RPL_NAMREPLY), which -MUST include the user joining. - -Note that this message accepts a special argument ("0"), which is -a special request to leave all channels the user is currently a member -of. The server will process this message as if the user had sent -a PART command (See Section 3.2.2) for each channel he is a member -of. - - Numeric Replies: - - ERR_NEEDMOREPARAMS ERR_BANNEDFROMCHAN - ERR_INVITEONLYCHAN ERR_BADCHANNELKEY - ERR_CHANNELISFULL ERR_BADCHANMASK - ERR_NOSUCHCHANNEL ERR_TOOMANYCHANNELS - ERR_TOOMANYTARGETS ERR_UNAVAILRESOURCE - RPL_TOPIC - - Examples: - - JOIN #foobar ; Command to join channel #foobar. - - JOIN &foo fubar ; Command to join channel &foo using - key "fubar". - - JOIN #foo,&bar fubar ; Command to join channel #foo using - key "fubar" and &bar using no key. - - JOIN #foo,#bar fubar,foobar ; Command to join channel #foo using - key "fubar", and channel #bar using - key "foobar". - - JOIN #foo,#bar ; Command to join channels #foo and - #bar. - - JOIN 0 ; Leave all currently joined - channels. - - :WiZ!jto@tolsun.oulu.fi JOIN #Twilight_zone ; JOIN message from WiZ - on channel #Twilight_zone -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.2.2 Part message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: PART -Parameters: *( "," ) [ ] - -The PART command causes the user sending the message to be removed -from the list of active members for all given channels listed in the -parameter string. If a "Part Message" is given, this will be sent -instead of the default message, the nickname. This request is always -granted by the server. - -Servers MUST be able to parse arguments in the form of a list of -target, but SHOULD NOT use lists when sending PART messages to -clients. - - Numeric Replies: - - ERR_NEEDMOREPARAMS ERR_NOSUCHCHANNEL - ERR_NOTONCHANNEL - - Examples: - - PART #twilight_zone ; Command to leave channel - "#twilight_zone" - - PART #oz-ops,&group5 ; Command to leave both channels - "&group5" and "#oz-ops". - - :WiZ!jto@tolsun.oulu.fi PART #playzone :I lost - ; User WiZ leaving channel - "#playzone" with the message "I - lost". -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.2.3 Channel mode message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: MODE -Parameters: *( ( "-" / "+" ) * * ) - -The MODE command is provided so that users may query and change the -characteristics of a channel. For more details on available modes -and their uses, see "Internet Relay Chat: Channel Management" [IRC- -CHAN]. Note that there is a maximum limit of three (3) changes per -command for modes that take a parameter. - - Numeric Replies: - - ERR_NEEDMOREPARAMS ERR_KEYSET - ERR_NOCHANMODES ERR_CHANOPRIVSNEEDED - ERR_USERNOTINCHANNEL ERR_UNKNOWNMODE - RPL_CHANNELMODEIS - RPL_BANLIST RPL_ENDOFBANLIST - RPL_EXCEPTLIST RPL_ENDOFEXCEPTLIST - RPL_INVITELIST RPL_ENDOFINVITELIST - RPL_UNIQOPIS - - The following examples are given to help understanding the syntax of - the MODE command, but refer to modes defined in "Internet Relay Chat: - Channel Management" [IRC-CHAN]. - - Examples: - - MODE #Finnish +imI *!*@*.fi ; Command to make #Finnish channel - moderated and 'invite-only' with user - with a hostname matching *.fi - automatically invited. - - MODE #Finnish +o Kilroy ; Command to give 'chanop' privileges - to Kilroy on channel #Finnish. - - MODE #Finnish +v Wiz ; Command to allow WiZ to speak on - #Finnish. - - MODE #Fins -s ; Command to remove 'secret' flag - from channel #Fins. - - MODE #42 +k oulu ; Command to set the channel key to - "oulu". - - MODE #42 -k oulu ; Command to remove the "oulu" - channel key on channel "#42". - - MODE #eu-opers +l 10 ; Command to set the limit for the - number of users on channel - "#eu-opers" to 10. - - :WiZ!jto@tolsun.oulu.fi MODE #eu-opers -l - ; User "WiZ" removing the limit for - the number of users on channel "#eu- - opers". - - MODE &oulu +b ; Command to list ban masks set for - the channel "&oulu". - - MODE &oulu +b *!*@* ; Command to prevent all users from - joining. - - MODE &oulu +b *!*@*.edu +e *!*@*.bu.edu - ; Command to prevent any user from a - hostname matching *.edu from joining, - except if matching *.bu.edu - - MODE #bu +be *!*@*.edu *!*@*.bu.edu - ; Comment to prevent any user from a - hostname matching *.edu from joining, - except if matching *.bu.edu - - MODE #meditation e ; Command to list exception masks set - for the channel "#meditation". - - MODE #meditation I ; Command to list invitations masks - set for the channel "#meditation". - - MODE !12345ircd O ; Command to ask who the channel - creator for "!12345ircd" is -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.2.4 Topic message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: TOPIC -Parameters: [ ] - -The TOPIC command is used to change or view the topic of a channel. -The topic for channel is returned if there is no -given. If the parameter is present, the topic for that -channel will be changed, if this action is allowed for the user -requesting it. If the parameter is an empty string, the -topic for that channel will be removed. - - Numeric Replies: - - ERR_NEEDMOREPARAMS ERR_NOTONCHANNEL - RPL_NOTOPIC RPL_TOPIC - ERR_CHANOPRIVSNEEDED ERR_NOCHANMODES - - Examples: - - :WiZ!jto@tolsun.oulu.fi TOPIC #test :New topic ; User Wiz setting the - topic. - - TOPIC #test :another topic ; Command to set the topic on #test - to "another topic". - - TOPIC #test : ; Command to clear the topic on - #test. - - TOPIC #test ; Command to check the topic for - #test. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.2.5 Names message[/b] - -Command: NAMES -Parameters: [ *( "," ) [ ] ] - -By using the NAMES command, a user can list all nicknames that are -visible to him. For more details on what is visible and what is not, -see "Internet Relay Chat: Channel Management" [IRC-CHAN]. The - parameter specifies which channel(s) to return information -about. There is no error reply for bad channel names. - -If no parameter is given, a list of all channels and their -occupants is returned. At the end of this list, a list of users who -are visible but either not on any channel or not on a visible channel -are listed as being on `channel' "*". - -If the parameter is specified, the request is forwarded to -that server which will generate the reply. - -Wildcards are allowed in the parameter. - - Numerics: - - ERR_TOOMANYMATCHES ERR_NOSUCHSERVER - RPL_NAMREPLY RPL_ENDOFNAMES - - Examples: - - NAMES #twilight_zone,#42 ; Command to list visible users on - #twilight_zone and #42 - - NAMES ; Command to list all visible - channels and users -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.2.6 List message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: LIST -Parameters: [ *( "," ) [ ] ] - -The list command is used to list channels and their topics. If the - parameter is used, only the status of that channel is -displayed. - -If the parameter is specified, the request is forwarded to -that server which will generate the reply. - -Wildcards are allowed in the parameter. - - Numeric Replies: - - ERR_TOOMANYMATCHES ERR_NOSUCHSERVER - RPL_LIST RPL_LISTEND - - Examples: - - LIST ; Command to list all channels. - - LIST #twilight_zone,#42 ; Command to list channels - #twilight_zone and #42 -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.2.7 Invite message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: INVITE -Parameters: - -The INVITE command is used to invite a user to a channel. The -parameter is the nickname of the person to be invited to -the target channel . There is no requirement that the -channel the target user is being invited to must exist or be a valid -channel. However, if the channel exists, only members of the channel -are allowed to invite other users. When the channel has invite-only -flag set, only channel operators may issue INVITE command. -Only the user inviting and the user being invited will receive -notification of the invitation. Other channel members are not -notified. (This is unlike the MODE changes, and is occasionally the -source of trouble for users.) - - Numeric Replies: - - ERR_NEEDMOREPARAMS ERR_NOSUCHNICK - ERR_NOTONCHANNEL ERR_USERONCHANNEL - ERR_CHANOPRIVSNEEDED - RPL_INVITING RPL_AWAY - - Examples: - - :Angel!wings@irc.org INVITE Wiz #Dust - - ; Message to WiZ when he has been - invited by user Angel to channel - #Dust - - INVITE Wiz #Twilight_Zone ; Command to invite WiZ to - #Twilight_zone -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.2.8 Kick command[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: KICK -Parameters: *( "," ) *( "," ) -[] - -The KICK command can be used to request the forced removal of a user -from a channel. It causes the to PART from the by -force. For the message to be syntactically correct, there MUST be -either one channel parameter and multiple user parameter, or as many -channel parameters as there are user parameters. If a "comment" is -given, this will be sent instead of the default message, the nickname -of the user issuing the KICK. - -The server MUST NOT send KICK messages with multiple channels or -users to clients. This is necessarily to maintain backward -compatibility with old client software. - - Numeric Replies: - - ERR_NEEDMOREPARAMS ERR_NOSUCHCHANNEL - ERR_BADCHANMASK ERR_CHANOPRIVSNEEDED - ERR_USERNOTINCHANNEL ERR_NOTONCHANNEL - - Examples: - - KICK &Melbourne Matthew ; Command to kick Matthew from - &Melbourne - - KICK #Finnish John :Speaking English - ; Command to kick John from #Finnish - using "Speaking English" as the - reason (comment). - - :WiZ!jto@tolsun.oulu.fi KICK #Finnish John - ; KICK message on channel #Finnish - from WiZ to remove John from channel -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.3 Sending messages[/b] -[/pre][/td][/tr] - -[tr][td][pre] -The main purpose of the IRC protocol is to provide a base for clients -to communicate with each other. PRIVMSG, NOTICE and SQUERY -(described in Section 3.5 on Service Query and Commands) are the only -messages available which actually perform delivery of a text message -from one client to another - the rest just make it possible and try -to ensure it happens in a reliable and structured manner. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.3.1 Private messages[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: PRIVMSG -Parameters: - -PRIVMSG is used to send private messages between users, as well as to -send messages to channels. is usually the nickname of -the recipient of the message, or a channel name. - -The parameter may also be a host mask (#) or server -mask ($). In both cases the server will only send the PRIVMSG -to those who have a server or host matching the mask. The mask MUST -have at least 1 (one) "." in it and no wildcards following the last -".". This requirement exists to prevent people sending messages to -"#*" or "$*", which would broadcast to all users. Wildcards are the -'*' and '?' characters. This extension to the PRIVMSG command is -only available to operators. - - Numeric Replies: - - ERR_NORECIPIENT ERR_NOTEXTTOSEND - ERR_CANNOTSENDTOCHAN ERR_NOTOPLEVEL - ERR_WILDTOPLEVEL ERR_TOOMANYTARGETS - ERR_NOSUCHNICK - RPL_AWAY - - Examples: - - :Angel!wings@irc.org PRIVMSG Wiz :Are you receiving this message ? - ; Message from Angel to Wiz. - - PRIVMSG Angel :yes I'm receiving it ! - ; Command to send a message to Angel. - - PRIVMSG jto@tolsun.oulu.fi :Hello ! - ; Command to send a message to a user - on server tolsun.oulu.fi with - username of "jto". - - PRIVMSG kalt%millennium.stealth.net@irc.stealth.net :Are you a frog? - ; Message to a user on server - irc.stealth.net with username of - "kalt", and connected from the host - millennium.stealth.net. - - PRIVMSG kalt%millennium.stealth.net :Do you like cheese? - ; Message to a user on the local - server with username of "kalt", and - connected from the host - millennium.stealth.net. - - PRIVMSG Wiz!jto@tolsun.oulu.fi :Hello ! - ; Message to the user with nickname - Wiz who is connected from the host - tolsun.oulu.fi and has the username - "jto". - - PRIVMSG $*.fi :Server tolsun.oulu.fi rebooting. - ; Message to everyone on a server - which has a name matching *.fi. - - PRIVMSG #*.edu :NSFNet is undergoing work, expect interruptions - ; Message to all users who come from - a host which has a name matching - *.edu. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.3.2 Notice[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: NOTICE -Parameters: - -The NOTICE command is used similarly to PRIVMSG. The difference -between NOTICE and PRIVMSG is that automatic replies MUST NEVER be -sent in response to a NOTICE message. This rule applies to servers -too - they MUST NOT send any error reply back to the client on -receipt of a notice. The object of this rule is to avoid loops -between clients automatically sending something in response to -something it received. - -This command is available to services as well as users. - -This is typically used by services, and automatons (clients with -either an AI or other interactive program controlling their actions). - -See PRIVMSG for more details on replies and examples. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.4 Server queries and commands[/b] -[/pre][/td][/tr] - -[tr][td][pre] -The server query group of commands has been designed to return -information about any server which is connected to the network. - -In these queries, where a parameter appears as , wildcard -masks are usually valid. For each parameter, however, only one query -and set of replies is to be generated. In most cases, if a nickname -is given, it will mean the server to which the user is connected. - -These messages typically have little value for services, it is -therefore RECOMMENDED to forbid services from using them. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.4.1 Motd message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: MOTD -Parameters: [ ] - -The MOTD command is used to get the "Message Of The Day" of the given -server, or current server if is omitted. - -Wildcards are allowed in the parameter. - - Numeric Replies: - RPL_MOTDSTART RPL_MOTD - RPL_ENDOFMOTD ERR_NOMOTD -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.4.2 Lusers message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: LUSERS -Parameters: [ [ ] ] - -The LUSERS command is used to get statistics about the size of the -IRC network. If no parameter is given, the reply will be about the -whole net. If a is specified, then the reply will only -concern the part of the network formed by the servers matching the -mask. Finally, if the parameter is specified, the request -is forwarded to that server which will generate the reply. - -Wildcards are allowed in the parameter. - - Numeric Replies: - - RPL_LUSERCLIENT RPL_LUSEROP - RPL_LUSERUNKOWN RPL_LUSERCHANNELS - RPL_LUSERME ERR_NOSUCHSERVER -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.4.3 Version message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: VERSION -Parameters: [ ] - -The VERSION command is used to query the version of the server -program. An optional parameter is used to query the version -of the server program which a client is not directly connected to. - -Wildcards are allowed in the parameter. - - Numeric Replies: - - ERR_NOSUCHSERVER RPL_VERSION - - Examples: - - VERSION tolsun.oulu.fi ; Command to check the version of - server "tolsun.oulu.fi". -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.4.4 Stats message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: STATS -Parameters: [ [ ] ] - -The stats command is used to query statistics of certain server. If - parameter is omitted, only the end of stats reply is sent -back. - -A query may be given for any single letter which is only checked by -the destination server and is otherwise passed on by intermediate -servers, ignored and unaltered. - -Wildcards are allowed in the parameter. -Except for the ones below, the list of valid queries is -implementation dependent. The standard queries below SHOULD be -supported by the server: - - l - returns a list of the server's connections, showing how - long each connection has been established and the - traffic over that connection in Kbytes and messages for - each direction; - m - returns the usage count for each of commands supported - by the server; commands for which the usage count is - zero MAY be omitted; - o - returns a list of configured privileged users, - operators; - u - returns a string showing how long the server has been - up. - -It is also RECOMMENDED that client and server access configuration be -published this way. - - Numeric Replies: - - ERR_NOSUCHSERVER - RPL_STATSLINKINFO RPL_STATSUPTIME - RPL_STATSCOMMANDS RPL_STATSOLINE - RPL_ENDOFSTATS - - Examples: - - STATS m ; Command to check the command usage - for the server you are connected to -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.4.5 Links message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: LINKS -Parameters: [ [ ] ] - -With LINKS, a user can list all servernames, which are known by the -server answering the query. The returned list of servers MUST match -the mask, or if no mask is given, the full list is returned. - -If is given in addition to , the LINKS -command is forwarded to the first server found that matches that name -(if any), and that server is then required to answer the query. - -Numeric Replies: - - ERR_NOSUCHSERVER - RPL_LINKSRPL_ENDOFLINKS - -Examples: - -LINKS *.au ; Command to list all servers which - have a name that matches *.au; - -LINKS *.edu *.bu.edu; Command to list servers matching - *.bu.edu as seen by the first server - matching *.edu. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.4.6 Time message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: TIME -Parameters: [ ] - -The time command is used to query local time from the specified -server. If the parameter is not given, the server receiving -the command must reply to the query. - -Wildcards are allowed in the parameter. - - Numeric Replies: - - ERR_NOSUCHSERVER RPL_TIME - - Examples: - TIME tolsun.oulu.fi ; check the time on the server - "tolson.oulu.fi" -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.4.7 Connect message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: CONNECT -Parameters: [ ] - -The CONNECT command can be used to request a server to try to -establish a new connection to another server immediately. CONNECT is -a privileged command and SHOULD be available only to IRC Operators. -If a is given and its mask doesn't match name of the -parsing server, the CONNECT attempt is sent to the first match of -remote server. Otherwise the CONNECT attempt is made by the server -processing the request. - -The server receiving a remote CONNECT command SHOULD generate a -WALLOPS message describing the source and target of the request. - - Numeric Replies: - - ERR_NOSUCHSERVER ERR_NOPRIVILEGES - ERR_NEEDMOREPARAMS - - Examples: - - CONNECT tolsun.oulu.fi 6667 ; Command to attempt to connect local - server to tolsun.oulu.fi on port 6667 -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.4.8 Trace message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: TRACE -Parameters: [ ] - -TRACE command is used to find the route to specific server and -information about its peers. Each server that processes this command -MUST report to the sender about it. The replies from pass-through -links form a chain, which shows route to destination. After sending -this reply back, the query MUST be sent to the next server until -given server is reached. - -TRACE command is used to find the route to specific server. Each -server that processes this message MUST tell the sender about it by -sending a reply indicating it is a pass-through link, forming a chain -of replies. After sending this reply back, it MUST then send the -TRACE message to the next server until given server is reached. If -the parameter is omitted, it is RECOMMENDED that TRACE -command sends a message to the sender telling which servers the local -server has direct connection to. - -If the destination given by is an actual server, the -destination server is REQUIRED to report all servers, services and -operators which are connected to it; if the command was issued by an -operator, the server MAY also report all users which are connected to -it. If the destination given by is a nickname, then only a -reply for that nickname is given. If the parameter is -omitted, it is RECOMMENDED that the TRACE command is parsed as -targeted to the processing server. - -Wildcards are allowed in the parameter. - - Numeric Replies: - - ERR_NOSUCHSERVER - - If the TRACE message is destined for another server, all - intermediate servers must return a RPL_TRACELINK reply to indicate - that the TRACE passed through it and where it is going next. - - RPL_TRACELINK - - A TRACE reply may be composed of any number of the following - numeric replies. - - RPL_TRACECONNECTING RPL_TRACEHANDSHAKE - RPL_TRACEUNKNOWN RPL_TRACEOPERATOR - RPL_TRACEUSER RPL_TRACESERVER - RPL_TRACESERVICE RPL_TRACENEWTYPE - RPL_TRACECLASS RPL_TRACELOG - RPL_TRACEEND - - Examples: - - TRACE *.oulu.fi ; TRACE to a server matching - *.oulu.fi -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.4.9 Admin command[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: ADMIN -Parameters: [ ] - -The admin command is used to find information about the administrator -of the given server, or current server if parameter is -omitted. Each server MUST have the ability to forward ADMIN messages -to other servers. - -Wildcards are allowed in the parameter. - - Numeric Replies: - - ERR_NOSUCHSERVER - RPL_ADMINME RPL_ADMINLOC1 - RPL_ADMINLOC2 RPL_ADMINEMAIL - - Examples: - - ADMIN tolsun.oulu.fi ; request an ADMIN reply from - tolsun.oulu.fi - - ADMIN syrk ; ADMIN request for the server to - which the user syrk is connected -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.4.10 Info command[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: INFO -Parameters: [ ] - -The INFO command is REQUIRED to return information describing the -server: its version, when it was compiled, the patchlevel, when it -was started, and any other miscellaneous information which may be -considered to be relevant. - -Wildcards are allowed in the parameter. - - Numeric Replies: - - ERR_NOSUCHSERVER - RPL_INFO RPL_ENDOFINFO - - Examples: - - INFO csd.bu.edu ; request an INFO reply from - csd.bu.edu - - INFO Angel ; request info from the server that - Angel is connected to. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.5 Service Query and Commands[/b] -[/pre][/td][/tr] -[tr][td][pre] -The service query group of commands has been designed to return -information about any service which is connected to the network. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.5.1 Servlist message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: SERVLIST -Parameters: [ [ ] ] - -The SERVLIST command is used to list services currently connected to -the network and visible to the user issuing the command. The -optional parameters may be used to restrict the result of the query -(to matching services names, and services type). - - Numeric Replies: - - RPL_SERVLIST RPL_SERVLISTEND -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.5.2 Squery[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: SQUERY -Parameters: - -The SQUERY command is used similarly to PRIVMSG. The only difference -is that the recipient MUST be a service. This is the only way for a -text message to be delivered to a service. - -See PRIVMSG for more details on replies and example. - - Examples: - - SQUERY irchelp :HELP privmsg - ; Message to the service with - nickname irchelp. - - SQUERY dict@irc.fr :fr2en blaireau - ; Message to the service with name - dict@irc.fr. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.6 User based queries[/b] -[/pre][/td][/tr] -[tr][td][pre] -User queries are a group of commands which are primarily concerned -with finding details on a particular user or group users. When using -wildcards with any of these commands, if they match, they will only -return information on users who are 'visible' to you. The visibility -of a user is determined as a combination of the user's mode and the -common set of channels you are both on. - -Although services SHOULD NOT be using this class of message, they are -allowed to. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.6.1 Who query[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: WHO -Parameters: [ [ "o" ] ] - -The WHO command is used by a client to generate a query which returns -a list of information which 'matches' the parameter given by -the client. In the absence of the parameter, all visible -(users who aren't invisible (user mode +i) and who don't have a -common channel with the requesting client) are listed. The same -result can be achieved by using a of "0" or any wildcard which -will end up matching every visible user. - -The passed to WHO is matched against users' host, server, real -name and nickname if the channel cannot be found. -If the "o" parameter is passed only operators are returned according -to the supplied. - - Numeric Replies: - - ERR_NOSUCHSERVER - RPL_WHOREPLY RPL_ENDOFWHO - - Examples: - - WHO *.fi ; Command to list all users who match - against "*.fi". - - WHO jto* o ; Command to list all users with a - match against "jto*" if they are an - operator. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.6.2 Whois query[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: WHOIS -Parameters: [ ] *( "," ) - -This command is used to query information about particular user. -The server will answer this command with several numeric messages -indicating different statuses of each user which matches the mask (if -you are entitled to see them). If no wildcard is present in the -, any information about that nick which you are allowed to see -is presented. - -If the parameter is specified, it sends the query to a -specific server. It is useful if you want to know how long the user -in question has been idle as only local server (i.e., the server the -user is directly connected to) knows that information, while -everything else is globally known. - -Wildcards are allowed in the parameter. - - Numeric Replies: - - ERR_NOSUCHSERVER ERR_NONICKNAMEGIVEN - RPL_WHOISUSER RPL_WHOISCHANNELS - RPL_WHOISCHANNELS RPL_WHOISSERVER - RPL_AWAY RPL_WHOISOPERATOR - RPL_WHOISIDLE ERR_NOSUCHNICK - RPL_ENDOFWHOIS - - Examples: - - WHOIS wiz ; return available user information - about nick WiZ - - WHOIS eff.org trillian ; ask server eff.org for user - information about trillian -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.6.3 Whowas[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: WHOWAS -Parameters: *( "," ) [ [ ] ] - -Whowas asks for information about a nickname which no longer exists. -This may either be due to a nickname change or the user leaving IRC. -In response to this query, the server searches through its nickname -history, looking for any nicks which are lexically the same (no wild -card matching here). The history is searched backward, returning the -most recent entry first. If there are multiple entries, up to - replies will be returned (or all of them if no -parameter is given). If a non-positive number is passed as being -, then a full search is done. - -Wildcards are allowed in the parameter. - - Numeric Replies: - - ERR_NONICKNAMEGIVEN ERR_WASNOSUCHNICK - RPL_WHOWASUSER RPL_WHOISSERVER - RPL_ENDOFWHOWAS - - Examples: - - WHOWAS Wiz ; return all information in the nick - history about nick "WiZ"; - - WHOWAS Mermaid 9 ; return at most, the 9 most recent - entries in the nick history for - "Mermaid"; - - WHOWAS Trillian 1 *.edu ; return the most recent history for - "Trillian" from the first server - found to match "*.edu". -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.7 Miscellaneous messages[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Messages in this category do not fit into any of the above categories -but are nonetheless still a part of and REQUIRED by the protocol. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.7.1 Kill message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: KILL -Parameters: - -The KILL command is used to cause a client-server connection to be -closed by the server which has the actual connection. Servers -generate KILL messages on nickname collisions. It MAY also be -available available to users who have the operator status. - -Clients which have automatic reconnect algorithms effectively make -this command useless since the disconnection is only brief. It does -however break the flow of data and can be used to stop large amounts -of 'flooding' from abusive users or accidents. Abusive users usually -don't care as they will reconnect promptly and resume their abusive -behaviour. To prevent this command from being abused, any user may -elect to receive KILL messages generated for others to keep an 'eye' -on would be trouble spots. - -In an arena where nicknames are REQUIRED to be globally unique at all -times, KILL messages are sent whenever 'duplicates' are detected -(that is an attempt to register two users with the same nickname) in -the hope that both of them will disappear and only 1 reappear. - -When a client is removed as the result of a KILL message, the server -SHOULD add the nickname to the list of unavailable nicknames in an -attempt to avoid clients to reuse this name immediately which is -usually the pattern of abusive behaviour often leading to useless -"KILL loops". See the "IRC Server Protocol" document [IRC-SERVER] -for more information on this procedure. - -The comment given MUST reflect the actual reason for the KILL. For -server-generated KILLs it usually is made up of details concerning -the origins of the two conflicting nicknames. For users it is left -up to them to provide an adequate reason to satisfy others who see -it. To prevent/discourage fake KILLs from being generated to hide -the identify of the KILLer, the comment also shows a 'kill-path' -which is updated by each server it passes through, each prepending -its name to the path. - - Numeric Replies: - - ERR_NOPRIVILEGES ERR_NEEDMOREPARAMS - ERR_NOSUCHNICK ERR_CANTKILLSERVER - -NOTE: -It is RECOMMENDED that only Operators be allowed to kill other users -with KILL command. This command has been the subject of many -controversies over the years, and along with the above -recommendation, it is also widely recognized that not even operators -should be allowed to kill users on remote servers. -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.7.2 Ping message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: PING -Parameters: [ ] - -The PING command is used to test the presence of an active client or -server at the other end of the connection. Servers send a PING -message at regular intervals if no other activity detected coming -from a connection. If a connection fails to respond to a PING -message within a set amount of time, that connection is closed. A -PING message MAY be sent even if the connection is active. - -When a PING message is received, the appropriate PONG message MUST be -sent as reply to (server which sent the PING message out) -as soon as possible. If the parameter is specified, it -represents the target of the ping, and the message gets forwarded -there. - - Numeric Replies: - - ERR_NOORIGIN ERR_NOSUCHSERVER - - Examples: - - PING tolsun.oulu.fi ; Command to send a PING message to - server - - PING WiZ tolsun.oulu.fi ; Command from WiZ to send a PING - message to server "tolsun.oulu.fi" - - PING :irc.funet.fi ; Ping message sent by server - "irc.funet.fi" -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.7.3 Pong message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: PONG -Parameters: [ ] - -PONG message is a reply to ping message. If parameter is -given, this message MUST be forwarded to given target. The -parameter is the name of the entity who has responded to PING message -and generated this message. - - Numeric Replies: - - ERR_NOORIGIN ERR_NOSUCHSERVER - - Example: - - PONG csd.bu.edu tolsun.oulu.fi ; PONG message from csd.bu.edu to - tolsun.oulu.fi -[/pre][/td][/tr] - -[tr][td][pre] -[b]3.7.4 Error[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: ERROR -Parameters: - -The ERROR command is for use by servers when reporting a serious or -fatal error to its peers. It may also be sent from one server to -another but MUST NOT be accepted from any normal unknown clients. - -Only an ERROR message SHOULD be used for reporting errors which occur -with a server-to-server link. An ERROR message is sent to the server -at the other end (which reports it to appropriate local users and -logs) and to appropriate local users and logs. It is not to be -passed onto any other servers by a server if it is received from a -server. - -The ERROR message is also used before terminating a client -connection. - -When a server sends a received ERROR message to its operators, the -message SHOULD be encapsulated inside a NOTICE message, indicating -that the client was not responsible for the error. - - Numerics: - - None. - - Examples: - - ERROR :Server *.fi already exists ; ERROR message to the other server - which caused this error. - - NOTICE WiZ :ERROR from csd.bu.edu -- Server *.fi already exists - ; Same ERROR message as above but - sent to user WiZ on the other server. -[/pre][/td][/tr] - -[tr][td][pre] -[b]4. Optional features[/b] -[/pre][/td][/tr] - -[tr][td][pre] -This section describes OPTIONAL messages. They are not required in a -working server implementation of the protocol described herein. In -the absence of the feature, an error reply message MUST be generated -or an unknown command error. If the message is destined for another -server to answer then it MUST be passed on (elementary parsing -REQUIRED) The allocated numerics for this are listed with the -messages below. - -From this section, only the USERHOST and ISON messages are available -to services. -[/pre][/td][/tr] - -[tr][td][pre] -[b]4.1 Away[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: AWAY -Parameters: [ ] - -With the AWAY command, clients can set an automatic reply string for -any PRIVMSG commands directed at them (not to a channel they are on). -The server sends an automatic reply to the client sending the PRIVMSG -command. The only replying server is the one to which the sending -client is connected to. - -The AWAY command is used either with one parameter, to set an AWAY -message, or with no parameters, to remove the AWAY message. - -Because of its high cost (memory and bandwidth wise), the AWAY -message SHOULD only be used for client-server communication. A -server MAY choose to silently ignore AWAY messages received from -other servers. To update the away status of a client across servers, -the user mode 'a' SHOULD be used instead. (See Section 3.1.5) - - Numeric Replies: - - RPL_UNAWAY RPL_NOWAWAY - - Example: - - AWAY :Gone to lunch. Back in 5 ; Command to set away message to - "Gone to lunch. Back in 5". -[/pre][/td][/tr] - -[tr][td][pre] -[b]4.2 Rehash message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: REHASH -Parameters: None - -The rehash command is an administrative command which can be used by -an operator to force the server to re-read and process its -configuration file. - - Numeric Replies: - - RPL_REHASHING ERR_NOPRIVILEGES - - - Example: - - REHASH ; message from user with operator - status to server asking it to reread - its configuration file. -[/pre][/td][/tr] - -[tr][td][pre] -[b]4.3 Die message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: DIE -Parameters: None - -An operator can use the DIE command to shutdown the server. This -message is optional since it may be viewed as a risk to allow -arbitrary people to connect to a server as an operator and execute -this command. - -The DIE command MUST always be fully processed by the server to which -the sending client is connected and MUST NOT be passed onto other -connected servers. - - Numeric Replies: - - ERR_NOPRIVILEGES - - Example: - - DIE ; no parameters required. -[/pre][/td][/tr] - -[tr][td][pre] -[b]4.4 Restart message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: RESTART -Parameters: None - -An operator can use the restart command to force the server to -restart itself. This message is optional since it may be viewed as a -risk to allow arbitrary people to connect to a server as an operator -and execute this command, causing (at least) a disruption to service. - -The RESTART command MUST always be fully processed by the server to -which the sending client is connected and MUST NOT be passed onto -other connected servers. - - Numeric Replies: - - ERR_NOPRIVILEGES - - Example: - - RESTART ; no parameters required. -[/pre][/td][/tr] - -[tr][td][pre] -[b]4.5 Summon message[/b] -[/pre][/td][/tr] - -[tr][td][pre] -Command: SUMMON -Parameters: [ [ ] ] - -The SUMMON command can be used to give users who are on a host -running an IRC server a message asking them to please join IRC. This -message is only sent if the target server (a) has SUMMON enabled, (b) -the user is logged in and (c) the server process can write to the -user's tty (or similar). - -If no parameter is given it tries to summon from the -server the client is connected to is assumed as the target. - -If summon is not enabled in a server, it MUST return the -ERR_SUMMONDISABLED numeric. - - Numeric Replies: - - ERR_NORECIPIENT ERR_FILEERROR - ERR_NOLOGIN ERR_NOSUCHSERVER - ERR_SUMMONDISABLED RPL_SUMMONING - - Examples: - - SUMMON jto ; summon user jto on the server's - host - - SUMMON jto tolsun.oulu.fi ; summon user jto on the host which a - server named "tolsun.oulu.fi" is - running. -[/pre][/td][/tr] - -[tr][td] -[b]4.6 Users[/b] -[/td][/tr] - -[tr][td][pre] -Command: USERS -Parameters: [ ] - -The USERS command returns a list of users logged into the server in a -format similar to the UNIX commands who(1), rusers(1) and finger(1). -If disabled, the correct numeric MUST be returned to indicate this. - -Because of the security implications of such a command, it SHOULD be -disabled by default in server implementations. Enabling it SHOULD -require recompiling the server or some equivalent change rather than -simply toggling an option and restarting the server. The procedure -to enable this command SHOULD also include suitable large comments. - - Numeric Replies: - - ERR_NOSUCHSERVER ERR_FILEERROR - RPL_USERSSTART RPL_USERS - RPL_NOUSERS RPL_ENDOFUSERS - ERR_USERSDISABLED - - Disabled Reply: - - ERR_USERSDISABLED - - Example: - - USERS eff.org ; request a list of users logged in - on server eff.org -[/pre][/td][/tr] - -[tr][td] -[b]4.7 Operwall message[/b] -[/td][/tr] - -[tr][td][pre] -Command: WALLOPS -Parameters: - -The WALLOPS command is used to send a message to all currently -connected users who have set the 'w' user mode for themselves. (See -Section 3.1.5 "User modes"). -After implementing WALLOPS as a user command it was found that it was -often and commonly abused as a means of sending a message to a lot of -people. Due to this, it is RECOMMENDED that the implementation of -WALLOPS allows and recognizes only servers as the originators of -WALLOPS. - - Numeric Replies: - - ERR_NEEDMOREPARAMS - - Example: - - :csd.bu.edu WALLOPS :Connect '*.uiuc.edu 6667' from Joshua ; WALLOPS - message from csd.bu.edu announcing a - CONNECT message it received from - Joshua and acted upon. -[/pre][/td][/tr] - -[tr][td] -[b]4.8 Userhost message[/b] -[/td][/tr] - -[tr][td][pre] -Command: USERHOST -Parameters: *( SPACE ) - -The USERHOST command takes a list of up to 5 nicknames, each -separated by a space character and returns a list of information -about each nickname that it found. The returned list has each reply -separated by a space. - - Numeric Replies: - - RPL_USERHOST ERR_NEEDMOREPARAMS - - Example: - - USERHOST Wiz Michael syrk ; USERHOST request for information on - nicks "Wiz", "Michael", and "syrk" - - :ircd.stealth.net 302 yournick :syrk=+syrk@millennium.stealth.net - ; Reply for user syrk -[/pre][/td][/tr] - -[tr][td] -[b]4.9 Ison message[/b] -[/td][/tr] - -[tr][td][pre] -Command: ISON -Parameters: *( SPACE ) - -The ISON command was implemented to provide a quick and efficient -means to get a response about whether a given nickname was currently -on IRC. ISON only takes one (1) type of parameter: a space-separated -list of nicks. For each nickname in the list that is present, the -server adds that to its reply string. Thus the reply string may -return empty (none of the given nicks are present), an exact copy of -the parameter string (all of them present) or any other subset of the -set of nicks given in the parameter. The only limit on the number of -nicks that may be checked is that the combined length MUST NOT be too -large as to cause the server to chop it off so it fits in 512 -characters. - -ISON is only processed by the server local to the client sending the -command and thus not passed onto other servers for further -processing. - - Numeric Replies: - - RPL_ISON ERR_NEEDMOREPARAMS - - Example: - - ISON phone trillian WiZ jarlek Avalon Angel Monstah syrk - ; Sample ISON request for 7 nicks. -[/pre][/td][/tr] - -[tr][td] -[b]5. Replies[/b] -[/td][/tr] - -[tr][td] -The following is a list of numeric replies which are generated in -response to the commands given above. Each numeric is given with its -number, name and reply string. -[/td][/tr] - -[tr][td] -[b]5.1 Command responses[/b] -[/td][/tr] - -[tr][td] -Numerics in the range from 001 to 099 are used for client-server -connections only and should never travel between servers. Replies -generated in the response to commands are found in the range from 200 -to 399. -[p] -[pre] - 001 RPL_WELCOME - "Welcome to the Internet Relay Network - !@" - 002 RPL_YOURHOST - "Your host is , running version " - 003 RPL_CREATED - "This server was created " - 004 RPL_MYINFO - " - " - - - The server sends Replies 001 to 004 to a user upon - successful registration. - - 005 RPL_BOUNCE - "Try server , port " - - - Sent by the server to a user to suggest an alternative - server. This is often used when the connection is - refused because the server is already full. - - 302 RPL_USERHOST - ":*1 *( " " )" - - - Reply format used by USERHOST to list replies to - the query list. The reply string is composed as - follows: - - reply = nickname [ "*" ] "=" ( "+" / "-" ) hostname - - The '*' indicates whether the client has registered - as an Operator. The '-' or '+' characters represent - whether the client has set an AWAY message or not - respectively. - - 303 RPL_ISON - ":*1 *( " " )" - - - Reply format used by ISON to list replies to the - query list. - - 301 RPL_AWAY - " :" - 305 RPL_UNAWAY - ":You are no longer marked as being away" - 306 RPL_NOWAWAY - ":You have been marked as being away" - - - These replies are used with the AWAY command (if - allowed). RPL_AWAY is sent to any client sending a - PRIVMSG to a client which is away. RPL_AWAY is only - sent by the server to which the client is connected. - Replies RPL_UNAWAY and RPL_NOWAWAY are sent when the - client removes and sets an AWAY message. - - 311 RPL_WHOISUSER - " * :" - 312 RPL_WHOISSERVER - " :" - 313 RPL_WHOISOPERATOR - " :is an IRC operator - 317 RPL_WHOISIDLE - " :seconds idle" - 318 RPL_ENDOFWHOIS - " :End of WHOIS list" - 319 RPL_WHOISCHANNELS - " :*( ( "@" / "+" ) " " )" - - - Replies 311 - 313, 317 - 319 are all replies - generated in response to a WHOIS message. Given that - there are enough parameters present, the answering - server MUST either formulate a reply out of the above - numerics (if the query nick is found) or return an - error reply. The '*' in RPL_WHOISUSER is there as - the literal character and not as a wild card. For - each reply set, only RPL_WHOISCHANNELS may appear - more than once (for long lists of channel names). - The '@' and '+' characters next to the channel name - indicate whether a client is a channel operator or - has been granted permission to speak on a moderated - channel. The RPL_ENDOFWHOIS reply is used to mark - the end of processing a WHOIS message. - - 314 RPL_WHOWASUSER - " * :" - 369 RPL_ENDOFWHOWAS - " :End of WHOWAS" - - - When replying to a WHOWAS message, a server MUST use - the replies RPL_WHOWASUSER, RPL_WHOISSERVER or - ERR_WASNOSUCHNICK for each nickname in the presented - list. At the end of all reply batches, there MUST - be RPL_ENDOFWHOWAS (even if there was only one reply - and it was an error). - - 321 RPL_LISTSTART - Obsolete. Not used. - - 322 RPL_LIST - " <# visible> :" - 323 RPL_LISTEND - ":End of LIST" - - - Replies RPL_LIST, RPL_LISTEND mark the actual replies - with data and end of the server's response to a LIST - command. If there are no channels available to return, - only the end reply MUST be sent. - - 325 RPL_UNIQOPIS - " " - - 324 RPL_CHANNELMODEIS - " " - - 331 RPL_NOTOPIC - " :No topic is set" - 332 RPL_TOPIC - " :" - - - When sending a TOPIC message to determine the - channel topic, one of two replies is sent. If - the topic is set, RPL_TOPIC is sent back else - RPL_NOTOPIC. - - 341 RPL_INVITING - " " - - - Returned by the server to indicate that the - attempted INVITE message was successful and is - being passed onto the end client. - - 342 RPL_SUMMONING - " :Summoning user to IRC" - - - Returned by a server answering a SUMMON message to - indicate that it is summoning that user. - - 346 RPL_INVITELIST - " " - 347 RPL_ENDOFINVITELIST - " :End of channel invite list" - - - When listing the 'invitations masks' for a given channel, - a server is required to send the list back using the - RPL_INVITELIST and RPL_ENDOFINVITELIST messages. A - separate RPL_INVITELIST is sent for each active mask. - After the masks have been listed (or if none present) a - RPL_ENDOFINVITELIST MUST be sent. - - 348 RPL_EXCEPTLIST - " " - 349 RPL_ENDOFEXCEPTLIST - " :End of channel exception list" - - - When listing the 'exception masks' for a given channel, - a server is required to send the list back using the - RPL_EXCEPTLIST and RPL_ENDOFEXCEPTLIST messages. A - separate RPL_EXCEPTLIST is sent for each active mask. - After the masks have been listed (or if none present) - a RPL_ENDOFEXCEPTLIST MUST be sent. - - 351 RPL_VERSION - ". :" - - - Reply by the server showing its version details. - The is the version of the software being - used (including any patchlevel revisions) and the - is used to indicate if the server is - running in "debug mode". - - The "comments" field may contain any comments about - the version or further version details. - - 352 RPL_WHOREPLY - " - ( "H" / "G" > ["*"] [ ( "@" / "+" ) ] - : " - - 315 RPL_ENDOFWHO - " :End of WHO list" - - - The RPL_WHOREPLY and RPL_ENDOFWHO pair are used - to answer a WHO message. The RPL_WHOREPLY is only - sent if there is an appropriate match to the WHO - query. If there is a list of parameters supplied - with a WHO message, a RPL_ENDOFWHO MUST be sent - after processing each list item with being - the item. - - 353 RPL_NAMREPLY - "( "=" / "*" / "@" ) - :[ "@" / "+" ] *( " " [ "@" / "+" ] ) - - "@" is used for secret channels, "*" for private - channels, and "=" for others (public channels). - - 366 RPL_ENDOFNAMES - " :End of NAMES list" - - - To reply to a NAMES message, a reply pair consisting - of RPL_NAMREPLY and RPL_ENDOFNAMES is sent by the - server back to the client. If there is no channel - found as in the query, then only RPL_ENDOFNAMES is - returned. The exception to this is when a NAMES - message is sent with no parameters and all visible - channels and contents are sent back in a series of - RPL_NAMEREPLY messages with a RPL_ENDOFNAMES to mark - the end. - - 364 RPL_LINKS - " : " - 365 RPL_ENDOFLINKS - " :End of LINKS list" - - - In replying to the LINKS message, a server MUST send - replies back using the RPL_LINKS numeric and mark the - end of the list using an RPL_ENDOFLINKS reply. - - 367 RPL_BANLIST - " " - 368 RPL_ENDOFBANLIST - " :End of channel ban list" - - - When listing the active 'bans' for a given channel, - a server is required to send the list back using the - RPL_BANLIST and RPL_ENDOFBANLIST messages. A separate - RPL_BANLIST is sent for each active banmask. After the - banmasks have been listed (or if none present) a - RPL_ENDOFBANLIST MUST be sent. - - 371 RPL_INFO - ":" - 374 RPL_ENDOFINFO - ":End of INFO list" - - - A server responding to an INFO message is required to - send all its 'info' in a series of RPL_INFO messages - with a RPL_ENDOFINFO reply to indicate the end of the - replies. - - 375 RPL_MOTDSTART - ":- Message of the day - " - 372 RPL_MOTD - ":- " - 376 RPL_ENDOFMOTD - ":End of MOTD command" - - - When responding to the MOTD message and the MOTD file - is found, the file is displayed line by line, with - each line no longer than 80 characters, using - RPL_MOTD format replies. These MUST be surrounded - by a RPL_MOTDSTART (before the RPL_MOTDs) and an - RPL_ENDOFMOTD (after). - - 381 RPL_YOUREOPER - ":You are now an IRC operator" - - - RPL_YOUREOPER is sent back to a client which has - just successfully issued an OPER message and gained - operator status. - - 382 RPL_REHASHING - " :Rehashing" - - - If the REHASH option is used and an operator sends - a REHASH message, an RPL_REHASHING is sent back to - the operator. - - 383 RPL_YOURESERVICE - "You are service " - - - Sent by the server to a service upon successful - registration. - - 391 RPL_TIME - " :" - - - When replying to the TIME message, a server MUST send - the reply using the RPL_TIME format above. The string - showing the time need only contain the correct day and - time there. There is no further requirement for the - time string. - - 392 RPL_USERSSTART - ":UserID Terminal Host" - 393 RPL_USERS - ": " - 394 RPL_ENDOFUSERS - ":End of users" - 395 RPL_NOUSERS - ":Nobody logged in" - - - If the USERS message is handled by a server, the - replies RPL_USERSTART, RPL_USERS, RPL_ENDOFUSERS and - RPL_NOUSERS are used. RPL_USERSSTART MUST be sent - first, following by either a sequence of RPL_USERS - or a single RPL_NOUSER. Following this is - RPL_ENDOFUSERS. - - 200 RPL_TRACELINK - "Link - V - - " - 201 RPL_TRACECONNECTING - "Try. " - 202 RPL_TRACEHANDSHAKE - "H.S. " - 203 RPL_TRACEUNKNOWN - "???? []" - 204 RPL_TRACEOPERATOR - "Oper " - 205 RPL_TRACEUSER - "User " - 206 RPL_TRACESERVER - "Serv S C - @ V" - 207 RPL_TRACESERVICE - "Service " - 208 RPL_TRACENEWTYPE - " 0 " - 209 RPL_TRACECLASS - "Class " - 210 RPL_TRACERECONNECT - Unused. - 261 RPL_TRACELOG - "File " - 262 RPL_TRACEEND - " :End of TRACE" - - - The RPL_TRACE* are all returned by the server in - response to the TRACE message. How many are - returned is dependent on the TRACE message and - whether it was sent by an operator or not. There - is no predefined order for which occurs first. - Replies RPL_TRACEUNKNOWN, RPL_TRACECONNECTING and - RPL_TRACEHANDSHAKE are all used for connections - which have not been fully established and are either - unknown, still attempting to connect or in the - process of completing the 'server handshake'. - RPL_TRACELINK is sent by any server which handles - a TRACE message and has to pass it on to another - server. The list of RPL_TRACELINKs sent in - response to a TRACE command traversing the IRC - network should reflect the actual connectivity of - the servers themselves along that path. - RPL_TRACENEWTYPE is to be used for any connection - which does not fit in the other categories but is - being displayed anyway. - RPL_TRACEEND is sent to indicate the end of the list. - - 211 RPL_STATSLINKINFO - " - -
No matches found

Main index" - echo "$DOCUMENT" > $2 - exit 0 - fi -done - -DOCS_COUNT="0" - -for a_file in $SEARCH_RESULT; do - - RESULT_DESCRIPTION="[" - for a_word in $SEARCH_WORDS; do - WORD_MATCHES=`grep -i -h -c $a_word "$a_file"` - RESULT_DESCRIPTION="$RESULT_DESCRIPTION $a_word:$WORD_MATCHES " - done - RESULT_DESCRIPTION="$RESULT_DESCRIPTION ]" - - DOC_TITLE=`grep -i -h "" "$a_file" | sed -e 's/title/b/g'` - if test -z "$DOC_TITLE"; then - DOC_TITLE="<b>Untitled</b>" - fi - DOC_PREMATCH=`grep -i -h -A 30 "searchbody" "$a_file" | tac | tail -n 30 | tac` - DOC_MATCH=`echo "$DOC_PREMATCH" | sed -e 's/<[a-zA-Z0-9 _ \=\"\#\%\&\/\.]*>/ /g'` - DOC_MATCH=`echo "$DOC_MATCH" | sed -e 's/</\</g'` - DOC_MATCH=`echo "$DOC_MATCH" | sed -e 's/>/\>/g'` - DOC_MATCH=`echo "$DOC_MATCH" | grep -h "[a-zA-Z0-9{}]"` - DOC_MATCH=`echo "$DOC_MATCH" | sed -e 's/^[ ]*//'` - DOC_MATCH=`echo "$DOC_MATCH" | tac | tail -n 10 | tac` - if test -z "$DOC_MATCH"; then - DOC_MATCH="No document body found" - fi - - DOCS_COUNT=`expr $DOCS_COUNT + 1` - - DOCUMENT="$DOCUMENT <tr bgcolor=\"#F0F0F0\"><td><a href=\"$a_file\"><b>$DOCS_COUNT</b>. $DOC_TITLE</a><br><br><I>...$DOC_MATCH...</I><br><br><b>$RESULT_DESCRIPTION</b></td></tr>" - -done - -DOCUMENT="$DOCUMENT</table><hr><br>Found $DOCS_COUNT matches</html>" - -echo "$DOCUMENT" > $2 diff --git a/3.4.0/src/.svnignore b/3.4.0/src/.svnignore deleted file mode 100644 index afa81c2049..0000000000 --- a/3.4.0/src/.svnignore +++ /dev/null @@ -1,15 +0,0 @@ -Makefile.in -Makefile -core -kvi_configstatus.h -config.h -config.h.in -stamp-h -stamp-h1 -stamp-h.in -stamp.h.in -.xvpics -.pics -*.o -*.lo -*.moc diff --git a/3.4.0/src/KVIRC.dsw b/3.4.0/src/KVIRC.dsw deleted file mode 100644 index 7450290710..0000000000 --- a/3.4.0/src/KVIRC.dsw +++ /dev/null @@ -1,1055 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "KVILIB"=.\kvilib\KVILIB.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "idleui"=.\modules\my\win32\idleui.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "kviabout"=.\modules\about\kviabout.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kviaction"=.\modules\action\kviaction.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kviactioneditor"=.\modules\actioneditor\kviactioneditor.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kviaddon"=.\modules\addon\kviaddon.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "kvialiaseditor"=.\modules\aliaseditor\kvialiaseditor.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kviavatar"=.\modules\avatar\kviavatar.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvichan"=.\modules\chan\kvichan.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvichannelsjoin"=.\modules\channelsjoin\kvichannelsjoin.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvicodetester"=.\modules\codetester\kvicodetester.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kviconfig"=.\modules\config\kviconfig.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvidcc"=.\modules\dcc\kvidcc.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvidialog"=.\modules\dialog\kvidialog.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvidockwidget"=.\modules\dockwidget\kvidockwidget.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvieditor"=.\modules\editor\kvieditor.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvieventeditor"=.\modules\eventeditor\kvieventeditor.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvifile"=.\modules\file\kvifile.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvifiletransferwindow"=.\modules\filetransferwindow\kvifiletransferwindow.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvihelp"=.\modules\help\kvihelp.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvihttp"=.\modules\http\kvihttp.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kviident"=.\modules\ident\kviident.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvilag"=.\modules\lag\kvilag.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvilamerizer"=.\modules\lamerizer\kvilamerizer.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvilanguage"=.\modules\language\kvilanguange.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvilinks"=.\modules\links\kvilinks.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvilist"=.\modules\list\kvilist.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvilog"=.\modules\log\kvilog.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvilogview"=.\modules\logview\kvilogview.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvimask"=.\modules\mask\kvimask.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvimath"=.\modules\math\kvimath.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvimediaplayer"=.\modules\mediaplayer\kvimediaplayer.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvimircimport"=.\modules\mircimport\kvimircimport.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvimy"=.\modules\my\kvimy.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency - Begin Project Dependency - Project_Dep_Name idleui - End Project Dependency -}}} - -############################################################################### - -Project: "kvinotifier"=.\modules\notifier\kvinotifier.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kviobjects"=.\modules\objects\kviobjects.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "kvioptions"=.\modules\options\kvioptions.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kviperl"=.\modules\perl\kviperl.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kviperlcore"=.\modules\perlcore\kviperlcore.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvipopupeditor"=.\modules\popupeditor\kvipopupeditor.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kviraweditor"=.\modules\raweditor\kviraweditor.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvirc"=.\kvirc\kvirc.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency -}}} - -############################################################################### - -Project: "kviregchan"=.\modules\regchan\kviregchan.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvireguser"=.\modules\reguser\kvireguser.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvirijndael"=.\modules\rijndael\kvirijndael.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvisetup"=.\modules\setup\kvisetup.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvisharedfiles"=.\modules\sharedfile\kvisharedfile.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvisharedfileswindow"=.\modules\sharedfileswindow\kvisharedfileswindow.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvisnd"=.\modules\snd\kvisnd.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvisocketspy"=.\modules\socketspy\kvisocketspy.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvispaste"=.\modules\spaste\kvispaste.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvistr"=.\modules\str\kvistr.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvisystem"=.\modules\system\kvisystem.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvitip"=.\modules\tip\kvitip.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvitmphighlight"=.\modules\tmphighlight\kvitmphighlight.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvitoolbar"=.\modules\toolbar\kvitoolbar.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kvitoolbareditor"=.\modules\toolbareditor\kvitoolbareditor.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kviurl"=.\modules\url\kviurl.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Project: "kviwindow"=.\modules\window\kviwindow.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name KVILIB - End Project Dependency - Begin Project Dependency - Project_Dep_Name kvirc - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/3.4.0/src/Makefile.am b/3.4.0/src/Makefile.am deleted file mode 100644 index a3f12af2d4..0000000000 --- a/3.4.0/src/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -SUBDIRS = kvilib kvirc modules - -headers_HEADERS=kvi_configstatus.h - -kvi_configstatus.h: config.h - cp -f config.h kvi_configstatus.h diff --git a/3.4.0/src/config.h.in b/3.4.0/src/config.h.in deleted file mode 100644 index e79ea040ea..0000000000 --- a/3.4.0/src/config.h.in +++ /dev/null @@ -1,247 +0,0 @@ -/* src/config.h.in. Generated from configure.in by autoheader. */ - -/* define this to the number of average channel users */ -#undef AVERAGE_CHANNEL_USERS - -/* define this if you are on a big endian machine */ -#undef BIG_ENDIAN_MACHINE_BYTE_ORDER - -/* this is the build date (configure date rather) */ -#undef BUILD_DATE - -/* these are the build flags */ -#undef BUILD_FLAGS - -/* define if you want to enable the Arts daemon support */ -#undef COMPILE_ARTS_SUPPORT - -/* define if you want to enable the Audiofile library support */ -#undef COMPILE_AUDIOFILE_SUPPORT - -/* define if you want to compile the crypt support */ -#undef COMPILE_CRYPT_SUPPORT - -/* define if you want to disable DCC VOICE sound support */ -#undef COMPILE_DISABLE_DCC_VOICE - -/* define if you want to enable the Esound daemon support */ -#undef COMPILE_ESD_SUPPORT - -/* define if you have the SIOCGIFADDR ioctl and the related headers */ -#undef COMPILE_GET_INTERFACE_ADDRESS - -/* define this if you want to ignore the SIGALARM signal */ -#undef COMPILE_IGNORE_SIGALARM - -/* define if you want the info tips to be compiled in */ -#undef COMPILE_INFO_TIPS - -/* define if you want the IpV6 support */ -#undef COMPILE_IPV6_SUPPORT - -/* define if you want to compile the KDE 3.x support */ -#undef COMPILE_KDE_SUPPORT - -/* define if you want the memory checks */ -#undef COMPILE_MEMORY_CHECKS - -/* define if you want the gcc memory profile */ -#undef COMPILE_MEMORY_PROFILE - -/* define if you want to enable the new KVS parser */ -#undef COMPILE_NEW_KVS - -/* define this if you want to disable the inter-process communication support - */ -#undef COMPILE_NO_IPC - -/* define if you want to ignore X Windows completely */ -#undef COMPILE_NO_X - -/* define if you want to disable the X bell support */ -#undef COMPILE_NO_X_BELL - -/* define if you want to use only the new KVS parser */ -#undef COMPILE_ONLY_NEW_KVS - -/* define if you want to enable OSS sound support */ -#undef COMPILE_OSS_SUPPORT - -/* define if you have perl and want the perl scripting support in kvirc */ -#undef COMPILE_PERL_SUPPORT - -/* define if you have the KDE support and want the pseudo transparency */ -#undef COMPILE_PSEUDO_TRANSPARENCY - -/* define if you have openssl and want the ssl support in kvirc */ -#undef COMPILE_SSL_SUPPORT - -/* define if you want to use the pthreads library */ -#undef COMPILE_THREADS_USE_POSIX - -/* define if you want to use the solaris libthread */ -#undef COMPILE_THREADS_USE_SOLARIS_LIBTHREAD - -/* define if your compiler supports gotos do dynamic labels */ -#undef COMPILE_USE_DYNAMIC_LABELS - -/* define if you have libgsm and want the GSM code to be compiled */ -#undef COMPILE_USE_GSM - -/* define if you want to compile the Qt 4.x support */ -#undef COMPILE_USE_QT4 - -/* define if you trust your memmove() function */ -#undef COMPILE_WITH_SYSTEM_MEMMOVE - -/* define if you want to enable the ZLib library support */ -#undef COMPILE_XSS_SUPPORT - -/* define if you want to enable the ZLib library support */ -#undef COMPILE_ZLIB_SUPPORT - -/* define if you want the i386 asm code */ -#undef COMPILE_ix86_ASM - -/* Define to 1 if you have the <dlfcn.h> header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the `getenv' function. */ -#undef HAVE_GETENV - -/* Define to 1 if you have the `getnameinfo' function. */ -#undef HAVE_GETNAMEINFO - -/* Define to 1 if you have the `gmtime_r' function. */ -#undef HAVE_GMTIME_R - -/* Define to 1 if you have the `inet_aton' function. */ -#undef HAVE_INET_ATON - -/* Define to 1 if you have the `inet_ntoa' function. */ -#undef HAVE_INET_NTOA - -/* Define to 1 if you have the <inttypes.h> header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the <linux/soundcard.h> header file. */ -#undef HAVE_LINUX_SOUNDCARD_H - -/* Define to 1 if you have the `localtime_r' function. */ -#undef HAVE_LOCALTIME_R - -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - -/* Define to 1 if you have the `setenv' function. */ -#undef HAVE_SETENV - -/* Define to 1 if you have the <soundcard.h> header file. */ -#undef HAVE_SOUNDCARD_H - -/* Define to 1 if you have the <stdint.h> header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* Define to 1 if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the <sys/soundcard.h> header file. */ -#undef HAVE_SYS_SOUNDCARD_H - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the <sys/types.h> header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `unsetenv' function. */ -#undef HAVE_UNSETENV - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* The size of `int', as computed by sizeof. */ -#undef SIZEOF_INT - -/* The size of `long int', as computed by sizeof. */ -#undef SIZEOF_LONG_INT - -/* The size of `long long int', as computed by sizeof. */ -#undef SIZEOF_LONG_LONG_INT - -/* The size of `short int', as computed by sizeof. */ -#undef SIZEOF_SHORT_INT - -/* The size of `unsigned int', as computed by sizeof. */ -#undef SIZEOF_UNSIGNED_INT - -/* The size of `unsigned long int', as computed by sizeof. */ -#undef SIZEOF_UNSIGNED_LONG_INT - -/* The size of `unsigned long long int', as computed by sizeof. */ -#undef SIZEOF_UNSIGNED_LONG_LONG_INT - -/* The size of `unsigned short int', as computed by sizeof. */ -#undef SIZEOF_UNSIGNED_SHORT_INT - -/* The size of `void *', as computed by sizeof. */ -#undef SIZEOF_VOID_P - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION - -/* MAJOR.MINOR part of version */ -#undef VERSION_BRANCH - -/* Define to 1 if the X Window System is missing or not being used. */ -#undef X_DISPLAY_MISSING - -/* Define to 1 if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif - -/* Define to 1 if on MINIX. */ -#undef _MINIX - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -#undef _POSIX_1_SOURCE - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -#undef _POSIX_SOURCE diff --git a/3.4.0/src/kvilib/.svnignore b/3.4.0/src/kvilib/.svnignore deleted file mode 100644 index 4314e23d16..0000000000 --- a/3.4.0/src/kvilib/.svnignore +++ /dev/null @@ -1,16 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -*.o -*.lo -*.la -*.so -*.lai diff --git a/3.4.0/src/kvilib/KVILIB.dsp b/3.4.0/src/kvilib/KVILIB.dsp deleted file mode 100644 index 0d57a840c3..0000000000 --- a/3.4.0/src/kvilib/KVILIB.dsp +++ /dev/null @@ -1,1003 +0,0 @@ -# Microsoft Developer Studio Project File - Name="KVILIB" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=KVILIB - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "KVILIB.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "KVILIB.mak" CFG="KVILIB - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "KVILIB - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "KVILIB - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "KVILIB - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "KVILIB_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "config" /I "tal" /I "system" /I "irc" /I "file" /I "ext" /I "net" /I "core\wstring" /I "core" /I "..\kernel" /I "$(QTDIR)\include" /I "c:\ssl" /I "c:\ipv6" /D "NDEBUG" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "KVILIB_EXPORTS" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /D "__LIBKVILIB__" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x410 /d "NDEBUG" -# ADD RSC /l 0x410 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 libeay32.lib SSLeay32.lib ws2_32.lib msvcrt.lib $(QTDIR)\lib\qt-mtnc321.lib $(QTDIR)\lib\qtmain.lib /nologo /dll /machine:I386 /nodefaultlib:"LIBCMT.lib" /out:"..\..\win32build\bin\kvilib.dll" /libpath:"C:\OpenSSL\lib\VC" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "KVILIB - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "KVILIB_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "C:\src\kvilib\config" /I "C:\src\kvilib\tal" /I "C:\src\kvilib\system" /I "C:\src\kvilib\irc" /I "C:\src\kvilib\file" /I "C:\src\kvilib\ext" /I "C:\src\kvilib\net" /I "C:\src\kvilib\core\wstring" /I "C:\src\kvilib\core" /I "C:\src\kvirc\kernel" /I "_$(QTDIR)\include" /I "$(QTDIR)\include" /I "config" /I "tal" /I "system" /I "irc" /I "file" /I "ext" /I "net" /I "core\wstring" /I "core" /I "c:\ssl" /I "c:\ipv6" /I "..\kernel" /D "_DEBUG" /D "__LIBKVILIB__" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "KVILIB_EXPORTS" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x410 /d "NDEBUG" -# ADD RSC /l 0x410 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 libeay32.lib SSLeay32.lib ws2_32.lib msvcrt.lib $(QTDIR)\lib\qt-mtnc321.lib $(QTDIR)\lib\qtmain.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"LIBCMT.lib" /out:"..\..\win32build\KviDebug\kvilib.dll" /pdbtype:sept /libpath:"C:\OpenSSL\lib\VC" -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "KVILIB - Win32 Release" -# Name "KVILIB - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\irc\kvi_avatar.cpp -# End Source File -# Begin Source File - -SOURCE=.\irc\kvi_avatarcache.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_cmdformatter.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_config.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_crypt.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_databuffer.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_datacontainer.cpp -# End Source File -# Begin Source File - -SOURCE=.\net\kvi_dns.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_doublebuffer.cpp -# End Source File -# Begin Source File - -SOURCE=.\system\kvi_env.cpp -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_error.cpp -# End Source File -# Begin Source File - -SOURCE=.\file\kvi_file.cpp -# End Source File -# Begin Source File - -SOURCE=.\file\kvi_fileutils.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_garbage.cpp -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_heapobject.cpp -# End Source File -# Begin Source File - -SOURCE=.\net\kvi_http.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_imagelib.cpp -# End Source File -# Begin Source File - -SOURCE=.\irc\kvi_ircmask.cpp -# End Source File -# Begin Source File - -SOURCE=.\irc\kvi_ircserver.cpp -# End Source File -# Begin Source File - -SOURCE=.\irc\kvi_ircserverdb.cpp -# End Source File -# Begin Source File - -SOURCE=.\irc\kvi_ircuserdb.cpp -# End Source File -# Begin Source File - -SOURCE=.\system\kvi_locale.cpp -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_malloc.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_md5.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_mediatype.cpp -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_memmove.cpp -# End Source File -# Begin Source File - -SOURCE=.\irc\kvi_mirccntrl.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_msgtype.cpp -# End Source File -# Begin Source File - -SOURCE=.\net\kvi_netutils.cpp -# End Source File -# Begin Source File - -SOURCE=.\irc\kvi_nickserv.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_osinfo.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_parameterlist.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_pixmap.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_proxydb.cpp -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_qstring.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_regchan.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_regusersdb.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_sharedfiles.cpp -# End Source File -# Begin Source File - -SOURCE=.\net\kvi_socket.cpp -# End Source File -# Begin Source File - -SOURCE=.\net\kvi_ssl.cpp -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_string.cpp -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_stringarray.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_stringconversion.cpp -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_application.cpp -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_filedialog.cpp -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_mainwindow.cpp -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_menubar.cpp -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_toolbar.cpp -# End Source File -# Begin Source File - -SOURCE=.\system\kvi_thread.cpp -# End Source File -# Begin Source File - -SOURCE=.\system\kvi_time.cpp -# End Source File -# Begin Source File - -SOURCE=.\net\kvi_url.cpp -# End Source File -# Begin Source File - -SOURCE=.\ext\moc_kvi_crypt.cpp -# ADD CPP /D "__KVILIB__" -# End Source File -# Begin Source File - -SOURCE=.\net\moc_kvi_dns.cpp -# ADD CPP /D "__KVILIB__" -# End Source File -# Begin Source File - -SOURCE=.\ext\moc_kvi_garbage.cpp -# ADD CPP /D "__KVILIB__" -# End Source File -# Begin Source File - -SOURCE=.\net\moc_kvi_http.cpp -# ADD CPP /D "__KVILIB__" -# End Source File -# Begin Source File - -SOURCE=.\system\moc_kvi_locale.cpp -# ADD CPP /D "__KVILIB__" -# End Source File -# Begin Source File - -SOURCE=.\ext\moc_kvi_sharedfiles.cpp -# ADD CPP /D "__KVILIB__" -# End Source File -# Begin Source File - -SOURCE=.\system\moc_kvi_thread.cpp - -!IF "$(CFG)" == "KVILIB - Win32 Release" - -# ADD CPP /D "__KVILIB__" - -!ELSEIF "$(CFG)" == "KVILIB - Win32 Debug" - -# ADD CPP /D "NDEBUG" /D "__KVILIB__" - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\irc\kvi_avatar.h -# End Source File -# Begin Source File - -SOURCE=.\irc\kvi_avatarcache.h -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_bswap.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_cmdformatter.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_config.h -# End Source File -# Begin Source File - -SOURCE=.\config\kvi_confignames.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_crypt.h - -!IF "$(CFG)" == "KVILIB - Win32 Release" - -# Begin Custom Build -InputDir=.\ext -InputPath=.\ext\kvi_crypt.h -InputName=kvi_crypt - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "KVILIB - Win32 Debug" - -# Begin Custom Build -InputDir=.\ext -InputPath=.\ext\kvi_crypt.h -InputName=kvi_crypt - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_databuffer.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_datacontainer.h -# End Source File -# Begin Source File - -SOURCE=.\net\kvi_dns.h - -!IF "$(CFG)" == "KVILIB - Win32 Release" - -# Begin Custom Build -InputDir=.\net -InputPath=.\net\kvi_dns.h -InputName=kvi_dns - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "KVILIB - Win32 Debug" - -# Begin Custom Build -InputDir=.\net -InputPath=.\net\kvi_dns.h -InputName=kvi_dns - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_doublebuffer.h -# End Source File -# Begin Source File - -SOURCE=.\system\kvi_env.h -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_error.h -# End Source File -# Begin Source File - -SOURCE=.\file\kvi_file.h -# End Source File -# Begin Source File - -SOURCE=.\file\kvi_fileutils.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_garbage.h - -!IF "$(CFG)" == "KVILIB - Win32 Release" - -# Begin Custom Build -InputDir=.\ext -InputPath=.\ext\kvi_garbage.h -InputName=kvi_garbage - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "KVILIB - Win32 Debug" - -# Begin Custom Build -InputDir=.\ext -InputPath=.\ext\kvi_garbage.h -InputName=kvi_garbage - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_heapobject.h -# End Source File -# Begin Source File - -SOURCE=.\net\kvi_http.h - -!IF "$(CFG)" == "KVILIB - Win32 Release" - -# Begin Custom Build -InputDir=.\net -InputPath=.\net\kvi_http.h -InputName=kvi_http - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "KVILIB - Win32 Debug" - -# Begin Custom Build -InputDir=.\net -InputPath=.\net\kvi_http.h -InputName=kvi_http - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_imagelib.h -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_inttypes.h -# End Source File -# Begin Source File - -SOURCE=.\irc\kvi_ircmask.h -# End Source File -# Begin Source File - -SOURCE=.\irc\kvi_ircserver.h -# End Source File -# Begin Source File - -SOURCE=.\irc\kvi_ircserverdb.h -# End Source File -# Begin Source File - -SOURCE=.\irc\kvi_ircuserdb.h -# End Source File -# Begin Source File - -SOURCE=.\system\kvi_library.h -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_list.h -# End Source File -# Begin Source File - -SOURCE=.\system\kvi_locale.h - -!IF "$(CFG)" == "KVILIB - Win32 Release" - -# Begin Custom Build -InputDir=.\system -InputPath=.\system\kvi_locale.h -InputName=kvi_locale - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "KVILIB - Win32 Debug" - -# Begin Custom Build -InputDir=.\system -InputPath=.\system\kvi_locale.h -InputName=kvi_locale - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_malloc.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_md5.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_mediatype.h -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_memmove.h -# End Source File -# Begin Source File - -SOURCE=.\irc\kvi_mirccntrl.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_msgtype.h -# End Source File -# Begin Source File - -SOURCE=.\net\kvi_netutils.h -# End Source File -# Begin Source File - -SOURCE=.\irc\kvi_nickserv.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_osinfo.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_parameterlist.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_pixmap.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_proxydb.h -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_qstring.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_regchan.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_regusersdb.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_sharedfiles.h - -!IF "$(CFG)" == "KVILIB - Win32 Release" - -# Begin Custom Build -InputDir=.\ext -InputPath=.\ext\kvi_sharedfiles.h -InputName=kvi_sharedfiles - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "KVILIB - Win32 Debug" - -# Begin Custom Build -InputDir=.\ext -InputPath=.\ext\kvi_sharedfiles.h -InputName=kvi_sharedfiles - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\net\kvi_socket.h -# End Source File -# Begin Source File - -SOURCE=.\net\kvi_sockettype.h -# End Source File -# Begin Source File - -SOURCE=.\net\kvi_ssl.h -# End Source File -# Begin Source File - -SOURCE=.\system\kvi_stdarg.h -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_strasm.h -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_string.h -# End Source File -# Begin Source File - -SOURCE=.\core\kvi_stringarray.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_stringconversion.h -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_application.h - -!IF "$(CFG)" == "KVILIB - Win32 Release" - -# Begin Custom Build -InputDir=.\tal -InputPath=.\tal\kvi_tal_application.h -InputName=kvi_tal_application - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "KVILIB - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_application_kde.h -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_application_qt.h - -!IF "$(CFG)" == "KVILIB - Win32 Release" - -# Begin Custom Build -InputDir=.\tal -InputPath=.\tal\kvi_tal_application_qt.h -InputName=kvi_tal_application_qt - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "KVILIB - Win32 Debug" - -# Begin Custom Build -InputDir=.\tal -InputPath=.\tal\kvi_tal_application_qt.h -InputName=kvi_tal_application_qt - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_filedialog.h -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_filedialog_kde.h -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_filedialog_qt.h - -!IF "$(CFG)" == "KVILIB - Win32 Release" - -# Begin Custom Build -InputDir=.\tal -InputPath=.\tal\kvi_tal_filedialog_qt.h -InputName=kvi_tal_filedialog_qt - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "KVILIB - Win32 Debug" - -# Begin Custom Build -InputDir=.\tal -InputPath=.\tal\kvi_tal_filedialog_qt.h -InputName=kvi_tal_filedialog_qt - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_mainwindow.h -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_mainwindow_kde.h -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_mainwindow_qt.h - -!IF "$(CFG)" == "KVILIB - Win32 Release" - -# Begin Custom Build -InputDir=.\tal -InputPath=.\tal\kvi_tal_mainwindow_qt.h -InputName=kvi_tal_mainwindow_qt - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "KVILIB - Win32 Debug" - -# Begin Custom Build -InputDir=.\tal -InputPath=.\tal\kvi_tal_mainwindow_qt.h -InputName=kvi_tal_mainwindow_qt - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_menubar.h -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_menubar_kde.h -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_menubar_qt.h - -!IF "$(CFG)" == "KVILIB - Win32 Release" - -# Begin Custom Build -InputDir=.\tal -InputPath=.\tal\kvi_tal_menubar_qt.h -InputName=kvi_tal_menubar_qt - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "KVILIB - Win32 Debug" - -# Begin Custom Build -InputDir=.\tal -InputPath=.\tal\kvi_tal_menubar_qt.h -InputName=kvi_tal_menubar_qt - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_toolbar.h -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_toolbar_kde.h -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_toolbar_qt.h - -!IF "$(CFG)" == "KVILIB - Win32 Release" - -# Begin Custom Build -InputDir=.\tal -InputPath=.\tal\kvi_tal_toolbar_qt.h -InputName=kvi_tal_toolbar_qt - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "KVILIB - Win32 Debug" - -# Begin Custom Build -InputDir=.\tal -InputPath=.\tal\kvi_tal_toolbar_qt.h -InputName=kvi_tal_toolbar_qt - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_toolbardocktype.h -# End Source File -# Begin Source File - -SOURCE=.\system\kvi_thread.h - -!IF "$(CFG)" == "KVILIB - Win32 Release" - -# Begin Custom Build -InputDir=.\system -InputPath=.\system\kvi_thread.h -InputName=kvi_thread - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "KVILIB - Win32 Debug" - -# Begin Custom Build -InputDir=.\system -InputPath=.\system\kvi_thread.h -InputName=kvi_thread - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\system\kvi_time.h -# End Source File -# Begin Source File - -SOURCE=.\net\kvi_url.h -# End Source File -# Begin Source File - -SOURCE=.\config\kvi_wincfg.h -# End Source File -# Begin Source File - -SOURCE=.\ext\kvi_xlib.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# Begin Group "Generated" - -# PROP Default_Filter ".moc" -# Begin Source File - -SOURCE=.\tal\kvi_tal_application_qt.moc -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_filedialog_qt.moc -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_mainwindow_qt.moc -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_menubar_qt.moc -# End Source File -# Begin Source File - -SOURCE=.\tal\kvi_tal_toolbar_qt.moc -# End Source File -# End Group -# End Target -# End Project diff --git a/3.4.0/src/kvilib/Makefile.am b/3.4.0/src/kvilib/Makefile.am deleted file mode 100644 index 1268e5e043..0000000000 --- a/3.4.0/src/kvilib/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -SUBDIRS = build config core ext file include irc net system tal diff --git a/3.4.0/src/kvilib/build/.svnignore b/3.4.0/src/kvilib/build/.svnignore deleted file mode 100644 index 3293c87c13..0000000000 --- a/3.4.0/src/kvilib/build/.svnignore +++ /dev/null @@ -1,18 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -*.o -*.lo -*.la -*.so -*.lai -libkvilib.la -symlinks diff --git a/3.4.0/src/kvilib/build/Makefile.am b/3.4.0/src/kvilib/build/Makefile.am deleted file mode 100644 index 51e9333ad6..0000000000 --- a/3.4.0/src/kvilib/build/Makefile.am +++ /dev/null @@ -1,339 +0,0 @@ -######################################################################################################################## -# -# KVILIB Makefile : KVIrc utility library -# Szymon Stefanek 21.09.2001 -# -######################################################################################################################## - -AM_CPPFLAGS = -I$(SS_TOPSRCDIR)/src/kvilib/include/ $(SS_INCDIRS) $(SS_CPPFLAGS) - -lib_LTLIBRARIES = libkvilib.la -libkvilib_la_LDFLAGS = $(SS_LDFLAGS) -version-info 3:0:0 $(SS_LIBDIRS) -libkvilib_la_LIBADD = $(SS_LIBLINK) - -# -# Command useful to find out all the sources -# SRC=`find ../ -name *.cpp | sort` -# echo $SRC -# - -nodist_libkvilib_la_SOURCES = \ - ../ext/moc_kvi_crypt.cpp \ - ../ext/moc_kvi_garbage.cpp \ - ../ext/moc_kvi_regusersdb.cpp \ - ../ext/moc_kvi_sharedfiles.cpp \ - ../irc/moc_kvi_ircuserdb.cpp \ - ../net/moc_kvi_dns.cpp \ - ../net/moc_kvi_http.cpp \ - ../system/moc_kvi_locale.cpp \ - ../system/moc_kvi_thread.cpp \ - ../tal/moc_kvi_tal_wizard.cpp - -libkvilib_la_SOURCES = \ - ../core/kvi_error.cpp \ - ../core/kvi_heapobject.cpp \ - ../core/kvi_malloc.cpp \ - ../core/kvi_memmove.cpp \ - ../core/kvi_qstring.cpp \ - ../core/kvi_string.cpp \ - ../core/kvi_stringarray.cpp \ - ../ext/kvi_cmdformatter.cpp \ - ../ext/kvi_config.cpp \ - ../ext/kvi_crypt.cpp \ - ../ext/kvi_databuffer.cpp \ - ../ext/kvi_dcophelper.cpp \ - ../ext/kvi_doublebuffer.cpp \ - ../ext/kvi_garbage.cpp \ - ../ext/kvi_osinfo.cpp \ - ../ext/kvi_imagelib.cpp \ - ../ext/kvi_md5.cpp \ - ../ext/kvi_mediatype.cpp \ - ../ext/kvi_miscutils.cpp \ - ../ext/kvi_msgtype.cpp \ - ../ext/kvi_parameterlist.cpp \ - ../ext/kvi_pixmap.cpp \ - ../ext/kvi_proxydb.cpp \ - ../ext/kvi_regchan.cpp \ - ../ext/kvi_regusersdb.cpp \ - ../ext/kvi_sharedfiles.cpp \ - ../ext/kvi_stringconversion.cpp \ - ../file/kvi_file.cpp \ - ../file/kvi_fileutils.cpp \ - ../file/kvi_packagefile.cpp \ - ../irc/kvi_avatar.cpp \ - ../irc/kvi_avatarcache.cpp \ - ../irc/kvi_ircmask.cpp \ - ../irc/kvi_ircserver.cpp \ - ../irc/kvi_ircserverdb.cpp \ - ../irc/kvi_ircuserdb.cpp \ - ../irc/kvi_mirccntrl.cpp \ - ../irc/kvi_nickserv.cpp \ - ../irc/kvi_useridentity.cpp \ - ../net/kvi_dns.cpp \ - ../net/kvi_http.cpp \ - ../net/kvi_netutils.cpp \ - ../net/kvi_socket.cpp \ - ../net/kvi_ssl.cpp \ - ../net/kvi_url.cpp \ - ../system/kvi_env.cpp \ - ../system/kvi_locale.cpp \ - ../system/kvi_thread.cpp \ - ../system/kvi_time.cpp \ - ../tal/kvi_tal_application.cpp \ - ../tal/kvi_tal_filedialog.cpp \ - ../tal/kvi_tal_grid.cpp \ - ../tal/kvi_tal_groupbox.cpp \ - ../tal/kvi_tal_hbox.cpp \ - ../tal/kvi_tal_iconview.cpp \ - ../tal/kvi_tal_listbox.cpp \ - ../tal/kvi_tal_listview.cpp \ - ../tal/kvi_tal_mainwindow.cpp \ - ../tal/kvi_tal_menubar.cpp \ - ../tal/kvi_tal_popupmenu.cpp \ - ../tal/kvi_tal_scrollview.cpp \ - ../tal/kvi_tal_tabdialog.cpp \ - ../tal/kvi_tal_textedit.cpp \ - ../tal/kvi_tal_toolbar.cpp \ - ../tal/kvi_tal_tooltip.cpp \ - ../tal/kvi_tal_vbox.cpp \ - ../tal/kvi_tal_widgetstack.cpp \ - ../tal/kvi_tal_wizard.cpp - -# -# Command useful to find out all the headers -# rm -f ../include/*.h -# SRC=`find ../ -name *.h | sort` -# echo $SRC -# - - -headers_HEADERS = \ - ../config/kvi_confignames.h \ - ../config/kvi_debug.h \ - ../config/kvi_defaults.h \ - ../config/kvi_fileextensions.h \ - ../config/kvi_settings.h \ - ../config/kvi_sourcesdate.h \ - ../config/kvi_wincfg.h \ - ../core/kvi_bswap.h \ - ../core/kvi_error.h \ - ../core/kvi_heapobject.h \ - ../core/kvi_inttypes.h \ - ../core/kvi_malloc.h \ - ../core/kvi_memmove.h \ - ../core/kvi_pointerlist.h \ - ../core/kvi_pointerhashtable.h \ - ../core/kvi_qcstring.h \ - ../core/kvi_qstring.h \ - ../core/kvi_strasm.h \ - ../core/kvi_string.h \ - ../core/kvi_stringarray.h \ - ../core/kvi_valuelist.h \ - ../ext/kvi_accel.h \ - ../ext/kvi_cmdformatter.h \ - ../ext/kvi_config.h \ - ../ext/kvi_crypt.h \ - ../ext/kvi_databuffer.h \ - ../ext/kvi_doublebuffer.h \ - ../ext/kvi_draganddrop.h \ - ../ext/kvi_osinfo.h \ - ../ext/kvi_garbage.h \ - ../ext/kvi_imagelib.h \ - ../ext/kvi_md5.h \ - ../ext/kvi_mediatype.h \ - ../ext/kvi_miscutils.h \ - ../ext/kvi_msgtype.h \ - ../ext/kvi_parameterlist.h \ - ../ext/kvi_pixmap.h \ - ../ext/kvi_proxydb.h \ - ../ext/kvi_regchan.h \ - ../ext/kvi_regusersdb.h \ - ../ext/kvi_sharedfiles.h \ - ../ext/kvi_stringconversion.h \ - ../ext/kvi_xlib.h \ - ../file/kvi_file.h \ - ../file/kvi_fileutils.h \ - ../file/kvi_packagefile.h \ - ../irc/kvi_avatar.h \ - ../irc/kvi_avatarcache.h \ - ../irc/kvi_ircmask.h \ - ../irc/kvi_ircserverdb.h \ - ../irc/kvi_ircserver.h \ - ../irc/kvi_ircuserdb.h \ - ../irc/kvi_mirccntrl.h \ - ../irc/kvi_nickserv.h \ - ../irc/kvi_useridentity.h \ - ../net/kvi_dns.h \ - ../net/kvi_http.h \ - ../net/kvi_netutils.h \ - ../net/kvi_socket.h \ - ../net/kvi_sockettype.h \ - ../net/kvi_ssl.h \ - ../net/kvi_url.h \ - ../system/kvi_env.h \ - ../system/kvi_library.h \ - ../system/kvi_locale.h \ - ../system/kvi_process.h \ - ../system/kvi_stdarg.h \ - ../system/kvi_thread.h \ - ../system/kvi_time.h \ - ../tal/kvi_tal_application.h \ - ../tal/kvi_tal_application_kde.h \ - ../tal/kvi_tal_application_qt.h \ - ../tal/kvi_tal_filedialog.h \ - ../tal/kvi_tal_filedialog_kde.h \ - ../tal/kvi_tal_filedialog_qt.h \ - ../tal/kvi_tal_filedialog_qt4.h \ - ../tal/kvi_tal_grid.h \ - ../tal/kvi_tal_grid_qt3.h \ - ../tal/kvi_tal_grid_qt4.h \ - ../tal/kvi_tal_groupbox.h \ - ../tal/kvi_tal_groupbox_qt3.h \ - ../tal/kvi_tal_groupbox_qt4.h \ - ../tal/kvi_tal_hbox.h \ - ../tal/kvi_tal_hbox_qt3.h \ - ../tal/kvi_tal_hbox_qt4.h \ - ../tal/kvi_tal_iconview.h \ - ../tal/kvi_tal_iconview_qt3.h \ - ../tal/kvi_tal_iconview_qt4.h \ - ../tal/kvi_tal_listbox.h \ - ../tal/kvi_tal_listbox_qt3.h \ - ../tal/kvi_tal_listbox_qt4.h \ - ../tal/kvi_tal_listview.h \ - ../tal/kvi_tal_listview_qt3.h \ - ../tal/kvi_tal_listview_qt4.h \ - ../tal/kvi_tal_mainwindow.h \ - ../tal/kvi_tal_mainwindow_kde.h \ - ../tal/kvi_tal_mainwindow_qt3.h \ - ../tal/kvi_tal_mainwindow_qt4.h \ - ../tal/kvi_tal_menubar.h \ - ../tal/kvi_tal_menubar_kde.h \ - ../tal/kvi_tal_menubar_qt.h \ - ../tal/kvi_tal_popupmenu.h \ - ../tal/kvi_tal_popupmenu_qt3.h \ - ../tal/kvi_tal_popupmenu_qt4.h \ - ../tal/kvi_tal_scrollview.h \ - ../tal/kvi_tal_scrollview_qt3.h \ - ../tal/kvi_tal_scrollview_qt4.h \ - ../tal/kvi_tal_tabdialog.h \ - ../tal/kvi_tal_tabdialog_qt3.h \ - ../tal/kvi_tal_tabdialog_qt4.h \ - ../tal/kvi_tal_textedit.h \ - ../tal/kvi_tal_textedit_qt3.h \ - ../tal/kvi_tal_textedit_qt4.h \ - ../tal/kvi_tal_toolbar.h \ - ../tal/kvi_tal_toolbar_kde.h \ - ../tal/kvi_tal_toolbar_qt3.h \ - ../tal/kvi_tal_toolbar_qt4.h \ - ../tal/kvi_tal_toolbardocktype.h \ - ../tal/kvi_tal_tooltip.h \ - ../tal/kvi_tal_vbox.h \ - ../tal/kvi_tal_vbox_qt3.h \ - ../tal/kvi_tal_vbox_qt4.h \ - ../tal/kvi_tal_widgetstack.h \ - ../tal/kvi_tal_widgetstack_qt3.h \ - ../tal/kvi_tal_widgetstack_qt4.h \ - ../tal/kvi_tal_wizard.h \ - ../tal/kvi_tal_windowstate.h - - -../ext/moc_%.cpp: ../ext/%.h - $(SS_QT_MOC) $(SS_QT_MOC_FLAGS) $< -o $@ - -../file/moc_%.cpp: ../file/%.h - $(SS_QT_MOC) $(SS_QT_MOC_FLAGS) $< -o $@ - -../irc/moc_%.cpp: ../irc/%.h - $(SS_QT_MOC) $(SS_QT_MOC_FLAGS) $< -o $@ - -../net/moc_%.cpp: ../net/%.h - $(SS_QT_MOC) $(SS_QT_MOC_FLAGS) $< -o $@ - -../system/moc_%.cpp: ../system/%.h - $(SS_QT_MOC) $(SS_QT_MOC_FLAGS) $< -o $@ - -../tal/moc_%.cpp: ../tal/%.h - $(SS_QT_MOC) $(SS_QT_MOC_FLAGS) $< -o $@ - - -%.moc: %.h - $(SS_QT_MOC) $(SS_QT_MOC_FLAGS) $< -o $@ - -#%.h.gch: %.h -# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c $< -o $@ - -#PRECOMPILED_HDRS = \ -# ../config/kvi_confignames.h.gch \ -# ... - -# -# Command useful to find the moc dependancies -# grep "\.moc" ../*/*.cpp | sort | sed -e 's/[[:space:]]*#include//' | sed -e 's/\"//g' -# needs to be modified by hand then to add the moc file path... :) -# - -../tal/kvi_tal_application.cpp: ../tal/kvi_tal_application_kde.moc -../tal/kvi_tal_application.cpp: ../tal/kvi_tal_application_qt.moc -../tal/kvi_tal_mainwindow.cpp: ../tal/kvi_tal_mainwindow_kde.moc -../tal/kvi_tal_mainwindow.cpp: ../tal/kvi_tal_mainwindow_qt3.moc -../tal/kvi_tal_mainwindow.cpp: ../tal/kvi_tal_mainwindow_qt4.moc -../tal/kvi_tal_menubar.cpp: ../tal/kvi_tal_menubar_kde.moc -../tal/kvi_tal_menubar.cpp: ../tal/kvi_tal_menubar_qt.moc -../tal/kvi_tal_filedialog.cpp: ../tal/kvi_tal_filedialog_kde.moc -../tal/kvi_tal_filedialog.cpp: ../tal/kvi_tal_filedialog_qt.moc -../tal/kvi_tal_filedialog.cpp: ../tal/kvi_tal_filedialog_qt4.moc -../tal/kvi_tal_grid.cpp: ../tal/kvi_tal_grid_qt3.moc -../tal/kvi_tal_grid.cpp: ../tal/kvi_tal_grid_qt4.moc -../tal/kvi_tal_groupbox.cpp: ../tal/kvi_tal_groupbox_qt3.moc -../tal/kvi_tal_groupbox.cpp: ../tal/kvi_tal_groupbox_qt4.moc -../tal/kvi_tal_hbox.cpp: ../tal/kvi_tal_hbox_qt3.moc -../tal/kvi_tal_hbox.cpp: ../tal/kvi_tal_hbox_qt4.moc -../tal/kvi_tal_vbox.cpp: ../tal/kvi_tal_vbox_qt3.moc -../tal/kvi_tal_vbox.cpp: ../tal/kvi_tal_vbox_qt4.moc -../tal/kvi_tal_popupmenu.cpp: ../tal/kvi_tal_popupmenu_qt3.moc -../tal/kvi_tal_popupmenu.cpp: ../tal/kvi_tal_popupmenu_qt4.moc -../tal/kvi_tal_listview.cpp: ../tal/kvi_tal_listview_qt3.moc -../tal/kvi_tal_listview.cpp: ../tal/kvi_tal_listview_qt4.moc -../tal/kvi_tal_listbox.cpp: ../tal/kvi_tal_listbox_qt3.moc -../tal/kvi_tal_listbox.cpp: ../tal/kvi_tal_listbox_qt4.moc -../tal/kvi_tal_iconview.cpp: ../tal/kvi_tal_iconview_qt3.moc -../tal/kvi_tal_iconview.cpp: ../tal/kvi_tal_iconview_qt4.moc -../tal/kvi_tal_scrollview.cpp: ../tal/kvi_tal_scrollview_qt3.moc -../tal/kvi_tal_scrollview.cpp: ../tal/kvi_tal_scrollview_qt4.moc -../tal/kvi_tal_tabdialog.cpp: ../tal/kvi_tal_tabdialog_qt3.moc -../tal/kvi_tal_tabdialog.cpp: ../tal/kvi_tal_tabdialog_qt4.moc -../tal/kvi_tal_textedit.cpp: ../tal/kvi_tal_textedit_qt3.moc -../tal/kvi_tal_textedit.cpp: ../tal/kvi_tal_textedit_qt4.moc -../tal/kvi_tal_toolbar.cpp: ../tal/kvi_tal_toolbar_qt3.moc -../tal/kvi_tal_toolbar.cpp: ../tal/kvi_tal_toolbar_qt4.moc -../tal/kvi_tal_toolbar.cpp: ../tal/kvi_tal_toolbar_kde.moc -../tal/kvi_tal_tooltip.cpp: ../tal/kvi_tal_tooltip.moc -../tal/kvi_tal_widgetstack.cpp: ../tal/kvi_tal_widgetstack_qt3.moc -../tal/kvi_tal_widgetstack.cpp: ../tal/kvi_tal_widgetstack_qt4.moc - -# -# All the cpp files depend on the precompiled headers being up-to-date -# - -#../*/*.cpp: symlinks $(PRECOMPILED_HDRS) gchsymlinks - -../*/*.cpp: symlinks - -# -# Symlinks depend on all the header files: symlink is rebuilt whenewer an *.h file changes -# - -symlinks: ../config/*.h ../core/*.h ../ext/*.h ../file/*.h ../irc/*.h ../net/*.h ../system/*.h ../tal/*.h - cd ../include; for i in kvi_*.h; do if [ ! -f $$i ]; then rm -f $$i; fi; done; for i in $(SS_TOPSRCDIR)/src/kvilib/*/kvi_*.h; do $(LN_S) $$i . >/dev/null 2>&1; echo "Created link to $$i"; done; - touch symlinks - -# gchsymlinks: ../config/*.h ../core/*.h ../ext/*.h ../file/*.h ../irc/*.h ../net/*.h ../system/*.h ../tal/*.h -# cd ../include; for i in kvi_*.gch; do if [ ! -f $$i ]; then rm -f $$i; fi; done; for i in $(SS_TOPSRCDIR)/src/kvilib/*/kvi_*.h.gch; do $(LN_S) $$i . >/dev/null 2>&1; echo "Created link to $$i"; done; -# touch gchsymlinks - -# -# When cleaning...remove also the symlinks, gchsymlinks and gch headers -# - -#CLEANFILES = ../include/*.h ../include/*.gch symlinks gchsymlinks ../*/*.moc ../*/moc_kvi_*.cpp ../*/*.gch -CLEANFILES = ../include/*.h symlinks ../*/*.moc ../*/moc_kvi_*.cpp diff --git a/3.4.0/src/kvilib/config/.svnignore b/3.4.0/src/kvilib/config/.svnignore deleted file mode 100644 index 1612c03b91..0000000000 --- a/3.4.0/src/kvilib/config/.svnignore +++ /dev/null @@ -1,20 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -*.o -*.lo -*.la -*.so -*.lai -kvirc -symlinks -moc_*.cpp - diff --git a/3.4.0/src/kvilib/config/Makefile.am b/3.4.0/src/kvilib/config/Makefile.am deleted file mode 100644 index 23078cbb0d..0000000000 --- a/3.4.0/src/kvilib/config/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -EXTRA_DIST = *.h diff --git a/3.4.0/src/kvilib/config/kvi_confignames.h b/3.4.0/src/kvilib/config/kvi_confignames.h deleted file mode 100644 index 05f6e79fbb..0000000000 --- a/3.4.0/src/kvilib/config/kvi_confignames.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef _KVI_CONFIGNAMES_H_ -#define _KVI_CONFIGNAMES_H_ - -//============================================================================= -// -// File : kvi_confignames.h -// Creation date : Wed Oct 18 2000 14:16:22 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_fileextensions.h" - -//============================================================================= -// This file contains the config file names used in KVIrc -// -// You can play a bit with these, but be aware that some (bad) scripts -// may find themselves in trouble -//============================================================================= - -#define KVI_CONFIGFILE_MAIN "main." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_WINPROPERTIES "winproperties." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_SERVERDB "serverdb." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_PROXYDB "proxydb." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_EVENTS "events." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_RAWEVENTS "rawevents." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_POPUPS "popups." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_SCRIPTTOOLBARS "toolbars." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_CUSTOMTOOLBARS "customtoolbars." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_MEDIATYPES "mediatypes." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_REGUSERDB "reguserdb." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_SHAREDFILES "sharedfiles." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_RECENT "recent." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_TOOLBARS "toolbarpos." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_ALIASES "aliases." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_NICKSERVDATABASE "nickserv." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_TEXTICONS "texticons." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_REGCHANDB "regchan." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_INPUTHISTORY "inputhistory." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_AVATARCACHE "avatarcache." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_USERACTIONS "useractions." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_SCRIPTADDONS "scriptaddons." KVI_FILEEXTENSION_CONFIG -#define KVI_CONFIGFILE_IDENTITIES "identities." KVI_FILEEXTENSION_CONFIG - -#endif //_KVI_CONFIGNAMES_H_ diff --git a/3.4.0/src/kvilib/config/kvi_debug.h b/3.4.0/src/kvilib/config/kvi_debug.h deleted file mode 100644 index 20a3c4d197..0000000000 --- a/3.4.0/src/kvilib/config/kvi_debug.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef _KVI_DEBUG_H_ -#define _KVI_DEBUG_H_ - -//============================================================================= -// -// File : kvi_debug.h -// Creation date : Fri Mar 19 1999 03:10:39 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <qglobal.h> - -//============================================================================= -// This file contains the definition of the debug macros -// You can enable ALL the debugging output by uncommenting the next line -// -// #define _KVI_DEBUG_CHECK_RANGE_ -// -//============================================================================= - -#ifdef _KVI_DEBUG_CHECK_RANGE_ - #define __range_valid(_expr) if(!(_expr))debug("[kvirc]: ASSERT FAILED: \"%s\" is false in %s (%d)",#_expr,__FILE__,__LINE__) - #define __range_invalid(_expr) if(_expr)debug("[kvirc]: ASSERT FAILED: \"%s\" is true in %s (%d)",#_expr,__FILE__,__LINE__) -#else - #define __range_valid(_expr) - #define __range_invalid(_expr) -#endif - -#if defined(_KVI_DEBUG_) || defined(__KVI_DEBUG__) - #define __ASSERT(_expr) if(!(_expr))debug("[kvirc]: ASSERT FAILED: \"%s\" is false in %s (%d)",#_expr,__FILE__,__LINE__) -#else - #define __ASSERT(_expr) -#endif - -#endif //_KVI_DEBUG_H_ diff --git a/3.4.0/src/kvilib/config/kvi_defaults.h b/3.4.0/src/kvilib/config/kvi_defaults.h deleted file mode 100644 index 0072643820..0000000000 --- a/3.4.0/src/kvilib/config/kvi_defaults.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef _KVI_DEFAULTS_H_ -#define _KVI_DEFAULTS_H_ - -//============================================================================= -// -// File : kvi_defaults.h -// Creation date : Wed Jun 21 2000 13:23:13 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - -//============================================================================= -// This file contains (more or less) freely customizable compile time defaults -// -// You can safely play with the ones you understand the meaning of -//============================================================================= - -#include "kvi_settings.h" - -#ifdef COMPILE_ON_WINDOWS - #define KVI_HOME_CONFIG_FILE_NAME "kvirc.ini" -#else - #define KVI_HOME_CONFIG_FILE_NAME ".kvirc.rc" -#endif - - -#define KVI_DEFAULT_INCOMING_SUBDIRECTORY_NAME "download" - -#define KVI_DEFAULT_NICKNAME1 "newbie" -#define KVI_DEFAULT_NICKNAME2 "[newbie]" -#define KVI_DEFAULT_NICKNAME3 "_newbie_" -#define KVI_DEFAULT_NICKNAME4 "newbie4" -#define KVI_DEFAULT_USERNAME "kvirc" -#define KVI_DEFAULT_REALNAME "KVIrc " VERSION " '" KVI_RELEASE_NAME "' http://kvirc.net/" - -#define KVI_DEFAULT_PART_MESSAGE "No matter how dark the night, somehow the Sun rises once again" -#define KVI_DEFAULT_QUIT_MESSAGE "KVIrc $version $version(r) http://www.kvirc.net/" -#define KVI_DEFAULT_CTCP_USERINFO_REPLY "I'm too lazy to edit this field." -#define KVI_DEFAULT_CTCP_PAGE_REPLY "Your message has been received and logged" -#define KVI_DEFAULT_AWAY_MESSAGE "I'm off to see the wizard." -#define KVI_DEFAULT_AWAY_NICK "%nick%|NotHere" - -#define KVI_MAX_PENDING_AVATARS 20 -#define KVI_MAX_RECENT_SERVERS 10 -#define KVI_MAX_RECENT_CHANNELS 30 -#define KVI_MAX_RECENT_NICKNAMES 10 -#define KVI_RECENT_TOPIC_ENTRIES 20 - -#endif //_KVI_DEFAULTS_H_ diff --git a/3.4.0/src/kvilib/config/kvi_fileextensions.h b/3.4.0/src/kvilib/config/kvi_fileextensions.h deleted file mode 100644 index 7036e6d8d4..0000000000 --- a/3.4.0/src/kvilib/config/kvi_fileextensions.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _KVI_FILEEXTENSIONS_H_ -#define _KVI_FILEEXTENSIONS_H_ - -//============================================================================= -// -// File : kvi_fileextensions.h -// Creation date : Tue Dec 26 2006 05:09:22 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - -//============================================================================= -// This file contains the file extensions used by KVIrc -//============================================================================= - -#define KVI_FILEEXTENSION_CONFIG "kvc" -#define KVI_FILEEXTENSION_SCRIPT "kvs" -#define KVI_FILEEXTENSION_THEMEPACKAGE "kvt" -#define KVI_FILEEXTENSION_ADDONPACKAGE "kva" - -#endif //_KVI_FILEEXTENSIONS_H_ diff --git a/3.4.0/src/kvilib/config/kvi_settings.h b/3.4.0/src/kvilib/config/kvi_settings.h deleted file mode 100644 index 2639241250..0000000000 --- a/3.4.0/src/kvilib/config/kvi_settings.h +++ /dev/null @@ -1,140 +0,0 @@ -#ifndef _KVI_SETTINGS_H_ -#define _KVI_SETTINGS_H_ - -//============================================================================= -// -// File : kvi_settings.h -// Creation date : Fri Mar 19 1999 05:21:13 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - -//============================================================================= -// This file contains compile time settings, either set by configure or -// non-customizable defaults -// -// Better do not touch this -//============================================================================= - -#include <qglobal.h> - -#if defined(_OS_WIN32_) || defined(Q_OS_WIN32) || defined(Q_OS_WIN32_) - - #define FEEL_LIKE_I_AM_COMPILING_UNDER_WINDOZE - #define COMPILE_ON_WINDOWS - - // Windows has no config.h - - #include "kvi_wincfg.h" - - #ifdef __KVILIB__ - #define KVILIB_API __declspec(dllexport) - #else - #define KVILIB_API __declspec(dllimport) - #endif - - #ifdef __KVIRC__ - #define KVIRC_API __declspec(dllexport) - #else - #define KVIRC_API __declspec(dllimport) - #endif - -#else - - #ifdef KVIRC_EXTERNAL_MODULE - // when compiling an external module - // include the last configuration - #include "kvi_configstatus.h" - #else - #ifdef HAVE_CONFIG_H - #include "config.h" - #else - #error "You're missing the config.h file: you must run configure before running make!" - #endif - #endif - - #define KVILIB_API - #define KVIRC_API - - #ifndef VERSION - #define VERSION "?.?.?" - #endif - - #ifndef BUILD_DATE - #define BUILD_DATE "?" - #endif - - #ifndef BUILD_FLAGS - #define BUILD_FLAGS "?" - #endif - -#endif - -#define KVI_VERSION VERSION -#define KVI_VERSION_BRANCH VERSION_BRANCH -#define KVI_BUILD_DATE BUILD_DATE -#define KVI_BUILD_FLAGS BUILD_FLAGS - -#define KVI_RELEASE_NAME "Virgo" - -// We want _GNU_SOURCE features -#ifndef _GNU_SOURCE - #define _GNU_SOURCE -#endif - - -#if defined(__GNUC__) - // gcc - #if __GNUC__ >= 3 - #define KVI_PTR2MEMBER(__x) &__x - #else - #define KVI_PTR2MEMBER(__x) &(__x) - #endif -#elif defined(COMPILE_ON_WINDOWS) - // Visual C++ - #define KVI_PTR2MEMBER(__x) &__x -#elif defined(__SUNPRO_CC) - // Sun Forte - #define KVI_PTR2MEMBER(__x) (__x) -#else - // default - #define KVI_PTR2MEMBER(__x) &(__x) -#endif - -#ifdef COMPILE_NO_X - #ifndef COMPILE_NO_X_BELL - #define COMPILE_NO_X_BELL - #endif -#endif - -/* -#if __GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2) - #define KVI_DEPRECATED __attribute__ ((deprecated)) -#else - #define KVI_DEPRECATED -#endif -*/ -#define KVI_DEPRECATED - -#ifdef COMPILE_USE_QT4 - #define debug qDebug -#endif - - -#endif //_KVI_SETTINGS_H_ diff --git a/3.4.0/src/kvilib/config/kvi_sourcesdate.h b/3.4.0/src/kvilib/config/kvi_sourcesdate.h deleted file mode 100644 index 67f58e0f39..0000000000 --- a/3.4.0/src/kvilib/config/kvi_sourcesdate.h +++ /dev/null @@ -1,40 +0,0 @@ - -#ifndef _KVI_SOURCESDATE_H_ -#define _KVI_SOURCESDATE_H_ - -//============================================================================= -// -// File : kvi_sourcesdate.h -// Creation date : Sun Mar 5 2006 23:22:22 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#define KVI_SOURCES_DATE "20080323" -#define KVI_SOURCES_DATE_NUMERIC 0x20080323 - -// this is the date of the sources before that we should force a setup -// this is usually changed only when a setup is really needed because -// of an incompatible change in the configuration files -// .. so do NOT change it just when you change KVI_SOURCES_DATE_NUMERIC :) -#define KVI_SOURCES_DATE_NUMERIC_FORCE_SETUP 0x20080101 - -#endif //!_KVI_SOURCESDATE_H_ diff --git a/3.4.0/src/kvilib/config/kvi_version.h b/3.4.0/src/kvilib/config/kvi_version.h deleted file mode 100644 index b4c4aafc8f..0000000000 --- a/3.4.0/src/kvilib/config/kvi_version.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef _KVI_VERSION_H_ -#define _KVI_VERSION_H_ - -//============================================================================= -// -// File : kvi_version.h -// Creation date : Sun Mar 5 2006 23:22:22 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - - - -#endif //!_KVI_VERSION_H_ - diff --git a/3.4.0/src/kvilib/config/kvi_wincfg.h b/3.4.0/src/kvilib/config/kvi_wincfg.h deleted file mode 100644 index f0b84a3af7..0000000000 --- a/3.4.0/src/kvilib/config/kvi_wincfg.h +++ /dev/null @@ -1,210 +0,0 @@ -#ifndef _KVI_WINCFG_H_ -#define _KVI_WINCFG_H_ - -//============================================================================= -// -// File : kvi_wincfg.h -// Creation date : Fri Sep 21 16:21:09 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - -//============================================================================= -// Windows configuration: do not touch -//============================================================================= - -/* define if you want to compile with new parser */ -#define COMPILE_NEW_KVS 1 - -/* define if you want to use the Qt 4.x support */ -/* #undef COMPILE_USE_QT4 */ - -#define COMPILE_USE_QT4 - -/* define if you want to use only the new KVS parser */ -#define COMPILE_ONLY_NEW_KVS 1 - -/* define if you want to disable DCC VOICE sound support */ -/* #undef COMPILE_WITH_NO_SOUND */ - -/* define if you have libgsm and want the GSM code to be compiled */ -/* #undef COMPILE_USE_GSM */ - -/* define if you want the info tips to be compiled in */ -#define COMPILE_INFO_TIPS 1 - -/* define if you want to compile the KDE 2.x support */ -/* #undef COMPILE_KDE_SUPPORT */ - -/* define if you want the gcc memory profile */ -/* #undef COMPILE_MEMORY_PROFILE */ - -/* define if you want the memory checks */ -/* #undef COMPILE_MEMORY_CHECKS */ - -/* define if you trust your memmove() function */ -#define COMPILE_WITH_SYSTEM_MEMMOVE 1 - -/* define if you want to compile the crypt support */ -#define COMPILE_CRYPT_SUPPORT 1 - -/* define if you want the i386 asm code */ -/* #undef COMPILE_ix86_ASM */ - -/* define if your compiler supports gotos do dynamic labels */ -/* #undef COMPILE_USE_DYNAMIC_LABELS */ - -/* define if you want to compile the localization support */ -#define COMPILE_LOCALE_STUFF 1 - -/* define if you want the IpV6 support */ -#define COMPILE_IPV6_SUPPORT 1 - -/* define if you want zlib support */ -#define COMPILE_ZLIB_SUPPORT 1 - -/* define if you want to use the pthreads library */ -/* #undef COMPILE_THREADS_USE_POSIX */ - -/* define if you want to use the solaris libthread */ -/* #undef COMPILE_THREADS_USE_SOLARIS_LIBTHREAD */ - -#define COMPILE_PSEUDO_TRANSPARENCY - -/* define if you have the SIOCGIFADDR ioctl and the related headers */ -/* #undef COMPILE_GET_INTERFACE_ADDRESS */ - -/* this is the build date (configure date rather) */ -#define BUILD_DATE __DATE__" "__TIME__ - -/* these are the build flags */ -#define BUILD_FLAGS "win32" - -/* define if you have strings.h */ -/* #undef HAVE_STRINGS_H */ - -/* define if you have the getenv function */ -/* #undef HAVE_GETENV */ - -/* define if you have the strerror function */ -#define HAVE_STRERROR 1 - -/* define if you have the inet_aton function */ -/* #define HAVE_INET_ATON 1 */ - -/* define if you have the inet_ntoa function */ -/* #define HAVE_INET_NTOA 1 */ - -/* define if you have the inet_pton function */ -/* #undef HAVE_INET_PTON */ - -/* define if you have the inet_ntop function */ -/* #undef HAVE_INET_NTOP */ - -/* define if you have the getnameinfo function */ -#define HAVE_GETNAMEINFO - -/* define if you have the getaddrinfo function */ -#define HAVE_GETADDRINFO - -/* define this to the number of average channel users */ -#define AVERAGE_CHANNEL_USERS 101 - -/* define this if you want to ignore the SIGALARM signal */ -/* #undef COMPILE_IGNORE_SIGALARM */ - -/* define this if you are on a big endian machine */ -/* #undef BIG_ENDIAN_MACHINE_BYTE_ORDER */ - -/* define this if you want to use the unicode-local 8bit charset translation */ -/* #undef COMPILE_USE_LOCAL_8BIT */ - -/* define this if you want to disable the inter-process communication support */ -/* #undef COMPILE_NO_IPC */ - -/* Define if you have the `getenv' function. */ -/* #undef HAVE_GETENV */ - -/* Define if you have the <linux/soundcard.h> header file. */ -/* #undef HAVE_LINUX_SOUNDCARD_H */ - -/* Define if you have the <soundcard.h> header file. */ -/* #undef HAVE_SOUNDCARD_H */ - -/* Define if you have the <sys/soundcard.h> header file. */ -/* #undef HAVE_SYS_SOUNDCARD_H */ - -/* Name of package */ -#define PACKAGE "kvirc" - -/* Version number of package */ -#define VERSION "3.4.0" - -#define VERSION_BRANCH "3.4" - - -/* Define if the system does not provide POSIX.1 features except with this - defined. */ -/* #undef _POSIX_1_SOURCE */ - -/* Define if you need to in order for `stat' and other things to work. */ -/* #undef _POSIX_SOURCE */ - -// for now we need this....dcc voice is not ported yet -#define COMPILE_WITH_NO_SOUND - -#define COMPILE_DISABLE_DCC_VOICE - -/* No X support */ -#define COMPILE_NO_X - -/* No X bell! */ -#define COMPILE_NO_X_BELL - -/* define if you have openssl and want the ssl support in kvirc */ -#define COMPILE_SSL_SUPPORT - -/* define if you want perl scripting support */ -#define COMPILE_PERL_SUPPORT - -/* The size of a `int', as computed by sizeof. */ -#define SIZEOF_INT 4 - -/* The size of a `long int', as computed by sizeof. */ -#define SIZEOF_LONG_INT 4 - -/* The size of a `long long int', as computed by sizeof. */ -#define SIZEOF_LONG_LONG_INT 8 - -/* The size of a `short int', as computed by sizeof. */ -#define SIZEOF_SHORT_INT 2 - -/* The size of a `unsigned int', as computed by sizeof. */ -#define SIZEOF_UNSIGNED_INT 4 - -/* The size of a `unsigned long int', as computed by sizeof. */ -#define SIZEOF_UNSIGNED_LONG_INT 4 - -/* The size of a `unsigned long long int', as computed by sizeof. */ -#define SIZEOF_UNSIGNED_LONG_LONG_INT 8 - -/* The size of a `unsigned short int', as computed by sizeof. */ -#define SIZEOF_UNSIGNED_SHORT_INT 2 - -#endif //_KVI_WINCFG_H_ diff --git a/3.4.0/src/kvilib/core/.svnignore b/3.4.0/src/kvilib/core/.svnignore deleted file mode 100644 index 1612c03b91..0000000000 --- a/3.4.0/src/kvilib/core/.svnignore +++ /dev/null @@ -1,20 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -*.o -*.lo -*.la -*.so -*.lai -kvirc -symlinks -moc_*.cpp - diff --git a/3.4.0/src/kvilib/core/Makefile.am b/3.4.0/src/kvilib/core/Makefile.am deleted file mode 100644 index c84487eb66..0000000000 --- a/3.4.0/src/kvilib/core/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -EXTRA_DIST = *.cpp *.h diff --git a/3.4.0/src/kvilib/core/kvi_bswap.h b/3.4.0/src/kvilib/core/kvi_bswap.h deleted file mode 100644 index 6da000f2ac..0000000000 --- a/3.4.0/src/kvilib/core/kvi_bswap.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef _KVI_BSWAP_H_ -#define _KVI_BSWAP_H_ - -//============================================================================= -// -// File : kvi_bswap.h -// Creation date : Fri Mar 19 1999 03:15:21 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_inttypes.h" - - -// KVILIB_API has been removed from therse two functions -// these should always go inlined - -inline kvi_u64_t kvi_swap64(kvi_u64_t i) -{ - // abcdefgh to hgfedcba - return ((i << 56) | /* h to a */ - ((i & 0xff00) << 40) | /* g to b */ - ((i & 0xff0000) << 24) | /* f to c */ - ((i & 0xff000000) << 8) | /* e to d */ - ((i >> 8) & 0xff000000) | /* d to e */ - ((i >> 24) & 0xff0000) | /* c to f */ - ((i >> 40) & 0xff00) | /* b to g */ - (i >> 56)); /* a to h */ -} - -inline kvi_u32_t kvi_swap32(kvi_u32_t i) -{ - // abcd to dcba - return ((i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24)); -} - -inline kvi_u16_t kvi_swap16(kvi_u16_t i) -{ - // ab to ba - return ((i << 8) | (i >> 8)); -} - - - - -#endif // !_KVI_BSWAP_H_ diff --git a/3.4.0/src/kvilib/core/kvi_error.cpp b/3.4.0/src/kvilib/core/kvi_error.cpp deleted file mode 100644 index 0c3e461949..0000000000 --- a/3.4.0/src/kvilib/core/kvi_error.cpp +++ /dev/null @@ -1,237 +0,0 @@ -//============================================================================= -// -// File : kvi_error.cpp -// Creation date : Sun Jul 02 2000 18:37:02 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - -#define _KVI_ERROR_CPP_ - -#include "kvi_locale.h" -#include "kvi_error.h" -#include "kvi_settings.h" - - -#ifdef COMPILE_ON_WINDOWS -#include <winsock2.h> // for the WSAE* error codes -#endif - -#include <errno.h> - -#ifdef HAVE_STRERROR -#include <string.h> // for strerror() -#endif - -// FIXME: This stuff should basically die and be eventually replaced with some -// helper functions for handling ONLY system errors. -// -// WARNING: getDescription() is not even thread safe... it will die in the near future - -const char * g_errorTable[KVI_NUM_ERRORS]= -{ - __tr_no_lookup("Success"), // 000: success - __tr_no_lookup("Unknown error"), // 001: unkonwnError - __tr_no_lookup("Internal error"), // 002: internalError - __tr_no_lookup("Unknown command"), // 003: unknownCommand - __tr_no_lookup("Missing closing brace"), // 004: missingClosingBrace - __tr_no_lookup("Unexpected end of command in string"), // 005: unexpectedEndInString - __tr_no_lookup("Unexpected end of command in dictionary key"), // 006: unexpectedEndInDictionaryKey - __tr_no_lookup("Switch dash without switch letter"), // 007: switchDashWithoutSwitchLetter - __tr_no_lookup("Unknown function"), // 008: unknownFunction - __tr_no_lookup("Unexpected end of command in parenthesis"), // 009: unexpectedEndInParenthesis - __tr_no_lookup("Unexpected end of command in function parameters"), // 010: unexpectedEndInFunctionParams - __tr_no_lookup("Missing variable name"), // 011: missingVariableName - __tr_no_lookup("Variable or identifier expected"), // 012: variableOrIdentifierExpected - __tr_no_lookup("Left operand is not a number"), // 013: leftOperandIsNotANumber - __tr_no_lookup("Multiple operations not supported for numeric operators"), // 014: multipleOpsNotSupportedForOperator - __tr_no_lookup("Division by zero"), // 015: divisionByZero - __tr_no_lookup("Modulo by zero"), // 016: moduloByZero - __tr_no_lookup("Right operand is not a number"), // 017: rightOperandIsNotANumber - __tr_no_lookup("Unterminated expression (missing ')' ?)"), // 018: unterminatedExpression - __tr_no_lookup("Unterminated subexpression (Parenthesis mismatch)"), // 019: unterminatedSubexpression - __tr_no_lookup("Unexpected character"), // 020: unexpectedCharacter - __tr_no_lookup("Unknown operator"), // 021: unknownOperator - __tr_no_lookup("No host to resolve"), // 022 - __tr_no_lookup("(DNS Internal) Unsupported address family"), // 023 - __tr_no_lookup("Valid name but the host has no IP address"), // 024 - __tr_no_lookup("Unrecoverable nameserver error (crashed ?)"), // 025 - __tr_no_lookup("Dns temporaneous fault (try again)"), // 026 - __tr_no_lookup("(DNS Internal) Bad flags"), // 027 - __tr_no_lookup("(DNS Internal) Out of memory"), // 028 - __tr_no_lookup("(DNS Internal) Service not supported"), // 029 - __tr_no_lookup("Unknown node (host not found)"), // 030 - __tr_no_lookup("(DNS Internal) Unsupported socket type"), // 031 - __tr_no_lookup("Dns query failed"), // 032 - __tr_no_lookup("This KVIrc executable has no IPV6 support"), // 033 - __tr_no_lookup("Host not found"), // 034 - __tr_no_lookup("(DNS Internal) IPC failure (slave data corrupted)"), // 035 - __tr_no_lookup("Another connection in progress"), // 036 - __tr_no_lookup("Invalid IP address"), // 037 - __tr_no_lookup("Socket creation failed"), // 038 - __tr_no_lookup("Failed to put the socket in non blocking mode"), // 039 - __tr_no_lookup("Bad file descriptor"), // 040 - __tr_no_lookup("Out of address space"), // 041 - __tr_no_lookup("Connection refused"), // 042 - __tr_no_lookup("Kernel networking panic"), // 043 - __tr_no_lookup("Connection timed out"), // 044 - __tr_no_lookup("Network is unreachable"), // 045 - __tr_no_lookup("Broken pipe"), // 046 - __tr_no_lookup("Invalid proxy address"), // 047 - __tr_no_lookup("Remote end has closed the connection"), // 048 - __tr_no_lookup("Invalid irc context id"), // 049 - __tr_no_lookup("Error in loading module"), // 050 - __tr_no_lookup("No such module command"), // 051 - __tr_no_lookup("No such module function"), // 052 - __tr_no_lookup("Left operand is not a dictionary reference"), // 053 - __tr_no_lookup("Right operand is not a dictionary reference"), // 054 - __tr_no_lookup("Missing object class name"), // 055 - __tr_no_lookup("No such object class"), // 056 - __tr_no_lookup("No such object"), // 057 - __tr_no_lookup("No such object function"), // 058 - __tr_no_lookup("Invalid left operand"), // 059 - __tr_no_lookup("Not enough parameters"), // 060 - __tr_no_lookup("Integer parameter expected"), // 061 - __tr_no_lookup("Invalid parameter"), // 062 - __tr_no_lookup("No such file"), // 063 - __tr_no_lookup("Open parenthesis expected"), // 064 - __tr_no_lookup("Open brace expected"), // 065 - __tr_no_lookup("Can't kill a builtin class"), // 066 - __tr_no_lookup("The SOCKSV4 protocol lacks IpV6 support"), // 067 - __tr_no_lookup("Unrecognized proxy reply"), // 068 - __tr_no_lookup("Proxy response: auth failed: access denied"), - __tr_no_lookup("Proxy response: No acceptable auth method: request rejected"), - __tr_no_lookup("Proxy response: request failed"), - __tr_no_lookup("Proxy response: ident failed"), - __tr_no_lookup("Proxy response: ident not matching"), - __tr_no_lookup("Proxy response: general SOCKS failure"), - __tr_no_lookup("Proxy response: connection not allowed"), - __tr_no_lookup("Proxy response: network unreachable"), - __tr_no_lookup("Proxy response: host unreachable"), - __tr_no_lookup("Proxy response: connection refused"), - __tr_no_lookup("Proxy response: TTL expired"), - __tr_no_lookup("Proxy response: command not supported"), - __tr_no_lookup("Proxy response: address type not supported"), - __tr_no_lookup("Proxy response: invalid address"), - __tr_no_lookup("Invalid port number"), - __tr_no_lookup("Socket not connected"), - __tr_no_lookup("Insufficient resources to complete the operation"), - __tr_no_lookup("Can't setup a listening socket : bind failed"), - __tr_no_lookup("Can't resolve the localhost name"), - __tr_no_lookup("Unsupported image format"), - __tr_no_lookup("Can't open file for appending"), - __tr_no_lookup("Can't open file for writing"), - __tr_no_lookup("File I/O error"), - __tr_no_lookup("Acknowledge error"), - __tr_no_lookup("Can't open file for reading"), - __tr_no_lookup("Can't send a zero-size file"), - __tr_no_lookup("Missing popup name"), - __tr_no_lookup("'item', 'popup', 'label' or 'separator' keyword expected"), - __tr_no_lookup("Self modification not allowed"), - __tr_no_lookup("UNUSED"), - __tr_no_lookup("Feature not available"), - __tr_no_lookup("Unexpected characters in array index"), - __tr_no_lookup("Unexpected end in expression"), - __tr_no_lookup("Unexpected end in array index"), - __tr_no_lookup("Connection thru HTTP proxy failed"), - __tr_no_lookup("Case , match , regexp , default or break keyword expected"), - __tr_no_lookup("Access denied"), - __tr_no_lookup("Address already in use"), - __tr_no_lookup("Can't assign the requested address"), - __tr_no_lookup("Connection reset by peer"), - __tr_no_lookup("Host unreachable (no route to host)"), - __tr_no_lookup("Variable expected"), - __tr_no_lookup("Invalid array index: positive integer expected"), - __tr_no_lookup("listen() call failed"), - __tr_no_lookup("This executable has been compiled without SSL support"), - __tr_no_lookup("Secure Socket Layer error"), - __tr_no_lookup("Slash (/) character expected"), - __tr_no_lookup("Unknown string manipulation operation"), - __tr_no_lookup("Operation aborted"), - __tr_no_lookup("Unexpected token"), - __tr_no_lookup("Scope object already defined (unexpected @)"), - __tr_no_lookup("There is no $this pointer in this scope (unexpected @)") -}; - -namespace KviError -{ - const char * getUntranslatedDescription(int iErrorCode) - { - if((iErrorCode < KVI_NUM_ERRORS) && (iErrorCode >= 0)) - return g_errorTable[iErrorCode]; -#ifdef HAVE_STRERROR - if(iErrorCode < 0)return strerror(-iErrorCode); -#endif - return g_errorTable[KviError_unknownError]; - } - - QString getDescription(int iErrorCode) - { - return __tr2qs_no_xgettext(getUntranslatedDescription(iErrorCode)); - } - - int translateSystemError(int iErrNo) - { -#ifdef COMPILE_ON_WINDOWS - switch(iErrNo) - { - case EBADF: return KviError_badFileDescriptor; break; - case WSAEINVAL: - case WSAEFAULT: - case EFAULT: return KviError_outOfAddressSpace; break; - case WSAECONNREFUSED: return KviError_connectionRefused; break; - case WSAENOTSOCK: return KviError_kernelNetworkingPanic; break; - case WSAETIMEDOUT: return KviError_connectionTimedOut; break; - case WSAENETUNREACH: return KviError_networkUnreachable; break; - case EPIPE: return KviError_brokenPipe; break; - case WSAENOTCONN: return KviError_socketNotConnected; break; - - case WSAEACCES: return KviError_accessDenied; break; - case WSAEADDRINUSE: return KviError_addressAlreadyInUse; break; - case WSAEADDRNOTAVAIL: return KviError_cantAssignRequestedAddress; break; - case WSAEAFNOSUPPORT: return KviError_unsupportedAddressFamily; break; - case WSAECONNRESET: return KviError_connectionResetByPeer; break; - case WSAEHOSTUNREACH: return KviError_hostUnreachable; break; - - //case ENOBUFS: return KviError_insufficientResources; break; - // Unhandled error...pass errno to the strerror function - default: return -iErrNo; break; - } -#else - switch(iErrNo) - { - case EBADF: return KviError_badFileDescriptor; break; - case EFAULT: return KviError_outOfAddressSpace; break; - case ECONNREFUSED: return KviError_connectionRefused; break; - case ENOTSOCK: return KviError_kernelNetworkingPanic; break; - case ETIMEDOUT: return KviError_connectionTimedOut; break; - case ENETUNREACH: return KviError_networkUnreachable; break; - case EPIPE: return KviError_brokenPipe; break; - case ENOTCONN: return KviError_socketNotConnected; break; - case ENOBUFS: return KviError_insufficientResources; break; - case EHOSTUNREACH: return KviError_hostUnreachable; break; - // Unhandled error...pass errno to the strerror function - default: return -iErrNo; break; - } -#endif - } -}; - diff --git a/3.4.0/src/kvilib/core/kvi_error.h b/3.4.0/src/kvilib/core/kvi_error.h deleted file mode 100644 index 7190eae067..0000000000 --- a/3.4.0/src/kvilib/core/kvi_error.h +++ /dev/null @@ -1,188 +0,0 @@ -#ifndef _KVI_ERROR_H_ -#define _KVI_ERROR_H_ -//============================================================================= -// -// File : kvi_error.h -// Creation date : Sun Jul 02 2000 18:35:56 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" - -#define KviError_success 0 -#define KviError_unknownError 1 -#define KviError_internalError 2 -#define KviError_unknownCommand 3 -#define KviError_missingClosingBrace 4 -#define KviError_unexpectedEndInString 5 -#define KviError_unexpectedEndInDictionaryKey 6 -#define KviError_switchDashWithoutSwitchLetter 7 -#define KviError_unknownFunction 8 -#define KviError_unexpectedEndInParenthesis 9 -#define KviError_unexpectedEndInFunctionParams 10 -#define KviError_missingVariableName 11 -#define KviError_variableOrIdentifierExpected 12 -#define KviError_leftOperandIsNotANumber 13 -#define KviError_multipleOpsNotSupportedForOperator 14 -#define KviError_divisionByZero 15 -#define KviError_moduloByZero 16 -#define KviError_rightOperandIsNotANumber 17 -#define KviError_unterminatedExpression 18 -#define KviError_unterminatedSubexpression 19 -#define KviError_unexpectedCharacter 20 -#define KviError_unknownOperator 21 - -#define KviError_noHostToResolve 22 -#define KviError_unsupportedAddressFamily 23 -#define KviError_validNameButNoIpAddress 24 -#define KviError_unrecoverableNameserverError 25 -#define KviError_dnsTemporaneousFault 26 -#define KviError_dnsInternalErrorBadFlags 27 -#define KviError_dnsInternalErrorOutOfMemory 28 -#define KviError_dnsInternalErrorServiceNotSupported 29 -#define KviError_dnsNoName 30 -#define KviError_dnsInternalErrorUnsupportedSocketType 31 -#define KviError_dnsQueryFailed 32 -#define KviError_noIpV6Support 33 -#define KviError_hostNotFound 34 -#define KviError_dnsInternalIPCFailure 35 - -#define KviError_anotherConnectionInProgress 36 -#define KviError_invalidIpAddress 37 -#define KviError_socketCreationFailed 38 -#define KviError_asyncSocketFailed 39 -#define KviError_badFileDescriptor 40 -#define KviError_outOfAddressSpace 41 -#define KviError_connectionRefused 42 -#define KviError_kernelNetworkingPanic 43 -#define KviError_connectionTimedOut 44 -#define KviError_networkUnreachable 45 -#define KviError_brokenPipe 46 -#define KviError_invalidProxyAddress 47 -#define KviError_remoteEndClosedConnection 48 - -#define KviError_invalidIrcContextId 49 -#define KviError_errorInLoadingModule 50 -#define KviError_noSuchModuleCommand 51 -#define KviError_noSuchModuleFunction 52 - -#define KviError_leftOperandIsNotADictionaryReference 53 -#define KviError_rightOperandIsNotADictionaryReference 54 - -#define KviError_missingObjectClassName 55 -#define KviError_noSuchObjectClass 56 -#define KviError_noSuchObject 57 -#define KviError_noSuchObjectFunction 58 - -#define KviError_invalidLeftOperand 59 - -#define KviError_notEnoughParameters 60 -#define KviError_integerParameterExpected 61 -#define KviError_invalidParameter 62 - -#define KviError_noSuchFile 63 - -#define KviError_openParenthesisExpected 64 -#define KviError_openBraceExpected 65 - -#define KviError_cantKillABuiltinClass 66 -#define KviError_socksV4LacksIpV6Support 67 -#define KviError_unrecognizedProxyReply 68 -#define KviError_proxyAuthFailed 69 -#define KviError_proxyNoAcceptableAuthMethod 70 - -#define KviError_proxyReply91RequestFailed 71 -#define KviError_proxyReply92IdentFailed 72 -#define KviError_proxyReply93IdentNotMatching 73 -#define KviError_proxyReply01GeneralSOCKSFailure 74 -#define KviError_proxyReply02ConnectionNotAllowed 75 -#define KviError_proxyReply03NetworkUnreachable 76 -#define KviError_proxyReply04HostUnreachable 77 -#define KviError_proxyReply05ConnectionRefused 78 -#define KviError_proxyReply06TTLExpired 79 -#define KviError_proxyReply07CommandNotSupported 80 -#define KviError_proxyReply08AddressTypeNotSupported 81 -#define KviError_proxyReply09InvalidAddress 82 - -#define KviError_invalidPortNumber 83 -#define KviError_socketNotConnected 84 -#define KviError_insufficientResources 85 -#define KviError_bindFailed 86 -#define KviError_cantResolveLocalhost 87 - -#define KviError_unsupportedImageFormat 88 - -#define KviError_cantOpenFileForAppending 89 -#define KviError_cantOpenFileForWriting 90 -#define KviError_fileIOError 91 -#define KviError_acknowledgeError 92 -#define KviError_cantOpenFileForReading 93 -#define KviError_cantSendAZeroSizeFile 94 - -#define KviError_missingPopupName 95 -#define KviError_itemPopupOrSeparatorExpected 96 -#define KviError_selfModificationNotAllowed 97 - -//#define KviError_recursionTooDeep 98 -#define KviError_featureNotAvailable 99 - -#define KviError_unexpectedCharactersInArrayIndex 100 -#define KviError_unexpectedEndInExpression 101 -#define KviError_unexpectedEndInArrayIndex 102 - -#define KviError_proxyHttpFailure 103 -#define KviError_caseMatchRegexpDefaultOrBreakExpected 104 - - -#define KviError_accessDenied 105 -#define KviError_addressAlreadyInUse 106 -#define KviError_cantAssignRequestedAddress 107 -#define KviError_connectionResetByPeer 108 -#define KviError_hostUnreachable 109 - -#define KviError_variableExpected 110 -#define KviError_invalidArrayIndex 111 - -#define KviError_listenFailed 112 - -#define KviError_noSSLSupport 113 -#define KviError_SSLError 114 - -#define KviError_slashCharacterExpected 115 -#define KviError_unknownStringManipulationOperator 116 - -#define KviError_operationAborted 117 - -#define KviError_unexpectedToken 118 - -#define KviError_scopeObjectAlreadyDefined 119 -#define KviError_noThisObject 120 - -#define KVI_NUM_ERRORS 121 - -namespace KviError -{ - KVILIB_API QString getDescription(int iErrorCode); - KVILIB_API const char * getUntranslatedDescription(int iErrorCode); - KVILIB_API int translateSystemError(int iErrNo); -}; - -#endif //_KVI_ERROR_H_ diff --git a/3.4.0/src/kvilib/core/kvi_heapobject.cpp b/3.4.0/src/kvilib/core/kvi_heapobject.cpp deleted file mode 100644 index 229e2e33e5..0000000000 --- a/3.4.0/src/kvilib/core/kvi_heapobject.cpp +++ /dev/null @@ -1,96 +0,0 @@ -//============================================================================= -// -// File : kvi_heapobject.cpp -// Created on Wed 24 Mar 2004 04:45:17 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004-2006 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_heapobject.h" -#include "kvi_malloc.h" - -// On windows we need to override new and delete operators -// to ensure that always the right new/delete pair is called for an object instance -// This bug jumps out because windows uses a local heap for each -// executable module (exe or dll). -// (this is a well known bug described in Q122675 of MSDN) - -// on Linux it is not needed: there is a single global heap - - - -// 05.02.2005 : scalar/vector deleting destructors in modules -// -// There are also other issues involving the MSVC compiler. -// When the operator new is called on an object with a virtual -// destructor the compiler generates a helper function -// called "vector deleting destructor" that is used to both -// free the object's memory and call the object's destructor. -// (In fact there is also a "scalar deleting destructor" but -// MSVC seems to call the vector version also for scalar deletes ?!?) -// The problem arises when operator new is called in a module: -// the helper function gets stuffed in one of the module's sections -// and when the module is unloaded any attempt to delete -// the object will simply jump into no man's land. - -// An "unhandled exception" in a "call [%eax]" corresponding -// to a delete <pointer> may be a symptom of this problem. - -// I haven't been able to find a solution nicer than having -// a static allocation function in each class that can be -// created from inside a module and destroyed anywhere else -// and has a virtual destructor. - -#ifdef COMPILE_ON_WINDOWS - void * KviHeapObject::operator new(size_t uSize) - { - return kvi_malloc(uSize); - } - - void KviHeapObject::operator delete(void * pData) - { - kvi_free(pData); - } - - void * KviHeapObject::operator new[](size_t uSize) - { - return kvi_malloc(uSize); - } - - void KviHeapObject::operator delete[](void * pData) - { - kvi_free(pData); - } - - // these are the debug versions... - void * KviHeapObject::operator new(size_t uSize,const char *,int) - { - return kvi_malloc(uSize); - } - - void KviHeapObject::operator delete(void * pData,const char *,int) - { - kvi_free(pData); - } -#endif - - diff --git a/3.4.0/src/kvilib/core/kvi_heapobject.h b/3.4.0/src/kvilib/core/kvi_heapobject.h deleted file mode 100644 index 6d821e9a5e..0000000000 --- a/3.4.0/src/kvilib/core/kvi_heapobject.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _KVI_HEAPOBJECT_H_ -#define _KVI_HEAPOBJECT_H_ -//============================================================================= -// -// File : kvi_heapobject.h -// Created on Wed 24 Mar 2004 04:45:17 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004-2006 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" - -// See kvi_heapobject.cpp for comments on this class - -#ifdef COMPILE_ON_WINDOWS - - class KVILIB_API KviHeapObject - { - public: - void * operator new(size_t uSize); - void operator delete(void * pData); - void * operator new[](size_t uSize); - void operator delete[](void * pData); - void * operator new(size_t uSize,const char *,int); - void operator delete(void * pData,const char *,int); - }; -#else //!COMPILE_ON_WINDOWS - class KVILIB_API KviHeapObject - { - // on other platforms this crap is not necessary - }; -#endif //!COMPILE_ON_WINDOWS - -#endif //!_KVI_HEAPOBJECT_H_ diff --git a/3.4.0/src/kvilib/core/kvi_inttypes.h b/3.4.0/src/kvilib/core/kvi_inttypes.h deleted file mode 100644 index b3f4163a15..0000000000 --- a/3.4.0/src/kvilib/core/kvi_inttypes.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef _KVI_INTTYPES_H_ -#define _KVI_INTTYPES_H_ -//============================================================================= -// -// File : kvi_inttypes.h -// Creation date : Wed Sep 4 22:28:00 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002-2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_ON_WINDOWS - // we don't have a configure script here - // so we can't check the size of types - // We rely on the ms specific definitions then - typedef __int64 kvi_i64_t; - typedef unsigned __int64 kvi_u64_t; - typedef int kvi_i32_t; - typedef unsigned int kvi_u32_t; - typedef short int kvi_i16_t; - typedef short unsigned int kvi_u16_t; - typedef char kvi_i8_t; - typedef unsigned char kvi_u8_t; -#else - #if SIZEOF_LONG_INT == 8 - // the most common case on 64 bit machines - typedef long int kvi_i64_t; - typedef unsigned long int kvi_u64_t; - #elif SIZEOF_INT == 8 - // 64 bit ints ?.. a Cray ? :D - typedef int kvi_i64_t; - typedef unsigned int kvi_u64_t; - #elif SIZEOF_LONG_LONG_INT == 8 - // the most common case on 32 bit machines - typedef long long int kvi_i64_t; - typedef unsigned long long int kvi_u64_t; - #else - // attempt to live without a 64bit integer type anyway... - // dunno if it will work tough... - typedef long long int kvi_i64_t; - typedef unsigned long long int kvi_u64_t; - #endif - - #if SIZEOF_INT == 4 - // the most common case - typedef int kvi_i32_t; - typedef unsigned int kvi_u32_t; - #elif SIZEOF_SHORT_INT == 4 - // 32 bit shorts ?.. a Cray ? :D - typedef short int kvi_i32_t; - typedef short unsigned int kvi_u32_t; - #elif SIZEOF_LONG_INT == 4 - typedef long int kvi_i32_t; - typedef unsigned long int kvi_u32_t; - #else - #error "Can't find a 32 bit integral type on this system" - #error "Please report to pragma at kvirc dot net" - #endif - - #if SIZEOF_SHORT_INT == 2 - // the most common case - typedef short int kvi_i16_t; - typedef short unsigned int kvi_u16_t; - #elif SIZEOF_INT == 2 - // this isn't going to work anyway, I think.. - typedef int kvi_i16_t; - typedef long int kvi_u16_t; - #else - #error "Can't find a 16 bit integral type on this system" - #error "Please report to pragma at kvirc dot net" - #endif - - // assume that char is always 8 bit - typedef char kvi_i8_t; - typedef unsigned char kvi_u8_t; -#endif - -#endif //_KVI_INTTYPES_H_ diff --git a/3.4.0/src/kvilib/core/kvi_malloc.cpp b/3.4.0/src/kvilib/core/kvi_malloc.cpp deleted file mode 100644 index 18ee5bb4d9..0000000000 --- a/3.4.0/src/kvilib/core/kvi_malloc.cpp +++ /dev/null @@ -1,198 +0,0 @@ -//============================================================================= -// -// File : kvi_malloc.cpp -// Creation date : Sun Jun 18 2000 18:26:27 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - -//============================================================================= -// C memory allocation routines -// This stuff is rather unused, because in normal compilations -// kvi_malloc , kvi_free and kvi_realloc are macros (see kvi_malloc.h) -//============================================================================= - -#define __KVILIB__ - -#define _KVI_MALLOC_CPP_ -#include "kvi_malloc.h" - -#include <stdio.h> - - - -#ifdef COMPILE_MEMORY_PROFILE - - // - // Memory profile stuff - // Used to find memory leaks etc... - // - - #include "kvi_pointerlist.h" - - typedef struct _KviMallocEntry { - struct _KviMallocEntry * prev; - void * pointer; - int size; - void * return_addr1; - void * return_addr2; - struct _KviMallocEntry * next; - } KviMallocEntry; - - int g_iMaxRequestSize = 0; - void * g_pMaxRequestReturnAddress1 = 0; - void * g_pMaxRequestReturnAddress2 = 0; - unsigned int g_iMallocCalls = 0; - unsigned int g_iReallocCalls = 0; - unsigned int g_iFreeCalls = 0; - unsigned int g_iTotalMemAllocated = 0; - unsigned int g_uAllocationPeak = 0; - KviMallocEntry * g_pEntries = 0; - - void * kvi_malloc(int size) - { - g_iMallocCalls ++; - g_iTotalMemAllocated += size; - if(g_iTotalMemAllocated > g_uAllocationPeak)g_uAllocationPeak = g_iTotalMemAllocated; - if(g_iMaxRequestSize < size){ - g_iMaxRequestSize = size; - g_pMaxRequestReturnAddress1 = __builtin_return_address(1); - g_pMaxRequestReturnAddress2 = __builtin_return_address(2); - } - KviMallocEntry * e = (KviMallocEntry *)malloc(sizeof(KviMallocEntry)); - e->pointer = malloc(size); - e->size = size; - e->return_addr1 = __builtin_return_address(1); - e->return_addr2 = __builtin_return_address(2); - e->next = g_pEntries; - e->prev = 0; - if(g_pEntries)g_pEntries->prev = e; - g_pEntries = e; - return e->pointer; - } - - void * kvi_realloc(void * ptr,int size) - { - g_iReallocCalls ++; - if(ptr == 0)return kvi_malloc(size); - if(g_iMaxRequestSize < size){ - g_iMaxRequestSize = size; - g_pMaxRequestReturnAddress1 = __builtin_return_address(1); - g_pMaxRequestReturnAddress2 = __builtin_return_address(2); - } - KviMallocEntry *e = g_pEntries; - while(e){ - if(e->pointer == ptr){ - g_iTotalMemAllocated -= e->size; - g_iTotalMemAllocated += size; - if(g_iTotalMemAllocated > g_uAllocationPeak)g_uAllocationPeak = g_iTotalMemAllocated; - e->pointer = realloc(ptr,size); - e->size = size; - e->return_addr1 = __builtin_return_address(1); - e->return_addr2 = __builtin_return_address(2); - return e->pointer; - } - e = e->next; - } - fprintf(stderr,"Attempt to realloc an inexisting pointer (%p) (called from %p (%p))\n",ptr,__builtin_return_address(1),__builtin_return_address(2)); - return realloc(ptr,size); - } - - void kvi_free(void * ptr) - { - g_iFreeCalls++; - if(ptr == 0){ - fprintf(stderr,"Attempt to free a null pointer (called from %p (%p))\n",__builtin_return_address(1),__builtin_return_address(2)); - exit(-1); - } - KviMallocEntry * e= g_pEntries; - while(e){ - if(e->pointer == ptr){ - g_iTotalMemAllocated -= e->size; - if(e->prev){ - if(e == g_pEntries)fprintf(stderr,"Mem profiling internal error!\n"); - e->prev->next = e->next; - if(e->next)e->next->prev = e->prev; - } else { - if(e != g_pEntries)fprintf(stderr,"Mem profiling internal error!\n"); - if(e->next)e->next->prev = 0; - g_pEntries = e->next; - } - free(e); - return; - } - e = e->next; - } - fprintf(stderr,"Attempt to free an inexisting pointer (%p) (called from %p (%p))\n",ptr,__builtin_return_address(1),__builtin_return_address(2)); - } - - void kvi_memory_profile() __attribute__((destructor)); - void kvi_memory_profile() - { - unsigned int countUnfreed = 0; - KviMallocEntry * e = g_pEntries; - while(e){ - countUnfreed++; - e = e->next; - } - fprintf(stderr,"|====|====|====|====|====|====|====|====\n"); - fprintf(stderr,"| Memory profile for KVIrc\n"); - fprintf(stderr,"| Unfreed chunks : %d\n",countUnfreed); - fprintf(stderr,"| Total unfreed memory : %u bytes\n",g_iTotalMemAllocated); - fprintf(stderr,"|====|====|====|====|====|====|====|====\n"); - fprintf(stderr,"| Possible unfreed chunks dump:\n"); - e = g_pEntries; - while(e){ - fprintf(stderr,"|====|====|\n"); - fprintf(stderr,"| Currently unfreed chunk: %p\n",e->pointer); - fprintf(stderr,"| Size: %d\n",e->size); - fprintf(stderr,"| Caller address 1: %p\n",e->return_addr1); - fprintf(stderr,"| Caller address 2: %p\n",e->return_addr2); - if(e->size > 10)fprintf(stderr,"| Data: %.10s\n",e->pointer); - else if(e->size > 5)fprintf(stderr,"| Data: %.5s\n",e->pointer); - KviMallocEntry *toFree = e; - e = e->next; - free(toFree); - } - fprintf(stderr,"|====|====|====|====|====|====|====|====\n"); - fprintf(stderr,"| Allocation peak : %u bytes\n",g_uAllocationPeak); - fprintf(stderr,"|====|====|====|====|====|====|====|====\n"); - fprintf(stderr,"| Max request size : %d bytes\n",g_iMaxRequestSize); - fprintf(stderr,"| Called from %p (%p)\n",g_pMaxRequestReturnAddress1,g_pMaxRequestReturnAddress2); - fprintf(stderr,"|====|====|====|====|====|====|====|====\n"); - fprintf(stderr,"| Malloc calls: %u\n",g_iMallocCalls); - fprintf(stderr,"| Realloc calls: %u\n",g_iReallocCalls); - fprintf(stderr,"| Free calls: %u\n",g_iFreeCalls); - fprintf(stderr,"|====|====|====|====|====|====|====|====\n"); - } - -#else - - #ifdef COMPILE_MEMORY_CHECKS - - void outOfMemory() - { - //What a cool message :) - fprintf(stderr,"Virtual memory exhausted in malloc call....bye!\n"); - exit(-1); - } - - #endif - -#endif diff --git a/3.4.0/src/kvilib/core/kvi_malloc.h b/3.4.0/src/kvilib/core/kvi_malloc.h deleted file mode 100644 index 09f187bdbd..0000000000 --- a/3.4.0/src/kvilib/core/kvi_malloc.h +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef _KVI_MALLOC_H_ -#define _KVI_MALLOC_H_ - -//============================================================================= -// -// File : kvi_malloc.h -// Creation date : Sun Jun 18 2000 18:18:36 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - -//============================================================================= -// C memory allocation routines: macros in common compilations -//============================================================================= - -#include "kvi_settings.h" - -#include <stdlib.h> - -#ifdef COMPILE_MEMORY_PROFILE - - #ifdef COMPILE_ON_WINDOWS - #error "This stuff should be never compiled on Windows" - #endif - - extern void * kvi_malloc(int size); - extern void * kvi_realloc(void * ptr,int size); - extern void kvi_free(void * ptr); - -#else - - #ifndef COMPILE_MEMORY_CHECKS - - // These two are the "common" ones - #define kvi_malloc(__size_) malloc(__size_) - #define kvi_realloc(__ptr_,__size_) realloc((void *)__ptr_,__size_) - - #else - - #ifdef COMPILE_ON_WINDOWS - #error "This stuff should be never compiled on Windows" - #endif - - // Want to check all the pointers - #define kvi_malloc(__size_) kvi_safe_malloc(__size_) - #define kvi_realloc(__ptr_,__size_) kvi_safe_realloc((void *)__ptr_,__size_) - - #ifndef _KVI_MALLOC_CPP_ - extern void outOfMemory(); - #endif - - inline void * kvi_safe_malloc(int size) - { - void * ptr = malloc(size); - if(!ptr)outOfMemory(); - return ptr; - } - - inline void * kvi_safe_realloc(void * ptr,int size) - { - ptr = realloc(ptr,size); - if(!ptr)outOfMemory(); - return ptr; - } - - #endif //COMPILE_MEMORY_CHECKS - - #define kvi_free(__ptr_) free((void *)__ptr_) - -#endif - -#endif //_KVI_MALLOC_H_ diff --git a/3.4.0/src/kvilib/core/kvi_memmove.cpp b/3.4.0/src/kvilib/core/kvi_memmove.cpp deleted file mode 100644 index b486140f80..0000000000 --- a/3.4.0/src/kvilib/core/kvi_memmove.cpp +++ /dev/null @@ -1,253 +0,0 @@ -//============================================================================= -// -// File : kvi_memmove.cpp -// Creation date : Sun Jun 18 2000 18:27:50 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - -#define _KVI_DEBUG_CHECK_RANGE_ -#include "kvi_debug.h" - -#define _KVI_MEMMOVE_CPP_ -#include "kvi_memmove.h" - -// FIXME: #warning "With system memmove could be guessed by configure" - -#ifndef COMPILE_WITH_SYSTEM_MEMMOVE - - #ifdef COMPILE_ix86_ASM - - - void *kvi_memmove(void * dst_ptr,const void *src_ptr,int len) - { - __range_valid(dst_ptr); - __range_valid(src_ptr); - __range_valid(len >= 0); - // Save pointer registers - asm(" pushl %esi"); // save %esi - asm(" pushl %edi"); // save %edi - // Load arguments - asm(" movl 16(%ebp),%ecx"); // %ecx = len - asm(" movl 12(%ebp),%esi"); // %esi = src - asm(" movl 8(%ebp),%edi"); // %edi = dst - // Compare src and dest - asm(" cmpl %esi,%edi"); // %edi - %esi - asm(" jbe move_from_bottom_to_top"); // if(%edi < %esi) jump to move_from_bottom_to_top - // dst_ptr > src_ptr - asm(" addl %ecx,%esi"); // %esi += %ecx (src_ptr += len); - asm(" addl %ecx,%edi"); // %edi += %ecx (dst_ptr += len); - asm(" decl %esi"); // %esi--; (src_ptr--); - asm(" decl %edi"); // %edi--; (dst_ptr--); - asm(" std"); // set direction flag (decrement esi and edi in movsb) - // Optimization : check for non-odd len (1,3,5,7...) - asm(" shr $1,%ecx"); // %ecx >> 1 , shifted bit -> CF - asm(" jnc move_two_bytes_top_to_bottom_directly"); // if !carry (CF == 0) skip this move - // Move the first byte (non-odd) - asm(" movsb %ds:(%esi),%es:(%edi)"); // *dst-- = *src-- if DF else *dst++ = *src++ - asm("move_two_bytes_top_to_bottom_directly:"); - asm(" decl %esi"); // %esi--; (src_ptr--); - asm(" decl %edi"); // %edi--; (dst_ptr--); - asm("move_two_bytes_top_to_bottom:"); - asm(" shr $1,%ecx"); // %ecx >> 1 , shifted bit -> CF - asm(" jnc move_the_rest_top_to_bottom_directly"); // if !carry (CF == 0) skip this move - // Move the next two bytes - asm(" movsw %ds:(%esi),%es:(%edi)"); // *((word *)dst)-- = *((word)src)-- if DF else *((word *)dst)++ = *((word)src)++ - asm("move_the_rest_top_to_bottom_directly:"); - asm(" subl $2,%esi"); // %esi-=2; (src-=2); - asm(" subl $2,%edi"); // %edi-=2; (dst-=2); - asm(" jmp move_the_rest"); // call last repnz movsl - // dst_ptr <= src_ptr - asm("move_from_bottom_to_top:"); - asm(" cld"); // clear direction flag (increment esi and edi in movsb) - // Optimization : check for non-odd len (1,3,5,7...) - asm(" shr $1,%ecx"); // %ecx >> 1 , shifted bit -> CF - asm(" jnc move_two_bytes"); // if !carry (CF == 0) skip this move - // Move the first byte (non-odd) - asm(" movsb %ds:(%esi),%es:(%edi)"); // *dst-- = *src-- if DF else *dst++ = *src++ - // Optimization : pass 2 , check for %2 and %3 - asm("move_two_bytes:"); - asm(" shr $1,%ecx"); // %ecx >> 1 , shifted bit -> CF - asm(" jnc move_the_rest"); // if !carry (CF == 0) skip this move - // Move the next two bytes - asm(" movsw %ds:(%esi),%es:(%edi)"); // *((word *)dst)-- = *((word)src)-- if DF else *((word *)dst)++ = *((word)src)++ - // Main move remaining part - asm("move_the_rest:"); - asm(" repnz; movsl %ds:(%esi),%es:(%edi)"); // loop moving 4 bytes at once (increment or decrement as above) - // Restore pointer registers - asm(" popl %edi"); // restore %edi - asm(" popl %esi"); // restore %esi - return dst_ptr; //asm(" movl 8(%ebp),%eax"); <-- gcc will put that (AFTER THE OPTIMISATION PASS!) - } - - void *kvi_memmoveodd(void * dst_ptr,const void *src_ptr,int len) - { - __range_valid(dst_ptr); - __range_valid(src_ptr); - __range_valid(len >= 0); - // Save pointer registers - asm(" pushl %esi"); // save %esi - asm(" pushl %edi"); // save %edi - // Load arguments - asm(" movl 16(%ebp),%ecx"); // %ecx = len - asm(" movl 12(%ebp),%esi"); // %esi = src - asm(" movl 8(%ebp),%edi"); // %edi = dst - // Compare src and dest - asm(" cmpl %esi,%edi"); // %edi - %esi - asm(" jbe xmove_from_bottom_to_top"); // if(%edi < %esi) jump to move_from_bottom_to_top - // dst_ptr > src_ptr - asm(" addl %ecx,%esi"); // %esi += %ecx (src_ptr += len); - asm(" addl %ecx,%edi"); // %edi += %ecx (dst_ptr += len); - asm(" std"); // set direction flag (decrement esi and edi in movsb) - // start moving - asm(" shr $2,%ecx"); // %ecx >> 2 , last shifted bit -> CF - asm(" jnc xmove_the_rest_top_to_bottom_directly"); // if !carry (CF == 0) skip this move - // Move the next two bytes - asm(" subl $2,%esi"); // %esi-=2; (src_ptr-=2); - asm(" subl $2,%edi"); // %edi-=2; (dst_ptr-=2); - asm(" movsw %ds:(%esi),%es:(%edi)"); // *((word *)dst)-- = *((word)src)-- if DF else *((word *)dst)++ = *((word)src)++ - asm(" subl $2,%esi"); // %esi-=2; (src_ptr-=2); - asm(" subl $2,%edi"); // %edi-=2; (dst_ptr-=2); - asm(" jmp xmove_the_rest"); - asm("xmove_the_rest_top_to_bottom_directly:"); - asm(" subl $4,%esi"); // %esi-=4; (src-=4); - asm(" subl $4,%edi"); // %edi-=4; (dst-=4); - asm(" jmp xmove_the_rest"); // call last repnz movsl - // dst_ptr <= src_ptr - asm("xmove_from_bottom_to_top:"); - asm(" cld"); // clear direction flag (increment esi and edi in movsb) - // move it - asm(" shr $2,%ecx"); // %ecx >> 2 , last shifted bit -> CF - asm(" jnc xmove_the_rest"); // if !carry (CF == 0) skip this move - // Move the next two bytes - asm(" movsw %ds:(%esi),%es:(%edi)"); // *((word *)dst)-- = *((word)src)-- if DF else *((word *)dst)++ = *((word)src)++ - // Main move remaining part - asm("xmove_the_rest:"); - asm(" repnz; movsl %ds:(%esi),%es:(%edi)"); // loop moving 4 bytes at once (increment or decrement as above) - // Restore pointer registers - asm(" popl %edi"); // restore %edi - asm(" popl %esi"); // restore %esi - return dst_ptr; //asm(" movl 8(%ebp),%eax"); <-- gcc will put that (AFTER THE OPTIMISATION PASS!) - } - - #else // ndef COMPILE_ix86_ASM - - - - // The next 4 functions could be optimized with the & and shift technique - // used in the assembly implementations but the compilers usually - // will not translate the carry bit trick producing code - // that works slower on short block of memory (really near the average case) - - // The trick would be: - // - // if(len & 1) // the length is even - // *dst-- = *src--; // move one byte - // len >> 1; // drop the last bit (thus divide by 2) - // if(len & 1) // the length is still even - // *((short *)dst)-- = *((short *)src)--; // move two bytes - // len >> 1; // again drop the last bit (thus divide by 2) - // while(len--)*((int *)dst)-- = *((int *)src)--; // move four bytes at a time - // - // - - void *kvi_memmove(void *dst_ptr,const void *src_ptr,int len) - { - __range_valid(dst_ptr); - __range_valid(src_ptr); - __range_valid(len >= 0); - register char *dst; - register const char *src; - if(dst_ptr > src_ptr){ - dst = (char *)dst_ptr + len - 1; - src = (const char *)src_ptr + len - 1; - while(len--)*dst-- = *src--; - } else { //it is valid even if dst_ptr == src_ptr - dst = (char *)dst_ptr; - src = (const char *)src_ptr; - while(len--)*dst++ = *src++; - } - return dst_ptr; - } - - void *kvi_memmoveodd(void *dst_ptr,const void *src_ptr,int len) - { - __range_valid(dst_ptr); - __range_valid(src_ptr); - __range_valid(len >= 0); - __range_valid((len & 1) == 0); - register short *dst; - register const short *src; - if(dst_ptr > src_ptr){ - dst = (short *) (((char *)dst_ptr) + len - 2); - src = (const short *) (((const char *)src_ptr) + len - 2); - while(len > 0) - { - *dst-- = *src--; - len -= 2; - } - } else { //it is valid even if dst_ptr == src_ptr - dst = (short *)dst_ptr; - src = (const short *)src_ptr; - while(len > 0) - { - *dst++ = *src++; - len -= 2; - } - } - return dst_ptr; - } - - void kvi_fastmove(void *dst_ptr,const void *src_ptr,int len) - { - __range_valid(dst_ptr); - __range_valid(src_ptr); - __range_valid(len >= 0); - register const char *src = (const char *)src_ptr; - register char *dst = (char *)dst_ptr; - while(len--)*dst++ = *src++; - } - - void kvi_fastmoveodd(void *dst_ptr,const void *src_ptr,int len) - { - __range_valid(dst_ptr); - __range_valid(src_ptr); - __range_valid(len >= 0); - __range_valid((len & 1) == 0); - register const short *src = (const short *)src_ptr; - register short *dst = (short *)dst_ptr; - while(len > 0){ - *dst++ = *src++; - len -= 2; - } - } - - #endif // !COMPILE_ix86_ASM - - void kvi_memset(void *dst_ptr,char c,int len) - { - __range_valid(dst_ptr); - __range_valid(len >= 0); - register char *dst = (char *)dst_ptr; - while(len--)*dst++ = c; - } - -#endif // !COMPILE_WITH_SYSTEM_MEMMOVE diff --git a/3.4.0/src/kvilib/core/kvi_memmove.h b/3.4.0/src/kvilib/core/kvi_memmove.h deleted file mode 100644 index 71877a102a..0000000000 --- a/3.4.0/src/kvilib/core/kvi_memmove.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef _KVI_MEMMOVE_H_ -#define _KVI_MEMMOVE_H_ - -//============================================================================= -// -// File : kvi_memmove.h -// Creation date : Fri Mar 19 1999 03:15:21 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - -#include "kvi_settings.h" - -//#undef COMPILE_WITH_SYSTEM_MEMMOVE -//#define COMPILE_MMX_ASM - -#ifndef _KVI_MEMMOVE_CPP_ - - #ifdef COMPILE_WITH_SYSTEM_MEMMOVE - - #include <string.h> - - #define kvi_memmove memmove - #define kvi_memmoveodd memmove - #define kvi_memset memset - #define kvi_fastmove memcpy - #define kvi_fastmoveodd memcpy - - #else - - #ifdef COMPILE_ON_WINDOWS - #error "This stuff should be never compiled on Windows" - #endif - - extern void *kvi_memmove(void *dst_ptr,const void *src_ptr,int len); - extern void *kvi_memmoveodd(void *dst_ptr,const void *src_ptr,int len); - extern void *kvi_memset(void *dst_ptr,char c,int len); - // In fastmove the src and dst may not overlap - - #ifdef COMPILE_ix86_ASM - - // WE WANT repnz; movsq\n"!!! - - inline void kvi_fastmove(void * dst_ptr,const void *src_ptr,int len) - { - __asm__ __volatile__( - " cld\n" - " shr $1,%0\n" - " jnc 1f\n" - " movsb\n" - "1:\n" - " shr $1,%0\n" - " jnc 2f\n" - " movsw\n" - "2:\n" - " repnz; movsl\n" - : "=c" (len), "=&S" (src_ptr), "=&D" (dst_ptr) - : "0" (len), "1" (src_ptr), "2" (dst_ptr) - ); - } - - inline void kvi_fastmoveodd(void * dst_ptr,const void *src_ptr,int len) - { - __asm__ __volatile__( - " cld\n" - " shr $2,%0\n" - " jnc 1f\n" - " movsw\n" - "1:\n" - " repnz; movsl\n" - : "=c" (len), "=&S" (src_ptr), "=&D" (dst_ptr) - : "0" (len), "1" (src_ptr), "2" (dst_ptr) - ); - } - - #else // ! COMPILE_ix86_ASM - - extern void kvi_fastmove(void *dst_ptr,const void *src_ptr,int len); - extern void kvi_fastmoveodd(void *dst_ptr,const void *src_ptr,int len); - - #endif // !COMPILE_ix86_ASM - - #endif // COMPILE_WITH_SYSTEM_MEMMOVE - -#endif // _KVI_MEMMOVE_CPP_ - -#endif // !_KVI_MEMMOVE_H_ diff --git a/3.4.0/src/kvilib/core/kvi_pointerhashtable.h b/3.4.0/src/kvilib/core/kvi_pointerhashtable.h deleted file mode 100644 index 06b3911a66..0000000000 --- a/3.4.0/src/kvilib/core/kvi_pointerhashtable.h +++ /dev/null @@ -1,999 +0,0 @@ -#ifndef _KVI_POINTERHASHTABLE_H_ -#define _KVI_POINTERHASHTABLE_H_ -//================================================================================================= -// -// File : kvi_pointerhashtable.h -// Creation date : Sat Jan 12 2008 04:53 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2008 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_pointerlist.h" -#include "kvi_string.h" -#include "kvi_qstring.h" -#include "kvi_malloc.h" -#include "kvi_memmove.h" - -#include <ctype.h> - -/// -/// Hash functions for various data types -/// - -inline unsigned int kvi_hash_hash(const char * szKey,bool bCaseSensitive) -{ - unsigned int uResult = 0; - if(bCaseSensitive) - { - while(*szKey) - { - uResult += (unsigned char)(*(szKey)); - szKey++; - } - } else { - while(*szKey) - { - uResult += (unsigned char)tolower(*(szKey)); - szKey++; - } - } - return uResult; -} - -inline bool kvi_hash_key_equal(const char * szKey1,const char * szKey2,bool bCaseSensitive) -{ - if(bCaseSensitive) - { - while(*szKey1 && *szKey2) - { - if(*szKey1 != *szKey2) - return false; - szKey1++; - szKey2++; - } - } else { - while(*szKey1 && *szKey2) - { - if(tolower(*szKey1) != tolower(*szKey2)) - return false; - szKey1++; - szKey2++; - } - } - return true; -} - -inline void kvi_hash_key_copy(const char * const &szFrom,const char * &szTo,bool bDeepCopy) -{ - if(bDeepCopy) - { - int len = kvi_strLen(szFrom); - char * dst = (char *)kvi_malloc(len+1); - kvi_fastmove(dst,szFrom,len+1); - szTo = dst; - } else { - szTo = szFrom; // we never modify it anyway - } -} - -inline void kvi_hash_key_destroy(const char * &szKey,bool bDeepCopy) -{ - if(bDeepCopy) - kvi_free(szKey); -} - -inline const char * & kvi_hash_key_default(const char **) -{ - static const char * static_null = NULL; - return static_null; -} - -inline unsigned int kvi_hash_hash(const KviStr &szKey,bool bCaseSensitive) -{ - unsigned int uResult = 0; - const char * p = szKey.ptr(); - if(bCaseSensitive) - { - while(*p) - { - uResult += *((const unsigned char *)p); - p++; - } - } else { - while(*p) - { - uResult += tolower(*((const unsigned char *)p)); - p++; - } - } - return uResult; -} - -inline bool kvi_hash_key_equal(const KviStr &szKey1,const KviStr &szKey2) -{ - return kvi_hash_key_equal(szKey1.ptr(),szKey2.ptr()); -} - -inline void kvi_hash_key_copy(const KviStr &szFrom,KviStr &szTo,bool) -{ - szTo = szFrom; -} - -inline void kvi_hash_key_destroy(KviStr &szKey,bool) -{ -} - -inline const KviStr & kvi_hash_key_default(KviStr *) -{ - return KviStr::emptyString(); -} - -inline unsigned int kvi_hash_hash(const int &iKey,bool) -{ - return (unsigned int)iKey; -} - -inline bool kvi_hash_key_equal(const int &iKey1,const int &iKey2,bool) -{ - return iKey1 == iKey2; -} - -inline void kvi_hash_key_copy(const int &iKeyFrom,int &iKeyTo,bool) -{ - iKeyTo = iKeyFrom; -} - -inline void kvi_hash_key_destroy(int &iKey,bool) -{ -} - -inline const int & kvi_hash_key_default(int *) -{ - static int static_default = 0; - return static_default; -} - -inline unsigned int kvi_hash_hash(const unsigned short &iKey,bool) -{ - return (unsigned int)iKey; -} - -inline bool kvi_hash_key_equal(const unsigned short &iKey1,const unsigned short &iKey2,bool) -{ - return iKey1 == iKey2; -} - -inline void kvi_hash_key_copy(const unsigned short &iKeyFrom,unsigned short &iKeyTo,bool) -{ - iKeyTo = iKeyFrom; -} - -inline void kvi_hash_key_destroy(unsigned short &iKey,bool) -{ -} - -inline const unsigned short & kvi_hash_key_default(unsigned short *) -{ - static unsigned short static_default = 0; - return static_default; -} - - -inline unsigned int kvi_hash_hash(void * pKey,bool) -{ - unsigned char * pBytes = (unsigned char *)&(pKey); - unsigned char * pEnd = pBytes + sizeof(void *); - unsigned int uSum = 0; - while(pBytes < pEnd) - { - uSum += *pBytes; - pBytes++; - } - return uSum; -} - -inline bool kvi_hash_key_equal(void *pKey1,void *pKey2,bool) -{ - return pKey1 == pKey2; -} - -inline void kvi_hash_key_copy(void * const &pKeyFrom,void *&pKeyTo,bool) -{ - pKeyTo = pKeyFrom; -} - -inline void kvi_hash_key_destroy(void *iKey,bool) -{ -} - -inline void * & kvi_hash_key_default(void *) -{ - static void * static_default = NULL; - return static_default; -} - -inline unsigned int kvi_hash_hash(const QString &szKey,bool bCaseSensitive) -{ - unsigned int uResult = 0; - const QChar * p = KviQString::nullTerminatedArray(szKey); - if(!p)return 0; - if(bCaseSensitive) - { - while(p->unicode()) - { - uResult += p->unicode(); - p++; - } - } else { - while(p->unicode()) - { -#ifdef COMPILE_USE_QT4 - uResult += p->toLower().unicode(); -#else - uResult += p->lower().unicode(); -#endif - p++; - } - } - return uResult; -} - -inline bool kvi_hash_key_equal(const QString &szKey1,const QString &szKey2,bool bCaseSensitive) -{ - if(bCaseSensitive) - return KviQString::equalCS(szKey1,szKey2); - return KviQString::equalCI(szKey1,szKey2); -} - -inline void kvi_hash_key_copy(const QString &szFrom,QString &szTo,bool) -{ - szTo = szFrom; -} - -inline void kvi_hash_key_destroy(QString &szKey,bool) -{ -} - -inline const QString & kvi_hash_key_default(QString *) -{ - return KviQString::empty; -} - -template<typename Key,typename T> class KviPointerHashTable; -template<typename Key,typename T> class KviPointerHashTableIterator; - -template<typename Key,typename T> class KviPointerHashTableEntry -{ - friend class KviPointerHashTable<Key,T>; -protected: - T * pData; - Key hKey; -public: - Key & key(){ return hKey; }; - T * data(){ return pData; }; -}; - -/// -/// -/// \class KviPointerHashTable -/// \brief A fast pointer hash table implementation -/// -/// A very cool, very fast hash table implementation :P -/// -/// To use this hash table you need to provide implementations -/// for the following functions: -/// -/// \verbatim -/// -/// unsigned int kvi_hash_hash(const Key &hKey,bool bCaseSensitive); -/// bool kvi_hash_key_equal(const Key &hKey1,const Key &hKey2,bool bCaseSensitive); -/// void kvi_hash_key_copy(const Key &hKeyFrom,Key &hKeyTo,bool bDeepCopy); -/// void kvi_hash_key_destroy(Key &hKey,bool bIsDeepCopy); -/// const Key & kvi_hash_key_default(Key *); -/// -/// \endverbatim -/// -/// Implementations for the most likey Key data types are provided below. -/// KviPointerHashTable will automagically work with const char *,QString,KviStr -/// and integer types as keys. -/// -/// For string Key types, the hash table may or may not be case sensitive. -/// For other Key types the case sensitive flag has no meaning and will -/// (hopefully) be optimized out by the compiler. -/// -/// For pointer based keys the hash table may or may not mantain deep copies -/// of Key data. For example, with char * keys, if deep copying is enabled -/// then a private copy of the string data will be mantained. With deep -/// copying disabled only char * pointers will be kept. For types -/// that do not have meaning of deep copy the deep copying code will -/// (hopefully) be optimized out by the compiler. -/// -/// The hashtable mantains an array of KviPointerList based buckets. -/// The number of buckets may be specified by the application user -/// and does NOT need to be a prime number. Yet better to have it a power -/// of two so the memory allocation routines will feel better and are -/// less likely to waste space. -/// -template<class Key,class T> class KviPointerHashTable -{ - friend class KviPointerHashTableIterator<Key,T>; -protected: - KviPointerList<KviPointerHashTableEntry<Key,T> > ** m_pDataArray; - bool m_bAutoDelete; - unsigned int m_uSize; - unsigned int m_uCount; - bool m_bCaseSensitive; - bool m_bDeepCopyKeys; - unsigned int m_uIteratorIdx; -public: - /// - /// Returns the item associated to the key hKey - /// or NULL if no such item exists in the hash table. - /// Places the hash table iterator at the position - /// of the item found. - /// - T * find(const Key & hKey) - { - m_uIteratorIdx = kvi_hash_hash(hKey,m_bCaseSensitive) % m_uSize; - if(!m_pDataArray[m_uIteratorIdx])return 0; - for(KviPointerHashTableEntry<Key,T> * e = m_pDataArray[m_uIteratorIdx]->first();e;e = m_pDataArray[m_uIteratorIdx]->next()) - { - if(kvi_hash_key_equal(e->hKey,hKey,m_bCaseSensitive))return (T *)e->pData; - } - return 0; - } - - /// - /// Returns the item associated to the key hKey - /// or NULL if no such item exists in the hash table. - /// Places the hash table iterator at the position - /// of the item found. This is an alias to find(). - /// - T * operator[](const Key & hKey) - { - return find(hKey); - } - - /// - /// Returns the number of items in this hash table - /// - unsigned int count() const - { - return m_uCount; - } - - /// - /// Returns true if the hash table is empty - /// - bool isEmpty() const - { - return m_uCount == 0; - } - - /// - /// Inserts the item pData at the position specified by the key hKey. - /// Replaces any previous item with the same key - /// The replaced item is deleted if autodelete is enabled. - /// The hash table iterator is placed at the newly inserted item. - /// - void insert(const Key & hKey,T * pData) - { - if(!pData)return; - unsigned int uEntry = kvi_hash_hash(hKey,m_bCaseSensitive) % m_uSize; - if(!m_pDataArray[uEntry])m_pDataArray[uEntry] = new KviPointerList<KviPointerHashTableEntry<Key,T> >(true); - for(KviPointerHashTableEntry<Key,T> * e = m_pDataArray[uEntry]->first();e;e = m_pDataArray[uEntry]->next()) - { - if(kvi_hash_key_equal(e->hKey,hKey,m_bCaseSensitive)) - { - if(!m_bCaseSensitive) - { - // must change the key too - kvi_hash_key_destroy(e->hKey,m_bDeepCopyKeys); - kvi_hash_key_copy(hKey,e->hKey,m_bDeepCopyKeys); - } - if(m_bAutoDelete)delete e->pData; - e->pData = pData; - return; - } - } - KviPointerHashTableEntry<Key,T> * n = new KviPointerHashTableEntry<Key,T>; - kvi_hash_key_copy(hKey,n->hKey,m_bDeepCopyKeys); - n->pData = pData; - m_pDataArray[uEntry]->append(n); - m_uCount++; - } - - /// - /// Inserts the item pData at the position specified by the key hKey. - /// Replaces any previous item with the same key - /// The replaced item is deleted if autodelete is enabled. - /// The hash table iterator is placed at the newly inserted item. - /// This is just an alias to insert() with a different name. - /// - void replace(const Key & hKey,T * pData) - { - insert(hKey,pData); - } - - /// - /// Removes the item pointer associated to the key hKey, if such an item - /// exists in the hash table. The item is deleted if autodeletion - /// is enabled. Returns true if the item was found and removed and false if it wasn't found. - /// Invalidates the hash table iterator. - /// - bool remove(const Key & hKey) - { - unsigned int uEntry = kvi_hash_hash(hKey,m_bCaseSensitive) % m_uSize; - if(!m_pDataArray[uEntry])return false; - for(KviPointerHashTableEntry<Key,T> * e = m_pDataArray[uEntry]->first();e;e = m_pDataArray[uEntry]->next()) - { - if(kvi_hash_key_equal(e->hKey,hKey,m_bCaseSensitive)) - { - kvi_hash_key_destroy(e->hKey,m_bDeepCopyKeys); - if(m_bAutoDelete)delete ((T *)(e->pData)); - m_pDataArray[uEntry]->removeRef(e); - if(m_pDataArray[uEntry]->isEmpty()) - { - delete m_pDataArray[uEntry]; - m_pDataArray[uEntry] = 0; - } - m_uCount--; - return true; - } - } - return false; - } - - /// - /// Removes the first occurence of the item pointer pRef. The item is deleted if autodeletion - /// is enabled. Returns true if the pointer was found and false otherwise - /// Invalidates the hash table iterator. - /// - bool removeRef(const T * pRef) - { - for(unsigned int i=0;i<m_uSize;i++) - { - if(m_pDataArray[i]) - { - for(KviPointerHashTableEntry<Key,T> * e = m_pDataArray[i]->first();e;e = m_pDataArray[i]->next()) - { - if(e->pData == pRef) - { - kvi_hash_key_destroy(e->hKey,m_bDeepCopyKeys); - if(m_bAutoDelete)delete ((T *)(e->pData)); - m_pDataArray[i]->removeRef(e); - if(m_pDataArray[i]->isEmpty()) - { - delete m_pDataArray[i]; - m_pDataArray[i] = 0; - } - m_uCount--; - return true; - } - } - } - } - return false; - } - - /// - /// Removes all the items from the hash table. - /// The items are deleted if autodeletion is enabled. - /// Invalidates the hash table iterator. - /// - void clear() - { - for(unsigned int i=0;i<m_uSize;i++) - { - if(m_pDataArray[i]) - { - for(KviPointerHashTableEntry<Key,T> * e = m_pDataArray[i]->first();e;e = m_pDataArray[i]->next()) - { - kvi_hash_key_destroy(e->hKey,m_bDeepCopyKeys); - if(m_bAutoDelete) - delete ((T *)(e->pData)); - } - delete m_pDataArray[i]; - m_pDataArray[i] = 0; - } - } - m_uCount = 0; - } - - /// - /// Searches for the item pointer pRef and returns - /// it's hash table entry, if found, and NULL otherwise. - /// The hash table iterator is placed at the item found. - /// - KviPointerHashTableEntry<Key,T> * findRef(const T * pRef) - { - for(m_uIteratorIdx = 0;m_uIteratorIdx<m_uSize;m_uIteratorIdx++) - { - if(m_pDataArray[m_uIteratorIdx]) - { - for(KviPointerHashTableEntry<Key,T> * e = m_pDataArray[m_uIteratorIdx]->first();e;e = m_pDataArray[m_uIteratorIdx]->next()) - { - if(e->pData == pRef)return e; - } - } - } - return 0; - } - - /// - /// Returns the entry pointed by the hash table iterator. - /// This function must be preceeded by a call to firstEntry(), first() - /// or findRef(). - /// - KviPointerHashTableEntry<Key,T> * currentEntry() - { - if(m_uIteratorIdx >= m_uSize)return 0; - if(m_pDataArray[m_uIteratorIdx])return m_pDataArray[m_uIteratorIdx]->current(); - return 0; - } - - /// - /// Places the hash table iterator at the first entry - /// and returns it. - /// - KviPointerHashTableEntry<Key,T> * firstEntry() - { - m_uIteratorIdx = 0; - while(m_uIteratorIdx < m_uSize && (!m_pDataArray[m_uIteratorIdx])) - { - m_uIteratorIdx++; - } - if(m_uIteratorIdx == m_uSize)return 0; - return m_pDataArray[m_uIteratorIdx]->first(); - } - - /// - /// Places the hash table iterator at the next entry - /// and returns it. - /// This function must be preceeded by a call to firstEntry(), first() - /// or findRef(). - /// - KviPointerHashTableEntry<Key,T> * nextEntry() - { - if(m_uIteratorIdx >= m_uSize)return 0; - - if(m_uIteratorIdx < m_uSize) - { - KviPointerHashTableEntry<Key,T> * t = m_pDataArray[m_uIteratorIdx]->next(); - if(t)return t; - } - - m_uIteratorIdx++; - - while(m_uIteratorIdx < m_uSize && (!m_pDataArray[m_uIteratorIdx])) - { - m_uIteratorIdx++; - } - - if(m_uIteratorIdx == m_uSize)return 0; - - return m_pDataArray[m_uIteratorIdx]->first(); - - } - - /// - /// Returns the data value pointer pointed by the hash table iterator. - /// This function must be preceeded by a call to firstEntry(), first() - /// or findRef(). - /// - T * current() - { - if(m_uIteratorIdx >= m_uSize)return 0; - if(m_pDataArray[m_uIteratorIdx]) - { - KviPointerHashTableEntry<Key,T> * e = m_pDataArray[m_uIteratorIdx]->current(); - if(!e)return 0; - return e->data(); - } - return 0; - } - - /// - /// Returns the key pointed by the hash table iterator. - /// This function must be preceeded by a call to firstEntry(), first() - /// or findRef(). - /// - const Key & currentKey() - { - if(m_uIteratorIdx >= m_uSize)return kvi_hash_key_default(((Key *)NULL)); - if(m_pDataArray[m_uIteratorIdx]) - { - KviPointerHashTableEntry<Key,T> * e = m_pDataArray[m_uIteratorIdx]->current(); - if(!e)return kvi_hash_key_default(((Key *)NULL)); - return e->key(); - } - return kvi_hash_key_default(((Key *)NULL)); - } - - /// - /// Places the hash table iterator at the first entry - /// and returns the associated data value pointer. - /// - T * first() - { - m_uIteratorIdx = 0; - while(m_uIteratorIdx < m_uSize && (!m_pDataArray[m_uIteratorIdx])) - { - m_uIteratorIdx++; - } - if(m_uIteratorIdx == m_uSize)return 0; - KviPointerHashTableEntry<Key,T> * e = m_pDataArray[m_uIteratorIdx]->first(); - if(!e)return 0; - return e->data(); - } - - /// - /// Places the hash table iterator at the next entry - /// and returns the associated data value pointer. - /// This function must be preceeded by a call to firstEntry(), first() - /// or findRef(). - /// - T * next() - { - if(m_uIteratorIdx >= m_uSize)return 0; - - if(m_uIteratorIdx < m_uSize) - { - KviPointerHashTableEntry<Key,T> * t = m_pDataArray[m_uIteratorIdx]->next(); - if(t) - { - return t->data(); - } - } - - m_uIteratorIdx++; - - while(m_uIteratorIdx < m_uSize && (!m_pDataArray[m_uIteratorIdx])) - { - m_uIteratorIdx++; - } - - if(m_uIteratorIdx == m_uSize)return 0; - - KviPointerHashTableEntry<Key,T> * e = m_pDataArray[m_uIteratorIdx]->first(); - if(!e)return 0; - return e->data(); - } - - /// - /// Removes all items in the hash table and then - /// makes a complete shallow copy of the data contained in t. - /// The removed items are deleted if autodeletion is enabled. - /// The hash table iterator is invalidated. - /// Does not change autodelete flag: make sure you not delete the items twice :) - /// - void copyFrom(KviPointerHashTable<Key,T> &t) - { - clear(); - for(KviPointerHashTableEntry<Key,T> * e = t.firstEntry();e;e = t.nextEntry()) - insert(e->key(),e->data()); - } - - /// - /// Inserts a complete shallow copy of the data contained in t. - /// The hash table iterator is invalidated. - /// - void insert(KviPointerHashTable<Key,T> &t) - { - for(KviPointerHashTableEntry<Key,T> * e = t.firstEntry();e;e = t.nextEntry()) - insert(e->key(),e->data()); - } - - /// - /// Enables or disabled the autodeletion feature. - /// Items are deleted upon removal when the feature is enabled. - /// - void setAutoDelete(bool bAutoDelete) - { - m_bAutoDelete = bAutoDelete; - } - - /// - /// Creates an empty hash table. - /// Automatic deletion is enabled. - /// - /// \param uSize The number of hash buckets: does NOT necesairly need to be prime - /// \param bCaseSensitive Are the key comparisons case sensitive ? - /// \param Do we need to mantain deep copies of keys ? - /// - KviPointerHashTable(unsigned int uSize = 32,bool bCaseSensitive = true,bool bDeepCopyKeys = true) - { - m_uCount = 0; - m_bCaseSensitive = bCaseSensitive; - m_bAutoDelete = true; - m_bDeepCopyKeys = bDeepCopyKeys; - m_uSize = uSize > 0 ? uSize : 32; - m_pDataArray = new KviPointerList<KviPointerHashTableEntry<Key,T> > *[m_uSize]; - for(unsigned int i=0;i<m_uSize;i++)m_pDataArray[i] = NULL; - } - - /// - /// First creates an empty hash table - /// and then inserts a copy of all the item pointers present in t. - /// The autodelete feature is automatically disabled (take care!). - /// - KviPointerHashTable(KviPointerHashTable<Key,T> &t) - { - m_uCount = 0; - m_bAutoDelete = false; - m_bCaseSensitive = t.m_bCaseSensitive; - m_bDeepCopyKeys = t.m_bDeepCopyKeys; - m_uSize = t.m_uSize; - m_pDataArray = new KviPointerList<KviPointerHashTableEntry<Key,T> > *[m_uSize]; - for(unsigned int i=0;i<m_uSize;i++)m_pDataArray[i] = NULL; - copyFrom(t); - } - - /// - /// Destroys the hash table and all the items contained within. - /// Items are deleted if autodeletion is enabled. - /// - ~KviPointerHashTable() - { - clear(); - delete [] m_pDataArray; - } -}; - -template<typename Key,typename T> class KviPointerHashTableIterator -{ -protected: - const KviPointerHashTable<Key,T> * m_pHashTable; - unsigned int m_uEntryIndex; - KviPointerListIterator<KviPointerHashTableEntry<Key,T> > * m_pIterator; -public: - /// - /// Creates an iterator copy. - /// The new iterator points exactly to the item pointed by src. - /// - void operator = (const KviPointerHashTableIterator<Key,T> &src) - { - m_pHashTable = src.m_pHashTable; - m_uEntryIndex = src.m_uEntryIndex; - if(src.m_pIterator) - m_pIterator = new KviPointerListIterator<KviPointerHashTableEntry<Key,T> >(*(src.m_pIterator)); - else - m_pIterator = NULL; - } - - /// - /// Moves the iterator to the first element of the hash table. - /// Returns true in case of success or false if the hash table is empty. - /// - bool moveFirst() - { - if(m_pIterator) - { - delete m_pIterator; - m_pIterator = NULL; - } - - m_uEntryIndex = 0; - while((m_uEntryIndex < m_pHashTable->m_uSize) && (!(m_pHashTable->m_pDataArray[m_uEntryIndex]))) - { - m_uEntryIndex++; - } - - if(m_uEntryIndex == m_pHashTable->m_uSize) - return false; - - m_pIterator = new KviPointerListIterator<KviPointerHashTableEntry<Key,T> >(*(m_pHashTable->m_pDataArray[m_uEntryIndex])); - bool bRet = m_pIterator->moveFirst(); - if(!bRet) - { - delete m_pIterator; - m_pIterator = NULL; - } - return bRet; - } - - /// - /// Moves the iterator to the last element of the hash table. - /// Returns true in case of success or false if the hash table is empty. - /// - bool moveLast() - { - if(m_pIterator) - { - delete m_pIterator; - m_pIterator = NULL; - } - - m_uEntryIndex = m_pHashTable->m_uSize; - while(m_uEntryIndex > 0) - { - m_uEntryIndex--; - if(m_pHashTable->m_pDataArray[m_uEntryIndex]) - { - m_pIterator = new KviPointerListIterator<KviPointerHashTableEntry<Key,T> >(*(m_pHashTable->m_pDataArray[m_uEntryIndex])); - bool bRet = m_pIterator->moveLast(); - if(!bRet) - { - delete m_pIterator; - m_pIterator = NULL; - } - return bRet; - } - } - return false; - } - - /// - /// Moves the iterator to the next element of the hash table. - /// The iterator must be actually valid for this function to work. - /// Returns true in case of success or false if there is no next item. - /// - bool moveNext() - { - if(!m_pIterator) - return false; - if(m_pIterator->moveNext()) - return true; - if(m_pIterator) - { - delete m_pIterator; - m_pIterator = NULL; - } - m_uEntryIndex++; - while((m_uEntryIndex < m_pHashTable->m_uSize) && (!(m_pHashTable->m_pDataArray[m_uEntryIndex]))) - { - m_uEntryIndex++; - } - if(m_uEntryIndex == m_pHashTable->m_uSize) - return false; - m_pIterator = new KviPointerListIterator<KviPointerHashTableEntry<Key,T> >(*(m_pHashTable->m_pDataArray[m_uEntryIndex])); - bool bRet = m_pIterator->moveFirst(); - if(!bRet) - { - delete m_pIterator; - m_pIterator = NULL; - } - return bRet; - } - - /// - /// Moves the iterator to the next element of the hash table. - /// The iterator must be actually valid for this function to work. - /// Returns true in case of success or false if there is no next item. - /// This is just an alias to moveNext(). - /// - bool operator ++() - { - return moveNext(); - } - - /// - /// Moves the iterator to the previous element of the hash table. - /// The iterator must be actually valid for this function to work. - /// Returns true in case of success or false if there is no previous item. - /// - bool movePrev() - { - if(!m_pIterator) - return false; - if(m_pIterator->movePrev()) - return true; - if(m_pIterator) - { - delete m_pIterator; - m_pIterator = NULL; - } - if(m_uEntryIndex >= m_pHashTable->m_uSize) - return false; - while(m_uEntryIndex > 0) - { - m_uEntryIndex--; - if(m_pHashTable->m_pDataArray[m_uEntryIndex]) - { - m_pIterator = new KviPointerListIterator<KviPointerHashTableEntry<Key,T> >(*(m_pHashTable->m_pDataArray[m_uEntryIndex])); - bool bRet = m_pIterator->moveLast(); - if(!bRet) - { - delete m_pIterator; - m_pIterator = NULL; - } - return bRet; - } - } - return false; - } - - - /// - /// Moves the iterator to the previous element of the hash table. - /// The iterator must be actually valid for this function to work. - /// Returns true in case of success or false if there is no previous item. - /// This is just an alias to movePrev() with a different name. - /// - bool operator --() - { - return movePrev(); - } - - /// - /// Returs the value pointed by the iterator - /// or a default constructed value if the iterator is not valid. - /// This is an alias to operator *() with just a different name. - /// - T * current() const - { - return m_pIterator ? m_pIterator->current()->data() : NULL; - } - - /// - /// Returs the value pointed by the iterator - /// or a default constructed value if the iterator is not valid. - /// This is an alias to current() with just a different name. - /// - T * operator *() const - { - return m_pIterator ? m_pIterator->current()->data() : NULL; - } - - /// - /// Returs the key pointed by the iterator - /// or a default constructed key if the iterator is not valid. - /// - const Key & currentKey() const - { - return m_pIterator ? m_pIterator->current()->key() : kvi_hash_key_default(((Key *)NULL)); - } - - /// - /// Moves the iterator to the first element of the hash table. - /// Returns the first item found or NULL if the hash table is empty. - /// - T * toFirst() - { - if(!moveFirst()) - return NULL; - return current(); - } -public: - /// - /// Creates an iterator pointing to the first item in the hash table, if any. - /// - KviPointerHashTableIterator(const KviPointerHashTable<Key,T> &hTable) - { - m_pHashTable = &hTable; - m_uEntryIndex = 0; - m_pIterator = NULL; - moveFirst(); - } - - /// - /// Destroys the iterator - /// - ~KviPointerHashTableIterator() - { - if(m_pIterator) - delete m_pIterator; - } -}; - - - - -#endif //_KVI_POINTERHASHTABLE_H_ diff --git a/3.4.0/src/kvilib/core/kvi_pointerlist.h b/3.4.0/src/kvilib/core/kvi_pointerlist.h deleted file mode 100644 index 6d0f3583c6..0000000000 --- a/3.4.0/src/kvilib/core/kvi_pointerlist.h +++ /dev/null @@ -1,1069 +0,0 @@ -#ifndef _KVI_POINTERLIST_H_ -#define _KVI_POINTERLIST_H_ -//================================================================================================= -// -// File : kvi_pointerlist.h -// Creation date : Tue Jul 6 1999 14:52:20 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//================================================================================================= -//============================================================================= -// -// C++ Template based double linked pointer list class -// Original ss_list.h Created on 10 Dec 2001 -// Copyright (C) 2001-2007 Szymon Stefanek (pragma at kvirc dot net) -// Added to KVIrc on 02 Jan 2008. -// -//============================================================================= - -// Qt changes the collection classes too much and too frequently. -// I think we need to be independent of that to the maximum degree possible. -// That's why we have our own fast pointer list class. -// This does not depend on Qt AT ALL and has an interface similar -// to the Qt<=3.x series. The pointer lists with the autodelete -// feature was great and I don't completly understand why they have -// been removed from Qt4 in favor of the value based non-autodeleting -// lists... anyway: here we go :) - -#include "kvi_settings.h" - -template<typename T> class KviPointerList; -template<typename T> class KviPointerListIterator; - -#ifndef NULL - #define NULL 0 -#endif - -/// -/// \internal -/// -class KviPointerListNode -{ -public: - KviPointerListNode * m_pPrev; - void * m_pData; - KviPointerListNode * m_pNext; -}; - -/// -/// \class KviPointerListIterator -/// \brief A fast KviPointerList iterator. -/// -/// This class allows traversing the list sequentially. -/// Multilpe iterators can traverse the list at the same time. -/// -/// Iteration example 1: -/// -/// \verbatim -/// KviPointerListIterator<T> it(list); -/// for(bool b = it.moveFirst();b;b = it.moveNext()) -/// { -/// T * pData = it.data(); -/// doSomethingWithData(pData); -/// } -/// \endverbatim -/// -/// Iteration example 2: -/// -/// \verbatim -/// KviPointerListIterator<T> it(list); -/// if(it.moveFirst()) -/// { -/// do { -/// T * pData = it.data(); -/// doSomethingWithData(pData); -/// } while(it.moveNext()); -/// } -/// \endverbatim -/// -/// Iteration example 3: -/// -/// \verbatim -/// KviPointerListIterator<T> it(list.iteratorAt(10)); -/// if(it.isValid()) -/// { -/// do { -/// T * pData = it.data(); -/// doSomethingWithData(pData); -/// while(it.movePrev()); -/// } -/// \endverbatim -/// -/// Please note that you must NOT remove any item from -/// the list when using the iterators. An iterator pointing -/// to a removed item will crash your application if you use it. -/// The following code will NOT work (and crash): -/// -/// \verbatim -/// KviPointerList<T> l; -/// l.append(new KviStr("x")); -/// l.append(new KviStr("y")); -/// KviPointerListIterator<T> it(l); -/// it.moveFirst(); -/// l.removeFirst(); -/// KviStr * tmp = it.data(); <-- this will crash -/// \endverbatim -/// -/// In the rare cases in that you need to remove items -/// while traversing the list you should put them -/// in a temporary list and remove them after the iteration. -/// -/// I've choosen this way because usually you don't modify -/// the list while traversing it and a fix for this -/// would add a constant overhead to several list operation. -/// You just must take care of it yourself. -/// -/// \warning This class is not thread safe by itself. -/// -template<typename T> class KviPointerListIterator -{ -protected: - KviPointerList<T> * m_pList; - KviPointerListNode * m_pNode; -public: - /// - /// Creates an iterator copy. - /// The new iterator points exactly to the item pointed by src. - /// - KviPointerListIterator(const KviPointerListIterator<T> &src) - { - m_pList = src.m_pList; - m_pNode = src.m_pNode; - } - - /// - /// Creates an iterator for the list l. - /// The iterator points to the first list item, if any. - /// - KviPointerListIterator(KviPointerList<T> &l) - { - m_pList = (KviPointerList<T> *)&l; - m_pNode = m_pList->m_pHead; - } - - /// - /// Creates an iterator for the list l. - /// The iterator points to the specified list node. - /// - KviPointerListIterator(KviPointerList<T> &l,KviPointerListNode * pNode) - { - m_pList = (KviPointerList<T> *)&l; - m_pNode = pNode; - } - - /// - /// Creates an iterator copy. - /// The new iterator points exactly to the item pointed by src. - /// - void operator = (const KviPointerListIterator<T> &src) - { - m_pList = src.m_pList; - m_pNode = src.m_pNode; - } -public: - /// - /// Moves the iterator to the first element of the list. - /// Returns true in case of success or false if the list is empty. - /// - bool moveFirst() - { - m_pNode = m_pList->m_pHead; - return m_pNode != NULL; - } - - /// - /// Moves the iterator to the last element of the list. - /// Returns true in case of success or false if the list is empty. - /// - bool moveLast() - { - m_pNode = m_pList->m_pTail; - return m_pNode != NULL; - } - - /// - /// Moves the iterator to the next element of the list. - /// The iterator must be actually valid for this function to work. - /// Returns true in case of success or false if there is no next item. - /// - bool moveNext() - { - if(!m_pNode)return false; - m_pNode = m_pNode->m_pNext; - return m_pNode != NULL; - } - - /// - /// Moves the iterator to the next element of the list. - /// The iterator must be actually valid for this operator to work. - /// Returns true in case of success or false if there is no next item. - /// This is just a convenient alias to moveNext(). - /// - bool operator ++() - { - if(!m_pNode)return false; - m_pNode = m_pNode->m_pNext; - return m_pNode != NULL; - } - - /// - /// Moves the iterator to the previous element of the list. - /// The iterator must be actually valid for this function to work. - /// Returns true in case of success or false if there is no previous item. - /// - bool movePrev() - { - if(!m_pNode)return false; - m_pNode = m_pNode->m_pPrev; - return m_pNode != NULL; - } - - /// - /// Moves the iterator to the previous element of the list. - /// The iterator must be actually valid for this operator to work. - /// Returns true in case of success or false if there is no previous item. - /// This is just a convenient alias to movePrev(). - /// - bool operator --() - { - if(!m_pNode)return false; - m_pNode = m_pNode->m_pPrev; - return m_pNode != NULL; - } - - /// - /// Returs the value pointed by the iterator - /// or NULL if the iterator is not valid. - /// - T * current() - { - return m_pNode ? (T *)(m_pNode->m_pData) : NULL; - } - - /// - /// Returs the value pointed by the iterator - /// or NULL if the iterator is not valid. - /// This is just an alias to current(). - /// - T * operator *() - { - return m_pNode ? (T *)(m_pNode->m_pData) : NULL; - } - - /// - /// Returns true if this iterator points to a valid - /// element of the list and false otherwise. - /// - bool isValid() - { - return m_pNode != NULL; - } -}; - -/// -/// \class KviPointerList -/// \brief A template double linked list of pointers. -/// -/// The main advantage of this type of list is speed. -/// Insertion of pointers is very fast when compared -/// to the typical "copy constructor" call used -/// in the "plain type" template list implementations. -/// -/// Iterating over pointers is also very fast and this -/// class contains an internal iterator that allows to -/// write loops in a compact and clean way. -/// See the first(), next(), current() and findRef() -/// functions for the description of this feature. -/// -/// There is also a non-const external iterator -/// that you can use to traverse the list concurrently. -/// There is no const iterator (and no const access methods) -/// since the list provides the autoDelete() method -/// which vould implicitly violate constness. -/// If you have to deal with const objects then -/// you need to use a QList instead. -/// -/// Your objects also do not need to support copy constructors -/// or >= operators. This class will work fine without them -/// as opposed to a plain QList. -/// -/// This class also supports automatic deletion of the inseted items. -/// See the setAutoDelete() and autoDelete() members for the -/// description of the feature. -/// -/// Typcal usage: -/// -/// \verbatim -/// KviPointerList<MyClass> list(); -/// list.append(new MyClass()); -/// list.append(new MyClass()); -/// ... -/// for(MyClass * c = list.first();c;c = list.next())doSomethingWith(c); -/// delete list; // autodelete is set to true in the constructor -/// \endverbatim -/// -/// \warning This class is absolutely NOT thread safe. You must -/// protect concurrent access from multiple threads by -/// using an external synchronization tool (such as KviMutex). -/// -template<typename T> class KviPointerList -{ - friend class KviPointerListIterator<T>; -protected: - bool m_bAutoDelete; //< do we automatically delete items when they are removed ? - - KviPointerListNode * m_pHead; //< our list head pointer (NULL if there are no items in the list) - KviPointerListNode * m_pTail; //< our list tail - KviPointerListNode * m_pAux; //< our iteration pointer - - unsigned int m_uCount; //< the count of items in the list -protected: - /// - /// \internal - /// - /// inserts the item d before the item ref or at the beginning - /// if ref is not found in the list - /// also sets the current iteration pointer to the newly inserted item - /// - void insertBeforeSafe(KviPointerListNode * ref,const T * d) - { - m_pAux = ref; - KviPointerListNode * n = new KviPointerListNode; - n->m_pPrev = m_pAux->m_pPrev; - n->m_pNext = m_pAux; - if(m_pAux->m_pPrev) - { - m_pAux->m_pPrev->m_pNext = n; - } else { - m_pHead = n; - } - m_pAux->m_pPrev = n; - n->m_pData = (void *)d; - m_uCount++; - } - - /// - /// \internal - /// - /// Grabs the first element from the list src - /// and puts it as the first element of this list. - /// - void grabFirstAndPrepend(KviPointerList<T> * src) - { - KviPointerListNode * pNewHead = src->m_pHead; - if(!pNewHead) - return; - - if(pNewHead->m_pNext) - { - src->m_pHead = pNewHead->m_pNext; - src->m_pHead->m_pPrev = NULL; - } else { - src->m_pHead = NULL; - src->m_pTail = NULL; - } - - if(m_pHead) - { - m_pHead->m_pPrev = pNewHead; - pNewHead->m_pNext = m_pHead; - m_pHead = pNewHead; - } else { - m_pHead = pNewHead; - m_pTail = pNewHead; - m_pHead->m_pNext = NULL; - } - m_uCount++; - src->m_uCount--; - } - - /// - /// \internal - /// - /// Removes the current iteration item assuming that it is valid. - /// - void removeCurrentSafe() - { - if(m_pAux->m_pPrev) - m_pAux->m_pPrev->m_pNext = m_pAux->m_pNext; - else - m_pHead = m_pAux->m_pNext; - if(m_pAux->m_pNext) - m_pAux->m_pNext->m_pPrev = m_pAux->m_pPrev; - else - m_pTail = m_pAux->m_pPrev; - const T * pAuxData = (const T *)(m_pAux->m_pData); - delete m_pAux; - m_pAux = NULL; - m_uCount--; - if(m_bAutoDelete) - delete pAuxData; // this can cause recursion, so do it at the end - } - -public: - /// - /// Inserts the list src inside this list - /// by respecting the sort order. - /// The src list elements are removed. - /// - void merge(KviPointerList<T> * src) - { - m_pAux = m_pHead; - KviPointerListNode * n = src->m_pHead; - m_uCount += src->m_uCount; - while(m_pAux && n) - { - if(kvi_compare((const T *)(m_pAux->m_pData),(const T *)(n->m_pData)) > 0) - { - // our element is greater, n->m_pData goes first - KviPointerListNode * pNext = n->m_pNext; - n->m_pPrev = m_pAux->m_pPrev; // his prev becomes - n->m_pNext = m_pAux; - if(m_pAux->m_pPrev) - m_pAux->m_pPrev->m_pNext = n; - else - m_pHead = n; - m_pAux->m_pPrev = n; - n = pNext; - } else { - // that element is greater - m_pAux = m_pAux->m_pNext; - } - } - if(n) - { - // last items to append - if(m_pTail) - { - m_pTail->m_pNext = n; - n->m_pPrev = m_pTail; - } else { - m_pHead = n; - m_pTail = n; - n->m_pPrev = NULL; - } - m_pTail = src->m_pTail; - } - - src->m_pHead = NULL; - src->m_pTail = NULL; - src->m_uCount = 0; - } - - void swap(KviPointerList<T> * src) - { - KviPointerListNode * n = m_pHead; - m_pHead = src->m_pHead; - src->m_pHead = n; - n = m_pTail; - m_pTail = src->m_pTail; - src->m_pTail = n; - unsigned int uCount = m_uCount; - m_uCount = src->m_uCount; - src->m_uCount = uCount; - } - - - /// - /// Sorts this list in ascending order. - /// There must be an int kvi_compare(const T *p1,const T *p2) function - /// which returns a value less than, equal to - /// or greater than zero when the item p1 is considered lower than, - /// equal to or greater than p2. - /// - void sort() - { - if(m_uCount < 2)return; - - KviPointerList<T> carry; - KviPointerList<T> tmp[64]; - KviPointerList * fill = &tmp[0]; - KviPointerList * counter; - - do { - carry.grabFirstAndPrepend(this); - - for(counter = &tmp[0];counter != fill && !counter->isEmpty();++counter) - { - counter->merge(&carry); - carry.swap(counter); - } - carry.swap(counter); - if(counter == fill) - ++fill; - } while(m_uCount > 0); - - for(counter = &tmp[1];counter != fill;++counter) - counter->merge(counter-1); - swap(fill-1); - } - - /// - /// Inserts the item respecting the sorting order inside the list. - /// The list itself must be already sorted for this to work correctly. - /// There must be a int kvi_compare(const T *p1,const T * p2) - /// that returns a value less than, equal to - /// or greater than zero when the item p1 is considered lower than, - /// equal to or greater than p2. - /// - void inSort(T * t) - { - KviPointerListNode * x = m_pHead; - while(x && (kvi_compare(((T *)x->m_pData),t) > 0))x = x->m_pNext; - if(!x)append(t); - else insertBeforeSafe(x,t); - } - - /// - /// Returns true if the list is empty - /// - bool isEmpty() const - { - return (m_pHead == NULL); - } - - /// - /// Returns the count of the items in the list - /// - unsigned int count() const - { - return m_uCount; - } - - /// - /// Sets the iteration pointer to the first item in the list - /// and returns that item (or 0 if the list is empty) - /// - T * first() - { - if(!m_pHead) - { - m_pAux = NULL; - return NULL; - } - m_pAux = m_pHead; - return (T *)(m_pAux->m_pData); - } - - /// - /// Removes the first element from the list - /// and returns it to the caller. This function - /// obviously never deletes the item (regadless of autoDeletion()). - /// - T * takeFirst() - { - if(!m_pHead)return NULL; - T * pData = (T *)m_pHead->m_pData; - if(m_pHead->m_pNext) - { - m_pHead = m_pHead->m_pNext; - delete m_pHead->m_pPrev; - m_pHead->m_pPrev = NULL; - } else { - delete m_pHead; - m_pHead = NULL; - m_pTail = NULL; - } - m_uCount--; - return pData; - } - - /// - /// Returns an iterator pointing to the first item of the list. - /// - KviPointerListIterator<T> iteratorAtFirst() - { - return KviPointerListIterator<T>(*this,m_pHead); - } - - /// - /// Sets the iteration pointer to the last item in the list - /// and returns that item (or 0 if the list is empty) - /// - T * last() - { - if(!m_pTail) - { - m_pAux = NULL; - return NULL; - } - m_pAux = m_pTail; - return (T *)(m_pAux->m_pData); - } - - /// - /// Returns an iterator pointing to the first item of the list. - /// - KviPointerListIterator<T> iteratorAtLast() - { - return KviPointerListIterator<T>(*this,m_pTail); - } - - /// - /// Returns the current iteration item - /// A call to this function MUST be preceded by a call to - /// first(),last(),at() or findRef() - /// - T * current() - { - return (T *)(m_pAux->m_pData); - } - - /// - /// Returns the current iteration item - /// A call to this function should be preceded by a call to - /// first(),last(),at() or findRef(). - /// This function will return a NULL pointer if the current - /// item has been invalidated due to a remove operation. - /// - T * safeCurrent() - { - return m_pAux ? (T *)(m_pAux->m_pData) : NULL; - } - - - /// - /// Returns an iterator pointing to the current item in the list. - /// A call to this function MUST be preceded by a call to - /// first(),last(),at() or findRef() - /// - KviPointerListIterator<T> iteratorAtCurrent() - { - return KviPointerListIterator<T>(*this,m_pAux); - } - - /// - /// Sets the iteration pointer to the next item in the list - /// and returns that item (or 0 if the end of the list has been reached) - /// A call to this function MUST be preceded by a _succesfull_ call to - /// first(),last(),at() or findRef(). - /// - T * next() - { - if(!m_pAux)return NULL; - m_pAux = m_pAux->m_pNext; - if(m_pAux)return (T *)(m_pAux->m_pData); - return NULL; - } - - /// - /// Sets the iteration pointer to the previous item in the list - /// and returns that item (or 0 if the beginning of the list has been reached) - /// A call to this function MUST be preceded by a _succesfull_ call to - /// first(),last(),at() or findRef() - /// - T * prev() - { - if(!m_pAux)return NULL; - m_pAux = m_pAux->m_pPrev; - if(m_pAux)return (T *)(m_pAux->m_pData); - return NULL; - } - - /// - /// Sets the iteration pointer to the nTh item in the list - /// and returns that item (or 0 if the index is out of range) - /// - T * at(int idx) - { - T * t = first(); - int cnt = 0; - while(t) - { - if(idx == cnt)return t; - t = next(); - cnt++; - } - return 0; - } - - /// - /// Returns an iterator pointing to the item at the specified index. - /// - KviPointerListIterator<T> iteratorAt(int idx) - { - KviPointerListNode * n = m_pHead; - int cnt = 0; - while(n) - { - if(idx == cnt) - return KviPointerListIterator<T>(*this,n); - n = n->m_pNext; - cnt++; - } - return KviPointerListIterator<T>(*this,NULL); - } - - /// - /// Sets the iteration pointer to the item with pointer d - /// and returns its position (zero based index) in the list or -1 if the - /// item cannot be found - /// - int findRef(const T * d) - { - int ret = 0; - for(T * t = first();t;t = next()) - { - if(t == d)return ret; - ret++; - } - return -1; - } - - /// - /// Returns an iterator pointing to the item with pointer d. - /// - KviPointerListIterator<T> iteratorAtRef(const T * d) - { - KviPointerListNode * n = m_pHead; - while(n) - { - if(n->m_pData == d) - return KviPointerListIterator<T>(*this,n); - n = n->m_pNext; - } - return KviPointerListIterator<T>(*this,NULL); - } - - /// - /// Appends an item at the end of the list - /// - void append(const T * d) - { - if(!m_pHead) - { - m_pHead = new KviPointerListNode; - m_pHead->m_pPrev = NULL; - m_pHead->m_pNext = NULL; - m_pHead->m_pData = (void *)d; - m_pTail = m_pHead; - } else { - m_pTail->m_pNext = new KviPointerListNode; - m_pTail->m_pNext->m_pPrev = m_pTail; - m_pTail->m_pNext->m_pNext = NULL; - m_pTail->m_pNext->m_pData = (void *)d; - m_pTail = m_pTail->m_pNext; - } - m_uCount++; - } - - /// - /// Appends all the items from the list l to this list - /// - void append(KviPointerList<T> * l) - { - for(T * t = l->first();t;t = l->next())append(t); - } - - /// - /// Prepends (inserts in head position) all the items from - /// the list l to this list - /// - void prepend(KviPointerList<T> * l) - { - for(T * t = l->last();t;t = l->prev())prepend(t); - } - - /// - /// Inserts the item d in the head position - /// - void prepend(const T * d) - { - if(!m_pHead) - { - m_pHead = new KviPointerListNode; - m_pHead->m_pPrev = NULL; - m_pHead->m_pNext = NULL; - m_pHead->m_pData = (void *)d; - m_pTail = m_pHead; - } else { - m_pHead->m_pPrev = new KviPointerListNode; - m_pHead->m_pPrev->m_pNext = m_pHead; - m_pHead->m_pPrev->m_pPrev = NULL; - m_pHead->m_pPrev->m_pData = (void *)d; - m_pHead = m_pHead->m_pPrev; - m_uCount++; - } - } - - /// - /// Inserts the item d at the zero-based position - /// specified by iIndex. If the specified position - /// is out of the list then the item is appended. - /// Note that this function costs O(n). - /// It's really better to use insertAfter() or - /// insertBefore(), if possible. - /// - void insert(int iIndex,const T * d) - { - m_pAux = m_pHead; - while(m_pAux && iIndex > 0) - { - iIndex--; - m_pAux = m_pAux->m_pNext; - } - if(m_pAux) - insertBeforeSafe(m_pAux,d); - else - append(d); - } - - /// - /// Removes the firstitem (if any) - /// the item is deleted if autoDelete() is set to true - /// - bool removeFirst() - { - if(!m_pHead)return false; - const T * pAuxData; - if(m_pHead->m_pNext) - { - m_pHead = m_pHead->m_pNext; - pAuxData = (const T *)(m_pHead->m_pPrev->m_pData); - delete m_pHead->m_pPrev; - m_pHead->m_pPrev = NULL; - } else { - pAuxData = (const T *)(m_pHead->m_pData); - delete m_pHead; - m_pHead = NULL; - m_pTail = NULL; - } - m_pAux = NULL; - m_uCount--; - if(m_bAutoDelete) - delete pAuxData; - return true; - } - - /// - /// Removes the firstitem (if any) - /// the item is deleted if autoDelete() is set to true - /// - bool removeLast() - { - if(!m_pTail)return false; - const T * pAuxData; - if(m_pTail->m_pPrev) - { - m_pTail = m_pTail->m_pPrev; - pAuxData = (const T *)(m_pTail->m_pNext->m_pData); - delete m_pTail->m_pNext; - m_pTail->m_pNext = NULL; - } else { - pAuxData = (const T *)(m_pTail->m_pData); - delete m_pTail; - m_pHead = NULL; - m_pTail = NULL; - } - m_pAux = NULL; - m_uCount--; - if(m_bAutoDelete) - delete pAuxData; - return true; - } - - /// - /// Removes the item at zero-based position iIndex. - /// Does nothing and returns false if iIndex is out of the list. - /// Please note that this function costs O(n). - /// - bool remove(int iIndex) - { - m_pAux = m_pHead; - while(m_pAux && iIndex > 0) - { - iIndex--; - m_pAux = m_pAux->m_pNext; - } - if(!m_pAux) - return false; - removeCurrentSafe(); - return true; - } - - /// - /// Sets the autodelete flag - /// When this flag is on (default) , all the items - /// are deleted when removed from the list (or when the list is destroyed - /// or cleared explicitly) - /// - void setAutoDelete(bool bAutoDelete) - { - m_bAutoDelete = bAutoDelete; - } - - /// - /// Returns the autodelete flag. - /// - bool autoDelete() - { - return m_bAutoDelete; - }; - - /// - /// Removes all the items from the list - /// (the items are deleted if the autoDelete() flag is set to true) - /// - void clear() - { - while(m_pHead)removeFirst(); - } - - /// - /// Removes the current iteration item. - /// Returns true if the current iteration item was valid (and was removed) - /// and false otherwise. - /// - bool removeCurrent() - { - if(!m_pAux) - return false; - removeCurrentSafe(); - return true; - } - - /// - /// Removes the item pointed by d (if found in the list) - /// the item is deleted if the autoDelete() flag is set to true) - /// Returns true if the item was in the list and false otherwise. - /// - bool removeRef(const T * d) - { - if(findRef(d) == -1)return false; - removeCurrentSafe(); - return true; - } - - /// - /// inserts the item d after the item ref or at the end - /// if ref is not found in the list - /// also sets the current iteration pointer to the newly inserted item - /// - void insertAfter(const T * ref,const T * d) - { - if(findRef(ref) == -1) - { - append(d); - return; - } - KviPointerListNode * n = new KviPointerListNode; - n->m_pPrev = m_pAux; - n->m_pNext = m_pAux->m_pNext; - if(m_pAux->m_pNext) - m_pAux->m_pNext->m_pPrev = n; - else - m_pTail = n; - m_pAux->m_pNext = n; - n->m_pData = (void *)d; - m_uCount++; - } - - /// - /// inserts the item d before the item ref or at the beginning - /// if ref is not found in the list - /// also sets the current iteration pointer to the newly inserted item - /// - void insertBefore(const T * ref,const T * d) - { - if(findRef(ref) == -1) - { - prepend(d); - return; - } - KviPointerListNode * n = new KviPointerListNode; - n->m_pPrev = m_pAux->m_pPrev; - n->m_pNext = m_pAux; - if(m_pAux->m_pPrev) - m_pAux->m_pPrev->m_pNext = n; - else - m_pHead = n; - m_pAux->m_pPrev = n; - n->m_pData = (void *)d; - m_uCount++; - } - - /// - /// Inverts the elements in the list. - /// - void invert() - { - if(!m_pHead)return; - KviPointerListNode * oldHead = m_pHead; - KviPointerListNode * oldTail = m_pTail; - KviPointerListNode * n = m_pHead; - while(n) - { - KviPointerListNode * next = n->m_pNext; - n->m_pNext = n->m_pPrev; - n->m_pPrev = next; - n = next; - } - m_pTail = oldHead; - m_pHead = oldTail; - } - - /// - /// clears the list and inserts all the items from the list l - /// - void copyFrom(KviPointerList<T> * l) - { - clear(); - for(T * t = l->first();t;t = l->next())append(t); - } - - /// - /// equivalent to copyFrom(l) - /// - KviPointerList<T> & operator = (KviPointerList<T> &l) - { - copyFrom(&l); - return *this; - } - - /// - /// creates a template list - /// - KviPointerList<T>(bool bAutoDelete = true) - { - m_bAutoDelete = bAutoDelete; - m_pHead = NULL; - m_pTail = NULL; - m_uCount = 0; - m_pAux = NULL; - }; - - /// - /// destroys the list - /// if autoDelete() is set to true, all the items are deleted - /// - virtual ~KviPointerList<T>() - { - clear(); - }; -}; - -#define KviPointerListBase KviPointerList - -// BROKEN MSVC LINKER -#ifdef COMPILE_ON_WINDOWS - #include "kvi_string.h" - template class KVILIB_API KviPointerList<KviStr>; -#endif - -#endif //_KVI_POINTERLIST_H_ diff --git a/3.4.0/src/kvilib/core/kvi_qcstring.h b/3.4.0/src/kvilib/core/kvi_qcstring.h deleted file mode 100644 index f1b9cd25fb..0000000000 --- a/3.4.0/src/kvilib/core/kvi_qcstring.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _KVI_QCSTRING_H_ -#define _KVI_QCSTRING_H_ - -//============================================================================= -// -// File : kvi_qcstring.h -// Creation date : Thu Jan 18 2007 00:34:33 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include <q3cstring.h> // includes <qbytearray.h> - #define KviQCString QByteArray -#else - // this is dead in Qt 4.x - #include <qcstring.h> - #define KviQCString QCString -#endif - -#endif //!_KVI_QCSTRING_H_ diff --git a/3.4.0/src/kvilib/core/kvi_qstring.cpp b/3.4.0/src/kvilib/core/kvi_qstring.cpp deleted file mode 100644 index 48ce8bfa81..0000000000 --- a/3.4.0/src/kvilib/core/kvi_qstring.cpp +++ /dev/null @@ -1,1125 +0,0 @@ -//============================================================================= -// -// File : kvi_qstring.cpp -// Creation date : Mon Aug 04 2003 13:36:33 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003-2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - -//============================================================================= -// -// Helper functions for the QString class -// -//============================================================================= - -#define __KVILIB__ - - -#include "kvi_qstring.h" -#include "kvi_string.h" -#include "kvi_malloc.h" -#include "kvi_locale.h" - -#include <ctype.h> // for tolower() -#include <stdio.h> // for sprintf() -#include <qregexp.h> - -// kvi_string.cpp -extern unsigned char iso88591_toLower_map[256]; -extern unsigned char iso88591_toUpper_map[256]; - -#define MY_MIN(a,b) (((a) < (b)) ? (a) : (b)) - -namespace KviQString -{ - // The global empty (and null) string - const QString empty; - - bool equalCSN(const QString &sz1,const QString &sz2,unsigned int len) - { - if(len == 0)return true; // assume equal - const QChar * c1 = sz1.unicode(); - const QChar * c2 = sz2.unicode(); - unsigned int lmin = MY_MIN(sz1.length(),sz2.length()); - if(lmin < len)return false; - const QChar * c1e = c1 + len; - - if(!c1 || !c2)return (c1 == c2); - - while(c1 < c1e) - { - if(c1->unicode() != c2->unicode())return false; - c1++; - c2++; - } - return (c1 == c1e); - } - - bool equalCIN(const QString &sz1,const QString &sz2,unsigned int len) - { - if(len == 0)return true; // assume equal - const QChar * c1 = sz1.unicode(); - const QChar * c2 = sz2.unicode(); - unsigned int lmin = MY_MIN(sz1.length(),sz2.length()); - if(lmin < len)return false; - const QChar * c1e = c1 + len; - - if(!c1 || !c2)return (c1 == c2); - - while(c1 < c1e) - { -#ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != c2->toLower().unicode())return false; -#else - if(c1->lower().unicode() != c2->lower().unicode())return false; -#endif - c1++; - c2++; - } - return (c1 == c1e); - } - - bool equalCSN(const QString &sz1,const char * sz2,unsigned int len) - { - if(len == 0)return true; // assume equal - const QChar * c1 = sz1.unicode(); - if(sz1.length() < len)return false; - const QChar * c1e = c1 + len; - - if(!sz2)return !c1; - if(!c1)return !sz2; - - while((c1 < c1e) && (*sz2)) - { - if(c1->unicode() != *sz2)return false; - c1++; - sz2++; - } - return (c1 == c1e); - } - - bool equalCIN(const QString &sz1,const char * sz2,unsigned int len) - { - if(len == 0)return true; // assume equal - const QChar * c1 = sz1.unicode(); - if(sz1.length() < len)return false; - const QChar * c1e = c1 + len; - - if(!sz2)return !c1; - if(!c1)return !(*sz2); - - while((c1 < c1e) && (*sz2)) - { -#ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != tolower(*sz2))return false; -#else - if(c1->lower().unicode() != tolower(*sz2))return false; -#endif - c1++; - sz2++; - } - return (c1 == c1e); - } - - // sz2 is assumed to be null terminated, sz1 is not! - bool equalCIN(const QString &sz1,const QChar *sz2,unsigned int len) - { - if(len == 0)return true; // assume equal - const QChar * c1 = sz1.unicode(); - if(sz1.length() < len)return false; - const QChar * c1e = c1 + len; - - if(!sz2)return !c1; - if(!c1)return !(sz2->unicode()); - - while((c1 < c1e) && (sz2->unicode())) - { -#ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != sz2->toLower().unicode())return false; -#else - if(c1->lower().unicode() != sz2->lower().unicode())return false; -#endif - c1++; - sz2++; - } - return (c1 == c1e); - } - - QString makeSizeReadable(size_t bytes) - { - double size = bytes; - if(size<900) - return QString(__tr2qs("%1 bytes")).arg(size,0,'f',3); - - size/=1024; - if(size<900) - return QString(__tr2qs("%1 KB")).arg(size,0,'f',3); - - size/=1024; - if(size<900) - return QString(__tr2qs("%1 MB")).arg(size,0,'f',3); - - //Pirated DVD?;) - size/=1024; - if(size<900) - return QString(__tr2qs("%1 GB")).arg(size,0,'f',3); - - //Uhm.. We are downloading a whole internet:))) - size/=1024; - return QString(__tr2qs("%1 TB")).arg(size,0,'f',3); - } - - bool equalCS(const QString &sz1,const QString &sz2) - { - if(sz1.length() != sz2.length())return false; - - const QChar * c1 = sz1.unicode(); - const QChar * c2 = sz2.unicode(); - const QChar * c1e = c1 + sz1.length(); - - if(!c1 || !c2)return (c1 == c2); - - while(c1 < c1e) - { - if(c1->unicode() != c2->unicode())return false; - c1++; - c2++; - } - return (c1 == c1e); - } - - bool equalCI(const QString &sz1,const QString &sz2) - { - if(sz1.length() != sz2.length())return false; - - const QChar * c1 = sz1.unicode(); - const QChar * c2 = sz2.unicode(); - const QChar * c1e = c1 + sz1.length(); - - if(!c1 || !c2)return (c1 == c2); - - while(c1 < c1e) - { -#ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != c2->toLower().unicode())return false; -#else - if(c1->lower().unicode() != c2->lower().unicode())return false; -#endif - c1++; - c2++; - } - return (c1 == c1e); - } - - // sz2 is assumed to be null terminated, sz1 is not! - bool equalCI(const QString &sz1,const QChar *sz2) - { - const QChar * c1 = sz1.unicode(); - const QChar * c1e = c1 + sz1.length(); - - if(!c1 || !sz2)return (c1 == sz2); - - while(c1 < c1e) - { - if(!sz2->unicode())return false; // sz1 has at least another character -#ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != sz2->toLower().unicode())return false; -#else - if(c1->lower().unicode() != sz2->lower().unicode())return false; -#endif - c1++; - sz2++; - } - return (c1 == c1e) && (!sz2->unicode()); - } - - bool equalCS(const QString &sz1,const char * sz2) - { - const QChar * c1 = sz1.unicode(); - const QChar * c1e = c1 + sz1.length(); - - if(!c1)return !sz2; - - while((c1 < c1e) && (*sz2)) - { - if(c1->unicode() != *sz2)return false; - c1++; - sz2++; - } - return ((c1 == c1e) && (*sz2 == '\0')); - } - - bool equalCI(const QString &sz1,const char * sz2) - { - const QChar * c1 = sz1.unicode(); - const QChar * c1e = c1 + sz1.length(); - - if(!c1)return !sz2; - - while((c1 < c1e) && (*sz2)) - { -#ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != tolower(*sz2))return false; -#else - if(c1->lower().unicode() != tolower(*sz2))return false; -#endif - c1++; - sz2++; - } - return ((c1 == c1e) && (*sz2 == '\0')); - } - - int cmpCS(const QString &sz1,const QString &sz2) - { - const QChar * c1 = sz1.unicode(); - const QChar * c2 = sz2.unicode(); - const QChar * c1e = c1 + sz1.length(); - const QChar * c2e = c2 + sz2.length(); - - if(!c1) - { - if(!c2)return 0; - return -1; - } - if(!c2)return 1; - - - for(;;) - { - if(c1 >= c1e) - { - if(c2 < c2e)return /* 0 */ - (c2->unicode()); - return 0; - } - if(c2 >= c2e)return c1->unicode() /* - 0 */; - - int diff = c1->unicode() - c2->unicode(); - if(diff)return diff; - - c1++; - c2++; - } - - return 0; // never here - } - - int cmpCI(const QString &sz1,const QString &sz2) - { - const QChar * c1 = sz1.unicode(); - const QChar * c2 = sz2.unicode(); - const QChar * c1e = c1 + sz1.length(); - const QChar * c2e = c2 + sz2.length(); - - if(!c1) - { - if(!c2)return 0; - return -1; - } - if(!c2)return 1; - - for(;;) - { - if(c1 >= c1e) - { -#ifdef COMPILE_USE_QT4 - if(c2 < c2e)return /* 0 */ - (c2->toLower().unicode()); -#else - if(c2 < c2e)return /* 0 */ - (c2->lower().unicode()); -#endif - return 0; - } -#ifdef COMPILE_USE_QT4 - if(c2 >= c2e)return c1->toLower().unicode() /* - 0 */; -#else - if(c2 >= c2e)return c1->lower().unicode() /* - 0 */; -#endif - -#ifdef COMPILE_USE_QT4 - int diff = c1->toLower().unicode() - c2->toLower().unicode(); -#else - int diff = c1->lower().unicode() - c2->lower().unicode(); -#endif - if(diff)return diff; - - c1++; - c2++; - } - - return 0; // never here - } - - int cmpCIN(const QString &sz1,const QString &sz2,unsigned int len) - { - if(len == 0)return 0; // assume equal - unsigned int l1 = MY_MIN(len,sz1.length()); - unsigned int l = MY_MIN(l1,sz2.length()); // FIXME: THIS IS NOT OK - - const QChar * c1 = sz1.unicode(); - const QChar * c2 = sz2.unicode(); - const QChar * c1e = c1 + l; - - if(!c1) - { - if(!c2)return 0; - return -1; - } - if(!c2)return 1; - - int diff = 0; - -#ifdef COMPILE_USE_QT4 - while((c1 < c1e) && !(diff = (c1->toLower().unicode() - c2->toLower().unicode()))) -#else - while((c1 < c1e) && !(diff = (c1->lower().unicode() - c2->lower().unicode()))) -#endif - { - c1++; - c2++; - } - - return diff; - } - - void ensureLastCharIs(QString &szString,const QChar &c) - { - if(!lastCharIs(szString,c))szString.append(c); - } - - QString getToken(QString &szString,const QChar &sep) - { - int i=0; - while(i < szString.length()) - { - if(szString[i] == sep)break; - i++; - } - QString ret; - if(i == szString.length()) - { - ret = szString; - szString = ""; - } else { - ret = szString.left(i); - while(i < szString.length()) - { - if(szString[i] != sep)break; - i++; - } - if(i == szString.length())szString = ""; - else szString.remove(0,i); - } - return ret; - } - - void stripRightWhiteSpace(QString &s) - { - int iRemove = 0; - while(iRemove < s.length()) - { - if(s.at(s.length() - (iRemove + 1)).isSpace())iRemove++; - else break; - } - if(iRemove > 0)s.remove(s.length() - iRemove,iRemove); - } - - void stripRight(QString &s,const QChar &c) - { - int iRemove = 0; - while(iRemove < s.length()) - { - if(s.at(s.length() - (iRemove + 1)) == c)iRemove++; - else break; - } - if(iRemove > 0)s.remove(s.length() - iRemove,iRemove); - } - - void stripLeft(QString &s,const QChar &c) - { - int iRemove = 0; - while(iRemove < s.length()) - { - if(s[iRemove] == c) - iRemove++; - else - break; - } - if(iRemove > 0)s.remove(0,iRemove); - } - - void detach(QString &sz) - { -#ifdef COMPILE_USE_QT4 - sz.resize(sz.length()); -#else - sz.setLength(sz.length()); -#endif - } - - const QChar * nullTerminatedArray(const QString &sz) - { - //sz.setLength(sz.length()); // detach! -#ifdef COMPILE_USE_QT4 - return sz.constData(); -#else - return (const QChar *)sz.ucs2(); // MAY BE NULL! -#endif - } - - void appendNumber(QString &s,double dReal) - { - char buffer[512]; - ::sprintf(buffer,"%f",dReal); - s.append(buffer); - } - - void appendNumber(QString &s,int iInteger) - { - char buffer[64]; - ::sprintf(buffer,"%d",iInteger); - s.append(buffer); - } - - void appendNumber(QString &s,kvi_i64_t iInteger) - { - char buffer[64]; - ::sprintf(buffer,"%ld",iInteger); - s.append(buffer); - } - - void appendNumber(QString &s,kvi_u64_t uInteger) - { - char buffer[64]; - ::sprintf(buffer,"%lu",uInteger); - s.append(buffer); - } - - void appendNumber(QString &s,unsigned int uInteger) - { - char buffer[64]; - ::sprintf(buffer,"%u",uInteger); - s.append(buffer); - } - - void vsprintf(QString &s,const QString &szFmt,kvi_va_list list) - { -#define MEMINCREMENT 32 - - int reallen = 0; - int allocsize = MEMINCREMENT; - - //s.setLength(allocsize); - - const QChar * fmt = nullTerminatedArray(szFmt); - if(!fmt) - { - s = QString::null; - return; - } - - QChar * buffer = (QChar *)kvi_malloc(sizeof(QChar) * allocsize); - //QChar * p = (QChar *)s.unicode(); - - char *argString; - long argValue; - unsigned long argUValue; - - //9999999999999999999999999999999\0 - char numberBuffer[32]; //enough ? 10 is enough for 32bit unsigned int... - char *pNumBuf; - unsigned int tmp; - - QChar * p = buffer; - -#define INCREMENT_MEM \ - { \ - allocsize += MEMINCREMENT; \ - buffer = (QChar *)kvi_realloc(buffer,sizeof(QChar) * allocsize); \ - p = buffer + reallen; \ - } - -#define INCREMENT_MEM_BY(numchars) \ - { \ - allocsize += numchars + MEMINCREMENT; \ - buffer = (QChar *)kvi_realloc(buffer,sizeof(QChar) * allocsize); \ - p = buffer + reallen; \ - } - - - for(; fmt->unicode() ; ++fmt) - { - if(reallen == allocsize)INCREMENT_MEM - - //copy up to a '%' - if(fmt->unicode() != '%') - { - *p++ = *fmt; - reallen++; - continue; - } - - ++fmt; //skip this '%' - switch(fmt->unicode()) - { - case 's': // char * string - { - argString = kvi_va_arg(list,char *); - if(!argString)argString = "[!NULL!]"; - QString str(argString); - if(str.isEmpty())continue; - int len = str.length(); - const QChar * ch = str.unicode(); - if(!ch)continue; - if((allocsize - reallen) < len)INCREMENT_MEM_BY(len) - while(len--)*p++ = *ch++; - reallen += str.length(); - continue; - } - case 'S': // KviStr * string - { - KviStr * str = kvi_va_arg(list,KviStr *); - if(!str)continue; - if((allocsize - reallen) < str->len())INCREMENT_MEM_BY(str->len()) - argString = str->ptr(); - while(*argString)*p++ = QChar(*argString++); - reallen += str->len(); - continue; - } - case 'Q': // QString * string - { - QString * str = kvi_va_arg(list,QString *); - if(!str)continue; - if(str->isEmpty())continue; - int len = str->length(); - const QChar * ch = str->unicode(); - if(!ch)continue; - if((allocsize - reallen) < len)INCREMENT_MEM_BY(len) - while(len--)*p++ = *ch++; - reallen += str->length(); - continue; - } - case 'c': //char - { - // - // I'm not sure about this... - // In the linux kernel source the - // unsigned char is extracted from an integer type. - // We assume that gcc stacks a char argument - // as sizeof(int) bytes value. - // Is this always true ? - // - *p++ = (char)kvi_va_arg(list,int); - reallen++; - continue; - } - case 'q': // QChar * - { - // - // I'm not sure about this... - // In the linux kernel source the - // unsigned char is extracted from an integer type. - // We assume that gcc stacks a char argument - // as sizeof(int) bytes value. - // Is this always true ? - // - *p++ = *((QChar *)kvi_va_arg(list,QChar *)); - reallen++; - continue; - } - case 'd': //signed integer - { - argValue = kvi_va_arg(list,int); - if(argValue < 0) - { //negative integer - *p++ = '-'; - reallen++; - argValue = -argValue; //need to have it positive - // most negative integer exception (avoid completely senseless (non digit) responses) - if(argValue < 0)argValue = 0; //we get -0 here - } - //write the number in a temporary buffer - pNumBuf = numberBuffer; - do { - tmp = argValue / 10; - *pNumBuf++ = argValue - (tmp * 10) + '0'; - } while((argValue = tmp)); - //copy now.... - argUValue = pNumBuf - numberBuffer; //length of the number string - if((allocsize - reallen) < (int)argUValue)INCREMENT_MEM_BY(argUValue) - do { *p++ = QChar(*--pNumBuf); } while(pNumBuf != numberBuffer); - reallen += argUValue; - continue; - } - case 'u': //unsigned integer - { - argUValue = kvi_va_arg(list,unsigned int); //many implementations place int here - //write the number in a temporary buffer - pNumBuf = numberBuffer; - do { - tmp = argUValue / 10; - *pNumBuf++ = argUValue - (tmp * 10) + '0'; - } while((argUValue = tmp)); - //copy now.... - argValue = pNumBuf - numberBuffer; //length of the number string - if((allocsize - reallen) < argValue)INCREMENT_MEM_BY(argValue) - do { *p++ = *--pNumBuf; } while(pNumBuf != numberBuffer); - reallen += argValue; - continue; - } - case 'h': - case 'x': // hexadecimal unsigned integer - { - static char hexsmalldigits[]="0123456789abcdef"; - argUValue = kvi_va_arg(list,unsigned int); //many implementations place int here - //write the number in a temporary buffer - pNumBuf = numberBuffer; - do { - tmp = argUValue / 16; - *pNumBuf++ = hexsmalldigits[argUValue - (tmp * 16)]; - } while((argUValue = tmp)); - //copy now.... - argValue = pNumBuf - numberBuffer; //length of the number string - if((allocsize - reallen) < argValue)INCREMENT_MEM_BY(argValue) - do { *p++ = *--pNumBuf; } while(pNumBuf != numberBuffer); - reallen += argValue; - continue; - } - case 'H': - case 'X': // hexadecimal unsigned integer - { - static char hexbigdigits[]="0123456789ABCDEF"; - argUValue = kvi_va_arg(list,unsigned int); //many implementations place int here - //write the number in a temporary buffer - pNumBuf = numberBuffer; - do { - tmp = argUValue / 16; - *pNumBuf++ = hexbigdigits[argUValue - (tmp * 16)]; - } while((argUValue = tmp)); - //copy now.... - argValue = pNumBuf - numberBuffer; //length of the number string - if((allocsize - reallen) < argValue)INCREMENT_MEM_BY(argValue) - do { *p++ = *--pNumBuf; } while(pNumBuf != numberBuffer); - reallen += argValue; - continue; - } - default: //a normal percent followed by some char - { - *p++ = '%'; //write it - reallen++; - if(fmt->unicode()) - { - if(reallen == allocsize)INCREMENT_MEM - *p++ = *fmt; - reallen++; - } - continue; - } - } - } - - s.setUnicode(buffer,reallen); - kvi_free(buffer); - //s.squeeze(); - } - - - QString & sprintf(QString &s,const QString &szFmt,...) - { - kvi_va_list list; - kvi_va_start_by_reference(list,szFmt); - //print...with max 256 chars - KviQString::vsprintf(s,szFmt,list); - kvi_va_end(list); - return s; - } - - void appendFormatted(QString &s,const QString &szFmt,...) - { - QString tmp; - kvi_va_list list; - kvi_va_start_by_reference(list,szFmt); - //print...with max 256 chars - KviQString::vsprintf(tmp,szFmt,list); - kvi_va_end(list); - s.append(tmp); - } - - bool matchWildExpressionsCI(const QString &szM1,const QString &szM2) - { - //Matches two regular expressions containging wildcards (* and ?) - - // s1 - // m1 - // mask1 : *xor - // mask2 : xorand*xor - // m2 - // s2 - - // s2 - // m2 - // | - // XorT!xor@111.111.111.11 - // - // *!*@*.net - // | - // m1 - // s1 - // - -#ifdef COMPILE_USE_QT4 - const QChar * m1 = (const QChar *)szM1.constData(); - const QChar * m2 = (const QChar *)szM2.constData(); -#else - const QChar * m1 = (const QChar *)szM1.ucs2(); - const QChar * m2 = (const QChar *)szM2.ucs2(); -#endif - - if(!(m1 && m2 && (m1->unicode())))return false; - const QChar * savePos1 = 0; - const QChar * savePos2 = m2; - while(m1->unicode()) - { - //loop managed by m1 (initially first mask) - if(m1->unicode()=='*') - { - //Found a wildcard in m1 - savePos1 = ++m1; //move to the next char and save the position...this is our jolly - if(!savePos1->unicode())return true; //last was a wildcard , matches everything ahead... - savePos2 = m2+1; //next return state for the second string - continue; //and return - } - if(!m2->unicode())return false; //m2 finished and we had something to match here! -#ifdef COMPILE_USE_QT4 - if(m1->toLower()==m2->toLower()) -#else - if(m1->lower()==m2->lower()) -#endif - { - //chars matched - m1++; //Go ahead in the two strings - m2++; // - if((!(m1->unicode())) && m2->unicode() && savePos1) - { - //m1 finished , but m2 not yet and we have a savePosition for m1 (there was a wildcard)... - //retry matching the string following the * from the savePos2 (one char ahead last time) - m1 = savePos1; //back to char after wildcard - m2 = savePos2; //back to last savePos2 - savePos2++; //next savePos2 will be next char - } - } else { - if(m2->unicode() == '*') - { - //A wlidcard in the second string - //Invert the game : mask1 <-> mask2 - //mask2 now leads the game... - savePos1 = m1; //aux - m1 = m2; //...swap - m2 = savePos1; //...swap - savePos1 = m1; //sync save pos1 - savePos2 = m2 + 1; //sync save pos2 - continue; //...and again - } - // m1 != m2 , m1 != * , m2 != * - if((m1->unicode() == '?') || (m2->unicode() == '?')) - { - m1++; - m2++; - if((!(m1->unicode())) && m2->unicode() && savePos1) - { - //m1 finished , but m2 not yet and we have a savePosition for m1 (there was a wildcard)... - //retry matching the string following the * from the savePos2 (one char ahead last time) - m1 = savePos1; //back to char after wildcard - m2 = savePos2; //back to last savePos2 - savePos2++; //next savePos2 will be next char - } - } else { - if(savePos1) - { - //Have a jolly man...allow not matching... - m1 = savePos1; //go back to char after wildcard...need to rematch... - m2 = savePos2; //back to last savePos2 - savePos2++; //and set next savePos2 - } else return false; //No previous wildcards...not matched! - } - } - } - return (!(m2->unicode())); //m1 surely finished , so for the match , m2 must be finished too - } - - bool matchStringCI(const QString &szExp,const QString &szStr,bool bIsRegExp,bool bExact) - { - QString szWildcard; -#ifdef COMPILE_USE_QT4 - QChar* ptr=(QChar*)szExp.constData(); -#else - QChar* ptr=(QChar*)szExp.ucs2(); -#endif - if(!ptr) return 0; - while(ptr->unicode()) - { - if((ptr->unicode()=='[') || (ptr->unicode()==']')) - { - szWildcard.append("["); - szWildcard.append(*ptr); - szWildcard.append("]"); - } else { - szWildcard.append(*ptr); - } - ptr++; - } -#ifdef COMPILE_USE_QT4 - QRegExp re(szWildcard,Qt::CaseInsensitive,bIsRegExp ? QRegExp::RegExp : QRegExp::Wildcard); -#else - QRegExp re(szWildcard,false,!bIsRegExp); -#endif - if(bExact) return re.exactMatch(szStr); -#ifdef COMPILE_USE_QT4 - return re.indexIn(szStr) != -1; -#else - return re.search(szStr) != -1; -#endif - } - - bool matchStringCS(const QString &szExp,const QString &szStr,bool bIsRegExp,bool bExact) - { - QString szWildcard; -#ifdef COMPILE_USE_QT4 - QChar* ptr=(QChar*)szExp.constData(); -#else - QChar* ptr=(QChar*)szExp.ucs2(); -#endif - if(!ptr) return 0; - while(ptr->unicode()) - { - if((ptr->unicode()=='[')) // <-- hum ? - { - szWildcard.append("["); - szWildcard.append(*ptr); - szWildcard.append("]"); - } else { - szWildcard.append(*ptr); - } - ptr++; - } -#ifdef COMPILE_USE_QT4 - QRegExp re(szWildcard,Qt::CaseSensitive,bIsRegExp ? QRegExp::RegExp : QRegExp::Wildcard); -#else - QRegExp re(szWildcard,true,!bIsRegExp); -#endif - if(bExact) return re.exactMatch(szStr); -#ifdef COMPILE_USE_QT4 - return re.indexIn(szStr) != -1; -#else - return re.search(szStr) != -1; -#endif - } - - void cutFromFirst(QString &s,const QChar &c,bool bIncluded) - { -#ifdef COMPILE_USE_QT4 - int idx = s.indexOf(c); -#else - int idx = s.find(c); -#endif - if(idx == -1)return; - s.truncate(bIncluded ? idx : idx + 1); - } - - void cutFromLast(QString &s,const QChar &c,bool bIncluded) - { -#ifdef COMPILE_USE_QT4 - int idx = s.lastIndexOf(c); -#else - int idx = s.findRev(c); -#endif - if(idx == -1)return; - s.truncate(bIncluded ? idx : idx + 1); - } - - void cutToFirst(QString &s,const QChar &c,bool bIncluded,bool bClearIfNotFound) - { -#ifdef COMPILE_USE_QT4 - int idx = s.indexOf(c); -#else - int idx = s.find(c); -#endif - if(idx == -1) - { - if(bClearIfNotFound)s = ""; - return; - } - s.remove(0,bIncluded ? idx + 1 : idx); - } - - void cutToLast(QString &s,const QChar &c,bool bIncluded,bool bClearIfNotFound) - { -#ifdef COMPILE_USE_QT4 - int idx = s.lastIndexOf(c); -#else - int idx = s.findRev(c); -#endif - if(idx == -1) - { - if(bClearIfNotFound)s = ""; - return; - } - s.remove(0,bIncluded ? idx + 1 : idx); - } - - void cutFromFirst(QString &s,const QString &c,bool bIncluded) - { -#ifdef COMPILE_USE_QT4 - int idx = s.indexOf(c); -#else - int idx = s.find(c); -#endif - if(idx == -1)return; - s.truncate(bIncluded ? idx : idx + c.length()); - } - - void cutFromLast(QString &s,const QString &c,bool bIncluded) - { -#ifdef COMPILE_USE_QT4 - int idx = s.lastIndexOf(c); -#else - int idx = s.findRev(c); -#endif - if(idx == -1)return; - s.truncate(bIncluded ? idx : idx + c.length()); - } - - void cutToFirst(QString &s,const QString &c,bool bIncluded,bool bClearIfNotFound) - { -#ifdef COMPILE_USE_QT4 - int idx = s.indexOf(c); -#else - int idx = s.find(c); -#endif - if(idx == -1) - { - if(bClearIfNotFound)s = ""; - return; - } - s.remove(0,bIncluded ? idx + c.length() : idx); - } - - void cutToLast(QString &s,const QString &c,bool bIncluded,bool bClearIfNotFound) - { -#ifdef COMPILE_USE_QT4 - int idx = s.lastIndexOf(c); -#else - int idx = s.findRev(c); -#endif - if(idx == -1) - { - if(bClearIfNotFound)s = ""; - return; - } - s.remove(0,bIncluded ? idx + c.length() : idx); - } - - QString upperISO88591(const QString &szSrc) - { - const QChar * c = nullTerminatedArray(szSrc); - if(!c) - { - QString ret; - return ret; - } - QChar * buffer = (QChar *)kvi_malloc(sizeof(QChar) * szSrc.length()); - QChar * b = buffer; - unsigned short us = c->unicode(); - while(us) - { - if(us < 256) - *b=QChar((unsigned short)iso88591_toUpper_map[us]); - else - *b = *c; - c++; - b++; - us = c->unicode(); - } - QString ret(buffer,szSrc.length()); - kvi_free(buffer); - return ret; - } - - QString lowerISO88591(const QString &szSrc) - { - const QChar * c = nullTerminatedArray(szSrc); - if(!c) - { - QString ret; - return ret; - } - QChar * buffer = (QChar *)kvi_malloc(sizeof(QChar) * szSrc.length()); - QChar * b = buffer; - unsigned short us = c->unicode(); - while(us) - { - if(us < 256) - { - *b=QChar((unsigned short)iso88591_toLower_map[us]); - } else - *b = *c; - c++; - b++; - us = c->unicode(); - } - QString ret(buffer,szSrc.length()); - kvi_free(buffer); - return ret; - } - - void transliterate(QString &s,const QString &szToFind,const QString &szReplacement) - { - int i=0; - int il = MY_MIN(szToFind.length(),szReplacement.length()); - while(i < il) - { - int k=0; - int kl = s.length(); - while(k < kl) - { - if(s[k] == szToFind[i])s[k] = szReplacement[i]; - k++; - } - i++; - } - } - - static char hexdigits[16] = { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f' }; - - void bufferToHex(QString &szRetBuffer,const unsigned char * buffer,unsigned int len) - { -#ifdef COMPILE_USE_QT4 - szRetBuffer.resize(len * 2); -#else - szRetBuffer.setLength(len * 2); -#endif - unsigned int i=0; - while(i < (len*2)) - { - szRetBuffer[int(i)] = QChar( (unsigned int) hexdigits[(*buffer) / 16] ); - i++; - szRetBuffer[int(i)] = QChar( (unsigned int)hexdigits[(*buffer) % 16] ); - i++; - buffer++; - } - } -}; diff --git a/3.4.0/src/kvilib/core/kvi_qstring.h b/3.4.0/src/kvilib/core/kvi_qstring.h deleted file mode 100644 index d79ca91a09..0000000000 --- a/3.4.0/src/kvilib/core/kvi_qstring.h +++ /dev/null @@ -1,293 +0,0 @@ -#ifndef _KVI_QSTRING_H_ -#define _KVI_QSTRING_H_ - -//============================================================================= -// -// File : kvi_qstring.h -// Creation date : Mon Aug 04 2003 13:36:33 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003-2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - -//============================================================================= -// -// Helper functions for the QString class -// -//============================================================================= - -#include "kvi_settings.h" -#include "kvi_inttypes.h" -#include "kvi_stdarg.h" -#include "kvi_qcstring.h" - -#include <qstring.h> - -/// -/// \namespace KviQString -/// -/// \brief A namespace for QString helper functions -/// -/// This namespace contains several helper functions -/// that are used when dealing with QString. -/// -namespace KviQString -{ - extern KVILIB_API QString makeSizeReadable(size_t size); - extern KVILIB_API bool equalCS(const QString &sz1,const QString &sz2); - extern KVILIB_API bool equalCI(const QString &sz1,const QString &sz2); - extern KVILIB_API bool equalCS(const QString &sz1,const char * sz2); - extern KVILIB_API bool equalCI(const QString &sz1,const char * sz2); - // sz2 is assumed to be null terminated here! - extern KVILIB_API bool equalCI(const QString &sz1,const QChar * sz2); - inline bool equalCS(const char * sz1,const QString &sz2) - { return equalCS(sz2,sz1); }; - inline bool equalCI(const char * sz1,const QString &sz2) - { return equalCI(sz2,sz1); }; - // sz1 is assumed to be null terminated here! - inline bool equalCI(const QChar * sz1,const QString &sz2) - { return equalCI(sz2,sz1); }; - - extern KVILIB_API bool equalCSN(const QString &sz1,const QString &sz2,unsigned int len); - extern KVILIB_API bool equalCIN(const QString &sz1,const QString &sz2,unsigned int len); - extern KVILIB_API bool equalCSN(const QString &sz1,const char * sz2,unsigned int len); - extern KVILIB_API bool equalCIN(const QString &sz1,const char * sz2,unsigned int len); - // sz2 is assumed to be null terminated here! - extern KVILIB_API bool equalCIN(const QString &sz1,const QChar * sz2,unsigned int len); - inline bool equalCSN(const char * sz1,const QString &sz2,unsigned int len) - { return equalCSN(sz2,sz1,len); }; - inline bool equalCIN(const char * sz1,const QString &sz2,unsigned int len) - { return equalCIN(sz2,sz1,len); }; - // sz1 is assumed to be null terminated here! - inline bool equalCIN(const QChar * sz1,const QString &sz2,unsigned int len) - { return equalCIN(sz2,sz1,len); }; - - //note that greater here means that come AFTER in the alphabetic order - // return < 0 ---> str1 < str2 - // return = 0 ---> str1 = str2 - // return > 0 ---> str1 > str2 - extern KVILIB_API int cmpCI(const QString &sz1,const QString &sz2); - extern KVILIB_API int cmpCIN(const QString &sz1,const QString &sz2,unsigned int len); - extern KVILIB_API int cmpCS(const QString &sz1,const QString &sz2); - - extern KVILIB_API void detach(QString &sz); - - // this makes the QString sz appear as a null terminated array - // it MAY RETURN 0 when the QString is null! - extern KVILIB_API const QChar * nullTerminatedArray(const QString &sz); - - inline bool lastCharIs(QString &szString,const QChar &c) - { return szString.endsWith(c); }; - - extern KVILIB_API void ensureLastCharIs(QString &szString,const QChar &c); - - // wild expression matching - extern KVILIB_API bool matchWildExpressionsCI(const QString &szM1,const QString &szM2); - // wild or regexp matching - extern KVILIB_API bool matchStringCI(const QString &szExp,const QString &szStr,bool bIsRegExp = false,bool bExact = false); - extern KVILIB_API bool matchStringCS(const QString &szExp,const QString &szStr,bool bIsRegExp = false,bool bExact = false); - - extern KVILIB_API void vsprintf(QString &s,const QString &szFmt,kvi_va_list list); - extern KVILIB_API QString & sprintf(QString &s,const QString &szFmt,...); - extern KVILIB_API void stripRightWhiteSpace(QString &s); - extern KVILIB_API void stripLeft(QString &s,const QChar &c); - extern KVILIB_API void stripRight(QString &s,const QChar &c); - extern KVILIB_API void appendFormatted(QString &s,const QString &szFmt,...); - extern KVILIB_API void appendNumber(QString &s,double dReal); - extern KVILIB_API void appendNumber(QString &s,kvi_i64_t iInteger); - extern KVILIB_API void appendNumber(QString &s,int iInteger); - extern KVILIB_API void appendNumber(QString &s,unsigned int uInteger); - extern KVILIB_API void appendNumber(QString &s,kvi_u64_t uInteger); - - extern KVILIB_API void cutFromFirst(QString &s,const QChar &c,bool bIncluded = true); - extern KVILIB_API void cutFromLast(QString &s,const QChar &c,bool bIncluded = true); - extern KVILIB_API void cutToFirst(QString &s,const QChar &c,bool bIncluded = true,bool bClearIfNotFound = false); - extern KVILIB_API void cutToLast(QString &s,const QChar &c,bool bIncluded = true,bool bClearIfNotFound = false); - extern KVILIB_API void cutFromFirst(QString &s,const QString &c,bool bIncluded = true); - extern KVILIB_API void cutFromLast(QString &s,const QString &c,bool bIncluded = true); - extern KVILIB_API void cutToFirst(QString &s,const QString &c,bool bIncluded = true,bool bClearIfNotFound = false); - extern KVILIB_API void cutToLast(QString &s,const QString &c,bool bIncluded = true,bool bClearIfNotFound = false); - - extern KVILIB_API QString upperISO88591(const QString &szSrc); - extern KVILIB_API QString lowerISO88591(const QString &szSrc); - extern KVILIB_API QString getToken(QString &szString,const QChar &sep); - - extern KVILIB_API void transliterate(QString &s,const QString &szToFind,const QString &szReplacement); - - extern KVILIB_API void bufferToHex(QString &szRetBuffer,const unsigned char * buffer,unsigned int len); - - // a global empty string (note that this is ALSO NULL under Qt 3.x) - extern KVILIB_API const QString empty; - - /// - /// A portability wrapper which with Qt3 and Qt4. - /// Returns a lowcase version of the parameter string. - /// - inline QString toLower(const QString &s) - { -#ifdef COMPILE_USE_QT4 - return s.toLower(); -#else - return s.lower(); -#endif - } - - inline int find(const QString &s,QChar c,int index = 0,bool cs = true) - { -#ifdef COMPILE_USE_QT4 - return s.indexOf(c,index,cs ? Qt::CaseSensitive : Qt::CaseInsensitive); -#else - return s.find(c,index,cs); -#endif - } - - inline int find(const QString &s,char c,int index = 0,bool cs = true) - { -#ifdef COMPILE_USE_QT4 - return s.indexOf(c,index,cs ? Qt::CaseSensitive : Qt::CaseInsensitive); -#else - return s.find(c,index,cs); -#endif - } - - inline int find(const QString &s,const QString & str,int index = 0,bool cs = true) - { -#ifdef COMPILE_USE_QT4 - return s.indexOf(str,index,cs ? Qt::CaseSensitive : Qt::CaseInsensitive); -#else - return s.find(str,index,cs); -#endif - } - - inline int find(const QString &s,const QRegExp & rx,int index = 0) - { -#ifdef COMPILE_USE_QT4 - return s.indexOf(rx,index); -#else - return s.find(rx,index); -#endif - } - - inline int find(const QString &s,const char * str,int index = 0) - { -#ifdef COMPILE_USE_QT4 - return s.indexOf(QString(str),index); -#else - return s.find(str,index); -#endif - } - - inline int findRev(const QString &s,QChar c,int index = -1,bool cs = true) - { -#ifdef COMPILE_USE_QT4 - return s.lastIndexOf(c,index,cs ? Qt::CaseSensitive : Qt::CaseInsensitive); -#else - return s.findRev(c,index,cs); -#endif - } - - inline int findRev(const QString &s,char c,int index = -1,bool cs = true) - { -#ifdef COMPILE_USE_QT4 - return s.lastIndexOf(c,index,cs ? Qt::CaseSensitive : Qt::CaseInsensitive); -#else - return s.findRev(c,index,cs); -#endif - } - - inline int findRev(const QString &s,const QString & str,int index = -1,bool cs = true) - { -#ifdef COMPILE_USE_QT4 - return s.lastIndexOf(str,index,cs ? Qt::CaseSensitive : Qt::CaseInsensitive); -#else - return s.findRev(str,index,cs); -#endif - } - - inline int findRev(const QString &s,const QRegExp & rx,int index = -1) - { -#ifdef COMPILE_USE_QT4 - return s.lastIndexOf(rx,index); -#else - return s.findRev(rx,index); -#endif - } - - inline int findRev(const QString &s,const char * str,int index = -1) - { -#ifdef COMPILE_USE_QT4 - return s.lastIndexOf(QString(str),index); -#else - return s.findRev(str,index); -#endif - } - - inline QString trimmed(const QString &s) - { -#ifdef COMPILE_USE_QT4 - return s.trimmed(); -#else - return s.stripWhiteSpace(); -#endif - } - - // WARNING: DO NOT USE CONSTRUCTS LIKE char * c = KviQString::toUtf8(something).data(); - // They are dangerous since with many compilers the returned string gets destroyed - // at the end of the instruction and the c pointer gets thus invalidated. - // Use - // KviQCString tmp = KviQString::toUtf8(something); - // char * c = tmp.data(); - // instead. - // Yes, I know that it sucks, but it's the only way to - // transit to qt 4.x more or less cleanly... - inline KviQCString toUtf8(const QString &s) - { -#ifdef COMPILE_USE_QT4 - return s.toUtf8(); -#else - return s.utf8(); -#endif - } - - inline KviQCString toLocal8Bit(const QString &s) - { - return s.local8Bit(); - } - - inline kvi_i64_t toI64(QString &szNumber,bool * bOk) - { -#if SIZEOF_LONG_INT == 8 - return szNumber.toLong(bOk); -#else - return szNumber.toLongLong(bOk); -#endif - } - - inline kvi_u64_t toU64(QString &szNumber,bool * bOk) - { -#if SIZEOF_LONG_INT == 8 - return szNumber.toULong(bOk); -#else - return szNumber.toULongLong(bOk); -#endif - } -}; - -// QT4SUX: Because QString::null is gone. QString() is SLOWER than QString::null since it invokes a constructor and destructor. - -#endif //!_KVI_QSTRING_H_ diff --git a/3.4.0/src/kvilib/core/kvi_strasm.h b/3.4.0/src/kvilib/core/kvi_strasm.h deleted file mode 100644 index 157c99bebb..0000000000 --- a/3.4.0/src/kvilib/core/kvi_strasm.h +++ /dev/null @@ -1,194 +0,0 @@ -#ifndef _KVI_STRASM_H_ -#define _KVI_STRASM_H_ - -//============================================================================= -// -// File : kvi_strasm.h -// Creation date : Sun Jun 18 2000 18:38:26 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - -//============================================================================= -// -// Inline assembly implementations of the commonly used string functions -// These will work only on i386 based machines and can be compiled -// only by gcc -// -//============================================================================= - -extern inline bool kvi_strEqualCS(const char * str1,const char * str2) -{ - // An instruction pattern is really useful in this case. - // When inlining, GCC can optimize to load esi and edi - // directly with the strings , without pushing and getting it - // from the stack... - register bool eax; - __asm__ __volatile__ ( - " cld\n" - "1:\n" - " lodsb %%ds:(%%esi),%%al\n" - " scasb %%es:(%%edi),%%al\n" - " jne 2f\n" - " testb %%al,%%al\n" - " jne 1b\n" - " movl $0x1,%%eax\n" - " jmp 3f\n" - "2:\n" - " xorl %%eax,%%eax\n" - "3:" - : "=a" (eax), "=&S" (str1), "=&D" (str2) - : "1" (str1), "2" (str2) - ); - return eax; -} - -extern inline bool kvi_strEqualCSN(const char * str1,const char * str2,int len) -{ - register bool eax; - __asm__ __volatile__ ( - "1:\n" - " decl %3\n" - " js 2f\n" - " movb (%1),%%al\n" - " incl %1\n" - " cmpb %%al,(%2)\n" - " jne 3f\n" - " incl %2\n" - " testb %%al,%%al\n" - " jne 1b\n" - "2:\n" - " movl $0x1,%%eax\n" - " jmp 4f\n" - "3:\n" - " xorl %%eax,%%eax\n" - "4:\n" - : "=a" (eax), "=r" (str1), "=r" (str2), "=r" (len) - : "1" (str1), "2" (str2), "3" (len) - ); - return eax; -} - -// OPTIMIZATION -// The following two functions are used to compare a variable string with one in that -// only A-Z<->a-z case insensivity is significant. -// For example -// kvi_strEqualNoLocalCI("a string that does not contain any strange char",str2) -// will always give the correct result -// These will NOT work with localizable characters: -// 'a' with umlaut will be not equal to 'A' with umlaut - -extern inline bool kvi_strEqualNoLocaleCI(const char *str1,const char *str2) -{ - // Trivial implementation - // Ignores completely locales....only A-Z chars are transformed to a-z - // Anyway...it will work for IRC :) - register int reg; - register bool eax; - __asm__ __volatile__ ( - "1:\n" - " movb (%2),%%al\n" - " cmpb $65,%%al\n" - " jb 2f\n" - " cmpb $90,%%al\n" - " ja 2f\n" - " addb $32,%%al\n" - "2:\n" - " movb (%3),%b1\n" - " cmpb $65,%b1\n" - " jb 3f\n" - " cmpb $90,%b1\n" - " ja 3f\n" - " addb $32,%b1\n" - "3:\n" - " cmpb %%al,%b1\n" - " jne 4f\n" - " incl %2\n" - " incl %3\n" - " testb %%al,%%al\n" - " jne 1b\n" - " movl $1,%%eax\n" - " jmp 5f\n" - "4:\n" - " xorl %%eax,%%eax\n" - "5:\n" - : "=a" (eax), "=q" (reg), "=r" (str1), "=r" (str2) - : "2" (str1), "3" (str2) - ); - return eax; -} - -extern inline bool kvi_strEqualNoLocaleCIN(const char *str1,const char *str2,int len) -{ - - register int reg; - register bool eax; - __asm__ __volatile__ ( - "1:\n" - " decl %4\n" - " js 4f\n" - " movb (%2),%%al\n" - " cmpb $65,%%al\n" - " jb 2f\n" - " cmpb $90,%%al\n" - " ja 2f\n" - " addb $32,%%al\n" - "2:\n" - " movb (%3),%b1\n" - " cmpb $65,%b1\n" - " jb 3f\n" - " cmpb $90,%b1\n" - " ja 3f\n" - " addb $32,%b1\n" - "3:\n" - " cmpb %%al,%b1\n" - " jne 5f\n" - " incl %2\n" - " incl %3\n" - " testb %%al,%%al\n" - " jne 1b\n" - "4:\n" - " movl $1,%%eax\n" - " jmp 6f\n" - "5:\n" - " xorl %%eax,%%eax\n" - "6:\n" - : "=a" (eax), "=q" (reg), "=r" (str1), "=r" (str2), "=r" (len) - : "2" (str1), "3" (str2), "4" (len) - ); - return eax; -} - - -extern inline int kvi_strLen(const char * str) -{ - register int ecx; - __asm__ __volatile__( - " cld\n" - " repne\n" - " scasb\n" - " notl %0\n" - " decl %0" - : "=c" (ecx), "=&D" (str) - : "0" (0xffffffff), "1" (str), "a" (0) - ); - return ecx; -} - -#endif //_KVI_STRASM_H_ diff --git a/3.4.0/src/kvilib/core/kvi_string.cpp b/3.4.0/src/kvilib/core/kvi_string.cpp deleted file mode 100644 index dce203886e..0000000000 --- a/3.4.0/src/kvilib/core/kvi_string.cpp +++ /dev/null @@ -1,3063 +0,0 @@ -//============================================================================= -// -// File : kvi_string.cpp -// Creation date : Fri Mar 19 1999 03:20:45 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#define _KVI_DEBUG_CHECK_RANGE_ -#include "kvi_debug.h" - -#define _KVI_STRING_CPP_ -#include "kvi_string.h" - -#include "kvi_memmove.h" -#include "kvi_malloc.h" - -#include "kvi_qstring.h" - -kvi_wslen_t kvi_wstrlen(const kvi_wchar_t * str) -{ - const kvi_wchar_t * ptr = str; - while(*ptr)ptr++; - return (ptr - str); -} - - -// %s = Latin1 char string (can't be null) -// %d = signed int (short,char) -// %u = unsigned int (short,char) -// %c = char value (kvi_wchar_t value) - -// %f = double value - -// %w = kvi_wchar_t string (can't be null) - -// %S = Latin1 KviStr pointer (#ifdef WSTRINGCONFIG_USE_KVISTR) : can't be NULL! -// %W = KviWStr pointer : can't be NULL! -// %Q = QString pointer : can't be NULL! - -#define _WSTRING_WMEMCPY(_dst,_src,_len) kvi_fastmoveodd((void *)(_dst),(const void *)(_src),sizeof(kvi_wchar_t) * (_len)) -#define _WSTRING_STRLEN(_str) kvi_strLen(_str) - -#define WVSNPRINTF_BODY \ -\ - register kvi_wchar_t *p; \ - long int argValue; \ - unsigned long argUValue; \ -\ - kvi_wchar_t numberBuffer[32]; \ - kvi_wchar_t *pNumBuf; \ - unsigned int tmp; \ -\ - for(p=buffer ; *fmt ; ++fmt) \ - { \ - if(len < 1)return (-1); \ -\ - if(*fmt != '%') \ - { \ - *p++ = *fmt; \ - --len; \ - continue; \ - } \ -\ - ++fmt; \ -\ - switch(*fmt) \ - { \ - case 's': \ - { \ - char * argString = kvi_va_arg(list,char *); \ - argValue = (int)_WSTRING_STRLEN(argString); \ - if(len <= argValue)return (-1); \ - while(*argString)*p++ = *argString++; \ - len -= argValue; \ - } \ - break; \ - case 'S': \ - { \ - KviStr * pString = kvi_va_arg(list,KviStr *); \ - char * argString = pString->ptr(); \ - if(len <= ((int)(pString->len())))return (-1); \ - while(*argString)*p++ = *argString++; \ - len -= pString->len(); \ - } \ - break; \ - case 'Q': \ - { \ - QString * pString = kvi_va_arg(list,QString *); \ - if(pString->length() > 0) \ - { \ - if(len <= ((int)(pString->length())))return (-1); \ - _WSTRING_WMEMCPY(p,pString->unicode(),pString->length()); \ - p += pString->length(); \ - len -= pString->length(); \ - } \ - } \ - break; \ - case 'd': \ - argValue = kvi_va_arg(list,int); \ - if(argValue < 0) \ - { \ - *p++ = '-'; \ - if(--len == 0)return (-1); \ - argValue = -argValue; \ - if(argValue < 0)argValue = 0; \ - } \ - pNumBuf = numberBuffer; \ - do { \ - tmp = argValue / 10; \ - *pNumBuf++ = argValue - (tmp * 10) + '0'; \ - } while((argValue = tmp)); \ - argUValue = pNumBuf - numberBuffer; \ - if(((unsigned int)len) <= argUValue)return (-1); \ - do { \ - *p++ = *--pNumBuf; \ - } while(pNumBuf != numberBuffer); \ - len -= argUValue; \ - break; \ - case 'u': \ - argUValue = kvi_va_arg(list,unsigned int); \ - pNumBuf = numberBuffer; \ - do { \ - tmp = argUValue / 10; \ - *pNumBuf++ = argUValue - (tmp * 10) + '0'; \ - } while((argUValue = tmp)); \ - argValue = pNumBuf - numberBuffer; \ - if(len <= argValue)return (-1); \ - do { \ - *p++ = *--pNumBuf; \ - } while(pNumBuf != numberBuffer); \ - len -= argValue; \ - break; \ - case 'f': \ - { \ - double dVal = (double)kvi_va_arg(list,double); \ - char sprintfBuffer[32]; \ - argValue = sprintf(sprintfBuffer,"%f",dVal); \ - if(len <= argValue)return (-1); \ - char * pSprintfBuffer = sprintfBuffer; \ - while(*pSprintfBuffer)*p++ = *pSprintfBuffer++; \ - len -= argValue; \ - } \ - break; \ - case 'c': \ - *p++ = (kvi_wchar_t)kvi_va_arg(list,int); \ - --len; \ - break; \ - default: \ - *p++ = '%'; \ - if(--len == 0)return (-1); \ - if(*fmt){ \ - *p++ = *fmt; \ - --len; \ - } \ - break; \ - } \ - continue; \ - } \ - if(len < 1)return (-1); \ - *p = 0; \ - return p-buffer; - -int kvi_wvsnprintcf(kvi_wchar_t *buffer,kvi_wslen_t len,const char *fmt,kvi_va_list list) -{ - WVSNPRINTF_BODY -} - -int kvi_wvsnprintf(kvi_wchar_t *buffer,kvi_wslen_t len,const kvi_wchar_t *fmt,kvi_va_list list) -{ - WVSNPRINTF_BODY -} - -bool kvi_qstringEqualCI(const QString &s1,const QString &s2) -{ - const QChar * p1 = s1.unicode(); - const QChar * p2 = s2.unicode(); - int l = s1.length() < s2.length() ? s1.length() : s2.length(); -#ifdef COMPILE_USE_QT4 - while(l-- && (p1->toLower() == p2->toLower()))p1++,p2++; -#else - while(l-- && (p1->lower() == p2->lower()))p1++,p2++; -#endif - if(l==-1)return true; - return false; -} - -bool kvi_matchStringCI(register const char * exp,register const char * str) -{ - // a - // . - // exp = a*x?mem*a - // str = arexoxmexamemizazv - // . - // n - const char * afterWild = 0; - const char * nextStrToCheck = 0; - - while(*exp) - { - if(*exp == '*') - { - // exp is a wildcard... - afterWild = ++exp; - nextStrToCheck = str + 1; - if(!(*exp))return true; // and it's the last char in the string: matches everything ahead - continue; - } - - if(!(*str))return false; // str finished but we had something to match :( - - if(tolower(*exp) == tolower(*str)) - { - // chars matched - ++exp; - ++str; - if((!(*exp)) && *str)goto check_recovery; - continue; - } - - if(*exp == '?') - { - // any-char wildcard - ++exp; - ++str; - continue; - } - -check_recovery: - // chars unmatched!!! - if(afterWild) - { - // we had a wildcard in exp... - // let's use this jolly then - exp = afterWild; - str = nextStrToCheck; - nextStrToCheck++; - // and try to compare now - continue; - } - - return false; // no match :( - } - return (!(*str)); -} - - -bool kvi_matchStringCS(register const char * exp,register const char * str) -{ - // a - // . - // exp = a*x?mem*a - // str = arexoxmexamemizazv - // . - // n - const char * afterWild = 0; - const char * nextStrToCheck = 0; - - while(*exp) - { - if(*exp == '*') - { - // exp is a wildcard... - afterWild = ++exp; - nextStrToCheck = str + 1; - if(!(*exp))return true; // and it's the last char in the string: matches everything ahead - continue; - } - - if(!(*str))return false; // str finished but we had something to match :( - - if(*exp == *str) - { - // chars matched - ++exp; - ++str; - if((!(*exp)) && *str)goto check_recovery; - continue; - } - - if(*exp == '?') - { - // any-char wildcard - ++exp; - ++str; - continue; - } - -check_recovery: - // chars unmatched!!! - if(afterWild) - { - // we had a wildcard in exp... - // let's use this jolly then - exp = afterWild; - str = nextStrToCheck; - nextStrToCheck++; - // and try to compare now - continue; - } - - return false; // no match :( - } - return (!(*str)); -} - - - -bool kvi_matchStringWithTerminator(register const char * exp,register const char * str,char terminator,const char ** r1,const char ** r2) -{ -#define NOT_AT_END(__str) (*__str && (*__str != terminator)) - - // a - // . - // exp = a*x?mem*a - // str = arexoxmexamemizazv - // . - // n - const char * afterWild = 0; - const char * nextStrToCheck = 0; - - while(NOT_AT_END(exp)) - { - if(*exp == '*') - { - // exp is a wildcard... - afterWild = ++exp; - nextStrToCheck = str + 1; - if(!(NOT_AT_END(exp))) - { - while(NOT_AT_END(str))str++; - *r1 = exp; - *r2 = str; - return true; // and it's the last char in the string: matches everything ahead - } - continue; - } - - if(!(*str))return false; // str finished but we had something to match :( - - if(tolower(*exp) == tolower(*str)) - { - // chars matched - ++exp; - ++str; - if((!(NOT_AT_END(exp))) && NOT_AT_END(str))goto check_recovery; - continue; - } - - if(*exp == '?') - { - // any-char wildcard - ++exp; - ++str; - continue; - } - -check_recovery: - // chars unmatched!!! - if(afterWild) - { - // we had a wildcard in exp... - // let's use this jolly then - exp = afterWild; - str = nextStrToCheck; - nextStrToCheck++; - // and try to compare now - continue; - } - - return false; // no match :( - } - *r1 = exp; - *r2 = str; - return (!(NOT_AT_END(str))); - -#undef NOT_AT_END -} - -bool kvi_matchWildExpr(register const char *m1,register const char *m2) -{ - //Matches two regular expressions containging wildcards (* and ?) - - // s1 - // m1 - // mask1 : *xor - // mask2 : xorand*xor - // m2 - // s2 - - // s2 - // m2 - // | - // XorT!xor@111.111.111.11 - // - // *!*@*.net - // | - // m1 - // s1 - // - - if(!(m1 && m2 && (*m1)))return false; - const char * savePos1 = 0; - const char * savePos2 = m2; - while(*m1) - { - //loop managed by m1 (initially first mask) - if(*m1=='*') - { - //Found a wildcard in m1 - savePos1 = ++m1; //move to the next char and save the position...this is our jolly - if(!*savePos1)return true; //last was a wildcard , matches everything ahead... - savePos2 = m2+1; //next return state for the second string - continue; //and return - } - if(!(*m2))return false; //m2 finished and we had something to match here! - if(tolower(*m1)==tolower(*m2)) - { - //chars matched - m1++; //Go ahead in the two strings - m2++; // - if((!(*m1)) && *m2 && savePos1) - { - //m1 finished , but m2 not yet and we have a savePosition for m1 (there was a wildcard)... - //retry matching the string following the * from the savePos2 (one char ahead last time) - m1 = savePos1; //back to char after wildcard - m2 = savePos2; //back to last savePos2 - savePos2++; //next savePos2 will be next char - } - } else { - if(*m2 == '*') - { - //A wlidcard in the second string - //Invert the game : mask1 <-> mask2 - //mask2 now leads the game... - savePos1 = m1; //aux - m1 = m2; //...swap - m2 = savePos1; //...swap - savePos1 = m1; //sync save pos1 - savePos2 = m2 + 1; //sync save pos2 - continue; //...and again - } - // m1 != m2 , m1 != * , m2 != * - if((*m1 == '?') || (*m2 == '?')) - { - m1++; - m2++; - if((!(*m1)) && *m2 && savePos1) - { - //m1 finished , but m2 not yet and we have a savePosition for m1 (there was a wildcard)... - //retry matching the string following the * from the savePos2 (one char ahead last time) - m1 = savePos1; //back to char after wildcard - m2 = savePos2; //back to last savePos2 - savePos2++; //next savePos2 will be next char - } - } else { - if(savePos1) - { - //Have a jolly man...allow not matching... - m1 = savePos1; //go back to char after wildcard...need to rematch... - m2 = savePos2; //back to last savePos2 - savePos2++; //and set next savePos2 - } else return false; //No previous wildcards...not matched! - } - } - } - return (!(*m2)); //m1 surely finished , so for the match , m2 must be finished too - -} - -/* - - WARNING: Don't remove: working code but actually unused in KVIrc - Later it might become useful - -bool kvi_matchWildExprCS(register const char *m1,register const char *m2) -{ - if(!(m1 && m2 && (*m1)))return false; - const char * savePos1 = 0; - const char * savePos2 = m2; - while(*m1){ //loop managed by m1 (initially first mask) - if(*m1=='*'){ - //Found a wildcard in m1 - savePos1 = ++m1; //move to the next char and save the position...this is our jolly - if(!*savePos1)return true; //last was a wildcard , matches everything ahead... - savePos2 = m2+1; //next return state for the second string - continue; //and return - } - if(!(*m2))return false; //m2 finished and we had something to match here! - if((*m1)==(*m2)){ - //chars matched - m1++; //Go ahead in the two strings - m2++; // - if((!(*m1)) && *m2 && savePos1){ - //m1 finished , but m2 not yet and we have a savePosition for m1 (there was a wildcard)... - //retry matching the string following the * from the savePos2 (one char ahead last time) - m1 = savePos1; //back to char after wildcard - m2 = savePos2; //back to last savePos2 - savePos2++; //next savePos2 will be next char - } - } else { - if(*m2 == '*'){ - //A wlidcard in the second string - //Invert the game : mask1 <-> mask2 - //mask2 now leads the game... - savePos1 = m1; //aux - m1 = m2; //...swap - m2 = savePos1; //...swap - savePos1 = m1; //sync save pos1 - savePos2 = m2 + 1; //sync save pos2 - continue; //...and again - } - if(savePos1){ //Have a jolly man...allow not matching... - m1 = savePos1; //go back to char after wildcard...need to rematch... - m2 = savePos2; //back to last savePos2 - savePos2++; //and set next savePos2 - } else return false; //No previous wildcards...not matched! - } - } - return (!(*m2)); //m1 surely finished , so for the match , m2 must be finished too - -} -*/ - -bool kvi_matchWildExprWithTerminator(register const char *m1,register const char *m2,char terminator, - const char ** r1,const char ** r2) -{ - //Matches two regular expressions containging wildcards - -#define NOT_AT_END(__str) (*__str && (*__str != terminator)) - - bool bSwapped = false; - if(!(m1 && m2 && (NOT_AT_END(m1))))return false; - const char * savePos1 = 0; - const char * savePos2 = m2; - while(NOT_AT_END(m1)) - { - //loop managed by m1 (initially first mask) - if(*m1=='*') - { - //Found a wildcard in m1 - savePos1 = ++m1; //move to the next char and save the position...this is our jolly - if(!NOT_AT_END(savePos1)) - { - //last was a wildcard , matches everything ahead... - while(NOT_AT_END(m2))m2++; - *r1 = bSwapped ? m2 : m1; - *r2 = bSwapped ? m1 : m2; - return true; - } - savePos2 = m2+1; //next return state for the second string - continue; //and return - } - if(!NOT_AT_END(m2))return false; //m2 finished and we had something to match here! - if(tolower(*m1)==tolower(*m2)) - { - //chars matched - m1++; //Go ahead in the two strings - m2++; // - if((!NOT_AT_END(m1)) && NOT_AT_END(m2) && savePos1) - { - //m1 finished , but m2 not yet and we have a savePosition for m1 (there was a wildcard)... - //retry matching the string following the * from the savePos2 (one char ahead last time) - m1 = savePos1; //back to char after wildcard - m2 = savePos2; //back to last savePos2 - savePos2++; //next savePos2 will be next char - } - } else { - if(*m2 == '*') - { - //A wlidcard in the second string - //Invert the game : mask1 <-> mask2 - //mask2 now leads the game... - bSwapped = !bSwapped; - savePos1 = m1; //aux - m1 = m2; //...swap - m2 = savePos1; //...swap - savePos1 = m1; //sync save pos1 - savePos2 = m2 + 1; //sync save pos2 - continue; //...and again - } - // m1 != m2 , m1 != * , m2 != * - if((*m1 == '?') || (*m2 == '?')) - { - m1++; - m2++; - if((!NOT_AT_END(m1)) && NOT_AT_END(m2) && savePos1) - { - //m1 finished , but m2 not yet and we have a savePosition for m1 (there was a wildcard)... - //retry matching the string following the * from the savePos2 (one char ahead last time) - m1 = savePos1; //back to char after wildcard - m2 = savePos2; //back to last savePos2 - savePos2++; //next savePos2 will be next char - } - } else { - if(savePos1) - { - //Have a jolly man...allow not matching... - m1 = savePos1; //go back to char after wildcard...need to rematch... - m2 = savePos2; //back to last savePos2 - savePos2++; //and set next savePos2 - } else return false; //No previous wildcards...not matched! - } - } - } - *r1 = bSwapped ? m2 : m1; - *r2 = bSwapped ? m1 : m2; - - return (!NOT_AT_END(m2)); //m1 surely finished , so for the match , m2 must be finished too - -#undef NOT_AT_END -} - - - -const char * kvi_extractToken(KviStr &str,const char *aux_ptr,char sep) -{ - __range_valid(aux_ptr); - while(*aux_ptr && (*aux_ptr == sep))aux_ptr++; - const char *p=aux_ptr; - while(*p && (*p != sep))p++; - str.m_len=p-aux_ptr; - str.m_ptr = (char *)kvi_realloc(str.m_ptr,str.m_len+1); - kvi_fastmove(str.m_ptr,aux_ptr,str.m_len); - *(str.m_ptr+str.m_len)='\0'; - while(*p && (*p == sep))p++; - return p; -} - -const char * kvi_extractUpTo(KviStr &str,const char *aux_ptr,char sep) -{ - __range_valid(aux_ptr); - const char *p=aux_ptr; - while(*p && (*p != sep))p++; - str.m_len=p-aux_ptr; - str.m_ptr = (char *)kvi_realloc(str.m_ptr,str.m_len+1); - kvi_fastmove(str.m_ptr,aux_ptr,str.m_len); - *(str.m_ptr+str.m_len)='\0'; - return p; -} - -int kvi_vsnprintf(char *buffer,int len,const char *fmt,kvi_va_list list) -{ - __range_valid(fmt); - __range_valid(buffer); - __range_valid(len > 0); //printing 0 characters is senseless - - register char *p; - char *argString; - long argValue; - unsigned long argUValue; - - //9999999999999999999999999999999\0 - char numberBuffer[32]; //enough ? 10 is enough for 32bit unsigned int... - char *pNumBuf; - unsigned int tmp; - - - for(p=buffer ; *fmt ; ++fmt) - { - if(len < 1)return (-1); //not enough space ... (in fact this could be len < 2 for the terminator) - //copy up to a '%' - if(*fmt != '%') - { - *p++ = *fmt; - --len; - continue; - } - - ++fmt; //skip this '%' - switch(*fmt) - { - case 's': //string - argString = kvi_va_arg(list,char *); - if(!argString)continue; - argValue = (long)strlen(argString); - //check for space... - if(len <= argValue)return (-1); //not enough space for buffer and terminator - while(*argString)*p++ = *argString++; - len -= argValue; - continue; - case 'd': //signed integer - argValue = kvi_va_arg(list,int); - if(argValue < 0){ //negative integer - *p++ = '-'; - if(--len == 0)return (-1); - argValue = -argValue; //need to have it positive - // most negative integer exception (avoid completely senseless (non digit) responses) - if(argValue < 0)argValue = 0; //we get -0 here - } - //write the number in a temporary buffer - pNumBuf = numberBuffer; - do { - tmp = argValue / 10; - *pNumBuf++ = argValue - (tmp * 10) + '0'; - } while((argValue = tmp)); - //copy now.... - argUValue = pNumBuf - numberBuffer; //length of the number string - if(((uint)len) <= argUValue)return (-1); //not enough space for number and terminator - do { *p++ = *--pNumBuf; } while(pNumBuf != numberBuffer); - len -= argUValue; - continue; - case 'u': //unsigned integer - argUValue = kvi_va_arg(list,unsigned int); //many implementations place int here - //write the number in a temporary buffer - pNumBuf = numberBuffer; - do { - tmp = argUValue / 10; - *pNumBuf++ = argUValue - (tmp * 10) + '0'; - } while((argUValue = tmp)); - //copy now.... - argValue = pNumBuf - numberBuffer; //length of the number string - if(len <= argValue)return (-1); //not enough space for number and terminator - do { *p++ = *--pNumBuf; } while(pNumBuf != numberBuffer); - len -= argValue; - continue; - case 'c': //char - // - // I'm not sure about this... - // In the linux kernel source the - // unsigned char is extracted from an integer type. - // We assume that gcc stacks a char argument - // as sizeof(int) bytes value. - // Is this always true ? - // - *p++ = (char)kvi_va_arg(list,int); - --len; - continue; - case 'Q': // QString! (this should almost never happen) - { - QString * s = kvi_va_arg(list,QString *); - KviQCString cs = KviQString::toUtf8(*s); - const char * t = cs.data(); - if(!t)continue; // nothing to do - //check for space... - if(len <= (int)cs.length())return (-1); //not enough space for buffer and terminator - while(*t)*p++ = *t++; - len -= cs.length(); - continue; - } - default: //a normal percent - *p++ = '%'; //write it - if(--len == 0)return (-1); //not enough space for next char or terminator - if(*fmt){ //this if is just in case that we have a % at the end of the string. - *p++ = *fmt; //and write this char - --len; - } - continue; - } - } - if(len < 1)return (-1); //missing space for terminator - *p = '\0'; - return p-buffer; -} - -// -// Nearly the same as the above function... -// - -int kvi_irc_vsnprintf(char *buffer,const char *fmt,kvi_va_list list,bool *bTruncated) -{ - __range_valid(fmt); - __range_valid(buffer); - if( !( buffer && fmt) ) return false; - register char *p; - char *argString; - long argValue; - unsigned long argUValue; - char numberBuffer[64]; //enough ? 10 is enough for 32bit unsigned int... - char *pNumBuf; - unsigned int tmp; - *bTruncated = false; - int len = 512; - - for (p=buffer ; *fmt ; ++fmt) { - if(len < 3)goto truncate; - //copy up to a '%' - if (*fmt != '%') { - *p++ = *fmt; - --len; - continue; - } - ++fmt; //skip this '%' - switch(*fmt){ - case 's': //string - argString = kvi_va_arg(list,char *); - if(!argString)continue; - //check for space... - while(*argString){ - *p++ = *argString++; - if(--len < 3)goto truncate; - } - continue; - case 'Q': // QString! (this should almost never happen) - { - QString * s = kvi_va_arg(list,QString *); - KviQCString cs = KviQString::toUtf8(*s); - const char * t = cs.data(); - if(!t)continue; // nothing to do - while(*t) - { - *p++ = *t++; - if(--len < 3)goto truncate; - } - continue; - } - case 'd': //signed integer - argValue = kvi_va_arg(list,int); - if(argValue < 0){ //negative integer - *p++ = '-'; - if(--len < 3)goto truncate; //place just for CRLF - argValue = -argValue; //need to have it positive - if(argValue < 0)argValue = 0; // -0 (hack the exception) - } - //write the number in a temporary buffer - pNumBuf = numberBuffer; - do { - tmp = argValue / 10; - *pNumBuf++ = argValue - (tmp * 10) + '0'; - } while((argValue = tmp)); - //copy now.... - do { - *p++ = *--pNumBuf; - if(--len < 3)goto truncate; - } while(pNumBuf != numberBuffer); - continue; - case 'u': //unsigned integer - argUValue = kvi_va_arg(list,unsigned int); //many implementations place int here - //write the number in a temporary buffer - pNumBuf = numberBuffer; - do { - tmp = argUValue / 10; - *pNumBuf++ = argUValue - (tmp * 10) + '0'; - } while((argUValue = tmp)); - //copy now.... - if(--len < 3)goto truncate; //no place for digits - do { - *p++ = *--pNumBuf; - if(--len < 3)goto truncate; - } while(pNumBuf != numberBuffer); - continue; - case 'c': //char - *p++ = (char)kvi_va_arg(list,int); - --len; - continue; - default: //a normal percent - *p++ = '%'; //write it - if(--len < 3)goto truncate; //not enough space for next char - if(*fmt){ //this if is just in case that we have a % at the end of the string. - *p++ = *fmt; //and write this char - --len; - } - continue; - } - } - //succesfull finish - __range_valid(len >= 2); - *p++ = '\r'; - *p = '\n'; - return ((p-buffer)+1); -truncate: - __range_valid(len >= 2); - *bTruncated = true; - *p++ = '\r'; - *p = '\n'; - return ((p-buffer)+1); -} - -#ifndef COMPILE_ix86_ASM - -bool kvi_strEqualCS(const char *str1,const char *str2) -{ - __range_valid(str1); - __range_valid(str2); - if( !( str1 && str2 ) ) return false; - register unsigned char *s1 = (unsigned char *)str1; - register unsigned char *s2 = (unsigned char *)str2; - while(*s1)if(*s1++ != *s2++)return false; - return (*s1 == *s2); -} - -bool kvi_strEqualCSN(const char *str1,const char *str2,int len) -{ - __range_valid(str1); - __range_valid(str2); - __range_valid(len >= 0); - if( !( str1 && str2 && (len >= 0) ) ) return false; - register unsigned char *s1 = (unsigned char *)str1; - register unsigned char *s2 = (unsigned char *)str2; - while(len-- && *s1)if(*s1++ != *s2++)return false; - return (len < 0); -} - -#endif - -bool kvi_strEqualCIN(const char *str1,const char *str2,int len) -{ - __range_valid(str1); - __range_valid(str2); - __range_valid(len >= 0); - if( !( str1 && str2 && (len >= 0) ) ) return false; - register unsigned char *s1 = (unsigned char *)str1; - register unsigned char *s2 = (unsigned char *)str2; - while(len-- && *s1)if(tolower(*s1++) != tolower(*s2++))return false; - return (len < 0); -} - -bool kvi_strEqualCI(const char *str1,const char *str2) -{ - __range_valid(str1); - __range_valid(str2); - if( !( str1 && str2) ) return false; - register unsigned char *s1 = (unsigned char *)str1; - register unsigned char *s2 = (unsigned char *)str2; - while(*s1)if(tolower(*s1++) != tolower(*s2++))return false; - return (*s1 == *s2); -} - -//note that greater here means that come AFTER in the alphabetic order -// return < 0 ---> str1 < str2 -// return = 0 ---> str1 = str2 -// return > 0 ---> str1 > str2 -int kvi_strcmpCI(const char *str1,const char *str2) -{ - //abcd abce - __range_valid(str1); - __range_valid(str2); - if( !( str1 && str2) ) return false; - register unsigned char *s1 = (unsigned char *)str1; - register unsigned char *s2 = (unsigned char *)str2; - int diff; - unsigned char rightchar; - while(!(diff=(rightchar=tolower(*s1++)) - tolower(*s2++)))if(!rightchar)break; - return diff; //diff is nonzero or end of both was reached (it is positive if *s2 > *s1 -} - -// -////note that greater here means that come AFTER in the alphabetic order -//// return < 0 ---> str1 < str2 -//// return = 0 ---> str1 = str2 -//// return > 0 ---> str1 > str2 -//int kvi_strcmpCIN(const char *str1,const char *str2,int len) -//{ -// //abcd abce -// __range_valid(str1); -// __range_valid(str2); -// register unsigned char *s1 = (unsigned char *)str1; -// register unsigned char *s2 = (unsigned char *)str2; -// int diff; -// unsigned char rightchar; -// while(len--) -// { -// if(!(diff=(rightchar=tolower(*s1++)) - tolower(*s2++)))break; -// if(!rightchar)break; -// } -// return diff; //diff is nonzero or end of both was reached (it is positive if *s2 > *s1 -//} - -int kvi_strcmpCS(const char *str1,const char *str2) -{ - //abcd abce - __range_valid(str1); - __range_valid(str2); - if( !( str1 && str2) ) return false; - register unsigned char *s1 = (unsigned char *)str1; - register unsigned char *s2 = (unsigned char *)str2; - int diff; - while(!(diff=(*s1)-(*s2++)))if(!*s1++)break; - return diff; //diff is nonzero or end of both was reached (it is positive if *s2 > *s1 -} - -int kvi_strMatchRevCS(const char *str1, const char *str2, int index) -{ - __range_valid(str1); - __range_valid(str2); - if( !( str1 && str2) ) return false; - register char *s1=(char *)str1; - register char *s2=(char *)str2; - - int curlen=(int)strlen(str1); - int diff; - - if (index<0 || index >= curlen) index = curlen-1; - - s1+=index; - while (*s2) s2++; - s2--; - - // now start comparing - while (1){ - /* in this case, we have str1 = "lo" and str2 = "hello" */ - if (s1<str1 && !(s2<str2)) return 256; - if (s2<str2) return 0; - if ((diff=(*s1)-(*s2))) return diff; - s1--; - s2--; - } -} - -KviStr::KviStr() -{ - m_ptr = (char *)kvi_malloc(1); - *m_ptr = '\0'; - m_len = 0; -} - -KviStr::KviStr(const char *str) -{ - //Deep copy constructor - if(str){ - //Deep copy - m_len = (int)strlen(str); - m_ptr = (char *)kvi_malloc(m_len+1); - kvi_fastmove(m_ptr,str,m_len+1); - } else { - m_ptr = (char *)kvi_malloc(1); - *m_ptr = '\0'; - m_len = 0; - } -} - -KviStr::KviStr(const KviQCString &str) -{ - //Deep copy constructor - if(str.data()) - { - //Deep copy - m_len = str.length(); - m_ptr = (char *)kvi_malloc(m_len+1); - kvi_fastmove(m_ptr,str,m_len+1); - } else { - m_ptr = (char *)kvi_malloc(1); - *m_ptr = '\0'; - m_len = 0; - } -} - - -KviStr::KviStr(const char *str,int len) -{ - __range_valid(str); - //__range_valid(len <= ((int)strlen(str))); <-- we trust the user here (and a strlen() call may run AFTER len if data is not null terminated) - __range_valid(len >= 0); - m_len = len; - m_ptr = (char *)kvi_malloc(m_len+1); - kvi_fastmove(m_ptr,str,m_len); - *(m_ptr+m_len) = '\0'; -} - -KviStr::KviStr(const char *bg,const char *end) -{ - __range_valid(bg); - __range_valid(end); - __range_valid(bg <= end); - m_len = end-bg; - m_ptr = (char *)kvi_malloc(m_len +1); - kvi_fastmove(m_ptr,bg,m_len); - *(m_ptr + m_len)='\0'; -} - -KviStr::KviStr(KviFormatConstructorTag tag,const char *fmt,...) -{ - m_ptr=(char *)kvi_malloc(256); - //First try - kvi_va_list list; - kvi_va_start(list,fmt); - //print...with max 256 chars - m_len=kvi_vsnprintf(m_ptr,256,fmt,list); - kvi_va_end(list); - - //check if we failed - if(m_len < 0){ - //yes , failed.... - int dummy=256; - do{ //we failed , so retry with 256 more chars - dummy+=256; - //realloc - m_ptr=(char *)kvi_realloc(m_ptr,dummy); - //print... - kvi_va_start(list,fmt); - m_len=kvi_vsnprintf(m_ptr,dummy,fmt,list); - kvi_va_end(list); - } while(m_len < 0); - } - //done... - //now m_len is the length of the written string not including the terminator... - //perfect! :) - m_ptr=(char *)kvi_realloc(m_ptr,m_len+1); -} - -KviStr::KviStr(const KviStr &str) -{ - __range_valid(str.m_ptr); - m_len = str.m_len; - m_ptr = (char *)kvi_malloc(m_len+1); - kvi_fastmove(m_ptr,str.m_ptr,m_len+1); -} - -KviStr::KviStr(const QString &str) -{ - KviQCString sz = KviQString::toUtf8(str); - if(sz.length() > 0) - { - m_len = sz.length(); - m_ptr = (char *)kvi_malloc(m_len+1); - kvi_fastmove(m_ptr,sz.data(),m_len+1); - } else { - m_ptr = (char *)kvi_malloc(1); - *m_ptr = '\0'; - m_len = 0; - } -} - -KviStr::KviStr(char c,int fillLen) -{ - __range_valid(fillLen >= 0); - m_len = fillLen; - m_ptr = (char *)kvi_malloc(m_len+1); - register char *p=m_ptr; - while(fillLen--)*p++=c; - *p='\0'; -} - - -KviStr::KviStr(const kvi_wchar_t * unicode) -{ - if(!unicode) - { - m_len = 0; - m_ptr = (char *)kvi_malloc(1); - *m_ptr = 0; - } else { - m_len = kvi_wstrlen(unicode); - m_ptr = (char *)kvi_malloc(m_len + 1); - register char * p = m_ptr; - while(*unicode)*p++ = *unicode++; - *p = 0; - } -} - -KviStr::KviStr(const kvi_wchar_t * unicode,int len) -{ - m_len = len; - m_ptr = (char *)kvi_malloc(m_len + 1); - register char * p = m_ptr; - char * end = p + len; - while(p != end) - { - *p++ = *unicode++; - } - *p = 0; -} - - - - -KviStr::~KviStr() -{ - kvi_free(m_ptr); -} - -void KviStr::setLength(int iLen) -{ - __range_valid(iLen >= 0); - m_len = iLen; - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - *(m_ptr + m_len) = '\0'; -} - -KviStr & KviStr::operator=(const KviStr &str) -{ - __range_valid(str.m_ptr); - __range_valid(str.m_ptr != m_ptr); - m_len = str.m_len; - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - kvi_fastmove(m_ptr,str.m_ptr,m_len+1); - return (*this); -} - -KviStr & KviStr::operator=(const KviQCString &str) -{ - m_len = str.length(); - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - if(str.data())kvi_fastmove(m_ptr,str.data(),m_len+1); - else *m_ptr = 0; - return (*this); -} - -KviStr & KviStr::operator=(const char *str) -{ - //__range_valid(str); - if(str){ - m_len = (int)strlen(str); - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - kvi_memmove(m_ptr,str,m_len+1); - } else { - m_ptr = (char *)kvi_realloc(m_ptr,1); - *m_ptr = '\0'; - m_len = 0; - } - return (*this); -} - -void KviStr::clear() -{ - m_ptr = (char *)kvi_realloc(m_ptr,1); - *m_ptr = '\0'; - m_len = 0; -} - - -bool KviStr::hasNonWhiteSpaceData() const -{ - const char * aux = m_ptr; - while(*aux) - { - if(((*aux) != ' ') && ((*aux) != '\t'))return true; - aux++; - } - return false; -} - -static char hexdigits[16] = { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f' }; - -void KviStr::bufferToHex(const char *buffer,int len) -{ - __range_valid(buffer); - m_len = (len * 2); - m_ptr = (char *)kvi_realloc(m_ptr,m_len + 1); - char * aux = m_ptr; - while(len) - { - *aux = hexdigits[(unsigned int)(((unsigned char)(*buffer)) / 16)]; - aux++; - *aux = hexdigits[(unsigned int)(((unsigned char)(*buffer)) % 16)]; - aux++; - len--; - buffer++; - } - *(m_ptr+m_len) = '\0'; -} - - - -static char get_decimal_from_hex_digit_char(char dgt) -{ - if((dgt >= '0') && (dgt <= '9'))return (dgt - '0'); - if((dgt >= 'A') && (dgt <= 'F'))return (10 + (dgt - 'A')); - if((dgt >= 'a') && (dgt <= 'f'))return (10 + (dgt - 'a')); - return -1; -} - -// This is just error-correcting...it treats non hex stuff as zeros -/* -static inline char get_decimal_from_hex_digit_char(char dgt) -{ - char c = pedantic_get_decimal_from_hex_digit(dgt); - if(c == -1)return 0; - return c; -} - -int KviStr::hexToBuffer(char ** buffer,bool bNullToNewlines) -{ - int len; - if(m_len % 2)len = (m_len / 2) + 1; - else len = (m_len / 2); - *buffer = (char *)kvi_malloc(len); - - char * ptr = *buffer; - - char * aux = m_ptr; - while(*aux) - { - *ptr = get_decimal_from_hex_digit_char(*aux) * 16; - aux++; - if(*aux) - { - *ptr += get_decimal_from_hex_digit_char(*aux); - aux++; - } - if(bNullToNewlines)if(!(*ptr))*ptr = '\n'; - ptr++; - } - return len; -} -*/ - -int KviStr::hexToBuffer(char ** buffer,bool bNullToNewlines) -{ - *buffer = 0; - if((m_len == 0) || (m_len & 1))return -1; // this is an error - int len = (m_len / 2); - if(len < 1)return -1; - *buffer = (char *)kvi_malloc(len); - - char * ptr = *buffer; - char * aux = m_ptr; - - char aux2; - - while(*aux) - { - *ptr = get_decimal_from_hex_digit_char(*aux) * 16; - if(*ptr == -1) - { - kvi_free(*buffer); - *buffer = 0; - return -1; - } - aux++; - aux2 = get_decimal_from_hex_digit_char(*aux); - if(aux2 == -1) - { - kvi_free(*buffer); - *buffer = 0; - return -1; - } - *ptr += aux2; - aux++; - if(bNullToNewlines)if(!(*ptr))*ptr = '\n'; - ptr++; - } - return len; -} - -static const char * base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - - -void KviStr::bufferToBase64(const char * buffer,int len) -{ - m_len = (len / 3) << 2; - if(len % 3)m_len += 4; - - m_ptr = (char *)kvi_realloc(m_ptr,m_len + 1); - - unsigned char aux1,aux2,aux3; - char * aux_ptr = m_ptr; - while(len > 2) - { - aux1 = (unsigned char)*buffer++; - aux2 = (unsigned char)*buffer++; - aux3 = (unsigned char)*buffer++; - *aux_ptr++ = base64_chars[(aux1 & 0xFC) >> 2]; - *aux_ptr++ = base64_chars[((aux1 & 0x03) << 4) | ((aux2 & 0xF0) >> 4)]; - *aux_ptr++ = base64_chars[((aux2 & 0x0F) << 2) | ((aux3 & 0xC0) >> 6)]; - *aux_ptr++ = base64_chars[(aux3 & 0x3F)]; - len -= 3; - } - switch(len) - { - case 2: - aux1 = (unsigned char)*buffer++; - aux2 = (unsigned char)*buffer++; - *aux_ptr++ = base64_chars[(aux1 & 0xFC) >> 2]; - *aux_ptr++ = base64_chars[((aux1 & 0x03) << 4) | ((aux2 & 0xF0) >> 4)]; - *aux_ptr++ = base64_chars[((aux2 & 0x0F) << 2)]; - *aux_ptr++ = '='; - break; - case 1: - aux1 = (unsigned char)*buffer++; - aux2 = (unsigned char)*buffer++; - *aux_ptr++ = base64_chars[(aux1 & 0xFC) >> 2]; - *aux_ptr++ = base64_chars[((aux1 & 0x03) << 4)]; - *aux_ptr++ = '='; - *aux_ptr++ = '='; - break; - } - *aux_ptr = 0; -} - -static unsigned char get_base64_idx(char base64) -{ - if((base64 >= 'A') && (base64 <= 'Z'))return (base64 - 'A'); - if((base64 >= 'a') && (base64 <= 'z'))return ((base64 - 'a') + 26); - if((base64 >= '0') && (base64 <= '9'))return ((base64 - '0') + 52); - if(base64 == '+')return 62; - if(base64 == '/')return 63; - if(base64 == '=')return 64; - return 65; -} - - -int KviStr::base64ToBuffer(char ** buffer,bool bNullToNewlines) -{ - *buffer = 0; - if((m_len == 0) || (m_len & 3))return -1; // this is an error - int len = (m_len >> 2) * 3; - *buffer = (char *)kvi_malloc(len); - - char * auxBuf = *buffer; - - unsigned char aux1,aux2,aux3,aux4; - char * aux_ptr = m_ptr; - - int newLen = len; - - while(*aux_ptr) - { - if(newLen != len) - { - // ops... there was a padding and we still have chars after it - // this is an error - kvi_free(*buffer); - *buffer = 0; - return -1; - } - aux1 = get_base64_idx(*aux_ptr++); - aux2 = get_base64_idx(*aux_ptr++); - aux3 = get_base64_idx(*aux_ptr++); - aux4 = get_base64_idx(*aux_ptr++); - if((aux3 > 64) || (aux4 > 64)) - { - // error - kvi_free(*buffer); - *buffer = 0; - return -1; - } - if((aux1 | aux2) > 63) - { - // again error...impossible padding - kvi_free(*buffer); - *buffer = 0; - return -1; - } - if(aux4 == 64) - { - if(aux3 == 64) - { - // Double padding, only one digit here - *auxBuf++ = (char)((aux1 << 2) | (aux2 >> 4)); - newLen -= 2; - } else { - // Single padding, two digits here - *auxBuf++ = (char)((aux1 << 2) | (aux2 >> 4)); // >> 4 is a shr , not a ror! :) - *auxBuf++ = (char)((aux2 << 4) | (aux3 >> 2)); - newLen -= 1; - } - } else { - if(aux3 == 64) - { - // error... impossible padding - kvi_free(*buffer); - *buffer = 0; - return -1; - } else { - // Ok , no padding, three digits here - *auxBuf++ = (char)((aux1 << 2) | (aux2 >> 4)); - *auxBuf++ = (char)((aux2 << 4) | (aux3 >> 2)); - *auxBuf++ = (char)((aux3 << 6) | aux4); - } - } - } - - if(newLen != len)*buffer = (char *)kvi_realloc(*buffer,newLen); - return newLen; -} - -KviStr & KviStr::setStr(const char *str,int len) -{ - if(!str) - { - clear(); - return *this; - } - int alen = (int)strlen(str); - if((len < 0) || (len > alen))m_len = alen; - else m_len = len; - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - kvi_memmove(m_ptr,str,m_len); - *(m_ptr+m_len) = '\0'; - return (*this); -} - -KviStr & KviStr::operator=(const QString &str) -{ - KviQCString sz = KviQString::toUtf8(str); - if(sz.length() > 0){ - m_len = sz.length(); - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - kvi_fastmove(m_ptr,sz.data(),m_len+1); - } else { - m_ptr = (char *)kvi_realloc(m_ptr,1); - *m_ptr = '\0'; - m_len = 0; - } - return (*this); -} - -KviStr & KviStr::operator=(char c) -{ - m_len = 1; - m_ptr = (char *)kvi_realloc(m_ptr,2); - *m_ptr = c; - *(m_ptr+1)='\0'; - return (*this); -} - -void KviStr::append(char c) -{ - m_ptr = (char *)kvi_realloc(m_ptr,m_len+2); - *(m_ptr+m_len)=c; - m_len++; - *(m_ptr+m_len)='\0'; -} - -void KviStr::append(const KviStr &str) -{ - __range_valid(str.m_ptr); - m_ptr = (char *)kvi_realloc(m_ptr,m_len+str.m_len+1); - kvi_fastmove((m_ptr+m_len),str.m_ptr,str.m_len+1); - m_len += str.m_len; -} - -void KviStr::append(const char *str) -{ - if(!str)return; - int len = (int)strlen(str); - m_ptr = (char *)kvi_realloc(m_ptr,m_len+len+1); - kvi_fastmove((m_ptr+m_len),str,len+1); - m_len += len; -} - -void KviStr::append(const QString &str) -{ - KviQCString sz = KviQString::toUtf8(str); - if(sz.length() < 1)return; - m_ptr = (char *)kvi_realloc(m_ptr,m_len+sz.length()+1); - kvi_fastmove((m_ptr+m_len),sz.data(),sz.length()+1); - m_len += sz.length(); -} - -void KviStr::append(const char *str,int len) -{ - __range_valid(str); -// __range_valid(len <= ((int)strlen(str))); - __range_valid(len >= 0); - m_ptr = (char *)kvi_realloc(m_ptr,m_len+len+1); - kvi_fastmove((m_ptr+m_len),str,len); - m_len += len; - *(m_ptr + m_len)='\0'; -} - -void KviStr::append(KviFormatConstructorTag tag,const char *fmt,...) -{ - int auxLen; - m_ptr=(char *)kvi_realloc(m_ptr,m_len + 256); - //First try - kvi_va_list list; - kvi_va_start(list,fmt); - //print...with max 256 chars - auxLen =kvi_vsnprintf(m_ptr + m_len,256,fmt,list); - kvi_va_end(list); - - //check if we failed - if(auxLen < 0){ - //yes , failed.... - int dummy=256; - do{ //we failed , so retry with 256 more chars - dummy+=256; - //realloc - m_ptr=(char *)kvi_realloc(m_ptr,m_len + dummy); - //print... - kvi_va_start(list,fmt); - auxLen=kvi_vsnprintf(m_ptr + m_len,dummy,fmt,list); - kvi_va_end(list); - } while(auxLen < 0); - } - m_len += auxLen; - //done... - //now m_len is the length of the written string not including the terminator... - //perfect! :) - m_ptr=(char *)kvi_realloc(m_ptr,m_len+1); -} - -void KviStr::extractFromString(const char *begin,const char *end) -{ - __range_valid(begin); - __range_valid(end); - __range_valid(end >= begin); - m_len = end-begin; - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - kvi_fastmove(m_ptr,begin,m_len); - *(m_ptr + m_len)='\0'; -} - -void KviStr::prepend(const KviStr &str) -{ - __range_valid(str.m_ptr); - __range_valid(str.m_ptr != m_ptr); - m_ptr = (char *)kvi_realloc(m_ptr,m_len+str.m_len+1); - kvi_memmove((m_ptr+str.m_len),m_ptr,m_len+1); //move self - kvi_fastmove(m_ptr,str.m_ptr,str.m_len); - m_len += str.m_len; -} - -void KviStr::prepend(const char *str) -{ - if(!str)return; - int len = (int)strlen(str); - m_ptr = (char *)kvi_realloc(m_ptr,m_len+len+1); - kvi_memmove((m_ptr+len),m_ptr,m_len+1); //move self - kvi_fastmove(m_ptr,str,len); - m_len += len; -} - -void KviStr::prepend(const char *str,int len) -{ - __range_valid(str); - __range_valid(len <= ((int)strlen(str))); - __range_valid(len >= 0); - m_ptr = (char *)kvi_realloc(m_ptr,m_len+len+1); - kvi_memmove((m_ptr+len),m_ptr,m_len+1); //move self - kvi_fastmove(m_ptr,str,len); - m_len += len; -} - -unsigned char iso88591_toUpper_map[256]= -{ - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff -}; - -void KviStr::toUpperISO88591() -{ - register char *p=m_ptr; - while(*p) - { - *p=(char)iso88591_toUpper_map[(unsigned char)*p]; - p++; - } -} - -void KviStr::toUpper() -{ - register char *p=m_ptr; - while(*p) - { - *p=toupper(*p); - p++; - } -} - -unsigned char iso88591_toLower_map[256]= -{ - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff -}; - -void KviStr::toLowerISO88591() -{ - register char *p=m_ptr; - while(*p) - { - *p=(char)iso88591_toLower_map[(unsigned char)*p]; - p++; - } -} - - -void KviStr::toLower() -{ - register char *p=m_ptr; - while(*p) - { - *p=tolower(*p); - p++; - } -} - -KviStr KviStr::upper() const -{ - KviStr tmp(*this); - tmp.toUpper(); - return tmp; -} - -KviStr KviStr::upperISO88591() const -{ - KviStr tmp(*this); - tmp.toUpperISO88591(); - return tmp; -} - -KviStr KviStr::lower() const -{ - KviStr tmp(*this); - tmp.toLower(); - return tmp; -} - -KviStr KviStr::lowerISO88591() const -{ - KviStr tmp(*this); - tmp.toLowerISO88591(); - return tmp; -} - -KviStr KviStr::left(int maxLen) const -{ - if(maxLen <= 0) - { - KviStr empty; - return empty; - } - if(maxLen > m_len)maxLen=m_len; - KviStr str(m_ptr,maxLen); - return str; -} - -KviStr KviStr::right(int maxLen) const -{ - if(maxLen <= 0) - { - KviStr empty; - return empty; - } - if(maxLen > m_len)maxLen=m_len; - KviStr str((m_ptr+(m_len-maxLen)),maxLen); - return str; -} - -KviStr KviStr::middle(int idx,int maxLen) const -{ - __range_valid(maxLen >= 0); - __range_valid(idx >= 0); - if((maxLen <= 0) || (idx < 0)){ //max len negative...invalid params - KviStr ret; - return ret; - } - if((maxLen + idx) <= m_len){ //valid params - KviStr str(m_ptr+idx,maxLen); - return str; - } - if(idx < m_len){ //string shorter than requested - KviStr str(m_ptr+idx); - return str; - } - // idx out of bounds - KviStr ret; - return ret; -} - -KviStr ** KviStr::splitToArray(char sep,int max,int * realCount) const -{ - KviStr ** strings = (KviStr **)kvi_malloc(sizeof(KviStr *)); - int number = 0; - char * ptr = m_ptr; - char * last = ptr; - while((max > 0) && *ptr) - { - strings = (KviStr **)kvi_realloc((void *)strings,sizeof(KviStr *) * (number + 2)); - if(max > 1) - { - while(*ptr && (*ptr != sep))ptr++; - strings[number] = new KviStr(last,ptr - last); - } else { - strings[number] = new KviStr(ptr); - } - number++; - max--; - if(*ptr) - { - ptr++; - last = ptr; - } - } - if(realCount)*realCount = number; - strings[number] = 0; - return strings; -} -/* - WORKING BUT UNUSED - -KviStr ** KviStr::splitToArray(const char * sep,int max,int * realCount) const -{ - KviStr ** strings = (KviStr **)kvi_malloc(sizeof(KviStr *)); - KviStr tmp = *this; - int idx = tmp.findFirstIdx(sep); - int number = 0; - int seplen = kvi_strLen(sep); - - - while(idx != -1) - { - strings = (KviStr **)kvi_realloc(sizeof(KviStr *) * (number + 2)); - strings[number] = new KviStr(tmp.ptr(),idx); - tmp.cutLeft(idx + seplen); - number++; - idx = tmp.findFirstIdx(sep); - } - - if(tmp.hasData()) - { - strings = (KviStr **)kvi_realloc(sizeof(KviStr *) * (number + 2)); - strings[number] = new KviStr(tmp); - number++; - } - - if(realCount)*realCount = number; - strings[number] = 0; - return strings; -} -*/ -void KviStr::freeArray(KviStr ** strings) -{ - if(!strings)return; - KviStr ** aux = strings; - while(*aux) - { - delete (*aux); // delete (KviStr *) - aux++; - } - kvi_free(strings); -} - -void KviStr::freeBuffer(char * buffer) -{ - if(!buffer)return; - kvi_free(buffer); -} - -void KviStr::joinFromArray(KviStr ** strings,const char * sep,bool bLastSep) -{ - setLen(0); - if(!strings)return; - - while(*strings) - { - append(*(*strings)); - strings++; - if(*strings) - { - if(sep)append(sep); - } else { - if(sep && bLastSep)append(sep); - } - } -} - -KviStr & KviStr::insert(int idx,const char *data) -{ - __range_valid(data); - if(idx <= m_len){ - int len = (int)strlen(data); - m_ptr = (char *)kvi_realloc(m_ptr,m_len+len+1); - kvi_memmove(m_ptr+idx+len,m_ptr+idx,(m_len - idx)+1); - kvi_fastmove(m_ptr+idx,data,len); - m_len+=len; - } - return (*this); -} - -KviStr & KviStr::insert(int idx,char c) -{ - if(idx <= m_len){ - m_ptr = (char *)kvi_realloc(m_ptr,m_len+2); - kvi_memmove(m_ptr+idx+1,m_ptr+idx,(m_len - idx)+1); - m_len++; - *(m_ptr + idx) = c; - } - return (*this); -} - -// FIXME: #warning "Double check the following two functions !!!" - -KviStr & KviStr::hexEncodeWithTable(const unsigned char table[256]) -{ - char * aux = m_ptr; - char * begin = m_ptr; - - char * n = 0; - int curSize = 0; - - while(*aux) - { - if(table[*((unsigned char *)aux)] || (*aux == '%')) - { - int len = aux - begin; - n = (char *)kvi_realloc(n,curSize + len + 3); - kvi_memmove(n + curSize,begin,len); - curSize += len; - - n[curSize] = '%'; - curSize++; - n[curSize] = hexdigits[(unsigned int)(((unsigned char)(*aux)) / 16)]; - curSize++; - n[curSize] = hexdigits[(unsigned int)(((unsigned char)(*aux)) % 16)]; - curSize++; - - aux++; - begin = aux; - - } else aux++; - } - - int len = aux - begin; - n = (char *)kvi_realloc(n,curSize + len + 1); - kvi_memmove(n + curSize,begin,len); - curSize += len; - - n[curSize] = '\0'; - - kvi_free((void *)m_ptr); - m_ptr = n; - m_len = curSize; - - return (*this); -} - -KviStr & KviStr::hexEncodeWhiteSpace() -{ - static unsigned char ascii_jump_table[256]= - { - // 000 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 - // NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI - 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 , - // 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 - // DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US - 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 , - // 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 - // ! " # $ % & ' ( ) * + , - . / - 1 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 - // 0 1 2 3 4 5 6 7 8 9 : ; < = > ? - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079 - // @ A B C D E F G H I J K L M N O - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 080 081 082 083 084 085 086 087 088 089 090 091 092 093 094 095 - // P Q R S T U V W X Y Z [ \ ] ^ _ - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 096 097 098 099 100 101 102 103 104 105 106 107 108 109 110 111 - // ` a b c d e f g h i j k l m n o - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 - // p q r s t u v w x y z { | } ~  - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 - // - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 - // - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 - // - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 - // - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 - // � � � � � � � � � � � � � � � � - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 - // � � � � � � � � � � � � � � � � - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 - // � � � � � � � � � � � � � � � � - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 - // � � � � � � � � - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 - }; - - return hexEncodeWithTable(ascii_jump_table); -} - -KviStr & KviStr::hexDecode(const char * pFrom) -{ - // WARNING: pFrom can be also m_ptr here! - const char * aux = pFrom; - const char * begin = pFrom; - - char * n = 0; - int curSize = 0; - - while(*aux) - { - if(*aux == '%') - { - // move last block - int len = aux - begin; - n = (char *)kvi_realloc(n,curSize + len + 1); - kvi_memmove(n + curSize,begin,len); - curSize += len; - - // get the hex code - aux++; - - char theChar = get_decimal_from_hex_digit_char(*aux); - if(theChar < 0) - { - n[curSize] = '%'; // wrong code...just a '%' - curSize++; - } else { - aux++; - char theChar2 = get_decimal_from_hex_digit_char(*aux); - if(theChar2 < 0) - { - // wrong code...just a '%' and step back - n[curSize] = '%'; - curSize++; - aux--; - } else { - n[curSize] = (theChar * 16) + theChar2; - curSize++; - aux++; - } - } - - begin = aux; - - } else aux++; - } - - int len = aux - begin; - n = (char *)kvi_realloc(n,curSize + len + 2); - kvi_memmove(n + curSize,begin,len); - curSize += len; - n[curSize] = '\0'; - - kvi_free((void *)m_ptr); - m_ptr = n; - m_len = curSize; - - return (*this); -} - -KviStr & KviStr::replaceAll(char c,const char *str) -{ - int idx = findFirstIdx(c); - KviStr tmp; - while(idx >= 0){ - if(idx > 0)tmp += left(idx); - cutLeft(idx+1); - tmp.append(str); - idx = findFirstIdx(c); - } - tmp.append(*this); - // Now copy - m_len = tmp.m_len; - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - kvi_fastmove(m_ptr,tmp.m_ptr,m_len+1); - return (*this); -} - -KviStr & KviStr::replaceAll(char *toFind,const char *str,bool bCaseS) -{ - int len = (int)strlen(toFind); - int idx = findFirstIdx(toFind,bCaseS); - KviStr tmp; - while(idx >= 0) - { - if(idx > 0)tmp += left(idx); - cutLeft(idx+len); - tmp.append(str); - idx = findFirstIdx(toFind,bCaseS); - } - tmp.append(*this); - // Now copy - m_len = tmp.m_len; - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - kvi_fastmove(m_ptr,tmp.m_ptr,m_len+1); - return (*this); -} - -KviStr & KviStr::transliterate(const char * szToFind,const char * szReplacement) -{ - while(*szToFind && *szReplacement) - { - char * p = m_ptr; - while(*p) - { - if(*p == *szToFind)*p = *szReplacement; - ++p; - } - ++szToFind; - ++szReplacement; - } - return (*this); -} - - -int KviStr::occurences(char c,bool caseS) const -{ - register char *p = m_ptr; - int cnt=0; - if(caseS){ - while(*p){ - if(*p == c)cnt++; - p++; - } - } else { - char b=tolower(c); - while(*p){ - if(tolower(*p) == b)cnt++; - p++; - } - } - return cnt; -} - -int KviStr::occurences(const char *str,bool caseS) const -{ - __range_valid(str); - register char *p = m_ptr; - int cnt=0; - int len = (int)strlen(str); - if(caseS){ - while(*p){ - if(*p == *str){ - if(kvi_strEqualCSN(p,str,len))cnt++; - } - p++; - } - } else { - while(*p){ - char c = tolower(*str); - if(tolower(*p) == c){ - if(kvi_strEqualCIN(p,str,len))cnt++; - } - p++; - } - } - return cnt; -} - -bool KviStr::contains(char c,bool caseS) const -{ - register char *p = m_ptr; - if(caseS) - { - while(*p) - { - if(*p == c)return true; - p++; - } - } else { - char b=tolower(c); - while(*p) - { - if(tolower(*p) == b)return true; - p++; - } - } - return false; -} - -bool KviStr::contains(const char *str,bool caseS) const -{ - __range_valid(str); - register char *p = m_ptr; - int len = (int)strlen(str); - if(caseS) - { - while(*p) - { - if(*p == *str) - { - if(kvi_strEqualCSN(p,str,len))return true; - } - p++; - } - } else { - while(*p) - { - char c = tolower(*str); - if(tolower(*p) == c) - { - if(kvi_strEqualCIN(p,str,len))return true; - } - p++; - } - } - return false; -} - - -KviStr & KviStr::setNum(long num) -{ - char numberBuffer[30]; - bool bNegative = false; - long tmp; - register char *p; - register char *pNumBuf = numberBuffer; - - // somebody can explain me why -(-2147483648) = -2147483648 ? (2^31) - // it is like signed char x = 128 ---> 10000000 that is signed -0 (!?) - // mmmmh...or it is assumed to be -128 (a number rappresentation exception) - // at least on my machine it happens... - - // found the solution by myself today... - // - // ABS(3) Linux Programmer's Manual ABS(3) - // NAME - // abs - computes the absolute value of an integer. - // ... - // DESCRIPTION - // The abs() function computes the absolute value of the integer argument j. - // RETURN VALUE - // Returns the absolute value of the integer argument. - // CONFORMING TO - // SVID 3, POSIX, BSD 4.3, ISO 9899 - // NOTE ################################################################################## - // Trying to take the absolute value of the most negative integer is not defined. - // ####################################################################################### - - // so should i use temporaneous doubles to make calculations ? - - if(num < 0){ //negative integer - bNegative = true; - num = -num; //need to have it positive - if(num < 0){ // 2^31 exception - // We need to avoid absurd responses like ".(./),." :) - num = 0; // we get a negative zero here...it is still an exception - } - } - - //write the number in a temporary buffer (at least '0') - do { - tmp = num / 10; - *pNumBuf++ = num - (tmp * 10) + '0'; - } while((num = tmp)); - - //copy now.... - m_len = pNumBuf - numberBuffer; //length of the number string - if(bNegative){ - m_len++; - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - p=m_ptr; - *p++='-'; - } else { - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - p=m_ptr; - } - do { *p++ = *--pNumBuf; } while(pNumBuf != numberBuffer); - *(m_ptr + m_len)='\0'; - return (*this); -} - -KviStr & KviStr::setNum(unsigned long num) -{ - char numberBuffer[30]; - unsigned long tmp; - register char *p; - register char *pNumBuf = numberBuffer; - - //write the number in a temporary buffer (at least '0') - do { - tmp = num / 10; - *pNumBuf++ = num - (tmp * 10) + '0'; - } while((num = tmp)); - - //copy now.... - m_len = pNumBuf - numberBuffer; //length of the number string - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - p=m_ptr; - do { *p++ = *--pNumBuf; } while(pNumBuf != numberBuffer); - *(m_ptr + m_len)='\0'; - return (*this); -} - -long KviStr::toLong(bool *bOk) const -{ - long result = 0; - if(bOk)*bOk = false; - register char *p=m_ptr; - bool bNeg = false; - while(isspace(*p))p++; //skip spaces - if(*p == '-'){ - bNeg = true; - p++; - } else { - if(*p == '+')p++; - } - if(isdigit(*p)){ //point to something interesting ? - do{ - result = (result * 10) + (*p - '0'); - p++; - } while(isdigit(*p)); - if(bNeg)result = -result; - while(isspace(*p))p++; //skip trailing spaces - if(*p)return 0; //if this is not the end...die. - if(bOk)*bOk = true; - return result; - } - return 0; -} - -unsigned long KviStr::toULong(bool *bOk) const -{ - unsigned long result = 0; - if(bOk)*bOk = false; - register char *p=m_ptr; - while(isspace(*p))p++; //skip spaces - if(isdigit(*p)){ //point to something interesting ? - do{ - result = (result * 10) + (*p - '0'); - p++; - } while(isdigit(*p)); - while(isspace(*p))p++; //skip trailing spaces - if(*p)return 0; //if this is not the end...die. - if(bOk)*bOk = true; - return result; - } - return 0; -} - -long KviStr::toLongExt(bool *bOk,int base) -{ - if(m_len == 0){ - if(bOk)*bOk = false; - return 0; - } - char * endptr; - long result = strtol(m_ptr,&endptr,base); - if(*endptr){ - // must be whitespaces , otherwise there is trailing garbage inside - while(isspace(*endptr) && (*endptr))endptr++; - if(*endptr){ - // still not at the end - // trailing garbage not allowed - if(bOk)*bOk = false; - return result; - } - } - if(bOk)*bOk = true; - return result; -} - -// -//working code , but unused in kvirc -// -//unsigned long KviStr::toULongExt(bool *bOk = 0,int base = 0) -//{ -// if(m_len == 0){ -// if(bOk)*bOk = false; -// return 0; -// } -// char * endptr; -// unsigned long result = strtoul(m_ptr,&endptr,base); -// if(*endptr != '\0'){ -// if(bOk)*bOk = false; -// } -// return result; -//} - -KviStr & KviStr::cutLeft(int len) -{ - __range_valid(len >= 0); - if(len <= m_len){ - m_len -= len; - kvi_memmove(m_ptr,m_ptr+len,m_len+1); - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - } else { - m_ptr = (char *)kvi_realloc(m_ptr,1); - *m_ptr = '\0'; - m_len = 0; - } - return (*this); -} - -KviStr & KviStr::cutRight(int len) -{ - __range_valid(len >= 0); - if(len <= m_len){ - m_len -= len; - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - *(m_ptr +m_len)='\0'; - } else { - m_ptr = (char *)kvi_realloc(m_ptr,1); - *m_ptr = '\0'; - m_len = 0; - } - return (*this); -} - -KviStr & KviStr::cut(int idx,int len) -{ - __range_valid(idx >= 0); - __range_valid(len >= 0); - if(idx < m_len){ - // idx = 3 len = 3 m_len = 10 - // 0123456789 - // abcdefghij - // ^ ^ - // p1 p2 - char * p1 = m_ptr+idx; - if(len + idx > m_len)len = m_len - idx; - char * p2 = p1+len; - kvi_memmove(p1,p2,(m_len - (len+idx)) +1); - m_len -= len; - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - } - return (*this); -} - -KviStr & KviStr::cutToFirst(char c,bool bIncluded) -{ - int idx = findFirstIdx(c); - if(idx != -1)cutLeft(bIncluded ? idx + 1 : idx); - return (*this); -} - -KviStr KviStr::leftToFirst(char c,bool bIncluded) const -{ - int idx = findFirstIdx(c); - if(idx == -1)return KviStr(*this); - return KviStr(m_ptr,bIncluded ? idx + 1 : idx); -} - - -KviStr KviStr::leftToLast(char c,bool bIncluded) const -{ - int idx = findLastIdx(c); - return KviStr(m_ptr,bIncluded ? idx + 1 : idx); -} - -KviStr & KviStr::cutFromFirst(char c,bool bIncluded) -{ - int idx = findFirstIdx(c); - if(idx != -1)cutRight(bIncluded ? (m_len - idx) : (m_len - (idx + 1))); - return (*this); -} - -KviStr & KviStr::cutToLast(char c,bool bIncluded) -{ - int idx = findLastIdx(c); - if(idx != -1)cutLeft(bIncluded ? idx + 1 : idx); - return (*this); -} - -KviStr & KviStr::cutFromLast(char c,bool bIncluded) -{ - int idx = findLastIdx(c); - if(idx != -1)cutRight(bIncluded ? (m_len - idx) : (m_len - (idx + 1))); - return (*this); -} - -KviStr & KviStr::cutToFirst(const char *c,bool bIncluded) -{ - int len = (int)strlen(c); - int idx = findFirstIdx(c); - if(idx != -1)cutLeft(bIncluded ? idx + len : idx); - return (*this); -} - -KviStr & KviStr::cutFromFirst(const char *c,bool bIncluded) -{ - int len = (int)strlen(c); - int idx = findFirstIdx(c); - if(idx != -1)cutRight(bIncluded ? (m_len - idx) : (m_len - (idx + len))); - return (*this); -} - -KviStr & KviStr::cutToLast(const char *c,bool bIncluded) -{ - int len = (int)strlen(c); - int idx = findLastIdx(c); - if(idx != -1)cutLeft(bIncluded ? idx + len : idx); - return (*this); -} - -KviStr & KviStr::cutFromLast(const char *c,bool bIncluded) -{ - int len = (int)strlen(c); - int idx = findLastIdx(c); - if(idx != -1)cutRight(bIncluded ? (m_len - idx) : (m_len - (idx + len))); - return (*this); -} - -KviStr & KviStr::setLen(int len) -{ - __range_valid(len >= 0); - m_ptr = (char *)kvi_realloc(m_ptr,len+1); - *(m_ptr+len)='\0'; - m_len = len; - return (*this); -} - -KviStr & KviStr::stripLeftWhiteSpace() -{ - register char *p=m_ptr; - while(isspace(*p))p++; - m_len -= (p-m_ptr); - kvi_memmove(m_ptr,p,m_len+1); - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - return (*this); -} - -KviStr & KviStr::stripLeft(char c) -{ - __range_valid(c != '\0'); - register char *p=m_ptr; - while(*p == c)p++; - m_len -= (p-m_ptr); - kvi_memmove(m_ptr,p,m_len+1); - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - return (*this); -} - -bool KviStr::getToken(KviStr & str,char sep) -{ - __range_valid(str.m_ptr); - __range_valid(str.m_ptr != m_ptr); - register char *p=m_ptr; - //skip to the end - while(*p && (*p != sep))p++; - //0123456789 - //abcd xyz - //^ ^ - str.m_len = p-m_ptr; - str.m_ptr = (char *)kvi_realloc(str.m_ptr,str.m_len+1); - kvi_fastmove(str.m_ptr,m_ptr,str.m_len); - *(str.m_ptr + str.m_len)='\0'; - while(*p && (*p == sep))p++; - cutLeft(p-m_ptr); - return (m_len != 0); -} - -bool KviStr::getLine(KviStr &str) -{ - __range_valid(str.m_ptr); - __range_valid(str.m_ptr != m_ptr); - if(m_len == 0)return false; - register char *p=m_ptr; - //skip to the end - while(*p && (*p != '\n'))p++; - //0123456789 - //abcd xyz - //^ ^ - str.m_len = p-m_ptr; - str.m_ptr = (char *)kvi_realloc(str.m_ptr,str.m_len+1); - kvi_fastmove(str.m_ptr,m_ptr,str.m_len); - *(str.m_ptr + str.m_len)='\0'; - p++; - cutLeft(p-m_ptr); - return true; -} - -KviStr KviStr::getToken(char sep) -{ - register char *p=m_ptr; - while(*p && (*p != sep))p++; - KviStr ret(m_ptr,p); - while(*p && (*p == sep))p++; - cutLeft(p-m_ptr); - return ret; -} - -KviStr & KviStr::sprintf(const char *fmt,...) -{ - m_ptr=(char *)kvi_realloc(m_ptr,256); - //First try - kvi_va_list list; - kvi_va_start(list,fmt); - //print...with max 256 chars - m_len=kvi_vsnprintf(m_ptr,256,fmt,list); - kvi_va_end(list); - - //check if we failed - if(m_len < 0){ - //yes , failed.... - int dummy=256; - do{ //we failed , so retry with 256 more chars - dummy+=256; - //realloc - m_ptr=(char *)kvi_realloc(m_ptr,dummy); - //print... - kvi_va_start(list,fmt); - m_len=kvi_vsnprintf(m_ptr,dummy,fmt,list); - kvi_va_end(list); - } while(m_len < 0); - } - //done... - //now m_len is the length of the written string not including the terminator... - //perfect! :) - m_ptr=(char *)kvi_realloc(m_ptr,m_len+1); - return (*this); -} - -int KviStr::find(const char *str,int idx,bool caseS) const -{ - if(idx >= m_len)return -1; - register char *p=m_ptr + idx; - int len = (int)strlen(str); - if(caseS){ - for(;;){ - while(*p && (*p != *str))p++; - if(*p){ - if(kvi_strEqualCSN(str,p,len))return (p-m_ptr); - else p++; - } else return -1; - } - } else { - for(;;){ - char tmp = toupper(*str); - while(*p && (toupper(*p) != tmp))p++; - if(*p){ - if(kvi_strEqualCIN(str,p,len))return (p-m_ptr); - else p++; - } else return -1; - } - } -} - -int KviStr::find(char c,int idx) const -{ - if(idx >= m_len)return -1; - register char *p=m_ptr + idx; - while(*p && (*p != c))p++; - return (*p ? p-m_ptr : -1); -} - - -int KviStr::findRev(const char *str,int idx,bool caseS) const -{ - if((m_len + idx) < 0)return -1; - register char *p=m_ptr + m_len + idx; - int len = (int)strlen(str); - if(caseS) - { - for(;;) - { - while((p >= m_ptr) && (*p != *str))p--; - if(p >= m_ptr){ - if(kvi_strEqualCSN(str,p,len))return (p-m_ptr); - else p--; - } else return -1; - } - } else { - for(;;){ - char tmp = toupper(*str); - while((p >= m_ptr) && (toupper(*p) != tmp))p--; - if(p >= m_ptr){ - if(kvi_strEqualCIN(str,p,len))return (p-m_ptr); - else p--; - } else return -1; - } - } -} - -int KviStr::findFirstIdx(char c) const -{ - register char *p=m_ptr; - while(*p && (*p != c))p++; - return (*p ? p-m_ptr : -1); -} - -int KviStr::findFirstIdx(const char *str,bool caseS) const -{ - // This function can't be used to search inside - // multibyte encoded strings... convert your - // code to QString and use QString::findRev(). - // We must throw away KviStr at all in this case... - - // return QString(m_ptr).find(QString(str),0,caseS);; - - // Both this KviStr and the const char * str are assumed - // to be in the proper (and same) encoding. - // If KviStr is in encoding A then QString(m_ptr) might - // or not be decoded correctly. - // Also if KviStr is in UTF-8 (for example), then - // a position in QString() does not map to the position in the char array - // since a single UNICODE char may use one or more bytes... - - __range_valid(str); - register char *p=m_ptr; - int len = (int)strlen(str); - if(caseS){ - for(;;){ - while(*p && (*p != *str))p++; - if(*p){ - if(kvi_strEqualCSN(str,p,len))return (p-m_ptr); - else p++; - } else return -1; - } - } else { - // this will NOT work for strings that aren't in the current system encoding :( - for(;;){ - char tmp = toupper(*str); - while(*p && (toupper(*p) != tmp))p++; - if(*p){ - if(kvi_strEqualCIN(str,p,len))return (p-m_ptr); - else p++; - } else return -1; - } - } -} - -int KviStr::findLastIdx(char c) const -{ - //Empty string ? - if(m_len < 1)return -1; - //p points to the last character in the string - register char *p=((m_ptr+m_len)-1); - //go back until we find a match or we run to the first char in the string. - while((*p != c) && (p > m_ptr))p--; - //if *p == c --> matched , else we are at the beginning of the string. - return ((*p == c)? p-m_ptr : -1); -} - -int KviStr::findLastIdx(const char *str,bool caseS) const -{ - // This function can't be used to search inside - // multibyte encoded strings... convert your - // code to QString and use QString::findRev(). - // We must throw away KviStr at all in this case... - - // return QString(m_ptr).findRev(QString(str),-1,caseS); - - __range_valid(str); - //Calc the len of the searched string - int len = (int)strlen(str); - //Too long ? - if(m_len < len)return -1; - //p points to the last character in the string - register char *p=((m_ptr+m_len)-1); - if(caseS){ - for(;;){ - //go back until we find a character that mathes or we run to the first char. - while((*p != *str) && (p > m_ptr))p--; - if(*p == *str){ - //maybe occurence.... - if(kvi_strEqualCSN(str,p,len))return (p-m_ptr); - else { - //Nope...continue if there is more data to check... - if(p == m_ptr)return -1; - p--; - } - } else return -1; //Beginning of the string - } - } else { - // case insensitive - for(;;){ - //go back until we find a character that mathes or we run to the first char. - char tmp = toupper(*str); - while((toupper(*p) != tmp) && (p > m_ptr))p--; - if(toupper(*p) == tmp){ - //maybe occurence.... - if(kvi_strEqualCIN(str,p,len))return (p-m_ptr); - else { - //Nope...continue if there is more data to check... - if(p == m_ptr)return -1; - p--; - } - } else return -1; //Beginning of the string - } - } -} - -KviStr & KviStr::stripWhiteSpace() -{ - // 0123456789 - // abcd 0 - // ^ ^ - // left right - register char *left=m_ptr; - register char *right=m_ptr+m_len-1; - // skip initial spaces - while(isspace(*left))left++; - if(*left){ - // valid string , left points to first non-space - while((right >= left) && isspace(*right))right--; - // 0123456789 - // abcd 0 - // ^ ^ - // left right - m_len = (right - left)+1; - kvi_memmove(m_ptr,left,m_len); - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - *(m_ptr+m_len)='\0'; - } else { - m_ptr = (char *)kvi_realloc(m_ptr,1); - *m_ptr = '\0'; - m_len = 0; - } - return (*this); -} - -KviStr & KviStr::stripRightWhiteSpace() -{ - if(*m_ptr) - { - register char *right=m_ptr+m_len-1; - const char *start=right; - while((right >= m_ptr) && isspace( *right ))right--; - if(right != start) - { - m_len = (right - m_ptr) + 1; - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - *(m_ptr+m_len)='\0'; - } - } - return (*this); -} - -KviStr & KviStr::stripRight(char c) -{ - if(*m_ptr) - { - register char *right=m_ptr+m_len-1; - const char *start=right; - while((right >= m_ptr) && (*right == c))right--; - if(right != start) - { - m_len = (right - m_ptr) + 1; - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - *(m_ptr+m_len)='\0'; - } - } - return (*this); -} - -KviStr & KviStr::stripSpace() -{ - // 0123456789 - // abcd 0 - // ^ ^ - // left right - register char *left=m_ptr; - register char *right=m_ptr+m_len-1; - // skip initial spaces - while((*left == ' ') || (*left == '\t'))left++; - if(*left){ - // valid string , left points to first non-space - while((right >= left) && ((*right == ' ') || (*right == '\t')))right--; - // 0123456789 - // abcd 0 - // ^ ^ - // left right - m_len = (right - left)+1; - kvi_memmove(m_ptr,left,m_len); - m_ptr = (char *)kvi_realloc(m_ptr,m_len+1); - *(m_ptr+m_len)='\0'; - } else { - m_ptr = (char *)kvi_realloc(m_ptr,1); - *m_ptr = '\0'; - m_len = 0; - } - return (*this); -} - -bool KviStr::isNum() const -{ - register char *p=m_ptr; - while(isspace(*p))p++; - if(*p=='-')p++; - if(!isdigit(*p))return false; - while(isdigit(*p))p++; - while(isspace(*p))p++; - return (*p=='\0'); -} - -bool KviStr::isUnsignedNum() const -{ - register char *p=m_ptr; - while(isspace(*p))p++; - if(!isdigit(*p))return false; - while(isdigit(*p))p++; - while(isspace(*p))p++; - return (*p=='\0'); -} - -static KviStr g_szApplicationWideEmptyString; - -KviStr & KviStr::emptyString() -{ - return g_szApplicationWideEmptyString; -} - - -bool KviStr::ext_contains(register const char * data,const char * item,bool caseS) -{ - if(item && data) - { - int len = (int)strlen(item); - char c = tolower(*item); - if(caseS) - { - while(*data) - { - while(*data && (tolower(*data) != c))data++; - if(*data) - { - if(kvi_strEqualCSN(item,data,len))return true; - else data++; - } - } - } else { - while(*data) - { - while(*data && (tolower(*data) != c))data++; - if(*data) - { - if(kvi_strEqualCIN(item,data,len))return true; - else data++; - } - } - } - } - return false; -} - - -//void KviStr::pointerToBitString(const void * ptr) -//{ -// m_len = (sizeof(void *) * 8); -// m_ptr = kvi_realloc(m_ptr,m_len + 1); -// for(int i=0;i < m_len;i++) -// { -// m_ptr[i] = (ptr & 1) ? '1' : '0'; -// ptr >> 1; -// } -// m_ptr[i] = '\0'; -//} -// -//void * KviStr::bitStringToPointer() -//{ -// if(m_len != (sizeof(void *) * 8))return 0; -// const char * aux = m_ptr; -// void * ptr = 0; -// for(int i=m_len - 1;i >= 0;i--) -// { -// if(m_ptr[i] == '1')ptr &= 1; -// else if(m_ptr[i] !='0')return 0; -// ptr << 1; -// } -// return ptr; -//} - - - - -// static char ascii_jump_table[256]= -// { -// // 000 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 -// // NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI -// 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , -// // 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 -// // DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US -// 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , -// // 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 -// // ! " # $ % & ' ( ) * + , - . / -// 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , -// // 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 -// // 0 1 2 3 4 5 6 7 8 9 : ; < = > ? -// 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , -// // 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079 -// // @ A B C D E F G H I J K L M N O -// 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , -// // 080 081 082 083 084 085 086 087 088 089 090 091 092 093 094 095 -// // P Q R S T U V W X Y Z [ \ ] ^ _ -// 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , -// // 096 097 098 099 100 101 102 103 104 105 106 107 108 109 110 111 -// // ` a b c d e f g h i j k l m n o -// 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , -// // 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 -// // p q r s t u v w x y z { | } ~  -// 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , -// // 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 -// // -// 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , -// // 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 -// // -// 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , -// // 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 -// // -// 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , -// // 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 -// // -// 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , -// // 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 -// // � � � � � � � � � � � � � � � � -// 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , -// // 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 -// // � � � � � � � � � � � � � � � � -// 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , -// // 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 -// // � � � � � � � � � � � � � � � � -// 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , -// // 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 -// // � � � � � � � � -// 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 -// }; diff --git a/3.4.0/src/kvilib/core/kvi_string.h b/3.4.0/src/kvilib/core/kvi_string.h deleted file mode 100644 index ec28f83824..0000000000 --- a/3.4.0/src/kvilib/core/kvi_string.h +++ /dev/null @@ -1,552 +0,0 @@ -#ifndef _KVI_STRING_H_ -#define _KVI_STRING_H_ -//============================================================================= -// -// File : kvi_string.h -// Creation date : Fri Mar 19 1999 03:06:26 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <stdio.h> -#include <string.h> -#include <ctype.h> - -#ifdef HAVE_STRINGS_H - #include <strings.h> // useless ? -#endif - -#include <qglobal.h> -#include <qstring.h> - - -#include "kvi_qcstring.h" -#include "kvi_inttypes.h" -#include "kvi_heapobject.h" -#include "kvi_stdarg.h" - - - -// -// sigh... -// IRC is not UNICODE ...(yet) :( -// - -#undef __KVI_EXTERN -#ifdef _KVI_STRING_CPP_ - #define __KVI_EXTERN -#else - #define __KVI_EXTERN extern -#endif - - -__KVI_EXTERN KVILIB_API bool kvi_qstringEqualCI(const QString &s1,const QString &s2); - - -// Include inlined assembly implementations if required -#ifdef COMPILE_ix86_ASM - #include "kvi_strasm.h" -#else - // Returns true if the string str1 is equal to str2. case sensitive. - __KVI_EXTERN KVILIB_API bool kvi_strEqualCS(const char *str1,const char *str2); - // Returns true if the forst len characters of string str1 are equal to str2. - // case sensitive. - // Note that if str1 or str2 are shorter than len characters then are considered as NOT equal! - __KVI_EXTERN KVILIB_API bool kvi_strEqualCSN(const char *str1,const char *str2,int len); - // no such tricks in non-asm - #define kvi_strEqualNoLocaleCI(str1,str2) kvi_strEqualCI(str1,str2) - #define kvi_strEqualNoLocaleCIN(str1,str2,len) kvi_strEqualCIN(str1,str2,len) - #define kvi_strLen(str) strlen(str) -#endif - -// Returns true if the string str1 is equal to str2. -// case insensitive. -__KVI_EXTERN KVILIB_API bool kvi_strEqualCI(const char *str1,const char *str2); -// Returns true if the forst len characters of string str1 are equal to str2. -// case insensitive. -// Note that if str1 or str2 are shorter than len characters then are considered as NOT equal! -__KVI_EXTERN KVILIB_API bool kvi_strEqualCIN(const char *str1,const char *str2,int len); -// My own implementations of strcmp and strncasecmp -// Once I wrote it , I KNOW what they do : ALWAYS :) -// Note that greater here means that comes AFTER in the alphabetic order. -__KVI_EXTERN KVILIB_API int kvi_strcmpCI(const char *str1,const char *str2); -//__KVI_EXTERN KVILIB_API int kvi_strcmpCIN(const char *str1,const char *str2,int len); -__KVI_EXTERN KVILIB_API int kvi_strcmpCS(const char *str1,const char *str2); - -// some wide char stuff -typedef kvi_u16_t kvi_wchar_t; -typedef kvi_u32_t kvi_wslen_t; - -__KVI_EXTERN KVILIB_API kvi_wslen_t kvi_wstrlen(const kvi_wchar_t * str); -__KVI_EXTERN KVILIB_API int kvi_wvsnprintcf(kvi_wchar_t * buffer,kvi_wslen_t len,const char *fmt,kvi_va_list list); -__KVI_EXTERN KVILIB_API int kvi_wvsnprintf(kvi_wchar_t * buffer,kvi_wslen_t len,const kvi_wchar_t *fmt,kvi_va_list list); - -//============================================================================= -// -// A simple string class.<br> -// -No data sharing.<br> -// -Not UNICODE.<br> -// -Has ALWAYS NON-NULL DATA.<br> -// -(Maybe)Unsafe :)<br> -// WARNING : Handle with care and use at own risk :)<br> -// -//============================================================================= - -class KVILIB_API KviStr : public KviHeapObject -{ -public: - // No particular reason for these two names... - // It is just because I like it :) - - enum KviFormatConstructorTag { Format , Sprintf }; - - //============================================================================= - // Constructors - //============================================================================= - - // Empty string == "", len = 0, 1 byte allocated - KviStr(); - - // Deep copy of the NULL TERMINATED string (NULL str SAFE) - KviStr(const char *str); - - // Copy len characters from string str (NOT NULL str SAFE, str MUST be at least len chars long) - KviStr(const char *str,int len); - - // bg and end are pointers to a SINGLE string.<br> - // A string is extracted starting from bg and ending at end (not included).<br> - KviStr(const char *bg,const char *end); - - // Format constructor.<br> - // tag is....yes....a dummy number used to resolve ambiguities.<br> - // It is SAFE: will fail only if we run out of memory,<br> - // but can handle only %s %d %u and %c. - KviStr(KviFormatConstructorTag tag,const char *fmt,...); - - // Carbon copy :)...fast - KviStr(const KviStr &str); - - // Compat with QT...<br> - // WARNING : With QT2.x it WILL loose UNICODE data.<br> - // Safe even if the QString is null. - KviStr(const QString &str); - - KviStr(const KviQCString &str); - - // Fill sonstructor. - // Creates a string long fillLen characters filled with character c.<br> - KviStr(char c,int fillLen = 1); - - KviStr(const kvi_wchar_t * unicode); - - KviStr(const kvi_wchar_t * unicode,int len); - - // just free(m_ptr) - ~KviStr(); -public: - //yes...public..but think it as private...:) - char *m_ptr; // pointer to allocated buffer , do not change this! - int m_len; // string data length not including the terminator - -public: - //============================================================================= - // Basic const interface (read stuff) - //============================================================================= - - // Internal data buffer - char * ptr() const { return m_ptr; }; - // Length: fast, cached - int len() const { return m_len; }; - - // I hate this operator...but sometimes it is really useful - // especially in macros (kvi_options.cpp) - operator const char * () const { return m_ptr; }; - - bool isEmpty() const { return (m_len == 0); }; - bool hasData() const { return (m_len != 0); }; - - // this is better than string = "", it does not call strlen - void clear(); - - // forces the length of this string to be iLen (iLen does NOT include the trailing null : it is automatically added) - void setLength(int iLen); - - // Returns true if there is something "readable" inside the string - bool hasNonWhiteSpaceData() const; - - // Character at zero-based index : always safe! - char & at(int idx) const { return ((idx < m_len) ? m_ptr[idx] : m_ptr[m_len]); }; - - // character checks - bool lastCharIs(char ch) const { return (m_len > 0) ? (*(m_ptr + m_len - 1) == ch) : false; }; - bool firstCharIs(char ch) const { return (*m_ptr == ch); }; - - // upper and lower case copies - KviStr upper() const; - KviStr lower() const; - KviStr upperISO88591() const; - KviStr lowerISO88591() const; - - // left , right & co. - // all parameters are safety-checked - KviStr left(int maxLen) const; - KviStr right(int maxLen) const ; - KviStr middle(int idx,int maxLen) const; - - KviStr leftToFirst(char c,bool bIncluded = false) const; - KviStr leftToLast(char c,bool bIncluded = false) const; -// KviStr leftToFirst(const char * str); const; - - //============================================================================= - // Non-const interface (write stuff) - //============================================================================= - - // Null terminator is NOT included in len - KviStr & setLen(int len); - // str must not be 0, but len can be anything (it is checked) - KviStr & setStr(const char *str,int len = -1); - // Like the special constructor that gets the same args. - void extractFromString(const char *begin,const char *end); - - - // Safe sprintf. This one will never write past the end of the string - // It can handle only %s %d %u and %c format flags. - KviStr & sprintf(const char *fmt,...); - - // append functions - void append(const KviStr &str); - void append(const QString &str); - void append(char c); - void append(const char *str); // str CAN be 0 - void append(const char *str,int len); // str CAN NOT be 0, and MUST be at least len chars long - void append(KviFormatConstructorTag dummy,const char *fmt,...); - - // prepend stuff , same as above - void prepend(const KviStr &str); - void prepend(const char *str); // str CAN be 0 - void prepend(const char *str,int len); // str CAN NOT be 0, and MUST be at least len chars long - - // if lastCharIs ch does nothing otherwise appends it - void ensureLastCharIs(char ch) { if(!lastCharIs(ch))append(ch); }; - - // Change THIS string to uppercase or lowercase - void toUpperISO88591(); - void toUpper(); // this is LOCALE AWARE (in Turkish it maps i to Ã!) - void toLowerISO88591(); - void toLower(); - - // Assignment - KviStr & operator=(const KviStr &str); // deep copy - KviStr & operator=(const char *str); // str can be NULL here - KviStr & operator=(char c); // 2 bytes allocated ,m_len = 1 - KviStr & operator=(const QString &str); - KviStr & operator=(const KviQCString &str); - - // Append operators - KviStr & operator+=(const KviStr &str) { append(str); return (*this); }; - KviStr & operator+=(const char *str) { append(str); return (*this); }; - KviStr & operator+=(char c) { append(c); return (*this); }; - KviStr & operator+=(const QString &str) { append(str); return (*this); }; - - // Comparison - bool equalsCI(const KviStr &other) const { if(m_len != other.m_len)return false; return kvi_strEqualCI(m_ptr,other.m_ptr); }; - bool equalsCS(const KviStr &other) const { if(m_len != other.m_len)return false; return kvi_strEqualCS(m_ptr,other.m_ptr); }; - bool equalsCI(const char * other) const { return kvi_strEqualCI(m_ptr,other); }; - bool equalsCS(const char * other) const { return kvi_strEqualCS(m_ptr,other); }; - bool equalsCIN(const char * other,int len) const { return kvi_strEqualCIN(m_ptr,other,len); }; - bool equalsCSN(const char * other,int len) const { return kvi_strEqualCSN(m_ptr,other,len); }; - - //============================================================================= - // HEX and Base64 stuff - //============================================================================= - - // HEX transforms functions - void bufferToHex(const char *buffer,int len); - // Allocates the needed buffer and returns the allocated length, - // returns -1 in case of error (and allocates nothing) - // The string MUST contain only hex digits, and the digits MUST be in couples. (len % 2) must equal 0! - // So this will fail also if there are leading or trailing spaces! - int hexToBuffer(char ** buffer,bool bNullToNewlines = false); - // BASE64 stuff - void bufferToBase64(const char * buffer,int len); - // same as hexToBuffer but obviously transforms base64 notation to binary data (len % 4) must equal 0! - int base64ToBuffer(char ** buffer,bool bNullToNewlines = false); - - // frees a buffer allocated by hexToBuffer or base64ToBuffer - static void freeBuffer(char * buffer); - - //============================================================================= - // Splitters - //============================================================================= - - // cut - KviStr & cutLeft(int len); // kills the first len characters - KviStr & cutRight(int len); // kills the last len characters - KviStr & cut(int idx,int len); - KviStr & cutToFirst(char c,bool bIncluded = true); // cuts the left part of the string up to the first character c or does nothing if the char c is not in the string - KviStr & cutToLast(char c,bool bIncluded = true); - KviStr & cutFromFirst(char c,bool bIncluded = true); - KviStr & cutFromLast(char c,bool bIncluded = true); - KviStr & cutToFirst(const char *c,bool bIncluded = true); // cuts the left part of the string up to the first character c or does nothing if the char c is not in the string - KviStr & cutToLast(const char *c,bool bIncluded = true); - KviStr & cutFromFirst(const char *c,bool bIncluded = true); - KviStr & cutFromLast(const char *c,bool bIncluded = true); - // & paste - KviStr & insert(int idx,const char *data); - KviStr & insert(int idx,char c); - //Replaces all occurences of char c with the string str - KviStr & replaceAll(char c,const char *str); - //same as above but with a string - KviStr & replaceAll(char *toFind,const char *str,bool bCaseS = true); - - KviStr & transliterate(const char * szToFind,const char * szReplacement); - - // Strips whitespace characters from beginning of this string. - KviStr & stripLeftWhiteSpace(); - KviStr & stripRightWhiteSpace(); - // Stips inital and final WHITESPACE characters (see man isspace),<br> - // and returns a reference to this string. - KviStr & stripWhiteSpace(); - - // Strips spaces and tabs only - KviStr & stripSpace(); - // Strips all occurences of the character c from the beginning of the string.<br> - // Note that c can not be '\0' :) - KviStr & stripLeft(char c); - KviStr & stripRight(char c); - - //============================================================================= - // Tokenize - //============================================================================= - - // Extracts (copy to str and remove) a token from this string ,<br> - // and returns true if there are more tokens to extract<br> - // Does not strip initial separators!!<br> - // str can NOT be this string. - bool getToken(KviStr &str,char sep); - // Does not strip initial separators!<br> - // Can assign also to this string. - KviStr getToken(char sep); - // Extracts a line from the string.<br> - // Returns false if there was no data to extract - bool getLine(KviStr &str); - - // splits this string in a null-terminated array of strings - // separated by sep. - KviStr ** splitToArray(char sep,int max,int * realCount) const; - //KviStr ** splitToArray(const char * sep,int max,int * realCount) const; - static void freeArray(KviStr ** strings); - // joins the array to this string - // if sep is not 0 , it is inserted between the strings - // if bLastSep is true and sep is non 0 , then sep is also appended at the end - // of the buffer (after the last string) - void joinFromArray(KviStr ** strings,const char * sep = 0,bool bLastSep = false); - - //============================================================================= - // Utils - //============================================================================= - - // encodes chars that have nonzero in the jumptable - // into %HH equivalents - KviStr & hexEncodeWithTable(const unsigned char table[256]); - KviStr & hexEncodeWhiteSpace(); - KviStr & hexDecode(const char * pFrom); - KviStr & hexDecode(){ return hexDecode(m_ptr); }; - - //============================================================================= - // Contains / occurence count - //============================================================================= - - // Returns true if at least one occurence of str is found - bool contains(const char *str,bool caseS=true) const; - // Returns true if at least one occurence of character c is found in this string - bool contains(char c,bool caseS=true) const; - // Returns the number of occurences of string str in this string.<br> - // Overlapped matches are counted. - int occurences(const char *str,bool caseS=true) const; - // Returns the number of occurences of character c in this string - int occurences(char c,bool caseS=true) const; - - //============================================================================= - // Find - //============================================================================= - - // Finds the first occurence of the character c in this string,<br> - // and returns its zero-based index or -1 if c can not be found.<br> - // c can NOT be '\0' here. - int findFirstIdx(char c) const; - // Finds the first occurence of the sub-string str in this string,<br> - // and returns its zero-based index or -1 if the sub-string can not be found.<br> - // str can NOT be 0 here. - int findFirstIdx(const char *str,bool caseS = true) const; - // Finds the last occurence of the character c in this string,<br> - // and returns its zero-based index or -1 if the character can not be found. - int findLastIdx(char c) const; - // Finds the last occurence of the sub-string str in this string,<br> - // and returns its zero-based index or -1 if the sub-string can not be found.<br> - // str can NOT be 0 here. - int findLastIdx(const char *str,bool caseS = true) const; - - int find(char c,int startIdx) const; - int find(const char * str,int startIdx,bool caseS = true) const; - int findRev(const char * str,int startIdx,bool caseS = true) const; - - //============================================================================= - // Numbers - //============================================================================= - - // everything in base 10.... no overflow checks here - long toLong(bool *bOk=0) const; - unsigned long toULong(bool *bOk=0) const; - char toChar(bool *bOk=0) const { return (char)toLong(bOk); }; - unsigned char toUChar(bool *bOk=0) const { return (unsigned char)toULong(bOk); }; - int toInt(bool *bOk=0) const { return (int)toLong(bOk); }; - unsigned int toUInt(bool *bOk=0) const { return (unsigned int)toULong(bOk); }; - short toShort(bool *bOk=0) const { return (short)toLong(bOk); }; - unsigned short toUShort(bool *bOk=0) const { return (unsigned short)toLong(bOk); }; - - KviStr & setNum(long num); - KviStr & setNum(unsigned long num); - - KviStr & setNum(int num) { return setNum((long)num); }; - KviStr & setNum(unsigned int num) { return setNum((unsigned long)num); }; - KviStr & setNum(short num) { return setNum((long)num); }; - KviStr & setNum(unsigned short num) { return setNum((unsigned long)num); }; - KviStr & setNum(char num) { return setNum((long)num); }; - KviStr & setNum(unsigned char num) { return setNum((unsigned long)num); }; - - // Retuns true if the string contains only digits and an optional '-' character - // at the beginning.<be> - // Space characters are allowed at the begginning and the end.<br> - // There is no overflow check! - bool isNum() const; - bool isUnsignedNum() const; - - // special functions for multiple bases - long toLongExt(bool *bOk = 0,int base = 0); - // unsigned long toULongExt(bool *bOk = 0,int base = 0); //never used - - // returns an empty string... - // this if often useful! - static KviStr & emptyString(); - - //============================================================================= - // Dead interface - //============================================================================= - - // Transform a pointer to a string with all 0 and 1 - // void pointerToBitString(const void * ptr); - // Get a pointer from a string all of 0 and 1 : return 0 if invalid - // void * bitStringToPointer(); - - //============================================================================= - // "External string" helper functions - //============================================================================= - - // FIXME: Should it be KviStrExt::contains namespace ? - static bool ext_contains(register const char * data,const char * item,bool caseS = true); -}; - -// FIXME: the functions below should end in the KviStr namespace ??? - - -// Cool string parsing function. -// It will extract the first found token from the string aux_ptr , and return -// a pointer to the beginning of the next token , or end of the string. -// It skips the initial sep characters! -__KVI_EXTERN KVILIB_API const char * kvi_extractToken(KviStr &str,const char *aux_ptr,char sep =' '); -// Does not skip the beginning separators! -// Extracts data from the string up to the next separator character or the end of the string. -// and returns a pointer to that separator (or string end). -__KVI_EXTERN KVILIB_API const char * kvi_extractUpTo(KviStr &str,const char *aux_ptr,char sep=' '); -// Reduced vsnprintf... -// Handles %s,%c,%d,%u (%% are TWO percents here and not one.) -// Returns -1 if the formatted string exceeded the buffer length. -// Otherwise returns the length of the formatted buffer...(not including '\0') -__KVI_EXTERN KVILIB_API int kvi_vsnprintf(char *buffer,int len,const char *fmt,kvi_va_list list); -// Reduced vsnprintf: special version for irc. -// Handles %s,%c,%d,%u (%% are TWO percents here and not one.) -// Writes up to 510 characters and terminates the string with a CRLF -// Sets bTruncated if the requested format string was too large to fit in 512 bytes -// otherwise sets it to false; The buffer MUST be at least 512 bytes long. -// Always returns the length of the formatted buffer...(max 512 - min 2=CRLF) -__KVI_EXTERN KVILIB_API int kvi_irc_vsnprintf(char *buffer,const char *fmt,kvi_va_list list,bool *bTruncated); - -// WILDCARD EXPRESSION MATCHING FUNCTIONS - -// Returns true if the two regular expressions with wildcards matches -__KVI_EXTERN KVILIB_API bool kvi_matchWildExpr(register const char *m1,register const char *m2); -// Returns true if the two regular expressions with wildcards matches, case sensitive -//__KVI_EXTERN bool kvi_matchWildExprCS(register const char *m1,register const char *m2); // actually unused -// Same as kvi_matchWildExpr but with an additional char that acts as string terminator -// If there is a match this function returns true and puts the pointers where it stopped in r1 and r2 -__KVI_EXTERN KVILIB_API bool kvi_matchWildExprWithTerminator(register const char *m1,register const char *m2,char terminator, - const char ** r1,const char ** r2); - -// Returns true if the wildcard expression exp matches the string str -__KVI_EXTERN KVILIB_API bool kvi_matchStringCI(register const char * exp,register const char * str); -#define kvi_matchString kvi_matchStringCI -__KVI_EXTERN KVILIB_API bool kvi_matchStringCS(register const char * exp,register const char * str); -__KVI_EXTERN KVILIB_API bool kvi_matchStringWithTerminator(register const char * exp,register const char * str,char terminator,const char ** r1,const char ** r2); - -// This function works like a particular case of strncmp. -// It evaluates if str2 is the terminal part of str1. -// example: if str1 is "this is an experiment" and str2 is "xperiment" -// return 0. -// With the index parameter, the match start on str1 from the specified -// index. For example: -// if str1 is "this is an experiment" and str2 is "an" we have return !0 -// but "this is an experiment" -// 012345678901234567890 -// if we call kvi_strsubRevCS("this is an experiment","an", 9) we got a match. -__KVI_EXTERN KVILIB_API int kvi_strMatchRevCS(const char *str1, const char *str2, int index=-1); - -// KviStr comparison non-member operators -__KVI_EXTERN KVILIB_API inline bool operator==(const KviStr &left,const KviStr &right) -{ return (left.m_len == right.m_len) ? kvi_strEqualCS(left.m_ptr,right.m_ptr) : false; } -__KVI_EXTERN KVILIB_API inline bool operator==(const KviStr &left,const char *right) -{ return kvi_strEqualCS(left.m_ptr,right); } -__KVI_EXTERN KVILIB_API inline bool operator==(const char *left,const KviStr &right) -{ return kvi_strEqualCS(left,right.m_ptr); } -__KVI_EXTERN KVILIB_API inline bool operator!=(const KviStr &left,const KviStr &right) -{ return !kvi_strEqualCS(left.m_ptr,right.m_ptr); } -__KVI_EXTERN KVILIB_API inline bool operator!=(const KviStr &left,const char *right) -{ return !kvi_strEqualCS(left.m_ptr,right); } -__KVI_EXTERN KVILIB_API inline bool operator!=(const char *left,const KviStr &right) -{ return !kvi_strEqualCS(left,right.m_ptr); } - -__KVI_EXTERN KVILIB_API inline KviStr operator+(const KviStr &left,const KviStr &right) -{ KviStr ret(left); ret += right; return ret; } -__KVI_EXTERN KVILIB_API inline KviStr operator+(const KviStr &left,const char *right) -{ KviStr ret(left); ret += right; return ret; } -__KVI_EXTERN KVILIB_API inline KviStr operator+(const char *left,const KviStr &right) -{ KviStr ret(left); ret += right; return ret; } -__KVI_EXTERN KVILIB_API inline KviStr operator+(const KviStr &left,char right) -{ KviStr ret(left); ret += right; return ret; } -__KVI_EXTERN KVILIB_API inline KviStr operator+(char left,const KviStr &right) -{ KviStr ret(left); ret += right; return ret; } - -inline int kvi_compare(const KviStr * p1,const KviStr * p2) -{ - return kvi_strcmpCI(p1->ptr(),p2->ptr()); -} - -#endif //_KVI_STRING_H_ diff --git a/3.4.0/src/kvilib/core/kvi_stringarray.cpp b/3.4.0/src/kvilib/core/kvi_stringarray.cpp deleted file mode 100644 index 9799c57ed6..0000000000 --- a/3.4.0/src/kvilib/core/kvi_stringarray.cpp +++ /dev/null @@ -1,119 +0,0 @@ -//================================================================================================= -// -// File : kvi_stringarray.cpp -// Creation date : Tue Jun 6 02:20:20 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_stringarray.h" -#include "kvi_malloc.h" - -KviStringArray::KviStringArray() -{ - m_uSize = 0; - m_pData = 0; - m_uHighestIdx = 0; -} - -KviStringArray::~KviStringArray() -{ - if(m_pData)clear(); -} - - -void KviStringArray::clear() -{ - if(!m_pData)return; - for(unsigned int i=0;i<m_uSize;i++) - { - if(m_pData[i])delete m_pData[i]; - } - kvi_free(m_pData); - m_pData = 0; - m_uHighestIdx = 0; - m_uSize = 0; -} - -void KviStringArray::insert(unsigned int uIdx,KviStr * pVal) -{ - if(m_uSize <= uIdx) - { - unsigned int uOldSize = m_uSize; - m_uSize = uIdx + KVI_STRING_ARRAY_FREESPACE_SIZE; - m_pData = (KviStr **)kvi_realloc(m_pData,m_uSize * sizeof(KviStr *)); - for(unsigned int u = uOldSize;u < m_uSize;u++) - { - m_pData[u] = 0; - } - } else { - if(m_pData[uIdx])delete m_pData[uIdx]; - } - if(uIdx > m_uHighestIdx)m_uHighestIdx = uIdx; - m_pData[uIdx] = pVal; -} - -void KviStringArray::remove(unsigned int uIdx) -{ - if(uIdx > m_uHighestIdx)return; - if(m_pData[uIdx]) - { - delete m_pData[uIdx]; - m_pData[uIdx] = 0; - if(uIdx == m_uHighestIdx) - { - // shrink the array - if(m_uHighestIdx == 0)clear(); - else { - unsigned int u = m_uHighestIdx - 1; - while(!m_pData[u])u--; - if((m_uHighestIdx - u) > KVI_STRING_ARRAY_FREESPACE_SIZE)shrink(u); - else m_uHighestIdx = u; // just set the max index - } - } - } -} - -void KviStringArray::shrink(unsigned int uMaxItem) -{ - m_uHighestIdx = uMaxItem; - m_uSize = uMaxItem + 1; - m_pData = (KviStr **)kvi_realloc(m_pData,sizeof(KviStr *) * m_uSize); -} - -void KviStringArray::copyFrom(KviStringArray * a) -{ - clear(); - m_uSize = a->m_uSize; - m_uHighestIdx = a->m_uHighestIdx; - if(m_uSize > 0) - { - m_pData = (KviStr **)kvi_malloc(sizeof(KviStr *) * m_uSize); - for(unsigned int i=0;i<m_uSize;i++) - { - if(a->m_pData[i])m_pData[i] = new KviStr(*(a->m_pData[i])); - else m_pData[i] = 0; - } - } else { - m_pData = 0; - } -} diff --git a/3.4.0/src/kvilib/core/kvi_stringarray.h b/3.4.0/src/kvilib/core/kvi_stringarray.h deleted file mode 100644 index e3c9c32627..0000000000 --- a/3.4.0/src/kvilib/core/kvi_stringarray.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef _KVI_STRINGARRAY_H_ -#define _KVI_STRINGARRAY_H_ -//================================================================================================= -// -// File : kvi_stringarray.h -// Creation date : Tue Jun 6 02:20:20 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" -#include "kvi_heapobject.h" - -#define KVI_STRING_ARRAY_FREESPACE_SIZE 16 - -class KVILIB_API KviStringArray : public KviHeapObject -{ -public: - KviStringArray(); - ~KviStringArray(); -public: - unsigned int m_uSize; - unsigned int m_uHighestIdx; - KviStr ** m_pData; -public: - void clear(); - void insert(unsigned int uIdx,KviStr * pVal); - void copyFrom(KviStringArray * a); - unsigned int size(){ return (m_uSize == 0) ? 0 : (m_uHighestIdx + 1); }; - bool isEmpty(){ return m_uSize == 0; }; - void remove(unsigned int uIdx); - void shrink(unsigned int uMaxItem); - KviStr * uncheckedAt(unsigned int uIdx){ return m_pData[uIdx]; }; - KviStr * at(unsigned int uIdx){ return m_uSize > uIdx ? m_pData[uIdx] : 0; }; - KviStr * getAt(unsigned int uIdx){ KviStr * t = at(uIdx); if(t)m_pData[uIdx] = 0; return t; }; -}; - -#endif //_KVI_STRINGARRAY_H_ diff --git a/3.4.0/src/kvilib/core/kvi_valuelist.h b/3.4.0/src/kvilib/core/kvi_valuelist.h deleted file mode 100644 index d7ce12ce43..0000000000 --- a/3.4.0/src/kvilib/core/kvi_valuelist.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _KVI_VALUELIST_H_ -#define _KVI_VALUELIST_H_ -//================================================================================================= -// -// File : kvi_valuelist.h -// Creation date : Mon Jan 15 2007 04:53 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include <q3valuelist.h> - #define KviValueList Q3ValueList -#else - #include <qvaluelist.h> - #define KviValueList QValueList -#endif - -#endif //_KVI_VALUELIST_H_ diff --git a/3.4.0/src/kvilib/ext/.svnignore b/3.4.0/src/kvilib/ext/.svnignore deleted file mode 100644 index dca63d4297..0000000000 --- a/3.4.0/src/kvilib/ext/.svnignore +++ /dev/null @@ -1,19 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -*.o -*.lo -*.la -*.so -*.lai -moc_*.cpp -kvirc -symlinks diff --git a/3.4.0/src/kvilib/ext/Makefile.am b/3.4.0/src/kvilib/ext/Makefile.am deleted file mode 100644 index c84487eb66..0000000000 --- a/3.4.0/src/kvilib/ext/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -EXTRA_DIST = *.cpp *.h diff --git a/3.4.0/src/kvilib/ext/kvi_accel.h b/3.4.0/src/kvilib/ext/kvi_accel.h deleted file mode 100644 index 4500cb3c88..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_accel.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef _KVI_ACCEL_H_ -#define _KVI_ACCEL_H_ - -//============================================================================= -// -// File : kvi_accel.h -// Creation date : Wed Feb 01 2007 01:45:21 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include <q3accel.h> - #define KviAccel Q3Accel -#else - #include <qaccel.h> - #define KviAccel QAccel -#endif - -#endif //!_KVI_ACCEL_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_cmdformatter.cpp b/3.4.0/src/kvilib/ext/kvi_cmdformatter.cpp deleted file mode 100644 index 2c1450de59..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_cmdformatter.cpp +++ /dev/null @@ -1,242 +0,0 @@ -//============================================================================= -// -// File : kvi_cmdformatter.cpp -// Creation date : Tue Jun 12 2001 03:08:12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - -#include "kvi_cmdformatter.h" - -namespace KviCommandFormatter -{ - bool hasLeadingChars(KviStr ** array,char c) - { - if(!(*array))return false; // can't have more leading chars - bool bGotIt = false; - while(*array) - { - if(*((*array)->ptr()) == c) - { - // found at least one such leading char - bGotIt = true; - } else { - // we pretend this line to be empty - KviStr tmp = *(*array); - tmp.stripWhiteSpace(); - if(tmp.hasData())return false; - *(*array) = ""; // set it to empty also in the main buffer - } - array++; - } - return bGotIt; - } - - bool hasLeadingChars(QStringList &list,const QChar &c) - { - bool bGotIt = false; - for(QStringList::Iterator it = list.begin();it != list.end();++it) - { - if((*it).length() < 1)continue; - if((*it).at(0) == c) - { - // found at least one such leading char - bGotIt = true; - } else { - // we pretend this line to be empty - QString tmp = *it; -#ifdef COMPILE_USE_QT4 - tmp = tmp.trimmed(); -#else - tmp = tmp.stripWhiteSpace(); -#endif - if(!tmp.isEmpty())return false; - *it = ""; // set it to empty also in the main buffer - } - } - return bGotIt; - } - - void trimLeading(KviStr ** array) - { - while(*array) - { - if((*array)->hasData())(*array)->cutLeft(1); - array++; - } - } - - void trimLeading(QStringList &list) - { - for(QStringList::Iterator it = list.begin();it != list.end();++it) - { - (*it).remove(0,1); - } - } - - - void addLeading(KviStr ** array,char c) - { - while(*array) - { - if((*array)->hasData())(*array)->prepend(c); - array++; - } - } - - void addLeading(QStringList &list,const QChar & c) - { - for(QStringList::Iterator it = list.begin();it != list.end();++it) - { - (*it).prepend(c); - } - } - - - void unindent(KviStr &buffer) - { - // we can format correctly up to 65536 lines (that's really enough) - int realLen; - KviStr ** array = buffer.splitToArray('\n',65536,&realLen); - if(array) - { - while(hasLeadingChars(array,'\t') || hasLeadingChars(array,' '))trimLeading(array); - buffer.joinFromArray(array,"\n",true); - KviStr::freeArray(array); - } - } - - - void unindent(QString &buffer) - { -#ifdef COMPILE_USE_QT4 - QStringList list = buffer.split("\n",QString::KeepEmptyParts); -#else - QStringList list = QStringList::split("\n",buffer,true); -#endif - while(hasLeadingChars(list,QChar('\t')) || hasLeadingChars(list,QChar(' ')))trimLeading(list); - //buffer = list.join("\n"); join implementation sux :D - // we WANT the last newline - buffer = ""; - for(QStringList::Iterator it = list.begin();it != list.end();++it) - { - buffer.append(*it); - buffer.append(QChar('\n')); - } - } - - - void bufferFromBlock(KviStr &buffer) - { - buffer.stripWhiteSpace(); - - if((*(buffer.ptr()) == '{') && buffer.lastCharIs('}')) - { - // leading and trailing { must be stripped - buffer.cutLeft(1); - buffer.cutRight(1); - } - - unindent(buffer); - - buffer.stripWhiteSpace(); - } - - void bufferFromBlock(QString &buffer) - { -#ifdef COMPILE_USE_QT4 - buffer = buffer.trimmed(); -#else - buffer = buffer.stripWhiteSpace(); -#endif - - if(buffer.isEmpty())return; - - if((buffer.at(0) == QChar('{')) && buffer.endsWith(QChar('}'))) - { - buffer.remove(0,1); - buffer.remove(buffer.length() - 1,1); - while((buffer.length() > 0) && ((buffer.at(0) == QChar('\n')) || (buffer.at(0) == QChar('\r')))) - buffer.remove(0,1); - } - - unindent(buffer); - -#ifdef COMPILE_USE_QT4 - buffer = buffer.trimmed(); -#else - buffer = buffer.stripWhiteSpace(); -#endif - } - - - void indent(KviStr &buffer) - { - // we can format correctly up to 65536 lines (that's really enough) - int realLen; - KviStr ** array = buffer.splitToArray('\n',65536,&realLen); - if(array) - { - addLeading(array,'\t'); - buffer.joinFromArray(array,"\n",true); - KviStr::freeArray(array); - } - } - - void indent(QString &buffer) - { -#ifdef COMPILE_USE_QT4 - QStringList list = buffer.split("\n",QString::KeepEmptyParts); -#else - QStringList list = QStringList::split("\n",buffer,true); -#endif - addLeading(list,QChar('\t')); - //buffer = list.join("\n"); join implementation sux :D - // we WANT the last newline - buffer = ""; - for(QStringList::Iterator it = list.begin();it != list.end();++it) - { - buffer.append(*it); - buffer.append(QChar('\n')); - } - } - - - void blockFromBuffer(KviStr &buffer) - { - indent(buffer); - buffer.prepend("{\n"); - buffer.stripRightWhiteSpace(); - buffer.ensureLastCharIs('\n'); - buffer.append("}\n"); - } - - void blockFromBuffer(QString &buffer) - { - indent(buffer); - buffer.prepend("{\n"); - KviQString::stripRightWhiteSpace(buffer); - KviQString::ensureLastCharIs(buffer,'\n'); - buffer.append("}\n"); - } -}; - -// FIXME: #warning "move popups and events to this formatting stuff!" diff --git a/3.4.0/src/kvilib/ext/kvi_cmdformatter.h b/3.4.0/src/kvilib/ext/kvi_cmdformatter.h deleted file mode 100644 index d64e24b452..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_cmdformatter.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef _KVI_CMDFORMATTER_H_ -#define _KVI_CMDFORMATTER_H_ - -//============================================================================= -// -// File : kvi_cmdformatter.h -// Creation date : Tue Jun 12 2001 03:04:05 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_string.h" -#include "kvi_settings.h" - -#include "kvi_qstring.h" -#include <qstringlist.h> - -namespace KviCommandFormatter -{ - extern KVILIB_API bool hasLeadingChars(KviStr * array,char c); - extern KVILIB_API bool hasLeadingChars(QStringList &list,const QChar &c); - - extern KVILIB_API void trimLeading(KviStr ** array); - extern KVILIB_API void trimLeading(QStringList &list); - - extern KVILIB_API void addLeading(KviStr ** array,char c); - extern KVILIB_API void addLeading(QStringList &list,const QChar &c); - - extern KVILIB_API void trimBlockBraces(KviStr &buffer); - extern KVILIB_API void trimBlockBraces(QString &buffer); - - extern KVILIB_API void unindent(KviStr &buffer); - extern KVILIB_API void unindent(QString &buffer); - - extern KVILIB_API void bufferFromBlock(KviStr &buffer); - extern KVILIB_API void bufferFromBlock(QString &buffer); - - extern KVILIB_API void addBlockBraces(KviStr &buffer); - extern KVILIB_API void addBlockBraces(QString &buffer); - - extern KVILIB_API void indent(KviStr &buffer); - extern KVILIB_API void indent(QString &buffer); - - extern KVILIB_API void blockFromBuffer(KviStr &buffer); - extern KVILIB_API void blockFromBuffer(QString &buffer); -}; - -#endif //_KVI_CMDFORMATTER_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_config.cpp b/3.4.0/src/kvilib/ext/kvi_config.cpp deleted file mode 100644 index 2def6c974f..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_config.cpp +++ /dev/null @@ -1,1007 +0,0 @@ -//========================================================================================== -// -// File : kvi_config.cpp -// Last major modification : Thu Jan 14 1999 18:03:59 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - -#include "kvi_config.h" -#include "kvi_fileutils.h" -#include "kvi_pixmap.h" -#include "kvi_msgtype.h" -#include "kvi_stringconversion.h" -#include "kvi_memmove.h" -#include "kvi_malloc.h" -#include "kvi_file.h" - - -KviConfig::KviConfig(const QString &filename,FileMode f,bool bLocal8Bit) -{ - m_bLocal8Bit = bLocal8Bit; - m_szFileName = filename; - m_bDirty = false; - m_szGroup = KVI_CONFIG_DEFAULT_GROUP; - m_bPreserveEmptyGroups = false; - m_bReadOnly = (f == KviConfig::Read); - m_pDict = new KviPointerHashTable<QString,KviConfigGroup>(17,false); - m_pDict->setAutoDelete(true); - if(f != KviConfig::Write)load(); -} - -KviConfig::KviConfig(const char* filename,FileMode f,bool bLocal8Bit) -{ - m_bLocal8Bit = bLocal8Bit; - m_szFileName = QString::fromUtf8(filename); - m_bDirty = false; - m_szGroup = KVI_CONFIG_DEFAULT_GROUP; - m_bPreserveEmptyGroups = false; - m_bReadOnly = (f == KviConfig::Read); - m_pDict = new KviPointerHashTable<QString,KviConfigGroup>(17,false); - m_pDict->setAutoDelete(true); - if(f != KviConfig::Write)load(); -} - - -KviConfig::~KviConfig() -{ - if(m_bDirty)save(); - delete m_pDict; -} - -void KviConfig::clear() -{ - delete m_pDict; - m_pDict = new KviPointerHashTable<QString,KviConfigGroup>(17,false); - m_pDict->setAutoDelete(true); - m_bDirty = false; - m_szGroup = KVI_CONFIG_DEFAULT_GROUP; -} - -void KviConfig::clearGroup(const QString & szGroup) -{ - m_bDirty = true; - m_pDict->remove(szGroup); - if(!m_pDict->find(m_szGroup))m_szGroup = KVI_CONFIG_DEFAULT_GROUP; //removed the current one -} - -void KviConfig::clearKey(const QString & szKey) -{ - m_bDirty = true; - KviConfigGroup * p_group = getCurrentGroup(); - p_group->remove(szKey); - if(p_group->count() == 0)clearGroup(m_szGroup); -} - -/* -void KviConfig::getContentsString(KviStr &buffer) -{ - buffer = __tr("Contents of config file "); - buffer.append(m_szFileName.ptr()); - buffer.append('\n'); - int sections = 0; - int keys = 0; - KviPointerHashTableIterator<QString,KviStrDict> it(*m_pDict); - while(it.current()){ - buffer.append(" Section ["); - buffer.append(it.currentKey()); - buffer.append("]\n"); - int sectionKeys = 0; - KviPointerHashTableIterator<QString,KviStr> it2(*it.current()); - while(it2.current()){ - buffer.append(" Key ["); - buffer.append(it2.currentKey()); - buffer.append("] : "); - buffer.append(it2.current()->ptr()); - buffer.append('\n'); - ++it2; - ++sectionKeys; - ++keys; - } - KviStr tmp(KviStr::Format,__tr(" Total: %d keys"),sectionKeys); - buffer.append(tmp); - buffer.append('\n'); - ++it; - ++sections; - } - KviStr tmp(KviStr::Format,__tr("Total: %d keys in %d sections"),keys,sections); - buffer.append(tmp); -} -*/ - - - -#define LOAD_BLOCK_SIZE 32768 - -bool KviConfig::load() -{ - // this is really faster than the old version :) - - // open the file - KviFile f(m_szFileName); - if(!f.openForReading())return false; - - KviStr tmp; - KviConfigGroup * p_group = 0; - - int iLoadBlockSize = LOAD_BLOCK_SIZE; - - char * buffer = (char *)kvi_malloc(iLoadBlockSize * sizeof(char)); - - int toRead; - int readedLen; - int remainingLen = 0; - - char * p = buffer; // start writing to the beginning of the buffer - - do { - // compute the length to read - toRead = iLoadBlockSize - remainingLen; - if(toRead < 1) - { - // ops... a string longer than iLoadBlockSize - 1 chars - iLoadBlockSize += LOAD_BLOCK_SIZE; - int iOffset = p - buffer; - buffer = (char *)kvi_realloc(buffer,iLoadBlockSize * sizeof(char)); - p = buffer + iOffset; - toRead += LOAD_BLOCK_SIZE; - } - - // do read - readedLen = f.readBlock(p,toRead); - if(readedLen < toRead) - { - // check for errors - if(readedLen <= 0) - { - if(readedLen < 0) - { - // error at all - f.close(); - kvi_free(buffer); - return true; // nothing more to parse anyway - } else { - // just a zero byte read - if(remainingLen == 0) - { - // there was nothing in the buffer - f.close(); // nothing to parse anyway - kvi_free(buffer); - return true; - } - // there is something in the buffer but we have readed 0 bytes - // this usually means that the last line in the file has no trailing newline - // ...we just fake it :) - *p = '\n'; - readedLen = 1; - } - } else { - // just readed something but less than expected - // check if the last readed char is a newline - // if it isn't , fake it - if(*(p + readedLen - 1) != '\n') - { - *(p + readedLen) = '\n'; - readedLen++; - } - } - } - // compute the end pointer - char * endp = p + readedLen; - - p = buffer; // start from beginning of the data buffer at all - // begin of the current string - char * begin = p; - - // and loop - while(p < endp) - { - // find a newline - if(*p != '\n') - { - p++; - continue; - } - // newline! - *p = 0; - // now begin points to the string that terminates in p - // skip leading whitespace - while((*begin == '\t') || (*begin == ' '))begin++; - - if(p == begin) - { - // empty line - p++; - begin = p; - continue; - } - // now p > begin - // check if there are trailing spaces (include CR so CRLF is trimmed too) - char * trail = p - 1; - - p++; - - while(trail >= begin) - { - if((*trail == '\r') || (*trail == '\t') || (*trail == ' '))*trail = 0; - else break; - trail--; - } - - // yeah, have some data in this line :D - switch(*begin) - { - case 0: - // empty line - break; - case '#': - // comment: just skip it - break; - case '[': - // group ? - begin++; - if(*begin && (*begin != ']')) - { - char * z = begin; -#define COMPAT_WITH_OLD_CONFIGS -#ifdef COMPAT_WITH_OLD_CONFIGS - // run to the end of the string - while(*z)z++; - // run back to the trailing ']' - while((z > begin) && (*z != ']'))z--; - // if it is not ther just run back to the end of the string - if(*z != ']')while(*z)z++; -#else - // new configs have it always encoded properly - while(*z && (*z != ']'))z++; -#endif - *z = 0; - tmp.hexDecode(begin); - tmp.stripRightWhiteSpace(); // no external spaces in group names - - if(!tmp.isEmpty()) - { - QString szGroup = m_bLocal8Bit ? - QString::fromLocal8Bit(tmp.ptr(),tmp.len()) : - QString::fromUtf8(tmp.ptr(),tmp.len()); - p_group = m_pDict->find(szGroup); - if(!p_group) - { - p_group = new KviConfigGroup(17,false); - p_group->setAutoDelete(true); - m_pDict->insert(szGroup,p_group); - } - } - } - break; - default: - { - // real data ? - char * z = begin; - while(*z && (*z != '='))z++; - if(*z && (z != begin)) - { - *z = 0; - tmp.hexDecode(begin); - tmp.stripRightWhiteSpace(); // No external spaces at all in keys - if(!tmp.isEmpty()) - { - QString szKey = m_bLocal8Bit ? - QString::fromLocal8Bit(tmp.ptr(),tmp.len()) : - QString::fromUtf8(tmp.ptr(),tmp.len()); - z++; - while(*z && ((*z == ' ') || (*z == '\t')))z++; - if(*z) - { - tmp.hexDecode(z); - QString * pVal = new QString( m_bLocal8Bit ? - QString::fromLocal8Bit(tmp.ptr(),tmp.len()) : - QString::fromUtf8(tmp.ptr(),tmp.len()) - ); - if(!p_group) - { - // ops...we're missing a group - // use the default one - p_group = new KviConfigGroup(17,false); - p_group->setAutoDelete(true); - m_pDict->insert(KVI_CONFIG_DEFAULT_GROUP,p_group); - } - p_group->replace(szKey,pVal); - } else { - // we in fact need this (mercy :D) - // otherwise the empty options will be treated as non-existing ones - // and will get the defaults (which is bad) - QString * pVal = new QString(QString::null); - p_group->replace(szKey,pVal); - } - } - } - } - break; - } - begin = p; - } - if(begin != endp) - { - // there is data with no trailing newline in the buffer - remainingLen = endp-begin; - if(buffer != begin) - { - kvi_memmove(buffer,begin,remainingLen); - p = buffer + remainingLen; - } // else p remains where it is - } else { - p = buffer; - } - } while(readedLen == toRead); - - f.close(); - kvi_free(buffer); - return true; -} - -/* - -bool KviConfig::load() -{ - QFile f(m_szFileName); - if(!f.open(IO_ReadOnly))return false; - - - KviConfigGroup * p_group = 0; - - KviStr dataLine; - bool bContinue; - - do { - bContinue = kvi_readLine(&f,dataLine); - dataLine.stripWhiteSpace(); - if(dataLine.hasData()) - { - switch(*(dataLine.ptr())) - { - case '#': - // just skip it , it is a comment - break; - case '[': - { - //set the group - dataLine.cutLeft(1); - dataLine.cutRight(1); - dataLine.hexDecode(); - if(dataLine.hasData()) - { - QString szUtf8 = QString::fromUtf8(dataLine.ptr()); - p_group = m_pDict->find(szUtf8); - - if(!p_group) - { - p_group = new KviConfigGroup(17,false); - p_group->setAutoDelete(true); - m_pDict->insert(szUtf8,p_group); - } - } - } - break; - default: - { - //data entry...split in two... - KviStr name=dataLine.getToken('='); - name.stripRightWhiteSpace(); // strip any whitespace added externally - name.hexDecode(); - if(name.hasData()) - { - dataLine.stripLeftWhiteSpace(); // strip any whitespace added externally - dataLine.hexDecode(); - //insert (replace items if needed) - QString *p_data=new QString(QString::fromUtf8(dataLine.ptr())); - if(!p_group) - { - // ops...we're missing a group - // use the default one - p_group = new KviConfigGroup(17,false); - p_group->setAutoDelete(true); - m_pDict->insert(KVI_CONFIG_DEFAULT_GROUP,p_group); - } - QString szName = QString::fromUtf8(name.ptr()); - p_group->replace(szName,p_data); - } - } - break; - } - } - } while (bContinue); - - f.close(); - return true; -} - -*/ - -bool KviConfig::save() -{ - static unsigned char encode_table[256]= - { - // 000 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 - // NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI - 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 , - // 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 - // DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US - 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 , - // 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 - // ! " # $ % & ' ( ) * + , - . / - 1 ,0 ,0 ,1 ,0 ,1 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 - // 0 1 2 3 4 5 6 7 8 9 : ; < = > ? - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,1 ,0 ,0 , - // 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079 - // @ A B C D E F G H I J K L M N O - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 080 081 082 083 084 085 086 087 088 089 090 091 092 093 094 095 - // P Q R S T U V W X Y Z [ \ ] ^ _ - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,1 ,0 ,1 ,0 ,0 , - // 096 097 098 099 100 101 102 103 104 105 106 107 108 109 110 111 - // ` a b c d e f g h i j k l m n o - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 - // p q r s t u v w x y z { | } ~  - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 - // - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 - // - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 - // - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 - // - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 - // � � � � � � � � � � � � � � � � - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 - // � � � � � � � � � � � � � � � � - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 - // � � � � � � � � � � � � � � � � - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 - // � � � � � � � � - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 - }; - - - if(m_bReadOnly)return false; - - KviFile f(m_szFileName); - if(!f.openForWriting())return false; - if(f.writeBlock("# KVIrc configuration file\n",27) != 27)return false; - - KviPointerHashTableIterator<QString,KviConfigGroup> it(*m_pDict); - while (it.current()) - { - if((it.current()->count() != 0) || (m_bPreserveEmptyGroups)) - { - KviStr group(m_bLocal8Bit ? KviQString::toLocal8Bit(it.currentKey()) : KviQString::toUtf8(it.currentKey())); - group.hexEncodeWithTable(encode_table); - - if(!f.putChar('['))return false; - if(f.writeBlock(group.ptr(),group.len()) < (int) group.len())return false; - if(f.writeBlock("]\n",2) < 2)return false; - - KviConfigGroup * dict = (KviConfigGroup *)it.current(); - KviConfigGroupIterator it2(*dict); - - KviStr szName,szValue; - while(QString * p_str = it2.current()) - { - szName = m_bLocal8Bit ? KviQString::toLocal8Bit(it2.currentKey()) : KviQString::toUtf8(it2.currentKey()); - szValue = m_bLocal8Bit ? KviQString::toLocal8Bit(*p_str) : KviQString::toUtf8(*p_str); - szName.hexEncodeWithTable(encode_table); - szValue.hexEncodeWhiteSpace(); - - if(f.writeBlock(szName.ptr(),szName.len()) < (int) szName.len())return false; - if(!f.putChar('='))return false; - if(f.writeBlock(szValue.ptr(),szValue.len()) < (int) szValue.len())return false; - if(!f.putChar('\n'))return false; - ++it2; - } - } - ++it; - } - f.close(); - m_bDirty = false; - return true; -} - -void KviConfig::setGroup(const QString & szGroup) -{ - m_szGroup = szGroup; - if(m_bPreserveEmptyGroups) - { - if(!hasGroup(szGroup)) - { - getCurrentGroup(); // we need it to be created. - m_bDirty = true; - } - } -} - -bool KviConfig::hasKey(const QString & szKey) -{ - KviConfigGroup * p_group = getCurrentGroup(); - return (p_group->find(szKey) != 0); -} - -bool KviConfig::hasGroup(const QString & szGroup) -{ - return (m_pDict->find(szGroup) != 0); -} - -KviConfigGroup * KviConfig::getCurrentGroup() -{ - if(m_szGroup.isEmpty())m_szGroup = KVI_CONFIG_DEFAULT_GROUP; - KviConfigGroup * p_group = m_pDict->find(m_szGroup); - if(!p_group) - { - //create the group - p_group = new KviConfigGroup(17,false); - p_group->setAutoDelete(true); - m_pDict->insert(m_szGroup,p_group); - } - return p_group; -} - -////////////////////////////////// KviStr - -void KviConfig::writeEntry(const QString & szKey,const QString & szValue) -{ - m_bDirty = true; - KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data=new QString(szValue); - p_group->replace(szKey,p_data); -} - -// FIXME: #warning "We have probs here ?" - -QString KviConfig::readEntry(const QString & szKey,const QString & szDefault) -{ - KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); - if(!p_str) - { - m_szStrBuffer = szDefault; - } else { - m_szStrBuffer = *p_str; - } - return m_szStrBuffer; -} - -//////////////////////////////////// QString - -/* -QString KviConfig::readQStringEntry(const char *szKey,const QString &szDefault) -{ - KviStrDict * p_group = getCurrentGroup(); - KviStr * p_str = p_group->find(szKey); - if(!p_str)return szDefault; - return QString::fromUtf8(p_str->ptr()); -} -*/ - -/* -void KviConfig::writeEntry(const char *szKey,const QString &szValue) -{ - m_bDirty = true; - KviStrDict * p_group = getCurrentGroup(); - p_group->replace(szKey,new KviStr(szValue.utf8().data())); -} -*/ - -////////////////////////////////// QStringList - -static QString g_szConfigStringListSeparator(",\\[ITEM],"); - -QStringList KviConfig::readStringListEntry(const QString & szKey,const QStringList &list) -{ - KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); - if(!p_str)return list; -#ifdef COMPILE_USE_QT4 - return p_str->split(g_szConfigStringListSeparator); -#else - return QStringList::split(g_szConfigStringListSeparator,*p_str); -#endif -} - -void KviConfig::writeEntry(const QString & szKey,const QStringList &list) -{ - m_bDirty = true; - KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data=new QString(list.join(g_szConfigStringListSeparator)); - p_group->replace(szKey,p_data); -} - -////////////////////////////////// KviValueList<int> - -KviValueList<int> KviConfig::readIntListEntry(const QString & szKey,const KviValueList<int> &list) -{ - KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); - if(!p_str) - { - //debug("Returning default list for group %s and key %s",m_szGroup.latin1(),szKey.latin1()); - return list; - } -#ifdef COMPILE_USE_QT4 - QStringList sl = p_str->split(","); -#else - QStringList sl = QStringList::split(",",*p_str); -#endif - KviValueList<int> ret; - - //debug("Got option list for group %s and key %s: %s",m_szGroup.latin1(),szKey.latin1(),p_str->latin1()); - - for(QStringList::Iterator it = sl.begin();it != sl.end();++it) - { - bool bOk; - int iTmp = (*it).toInt(&bOk); - if(bOk)ret.append(iTmp); - } - - return ret; -} - - -void KviConfig::writeEntry(const QString & szKey,const KviValueList<int> &list) -{ - m_bDirty = true; - KviConfigGroup * p_group = getCurrentGroup(); - KviStr szData; - for(KviValueList<int>::ConstIterator it = list.begin();it != list.end();++it) - { - if(szData.hasData())szData.append(','); - szData.append(KviStr::Format,"%d",*it); - } - //debug("Writing option list for group %s and key %s: %s",m_szGroup.latin1(),szKey.latin1(),szData.ptr()); - - p_group->replace(szKey,new QString(szData.ptr())); -} - -////////////////////////////////// KviPixmap - -// FIXME: #warning "Spaces in image names ?" - -void KviConfig::writeEntry(const QString & szKey,const KviPixmap &pixmap) -{ - m_bDirty = true; - KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data=new QString(); - KviStringConversion::toString(pixmap,*p_data); - p_group->replace(szKey,p_data); -} - -KviPixmap KviConfig::readPixmapEntry(const QString & szKey,const KviPixmap &pixDef) -{ - KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); - if(p_str) - { - KviPixmap ret(""); - return KviStringConversion::fromString(*p_str,ret) ? ret : pixDef; - } else { - return pixDef; - } -} - -////////////////////////////////// KviMsgType - -void KviConfig::writeEntry(const QString & szKey,const KviMsgType &msg) -{ - m_bDirty = true; - KviConfigGroup * p_group = getCurrentGroup(); - QString szData; - KviStringConversion::toString(msg,szData); - p_group->replace(szKey,new QString(szData)); -} - -KviMsgType KviConfig::readMsgTypeEntry(const QString & szKey,const KviMsgType &msgDef) -{ - KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); - if(!p_str)return msgDef; - KviMsgType ret = msgDef; - KviStringConversion::fromString(*p_str,ret); - return ret; -} - -////////////////////////////////// QColor - -void KviConfig::writeEntry(const QString & szKey,const QColor &clr) -{ - m_bDirty = true; - KviConfigGroup * p_group = getCurrentGroup(); - KviStr szData(KviStr::Format,"%d,%d,%d",clr.red(),clr.green(),clr.blue()); - p_group->replace(szKey,new QString(szData.ptr())); -} - -QColor KviConfig::readColorEntry(const QString & szKey,const QColor &clr) -{ - KviConfigGroup * p_group = getCurrentGroup(); - QColor color(clr); - QString * pointer_that_IS_initialized = p_group->find(szKey); - - - if(pointer_that_IS_initialized) - { - - KviStr str(*pointer_that_IS_initialized); - str.stripLeftWhiteSpace(); - - KviStr red,green,blue; - - str.getToken(red,','); - str.getToken(green,','); - str.getToken(blue,','); - - if((red.isUnsignedNum())&&(green.isUnsignedNum())&&(blue.isUnsignedNum())){ - bool bOk; - int r = red.toInt(&bOk) % 256; - int g = green.toInt(&bOk) % 256; - int b = blue.toInt(&bOk) % 256; - if(r < 0)r = -r; - if(g < 0)g = -g; - if(b < 0)b = -b; - color.setRgb(r,g,b); - } - } - return color; -} - -////////////////////////////////// QFont - -void KviConfig::getFontProperties(KviStr & buffer,QFont *fnt) -{ - QString tmp; - KviStringConversion::toString(*fnt,tmp); - buffer = tmp; -} - -void KviConfig::writeEntry(const QString & szKey,QFont &fnt) -{ - m_bDirty = true; - KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data = new QString(); - KviStringConversion::toString(fnt,*p_data); - p_group->replace(szKey,p_data); -} - - -void KviConfig::setFontProperties(KviStr & str,QFont *fnt) -{ - KviStringConversion::fromString(str.ptr(),*fnt); -} - -QFont KviConfig::readFontEntry(const QString & szKey,const QFont &fnt) -{ - QFont font(fnt); - KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); - if(p_str) - { - //FontEntry=Arial,12,9,0,100,italic,underline,strikeout, - KviStr str(*p_str); - str.stripLeftWhiteSpace(); - setFontProperties(str,&font); - } - return font; -} - -////////////////////////////////// bool - -void KviConfig::writeEntry(const QString & szKey,bool bTrue) -{ - m_bDirty = true; - KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data = new QString(bTrue ? "true" : "false"); - p_group->replace(szKey,p_data); -} - -bool KviConfig::readBoolEntry(const QString & szKey,bool bTrue) -{ - KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); - if(!p_str)return bTrue; - static QString szTrue = "true"; - return (KviQString::toLower(*p_str) == szTrue); -} - -////////////////////////////////// QRect - -void KviConfig::writeEntry(const QString & szKey,const QRect &rct) -{ - m_bDirty = true; - KviConfigGroup * p_group = getCurrentGroup(); - QString szBuf; - KviStringConversion::toString(rct,szBuf); - p_group->replace(szKey,new QString(szBuf)); -} - -QRect KviConfig::readRectEntry(const QString & szKey,const QRect &rct) -{ - KviConfigGroup * p_group = getCurrentGroup(); - QString * str = p_group->find(szKey); - if(!str)return rct; - QRect ret; - return KviStringConversion::fromString(*str,ret) ? ret : rct; -} - -////////////////////////////////// unsigned short - -void KviConfig::writeEntry(const QString & szKey,unsigned short usValue) -{ - m_bDirty = true; - KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data = new QString(); - p_data->setNum(usValue); - p_group->replace(szKey,p_data); -} - -unsigned short int KviConfig::readUShortEntry(const QString & szKey,unsigned short int usDefault) -{ - KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); - if(!p_str)return usDefault; - bool bOk; - unsigned short int usVal=p_str->toUShort(&bOk); - return bOk ? usVal : usDefault; -} - -/* -////////////////////////////////// unsigned long - -Unused code -void KviConfig::writeEntry(const char *szKey,unsigned long lValue) -{ - m_bDirty = true; - KviStrDict * p_group = getCurrentGroup(); - KviStr *p_data = new KviStr(); - p_data->setNum(lValue); - p_group->replace(szKey,p_data); -} - -unsigned long KviConfig::readULongEntry(const char *szKey,unsigned long lDefault) -{ - KviStrDict * p_group = getCurrentGroup(); - KviStr * p_str = p_group->find(szKey); - if(!p_str)return lDefault; - bool bOk; - unsigned long lVal=p_str->toULong(&bOk); - return bOk ? lVal : lDefault; -} -*/ - -////////////////////////////////// int - -void KviConfig::writeEntry(const QString & szKey,int iValue) -{ - m_bDirty = true; - KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data = new QString(); - p_data->setNum(iValue); - p_group->replace(szKey,p_data); -} - -int KviConfig::readIntEntry(const QString & szKey,int iDefault) -{ - KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); - if(!p_str)return iDefault; - bool bOk; - int iVal=p_str->toInt(&bOk); - return bOk ? iVal : iDefault; -} - -////////////////////////////////// unsigned int - -void KviConfig::writeEntry(const QString & szKey,unsigned int iValue) -{ - m_bDirty = true; - KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data = new QString(); - p_data->setNum(iValue); - p_group->replace(szKey,p_data); -} - -unsigned int KviConfig::readUIntEntry(const QString & szKey,unsigned int iDefault) -{ - KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); - if(!p_str)return iDefault; - bool bOk; - unsigned int iVal=p_str->toUInt(&bOk); - return bOk ? iVal : iDefault; -} - -////////////////////////////////// char - -void KviConfig::writeEntry(const QString & szKey,char iValue) -{ - m_bDirty = true; - KviConfigGroup * p_group = getCurrentGroup(); - QString * p_data = new QString(); - p_data->setNum(iValue); - p_group->replace(szKey,p_data); -} - -char KviConfig::readCharEntry(const QString & szKey,char iDefault) -{ - KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); - if(!p_str)return iDefault; - bool bOk; - char iVal=(char)p_str->toInt(&bOk); - return bOk ? iVal : iDefault; -} - -////////////////////////////////// unsigned char - -void KviConfig::writeEntry(const QString & szKey,unsigned char iValue) -{ - m_bDirty = true; - KviConfigGroup * p_group = getCurrentGroup(); - QString *p_data = new QString(); - p_data->setNum(iValue); - p_group->replace(szKey,p_data); -} - -unsigned char KviConfig::readUCharEntry(const QString & szKey,unsigned char iDefault) -{ - KviConfigGroup * p_group = getCurrentGroup(); - QString * p_str = p_group->find(szKey); - if(!p_str)return iDefault; - bool bOk; - unsigned char iVal=(unsigned char)p_str->toUInt(&bOk); - return bOk ? iVal : iDefault; -} - - -#ifdef COMPILE_ON_WINDOWS - - // On windows we need to override new and delete operators - // to ensure that always the right new/delete pair is called for an object instance - // This bug is present in all the classes exported by a module that - // can be instantiated/destroyed from external modules. - // (this is a well known bug described in Q122675 of MSDN) - - void * KviConfig::operator new(size_t tSize) - { - return kvi_malloc(tSize); - } - - void KviConfig::operator delete(void * p) - { - kvi_free(p); - } - -#endif diff --git a/3.4.0/src/kvilib/ext/kvi_config.h b/3.4.0/src/kvilib/ext/kvi_config.h deleted file mode 100644 index 1f529ccbad..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_config.h +++ /dev/null @@ -1,162 +0,0 @@ -#ifndef _KVI_CONFIG_H_INCLUDED_ -#define _KVI_CONFIG_H_INCLUDED_ - -//============================================================================= -// -// File : kvi_config.h (/usr/build/NEW_kvirc/kvirc/kvilib/kvi_config.h) -// Last major modification : Thu Jan 14 1999 18:01:22 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_string.h" -#include "kvi_settings.h" -#include "kvi_heapobject.h" -#include "kvi_pointerhashtable.h" -#include "kvi_valuelist.h" - -#include <qcolor.h> -#include <qfont.h> -#include <qrect.h> -#include <qstringlist.h> - -#define KVI_CONFIG_DEFAULT_GROUP "KVIrc" - -class KviPixmap; -class KviMsgType; - -typedef KviPointerHashTable<QString,QString> KviConfigGroup; -typedef KviPointerHashTableIterator<QString,QString> KviConfigGroupIterator; -typedef KviPointerHashTableIterator<QString,KviConfigGroup> KviConfigIterator; - -class KVILIB_API KviConfig : public KviHeapObject -{ -public: - enum FileMode { Read = 1 , Write = 2 , ReadWrite = 3 }; -public: - KviConfig(const QString &filename,FileMode f/* = ReadWrite*/,bool bLocal8Bit = false); - KviConfig(const char *filename,FileMode f/* = ReadWrite*/,bool bLocal8Bit = false); - ~KviConfig(); -private: - bool m_bLocal8Bit; - KviPointerHashTable<QString,KviConfigGroup> * m_pDict; - QString m_szFileName; - bool m_bDirty; - QString m_szStrBuffer; - QString m_szGroup; - bool m_bPreserveEmptyGroups; - bool m_bReadOnly; -private: - bool load(); - bool save(); - KviConfigGroup * getCurrentGroup(); -public: - // - // Useful when saving... - // Normally this class does not save empty groups - // and setGroup() is never a config modification. - // If the group is not existing it will be effectively - // created only at the first attempt to read from it or write to it. - // With this flag set to true the KviConfig class will - // write down also the empty groups , and calls to setGroup() - // will create the groups if not existing yet (and set the config data - // as modified). - // - void preserveEmptyGroups(bool bPreserve){ m_bPreserveEmptyGroups = bPreserve; }; - const QString & fileName(){ return m_szFileName; }; - bool readOnly(){ return m_bReadOnly; }; - void setReadOnly(bool bReadOnly){ m_bReadOnly = bReadOnly; }; - bool dirty(){ return m_bDirty; }; - // - // This sets the save path for the config file - // In this way you can load a system-wide read-only config file - // as default configuration, alter its settings and save it to the - // user local configuration directory - void setSavePath(const QString & savePath){ m_szFileName = savePath; }; - KviPointerHashTable<QString,KviConfigGroup> *dict(){ return m_pDict; }; - - void clearDirtyFlag(){ m_bDirty = false; }; - void clear(); - void clearGroup(const QString & szGroup); - void clearKey(const QString & szKey); - unsigned int groupsCount(){ return m_pDict->count(); }; - bool sync(){ return save(); }; - bool hasKey(const QString & szKey); - bool hasGroup(const QString & szGroup); - void setGroup(const QString & szGroup); - //void getContentsString(KviStr &buffer); - const QString & group(){ return m_szGroup; }; - void writeEntry(const QString & szKey,const QString & szValue); - void writeEntry(const QString & szKey,const char * szValue) - { writeEntry(szKey,QString::fromUtf8(szValue)); }; - QString readEntry(const QString & szKey,const QString & szDefault = QString::null); - // HACK for KviOptions.. (FIXME) - QString readKviStrEntry(const QString &szKey,const KviStr &szDefault) - { return readEntry(szKey,szDefault.ptr()); }; - //void writeEntry(const char *szKey,KviStr &szValue); - //const char * readEntry(const char *szKey,KviStr &szDefault); - void writeEntry(const QString & szKey,const KviPixmap &pixmap); - KviPixmap readPixmapEntry(const QString & szKey,const KviPixmap &pixDef); - void writeEntry(const QString & szKey,const KviMsgType &msg); - KviMsgType readMsgTypeEntry(const QString & szKey,const KviMsgType &msgDef); - void writeEntry(const QString & szKey,const QColor &clr); - QColor readColorEntry(const QString & szKey,const QColor &clr); - void writeEntry(const QString & szKey,QFont &fnt); - QFont readFontEntry(const QString & szKey,const QFont &fnt); - void writeEntry(const QString & szKey,bool bTrue); - bool readBoolEntry(const QString & szKey,bool bTrue); - QRect readRectEntry(const QString & szKey,const QRect &rct); - void writeEntry(const QString & szKey,const QRect &rct); - QStringList readStringListEntry(const QString & szKey,const QStringList &list); - void writeEntry(const QString & szKey,const QStringList &list); - KviValueList<int> readIntListEntry(const QString & ,const KviValueList<int> &list); - void writeEntry(const QString & szKey,const KviValueList<int> &list); - QString readQStringEntry(const QString & szKey,const QString &szDefault = QString::null) - { return readEntry(szKey,szDefault); }; - //void writeEntry(const QString & szKey,const QString &szValue); - //void writeEntry(const char *szKey,unsigned long lValue); - //unsigned long readULongEntry(const char *szKey,unsigned long lDefault); - //void writeEntry(const char *szKey,long lValue); - //long readLongEntry(const char *szKey,long lDefault); - void writeEntry(const QString & szKey,int iValue); - int readIntEntry(const QString & szKey,int iDefault); - void writeEntry(const QString & szKey,unsigned short int usValue); - unsigned short int readUShortEntry(const QString & szKey,unsigned short int usDefault); - void writeEntry(const QString & szKey,unsigned int iValue); - unsigned int readUIntEntry(const QString & szKey,unsigned int iDefault); - void writeEntry(const QString & szKey,char iValue); - char readCharEntry(const QString & szKey,char iDefault); - void writeEntry(const QString & szKey,unsigned char iValue); - unsigned char readUCharEntry(const QString & szKey,unsigned char iDefault); - - static void getFontProperties(KviStr & buffer,QFont *fnt); - static void setFontProperties(KviStr & str,QFont *fnt); - -#ifdef COMPILE_ON_WINDOWS - // On windows we need to override new and delete operators - // to ensure that always the right new/delete pair is called for an object instance - // This bug is present in all the classes exported by a module that - // can be instantiated/destroyed from external modules. - // (this is a well known bug described in Q122675 of MSDN) - void * operator new(size_t tSize); - void operator delete(void * p); -#endif -}; - -#endif //!_KVI_CONFIG_H_INCLUDED_ diff --git a/3.4.0/src/kvilib/ext/kvi_crypt.cpp b/3.4.0/src/kvilib/ext/kvi_crypt.cpp deleted file mode 100644 index 1846753d9d..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_crypt.cpp +++ /dev/null @@ -1,240 +0,0 @@ -//============================================================================= -// -// File : kvi_crypt.cpp -// Creation date : Fri Nov 03 2000 02:34:43 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - -#include "kvi_crypt.h" -#include "kvi_locale.h" - -#ifdef COMPILE_ON_WINDOWS - #include "kvi_malloc.h" -#endif - -/* - @doc: crypt_engines - @type: - generic - @keyterms: - cryptography, privacy, private key, text transformation - @title: - Cryptography and text transformation - @short: - Crypt/text transformation engines and how to use them - @body: - [big]Introduction[/big][br] - Well , there is a concrete background noise about security around the net. - And I've thought that adding a little cryptography support to KVIrc wasn't - a bad idea. So I've first comed out with the "crypt engines", that - allowed to have secure conversations on channels, queries and dcc chats; - then found out that the realized structure was perfect to be "generalized" - into "text transformation" support.[br] - [big]The concept[/big][br] - In few words, the "text transformation" engine is a layer between the user and the - IRC connection. You type some text in the input line of a query window (for example), - the engine transforms the text in some way and then sends it to the remote target. - The trick works also in the reverse way: some data come from the remote target, - the engine retransforms the text in some other way and displays it to the local user.[br] - The "incoming" transformation is usually the inverse of the "outgoing" one, but it - is not mandatory. It will become clear in few sentences that some engines will do no "incoming" - transformation at all. The original use of the transformation engines was to crypt the - outgoing data and to decrypt the incoming data; anyway, the engines can perform - other funky tasks. One of them is remapping the local charset to a "standardized" one - when sending text to a channel (or some other target) and doing the inverse map on - the way back. A totally "fantastic" usage of this concept could be an "on-the-fly translator"; - it could translate for example Italian to English while sending to a channel - and English to Italian on the way back...the implementation of a such engine is left - to the reader as exercise :) Another (maybe less interesting) usage is to - colorize the outgoing text, or transform it - in a way that it is still readable but has a different look. This engine - would not require a back transformation (so no "decrypt stage"). A "symmetric" - idea could be an engine that strips the color codes from the incoming text: this - engine would not require a "crypting" stage.[br] - - [big]The name of this stuf[/big][br] - Initially all this stuff was named "cryptography support". - Then the "cryptography" comed out to be not "enough" to describe - the framework, so "text transformation" is a more generic term. - Anyway, both terms were used in the documentation and the source. - Just as example, the "text transformation engine" is called - KviCryptEngine in the sources. So actually the terms "crypt" - and "text transformations" refer to the "same thing". - You will often find the term "encrypt" standing for "outgoing text - transformation" and "decrypt" standing for "incoming text transformation".[br] - - [big]Yes, but why cryptography (on IRC) ?[/big][br] - Because it MAY be useful. More than once people have asked me to add some - crypting support to the dcc chats. Yes , I know that there are other - "secure communication" tools , but actually I can't find one that is able to - implement a "secure real time conversation". And what about a MULTIPLE real - time secure conversation ? This can be done on an IRC channel now.[br] - - [big]The working things[/big][br] - KVIrc can use a text transformation engine on irc channels, in the queries - and the dcc chats. At the time I am writing, only the [module:rijndael]Rijndael[/module] crypt engine - is available: this is a private key encryption algorithm that assures - a "pretty good" security level. More engines will be surely available - at the time of the 3.0.0 release of KVIrc. The engines - can be activated by the dedicated dialog that can be accessed from the "button bar" - of the window. Once an engine has been enabled all the text that you type - in the input line (that is not a command obviously) is encrypted - and sent to the remote endpoint. If you want to sent a non crypted message - while an engine is working you can use the CTRL+P escape: by placing - that character as the FIRST CHARACTER of the line you will avoid crypting. - Every engine has different capabilities: some can both encrypt - and decrypt, other perform only half of the operations. Some engines - need a key (the crypt engines obviously), or two keys (you can specify - one for the outgoing data and one for the incoming). You can specify - all these options in the crypt/text transformation dialog.[br] - Obviously (with the current implementations) all the conversation endpoints - must agree on the engine (or better algorithm) used and on the key(s). - The key is user specified, so you have to find a secure way to negotiate - it with your communication engpoints. If you can meet the persons in the "real life", - this is the best way to exchange the keys, otherwise you can use mail & pgp. - Yes, this is a "miss" of the crypt protocol: it is missing a public key handshake.[br] - - [big]The first test[/big][br] - A cool way to test a crypting engine is to use a "self query": connect to - any irc server, and execute [cmd]query[/cmd] <yournickname>; a query window - with you both as source and target will popup; activate a crypt engine - and enable both encryption and decryption; specify the same key for - bot directions and then type some text in the input line: you will see - the message twice: one is "your local text" and the other is the server routed one. - Then you can try to activate encryption only and leaving decryption disabled: - you will see how the text would appear to a possible "man in the middle". - You can also try to use different keys for encrypting and decrypting, - and play with the CTRL+P escape.[br] - - [big]The protocol[/big][br] - Well, there is no protocol actually , only the existing implementations , that - can be accessed by anyone that want to reproduce them. There are only some - points relating to the crypting engines that need to be cleared:[br] - The crypted text must be suitable to be sent thru an IRC connection; - this means that some characters can not appear in the crypted text (e.g. CR,LF,NULL....). - KVIrc solves it in a simple way: the crypted binary data is encoded, - either as hexadecimal numeric string or in base64.[br] - An escape character has been defined to identify messages that are "crypted" from the - ones that are not: this character has ascii code 30 (decimal).[br] - The encoding is used in private messages only and has the following format:[br] - PRIVMSG <target> :<escape_char_ascii_30><encrypted message>[br] - ASCII 30 does not correspond to any widely used escape sequence and allows - mixing encrypted and plain text messages in a conversation...Well, this is not - so pretty but you can exchange crypted messages with one or two friends while - talking on a normal IRC channel: nobody else than your friends will be able - to understand the message; others will see senseless sequences of characters. - You will be still able to read the unencrypted messages of the other people - on the channel.[br] The escape character is not needed if the engine - performs non-crypting tasks: a charset mapper will produce text that - is meant to be readed by anyone on the channel, a text colorizer will - act in a similar way too. So the escape character is used for the "crypting" - engines only. - - [big]An idea for the future implementations[/big][br] - A "public key" handshake protocol could be implemented. -*/ - - - KviCryptEngine::KviCryptEngine() - { -#ifdef COMPILE_CRYPT_SUPPORT - setLastError(__tr2qs("Invalid crypt engine")); - m_iMaxEncryptLen = -1; // unlimited - m_deallocFunc = 0; -#endif //COMPILE_CRYPT_SUPPORT - } - - KviCryptEngine::~KviCryptEngine() - { - } - -#ifdef COMPILE_CRYPT_SUPPORT - - bool KviCryptEngine::init(const char *,int,const char *,int) - { - return false; - } - - KviCryptEngine::EncryptResult KviCryptEngine::encrypt(const char *,KviStr &) - { -// debug("Pure virtual KviCryptEngine::encrypt() called"); - return EncryptError; - } - - KviCryptEngine::DecryptResult KviCryptEngine::decrypt(const char *,KviStr &) - { -// debug("Pure virtual KviCryptEngine::decrypt() called"); - return DecryptError; - } - - - KviCryptEngineManager::KviCryptEngineManager() - { - m_pEngineDict = new KviPointerHashTable<QString,KviCryptEngineDescription>; - m_pEngineDict->setAutoDelete(true); - } - - KviCryptEngineManager::~KviCryptEngineManager() - { - delete m_pEngineDict; - } - - void KviCryptEngineManager::registerEngine(KviCryptEngineDescription * d) - { - m_pEngineDict->replace(d->szName,d); - } - - void KviCryptEngineManager::unregisterEngine(const QString &szName) - { - m_pEngineDict->remove(szName); - } - - void KviCryptEngineManager::unregisterEngines(void * providerHandle) - { - KviPointerHashTableIterator<QString,KviCryptEngineDescription> it(*m_pEngineDict); - while(it.current()) - { - if(it.current()->providerHandle == providerHandle) - m_pEngineDict->remove(it.currentKey()); - else - ++it; - } - } - - KviCryptEngine * KviCryptEngineManager::allocateEngine(const QString &szName) - { - KviCryptEngineDescription * d = m_pEngineDict->find(szName); - if(!d)return 0; - KviCryptEngine * e = d->allocFunc(); - if(!e)return 0; - e->m_deallocFunc = d->deallocFunc; // remember the dealloc func from now on - return e; - } - - void KviCryptEngineManager::deallocateEngine(KviCryptEngine * e) - { - if(!e)return; - crypt_engine_deallocator_func deallocFunc = e->m_deallocFunc; - deallocFunc(e); - } - -#endif //COMPILE_CRYPT_SUPPORT diff --git a/3.4.0/src/kvilib/ext/kvi_crypt.h b/3.4.0/src/kvilib/ext/kvi_crypt.h deleted file mode 100644 index 5e05a26670..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_crypt.h +++ /dev/null @@ -1,160 +0,0 @@ -#ifndef _KVI_CRYPT_H_ -#define _KVI_CRYPT_H_ - -//============================================================================= -// -// File : kvi_crypt.h -// Creation date : Fri Nov 03 2000 01:45:21 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - - -// -// Base class for all IRC crypt engines -// These intend to encrypt plain text into something -// that can be sent through the IRC protocol... -// so it should not contain NULL, CR , LF and other -// similar stuff... -// - - -#include "kvi_qstring.h" -#include "kvi_string.h" -#include "kvi_heapobject.h" -#include "kvi_pointerhashtable.h" - -#include <qobject.h> - -#ifdef COMPILE_CRYPT_SUPPORT - class KviCryptEngine; - - typedef KviCryptEngine * (*crypt_engine_allocator_func)(); - typedef void (*crypt_engine_deallocator_func)(KviCryptEngine *); -#endif //COMPILE_CRYPT_SUPPORT - - // we must include this declaration to make moc happy even - // if we're not compiling the crypt support - - class KVILIB_API KviCryptEngine : public QObject, public KviHeapObject - { - Q_OBJECT - friend class KviCryptEngineManager; - public: - KviCryptEngine(); - virtual ~KviCryptEngine(); - -#ifdef COMPILE_CRYPT_SUPPORT - private: - crypt_engine_deallocator_func m_deallocFunc; // this is accessed by KviCryptEngineManager only - QString m_szLastError; - int m_iMaxEncryptLen; - public: - void setMaxEncryptLen(int m){ m_iMaxEncryptLen = m; }; - int maxEncryptLen(){ return m_iMaxEncryptLen; }; - virtual bool init(const char * encKey,int encKeyLen,const char * decKey,int decKeyLen); - // - // Encrypts utf8 plainText and returns the encrypted - // data in outBuffer. The encrypted data must be - // suitable for sending thru an IRC (eventually DCC - // that is less restrictive) connection and must be utf8 encoded: so - // no NULL, CR and LF in the output. - // 0x01 should be also avoided since - // it is the CTCP delimiter. - // Converting the result in a HEX string - // is a good trick...also Base64 could be used. - // Should return false in case of an error. - // Theoretically we could allow NULLs in plainText - // but this is not the case of KVIrc. - // - enum EncryptResult { Encrypted, Encoded, EncryptError }; - virtual EncryptResult encrypt(const char * plainText,KviStr &outBuffer); - // - // Decrypts the utf8 data in inBuffer and puts the decrypted utf8 - // stuff in plainText. inBuffer is the thingie - // that we got from outBuffer of encrupt() so it - // follows the same rules. - // Should return false in case of error. - // - enum DecryptResult { DecryptOkWasEncrypted, DecryptOkWasEncoded, DecryptOkWasPlainText, DecryptError }; - virtual DecryptResult decrypt(const char * inBuffer,KviStr &plainText); - // - // Returns the string containing the description - // of the last error or an empty string if there - // was no error after the last init() call. - // - const QString &lastError(){ return m_szLastError; }; - protected: - // - // The following two should have clear meaning - // - void clearLastError(){ m_szLastError = ""; }; - void setLastError(const QString &err){ m_szLastError = err; }; -#endif //COMPILE_CRYPT_SUPPORT - }; - -#ifdef COMPILE_CRYPT_SUPPORT - #define KVI_CRYPTENGINE_CAN_ENCRYPT 1 - #define KVI_CRYPTENGINE_CAN_DECRYPT 2 - #define KVI_CRYPTENGINE_WANT_ENCRYPT_KEY 4 - #define KVI_CRYPTENGINE_WANT_DECRYPT_KEY 8 - - class KVILIB_API KviCryptEngineDescription : public KviHeapObject - { - public: - KviCryptEngineDescription(){}; - virtual ~KviCryptEngineDescription(){}; - public: - QString szName; // engine name - QString szDescription; // details - QString szAuthor; // algorithm author - int iFlags; // properties - crypt_engine_allocator_func allocFunc; // engine allocator - crypt_engine_deallocator_func deallocFunc; // deallocation function (if called from outside the origin module) - void * providerHandle; // used to identify the provider module - }; - - - class KVILIB_API KviCryptEngineManager - { - public: - KviCryptEngineManager(); - virtual ~KviCryptEngineManager(); - private: - KviPointerHashTable<QString,KviCryptEngineDescription> * m_pEngineDict; - public: - const KviPointerHashTable<QString,KviCryptEngineDescription> * engineDict(){ return m_pEngineDict; }; - void registerEngine(KviCryptEngineDescription * d); - void unregisterEngine(const QString &szName); - void unregisterEngines(void * providerHandle); - // - // Allocates a crypt engine - // Please note that the engine may be deleted from outside - // so you'd better connect the "destroyed" signal - // - KviCryptEngine * allocateEngine(const QString &szName); - void deallocateEngine(KviCryptEngine * e); - }; - -#endif //COMPILE_CRYPT_SUPPORT - - -#endif //!_KVI_CRYPT_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_databuffer.cpp b/3.4.0/src/kvilib/ext/kvi_databuffer.cpp deleted file mode 100644 index 0f69202794..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_databuffer.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// -// File : kvi_databuffer.cpp -// Creation date : Thu Aug 23 17:04:24 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#define _KVI_DEBUG_CHECK_RANGE_ - -#include "kvi_debug.h" - -#include "kvi_databuffer.h" -#include "kvi_malloc.h" -#include "kvi_memmove.h" - -// FIXME: this could resize in chunks!...this would be damn faster :) - -KviDataBuffer::KviDataBuffer(int uSize,const unsigned char * data) -{ - __range_valid(uSize > 0); - m_uSize = uSize; - m_pData = (unsigned char *)kvi_malloc(sizeof(unsigned char) * uSize); - if(data)kvi_memmove(m_pData,data,uSize); -} - -KviDataBuffer::KviDataBuffer() -{ - m_uSize = 0; - m_pData = 0; -} - -KviDataBuffer::~KviDataBuffer() -{ - if(m_pData) - { - __range_valid(m_uSize); - kvi_free(m_pData); - } -} - -int KviDataBuffer::find(const unsigned char * block,int uSize) -{ - if(uSize < 1)return -1; - if(uSize > m_uSize)return -1; - - int uSearchSize = (m_uSize - uSize) + 1; - - for(int i=0;i<uSearchSize;i++) - { - if(m_pData[i] == *block) - { - // good beginning - if(uSize == 1)return i; - int j; - for(j = 1;j<uSize;j++) - { - if(m_pData[i + j] != block[j]) - { - j = 0; - break; - } - } - if(j > 0)return i; - } - } - - return -1; -} - -int KviDataBuffer::find(unsigned char c) -{ - const unsigned char * p = m_pData; - const unsigned char * e = p + m_uSize; - while(p < e) - { - if(*p == c)return (p - m_pData); - p++; - } - return -1; -} - - -void KviDataBuffer::remove(int uSize) -{ - __range_valid((uSize <= m_uSize) && (uSize > 0)); - - m_uSize -= uSize; - - if(m_uSize > 0) - { - kvi_memmove(m_pData,m_pData + uSize,m_uSize); - m_pData = (unsigned char *)kvi_realloc(m_pData,m_uSize * sizeof(unsigned char)); - } else { - kvi_free(m_pData); - m_pData = 0; - } -} - -void KviDataBuffer::resize(int uSize) -{ - __range_valid(uSize >= 0); - if(uSize > 0) - { - m_pData = (unsigned char *)kvi_realloc(m_pData,uSize * sizeof(unsigned char)); - } else { - kvi_free(m_pData); - m_pData = 0; - } - m_uSize = uSize; -} - -void KviDataBuffer::append(const unsigned char * data,int uSize) -{ - m_pData = (unsigned char *)kvi_realloc(m_pData,m_uSize + uSize); - kvi_memmove(m_pData + m_uSize,data,uSize); - m_uSize += uSize; -} diff --git a/3.4.0/src/kvilib/ext/kvi_databuffer.h b/3.4.0/src/kvilib/ext/kvi_databuffer.h deleted file mode 100644 index aa5fe08cd6..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_databuffer.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef _KVI_DATABUFFER_H_ -#define _KVI_DATABUFFER_H_ -// -// File : kvi_databuffer.h -// Creation date : Thu Aug 23 17:04:25 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_heapobject.h" - -class KVILIB_API KviDataBuffer : public KviHeapObject -{ -public: - // uSize MUST be greater than 0 - // if data is non-zero, it MUST point to a buffer at least uSize bytes long - // and the data is COPIED from that buffer! - KviDataBuffer(int uSize,const unsigned char * data = 0); - KviDataBuffer(); - ~KviDataBuffer(); -private: - int m_uSize; - unsigned char * m_pData; -public: - int size() const { return m_uSize; }; - unsigned char * data() const { return m_pData; }; - // uSize MUST be smaller or equal to size() - // consumes data! - void remove(int uSize); - void clear(){ if(m_uSize > 0)remove(m_uSize); }; - // uSize MUST be greater than 0 - void resize(int uSize); - void addSize(int uSize){ resize(m_uSize + uSize); }; - void append(const unsigned char * data,int uSize); - void append(const KviDataBuffer &b){ append(b.data(),b.size()); }; - int find(unsigned char c); - int find(const unsigned char * block,int uSize); -}; - -#endif //_KVI_DATABUFFER_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_dcophelper.cpp b/3.4.0/src/kvilib/ext/kvi_dcophelper.cpp deleted file mode 100644 index 62d8436d36..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_dcophelper.cpp +++ /dev/null @@ -1,357 +0,0 @@ -//============================================================================= -// -// File : kvi_dcophelper.cpp -// Created on Sat 20 Jan 2007 12:35:21 by Alexander Stillich -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// Copyright (C) 2007 Alexander Stillich <torque at pltn dot org> -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_dcophelper.h" - -#ifdef COMPILE_KDE_SUPPORT - -#include "dcopclient.h" - -#include <qdatastream.h> -#include <qvaluelist.h> - -// must be included this way, since kvilib is built -// before kvirc and symlinks to headers aren't set yet -#include "../../kvirc/kernel/kvi_app.h" -#include "kvi_thread.h" - -KviDCOPHelper::KviDCOPHelper(bool bStartApp, const KviQCString &szAppId) -{ - m_szAppId = szAppId; -} - -KviDCOPHelper::~KviDCOPHelper() -{ -} - -bool KviDCOPHelper::ensureAppRunning(const QString &szApp) -{ - if (findRunningApp(m_szAppId)) - return true; - - if (m_bStartApp) - return startApp(m_szAppId,400); - - return false; -} - - -bool KviDCOPHelper::voidRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc) -{ - if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); -} - -bool KviDCOPHelper::voidRetBoolDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,bool bVal) -{ - if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - QDataStream arg(data, IO_WriteOnly); - arg << bVal; - return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); -} - -bool KviDCOPHelper::voidRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal) -{ - if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - QDataStream arg(data, IO_WriteOnly); - arg << iVal; - return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); -} - -bool KviDCOPHelper::voidRetIntBoolDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal, bool bVal) -{ - if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - QDataStream arg(data, IO_WriteOnly); - arg << iVal; - arg << bVal; - return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); -} - -bool KviDCOPHelper::voidRetIntIntIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal1, int iVal2, int iVal3) -{ - if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - QDataStream arg(data, IO_WriteOnly); - arg << iVal1; - arg << iVal2; - arg << iVal3; - return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); -} - -bool KviDCOPHelper::voidRetFloatDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,float fVal) -{ - if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - QDataStream arg(data, IO_WriteOnly); - arg << fVal; - return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); -} - -bool KviDCOPHelper::voidRetStringDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,const QString &szVal) -{ - if(!ensureAppRunning(m_szAppId))return false; - QByteArray data; - QDataStream arg(data, IO_WriteOnly); - arg << szVal; - return g_pApp->dcopClient()->send(m_szAppId,szObj,szFunc,data); -} - -bool KviDCOPHelper::stringRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,QString &szRet) -{ - if(!ensureAppRunning(m_szAppId))return false; - QByteArray data, replyData; - KviQCString replyType; - if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) - return false; - QDataStream reply( replyData, IO_ReadOnly ); - if(replyType == "QString") - { - reply >> szRet; - return true; - } - return false; -} - -bool KviDCOPHelper::stringRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,QString &szRet,int iVal) -{ - if(!ensureAppRunning(m_szAppId))return false; - QByteArray data, replyData; - KviQCString replyType; - - QDataStream arg(data, IO_WriteOnly); - arg << iVal; - - if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) - return false; - - QDataStream reply( replyData, IO_ReadOnly ); - if(replyType == "QString") - { - reply >> szRet; - return true; - } - return false; -} - -bool KviDCOPHelper::intRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int &ret) -{ - if(!ensureAppRunning(m_szAppId))return false; - QByteArray data, replyData; - KviQCString replyType; - if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) - return false; - QDataStream reply( replyData, IO_ReadOnly ); - if(replyType == "int") - { - reply >> ret; - return true; - } - return false; -} - -bool KviDCOPHelper::intRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int &ret, int iVal) -{ - if(!ensureAppRunning(m_szAppId))return false; - QByteArray data, replyData; - KviQCString replyType; - - QDataStream arg(data, IO_WriteOnly); - arg << iVal; - - if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) - return false; - - QDataStream reply( replyData, IO_ReadOnly ); - if(replyType == "int") - { - reply >> ret; - return true; - } - return false; -} - -bool KviDCOPHelper::boolRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,bool &ret) -{ - if(!ensureAppRunning(m_szAppId))return false; - QByteArray data, replyData; - KviQCString replyType; - if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) - return false; - QDataStream reply( replyData, IO_ReadOnly ); - if(replyType == "bool") - { - reply >> ret; - return true; - } - return false; -} - -bool KviDCOPHelper::qvalueListIntRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,KviValueList<int> &ret, int iVal) -{ - if(!ensureAppRunning(m_szAppId)) - return false; - - QByteArray data, replyData; - KviQCString replyType; - QDataStream arg(data, IO_WriteOnly); - - arg << iVal; - - - if(!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) - return false; - - if(replyType != "QValueList<int>") - return false; - - QDataStream replyStream(replyData, IO_ReadOnly); - replyStream >> ret; - - return true; -} - -bool KviDCOPHelper::qcstringListRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,KviQCStringList &ret) -{ - QByteArray data, replyData; - KviQCString replyType; - - if (!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) - return false; - - if (replyType != "KviQCStringList") - return false; - - QDataStream replyStream(replyData, IO_ReadOnly); - replyStream >> ret; - - return true; -} - -bool KviDCOPHelper::qcstringListRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,KviQCStringList &ret, int iVal) -{ - QByteArray data, replyData; - KviQCString replyType; - - QDataStream arg(data, IO_WriteOnly); - arg << iVal; - - if (!g_pApp->dcopClient()->call(m_szAppId,szObj,szFunc,data,replyType,replyData)) - return false; - - if (replyType != "KviQCStringList") - return false; - - QDataStream replyStream(replyData, IO_ReadOnly); - replyStream >> ret; - - return true; -} - -bool KviDCOPHelper::findRunningApp(const QString &szApp) -{ - QValueList<KviQCString> allApps = g_pApp->dcopClient() ->registeredApplications(); - QValueList<KviQCString>::iterator iterator; - KviQCString sz = szApp.local8Bit(); - for (iterator = allApps.begin();iterator != allApps.end();iterator++) - { - if(*iterator == sz) - return true; - } - return false; -} - -int KviDCOPHelper::detectApp(const QString &szApp,bool bStart,int iScoreWhenFound,int iScoreWhenStarted) -{ - // dcop available - if(!g_pApp->dcopClient()) - return 0; - - if(findRunningApp(szApp)) - return 95; // found a running app, no need to run further - - // no app found running - if(bStart) - { - // try to start it - if(!startApp(szApp,5000)) - return 10; // very low possibility - return findRunningApp(szApp) ? 99 : 0; // try to find it again - } - - return 30; // it still might be installed on the system but we're just unable to start it... -} - - -bool KviDCOPHelper::startApp(const QString &szApp,int iWaitMSecs) -{ - // we could use KApplication::startServiceByDesktopName here - // but we want to be able to wait a defined amount of time - QStringList tmp; - QByteArray data, replyData; - KviQCString replyType; - QDataStream arg(data, IO_WriteOnly); - arg << szApp << tmp; - if(!g_pApp->dcopClient()->call( - "klauncher", - "klauncher", - "start_service_by_desktop_name(QString,QStringList)", - data, - replyType, - replyData)) - { - return false; - } else { - QDataStream reply(replyData, IO_ReadOnly); - if(replyType != "serviceResult")return false; - int result; - KviQCString dcopName; - QString error; - reply >> result >> dcopName >> error; - if(result != 0)return false; - } - // ok , we seem to have started it.. but it might take some seconds - // for the app to get registered - // we wait up to five seconds - if(iWaitMSecs > 0) - { - int i = 0; - while(i < iWaitMSecs) - { - if(findRunningApp(szApp))return true; - KviThread::msleep(100); - i += 100; - } - return findRunningApp(szApp); - } - return true; -} - - -#endif //COMPILE_KDE_SUPPORT diff --git a/3.4.0/src/kvilib/ext/kvi_dcophelper.h b/3.4.0/src/kvilib/ext/kvi_dcophelper.h deleted file mode 100644 index f87f3a75fd..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_dcophelper.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef _KVI_DCOPHELPER_H_ -#define _KVI_DCOPHELPER_H_ -//============================================================================= -// -// File : kvi_dcophelper.h -// Created on Sat 20 Jan 2007 12:35:21 by Alexander Stillich -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// Copyright (C) 2007 Alexander Stillich <torque at pltn dot org> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_qcstring.h" -#include "kvi_valuelist.h" - -#ifdef COMPILE_KDE_SUPPORT - -typedef KviValueList<KviQCString> KviQCStringList; - -class KVILIB_API KviDCOPHelper -{ - -public: - - // Constructs a DCOP helper object. - // bStartApp: tries to start application when a dcop call is about to be made and the app is not already running - // szAppID: application name as seen by DCOP - KviDCOPHelper(bool bStartApp, const KviQCString &szAppId); - ~KviDCOPHelper(); - -protected: - - KviQCString m_szAppId; - bool m_bStartApp; - -protected: - - bool ensureAppRunning(const QString &szApp); - bool findRunningApp(const QString &szApp); - bool startApp(const QString &szApp,int iWaitMSecs = 0); - int detectApp(const QString &szApp,bool bStart,int iScoreWhenFound,int iScoreWhenStarted); - - // naming convention: [return value] Ret [argument type(s)] DCOPCall - - bool voidRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc); - bool voidRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal); - bool voidRetIntBoolDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal, bool bVal); - bool voidRetIntIntIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int iVal1, int iVal2, int iVal3); - bool voidRetBoolDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,bool bVal); - bool voidRetStringDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,const QString &szVal); - bool voidRetFloatDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,float fVal); - bool stringRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,QString &szRet); - bool stringRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,QString &szRet,int iVal); - bool intRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int &ret); - bool intRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,int &ret, int iVal); - bool boolRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,bool &ret); - - bool qvalueListIntRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,KviValueList<int> &ret, int iVal); - bool qcstringListRetIntDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,KviQCStringList &ret, int iVal); - bool qcstringListRetVoidDCOPCall(const KviQCString &szObj,const KviQCString &szFunc,KviQCStringList &ret); -}; - -#endif //COMPILE_KDE_SUPPORT - -#endif // _KVI_DCOPHELPER_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_doublebuffer.cpp b/3.4.0/src/kvilib/ext/kvi_doublebuffer.cpp deleted file mode 100644 index 7a0694c2da..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_doublebuffer.cpp +++ /dev/null @@ -1,90 +0,0 @@ -//============================================================================= -// -// File : kvi_doublebuffer.cpp -// Created on Fri 27 Jan 2006 18:59:54 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2006 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVILIB__ - -#include "kvi_doublebuffer.h" - -static QPixmap * g_pMemoryPixmap = 0; -static unsigned int g_uMaxRequestedWidth = 0; -static unsigned int g_uMaxRequestedHeight = 0; - -KviDoubleBuffer::KviDoubleBuffer(unsigned int uWidth,unsigned int uHeight) -{ - if((g_pMemoryPixmap->width() < uWidth) || (g_pMemoryPixmap->height() < uHeight)) - { - // The memory buffer is too small - // There is either no such user requirement or it has grown by the meantime - unsigned int uMaxW = uWidth > g_pMemoryPixmap->width() ? uWidth : g_pMemoryPixmap->width(); - unsigned int uMaxH = uHeight > g_pMemoryPixmap->height() ? uHeight : g_pMemoryPixmap->height(); -#ifdef COMPILE_USE_QT4 - // QT4SUX: QPixmap::resize() is missing (it's a widely used function and assigning a new QPixmap() seems to be slower and not intuitive) - *g_pMemoryPixmap = QPixmap(uMaxW,uMaxH); -#else - g_pMemoryPixmap->resize(uMaxW,uMaxH); -#endif - } - - if(uWidth > g_uMaxRequestedWidth)g_uMaxRequestedWidth = uWidth; - if(uHeight > g_uMaxRequestedHeight)g_uMaxRequestedHeight = uHeight; -} - -KviDoubleBuffer::~KviDoubleBuffer() -{ - // We never shrink here (it's time consuming) -} - -QPixmap * KviDoubleBuffer::pixmap() -{ - return g_pMemoryPixmap; -} - -void KviDoubleBuffer::init() -{ - if(g_pMemoryPixmap)return; - g_pMemoryPixmap = new QPixmap(); -} - -void KviDoubleBuffer::done() -{ - if(!g_pMemoryPixmap)return; - delete g_pMemoryPixmap; - g_pMemoryPixmap = 0; -} - -void KviDoubleBuffer::heartbeat() -{ - if(((g_uMaxRequestedHeight + 64) < g_pMemoryPixmap->height()) || ((g_uMaxRequestedWidth + 64) < g_pMemoryPixmap->width())) - { - // do shrink :) -#ifdef COMPILE_USE_QT4 - // QT4SUX: QPixmap::resize() is missing (it's a widely used function and assigning a new QPixmap() seems to be slower and not intuitive) - *g_pMemoryPixmap = QPixmap(g_uMaxRequestedWidth,g_uMaxRequestedHeight); -#else - g_pMemoryPixmap->resize(g_uMaxRequestedWidth,g_uMaxRequestedHeight); -#endif - } - g_uMaxRequestedHeight = 0; - g_uMaxRequestedWidth = 0; -} diff --git a/3.4.0/src/kvilib/ext/kvi_doublebuffer.h b/3.4.0/src/kvilib/ext/kvi_doublebuffer.h deleted file mode 100644 index 46eeaee8d8..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_doublebuffer.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef _KVI_DOUBLEBUFFER_H_ -#define _KVI_DOUBLEBUFFER_H_ -//============================================================================= -// -// File : kvi_doublebuffer.h -// Created on Fri 27 Jan 2006 18:59:54 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2006 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qpixmap.h> - -// -// This class is basically a huge shared memory pixmap meant to be used in double-buffer -// painting operations. The memory buffer is resized on the fly so you will always obtain -// a pixmap that is at least of the specified size. The problem is that this is a time -// consuming operation (not good in a paint event). We solve it by keeping the buffer -// with the greatest requested size in the last N minutes. -// -// The keyword in all this thingie is "memory is cheap, processing time is not". -// We know in advance that KVIrc needs a huge double buffer anyway... -// So we basically grow instantly but we are really lazy at shrinking. -// - -class KVILIB_API KviDoubleBuffer -{ -public: - KviDoubleBuffer(unsigned int uWidth,unsigned int uHeight); - ~KviDoubleBuffer(); -public: - // This returns a pointer to the memory buffer. The buffer is at least - // of the size declared in the constructor. - QPixmap * pixmap(); - - // The stuff below is internal (used only by KviApp) - - // to be called at application initialisation and cleanup - static void init(); - static void done(); - // this has to be called at sensible intervals (like 2 minutes) - static void heartbeat(); -}; - -#endif //!_KVI_DOUBLEBUFFER_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_draganddrop.h b/3.4.0/src/kvilib/ext/kvi_draganddrop.h deleted file mode 100644 index 13bb1b2c58..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_draganddrop.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _KVI_DRAGANDDROP_H_ -#define _KVI_DRAGANDDROP_H_ - -//============================================================================= -// -// File : kvi_draganddrop.h -// Creation date : Wed Feb 01 2007 01:45:21 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - - -#ifdef COMPILE_USE_QT4 - #include <q3dragobject.h> - #define KviDragObject Q3DragObject - #define KviUriDrag Q3UriDrag - #define KviTextDrag Q3TextDrag - #define KviImageDrag Q3ImageDrag -#else - #include <qdragobject.h> - #define KviDragObject QDragObject - #define KviUriDrag QUriDrag - #define KviTextDrag QTextDrag - #define KviImageDrag QImageDrag -#endif - -#endif //!_KVI_DRAGANDDROP_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_garbage.cpp b/3.4.0/src/kvilib/ext/kvi_garbage.cpp deleted file mode 100644 index 87be5c323c..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_garbage.cpp +++ /dev/null @@ -1,148 +0,0 @@ -// -// File : kvi_garbage.cpp -// Creation date : Mon Dec 3 16:49:15 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - - -#include "kvi_garbage.h" - -#include <qvariant.h> - -KviGarbageCollector::KviGarbageCollector() -: QObject(0) -{ - m_pGarbageList = 0; - m_pCleanupTimer = 0; - m_bForceCleanupNow = false; -} - -KviGarbageCollector::~KviGarbageCollector() -{ - m_bForceCleanupNow = true; - cleanup(); -} - -void KviGarbageCollector::collect(QObject * g) -{ - if(!m_pGarbageList) - { - m_pGarbageList = new KviPointerList<QObject>; - m_pGarbageList->setAutoDelete(true); - } - //debug("COLLECTING GARBAGE %s",g->className()); - m_pGarbageList->append(g); -// debug("Registering garbage object %d (%s:%s)",g,g->className(),g->name()); - connect(g,SIGNAL(destroyed()),this,SLOT(garbageSuicide())); - triggerCleanup(0); -} - -void KviGarbageCollector::garbageSuicide() -{ - if(!m_pGarbageList) - { - debug("Ops... garbage suicide while no garbage list"); - return; - } - int idx = m_pGarbageList->findRef(sender()); - if(idx == -1) - { - debug("Ops... unregistered garbage suicide"); - return; - } - m_pGarbageList->removeRef(sender()); - if(m_pGarbageList->isEmpty()) - { - cleanup(); - } -} - -void KviGarbageCollector::triggerCleanup(int iTimeout) -{ - //debug("TRIGGERING CLEANUP AFTER %d msecs",iTimeout); - if(m_pCleanupTimer) - { - m_pCleanupTimer->stop(); - } else { - m_pCleanupTimer = new QTimer(this); - connect(m_pCleanupTimer,SIGNAL(timeout()),this,SLOT(cleanup())); - } - m_pCleanupTimer->start(iTimeout); -} - -void KviGarbageCollector::cleanup() -{ - //debug("CLEANUP CALLED !"); - if(m_pGarbageList) - { - //debug("SOME GARBAGE TO DELETE"); - KviPointerList<QObject> dying; - dying.setAutoDelete(false); - for(QObject * o = m_pGarbageList->first();o;o = m_pGarbageList->next()) - { - //debug("CHECKING GARBAGE CLASS %s",o->className()); - bool bDeleteIt = m_bForceCleanupNow; - if(!bDeleteIt) - { - //debug("CLEANUP NOT FORCED"); - QVariant v = o->property("blockingDelete"); - if(v.isValid()) - { - //debug("HAS A VALID VARIANT!"); -// debug("[Garbage collector]: garbage has a blockingDelete property"); - bDeleteIt = !(v.toBool()); -// if(!bDeleteIt)debug("And doesn't want to be delete now!"); - } else bDeleteIt = true; // must be deleted - } - if(bDeleteIt)dying.append(o); - } - - for(QObject * o2 = dying.first();o2;o2 = dying.next()) - { - //debug("KILLING GARBAGE CLASS %s",o2->className()); - disconnect(o2,SIGNAL(destroyed()),this,SLOT(garbageSuicide())); - m_pGarbageList->removeRef(o2); - } - - if(m_pGarbageList->isEmpty()) - { - delete m_pGarbageList; - m_pGarbageList = 0; - } - } - - if(m_pGarbageList) - { -// debug("[Garbage collector cleanup]: Some stuff left to be deleted, will retry in a while"); - // something left to be destroyed - if(m_bForceCleanupNow)debug("[Garbage collector]: Ops...I've left some undeleted stuff!"); - triggerCleanup(5000); // retry in 5 sec - } else { -// debug("[Garbage collector cleanup]: Completed"); - // nothing left to delete - if(m_pCleanupTimer) - { - delete m_pCleanupTimer; - m_pCleanupTimer = 0; - } - } -} - diff --git a/3.4.0/src/kvilib/ext/kvi_garbage.h b/3.4.0/src/kvilib/ext/kvi_garbage.h deleted file mode 100644 index bf0b34862f..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_garbage.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef _KVI_GARBAGE_H_ -#define _KVI_GARBAGE_H_ -// -// File : kvi_garbage.h -// Creation date : Mon Dec 3 16:49:13 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qobject.h> -#include "kvi_pointerlist.h" -#include <qtimer.h> - - -class KVILIB_API KviGarbageCollector : public QObject -{ - Q_OBJECT -public: - KviGarbageCollector(); - ~KviGarbageCollector(); -protected: - KviPointerList<QObject> * m_pGarbageList; - QTimer * m_pCleanupTimer; - bool m_bForceCleanupNow; -public: - void collect(QObject * g); -protected: - void triggerCleanup(int iTimeout); -protected slots: - void cleanup(); - void garbageSuicide(); -}; - -#endif //_KVI_GARBAGE_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_imagelib.cpp b/3.4.0/src/kvilib/ext/kvi_imagelib.cpp deleted file mode 100644 index 88083c98d9..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_imagelib.cpp +++ /dev/null @@ -1,138 +0,0 @@ -//============================================================================= -// -// File : kvi_imagelib.cpp -// Creation date : Wed Jul 21 1999 16:41:26 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - -#include <qnamespace.h> - -#include "kvi_imagelib.h" -#include "kvi_fileutils.h" -#include "kvi_locale.h" -#include "kvi_memmove.h" - -#include <qpixmap.h> - - -//KviImageLibrary::KviImageLibrary(const QPixmap &pixmap,int imageWidth,int imageHeight) -//{ -// if(pixmap.isNull())m_pLibrary=0; -// else m_pLibrary=new QPixmap(pixmap); -// setImageSize(imageWidth,imageHeight); -//} - -KviImageLibrary::KviImageLibrary(const QString &path,int imageWidth,int imageHeight) -{ - m_pLibrary=0; - loadLibrary(path); - setImageSize(imageWidth,imageHeight); -} - -KviImageLibrary::KviImageLibrary(const QString &path1,const QString &path2,int imageWidth,int imageHeight) -{ - m_pLibrary=0; - if(KviFileUtils::fileExists(path1)) - { - loadLibrary(path1); - if(m_pLibrary==0)loadLibrary(path2); - } else loadLibrary(path2); - setImageSize(imageWidth,imageHeight); -} - - -KviImageLibrary::~KviImageLibrary() -{ - unloadLibrary(); -} - -void KviImageLibrary::unloadLibrary() -{ - if(m_pLibrary)delete m_pLibrary; - m_pLibrary=0; -} - -bool KviImageLibrary::setImageSize(int imageWidth,int imageHeight) -{ - m_iWidth=((imageWidth>0) ? imageWidth : 16); - m_iHeight=((imageHeight>0) ? imageHeight : 16); - return true; -} - -bool KviImageLibrary::loadLibrary(const QString &path) -{ - if(m_pLibrary)delete m_pLibrary; - m_pLibrary=new QImage(path); - if(m_pLibrary->isNull()) - { - delete m_pLibrary; - m_pLibrary=0; - debug("WARNING : Can not load image library %s",KviQString::toUtf8(path).data()); - } - return (m_pLibrary != 0); -} - -int KviImageLibrary::imageCount() -{ - if(!m_pLibrary)return 0; - if((m_iWidth<1)||(m_iHeight<1))return 0; - int nRows=m_pLibrary->width()/m_iWidth; - return ( nRows * (m_pLibrary->height()/m_iHeight)); -} - -QPixmap KviImageLibrary::getImage(int zeroBasedIndex) -{ - if((zeroBasedIndex >= imageCount())||(zeroBasedIndex < 0)||(m_pLibrary->depth() < 8)) - { - QPixmap image(32,32); - image.fill(); //White fill - return image; - } - - // Im per row is not zero...because imageCount returned non zero. - int imPerRow=(m_pLibrary->width() / m_iWidth); - int xOffset=(zeroBasedIndex % imPerRow) * m_iWidth; - int yOffset=(zeroBasedIndex / imPerRow) * m_iHeight; - -#ifdef COMPILE_USE_QT4 - QImage image(m_iWidth,m_iHeight,m_pLibrary->format()); -#else - QImage image(m_iWidth,m_iHeight,m_pLibrary->depth()); -#endif - - int d = image.depth() / 8; -#ifndef COMPILE_USE_QT4 - if(d == 4)image.setAlphaBuffer(true); // Qt 4.x should manage it automagically -#endif - //Copy the image data - //bitBlt(&image,0,0,m_pLibrary,xOffset,yOffset,m_iWidth,m_iHeight,Qt::CopyROP,false); - - for(int i=0;i<m_iHeight;i++) - kvi_memmove(image.scanLine(i),m_pLibrary->scanLine(i + yOffset) + (xOffset * d),m_iWidth * d); - -#ifdef COMPILE_USE_QT4 - QPixmap p = QPixmap::fromImage(image); -#else - QPixmap p(image); -#endif - return p; -} diff --git a/3.4.0/src/kvilib/ext/kvi_imagelib.h b/3.4.0/src/kvilib/ext/kvi_imagelib.h deleted file mode 100644 index 64f750f78b..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_imagelib.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef _KVI_IMAGELIB_H_ -#define _KVI_IMAGELIB_H_ - -// -// File : kvi_imagelib.h -// Creation date : Wed Jul 21 1999 16:41:26 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// - -// -// A class to manage multiple image libraries. -// The library is in fact a big image that contains -// several rows of other smaller images of the same size. -// The images inside the 'library' are indexed in the following way: -// -// ------------- -// |...|...|...| -// |.0.|.1.|.2.| -// ------------- -// |...|...|...| -// |.3.|.4.|.5.| -// ------------- -// |...|...|...| -// -// The 'library' image should have the size that is a multiple -// of the single image size. If not , the remaining part is ignored. -// The first image starts always in the left upper corner. -// - -// WARNING: This class will be removed in the near future. Don't use it. - -#include "kvi_settings.h" - -#include <qimage.h> - -class KVILIB_API KviImageLibrary -{ -public: // Consruction & Destruction -// KviImageLibrary(const QPixmap &pixmap,int imageWidth,int imageHeight); - KviImageLibrary(const QString &path,int imageWidth,int imageHeight); - KviImageLibrary(const QString &path1,const QString &path2,int imageWidth,int imageHeight); - ~KviImageLibrary(); -public: // Fields - QImage *m_pLibrary; - int m_iWidth; - int m_iHeight; -public: // Methods - bool loadLibrary(const QString &path); - void unloadLibrary(); - int imageCount(); - bool libraryLoaded(){ return (m_pLibrary != 0); }; - QImage *getLibrary(){ return m_pLibrary; }; - QPixmap getImage(int zeroBasedIndex); - bool setImageSize(int imageWidth,int imageHeight); -}; - -#endif //_KVI_IMAGELIB_H_INCLUDED_ diff --git a/3.4.0/src/kvilib/ext/kvi_md5.cpp b/3.4.0/src/kvilib/ext/kvi_md5.cpp deleted file mode 100644 index dac46fd36b..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_md5.cpp +++ /dev/null @@ -1,298 +0,0 @@ -// -// File : kvi_md5.cpp -// Creation date : Wed Sep 4 22:16:45 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - - -/* - ###################################################################### - - MD5Sum - MD5 Message Digest Algorithm. - - This code implements the MD5 message-digest algorithm. The algorithm is - due to Ron Rivest. This code was written by Colin Plumb in 1993, no - copyright is claimed. This code is in the public domain; do with it what - you wish. - - Equivalent code is available from RSA Data Security, Inc. This code has - been tested against that, and is equivalent, except that you don't need to - include two pages of legalese with every copy. - - To compute the message digest of a chunk of bytes, instantiate the class, - and repeatedly call one of the Add() members. When finished the Result - method will return the Hash and finalize the value. - - Changed so as no longer to depend on Colin Plumb's `usual.h' header - definitions; now uses stuff from dpkg's config.h. - - Ian Jackson <ijackson@nyx.cs.du.edu>. - - Changed into a C++ interface and made work with APT's config.h. - - Jason Gunthorpe <jgg@gpu.srv.ualberta.ca> - - Interface adapted to the KVIrc irc client - - Szymon Stefanek <pragma at kvirc dot net> - - The classes use arrays of char that are a specific size. We cast those - arrays to uint8_t's and go from there. This allows us to advoid using - the uncommon inttypes.h in a public header or internally newing memory. - In theory if C9x becomes nicely accepted - - ##################################################################### */ - -#include "kvi_md5.h" -#include "kvi_settings.h" -#include "kvi_bswap.h" -#include "kvi_memmove.h" - -/* Swap n 32 bit longs in given buffer */ -#ifdef BIG_ENDIAN_MACHINE_BYTE_ORDER - static void byteSwap(kvi_u32_t *buf,unsigned int words) - { -// kvi_u8_t *p = (kvi_u8_t *)buf; -// do -// { -// *buf++ = (kvi_u32_t)((unsigned)p[3] << 8 | p[2]) << 16 | ((unsigned)p[1] << 8 | p[0]); -// p += 4; -// } while (--words); - do { - *buf = kvi_swap32(*buf); - buf++; - } while(--words); - } -#else - #define byteSwap(buf,words) -#endif - -/* The core of the MD5 algorithm, this alters an existing MD5 hash to - reflect the addition of 16 longwords of new data. Add blocks - the data and converts bytes into longwords for this routine. */ - -// The four core functions - F1 is optimized somewhat -// #define F1(x, y, z) (x & y | ~x & z) -#define F1(x, y, z) (z ^ (x & (y ^ z))) -#define F2(x, y, z) F1(z, x, y) -#define F3(x, y, z) (x ^ y ^ z) -#define F4(x, y, z) (y ^ (x | ~z)) - -// This is the central step in the MD5 algorithm. -#define MD5STEP(f,w,x,y,z,in,s) \ - (w += f(x,y,z) + in, w = (w<<s | w>>(32-s)) + x) - -static void MD5Transform(kvi_u32_t buf[4],const kvi_u32_t in[16]) -{ - register kvi_u32_t a, b, c, d; - - a = buf[0]; - b = buf[1]; - c = buf[2]; - d = buf[3]; - - MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); - MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); - MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); - MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); - MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); - MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); - MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); - MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); - MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); - MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); - MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); - MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); - MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); - MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); - MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); - MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); - - MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); - MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); - MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); - MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); - MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); - MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); - MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); - MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); - MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); - MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); - MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); - MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); - MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); - MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); - MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); - MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); - - MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); - MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); - MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); - MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); - MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); - MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); - MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); - MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); - MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); - MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); - MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); - MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); - MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); - MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); - MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); - MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); - - MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); - MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); - MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); - MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); - MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); - MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); - MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); - MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); - MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); - MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); - MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); - MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); - MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); - MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); - MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); - MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); - - buf[0] += a; - buf[1] += b; - buf[2] += c; - buf[3] += d; -} - -KviMd5::KviMd5() -{ - kvi_u32_t *buf = (kvi_u32_t *)m_pBuf; - kvi_u32_t *bytes = (kvi_u32_t *)m_pBytes; - - buf[0] = 0x67452301; - buf[1] = 0xefcdab89; - buf[2] = 0x98badcfe; - buf[3] = 0x10325476; - - bytes[0] = 0; - bytes[1] = 0; - - m_bDone = false; -} - -KviMd5::~KviMd5() -{ -} - -bool KviMd5::add(const unsigned char *data,unsigned long len) -{ - if(m_bDone)return false; - - kvi_u32_t *buf = (kvi_u32_t *)m_pBuf; - kvi_u32_t *bytes = (kvi_u32_t *)m_pBytes; - kvi_u32_t *in = (kvi_u32_t *)m_pIn; - - // Update byte count and carry (this could be done with a long long?) - kvi_u32_t t = bytes[0]; - - if ((bytes[0] = t + len) < t)bytes[1]++; - - // Space available (at least 1) - t = 64 - (t & 0x3f); - if (t > len) - { - kvi_fastmove((unsigned char *)in + 64 - t,data,len); - return true; - } - - // First chunk is an odd size - kvi_fastmove((unsigned char *)in + 64 - t,data,t); - byteSwap(in, 16); - - MD5Transform(buf,in); - data += t; - len -= t; - - // Process data in 64-byte chunks - while (len >= 64) - { - kvi_fastmove(in,data,64); - byteSwap(in,16); - MD5Transform(buf,in); - data += 64; - len -= 64; - } - - // Handle any remaining bytes of data. - kvi_memmove(in,data,len); - - return true; -} - - -// --------------------------------------------------------------------- -/* Because this must add in the last bytes of the series it prevents anyone - from calling add after. */ - -KviStr KviMd5::result() -{ - kvi_u32_t *buf = (kvi_u32_t *)m_pBuf; - kvi_u32_t *bytes = (kvi_u32_t *)m_pBytes; - kvi_u32_t *in = (kvi_u32_t *)m_pIn; - - if(!m_bDone) - { - // Number of bytes in In - int count = bytes[0] & 0x3f; - unsigned char *p = (unsigned char *)in + count; - - // Set the first char of padding to 0x80. There is always room. - *p++ = 0x80; - - // Bytes of padding needed to make 56 bytes (-8..55) - count = 56 - 1 - count; - - // Padding forces an extra block - if (count < 0) - { - kvi_memset(p,0,count + 8); - byteSwap(in, 16); - MD5Transform(buf,in); - p = (unsigned char *)in; - count = 56; - } - - kvi_memset(p, 0, count); - byteSwap(in, 14); - - // Append length in bits and transform - in[14] = bytes[0] << 3; - in[15] = bytes[1] << 3 | bytes[0] >> 29; - MD5Transform(buf,in); - byteSwap(buf,4); - m_bDone = true; - } - - // m_pBuf now contains the md5 sum - KviStr ret; - ret.bufferToHex((char *)m_pBuf,16); - - return ret; -} diff --git a/3.4.0/src/kvilib/ext/kvi_md5.h b/3.4.0/src/kvilib/ext/kvi_md5.h deleted file mode 100644 index 4909089f2a..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_md5.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef _KVI_MD5_H_ -#define _KVI_MD5_H_ -// -// File : kvi_md5.h -// Creation date : Wed Sep 4 22:16:44 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// - - - -/* ###################################################################### - - MD5SumValue - Storage for a MD5Sum - MD5Summation - MD5 Message Digest Algorithm. - - This is a C++ interface to a set of MD5Sum functions. The class can - store a MD5Sum in 16 bytes of memory. - - A MD5Sum is used to generate a (hopefully) unique 16 byte number for a - block of data. This can be used to gaurd against corruption of a file. - MD5 should not be used for tamper protection, use SHA or something more - secure. - - There are two classes because computing a MD5 is not a continual - operation unless 64 byte blocks are used. Also the summation requires an - extra 18*4 bytes to operate. - - ##################################################################### */ - -#include "kvi_settings.h" -#include "kvi_inttypes.h" -#include "kvi_string.h" - -class KviMd5 -{ -public: - KviMd5(); - ~KviMd5(); -protected: - unsigned char m_pBuf[4*4]; - unsigned char m_pBytes[2*4]; - unsigned char m_pIn[16*4]; - bool m_bDone; - -public: - bool add(const unsigned char *Data,unsigned long Size); - - KviStr result(); -}; - - -#endif //_KVI_MD5_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_mediatype.cpp b/3.4.0/src/kvilib/ext/kvi_mediatype.cpp deleted file mode 100644 index c17131cdae..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_mediatype.cpp +++ /dev/null @@ -1,541 +0,0 @@ -// -// File : kvi_mediatype.cpp -// Creation date : Mon Aug 21 2000 17:51:56 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -//#define _KVI_DEBUG_CHECK_RANGE_ - - - -#include "kvi_debug.h" -#include "kvi_mediatype.h" -#include "kvi_config.h" -#include "kvi_fileutils.h" -#include "kvi_locale.h" -#include "kvi_file.h" - -#include "kvi_settings.h" - -#include <qregexp.h> -#include <qdir.h> - -#include <sys/types.h> -#include <sys/stat.h> - - -#ifndef COMPILE_ON_WINDOWS - #include <unistd.h> - #include "kvi_malloc.h" -#endif - - - -#ifndef S_ISDIR -#define S_ISDIR(__f) (__f & _S_IFDIR) -#endif - -#ifndef S_ISFIFO -#define S_ISFIFO(__f) (__f & _S_IFIFO) -#endif - -#ifndef S_ISREG -#define S_ISREG(__f) (__f & _S_IFREG) -#endif - -#ifndef S_ISCHR -#define S_ISCHR(__f) (__f & _S_IFCHR) -#endif - -#ifndef COMPILE_ON_WINDOWS - #include <dirent.h> -#else - #include "kvi_malloc.h" -#endif - - - - -KviMediaManager::KviMediaManager() -: KviMutex() -{ - m_pMediaTypeList = new KviPointerList<KviMediaType>; - m_pMediaTypeList->setAutoDelete(true); -} - -KviMediaManager::~KviMediaManager() -{ - delete m_pMediaTypeList; -} - -KviMediaType * KviMediaManager::findMediaTypeByIanaType(const char * ianaType) -{ - __range_valid(locked()); - for(KviMediaType * mt = m_pMediaTypeList->first();mt;mt = m_pMediaTypeList->next()) - { - if(kvi_strEqualCI(mt->szIanaType.ptr(),ianaType))return mt; - } - - return 0; -} - -KviMediaType * KviMediaManager::findMediaTypeByFileMask(const char * filemask) -{ - __range_valid(locked()); - for(KviMediaType * mt = m_pMediaTypeList->first();mt;mt = m_pMediaTypeList->next()) - { -// FIXME: #warning "Should this be case sensitive ?" - if(kvi_strEqualCI(mt->szFileMask.ptr(),filemask))return mt; - } - - return 0; -} - -void KviMediaManager::copyMediaType(KviMediaType * dst,KviMediaType * src) -{ - dst->szFileMask = src->szFileMask; - dst->szMagicBytes = src->szMagicBytes; - dst->szIanaType = src->szIanaType; - dst->szDescription = src->szDescription; - dst->szSavePath = src->szSavePath; - dst->szCommandline = src->szCommandline; - dst->szRemoteExecCommandline = src->szRemoteExecCommandline; - dst->szIcon = src->szIcon; -} - - -void KviMediaManager::insertMediaType(KviMediaType * m) -{ - __range_valid(locked()); - int iWildCount = m->szFileMask.occurences('*'); - int iNonWildCount = m->szFileMask.len() - iWildCount; - - // The masks with no wildcards go first in the list - // then we insert the ones with more non-wild chars - - int index = 0; - for(KviMediaType * mt = m_pMediaTypeList->first();mt;mt = m_pMediaTypeList->next()) - { - if(iWildCount) - { - // the new mask has wildcards... if the current one has none, skip it - int iWildCountExisting = mt->szFileMask.occurences('*'); - if(iWildCountExisting) - { - // the one in the list has wildcards too... - // the ones with more non-wild chars go first... - int iNonWildCountExisting = mt->szFileMask.len() - iWildCountExisting; - if(iNonWildCountExisting < iNonWildCount) - { - // ok...the new one has more non-wildcards , insert - m_pMediaTypeList->insert(index,m); - return; - } else { - if(iNonWildCount == iNonWildCountExisting) - { - // the same number of non-wildcards - // let the number of wildcards decide (it will be eventually equal) - if(iWildCount < iWildCountExisting) - { - // the new one has less wildcards... goes first - m_pMediaTypeList->insert(index,m); - return; - } // else the same number of wildcards and non-wildcards...skip - } // else the existing one has more non-wildcards...skip - } - } // else the current has no wildcards...skip - } else { - // the new mask has no wildcards.... - if(mt->szFileMask.contains('*')) - { - // current one has wildcards...insert - m_pMediaTypeList->insert(index,m); - return; - } - // the current one has no wildcards... - // the longer masks go first.... - if(mt->szFileMask.len() < m->szFileMask.len()) - { - // the current one is shorter than the new one...insert - m_pMediaTypeList->insert(index,m); - return; - } // else current one is longer...skip - } - index++; - } - m_pMediaTypeList->append(m); - -/* - // the masks with no wildcards go first - // longer masks go first - - bool bHasWildcards = m->szFileMask.contains('*'); - int index = 0; - for(KviMediaType * mt = m_pMediaTypeList->first();mt;mt = m_pMediaTypeList->next()) - { - if(bHasWildcards) - { - if(mt->szFileMask.len() < m->szFileMask.len()) - { - m_pMediaTypeList->insert(index,m); - return; - } else if(mt->szFileMask.len() == m->szFileMask.len()) - { - if(mt->szMagicBytes.len() < m->szMagicBytes.len()) - { - m_pMediaTypeList->insert(index,m); - return; - } - } - } else { - if(mt->szFileMask.contains('*')) - { - m_pMediaTypeList->insert(index,m); - return; - } else { - if(mt->szFileMask.len() < m->szFileMask.len()) - { - m_pMediaTypeList->insert(index,m); - return; - } else if(mt->szFileMask.len() == m->szFileMask.len()) - { - if(mt->szMagicBytes.len() < m->szMagicBytes.len()) - { - m_pMediaTypeList->insert(index,m); - return; - } - } - } - } - index++; - } - m_pMediaTypeList->append(m); -*/ -} - - -KviMediaType * KviMediaManager::findMediaType(const char * filename,bool bCheckMagic) -{ - // FIXME: This should be ported at least to QString.... - __range_valid(locked()); - - KviStr szFullPath = filename; - if(!kvi_isAbsolutePath(szFullPath.ptr())) - { -#ifdef COMPILE_USE_QT4 - KviStr tmp = QDir::currentPath(); -#else - KviStr tmp = QDir::currentDirPath(); -#endif - tmp.ensureLastCharIs('/'); - szFullPath.prepend(tmp); - } - - KviStr szFile = filename; - szFile.cutToLast('/',true); - - - // first of all , lstat() the file -#ifdef COMPILE_ON_WINDOWS - struct _stat st; - if(_stat(szFullPath.ptr(),&st) != 0) -#else - struct stat st; - if(lstat(szFullPath.ptr(),&st) != 0) -#endif - { - //debug("Problems while stating file %s",szFullPath.ptr()); - // We do just the pattern matching - // it's better to avoid magic checks - // if the file is a device , we would be blocked while attempting to read data - return findMediaTypeForRegularFile(szFullPath.ptr(),szFile.ptr(),false); - } else { - // If it is a link , stat() the link target -#ifndef COMPILE_ON_WINDOWS - if(S_ISLNK(st.st_mode)) - { - if(stat(szFullPath.ptr(),&st) != 0) - { - debug("Problems while stating() target for link %s",szFullPath.ptr()); - // Same as above - return findMediaTypeForRegularFile(szFullPath.ptr(),szFile.ptr(),false); - } - } -#endif - } - - - if(S_ISDIR(st.st_mode)) - { - // Directory : return default media type - KviMediaType * mtd = findMediaTypeByIanaType("inode/directory"); - if(!mtd) - { - // Add it - mtd = new KviMediaType; - mtd->szIanaType = "inode/directory"; - mtd->szDescription = __tr("Directory"); - mtd->szCommandline = "dirbrowser.open -m $0"; - mtd->szIcon = "kvi_dbfolder.png"; // hardcoded ? - insertMediaType(mtd); - } - return mtd; - } - - -#ifndef COMPILE_ON_WINDOWS - if(S_ISSOCK(st.st_mode)) - { - // Socket : return default media type - KviMediaType * mtd = findMediaTypeByIanaType("inode/socket"); - if(!mtd) - { - // Add it - mtd = new KviMediaType; - mtd->szIanaType = "inode/socket"; - mtd->szDescription = __tr("Socket"); - mtd->szIcon = "kvi_dbsocket.png"; // hardcoded ? - insertMediaType(mtd); - } - return mtd; - } -#endif - - if(S_ISFIFO(st.st_mode)) - { - // Fifo: return default media type - KviMediaType * mtd = findMediaTypeByIanaType("inode/fifo"); - if(!mtd) - { - // Add it - mtd = new KviMediaType; - mtd->szIanaType = "inode/fifo"; - mtd->szDescription = __tr("Fifo"); - mtd->szIcon = "kvi_dbfifo.png"; // hardcoded ? - insertMediaType(mtd); - } - return mtd; - } - -#ifndef COMPILE_ON_WINDOWS - if(S_ISBLK(st.st_mode)) - { - // Block device: return default media type - KviMediaType * mtd = findMediaTypeByIanaType("inode/blockdevice"); - if(!mtd) - { - // Add it - mtd = new KviMediaType; - mtd->szIanaType = "inode/blockdevice"; - mtd->szDescription = __tr("Block device"); - mtd->szIcon = "kvi_dbblockdevice.png"; // hardcoded ? - insertMediaType(mtd); - } - return mtd; - } -#endif - - if(S_ISCHR(st.st_mode)) - { - // Char device: return default media type - KviMediaType * mtd = findMediaTypeByIanaType("inode/chardevice"); - if(!mtd) - { - // Add it - mtd = new KviMediaType; - mtd->szIanaType = "inode/chardevice"; - mtd->szDescription = __tr("Char device"); - mtd->szIcon = "kvi_dbchardevice.png"; // hardcoded ? - insertMediaType(mtd); - } - return mtd; - } - - - // this is a regular file (or at least it looks like one) - return findMediaTypeForRegularFile(szFullPath.ptr(),szFile.ptr(),bCheckMagic); -} - -KviMediaType * KviMediaManager::findMediaTypeForRegularFile(const char * szFullPath,const char * szFileName,bool bCheckMagic) -{ - char buffer[17]; - int len = 0; - - if(bCheckMagic) - { - QString szTmp=QString::fromUtf8(szFullPath); - KviFile f(szTmp); - if(f.openForReading()) - { - len = f.readBlock(buffer,16); - if(len > 0) - { - buffer[len] = '\0'; - if(buffer[0] == 0)len = 0; // no way to match it - } - f.close(); - } - } - - for(KviMediaType * m = m_pMediaTypeList->first();m;m = m_pMediaTypeList->next()) - { -// FIXME: #warning "Should this be case sensitive ?" - if(kvi_matchWildExpr(m->szFileMask.ptr(),szFileName)) - { - if(len && m->szMagicBytes.hasData()) - { - QRegExp re(m->szMagicBytes.ptr()); - // It looks like they can't decide the name for this function :D - // ... well, maybe the latest choice is the best one. -#ifdef COMPILE_USE_QT4 - if(re.indexIn(buffer) > -1)return m; // matched! -#else - #if QT_VERSION >= 300 - if(re.search(buffer) > -1)return m; // matched! - #else - if(re.find(buffer,0) > -1)return m; // matched! - #endif -#endif - // else magic failed...not a match - } else return m; // matched! (no magic check) - } - } - - KviMediaType * mtd = findMediaTypeByIanaType("application/octet-stream"); - if(!mtd) - { - // Add it - mtd = new KviMediaType; - mtd->szIanaType = "application/octet-stream"; - mtd->szDescription = __tr("Octet stream (unknown)"); - mtd->szCommandline = "editor.open $0"; - mtd->szIcon = "kvi_dbunknown.png"; // hardcoded ? - insertMediaType(mtd); - } - - return mtd; -} - -typedef struct _KviDefaultMediaType -{ - const char * filemask; - const char * magicbytes; - const char * ianatype; - const char * description; - const char * commandline; -} KviDefaultMediaType; - - -// FIXME : default handlers for windows ? - -static KviDefaultMediaType g_defMediaTypes[]= -{ - { "*.jpg","^\\0330\\0377","image/jpeg","JPEG image","run kview $0" }, - { "*.jpeg","^\\0330\\0377","image/jpeg","JPEG image","run kview $0" }, - { "*.png","","image/png","PNG image","run kview $0" }, - { "*.mp3","","audio/mpeg","MPEG audio","run xmms -e $0" }, - { "*.gif","","image/gif","GIF image","run kvirc $0" }, - { "*.mpeg","","video/mpeg","MPEG video","run xanim $0" }, - { "*.exe","","application/x-executable-file","Executable file","run $0" }, - { "*.zip","^PK\\0003\\0004","application/zip","ZIP archive","run ark $0" }, - { "*.tar.gz","","application/x-gzip","GZipped tarball","run ark $0" }, - { "*.tar.bz2","","applicatoin/x-bzip2","BZipped tarball","run ark $0" }, - { "*.tgz","","application/x-gzip","GZipped tarball","run ark $0" }, - { "*.wav","","audio/wav","Wave audio","run play $0" }, - { 0,0,0,0,0 } -}; - -void KviMediaManager::load(const char * filename) -{ - __range_valid(locked()); - - KviConfig cfg(filename,KviConfig::Read); - cfg.setGroup("MediaTypes"); - unsigned int nEntries = cfg.readUIntEntry("NEntries",0); - for(unsigned int i = 0; i < nEntries;i++) - { - KviMediaType * m = new KviMediaType; - KviStr tmp(KviStr::Format,"%dFileMask",i); - m->szFileMask = cfg.readEntry(tmp.ptr(),""); - tmp.sprintf("%dMagicBytes",i); - m->szMagicBytes = cfg.readEntry(tmp.ptr(),""); - tmp.sprintf("%dIanaType",i); - m->szIanaType = cfg.readEntry(tmp.ptr(),"application/unknown"); - tmp.sprintf("%dDescription",i); - m->szDescription = cfg.readEntry(tmp.ptr(),""); - tmp.sprintf("%dSavePath",i); - m->szSavePath = cfg.readEntry(tmp.ptr(),""); - tmp.sprintf("%dCommandline",i); - m->szCommandline = cfg.readEntry(tmp.ptr(),""); - tmp.sprintf("%dRemoteExecCommandline",i); - m->szRemoteExecCommandline = cfg.readEntry(tmp.ptr(),""); - tmp.sprintf("%dIcon",i); - m->szIcon = cfg.readEntry(tmp.ptr(),""); - insertMediaType(m); - } - - for(int u = 0;g_defMediaTypes[u].filemask;u++) - { - if(!findMediaTypeByFileMask(g_defMediaTypes[u].filemask)) - { - KviMediaType * m = new KviMediaType; - m->szFileMask = g_defMediaTypes[u].filemask; - m->szMagicBytes = g_defMediaTypes[u].magicbytes; - m->szIanaType = g_defMediaTypes[u].ianatype; - m->szDescription = g_defMediaTypes[u].description; - m->szCommandline = g_defMediaTypes[u].commandline; - insertMediaType(m); - } - } - -} - -void KviMediaManager::save(const char * filename) -{ - __range_valid(locked()); - KviConfig cfg(filename,KviConfig::Write); - - cfg.clear(); - cfg.setGroup("MediaTypes"); - cfg.writeEntry("NEntries",m_pMediaTypeList->count()); - int index = 0; - for(KviMediaType * m= m_pMediaTypeList->first();m;m = m_pMediaTypeList->next()) - { - KviStr tmp(KviStr::Format,"%dFileMask",index); - cfg.writeEntry(tmp.ptr(),m->szFileMask.ptr()); - tmp.sprintf("%dMagicBytes",index); - cfg.writeEntry(tmp.ptr(),m->szMagicBytes.ptr()); - tmp.sprintf("%dIanaType",index); - cfg.writeEntry(tmp.ptr(),m->szIanaType.ptr()); - tmp.sprintf("%dDescription",index); - cfg.writeEntry(tmp.ptr(),m->szDescription.ptr()); - tmp.sprintf("%dSavePath",index); - cfg.writeEntry(tmp.ptr(),m->szSavePath.ptr()); - tmp.sprintf("%dCommandline",index); - cfg.writeEntry(tmp.ptr(),m->szCommandline.ptr()); - tmp.sprintf("%dRemoteExecCommandline",index); - cfg.writeEntry(tmp.ptr(),m->szRemoteExecCommandline.ptr()); - tmp.sprintf("%dIcon",index); - cfg.writeEntry(tmp.ptr(),m->szIcon.ptr()); - ++index; - } -} diff --git a/3.4.0/src/kvilib/ext/kvi_mediatype.h b/3.4.0/src/kvilib/ext/kvi_mediatype.h deleted file mode 100644 index d93221c2f7..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_mediatype.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef _KVI_MEDIATYPE_H_ -#define _KVI_MEDIATYPE_H_ -// -// File : kvi_mediatype.h -// Creation date : Mon Aug 21 2000 17:19:56 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_heapobject.h" -#include "kvi_string.h" -#include "kvi_thread.h" - -#include "kvi_pointerlist.h" - - -// -// IANA media-types matching subsystem -// -// WARNING: This class is used in multiple threads -// Thus every usage of the classes and structures defined -// in this file MUST be protected by calls -// to KviMediaManager::lock() and KviMediaManager::unlock() -// - - -class KVILIB_API KviMediaType : public KviHeapObject -{ -public: - KviMediaType(){}; - ~KviMediaType(){}; -public: - KviStr szFileMask; - KviStr szMagicBytes; - KviStr szIanaType; - KviStr szDescription; - KviStr szSavePath; - KviStr szCommandline; - KviStr szRemoteExecCommandline; - KviStr szIcon; -}; - -class KVILIB_API KviMediaManager : public KviMutex -{ -public: - KviMediaManager(); - ~KviMediaManager(); -protected: - KviPointerList<KviMediaType> * m_pMediaTypeList; -private: - KviMediaType * findMediaTypeForRegularFile(const char * szFullPath,const char * szFileName,bool bCheckMagic); -public: - KviPointerList<KviMediaType> * mediaTypeList(){ return m_pMediaTypeList; }; - KviMediaType * findMediaTypeByFileMask(const char * filemask); - KviMediaType * findMediaTypeByIanaType(const char * ianaType); - bool removeMediaType(KviMediaType * t){ return m_pMediaTypeList->removeRef(t); }; - void clear(){ m_pMediaTypeList->clear(); }; - void insertMediaType(KviMediaType * t); - KviMediaType * findMediaType(const char * filename,bool bCheckMagic = true); - static void copyMediaType(KviMediaType * dst,KviMediaType * src); - - void load(const char * filename); - void save(const char * filename); -}; - - -#endif //_KVI_MEDIATYPE_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_miscutils.cpp b/3.4.0/src/kvilib/ext/kvi_miscutils.cpp deleted file mode 100644 index b44c76ebd6..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_miscutils.cpp +++ /dev/null @@ -1,86 +0,0 @@ -//============================================================================= -// -// File : kvi_miscutils.cpp -// Created on Mon 08 Jan 2007 04:07:31 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2007 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_miscutils.h" - -#include <qstringlist.h> - -namespace KviMiscUtils -{ - int compareVersions(const QString &szVersion1,const QString &szVersion2) - { -#ifdef COMPILE_USE_QT4 - QStringList sl1 = szVersion1.split("."); - QStringList sl2 = szVersion2.split("."); -#else - QStringList sl1 = QStringList::split(".",szVersion1); - QStringList sl2 = QStringList::split(".",szVersion2); -#endif - - QStringList::Iterator it1 = sl1.begin(); - QStringList::Iterator it2 = sl2.begin(); - while((it1 != sl1.end()) && (it2 != sl2.end())) - { - bool bOk; - int i1 = (*it1).toInt(&bOk); - if(!bOk)return 1; - int i2 = (*it2).toInt(&bOk); - if(!bOk)return -1; - if(i1 != i2) - { - // field not equal - if(i1 > i2)return -1; - else return 1; - } - it1++; - it2++; - } - // both are equal until now - if(it1 != sl1.end())return -1; // 1 has at least one field more - if(it2 != sl2.end())return 1; // 2 has at least one field more - // both are equal also in length - return 0; - } - - bool isValidVersionString(const QString &szVersion) - { -#ifdef COMPILE_USE_QT4 - QStringList sl = szVersion.split("."); -#else - QStringList sl = QStringList::split(".",szVersion); -#endif - if(sl.isEmpty())return false; - // must all be numbers - for(QStringList::Iterator it = sl.begin();it != sl.end();++it) - { - bool bOk; - int i = (*it).toInt(&bOk); - if(!bOk)return false; - if(i < 0)return false; - } - return true; - } - -}; diff --git a/3.4.0/src/kvilib/ext/kvi_miscutils.h b/3.4.0/src/kvilib/ext/kvi_miscutils.h deleted file mode 100644 index a9a651b19e..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_miscutils.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef _KVI_MISCUTILS_H_ -#define _KVI_MISCUTILS_H_ -//============================================================================= -// -// File : kvi_miscutils.h -// Created on Mon 08 Jan 2007 04:07:31 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2007 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" - -// this is the namespace for single function stuff that doesn't really fit anywhere else - -namespace KviMiscUtils -{ - // Compare two x.y.z... version strings. - // The function behaves like strcmp: it returns 0 when the versions - // are equal, -1 if the szVersion1 is greater and 1 if szVersion2 is greater - extern KVILIB_API int compareVersions(const QString &szVersion1,const QString &szVersion2); - - // Check if the argument string is a valid x.y.z.... version string - extern KVILIB_API bool isValidVersionString(const QString &szVersion); - -}; - -#endif //!_KVI_MISCUTILS_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_msgtype.cpp b/3.4.0/src/kvilib/ext/kvi_msgtype.cpp deleted file mode 100644 index 2ccd6db3c8..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_msgtype.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// -// File : kvi_msgtype.cpp -// Creation date : Fri 30 24 2000 13:53:21 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#define _KVI_DEBUG_CHECK_RANGE_ - -#include "kvi_debug.h" -#include "kvi_msgtype.h" - -KviMsgType::KviMsgType(const char * type,int pixId,unsigned char fore,unsigned char back,bool bLog,int iLevel) -{ - m_szType = type; - m_iPixId = pixId; - m_cForeColor = fore; - m_cBackColor = back; - m_bLogEnabled = bLog; - if((iLevel < KVI_MSGTYPE_MINLEVEL) || (iLevel > KVI_MSGTYPE_MAXLEVEL))iLevel = 1; - m_iLevel = iLevel; -} - -KviMsgType::KviMsgType(const KviMsgType &msg) -{ - m_szType = msg.m_szType; - m_iPixId = msg.m_iPixId; - m_cForeColor = msg.m_cForeColor; - m_cBackColor = msg.m_cBackColor; - m_bLogEnabled = msg.m_bLogEnabled; - m_iLevel = msg.m_iLevel; -} - -KviMsgType::~KviMsgType() -{ -} - - - -KviMsgType & KviMsgType::operator=(const KviMsgType &msg) -{ - //if(m_szType.ptr() == msg.m_szType.ptr())return (*this); // self assignment (!!!) - m_szType = msg.m_szType; - m_iPixId = msg.m_iPixId; - m_cForeColor = msg.m_cForeColor; - m_cBackColor = msg.m_cBackColor; - m_bLogEnabled = msg.m_bLogEnabled; - m_iLevel = msg.m_iLevel; - return (*this); -} diff --git a/3.4.0/src/kvilib/ext/kvi_msgtype.h b/3.4.0/src/kvilib/ext/kvi_msgtype.h deleted file mode 100644 index 39bdecf8af..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_msgtype.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef _KVI_MSGTYPE_H_ -#define _KVI_MSGTYPE_H_ - -// -// File : kvi_msgtype.h -// Creation date : Fri Jun 30 2000 13:50:11 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" - -#define KVI_MSGTYPE_MINLEVEL 0 -#define KVI_MSGTYPE_LEVEL_0 0 -#define KVI_MSGTYPE_LEVEL_1 1 -#define KVI_MSGTYPE_LEVEL_2 2 -#define KVI_MSGTYPE_LEVEL_3 3 -#define KVI_MSGTYPE_LEVEL_4 4 -#define KVI_MSGTYPE_LEVEL_5 5 -#define KVI_MSGTYPE_MAXLEVEL 5 - -// 1 : Common activity -// 2 : People talking -// 3 : Response messages (whois , dns) -// 4 : -// 5 : Highlighted text - -// FIXME: Check the message ranges!!! - -class KVILIB_API KviMsgType -{ -public: - KviMsgType(const char * type,int pixId,unsigned char fore,unsigned char back,bool bLog,int iLevel); - KviMsgType(const KviMsgType &msg); - ~KviMsgType(); -public: - const char * m_szType; - int m_iPixId; - unsigned char m_cForeColor; - unsigned char m_cBackColor; - bool m_bLogEnabled; - int m_iLevel; -public: - void setBack(char back){ m_cBackColor = back; }; - void setFore(char fore){ m_cForeColor = fore; }; - int pixId(){ return m_iPixId; }; - int level(){ return m_iLevel; }; - void setLevel(int iLevel){ if((iLevel < KVI_MSGTYPE_MINLEVEL) || (iLevel > KVI_MSGTYPE_MAXLEVEL))m_iLevel = 1; else m_iLevel = iLevel; }; - void setPixId(int pixId){ m_iPixId = pixId; }; - unsigned char back(){ return m_cBackColor; }; - unsigned char fore(){ return m_cForeColor; }; - bool logEnabled(){ return m_bLogEnabled; }; - void enableLogging(bool bEnable){ m_bLogEnabled = bEnable; }; - const char * type(){ return m_szType; }; - KviMsgType & operator=(const KviMsgType &msg); // deep copy -}; - -#endif //_KVI_MSGTYPE_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_osinfo.cpp b/3.4.0/src/kvilib/ext/kvi_osinfo.cpp deleted file mode 100644 index 6753bb67b0..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_osinfo.cpp +++ /dev/null @@ -1,510 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// -// File : kvi_osinfo.cpp -// Creation date : 19 Jan 2006 GMT by Alexey Uzhva -// -// This toolbar is part of the KVirc irc client distribution -// Copyright (C) 2006 Alexey Uzhva -// -// 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 opinion) 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 __KVILIB__ - -#include "kvi_osinfo.h" -#include "kvi_locale.h" -#include "kvi_qstring.h" - -#ifndef COMPILE_ON_WINDOWS - #include <sys/utsname.h> - #include <stdlib.h> - #include <unistd.h> -#endif - -#ifdef COMPILE_ON_WINDOWS -#include <windows.h> - -typedef enum QueryInfo -{ - Os_Release, - Os_Version, - Os_Type -}; -typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); -typedef BOOL (WINAPI *PGETPRODUCTINFO)(DWORD,DWORD,DWORD,DWORD,PDWORD); - -#define SM_SERVERR2 89 -#define BUFSIZE 1024 - -//Vista :/ - -#define PRODUCT_BUSINESS 0x00000006 -#define PRODUCT_BUSINESS_N 0x00000010 -#define PRODUCT_CLUSTER_SERVER 0x00000012 -#define PRODUCT_DATACENTER_SERVER 0x00000008 -#define PRODUCT_DATACENTER_SERVER_CORE 0x0000000C -#define PRODUCT_ENTERPRISE 0x00000004 -#define PRODUCT_ENTERPRISE_SERVER 0x0000000A -#define PRODUCT_ENTERPRISE_SERVER_CORE 0x0000000E -#define PRODUCT_ENTERPRISE_SERVER_IA64 0x0000000F -#define PRODUCT_HOME_BASIC 0x00000002 -#define PRODUCT_HOME_BASIC_N 0x00000005 -#define PRODUCT_HOME_PREMIUM 0x00000003 -#define PRODUCT_HOME_SERVER 0x00000013 -#define PRODUCT_SERVER_FOR_SMALLBUSINESS 0x00000018 -#define PRODUCT_SMALLBUSINESS_SERVER 0x00000009 -#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x00000019 -#define PRODUCT_STANDARD_SERVER 0x00000007 -#define PRODUCT_STANDARD_SERVER_CORE 0x0000000D -#define PRODUCT_STARTER 0x0000000B -#define PRODUCT_STORAGE_ENTERPRISE_SERVER 0x00000017 -#define PRODUCT_STORAGE_EXPRESS_SERVER 0x00000014 -#define PRODUCT_STORAGE_STANDARD_SERVER 0x00000015 -#define PRODUCT_STORAGE_WORKGROUP_SERVER 0x00000016 -#define PRODUCT_UNDEFINED 0x00000000 -#define PRODUCT_ULTIMATE 0x00000001 -#define PRODUCT_WEB_SERVER 0x00000011 - -static QString queryWinInfo( QueryInfo info) -{ - QString szVersion; - OSVERSIONINFOEX osvi; - SYSTEM_INFO si; - PGNSI pGNSI; - BOOL bOsVersionInfoEx; - - ZeroMemory(&si, sizeof(SYSTEM_INFO)); - ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); - - // Try calling GetVersionEx using the OSVERSIONINFOEX structure. - // If that fails, try using the OSVERSIONINFO structure. - - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - - if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) ) - { - osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); - if (! GetVersionEx ( (OSVERSIONINFO *) &osvi) ) - return FALSE; - } - - // Call GetNativeSystemInfo if supported or GetSystemInfo otherwise. - - pGNSI = (PGNSI) GetProcAddress( - GetModuleHandle(TEXT("kernel32.dll")), - "GetNativeSystemInfo"); - if(NULL != pGNSI) - pGNSI(&si); - else GetSystemInfo(&si); - - switch (osvi.dwPlatformId) - { - // Test for the Windows NT product family. - - case VER_PLATFORM_WIN32_NT: - - // Test for the specific product. - - if ( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0 ) - { - if( osvi.wProductType == VER_NT_WORKSTATION ) - szVersion+= "Windows Vista "; - else szVersion+="Windows Server \"Longhorn\" "; - } - - if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 ) - { - if( GetSystemMetrics(SM_SERVERR2) ) - szVersion+="Windows Server 2003 \"R2\" "; - else if( osvi.wProductType == VER_NT_WORKSTATION && - si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64) - { - szVersion+="Windows XP Professional x64 Edition "; - } - else szVersion+="Windows Server 2003, "; - } - - if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 ) - szVersion+="Windows XP "; - - if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 ) - szVersion+="Windows 2000 "; - - if ( osvi.dwMajorVersion <= 4 ) - szVersion+="Windows NT "; - - PGETPRODUCTINFO pGetProductInfo; - pGetProductInfo = (PGETPRODUCTINFO) GetProcAddress( - GetModuleHandle(TEXT("kernel32.dll")), "GetProductInfo"); - // Test for specific product on Windows NT 4.0 SP6 and later. - if( bOsVersionInfoEx ) - { - DWORD dwPlatformInfo; - if(NULL != pGetProductInfo) - if(pGetProductInfo(osvi.dwMajorVersion,osvi.dwMinorVersion, - osvi.wServicePackMajor,osvi.wServicePackMinor,&dwPlatformInfo)) - { - switch(dwPlatformInfo) - { - case PRODUCT_BUSINESS: - szVersion+="Business Edition"; - break; - case PRODUCT_BUSINESS_N: - szVersion+="Business N Edition"; - break; - case PRODUCT_CLUSTER_SERVER: - szVersion+="Cluster Server Edition"; - break; - case PRODUCT_DATACENTER_SERVER: - szVersion+="Server Datacenter Edition (full installation)"; - break; - case PRODUCT_DATACENTER_SERVER_CORE: - szVersion+="Server Datacenter Edition (core installation)"; - break; - case PRODUCT_ENTERPRISE: - szVersion+="Enterprise Edition"; - break; - case PRODUCT_ENTERPRISE_SERVER: - szVersion+="Server Enterprise Edition (full installation)"; - break; - case PRODUCT_ENTERPRISE_SERVER_CORE: - szVersion+="Server Enterprise Edition (core installation)"; - break; - case PRODUCT_ENTERPRISE_SERVER_IA64: - szVersion+="Server Enterprise Edition for Itanium-based Systems"; - break; - case PRODUCT_HOME_BASIC: - szVersion+="Home Basic Edition"; - break; - case PRODUCT_HOME_BASIC_N: - szVersion+="Home Basic N Edition"; - break; - case PRODUCT_HOME_PREMIUM: - szVersion+="Home Premium Edition"; - break; - case PRODUCT_HOME_SERVER: - szVersion+="Home Server Edition"; - break; - case PRODUCT_SERVER_FOR_SMALLBUSINESS: - szVersion+="Server for Small Business Edition"; - break; - case PRODUCT_SMALLBUSINESS_SERVER: - szVersion+="Small Business Server"; - break; - case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM: - szVersion+="Small Business Server Premium Edition"; - break; - case PRODUCT_STANDARD_SERVER: - szVersion+="Server Standard Edition (full installation)"; - break; - case PRODUCT_STANDARD_SERVER_CORE: - szVersion+="Server Standard Edition (core installation)"; - break; - case PRODUCT_STARTER: - szVersion+="Starter Edition"; - break; - case PRODUCT_STORAGE_ENTERPRISE_SERVER: - szVersion+="Storage Server Enterprise Edition"; - break; - case PRODUCT_STORAGE_EXPRESS_SERVER: - szVersion+="Storage Server Express Edition"; - break; - case PRODUCT_STORAGE_STANDARD_SERVER: - szVersion+="Storage Server Standard Edition"; - break; - case PRODUCT_STORAGE_WORKGROUP_SERVER: - szVersion+="Storage Server Workgroup Edition"; - break; - case PRODUCT_UNDEFINED: - szVersion+="An unknown product"; - break; - case PRODUCT_ULTIMATE: - szVersion+="Ultimate Edition"; - break; - case PRODUCT_WEB_SERVER: - szVersion+="Web Server Edition"; - break; - - } - szVersion+=" "; - if (si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64) - { - szVersion+="(x64) "; - } - } else { - // Test for the workstation type. - if ( osvi.wProductType == VER_NT_WORKSTATION && - si.wProcessorArchitecture!=PROCESSOR_ARCHITECTURE_AMD64) - { - if( osvi.dwMajorVersion == 4 ) - szVersion+= "Workstation 4.0 " ; - else if( osvi.wSuiteMask & VER_SUITE_PERSONAL ) - szVersion+= "Home Edition " ; - else szVersion+= "Professional " ; - } - - // Test for the server type. - else if ( osvi.wProductType == VER_NT_SERVER || - osvi.wProductType == VER_NT_DOMAIN_CONTROLLER ) - { - if(osvi.dwMajorVersion==5 && osvi.dwMinorVersion==2) - { - if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_IA64 ) - { - if( osvi.wSuiteMask & VER_SUITE_DATACENTER ) - szVersion+= "Datacenter Edition for Itanium-based Systems" ; - else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE ) - szVersion+= "Enterprise Edition for Itanium-based Systems" ; - } - - else if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64 ) - { - if( osvi.wSuiteMask & VER_SUITE_DATACENTER ) - szVersion+= "Datacenter x64 Edition " ; - else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE ) - szVersion+= "Enterprise x64 Edition " ; - else szVersion+= "Standard x64 Edition " ; - } - - else - { - if( osvi.wSuiteMask & VER_SUITE_DATACENTER ) - szVersion+= "Datacenter Edition " ; - else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE ) - szVersion+= "Enterprise Edition " ; - else if ( osvi.wSuiteMask == VER_SUITE_BLADE ) - szVersion+= "Web Edition " ; - else szVersion+= "Standard Edition " ; - } - } - else if(osvi.dwMajorVersion==5 && osvi.dwMinorVersion==0) - { - if( osvi.wSuiteMask & VER_SUITE_DATACENTER ) - szVersion+= "Datacenter Server " ; - else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE ) - szVersion+= "Advanced Server " ; - else szVersion+= "Server " ; - } - else // Windows NT 4.0 - { - if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE ) - szVersion+="Server 4.0, Enterprise Edition " ; - else szVersion+= "Server 4.0 " ; - } - } - } - } - // Test for specific product on Windows NT 4.0 SP5 and earlier - else - { - HKEY hKey; - TCHAR szProductType[BUFSIZE]; - DWORD dwBufLen=BUFSIZE*sizeof(TCHAR); - LONG lRet; - - lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE, - TEXT("SYSTEM\\CurrentControlSet\\Control\\ProductOptions"), - 0, KEY_QUERY_VALUE, &hKey ); - if( lRet != ERROR_SUCCESS ) - return FALSE; - - lRet = RegQueryValueEx( hKey, TEXT("ProductType"), NULL, NULL, - (LPBYTE) szProductType, &dwBufLen); - RegCloseKey( hKey ); - - if( (lRet != ERROR_SUCCESS) || (dwBufLen > BUFSIZE*sizeof(TCHAR)) ) - return FALSE; - - if ( lstrcmpi( TEXT("WINNT"), szProductType) == 0 ) - szVersion+= "Workstation " ; - if ( lstrcmpi( TEXT("LANMANNT"), szProductType) == 0 ) - szVersion+= "Server " ; - if ( lstrcmpi( TEXT("SERVERNT"), szProductType) == 0 ) - szVersion+= "Advanced Server " ; - } - - - // Display service pack (if any) and build number. - - if( osvi.dwMajorVersion == 4 && - lstrcmpi( osvi.szCSDVersion, TEXT("Service Pack 6") ) == 0 ) - { - HKEY hKey; - LONG lRet; - - // Test for SP6 versus SP6a. - lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE, - TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Hotfix\\Q246009"), - 0, KEY_QUERY_VALUE, &hKey ); - if( lRet == ERROR_SUCCESS ) - szVersion+= QString("Service Pack 6a (Build %1)").arg( osvi.dwBuildNumber & 0xFFFF ); - else // Windows NT 4.0 prior to SP6a - { - szVersion+= QString( "%1 (Build %2)").arg( osvi.szCSDVersion).arg( osvi.dwBuildNumber & 0xFFFF); - } - - RegCloseKey( hKey ); - } - else // not Windows NT 4.0 - { - szVersion+= QString( "%1 (Build %2)").arg( osvi.szCSDVersion).arg( osvi.dwBuildNumber & 0xFFFF); - } - - break; - - // Test for the Windows Me/98/95. - case VER_PLATFORM_WIN32_WINDOWS: - - if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0) - { - szVersion+="Windows 95 "; - if (osvi.szCSDVersion[1]=='C' || osvi.szCSDVersion[1]=='B') - szVersion+="OSR2 "; - } - - if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10) - { - szVersion+="Windows 98 "; - if ( osvi.szCSDVersion[1]=='A' || osvi.szCSDVersion[1]=='B') - szVersion+="SE "; - } - - if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90) - { - szVersion+="Windows Millennium Edition"; - } - break; - - case VER_PLATFORM_WIN32s: - - szVersion+="Win32s"; - break; - } - if(info==Os_Release) - { - unsigned long major = osvi.dwMajorVersion; - unsigned long minor = osvi.dwMinorVersion; - unsigned long release = osvi.dwBuildNumber; - QString szMajor, szMinor, szRelease, szVersion; - szMajor.setNum(major); - szMinor.setNum(minor); - szRelease.setNum(release); - szVersion = "Release : "+szMajor +"."+ szMinor +"."+ szRelease; - return szVersion; - } - if(info==Os_Type) - { - if(osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) return " NT "; - if(osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) return " Windows "; - if(osvi.dwPlatformId == VER_PLATFORM_WIN32s) return " Win32s "; - return __tr2qs("Unknown "); - } - if(info==Os_Version) - { - return szVersion; - } - - return "what's wrong? o.O"; -} -#endif - - -namespace KviOsInfo -{ - QString type() - { -#ifdef COMPILE_ON_WINDOWS - return queryWinInfo(Os_Type); -#else - #ifdef Q_OS_MACX - return "macosx"; - #else - return "unix"; - #endif -#endif - } - - QString name() - { -#ifdef COMPILE_ON_WINDOWS - return "windows"; -#else - struct utsname uts; - if(uname(&uts) == 0) - return QString::fromLocal8Bit(uts.sysname); - return KviQString::empty; -#endif - } - - QString version() - { -#ifdef COMPILE_ON_WINDOWS - return queryWinInfo(Os_Version); -#else - struct utsname uts; - if(uname(&uts) == 0) - return QString::fromLocal8Bit(uts.version); - return KviQString::empty; -#endif - } - - QString release() - { -#ifdef COMPILE_ON_WINDOWS - return queryWinInfo(Os_Release); -#else - struct utsname uts; - if(uname(&uts) == 0) - return QString::fromLocal8Bit(uts.release); - return KviQString::empty; -#endif - } - - QString machine() - { -#ifdef COMPILE_ON_WINDOWS - QString mach = getenv("PROCESSOR_IDENTIFIER"); - return mach.section(",",0,0); -#else - struct utsname uts; - if(uname(&uts) == 0) - return QString::fromLocal8Bit(uts.machine); - return KviQString::empty; -#endif - } - - QString nodename() - { -#ifdef COMPILE_ON_WINDOWS - return "windows"; -#else - struct utsname uts; - if(uname(&uts) == 0) - return QString::fromLocal8Bit(uts.nodename); - return KviQString::empty; -#endif - } - - QString hostname() - { - char hbuffer[1024]; - if(gethostname(hbuffer,1024) == 0) - return QString::fromLocal8Bit(hbuffer); - else - return KviQString::empty; - } -} - diff --git a/3.4.0/src/kvilib/ext/kvi_osinfo.h b/3.4.0/src/kvilib/ext/kvi_osinfo.h deleted file mode 100644 index 7409ddd126..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_osinfo.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef _KVI_OSINFO_H_ -#define _KVI_OSINFO_H_ - -/////////////////////////////////////////////////////////////////////////////// -// -// File : kvi_osinfo.h -// Creation date : 19 Jan 2006 GMT by Alexey Uzhva -// -// This toolbar is part of the KVirc irc client distribution -// Copyright (C) 2006 Alexey Uzhva -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qstring.h> - -namespace KviOsInfo -{ - extern KVILIB_API QString type(); - extern KVILIB_API QString name(); - extern KVILIB_API QString version(); - extern KVILIB_API QString release(); - extern KVILIB_API QString machine(); - extern KVILIB_API QString nodename(); - extern KVILIB_API QString hostname(); -}; - -#endif //!_KVI_OSINFO_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_parameterlist.cpp b/3.4.0/src/kvilib/ext/kvi_parameterlist.cpp deleted file mode 100644 index 2369667a8a..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_parameterlist.cpp +++ /dev/null @@ -1,254 +0,0 @@ -// -// File : kvi_parameterlist.cpp -// Creation date : Tue Sep 12 2000 18:14:01 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_parameterlist.h" - -KviParameterList::KviParameterList() -: KviPointerList<KviStr>() -{ - setAutoDelete(true); -} - -KviParameterList::KviParameterList(KviStr *p1) -: KviPointerList<KviStr>() -{ - setAutoDelete(true); - append(p1); -} - -KviParameterList::KviParameterList(KviStr *p1,KviStr *p2) -: KviPointerList<KviStr>() -{ - setAutoDelete(true); - append(p1); - append(p2); -} - -KviParameterList::KviParameterList(KviStr *p1,KviStr *p2,KviStr *p3) -: KviPointerList<KviStr>() -{ - setAutoDelete(true); - append(p1); - append(p2); - append(p3); -} - -KviParameterList::KviParameterList(KviStr *p1,KviStr *p2,KviStr *p3,KviStr *p4) -: KviPointerList<KviStr>() -{ - setAutoDelete(true); - append(p1); - append(p2); - append(p3); - append(p4); -} - -KviParameterList::KviParameterList(KviStr *p1,KviStr *p2,KviStr *p3,KviStr *p4,KviStr *p5) -: KviPointerList<KviStr>() -{ - setAutoDelete(true); - append(p1); - append(p2); - append(p3); - append(p4); - append(p5); -} - -KviParameterList::KviParameterList(KviStr *p1,KviStr *p2,KviStr *p3,KviStr *p4,KviStr *p5,KviStr *p6) -: KviPointerList<KviStr>() -{ - setAutoDelete(true); - append(p1); - append(p2); - append(p3); - append(p4); - append(p5); - append(p6); -} - - -KviParameterList::KviParameterList(KviStr *p1,KviStr *p2,KviStr *p3,KviStr *p4,KviStr *p5,KviStr *p6,KviStr *p7) -: KviPointerList<KviStr>() -{ - setAutoDelete(true); - append(p1); - append(p2); - append(p3); - append(p4); - append(p5); - append(p6); - append(p7); -} - -KviParameterList::KviParameterList(const char *paramBuffer) -: KviPointerList<KviStr>() -{ - setAutoDelete(true); - while(*paramBuffer) - { - KviStr * pStr = new KviStr(); - paramBuffer = kvi_extractToken(*pStr,paramBuffer); - append(pStr); - } -} - -KviParameterList::~KviParameterList() -{ -} - -KviStr * KviParameterList::safeFirst() -{ - KviStr * f= first(); - return f ? f : &m_szEmpty; -} - -KviStr * KviParameterList::safeNext() -{ - KviStr * f = next(); - return f ? f : &m_szEmpty; -} - - -bool KviParameterList::getBool() -{ - KviStr * par = current(); - (void)next(); - if(par) - { - if(kvi_strEqualCS(par->ptr(),"0"))return false; - } - return true; // default -} - -int KviParameterList::getInt(bool * bOk) -{ - KviStr * par = current(); - (void)next(); - if(par) - { - return par->toInt(bOk); - } - if(bOk)*bOk = false; - return 0; -} - -unsigned int KviParameterList::getUInt(bool * bOk) -{ - KviStr * par = current(); - (void)next(); - if(par) - { - return par->toUInt(bOk); - } - if(bOk)*bOk = false; - return 0; -} - -QRect KviParameterList::getRect(bool * bOk) -{ - int val[4]; - for(int i=0;i<4;i++) - { - KviStr * pszv = current(); - (void)next(); - if(!pszv) - { - if(bOk)*bOk = false; - return QRect(); // invalid - } - bool mybOk; - val[i] = pszv->toInt(&mybOk); - if(!mybOk) - { - if(bOk)*bOk = false; - return QRect(); // invalid - } - } - if(bOk)*bOk = true; - return QRect(val[0],val[1],val[2],val[3]); -} - -QPoint KviParameterList::getPoint(bool * bOk) -{ - int val[2]; - for(int i=0;i<2;i++) - { - KviStr * pszv = current(); - (void)next(); - if(!pszv) - { - if(bOk)*bOk = false; - return QPoint(); // invalid - } - bool mybOk; - val[i] = pszv->toInt(&mybOk); - if(!mybOk) - { - if(bOk)*bOk = false; - return QPoint(); // invalid - } - } - if(bOk)*bOk = true; - return QPoint(val[0],val[1]); -} - -QSize KviParameterList::getSize(bool * bOk) -{ - int val[2]; - for(int i=0;i<2;i++) - { - KviStr * pszv = current(); - (void)next(); - if(!pszv) - { - if(bOk)*bOk = false; - return QSize(); // invalid - } - bool mybOk; - val[i] = pszv->toInt(&mybOk); - if(!mybOk) - { - if(bOk)*bOk = false; - return QSize(); // invalid - } - } - if(bOk)*bOk = true; - return QSize(val[0],val[1]); -} - -//#ifdef COMPILE_ON_WINDOWS -// -// #include "kvi_malloc.h" -// -// void * KviParameterList::operator new(size_t tSize) -// { -// return kvi_malloc(tSize); -// } -// -// void KviParameterList::operator delete(void * p) -// { -// kvi_free(p); -// } -//#endif diff --git a/3.4.0/src/kvilib/ext/kvi_parameterlist.h b/3.4.0/src/kvilib/ext/kvi_parameterlist.h deleted file mode 100644 index fe01d66f4d..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_parameterlist.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef _KVI_PARAMETERLIST_H_ -#define _KVI_PARAMETERLIST_H_ - -// -// File : kvi_parameterlist.h -// Creation date : Tue Sep 12 2000 18:00:01 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_heapobject.h" -#include "kvi_string.h" - -#include "kvi_pointerlist.h" -#include <qrect.h> -#include <qpoint.h> -#include <qsize.h> - -class KVILIB_API KviParameterList : public KviPointerList<KviStr>, public KviHeapObject -{ -public: - KviParameterList(); - KviParameterList(KviStr *p1); - KviParameterList(KviStr *p1,KviStr *p2); - KviParameterList(KviStr *p1,KviStr *p2,KviStr *p3); - KviParameterList(KviStr *p1,KviStr *p2,KviStr *p3,KviStr *p4); - KviParameterList(KviStr *p1,KviStr *p2,KviStr *p3,KviStr *p4,KviStr *p5); - KviParameterList(KviStr *p1,KviStr *p2,KviStr *p3,KviStr *p4,KviStr *p5,KviStr *p6); - KviParameterList(KviStr *p1,KviStr *p2,KviStr *p3,KviStr *p4,KviStr *p5,KviStr *p6,KviStr *p7); - KviParameterList(const char * paramBuffer); - virtual ~KviParameterList(); -private: - KviStr m_szEmpty; -public: - void init(){ (void)first(); }; - // These functions have to be called when the - // current() points to the FIRST item that has - // to be interpreted as Bool,Int,UInt,Rect etc... - // At the call exit the current() points - // to the first item that was NOT used by the call - bool getBool(); - int getInt(bool * bOk = 0); - unsigned int getUInt(bool * bOk = 0); - QRect getRect(bool * bOk = 0); - QPoint getPoint(bool * bOk = 0); - QSize getSize(bool * bOk = 0); - KviStr * safeFirst(); - KviStr * safeNext(); - const char * safeFirstParam(){ return safeFirst()->ptr(); }; - const char * safeNextParam(){ return safeNext()->ptr(); }; - -}; - - - -#endif //_KVI_PARAMETERLIST_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_pixmap.cpp b/3.4.0/src/kvilib/ext/kvi_pixmap.cpp deleted file mode 100644 index 7fb6990a46..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_pixmap.cpp +++ /dev/null @@ -1,180 +0,0 @@ -//============================================================================= -// -// File : kvi_pixmap.cpp -// Creation date : Sat Jun 24 2000 14:00:27 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_debug.h" -#include "kvi_pixmap.h" -#include "kvi_qstring.h" - -#include <qpainter.h> - -KviPixmap::KviPixmap() -{ - m_pPix = 0; -} - -KviPixmap::KviPixmap(const char * path) -{ - m_pPix = 0; - load(path); -} - -KviPixmap::KviPixmap(const KviPixmap &pix) -{ - m_pPix = 0; - m_szPath = pix.path(); - - if(!m_szPath.isEmpty()) - { - if(pix.pixmap()) - { - m_pPix = new QPixmap(*(pix.pixmap())); - } - } -} - -KviPixmap::~KviPixmap() -{ - if(m_pPix)delete m_pPix; - m_pPix = 0; // just to be sure :) -} - -bool KviPixmap::load(const char * path) -{ - if(m_pPix)delete m_pPix; - m_pPix = 0; - m_szPath = path; - if(m_szPath.isEmpty())return false; - - m_pPix = new QPixmap(m_szPath); - - if(m_pPix->isNull()) - { - delete m_pPix; - m_pPix = 0; - m_szPath = ""; - return false; - } - return true; -} - -bool KviPixmap::load(const QString& path) -{ - if(m_pPix)delete m_pPix; - m_pPix = 0; - m_szPath = path; - if(m_szPath.isEmpty())return false; - - m_pPix = new QPixmap(m_szPath); - - if(m_pPix->isNull()) - { - delete m_pPix; - m_pPix = 0; - m_szPath = ""; - return false; - } - return true; -} - -void KviPixmap::set(const QPixmap &pix,const QString &szPath) -{ - if(pix.isNull()) - { - setNull(); - return; - } - - if(m_pPix)delete m_pPix; - m_pPix = new QPixmap(pix); - m_szPath = szPath; -} - - -void KviPixmap::setNull() -{ - if(m_pPix)delete m_pPix; - m_pPix = 0; - m_szPath = ""; -} - -KviPixmap & KviPixmap::operator=(const KviPixmap &pix) -{ - if(m_pPix == pix.m_pPix)return (*this); // self assignment (!!!) - if(KviQString::equalCI(m_szPath,pix.path()))return (*this); // same pix - - if(m_pPix)delete m_pPix; - m_pPix = 0; - m_szPath = pix.path(); - - if(!m_szPath.isEmpty()) - { - if(pix.pixmap()) - { - m_pPix = new QPixmap(*(pix.pixmap())); - } - } - return (*this); -} - - -void KviPixmapUtils::drawPixmapWithPainter(QPainter* p,QPixmap * pix,int flags,const QRect& paintRect,int iWidgetWidth,int iWidgetHeight,int dx,int dy) -{ - if(!pix)return; - if(!flags) - { - p->drawTiledPixmap(paintRect.left(),paintRect.top(),paintRect.width(),paintRect.height(),*pix,dx,dy); - return; - } - - int iPixWidth=pix->width(); - int iPixHeight=pix->height(); - int x=0; - int y=0; - - if( !(flags & Qt::AlignHorizontal_Mask )) - x=-1; - else if ( flags & Qt::AlignRight ) - x=iWidgetWidth - iPixWidth; - else if( flags & Qt::AlignHCenter ) - x=(iWidgetWidth - iPixWidth)/2; - - if( !(flags & Qt::AlignVertical_Mask )) - y=-1; - else if ( flags & Qt::AlignBottom ) - y=iWidgetHeight - iPixHeight; - else if( flags & Qt::AlignVCenter ) - y=(iWidgetHeight - iPixHeight)/2; - - if(x==-1) { - p->drawTiledPixmap(paintRect.left(),y,paintRect.width(),iPixHeight,*pix,dx,dy); - } else if(y==-1) { - p->drawTiledPixmap(x,paintRect.top(),iPixWidth,paintRect.height(),*pix,dx,dy); - } else { - p->drawPixmap(x,y,*pix); - } -} diff --git a/3.4.0/src/kvilib/ext/kvi_pixmap.h b/3.4.0/src/kvilib/ext/kvi_pixmap.h deleted file mode 100644 index 7ac5f91409..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_pixmap.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef _KVI_PIXMAP_H_ -#define _KVI_PIXMAP_H_ - -//============================================================================= -// -// File : kvi_pixmap.h -// Creation date : Sat Jun 24 2000 13:59:04 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" -#include <qpixmap.h> - -class KVILIB_API KviPixmap -{ -public: - KviPixmap(); - KviPixmap(const char * path); - KviPixmap(const KviPixmap &pix); - ~KviPixmap(); -private: - QPixmap * m_pPix; - QString m_szPath; -public: - bool isNull(){ return m_pPix == 0; }; - bool load(const char * path); - bool load(const QString& path); - const QString& path() const { return m_szPath; }; - QPixmap * pixmap() const { return m_pPix; }; - void set(const QPixmap &pix,const QString &szPath); - KviPixmap & operator=(const KviPixmap &pix); // deep copy - void setNull(); -}; - -namespace KviPixmapUtils -{ - extern KVILIB_API void drawPixmapWithPainter(QPainter* p,QPixmap * pix,int flags,const QRect& paintRect,int iWidgetWidth,int iWidgetHeight,int dx,int dy); - inline void drawPixmapWithPainter(QPainter* p,QPixmap * pix,int flags,const QRect& paintRect,int iWidgetWidth,int iWidgetHeight) - { KviPixmapUtils::drawPixmapWithPainter(p,pix,flags,paintRect,iWidgetWidth,iWidgetHeight,paintRect.left(),paintRect.top()); }; -}; - -#endif //_KVI_PIXMAP_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_proxydb.cpp b/3.4.0/src/kvilib/ext/kvi_proxydb.cpp deleted file mode 100644 index fb254af8e4..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_proxydb.cpp +++ /dev/null @@ -1,192 +0,0 @@ -// -// File : kvi_proxydb.cpp -// Creation date : Sat Jul 22 2000 18:23:23 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_proxydb.h" -#include "kvi_config.h" - - -KviProxy::KviProxy() -{ - m_szHostname = "proxy.example.net"; - m_uPort = 1080; - m_protocol = Socks4; - m_bIsIpV6 = false; -} - -KviProxy::KviProxy(const KviProxy &prx) -{ - m_szHostname = prx.m_szHostname; - m_szIp = prx.m_szIp; - m_szUser = prx.m_szUser; - m_szPass = prx.m_szPass; - m_uPort = prx.m_uPort; - m_protocol = prx.m_protocol; - m_bIsIpV6 = prx.m_bIsIpV6; -} - -KviProxy::~KviProxy() -{ -} - -static const char * proxy_protocols_table[3]= { "SOCKSv4", "SOCKSv5", "HTTP" }; - -const char * KviProxy::protocolName() const -{ - switch(m_protocol) - { - case Socks5: return proxy_protocols_table[1]; break; - case Http: return proxy_protocols_table[2]; break; - default: return proxy_protocols_table[0]; break; - } - - return proxy_protocols_table[0]; -} - -void KviProxy::setNamedProtocol(const char * proto) -{ - if(kvi_strEqualCI(proto,"SOCKSv5"))m_protocol = KviProxy::Socks5; - else if(kvi_strEqualCI(proto,"HTTP"))m_protocol = KviProxy::Http; - else m_protocol = KviProxy::Socks4; -} - -void KviProxy::getSupportedProtocolNames(QStringList & buf) -{ - for(int i=0;i<3;i++)buf.append(QString(proxy_protocols_table[i])); -} - -void KviProxy::normalizeUserAndPass() -{ - m_szUser.stripWhiteSpace(); - m_szPass.stripWhiteSpace(); -} - -KviProxyDataBase::KviProxyDataBase() -{ - m_pProxyList = new KviPointerList<KviProxy>; - m_pProxyList->setAutoDelete(true); - m_pCurrentProxy = 0; -} - -KviProxyDataBase::~KviProxyDataBase() -{ - delete m_pProxyList; -} - -void KviProxyDataBase::updateProxyIp(const char * proxy,const char * ip) -{ - for(KviProxy * prx = m_pProxyList->first();prx;prx = m_pProxyList->next()) - { - if(kvi_strEqualCI(proxy,prx->m_szHostname.ptr())) - { - prx->m_szIp = ip; - return; - } - } -} - -void KviProxyDataBase::clear() -{ - delete m_pProxyList; - m_pProxyList = new KviPointerList<KviProxy>; - m_pProxyList->setAutoDelete(true); - m_pCurrentProxy = 0; -} - -void KviProxyDataBase::load(const char * filename) -{ - clear(); - KviConfig cfg(filename,KviConfig::Read); - - unsigned int nEntries = cfg.readUIntEntry("Entries",0); - - for(unsigned int i=0;i<nEntries;i++) - { - KviProxy * p = new KviProxy(); - KviStr tmp(KviStr::Format,"%u_Hostname",i); - p->m_szHostname = cfg.readEntry(tmp.ptr(),"proxy.example.net"); - tmp.sprintf("%u_Port",i); - p->m_uPort = cfg.readUIntEntry(tmp.ptr(),7000); - tmp.sprintf("%u_Ip",i); - p->m_szIp = cfg.readEntry(tmp.ptr(),""); - tmp.sprintf("%u_User",i); - p->m_szUser = cfg.readEntry(tmp.ptr(),""); - tmp.sprintf("%u_Pass",i); - p->m_szPass = cfg.readEntry(tmp.ptr(),""); - - tmp.sprintf("%u_Protocol",i); - KviStr type = cfg.readEntry(tmp.ptr(),"SOCKSv4"); - p->setNamedProtocol(type.ptr()); - - tmp.sprintf("%u_IsIpV6",i); - p->m_bIsIpV6 = cfg.readBoolEntry(tmp.ptr(),false); - tmp.sprintf("%u_Current",i); - if(cfg.readBoolEntry(tmp.ptr(),false))m_pCurrentProxy = p; - m_pProxyList->append(p); - } - - if(!m_pCurrentProxy)m_pCurrentProxy = m_pProxyList->first(); -} - -void KviProxyDataBase::save(const char * filename) -{ - KviConfig cfg(filename,KviConfig::Write); - - cfg.clear(); - - cfg.writeEntry("Entries",m_pProxyList->count()); - - - int i=0; - - for(KviProxy * p=m_pProxyList->first();p;p=m_pProxyList->next()) - { - KviStr tmp(KviStr::Format,"%u_Hostname",i); - cfg.writeEntry(tmp.ptr(),p->m_szHostname.ptr()); - tmp.sprintf("%u_Port",i); - cfg.writeEntry(tmp.ptr(),p->m_uPort); - tmp.sprintf("%u_Ip",i); - cfg.writeEntry(tmp.ptr(),p->m_szIp.ptr()); - tmp.sprintf("%u_User",i); - cfg.writeEntry(tmp.ptr(),p->m_szUser.ptr()); - tmp.sprintf("%u_Pass",i); - cfg.writeEntry(tmp.ptr(),p->m_szPass.ptr()); - - tmp.sprintf("%u_Protocol",i); - KviStr type; - switch(p->m_protocol) - { - case KviProxy::Socks5: type = "SOCKSv5"; break; - case KviProxy::Http: type = "HTTP"; break; - default: type = "SOCKSv4"; break; - } - cfg.writeEntry(tmp.ptr(),type.ptr()); - - tmp.sprintf("%u_IsIpV6",i); - cfg.writeEntry(tmp.ptr(),p->m_bIsIpV6); - tmp.sprintf("%u_Current",i); - if(m_pCurrentProxy == p)cfg.writeEntry(tmp.ptr(),true); - i++; - } -} diff --git a/3.4.0/src/kvilib/ext/kvi_proxydb.h b/3.4.0/src/kvilib/ext/kvi_proxydb.h deleted file mode 100644 index 16a323406b..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_proxydb.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef _KVI_PROXYDB_H_ -#define _KVI_PROXYDB_H_ - -// -// File : kvi_proxydb.h -// Creation date : Sat Jul 22 2000 18:19:01 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_string.h" -#include "kvi_inttypes.h" -#include "kvi_pointerlist.h" -#include <qstringlist.h> - -class KVILIB_API KviProxy -{ -public: - enum Protocol { Socks4 , Socks5 , Http }; - KviProxy(); - KviProxy(const KviProxy &prx); - ~KviProxy(); -public: - KviStr m_szHostname; - KviStr m_szIp; - KviStr m_szPass; - KviStr m_szUser; - kvi_u32_t m_uPort; - Protocol m_protocol; - bool m_bIsIpV6; -public: - bool isIpV6() const { return m_bIsIpV6; }; - Protocol protocol() const { return m_protocol; }; - const char * protocolName() const; - void setNamedProtocol(const char * proto); - kvi_u32_t port() const { return m_uPort; }; - const char * user() const { return m_szUser.ptr(); }; - const char * pass() const { return m_szPass.ptr(); }; - const char * ip() const { return m_szIp.ptr(); }; - const char * hostname() const { return m_szHostname.ptr(); }; - void normalizeUserAndPass(); - bool hasPass() const { return m_szPass.hasData(); }; - bool hasUser() const { return m_szUser.hasData(); }; - unsigned int passLen() const { return (unsigned int)m_szPass.len(); }; - unsigned int userLen() const { return (unsigned int)m_szUser.len(); }; - static void getSupportedProtocolNames(QStringList & buf); -}; - - -class KVILIB_API KviProxyDataBase -{ -public: - KviProxyDataBase(); - ~KviProxyDataBase(); -private: - KviPointerList<KviProxy> * m_pProxyList; - KviProxy * m_pCurrentProxy; -public: - void clear(); - KviPointerList<KviProxy> * proxyList(){ return m_pProxyList; }; - KviProxy * currentProxy(){ return m_pCurrentProxy; }; - void updateProxyIp(const char * proxy,const char * ip); - void setCurrentProxy(KviProxy * prx){ m_pCurrentProxy = prx; }; - void insertProxy(KviProxy * prx){ m_pProxyList->append(prx); }; - void load(const char * filename); - void save(const char * filename); -}; - -#endif //_KVI_PROXYDB_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_regchan.cpp b/3.4.0/src/kvilib/ext/kvi_regchan.cpp deleted file mode 100644 index bd763877bf..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_regchan.cpp +++ /dev/null @@ -1,181 +0,0 @@ -//============================================================================= -// -// File : kvi_regchan.cpp -// Creation date : Sat Jun 29 01:01:16 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - -#include "kvi_regchan.h" -#include "kvi_config.h" -#include "kvi_qstring.h" - -KviRegisteredChannel::KviRegisteredChannel(const KviStr &name,const KviStr &netmask) -{ - m_szName = name; - m_szNetMask = netmask; - m_pPropertyDict = new KviPointerHashTable<const char *,KviStr>(7,false,true); - m_pPropertyDict->setAutoDelete(true); -} - -KviRegisteredChannel::~KviRegisteredChannel() -{ - delete m_pPropertyDict; -} - - - -KviRegisteredChannelDataBase::KviRegisteredChannelDataBase() -{ - m_pChannelDict = new KviPointerHashTable<const char *,KviRegisteredChannelList>(17,false,true); - m_pChannelDict->setAutoDelete(true); -} - -KviRegisteredChannelDataBase::~KviRegisteredChannelDataBase() -{ - delete m_pChannelDict; -} - -void KviRegisteredChannelDataBase::load(const char * filename) -{ - KviConfig cfg(filename,KviConfig::Read); - m_pChannelDict->clear(); - KviConfigIterator it(*(cfg.dict())); - while(KviConfigGroup * d = it.current()) - { - KviStr szMask = it.currentKey(); - KviStr szChan = szMask.leftToLast('@'); - szMask.cutToLast('@'); - KviRegisteredChannel * c = new KviRegisteredChannel(szChan,szMask); - add(c); - KviConfigGroupIterator sit(*d); - while(QString * s = sit.current()) - { - c->setProperty(KviQString::toUtf8(sit.currentKey()).data(),new KviStr(*s)); - ++sit; - } - ++it; - } -} - -void KviRegisteredChannelDataBase::save(const char * filename) -{ - KviConfig cfg(filename,KviConfig::Write); - cfg.clear(); - - KviPointerHashTableIterator<const char *,KviRegisteredChannelList> it(*m_pChannelDict); - while(KviRegisteredChannelList * l = it.current()) - { - for(KviRegisteredChannel * c = l->first();c;c = l->next()) - { - KviStr szGrp(KviStr::Format,"%s@%s",c->name().ptr(),c->netMask().ptr()); - cfg.setGroup(szGrp.ptr()); - KviPointerHashTableIterator<const char *,KviStr> pit(*(c->propertyDict())); - while(KviStr * s = pit.current()) - { - cfg.writeEntry(pit.currentKey(),s->ptr()); - ++pit; - } - } - ++it; - } -} - -KviRegisteredChannel * KviRegisteredChannelDataBase::find(const char * name,const char * net) -{ - KviRegisteredChannelList * l = m_pChannelDict->find(name); - if(!l)return 0; - for(KviRegisteredChannel * c = l->first();c;c = l->next()) - { - if(kvi_matchString(c->netMask().ptr(),net))return c; - } - - return 0; -} - -KviRegisteredChannel * KviRegisteredChannelDataBase::findExact(const char * name,const char * netmask) -{ - KviRegisteredChannelList * l = m_pChannelDict->find(name); - if(!l)return 0; - for(KviRegisteredChannel * c = l->first();c;c = l->next()) - { - if(kvi_strEqualCI(c->netMask().ptr(),netmask))return c; - } - return 0; -} - -void KviRegisteredChannelDataBase::remove(KviRegisteredChannel * c) -{ - KviRegisteredChannelList * l = m_pChannelDict->find(c->name().ptr()); - if(!l)return; - for(KviRegisteredChannel * ch = l->first();ch;ch = l->next()) - { - if(ch == c) - { - if(l->count() <= 1) - { - m_pChannelDict->remove(c->name().ptr()); - } else { - l->removeRef(c); - } - return; - } - } -} - - -void KviRegisteredChannelDataBase::add(KviRegisteredChannel * c) -{ - KviRegisteredChannel * old = findExact(c->name().ptr(),c->netMask().ptr()); - if(old) - { - KviPointerHashTableIterator<const char *,KviStr> pit(*(old->propertyDict())); - while(KviStr *s = pit.current()) - { - if(!c->property(pit.currentKey())) - c->setProperty(pit.currentKey(),new KviStr(*s)); - ++pit; - } - remove(old); - } - KviRegisteredChannelList * l = m_pChannelDict->find(c->name().ptr()); - if(!l) - { - l = new KviRegisteredChannelList; - l->setAutoDelete(true); - m_pChannelDict->insert(c->name().ptr(),l); - } - // insert where there are less wildcards - int o = c->netMask().occurences('*'); - int idx = 0; - for(KviRegisteredChannel * rc = l->first();rc;rc = l->next()) - { - if(rc->netMask().occurences('*') > o) - { - // the existing has more wildcards , insert here! - l->insert(idx,c); - return; - } - idx++; - } - l->append(c); -} - diff --git a/3.4.0/src/kvilib/ext/kvi_regchan.h b/3.4.0/src/kvilib/ext/kvi_regchan.h deleted file mode 100644 index 2848ffb738..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_regchan.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef _KVI_REGCHAN_H_ -#define _KVI_REGCHAN_H_ -//============================================================================= -// -// File : kvi_regchan.h -// Creation date : Sat Jun 29 01:01:15 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_heapobject.h" -#include "kvi_string.h" -#include "kvi_pointerlist.h" - -#include "kvi_pointerhashtable.h" - -class KVILIB_API KviRegisteredChannel : public KviHeapObject -{ - friend class KviRegisteredChannelDataBase; -public: - KviRegisteredChannel(const KviStr &name,const KviStr &netmask); - ~KviRegisteredChannel(); -protected: - KviStr m_szName; - KviStr m_szNetMask; - KviPointerHashTable<const char *,KviStr> * m_pPropertyDict; -public: - KviPointerHashTable<const char *,KviStr> * propertyDict(){ return m_pPropertyDict; }; - const KviStr & name(){ return m_szName; }; - const KviStr & netMask(){ return m_szNetMask; }; - KviStr * property(const char * name){ return m_pPropertyDict->find(name); }; - // val must be allocated with NEW! - void setProperty(const char * name,KviStr * val){ m_pPropertyDict->replace(name,val); }; - void removeProperty(const char * name){ m_pPropertyDict->remove(name); }; -}; - -typedef KVILIB_API KviPointerList<KviRegisteredChannel> KviRegisteredChannelList; - -class KVILIB_API KviRegisteredChannelDataBase -{ -public: - KviRegisteredChannelDataBase(); - ~KviRegisteredChannelDataBase(); -protected: - KviPointerHashTable<const char *,KviRegisteredChannelList> * m_pChannelDict; -public: - KviPointerHashTable<const char *,KviRegisteredChannelList> * channelDict(){ return m_pChannelDict; }; - KviRegisteredChannel * find(const char * name,const char * net); - KviRegisteredChannel * findExact(const char * name,const char * netmask); - void remove(KviRegisteredChannel * c); - void add(KviRegisteredChannel * c); - void load(const char * filename); - void save(const char * filename); -}; - - -#endif //_KVI_REGCHAN_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_regusersdb.cpp b/3.4.0/src/kvilib/ext/kvi_regusersdb.cpp deleted file mode 100644 index 44c72ba606..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_regusersdb.cpp +++ /dev/null @@ -1,743 +0,0 @@ -//================================================================================================= -// -// File : kvi_regusersdb.cpp -// Creation date : Sat Sep 09 2000 15:46:12 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - -#include "kvi_debug.h" - -#define _KVI_REGUSERDB_CPP_ -#include "kvi_regusersdb.h" - -#include "kvi_config.h" -#include "kvi_locale.h" - -/* - @doc: registered_users - @title: - Registered users - @type: - generic - @short: - Registration of users in KVIrc - @keyterms: - registered users, registration mask, registered user properties, - user properties, notify property, avatar property - @body: - [big]Introduction[/big][br] - The "registered user database" is basically a set of users with associated - [doc:irc_masks]irc-masks[/doc] and properties.[br] - It is used to recognize users on IRC and associate properties to them.[br] - This works more or less like the IRC ban list, K-Line list, or invite list.[br] - [big]User entry[/big][br] - A registered user database entry is identified by an [b]unique[/b] name.[br] - It may be the nickname of the user that you want to match, or the real name (if you know it) - or any other string (even with spaces). The name is an "internal identifier" for the user entry: - each name maps to a single entry and each entry has a single name.[br] - Each entry has a set of registration [doc:irc_masks]irc-masks[/doc]: these masks - are used to recognize the user on irc.[br] - [br] - [big]Registration masks[/big][br] - The masks have the common IRC mask format: [b]<nick>!<user>@<host>[/b][br] - The masks may contain '*' and '?' wildcards that match any portion of text.[br] - [b]*!*@*[/b][br] - [b]Pragma!*@*[/b][br] - [b]*!~daemon@*[/b][br] - [b]Pragma!*daemon@*.it[/b][br] - [b]Pragma!?daemon@some*.it[/b][br] - [b]Pragma!~daemon@some.host.it[/b][br] - Are examples of valid registration masks.[br] - The masks with wildcards can actually match more than a single user.[br] - For example the mask *!root@*.host.com will match all the users - having root as username and coming from the host.com domain.[br] - For this reason putting wildcards in nicknames could become a problem - if not used carefully (but may also be used to achieve interesting tricks).[br] - If you don't use wildcards in nicknames you are sure that - in a single irc connection , a mask will always refer to a single user.[br] - You will commonly use the following format:[br] - <nick>!*<username>@*.<host>.<top>[br] - or[br] - <nick>!*<username>@<number>.<number>.<number>.*[br] - In this way you can be 95% sure that the mask will really match the correct user.[br] - [br] - [big]Example of registration and lookups[/big] - Assume that you want to registere a friend of yours: Derek Riggs.[br] - Derek often uses "Eddie" as his nickname - "stranger" as username and has a dial-up connection that makes his IP address appear as - <variable-number>.somewhere.in.time.org.[br] - You will add an entry with name "Derek Riggs" and a registration mask like the following: - Eddie!stranger@*.somewhere.in.time.org.[br] - If the IRC servers keep adding strange characters ([doc:irc_masks]prefixes[/doc]) at the beginning of his username you may use - Eddie!*stranger@*.somewhere.in.time.org.[br] - If Eddie also often connects from the wasted.years.org domain and gets 'eddie' as username there, you might add a second registration mask as follows: - Eddie!*eddie@*.wasted.years.org.[br] - An alternative could be use only one mask with *.org as domain and allow any username (Eddie!*@*.org) but this - could become dangerous since it could match the users that you don't want to.[br] - On the other hand, if you dislike the users with the nickname Eddie that come from .org - and you're implementing an auto-kick system, the correct mask to register is "Eddie!*@*.org".[br] - [br] - KVirc ties to be smart , and always find the most correct match for an user: - If you have two masks registered: Pragma!*xor@*.myisp.it and *!*@*.myisp.it, - kvirc will match Pragma!~xor@233-dyn.myisp.it with the first one even if the second - one matches too; the firs one is a best match.[br] - [br] - [big]Properties[/big][br] - A registered user has an (eventually empty) set of properties - defined by name/value pairs. (In versions prior to 3.0.0 flags were used instead, - but revealed to be insufficient).[br] - KVirc recognizes some of these proprietes and associates semantic actions to it; other properties - are left for scripting extension. Property names are case insensitive.[br] - One of the recognized properties is the "[doc:notify_list]notify[/doc]" property. - When an user is found to have this property set to a special value - KVIrc will attempt to track the user presence on IRC. - Another one is the [doc:avatar]avatar[/doc] property. Its value should be the - name of the "default" [doc:avatar]avatar image file[/doc] for the specified user.[br] - The "ignore" property should be set to "1" (or "true") for users that have to be ignored (:D).[br] - [br] - [big]The interface to the database[/big][br] - The [module:reguser]reguser module[/module] is the interface to the "registered users database".[br] - It provides a set of commands for adding and removing masks and manipulating properties.[br] -*/ - -//============================================================================================================ -// -// KviRegisteredMask -// - -KVILIB_API KviRegisteredUserDataBase* g_pRegisteredUserDataBase = 0; - -KviRegisteredMask::KviRegisteredMask(KviRegisteredUser * u,KviIrcMask * m) -{ - m_pUser = u; - m_pMask = m; - m_iMaskNonWildChars = m_pMask->nonWildChars(); -} - -//============================================================================================================ -// -// KviRegisteredUser -// - - -KviRegisteredUser::KviRegisteredUser(const QString & name) -{ - m_iIgnoreFlags =0; - m_bIgnoreEnabled=false; - m_szName = name; - m_pPropertyDict = 0; - m_pMaskList = new KviPointerList<KviIrcMask>; - m_pMaskList->setAutoDelete(true); -} - -KviRegisteredUser::~KviRegisteredUser() -{ - if(m_pPropertyDict)delete m_pPropertyDict; - delete m_pMaskList; -} - -bool KviRegisteredUser::isIgnoreEnabledFor(IgnoreFlags flag) -{ - if(!m_bIgnoreEnabled) return false; - return m_iIgnoreFlags & flag; -} - -KviIrcMask * KviRegisteredUser::findMask(const KviIrcMask &mask) -{ - for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next()) - { - if(*m == mask)return m; - } - return 0; -} - -bool KviRegisteredUser::addMask(KviIrcMask * mask) -{ - if(findMask(*mask)) - { - delete mask; - mask = 0; - return false; - } - m_pMaskList->append(mask); - return true; -} - -bool KviRegisteredUser::removeMask(KviIrcMask * mask) -{ - if(!mask)return false; - return m_pMaskList->removeRef(mask); -} - -bool KviRegisteredUser::matches(const KviIrcMask &mask) -{ - for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next()) - { - if(m->matches(mask))return true; - } - return false; -} - -bool KviRegisteredUser::matchesFixed(const KviIrcMask &mask) -{ - for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next()) - { - if(m->matchesFixed(mask))return true; - } - return false; -} - -bool KviRegisteredUser::matchesFixed(const QString & nick,const QString & user,const QString & host) -{ - for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next()) - { - if(m->matchesFixed(nick,user,host))return true; - } - return false; -} - -void KviRegisteredUser::setProperty(const QString &name,bool value) -{ - setProperty(name,value ? QString("true") : QString("false")); -} - -void KviRegisteredUser::setProperty(const QString & name,const QString & value) -{ - if(!value.isEmpty()) - { - if(!m_pPropertyDict) - { - m_pPropertyDict = new KviPointerHashTable<QString,QString>(7,false); - m_pPropertyDict->setAutoDelete(true); - } -#ifdef COMPILE_USE_QT4 - QString * val = new QString(value.trimmed()); -#else - QString * val = new QString(value.stripWhiteSpace()); -#endif - if(!val->isEmpty()) - { - m_pPropertyDict->replace(name,val); - } else { - delete val; - val = 0; - } - } else { - if(m_pPropertyDict)m_pPropertyDict->remove(name); - } -} - -bool KviRegisteredUser::getProperty(const QString & name,QString &value) -{ - if(!m_pPropertyDict)return false; - if(name.isEmpty()) return false; - QString * pValue = m_pPropertyDict->find(name); - if(pValue)value = *pValue; - else return false; - return true; -} - -const QString & KviRegisteredUser::getProperty(const QString & name) -{ - if(!m_pPropertyDict)return KviQString::empty; - if(name.isEmpty())return KviQString::empty; - QString * pValue = m_pPropertyDict->find(name); - if(pValue)return *pValue; - return KviQString::empty; -} - -bool KviRegisteredUser::getBoolProperty(const QString & name,bool def) -{ - if(!m_pPropertyDict)return def; - if(name.isEmpty()) return def; - QString * pValue = m_pPropertyDict->find(name); - if(pValue) - { - // be flexible , allow more "true" values (pragma) - if(KviQString::equalCS(*pValue,"1"))return true; - if(KviQString::equalCI(*pValue,"true"))return true; - if(KviQString::equalCI(*pValue,"yes"))return true; - //if(KviQString::equalCI(*pValue,"yeah"))return true; - //if(KviQString::equalCI(*pValue,"sure"))return true; - //if(KviQString::equalCI(*pValue,"sureashell"))return true; - } - return def; -} - -//============================================================================================================ -// -// KviRegisteredUserGroup -// - -KviRegisteredUserGroup::KviRegisteredUserGroup(const QString &name) -{ - setName(name); -} - -KviRegisteredUserGroup::~KviRegisteredUserGroup() -{ -} - - -//============================================================================================================ -// -// KviRegisteredUserDb -// - -KviRegisteredUserDataBase::KviRegisteredUserDataBase() -{ - m_pUserDict = new KviPointerHashTable<QString,KviRegisteredUser>(31,false); // do not copy keys - m_pUserDict->setAutoDelete(true); - - m_pWildMaskList = new KviRegisteredMaskList; - m_pWildMaskList->setAutoDelete(true); - - m_pMaskDict = new KviPointerHashTable<QString,KviRegisteredMaskList>(49,false); // copy keys here! - m_pMaskDict->setAutoDelete(true); - - m_pGroupDict = new KviPointerHashTable<QString,KviRegisteredUserGroup>(5,false); // copy keys here! - m_pGroupDict->setAutoDelete(true); -} - -KviRegisteredUserDataBase::~KviRegisteredUserDataBase() -{ - emit(databaseCleared()); - delete m_pUserDict; - delete m_pWildMaskList; - delete m_pMaskDict; - delete m_pGroupDict; -} - -KviRegisteredUser * KviRegisteredUserDataBase::addUser(const QString & name) -{ - if(name.isEmpty()) return false; - if(m_pUserDict->find(name))return 0; - KviRegisteredUser * u = new KviRegisteredUser(name); - m_pUserDict->replace(u->name(),u); //u->name() because we're NOT copying keys! - emit(userAdded(name)); - return u; -} - -KviRegisteredUserGroup * KviRegisteredUserDataBase::addGroup(const QString & name) -{ - if(name.isEmpty()) return false; - if(m_pGroupDict->find(name))return 0; - KviRegisteredUserGroup * pGroup = new KviRegisteredUserGroup(name); - m_pGroupDict->replace(pGroup->name(),pGroup); //u->name() because we're NOT copying keys! - return pGroup; -} - -KviRegisteredUser * KviRegisteredUserDataBase::getUser(const QString & name) -{ - if(name.isEmpty()) return 0; - KviRegisteredUser * u = m_pUserDict->find(name); - if(!u) - { - u = new KviRegisteredUser(name); - m_pUserDict->replace(u->name(),u); //u->name() because we're NOT copying keys! - } - return u; -} - -static void append_mask_to_list(KviRegisteredMaskList *l,KviRegisteredUser *u,KviIrcMask *mask) -{ - KviRegisteredMask * newMask = new KviRegisteredMask(u,mask); - int idx = 0; - for(KviRegisteredMask * m = l->first();m;m = l->next()) - { - if(m->nonWildChars() < newMask->nonWildChars()) - { - l->insert(idx,newMask); - return; - } - idx++; - } - l->append(newMask); -} - -KviRegisteredUser * KviRegisteredUserDataBase::addMask(KviRegisteredUser * u,KviIrcMask * mask) -{ - if(!u || !mask) return 0; - __range_valid(u == m_pUserDict->find(u->name())); - - KviRegisteredMaskList * l; - if(mask->hasWildNick()) - { - for(KviRegisteredMask * m = m_pWildMaskList->first();m;m = m_pWildMaskList->next()) - { - if(*(m->mask()) == *mask) - { - delete mask; - mask = 0; - return m->user(); - } - } - // not found ...ok... add it - // masks with more info go first in the list - l = m_pWildMaskList; - } else { - l = m_pMaskDict->find(mask->nick()); - if(l) - { - // FIXME: #warning "Here we could compare the host and username only: nick matches for sure" - for(KviRegisteredMask * m = l->first();m;m = l->next()) - { - if(*(m->mask()) == *mask) - { - delete mask; - mask = 0; - return m->user(); - } - } - // not found ...ok... add it - } else { - // not found ...ok... add it - // this is the first mask in the list - l = new KviRegisteredMaskList; - l->setAutoDelete(true); - if(!u->addMask(mask)) - { - debug(" Ops...got an incoherent regusers action...recovered ?"); - delete l; - l = 0; - } else { - append_mask_to_list(l,u,mask); - m_pMaskDict->insert(mask->nick(),l); - } - return 0; - } - } - // Ok...add it - if(!u->addMask(mask)) - { - debug("ops...got an incoherent regusers action...recovered ?"); - return 0; // ops...already there ? - } - append_mask_to_list(l,u,mask); - return 0; -} - -void KviRegisteredUserDataBase::copyFrom(KviRegisteredUserDataBase * db) -{ - m_pUserDict->clear(); - m_pWildMaskList->clear(); - m_pMaskDict->clear(); - m_pGroupDict->clear(); - emit(databaseCleared()); - - KviPointerHashTableIterator<QString,KviRegisteredUser> it(*(db->m_pUserDict)); - - while(KviRegisteredUser * theCur = it.current()) - { - KviRegisteredUser * u = getUser(theCur->name()); - // copy masks - KviPointerList<KviIrcMask> * l = theCur->maskList(); - for(KviIrcMask * m=l->first();m;m = l->next()) - { - KviIrcMask * m2 = new KviIrcMask(*m); - addMask(u,m2); - } - // copy properties - KviPointerHashTable<QString,QString> * pd = theCur->propertyDict(); - if(pd) - { - KviPointerHashTableIterator<QString,QString> pdi(*pd); - while(pdi.current()) - { - u->setProperty(pdi.currentKey(),*(pdi.current())); - ++pdi; - } - } - u->m_iIgnoreFlags=theCur->m_iIgnoreFlags; - u->m_bIgnoreEnabled=theCur->m_bIgnoreEnabled; - u->setGroup(theCur->group()); - ++it; - } - - KviPointerHashTableIterator<QString,KviRegisteredUserGroup> git(*db->m_pGroupDict); - while(git.current()) - { - addGroup(git.currentKey()); - ++git; - } -} - - -bool KviRegisteredUserDataBase::removeUser(const QString & name) -{ - if(name.isEmpty()) return false; - KviRegisteredUser * u = m_pUserDict->find(name); - if(!u)return false; - while(KviIrcMask * mask = u->maskList()->first()) - { - if(!removeMaskByPointer(mask)) - debug("Ops... removeMaskByPointer(%s) failed ?",KviQString::toUtf8(name).data()); - } - emit(userRemoved(name)); - m_pUserDict->remove(name); - return true; -} -bool KviRegisteredUserDataBase::removeGroup(const QString & name) -{ - if(name.isEmpty()) return false; - m_pGroupDict->remove(name); - return true; -} - -bool KviRegisteredUserDataBase::removeMask(const KviIrcMask &mask) -{ - // find the mask pointer - KviRegisteredMask * m = findExactMask(mask); - // and remove it - if(m){ - if(removeMaskByPointer(m->mask())) - { - return true; - } - } - return 0; -} - -bool KviRegisteredUserDataBase::removeMaskByPointer(KviIrcMask * mask) -{ - if(!mask) return 0; - if(mask->hasWildNick()) - { - // remove from the wild list - for(KviRegisteredMask * m = m_pWildMaskList->first();m;m = m_pWildMaskList->next()) - { - if(m->mask() == mask) - { - // ok..got it, remove from the list and from the user struct (user struct deletes it!) - emit(userChanged(mask->nick())); - m->user()->removeMask(mask); // this one deletes m->mask() - m_pWildMaskList->removeRef(m); // this one deletes m - return true; - } - } - // not found ...opz :) - } else { - KviRegisteredMaskList * l = m_pMaskDict->find(mask->nick()); - if(l) - { - // FIXME: #warning "Here we could compare the host and username only: nick matches for sure" - for(KviRegisteredMask * m = l->first();m;m = l->next()) - { - if(m->mask() == mask) - { - QString nick = mask->nick(); - emit(userChanged(nick)); - m->user()->removeMask(mask); // this one deletes m->mask() (or mask) - l->removeRef(m); // this one deletes m - if(l->count() == 0)m_pMaskDict->remove(nick); - return true; - } - } - // not found ...opz - } - } - // not found... - return false; -} - - - -/* -KviRegisteredUser * KviRegisteredUserDataBase::findMatchingUser(const KviIrcMask &mask) -{ - // first lookup the nickname in the maskDict - KviRegisteredMaskList * l = m_pMaskDict->find(mask.nick()); - if(l) - { - for(KviRegisteredMask *m = l->first();m;m = l->next()) - { - if(m->mask()->matchesFixed(0,mask.user(),mask.host()))return m->user(); - } - } - // not found....lookup the wild ones - for(KviRegisteredMask * m = m_pWildMaskList->first();m;m = m_pWildMaskList->next()) - { - if(m->mask()->matchesFixed(mask))return m->user(); - } - return 0; // no match at all -} -*/ -KviRegisteredUser * KviRegisteredUserDataBase::findMatchingUser(const QString & nick,const QString &user,const QString & host) -{ - KviRegisteredMask * m = findMatchingMask(nick,user,host); - if(m)return m->user(); - return 0; // no match at all -} - -KviRegisteredMask * KviRegisteredUserDataBase::findMatchingMask(const QString & nick,const QString &user,const QString & host) -{ - // first lookup the nickname in the maskDict - if(nick.isEmpty()) return false; - KviRegisteredMaskList * l = m_pMaskDict->find(nick); - if(l) - { - for(KviRegisteredMask *m = l->first();m;m = l->next()) - { - if(m->mask()->matchesFixed(nick,user,host))return m; - } - } - // not found....lookup the wild ones - for(KviRegisteredMask * m = m_pWildMaskList->first();m;m = m_pWildMaskList->next()) - { - if(m->mask()->matchesFixed(nick,user,host))return m; - } - return 0; // no match at all -} - -KviRegisteredUser * KviRegisteredUserDataBase::findUserWithMask(const KviIrcMask &mask) -{ - KviRegisteredMask * m = findExactMask(mask); - if(m)return m->user(); - return 0; -} - -KviRegisteredMask * KviRegisteredUserDataBase::findExactMask(const KviIrcMask &mask) -{ - // first lookup the nickname in the maskDict - if(mask.nick()=="") return 0; - KviRegisteredMaskList * l = m_pMaskDict->find(mask.nick()); - if(l) - { - for(KviRegisteredMask *m = l->first();m;m = l->next()) - { - if(*(m->mask()) == mask)return m; - } - } - // not found....lookup the wild ones - for(KviRegisteredMask * m = m_pWildMaskList->first();m;m = m_pWildMaskList->next()) - { - if(*(m->mask()) == mask)return m; - } - return 0; // no match at all -} -/* -bool KviRegisteredUserDataBase::isIgnoredUser(const QString & nick,const QString & user,const QString & host) -{ - KviRegisteredUser * u = findMatchingUser(nick,user,host); - if(u)return u->getBoolProperty("IGNORE"); - else return false; -} -*/ -void KviRegisteredUserDataBase::load(const QString & filename) -{ - QString szCurrent; - KviConfig cfg(filename,KviConfig::Read); - - KviConfigIterator it(*cfg.dict()); - while(it.current()) - { - cfg.setGroup(it.currentKey()); - szCurrent=it.currentKey(); - if(KviQString::equalCSN("#Group ",szCurrent,7)) - { - szCurrent.remove(0,7); - addGroup(szCurrent); - } else { - KviRegisteredUser * u = addUser(szCurrent); - - if(u) - { - u->setIgnoreEnabled(cfg.readBoolEntry("IgnoreEnabled",false)); - u->setIgnoreFlags(cfg.readIntEntry("IgnoreFlags",0)); - KviConfigGroupIterator sdi(*(it.current())); - while(sdi.current()) - { - QString tmp = sdi.currentKey(); - if(KviQString::equalCSN("prop_",tmp,5)) - { - tmp.remove(0,5); - u->setProperty(tmp,*(sdi.current())); - } else if(KviQString::equalCSN("mask_",tmp,5)) - { - KviIrcMask * mask = new KviIrcMask(*(sdi.current())); - addMask(u,mask); - } else if(KviQString::equalCI(tmp,"Group")) - { - u->setGroup(*(sdi.current())); - } - ++sdi; - } - } - } - ++it; - } - if(!m_pGroupDict->find(__tr("Default"))) - addGroup(__tr("Default")); -} - - -void KviRegisteredUserDataBase::save(const QString & filename) -{ - KviConfig cfg(filename,KviConfig::Write); - cfg.clear(); - cfg.preserveEmptyGroups(true); - - KviPointerHashTableIterator<QString,KviRegisteredUser> it(*m_pUserDict); - - while(it.current()) - { - cfg.setGroup(it.current()->name()); - // Write properties - cfg.writeEntry("IgnoreEnabled",it.current()->ignoreEnagled()); - cfg.writeEntry("IgnoreFlags",it.current()->ignoreFlags()); - if(it.current()->propertyDict()) - { - KviPointerHashTableIterator<QString,QString> pit(*(it.current()->propertyDict())); - while(pit.current()) - { - QString tmp = "prop_"; - tmp.append(pit.currentKey()); - cfg.writeEntry(tmp,*(pit.current())); - ++pit; - } - } - // Write masks - int idx = 0; - for(KviIrcMask * m = it.current()->maskList()->first();m;m = it.current()->maskList()->next()) - { - QString tmp; - KviQString::sprintf(tmp,"mask_%d",idx); - QString mask; - m->mask(mask,KviIrcMask::NickUserHost); - cfg.writeEntry(tmp,mask); - ++idx; - } - cfg.writeEntry("Group",it.current()->group()); - ++it; - } - - KviPointerHashTableIterator<QString,KviRegisteredUserGroup> git(*m_pGroupDict); - QString szTmp; - while(git.current()) - { - KviQString::sprintf(szTmp,"#Group %Q",&(git.current()->name())); - cfg.setGroup(szTmp); - ++git; - } - -} diff --git a/3.4.0/src/kvilib/ext/kvi_regusersdb.h b/3.4.0/src/kvilib/ext/kvi_regusersdb.h deleted file mode 100644 index 7773dc1361..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_regusersdb.h +++ /dev/null @@ -1,201 +0,0 @@ -#ifndef _KVI_REGUSERSDB_H_ -#define _KVI_REGUSERSDB_H_ -//================================================================================================= -// -// File : kvi_regusersdb.h -// Creation date : Sat Sep 09 2000 15:30:56 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//================================================================================================= - -// -// REGISTERED USERS -// -// Here we manage users resigered by mask and their (generic!) properties -// - -#include "kvi_settings.h" -#include "kvi_heapobject.h" -#include "kvi_qstring.h" -#include "kvi_ircmask.h" -#include "kvi_debug.h" - -#include "kvi_pointerlist.h" -#include "kvi_pointerhashtable.h" -#include <qobject.h> - -class KviRegisteredUserDataBase; - -#ifndef _KVI_REGUSERDB_CPP_ - extern KVILIB_API KviRegisteredUserDataBase * g_pRegisteredUserDataBase; -#endif //!_KVI_REGUSERDB_CPP_ - -//================================================================================================= -// -// KviRegisteredUser -// - -class KVILIB_API KviRegisteredUser : public KviHeapObject -{ - friend class KviRegisteredUserDataBase; -public: - enum IgnoreFlags { - Channel=1, - Query=2, - Notice=4, - Ctcp=8, - Invite=16, - Dcc=32 - }; - - KviRegisteredUser(const QString &name); - ~KviRegisteredUser(); -private: - int m_iIgnoreFlags; - bool m_bIgnoreEnabled; - QString m_szName; - QString m_szGroup; - KviPointerHashTable<QString,QString> * m_pPropertyDict; // owned properties - KviPointerList<KviIrcMask> * m_pMaskList; // owned masks -protected: - // mask ownership is transferred! (always!) returns false if the mask was already there - bool addMask(KviIrcMask * mask); - bool removeMask(KviIrcMask * mask); - KviIrcMask * findMask(const KviIrcMask &mask); -public: - int ignoreFlags() { return m_iIgnoreFlags; }; - void setIgnoreFlags(int flags) {m_iIgnoreFlags=flags; }; - bool ignoreEnagled() { return m_bIgnoreEnabled; }; - void setIgnoreEnabled(bool enabled) {m_bIgnoreEnabled=enabled;}; - bool isIgnoreEnabledFor(IgnoreFlags flag); - - const QString &name(){ return m_szName; }; - bool matches(const KviIrcMask &mask); - bool matchesFixed(const KviIrcMask &mask); - bool matchesFixed(const QString &nick,const QString &user,const QString &host); - - void setProperty(const QString &name,const QString &value); - void setProperty(const QString &name,bool value); - - void setGroup(const QString &name) { m_szGroup=name; }; - const QString &group(){ return m_szGroup; }; - - const QString & getProperty(const QString &name); // returns 0 if the property is not there - bool getProperty(const QString &name,QString &value); // returns false if the property is not there - bool getBoolProperty(const QString &name,bool def=FALSE); // returns true if the property is there and is true - // the propertyDict may be 0! - KviPointerHashTable<QString,QString> * propertyDict(){ return m_pPropertyDict; }; - // this is never zero (but may contain no masks) - KviPointerList<KviIrcMask> * maskList(){ return m_pMaskList; }; -}; - -//============================================================================================================ -// -// KviRegisteredUserGroup -// - -class KVILIB_API KviRegisteredUserGroup : public KviHeapObject -{ - friend class KviRegisteredUserDataBase; -public: - KviRegisteredUserGroup(const QString &name); - ~KviRegisteredUserGroup(); - - void setName(const QString &name) { m_szName=name; }; - const QString &name(){ return m_szName; }; -private: - QString m_szName; -}; -//============================================================================================================ -// -// KviRegisteredMask -// - -class KVILIB_API KviRegisteredMask -{ -private: - KviRegisteredUser * m_pUser; // pointer , not owned! - KviIrcMask * m_pMask; // pointer , not owned! - int m_iMaskNonWildChars; -public: - KviRegisteredMask(KviRegisteredUser * u,KviIrcMask * m); - ~KviRegisteredMask(){}; -public: - int nonWildChars(){ return m_iMaskNonWildChars; }; - KviRegisteredUser * user(){ return m_pUser; }; - KviIrcMask * mask(){ return m_pMask; }; -}; - -typedef KviPointerList<KviRegisteredMask> KviRegisteredMaskList; - -//================================================================================================= -// -// KviRegisteredUsersDb -// -// Manages a set of KviRegisteredUser instances stored in the m_pUserDict dictionary -// The users are identified by masks stored in m_pMaskDict and m_pWildMaskList -// m_pMaskDict contains lists of non wild-nick KviRegisteredMask that point to users -// m_pWildMaskList is a list of wild-nick KviRegisteredMask that point to users -// - -class KVILIB_API KviRegisteredUserDataBase : public QObject -{ - Q_OBJECT -public: - KviRegisteredUserDataBase(); - ~KviRegisteredUserDataBase(); -private: - KviPointerHashTable<QString,KviRegisteredUser> * m_pUserDict; // unique namespace, owns the objects, does not copy keys - KviPointerHashTable<QString,KviRegisteredMaskList> * m_pMaskDict; // owns the objects, copies the keys - KviRegisteredMaskList * m_pWildMaskList; // owns the objects - KviPointerHashTable<QString,KviRegisteredUserGroup>* m_pGroupDict; -public: - void copyFrom(KviRegisteredUserDataBase * db); - KviRegisteredUser * addUser(const QString &name); // returns 0 if already there - KviRegisteredUser * getUser(const QString &name); // returns existing or adds - bool removeUser(const QString &name); - bool removeGroup(const QString &name); - KviRegisteredUser * findUserByName(const QString &name){ return m_pUserDict->find(name); }; - // mask must be allocated on the heap and the ownership is transferred! - // returns non zero if there is already an user with this mask (returns the pointer to it!) - KviRegisteredUser * addMask(KviRegisteredUser * u,KviIrcMask * mask); - bool removeMaskByPointer(KviIrcMask * mask); - bool removeMask(const KviIrcMask &mask); - KviRegisteredUser * findMatchingUser(const QString &nick,const QString &user,const QString &host); - KviRegisteredUser * findUserWithMask(const KviIrcMask &mask); - KviRegisteredMask * findExactMask(const KviIrcMask &mask); - KviRegisteredMask * findMatchingMask(const QString &nick,const QString &user,const QString &host); - //Only used in few places (actually one) of the code, but lot of times;perfect for inlining... - //bool isIgnoredUser(const char * nick,const char * user,const char * host); - void load(const QString &filename); - void save(const QString &filename); - - KviPointerHashTable<QString,KviRegisteredUser> * userDict(){ return m_pUserDict; }; - KviPointerHashTable<QString,KviRegisteredUserGroup>* groupDict() { return m_pGroupDict; }; - - KviRegisteredUserGroup* addGroup(const QString &name); -signals: - void userRemoved(const QString&); - void userChanged(const QString&); - void userAdded (const QString&); - void databaseCleared(); -}; - - -#endif //_KVI_REGUSERSDB_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_sharedfiles.cpp b/3.4.0/src/kvilib/ext/kvi_sharedfiles.cpp deleted file mode 100644 index dcb9464ecc..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_sharedfiles.cpp +++ /dev/null @@ -1,391 +0,0 @@ -//============================================================================= -// -// File : kvi_filetrader.cpp -// Creation date : Wed Aug 27 2000 10:33:11 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_sharedfiles.h" - -#include "kvi_config.h" -#include "kvi_fileutils.h" - -#include <qfileinfo.h> - -// TODO: Match servers that the file requests come from -// TODO: Max number of downloads ? - -// FIXME: MD5SUM ? - -/* - @doc: shared_files - @title: - Sharing files with KVIrc - @type: - generic - @short: - Automatically sharing your files with other IRC users - @keyterms: - file sharing - @body: - [big]What is this ?[/big] - The "file offers" are a simple way to share your files with other IRC users.[br] - Basically , you setup an offer by selecting a local file, choosing a "visible name" for it. - Remote users will be able to request you the file and download it automatically by - issuing a simple DCC GET request.[br] - [big]Details[/big] - Each offer refers to an existing file on one of your locally mounted file systems. - The offer is given a visible name that the remote users will effectively request. - To share the file /usr/arch/mp3/SonataArctica_SingInSilence_Live.mp3 you will add a file offer - with /usr/arch/mp3/SonataArctica_SingInSilence_Live.mp3 as real file path , something like - "SonataArctica_SingInSilence.mp3". A remote user will then request you a DCC GET SonataArctica_SingInSilence.mp3 - and KVIrc will automatically send the file.[br] - Each file offer has an "user mask" that the requesting remote users must match to - obtain the file: *!*@* matches any user, Pragma!*@* matches any user with nickname pragma, - *!*@*.omnikron.net matches any user coming from the omnikron.net domain.[br] - Each offer can have an expire time: the offer will be automatically removed after - a defined number of seconds. An expire time of '0' seconds means that the offer should never expire.[br] - If you have two file offers with the same name and different file, the remote user can - use an additional "size" parameter in the DCC GET request.[br] - [big]Security issues[/big] - This is a nice but unsecure method of sharing files.[br] - The user mask is a good protection but you have to use it properly!.[br] - Setting the user mask to Nick!*@* can be easily exploited (just by making an user disconnect - in one of the well known ways and then by using his nickname).[br] - On the other side, the remote end must know exactly the visible name of the offer to request - and noone but you will tell him that name.[br] - In sum:[br] - Don't share any really important files: this *might* be like putting it on your webpage :D[br] - Please don't send complains if someone stoles your /etc/passwd : it is because you have permitted that.[br] -*/ - -KviSharedFile::KviSharedFile(const QString &szName,const QString &szAbsPath,const QString &szUserMask,time_t expireTime,unsigned int uFileSize) -{ - m_szName = szName; - m_szAbsFilePath = szAbsPath; - m_szUserMask = szUserMask; - m_expireTime = expireTime; - m_uFileSize = uFileSize; -#ifdef COMPILE_USE_QT4 - // QT4ROX: Because they have finally moved the functionality of QString::contains() to QString::count(), and QString::contains() now does the right job - m_uWildCount = m_szUserMask.count('*'); -#else - m_uWildCount = m_szUserMask.contains('*'); -#endif - m_uNonWildCount = m_szUserMask.length() - m_uWildCount; -} - -KviSharedFile::~KviSharedFile() -{ -} - - -KviSharedFilesManager::KviSharedFilesManager() -: QObject() -{ - m_pSharedListDict = new KviPointerHashTable<QString,KviSharedFileList>(); - m_pSharedListDict->setAutoDelete(true); - m_pCleanupTimer = new QTimer(); - connect(m_pCleanupTimer,SIGNAL(timeout()),this,SLOT(cleanup())); -} - -KviSharedFilesManager::~KviSharedFilesManager() -{ - if(m_pCleanupTimer->isActive())m_pCleanupTimer->stop(); - delete m_pCleanupTimer; - delete m_pSharedListDict; -} - -void KviSharedFilesManager::cleanup() -{ - KviPointerHashTableIterator<QString,KviSharedFileList> it(*m_pSharedListDict); - time_t curTime = time(0); - - bool bOtherStuffToCleanup = false; - //bool bChanged = false; - - KviPointerList<QString> lDying; - lDying.setAutoDelete(true); - - while(KviSharedFileList * l = it.current()) - { - KviPointerList<KviSharedFile> tmp; - tmp.setAutoDelete(false); - for(KviSharedFile * o = l->first();o;o = l->next()) - { - if(o->expireTime() > 0) - { - if(((int)o->expireTime()) <= ((int)curTime)) - { - tmp.append(o); - //bChanged = true; - } else { - bOtherStuffToCleanup = true; - } - } - } - for(KviSharedFile * fo = tmp.first();fo;fo = tmp.next()) - { - l->removeRef(fo); - emit sharedFileRemoved(fo); - } - if(l->count() == 0) - lDying.append(new QString(it.currentKey())); - - ++it; - } - - for(QString * pDyingKey = lDying.first();pDyingKey;pDyingKey = lDying.next()) - m_pSharedListDict->remove(*pDyingKey); - - if(!bOtherStuffToCleanup)m_pCleanupTimer->stop(); - //if(bChanged)emit sharedFilesChanged(); -} - -void KviSharedFilesManager::clear() -{ - m_pSharedListDict->clear(); - emit sharedFilesChanged(); -} - -void KviSharedFilesManager::doInsert(KviSharedFileList * l, KviSharedFile * o) -{ - int index = 0; - for(KviSharedFile * fo =l->first();fo;fo = l->next()) - { - if(o->wildcardCount() > 0) - { - // the new mask has wildcards... if the current one has none, skip it - if(fo->wildcardCount() > 0) - { - // the one in the list has wildcards too... - // the ones with more non-wild chars go first... - if(fo->nonWildcardCount() < o->nonWildcardCount()) - { - // ok...the new one has more non-wildcards , insert - l->insert(index,o); - return; - } else { - if(o->nonWildcardCount() == fo->nonWildcardCount()) - { - // the same number of non-wildcards - // let the number of wildcards decide (it will be eventually equal) - if(o->wildcardCount() < fo->wildcardCount()) - { - // the new one has less wildcards... goes first - l->insert(index,o); - return; - } // else the same number of wildcards and non-wildcards...skip - } // else the existing one has more non-wildcards...skip - } - } // else the current has no wildcards...skip - } else { - // the new mask has no wildcards.... - if(fo->wildcardCount() > 0) - { - // current one has wildcards...insert - l->insert(index,o); - return; - } - // the current one has no wildcards... - // the longer masks go first.... - if(fo->maskLength() < o->maskLength()) - { - // the current one is shorter than the new one...insert - l->insert(index,o); - return; - } // else current one is longer...skip - } - index++; - } - l->append(o); -} - -void KviSharedFilesManager::addSharedFile(KviSharedFile * f) -{ - // First find the list - KviSharedFileList * l = m_pSharedListDict->find(f->name()); - if(!l) - { - l = new KviSharedFileList; - l->setAutoDelete(true); - m_pSharedListDict->replace(f->name(),l); - } - - doInsert(l,f); - - if(((int)f->expireTime()) > 0) - { - if(!m_pCleanupTimer->isActive())m_pCleanupTimer->start(60000); - } - - emit sharedFileAdded(f); -} - -KviSharedFile * KviSharedFilesManager::addSharedFile(const QString &szName,const QString &szAbsPath,const QString &szMask,int timeoutInSecs) -{ - QFileInfo inf(szAbsPath); - if(inf.exists() && inf.isFile() && inf.isReadable() && (inf.size() > 0)) - { - // First find the list - KviSharedFileList * l = m_pSharedListDict->find(szName); - if(!l) - { - l = new KviSharedFileList; - l->setAutoDelete(true); - m_pSharedListDict->replace(szName,l); - } - - // Now insert - KviSharedFile * o = new KviSharedFile(szName,szAbsPath,szMask,timeoutInSecs > 0 ? (((int)(time(0))) + timeoutInSecs) : 0,inf.size()); - - doInsert(l,o); - - if(((int)o->expireTime()) > 0) - { - if(!m_pCleanupTimer->isActive())m_pCleanupTimer->start(60000); - } - - emit sharedFileAdded(o); - - return o; - } else { - debug("File %s unreadable: can't add offer",KviQString::toUtf8(szAbsPath).data()); - return 0; - } -} - -KviSharedFile * KviSharedFilesManager::lookupSharedFile(const QString &szName,KviIrcMask * mask,unsigned int uFileSize) -{ - KviSharedFileList * l = m_pSharedListDict->find(szName); - if(!l)return 0; - - for(KviSharedFile * o = l->first();o;o = l->next()) - { - bool bMatch; - if(mask) - { - KviIrcMask umask(o->userMask()); - bMatch = mask->matchedBy(umask); - } else bMatch = KviQString::equalCS(o->userMask(),"*!*@*"); - if(bMatch) - { - if(uFileSize > 0) - { - if(uFileSize == o->fileSize())return o; - } else return o; - } - } - - return 0; -} -bool KviSharedFilesManager::removeSharedFile(const QString &szName,const QString &szMask,unsigned int uFileSize) -{ - KviSharedFileList * l = m_pSharedListDict->find(szName); - if(!l)return false; - for(KviSharedFile * o = l->first();o;o = l->next()) - { - if(KviQString::equalCI(szMask,o->userMask())) - { - bool bMatch = uFileSize > 0 ? uFileSize == o->fileSize() : true; - if(bMatch) - { - QString save = szName; // <-- szName MAY Be a pointer to o->name() - l->removeRef(o); - if(l->count() == 0)m_pSharedListDict->remove(save); - emit sharedFileRemoved(o); - return true; - } - } - } - return false; -} - -bool KviSharedFilesManager::removeSharedFile(const QString &szName,KviSharedFile * off) -{ - KviSharedFileList * l = m_pSharedListDict->find(szName); - if(!l)return false; - for(KviSharedFile * o = l->first();o;o = l->next()) - { - if(off == o) - { - QString save = szName; // <-- szName MAY Be a pointer to o->name() - l->removeRef(o); - if(l->count() == 0)m_pSharedListDict->remove(save); - emit sharedFileRemoved(off); - return true; - } - } - return false; -} - - -void KviSharedFilesManager::load(const QString &filename) -{ - KviConfig cfg(filename,KviConfig::Read); - //cfg.clear(); - cfg.setGroup("PermanentFileOffers"); - int num = cfg.readIntEntry("NEntries",0); - for(int idx=0;idx<num;idx++) - { - QString tmp; - KviQString::sprintf(tmp,"%dFName",idx); - QString szName = cfg.readQStringEntry(tmp,""); - KviQString::sprintf(tmp,"%dFilePath",idx); - QString szPath = cfg.readQStringEntry(tmp,""); - KviQString::sprintf(tmp,"%dUserMask",idx); - QString szMask = cfg.readQStringEntry(tmp,""); - if(!szMask.isEmpty() && !szPath.isEmpty() && !szName.isEmpty()) - addSharedFile(szName,szPath,szMask,0); - } -} - -void KviSharedFilesManager::save(const QString &filename) -{ - KviConfig cfg(filename,KviConfig::Write); - cfg.clear(); - cfg.setGroup("PermanentFileOffers"); - - KviPointerHashTableIterator<QString,KviSharedFileList> it(*m_pSharedListDict); - int idx = 0; - while(KviSharedFileList * l = it.current()) - { - for(KviSharedFile * o = l->first();o;o = l->next()) - { - if(((int)(o->expireTime())) == 0) - { - QString tmp; - KviQString::sprintf(tmp,"%dFName",idx); - cfg.writeEntry(tmp,it.currentKey()); - KviQString::sprintf(tmp,"%dFilePath",idx); - cfg.writeEntry(tmp,o->absFilePath()); - KviQString::sprintf(tmp,"%dUserMask",idx); - cfg.writeEntry(tmp,o->userMask()); - ++idx; - } - } - ++it; - } - cfg.writeEntry("NEntries",idx); -} - diff --git a/3.4.0/src/kvilib/ext/kvi_sharedfiles.h b/3.4.0/src/kvilib/ext/kvi_sharedfiles.h deleted file mode 100644 index c01a584261..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_sharedfiles.h +++ /dev/null @@ -1,133 +0,0 @@ -#ifndef _KVI_FILETRADER_H_ -#define _KVI_FILETRADER_H_ -//============================================================================= -// -// File : kvi_filetrader.h -// Creation date : Wed Aug 27 2000 10:28:51 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_heapobject.h" -#include "kvi_string.h" -#include "kvi_ircmask.h" -#include "kvi_pointerlist.h" -#include "kvi_qstring.h" - -#include "kvi_pointerhashtable.h" - -#include <time.h> -#include <qtimer.h> - - -class KVILIB_API KviSharedFile : public KviHeapObject -{ -public: - KviSharedFile(const QString &szName,const QString &szAbsPath,const QString &szUserMask,time_t expireTime,unsigned int uFileSize); - ~KviSharedFile(); -private: - QString m_szName; - QString m_szAbsFilePath; - time_t m_expireTime; - QString m_szUserMask; - unsigned int m_uFileSize; - unsigned int m_uWildCount; - unsigned int m_uNonWildCount; -public: - const QString &name(){ return m_szName; }; - - const QString &absFilePath(){ return m_szAbsFilePath; }; - - const QString &userMask(){ return m_szUserMask; }; - - time_t expireTime(){ return m_expireTime; }; - bool expires(){ return (m_expireTime != 0); }; - - unsigned int fileSize(){ return m_uFileSize; }; - - unsigned int wildcardCount(){ return m_uWildCount; }; - unsigned int nonWildcardCount(){ return m_uNonWildCount; }; - int maskLength(){ return m_szUserMask.length(); }; -}; - - -typedef KviPointerList<KviSharedFile> KviSharedFileList; - - -class KVILIB_API KviSharedFilesManager : public QObject -{ - Q_OBJECT -public: - KviSharedFilesManager(); - ~KviSharedFilesManager(); -private: - QTimer * m_pCleanupTimer; - KviPointerHashTable<QString,KviSharedFileList> * m_pSharedListDict; -public: - void addSharedFile(KviSharedFile * f); - KviSharedFile * addSharedFile(const QString &szName,const QString &szAbsPath,const QString &szMask,int timeoutInSecs); - KviSharedFile * lookupSharedFile(const QString &szName,KviIrcMask * mask,unsigned int uFileSize = 0); - bool removeSharedFile(const QString &szName,const QString &szMask,unsigned int uFileSize); - bool removeSharedFile(const QString &szName,KviSharedFile * off); - void load(const QString &filename); - void save(const QString &filename); - void clear(); - KviPointerHashTable<QString,KviSharedFileList> * sharedFileListDict(){ return m_pSharedListDict; }; -private: - void doInsert(KviSharedFileList * l, KviSharedFile * o); -private slots: - void cleanup(); -signals: - void sharedFilesChanged(); // emitted when the list is cleared at once - void sharedFileAdded(KviSharedFile * f); - void sharedFileRemoved(KviSharedFile * f); -}; - - -/* -class KviSharedFile -{ - KviSharedFile(); - KviSharedFile(const KviStr &filePath,const KviStr &userMask); - ~KviSharedFile(); -protected: - KviStr m_szFilePath; - KviStr m_szVisibleName; - KviStr m_szMd5Sum; - KviStr m_szUserMask; - unsigned short int m_uWildCount; - unsigned short int m_uNonWildCount; - - unsigned int m_uFileSize; - time_t m_tExpireTime; -public: - void setFilePath(const KviStr &filePath); - void setUserMask(const KviStr &userMask); - void setVisibleName(const KviStr &visibleName); - void setMd5Sum(const KviStr &md5Sum); - void setFileSize(unsigned int uFileSize); - void setExpireTime(time_t expireTime); - void doNotExpire(){ setExpireTime((time_t)0); }; - - void computeMd5Sum(); -}; -*/ - -#endif //_KVI_FILETRADER_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_stringconversion.cpp b/3.4.0/src/kvilib/ext/kvi_stringconversion.cpp deleted file mode 100644 index 7b6cc299a0..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_stringconversion.cpp +++ /dev/null @@ -1,277 +0,0 @@ -//============================================================================= -// -// File : kvi_stringconversion.cpp -// Creation date : Thu Oct 20 2000 14:12:21 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#define _KVI_STRINGCONVERSION_CPP_ -#include "kvi_stringconversion.h" - -#include "kvi_qstring.h" -#include <stdio.h> - -QString g_szGlobalDir; -QString g_szLocalDir; - -namespace KviStringConversion -{ - - void init(const QString& szGlobalDir,const QString& szLocalDir) - { - g_szGlobalDir=szGlobalDir; - g_szLocalDir=szLocalDir; - } - - void encodePath(QString& buffer) - { - if(!buffer.isEmpty()) - { - if(!g_szLocalDir.isEmpty()) - { - if(KviQString::find(buffer,g_szLocalDir)==0) - { - buffer.remove(0,g_szLocalDir.length()); - buffer.prepend("local://"); - } - } - if(!g_szGlobalDir.isEmpty()) - { - if(KviQString::find(buffer,g_szGlobalDir)==0) - { - buffer.remove(0,g_szGlobalDir.length()); - buffer.prepend("global://"); - } - } - } - } - - void decodePath(QString& buffer) - { - if(!buffer.isEmpty()) - { - if(!g_szLocalDir.isEmpty()) - { - if(KviQString::find(buffer,"local://")==0) - { - buffer.remove(0,8); - buffer.prepend(g_szLocalDir); - } - } - if(!g_szGlobalDir.isEmpty()) - { - if(KviQString::find(buffer,"global://")==0) - { - buffer.remove(0,9); - buffer.prepend(g_szGlobalDir); - } - } - } - } - - void encodePath(QStringList& buffer) - { - for ( QStringList::Iterator it = buffer.begin(); it != buffer.end(); ++it ) - { - encodePath(*it); - } - } - - void decodePath(QStringList& buffer) - { - for ( QStringList::Iterator it = buffer.begin(); it != buffer.end(); ++it ) - { - decodePath(*it); - } - } - - void toString(const bool bValue,QString &buffer) - { - buffer = bValue ? '1' : '0'; - } - - bool fromString(const QString & szValue,bool &buffer) - { - if(szValue.isEmpty())buffer = false; - else buffer = !((KviQString::equalCS(szValue,"0")) || (KviQString::equalCI(szValue,"false"))); - return true; - } - - void toString(const int iValue,QString &buffer) - { - buffer.setNum(iValue); - } - - bool fromString(const QString &szValue,int &buffer) - { - bool bOk; - buffer = szValue.toInt(&bOk); - return bOk; - } - - void toString(const unsigned int uValue,QString &buffer) - { - buffer.setNum(uValue); - } - - bool fromString(const QString & szValue,unsigned int &buffer) - { - bool bOk; - buffer= szValue.toUInt(&bOk); - return bOk; - } - - void toString(const QRect &rValue,QString &buffer) - { - buffer.sprintf("%d,%d,%d,%d",rValue.x(),rValue.y(),rValue.width(),rValue.height()); - } - - bool fromString(const QString & szValue,QRect &buffer) - { - KviQCString tmp = KviQString::toUtf8(szValue); - const char * c = tmp.data(); - if(!c)return false; - int l,t,w,h; - if(sscanf(c,"%d,%d,%d,%d",&l,&t,&w,&h) != 4)return false; - buffer.setRect(l,t,w,h); - return true; - } - - void toString(const QString &szValue,QString &buffer) - { - buffer = szValue; - } - - bool fromString(const QString & szValue,QString &buffer) - { - buffer = szValue; - return true; - } - - void toString(const KviPixmap &pValue,QString &buffer) - { - buffer=pValue.path(); - encodePath(buffer); - } - - bool fromString(const QString & szValue,KviPixmap &buffer) - { - QString szPath(szValue); - decodePath(szPath); - if(szPath.isEmpty()) { - buffer.setNull(); - return true; - } else { - return buffer.load(szPath); - } - } - - void toString(const KviMsgType &mValue,QString &buffer) - { - buffer.sprintf("%d,%u,%u,%d,%d",mValue.m_iPixId,mValue.m_cForeColor,mValue.m_cBackColor,mValue.m_bLogEnabled,mValue.m_iLevel); - } - - bool fromString(const QString & szValue,KviMsgType &buffer) - { - int iId,iLog,iLevel; - unsigned int uFore,uBack; - KviQCString tmp = KviQString::toUtf8(szValue); - char * cx = tmp.data(); - if(!cx)return false; - if(sscanf(cx,"%d,%u,%u,%d,%d",&iId,&uFore,&uBack,&iLog,&iLevel) != 5)return false; - buffer = KviMsgType(buffer.m_szType,iId,uFore,uBack,iLog,iLevel); - return true; - } - - void toString(const QColor &cValue,QString &buffer) - { - buffer = cValue.name(); - } - - bool fromString(const QString & szValue,QColor &buffer) - { - buffer.setNamedColor(szValue); return true; - } - - void toString(const QFont &fValue,QString &buffer) - { - QString family(fValue.family()); - buffer.sprintf("%s,%d,%d,%d",KviQString::toUtf8(family).data(),fValue.pointSize(),fValue.styleHint(),fValue.weight()); - QString options; - if(fValue.bold())options.append('b'); - if(fValue.italic())options.append('i'); - if(fValue.underline())options.append('u'); - if(fValue.strikeOut())options.append('s'); - if(fValue.fixedPitch())options.append('f'); - - if(!options.isEmpty()) - { - buffer.append(','); - buffer.append(options); - } - } - - bool fromString(const QString & szValue,QFont &buffer) - { - KviStr str = szValue; - KviStr family,pointSize,styleHint,weight,options; - str.getToken(family,','); - str.getToken(pointSize,','); - str.getToken(styleHint,','); - str.getToken(weight,','); - if(!family.isEmpty())buffer.setFamily(family.ptr()); - int i; - bool bOk; - i = pointSize.toInt(&bOk); - if(bOk && (i > 0))buffer.setPointSize(i); - i = styleHint.toInt(&bOk); - if(bOk && (i >= 0))buffer.setStyleHint((QFont::StyleHint)i); - i = weight.toInt(&bOk); - if(bOk && (i >= 0))buffer.setWeight(i); - if(!str.isEmpty()) - { - buffer.setBold(str.contains("b")); - buffer.setItalic(str.contains("i")); - buffer.setUnderline(str.contains("u")); - buffer.setStrikeOut(str.contains("s")); - buffer.setFixedPitch(str.contains("f")); - } - return true; - } - - void toString(const QStringList &sValue,QString &buffer) - { - buffer = sValue.join(","); - } - - bool fromString(const QString & szValue,QStringList &buffer) - { -#ifdef COMPILE_USE_QT4 - buffer = szValue.split(","); -#else - buffer = QStringList::split(",",szValue); -#endif - return true; - } - -} diff --git a/3.4.0/src/kvilib/ext/kvi_stringconversion.h b/3.4.0/src/kvilib/ext/kvi_stringconversion.h deleted file mode 100644 index e9d7f8c73c..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_stringconversion.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef _KVI_STRINGCONVERSION_H_ -#define _KVI_STRINGCONVERSION_H_ - -//============================================================================= -// -// File : kvi_stringconversion.h -// Creation date : Thu Oct 20 2000 13:27:12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" -#include "kvi_pixmap.h" -#include "kvi_msgtype.h" - -#include <qrect.h> -#include <qcolor.h> -#include <qfont.h> -#include <qstringlist.h> -#include <qstring.h> - - -namespace KviStringConversion -{ - extern KVILIB_API void init(const QString& szGlobalDir,const QString& szLocalDir); - - extern KVILIB_API void encodePath(QString& buffer); - extern KVILIB_API void decodePath(QString& buffer); - - extern KVILIB_API void encodePath(QStringList& buffer); - extern KVILIB_API void decodePath(QStringList& buffer); - - // bool <-> - extern KVILIB_API void toString(const bool bValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,bool &buffer); - - // int <-> QString - extern KVILIB_API void toString(const int iValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,int &buffer); - - // uint <-> QString - extern KVILIB_API void toString(const unsigned int uValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,unsigned int &buffer); - - // QRect <-> QString - extern KVILIB_API void toString(const QRect &rValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,QRect &buffer); - - // QString <-> QString (Null conversion) - extern KVILIB_API void toString(const QString &szValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,QString &buffer); - - // KviPixmap <-> QString - extern KVILIB_API void toString(const KviPixmap &pValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,KviPixmap &buffer); - - // QFont <-> QString - extern KVILIB_API void toString(const QFont &fValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,QFont &buffer); - - // KviMsgType <-> QString - extern KVILIB_API void toString(const KviMsgType &mValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,KviMsgType &buffer); - - // QColor <-> QString - extern KVILIB_API void toString(const QColor &cValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,QColor &buffer); - - // QStringList <-> QString - extern KVILIB_API void toString(const QStringList &sValue,QString &buffer); - extern KVILIB_API bool fromString(const QString &szValue,QStringList &buffer); -}; - -#endif //!_KVI_STRINGCONVERSION_H_ diff --git a/3.4.0/src/kvilib/ext/kvi_xlib.h b/3.4.0/src/kvilib/ext/kvi_xlib.h deleted file mode 100644 index 7364d63ee6..0000000000 --- a/3.4.0/src/kvilib/ext/kvi_xlib.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _KVI_XLIB_H_ -#define _KVI_XLIB_H_ -//============================================================================= -// -// File : kvi_xlib.h -// Creation date : Tue Aug 14 18:17:21 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001-2005 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifndef COMPILE_NO_X - - #ifdef Bool - // Someone has defined Bool ? - #undef Bool - #endif - - #include <X11/Xlib.h> - - // Too bad that X11/Xlib.h defines Bool, Error and Success... this basically - // SUX since we can't use them anywhere in the source! - // this breaks, enums in Qt, enums in KVIrc and other stuff all around... - // Shame on you Xlib.h author :D - -#endif // !COMPILE_NO_X - -#endif //_KVI_XLIB_H_ diff --git a/3.4.0/src/kvilib/file/.svnignore b/3.4.0/src/kvilib/file/.svnignore deleted file mode 100644 index 1612c03b91..0000000000 --- a/3.4.0/src/kvilib/file/.svnignore +++ /dev/null @@ -1,20 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -*.o -*.lo -*.la -*.so -*.lai -kvirc -symlinks -moc_*.cpp - diff --git a/3.4.0/src/kvilib/file/Makefile.am b/3.4.0/src/kvilib/file/Makefile.am deleted file mode 100644 index c84487eb66..0000000000 --- a/3.4.0/src/kvilib/file/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -EXTRA_DIST = *.cpp *.h diff --git a/3.4.0/src/kvilib/file/kvi_file.cpp b/3.4.0/src/kvilib/file/kvi_file.cpp deleted file mode 100644 index b1abd48e12..0000000000 --- a/3.4.0/src/kvilib/file/kvi_file.cpp +++ /dev/null @@ -1,256 +0,0 @@ -//============================================================================= -// -// File : kvi_file.cpp -// Creation date : Mon Dec 17 2001 00:04:12 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_file.h" -#include "kvi_byteorder.h" - - -KviFile::KviFile() -: QFile() -{ -} - -KviFile::KviFile(const QString &name) -: QFile(name) -{ -} - -KviFile::~KviFile() -{ -} - -bool KviFile::openForReading() -{ -#ifdef COMPILE_USE_QT4 - return open(QFile::ReadOnly); -#else - return open(IO_ReadOnly); -#endif -} - -bool KviFile::openForWriting(bool bAppend) -{ -#ifdef COMPILE_USE_QT4 - return open(QFile::WriteOnly | (bAppend ? QFile::Append : QFile::Truncate)); -#else - return open(IO_WriteOnly | (bAppend ? IO_Append : IO_Truncate)); -#endif -} - - -bool KviFile::save(const QByteArray &bData) -{ - if(!save((kvi_u32_t)(bData.size())))return false; - return (writeBlock(bData.data(),bData.size()) == ((int)(bData.size()))); -} - -bool KviFile::load(QByteArray &bData) -{ - kvi_u32_t iLen; - if(!load(iLen))return false; - bData.resize(iLen); // it is automatically null terminated in Qt 4.x... BLEAH :D - if(readBlock((char *)(bData.data()),iLen) != iLen)return false; - return true; -} - -#ifndef COMPILE_USE_QT4 - -bool KviFile::save(const KviQCString &szData) -{ - if(!save((kvi_u32_t)(szData.length())))return false; - return (writeBlock(szData.data(),szData.length()) == ((int)(szData.length()))); -} - -bool KviFile::load(KviQCString &szData) -{ - kvi_u32_t iLen; - if(!load(iLen))return false; - szData.resize(iLen + 1); // this would allocate one extra byte with Qt 4.x... - if(readBlock((char *)(szData.data()),iLen) != iLen)return false; - *(szData.data() + iLen) = 0; - return true; -} - -#endif - - -bool KviFile::save(const QString &szData) -{ - KviQCString c = KviQString::toUtf8(szData); - if(!save((kvi_u32_t)(c.length())))return false; - return (writeBlock(c.data(),c.length()) == ((int)(c.length()))); -} - -bool KviFile::load(QString &szData) -{ - kvi_u32_t iLen; - if(!load(iLen))return false; - KviQCString tmp; - tmp.resize(iLen + 1); - if(readBlock((char *)(tmp.data()),iLen) != iLen)return false; - *(tmp.data() + iLen) = 0; - szData = QString::fromUtf8(tmp.data()); - return true; -} - -bool KviFile::save(const KviStr &szData) -{ - if(!save((kvi_u32_t)(szData.len())))return false; - return (writeBlock(szData.ptr(),szData.len()) == (int) szData.len()); -} - -bool KviFile::load(KviStr &szData) -{ - kvi_u32_t iLen; - if(!load(iLen))return false; - szData.setLength(iLen); - return (readBlock((char *)(szData.ptr()),iLen) == iLen); -} - -bool KviFile::save(kvi_u32_t t) -{ -#ifndef LOCAL_CPU_LITTLE_ENDIAN - t = kvi_localCpuToLittleEndian32(t); -#endif - return (writeBlock((const char *)(&t),sizeof(kvi_u32_t)) == sizeof(kvi_u32_t)); -} - -bool KviFile::load(kvi_u32_t &t) -{ - if(!(readBlock((char *)(&t),sizeof(kvi_u32_t)) == sizeof(kvi_u32_t)))return false; -#ifndef LOCAL_CPU_LITTLE_ENDIAN - t = kvi_littleEndianToLocalCpu32(t); -#endif - return true; -} - -bool KviFile::save(kvi_u64_t t) -{ -#ifndef LOCAL_CPU_LITTLE_ENDIAN - t = kvi_localCpuToLittleEndian64(t); -#endif - return (writeBlock((const char *)(&t),sizeof(kvi_u64_t)) == sizeof(kvi_u64_t)); -} - -bool KviFile::load(kvi_u64_t &t) -{ - if(!(readBlock((char *)(&t),sizeof(kvi_u32_t)) == sizeof(kvi_u32_t)))return false; -#ifndef LOCAL_CPU_LITTLE_ENDIAN - t = kvi_littleEndianToLocalCpu32(t); -#endif - return true; -} - - -bool KviFile::save(kvi_u16_t t) -{ -#ifndef LOCAL_CPU_LITTLE_ENDIAN - t = kvi_localCpuToLittleEndian16(t); -#endif - return (writeBlock((const char *)(&t),sizeof(kvi_u16_t)) == sizeof(kvi_u16_t)); -} - -bool KviFile::load(kvi_u16_t &t) -{ - if(!(readBlock((char *)(&t),sizeof(kvi_u16_t)) == sizeof(kvi_u16_t)))return false; -#ifndef LOCAL_CPU_LITTLE_ENDIAN - t = kvi_littleEndianToLocalCpu16(t); -#endif - return true; -} - -bool KviFile::save(kvi_u8_t t) -{ - return (writeBlock((const char *)(&t),sizeof(kvi_u8_t)) == sizeof(kvi_u8_t)); -} - -bool KviFile::load(kvi_u8_t &t) -{ - return (readBlock((char *)(&t),sizeof(kvi_u8_t)) == sizeof(kvi_u8_t)); -} - - -bool KviFile::save(KviPointerList<KviStr> * pData) -{ - if(!save((int)(pData->count())))return false; - for(KviStr * s = pData->first();s;s = pData->next()) - { - if(!save(*s))return false; - } - return true; -} - -bool KviFile::load(KviPointerList<KviStr> * pData) -{ - pData->clear(); - int iCount; - if(!load(iCount))return false; - for(int i=0;i<iCount;i++) - { - KviStr * s = new KviStr(); - if(!load(*s)) - { - delete s; - s = 0; - return false; - } - pData->append(s); - } - return true; -} - -bool KviFile::skipFirst(char t,unsigned int maxdist) -{ - while(maxdist > 0) - { - char c; - if(!getChar(&c))return false; - if(((char)c) == t)return true; - maxdist--; - } - return false; -} - -bool KviFile::skipFirst(const KviStr &t,unsigned int maxdist) -{ - char * ptr = t.ptr(); - while(maxdist > 0) - { - char c; - if(!getChar(&c))return false; - if(c == *ptr) - { - ptr++; - if(!*ptr)return true; - } else { - ptr = t.ptr(); - } - maxdist--; - } - return false; -} - diff --git a/3.4.0/src/kvilib/file/kvi_file.h b/3.4.0/src/kvilib/file/kvi_file.h deleted file mode 100644 index 394220666b..0000000000 --- a/3.4.0/src/kvilib/file/kvi_file.h +++ /dev/null @@ -1,120 +0,0 @@ -#ifndef _KVI_FILE_H_ -#define _KVI_FILE_H_ - -//============================================================================= -// -// File : kvi_file.h -// Creation date : Mon Dec 17 2001 00:05:04 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_heapobject.h" -#include "kvi_qstring.h" -#include "kvi_string.h" -#include "kvi_pointerlist.h" -#include "kvi_inttypes.h" -#include "kvi_qcstring.h" - -#include <qfile.h> -#include <time.h> - -#ifdef COMPILE_USE_QT4 - #define kvi_file_offset_t qlonglong -#else - #define kvi_file_offset_t QFile::Offset -#endif - - -class KVILIB_API KviFile : public QFile, public KviHeapObject -{ -public: - KviFile(); - KviFile(const QString &name); - ~KviFile(); -public: - // Wrappers portable across Qt 3.x and Qt 4.x - bool openForReading(); - bool openForWriting(bool bAppend = false); - -#ifndef COMPILE_USE_QT4 - // Functions present in Qt 4.x but not Qt 3.x - bool putChar(char c){ return putch(c) != -1; }; - bool ungetChar(char c){ return ungetch(c) != -1; }; - bool getChar(char * c){ *c = getch(); return *c != -1; }; - bool seek(kvi_file_offset_t o){ return at(o); }; - kvi_file_offset_t pos(){ return at(); }; -#endif - -#ifdef COMPILE_USE_QT4 - // Missing functions in Qt 4.x - quint64 writeBlock(const char * data,quint64 uLen){ return write(data,uLen); }; - quint64 readBlock(char * data,quint64 uLen){ return read(data,uLen); }; -#endif - - // This stuff loads and saves LITTLE ENDIAN DATA! - bool save(kvi_u64_t t); - bool load(kvi_u64_t &t); - - bool save(kvi_i64_t t){ return save((kvi_u64_t)t); }; - bool load(kvi_i64_t &t){ return load((kvi_u64_t &)t); }; - - bool save(kvi_u32_t t); - bool load(kvi_u32_t &t); - - bool save(kvi_i32_t t){ return save((kvi_u32_t)t); }; - bool load(kvi_i32_t &t){ return load((kvi_u32_t &)t); }; - - bool save(kvi_u16_t t); - bool load(kvi_u16_t &t); - - bool save(kvi_i16_t t){ return save((kvi_u16_t)t); }; - bool load(kvi_i16_t &t){ return load((kvi_u16_t &)t); }; - - bool save(kvi_u8_t t); - bool load(kvi_u8_t &t); - - bool save(kvi_i8_t t){ return save((kvi_u8_t)t); }; - bool load(kvi_i8_t &t){ return load((kvi_u8_t &)t); };; - - bool save(const KviStr &szData); - bool load(KviStr &szData); - -#ifndef COMPILE_USE_QT4 - // Under Qt 4.x these collide with QByteArray - bool save(const KviQCString &szData); - bool load(KviQCString &szData); -#endif - - bool save(const QByteArray &bData); - bool load(QByteArray &bData); - - bool save(const QString &szData); - bool load(QString &szData); - - bool skipFirst(char t,unsigned int maxdist = 0xffffffff); - bool skipFirst(const KviStr &t,unsigned int maxdist = 0xffffffff); - - bool save(KviPointerList<KviStr> * pData); - bool load(KviPointerList<KviStr> * pData); -}; - - -#endif //_KVI_FILE_H_ diff --git a/3.4.0/src/kvilib/file/kvi_fileutils.cpp b/3.4.0/src/kvilib/file/kvi_fileutils.cpp deleted file mode 100644 index 9a701db091..0000000000 --- a/3.4.0/src/kvilib/file/kvi_fileutils.cpp +++ /dev/null @@ -1,505 +0,0 @@ -//============================================================================= -// -// File : kvi_fileutils.cpp -// Creation date : Fri Dec 25 1998 18:26:48 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1998-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#define _KVI_FILEUTLIS_CPP_ -#include "kvi_fileutils.h" -#include "kvi_qstring.h" -#include "kvi_file.h" -#include "kvi_malloc.h" - -#include <qdir.h> -#include <qfileinfo.h> -#include <qglobal.h> -#include <qtextcodec.h> -#include <qtextstream.h> - - -namespace KviFileUtils -{ - /* - WORKING CODE BUT UNUSED FOR NOW - bool readLine(QFile * f,QString &szBuffer,bool bClearBuffer) - { - // FIXME: Should this assume UTF8 encoding ? - char tmp_buf[256]; - int cur_len = 0; - //char *cur_ptr = tmp_buf; - if(bClearBuffer)szBuffer = ""; - int ch = f->getch(); - - while((ch != -1)&&(ch != '\n')&&(ch != 0)) - { - tmp_buf[cur_len] = ch; - cur_len++; - if(cur_len > 255) - { - if(tmp_buf[255] == '\r')cur_len--; //Ignore CR... - int lastlen = szBuffer.length(); - szBuffer.setLength(lastlen + cur_len); - QChar *p1 = szBuffer.unicode() + lastlen; - char * p2 = tmp_buf; - for(int i=0;i<cur_len;i++)*p1++ = *p2++; - cur_len = 0; - } - ch = f->getch(); - } - if(ch == 0) - { - debug("Warning : %s is not an ascii file",f->name().latin1()); - } - if(cur_len > 0) - { - if(tmp_buf[cur_len - 1] == '\r')cur_len--; //Ignore CR... - int lastlen = szBuffer.length(); - szBuffer.setLength(lastlen + cur_len); - QChar *p1 = szBuffer.unicode() + lastlen; - char * p2 = tmp_buf; - for(int i=0;i<cur_len;i++)*p1++ = *p2++; - } - return (ch == '\n'); //more data to read else a broken file or EOF - } - - bool loadFileStripCR(const QString &szPath,QString &szBuffer) - { - QFile f(szPath); - if(!f.open(IO_ReadOnly))return false; - szBuffer = ""; - while(readLine(&f,szBuffer,false)) - { - szBuffer.append('\n'); // readLine returned true...last char was a newline - } - // readLine returned false , no ending newline encountered - return true; - } - */ - - bool makeDir(const QString &szPath) - { - QDir d; - QString dir = KviQString::trimmed(szPath); - adjustFilePath(dir); - QString createdDir; - -#ifdef COMPILE_ON_WINDOWS -#ifdef COMPILE_USE_QT4 - int idx = dir.indexOf(':'); -#else - int idx = dir.find(':'); -#endif - if(idx == 1) - { - createdDir = dir.left(2); - dir.remove(0,2); - } -#endif - - KviQString::stripLeft(dir,KVI_PATH_SEPARATOR_CHAR); - while(!dir.isEmpty()) - { - createdDir += KVI_PATH_SEPARATOR; - createdDir += KviQString::getToken(dir,KVI_PATH_SEPARATOR_CHAR); - if(!directoryExists(createdDir)) - { - if(!d.mkdir(createdDir)) - { - debug("Can't create directory %s",KviQString::toUtf8(createdDir).data()); - return false; - } - } - KviQString::stripLeft(dir,KVI_PATH_SEPARATOR_CHAR); - } - return true; - } - - bool makeDir(const char* path) - { - QString szPath=QString::fromUtf8(path); - return makeDir(szPath); - } - - bool renameFile(const QString &szSrc,const QString &szDst) - { - QDir d; - return d.rename(szSrc,szDst); - } - - bool renameFile(const char* path,const char* path2) - { - QString szPath=QString::fromUtf8(path); - QString szPath2=QString::fromUtf8(path2); - return renameFile(szPath,szPath2); - } - - bool copyFile(const QString &szSrc,const QString &szDst) - { - KviFile f1(szSrc); - if(!f1.openForReading())return false; - KviFile f2(szDst); - if(!f2.openForWriting()) - { - f1.close(); - return false; - } - char buffer[1024]; - while(!f1.atEnd()) - { - int len = f1.readBlock(buffer,1024); - if(len <= 0) - { - f1.close(); - f2.close(); - return false; //"serious error" - } - f2.writeBlock(buffer,len); - } - f1.close(); - f2.close(); - return true; - } - - bool copyFile(const char* path,const char* path2) - { - QString szPath=QString::fromUtf8(path); - QString szPath2=QString::fromUtf8(path2); - return copyFile(szPath,szPath2); - } - - bool loadFile(const QString &szPath,QString &szBuffer,bool bUtf8) - { - KviFile f(szPath); - if(!f.openForReading())return false; - if(bUtf8) - { - QByteArray ba = f.readAll(); - szBuffer = QString::fromUtf8(ba.data(),ba.size()); - //debug("BUFFERLEN: %d",szBuffer.length()); - } else { - szBuffer = QString(f.readAll()); - } - return true; - } - - bool loadFile(const char* path,QString &szBuffer,bool bUtf8) - { - QString szPath=QString::fromUtf8(path); - return loadFile(szPath,szBuffer,bUtf8); - } - - void adjustFilePath(QString &szPath) - { -#ifdef COMPILE_ON_WINDOWS - szPath.replace('/',"\\"); -#ifdef COMPILE_USE_QT4 - szPath.replace("\\\\","\\"); -#else - while(szPath.find("\\\\") != -1)szPath.replace("\\\\","\\"); -#endif - // FIXME: Use the default drive here ? - if(szPath.startsWith("\\"))szPath.prepend("C:"); -#else - szPath.replace('\\',"/"); -#ifdef COMPILE_USE_QT4 - szPath.replace("//","/"); -#else - while(KviQString::find(szPath,"//") != -1)szPath.replace("//","/"); -#endif - // deal with windows paths - if((szPath.length() > 2) && (szPath.at(0) != QChar('/'))) - { - if((szPath.at(1) == QChar(':')) && (szPath.at(2) == QChar('/'))) - { - szPath.remove(0,2); - } - } -#ifdef COMPILE_USE_QT4 - szPath=QDir::cleanPath(szPath); -#else - szPath=QDir::cleanDirPath(szPath); -#endif -#endif - - } - - bool directoryExists(const QString &szPath) - { - QFileInfo f(szPath); - return (f.exists() && f.isDir()); - } - - bool directoryExists(const char* path) - { - QString szPath=QString::fromUtf8(path); - QFileInfo f(szPath); - return (f.exists() && f.isDir()); - } - - bool fileExists(const QString &szPath) - { - QFileInfo f(szPath); - return (f.exists() && f.isFile()); - } - - bool fileExists(const char* path) - { - QString szPath=QString::fromUtf8(path); - return fileExists(szPath); - } - - bool removeFile(const QString &szPath) - { - QDir d; - return d.remove(szPath); - } - - bool removeFile(const char* path) - { - QString szPath=QString::fromUtf8(path); - return removeFile(szPath); - } - - bool removeDir(const QString &szPath) - { - QDir d; - return d.rmdir(szPath); - } - - bool removeDir(const char* path) - { - QString szPath=QString::fromUtf8(path); - return removeDir(szPath); - } - - bool deleteDir(const QString &szPath) - { - QDir d(szPath); - QStringList sl = d.entryList(QDir::Dirs); - QStringList::Iterator it; - for(it=sl.begin();it != sl.end();it++) - { - QString szSubdir = *it; - if(!(KviQString::equalCS(szSubdir,"..") || KviQString::equalCS(szSubdir,"."))) - { - QString szSubPath = szPath; - KviQString::ensureLastCharIs(szSubPath,QChar(KVI_PATH_SEPARATOR_CHAR)); - szSubPath += szSubdir; - if(!KviFileUtils::deleteDir(szSubPath)) - return false; - } - } - - sl = d.entryList(QDir::Files); - for(it=sl.begin();it != sl.end();it++) - { - QString szFilePath = szPath; - KviQString::ensureLastCharIs(szFilePath,QChar(KVI_PATH_SEPARATOR_CHAR)); - szFilePath += *it; - if(!KviFileUtils::removeFile(szFilePath)) - return false; - } - - return KviFileUtils::removeDir(szPath); - } - - bool writeFile(const QString &szPath,const QString &szData,bool bAppend) - { - KviFile f(szPath); - if(!f.openForWriting(bAppend))return false; - KviQCString szTmp = KviQString::toUtf8(szData); - if(!szTmp.data())return true; - if(f.writeBlock(szTmp.data(),szTmp.length()) != ((int)(szTmp.length())))return false; - return true; - } - - bool writeFile(const char* path,const QString &szData,bool bAppend) - { - QString szPath=QString::fromUtf8(path); - return writeFile(szPath,szData,bAppend); - } - - bool writeFileLocal8Bit(const QString &szPath,const QString &szData,bool bAppend) - { - KviFile f(szPath); - if(!f.openForWriting(bAppend))return false; - KviQCString szTmp = QTextCodec::codecForLocale()->fromUnicode(szData); - if(!szTmp.data())return true; - if(f.writeBlock(szTmp.data(),szTmp.length()) != ((int)(szTmp.length())))return false; - return true; - } - - bool writeFileLocal8Bit(const char* path,const QString &szData,bool bAppend) - { - QString szPath=QString::fromUtf8(path); - return writeFileLocal8Bit(szPath,szData,bAppend); - } - - bool readFile(const QString &szPath,QString &szBuffer,unsigned int uMaxSize) - { - KviFile f(szPath); - if(!f.openForReading())return false; - if(f.size() < 1) - { - szBuffer = ""; - f.close(); - return true; - } - if(f.size() > uMaxSize)return false; - char * buf = new char[f.size() + 1]; - if(f.readBlock(buf,f.size()) != ((long int)f.size())) - { - delete buf; - buf = 0; - return false; - } - buf[f.size()] = '\0'; - szBuffer = QString::fromUtf8(buf); - delete[] buf; - return true; - } - - bool readFile(const char* path,QString &szBuffer,unsigned int uMaxSize) - { - QString szPath=QString::fromUtf8(path); - return readFile(szPath,szBuffer,uMaxSize); - } - - - QString extractFileName(const QString &szFileNameWithPath) - { - return QFileInfo(szFileNameWithPath).fileName(); - } - - QString extractFilePath(const QString &szFileNameWithPath) - { - return QFileInfo(szFileNameWithPath).dirPath(true); - } - - bool readLine(QFile * f,QString &szBuffer,bool bUtf8) - { - QTextStream stream(f); - stream.setEncoding(bUtf8 ? QTextStream::UnicodeUTF8 : QTextStream::Locale); - szBuffer=stream.readLine(); - return !szBuffer.isNull(); - } - - bool readLines(QFile * f,QStringList &buffer,int iStartLine, int iCount, bool bUtf8) - { - QTextStream stream( f ); - stream.setEncoding(bUtf8 ? QTextStream::UnicodeUTF8 : QTextStream::Locale); - for(int i=0;i<iStartLine;i++) - stream.readLine(); - - if(iCount>0) - { - for(; (iCount>0 && !stream.atEnd()) ; iCount-- ) - buffer.append(stream.readLine()); - } else { - while(!stream.atEnd()) { - buffer.append(stream.readLine()); - } - } - return buffer.count()!= 0; - } - - bool isReadable(const QString &szFname) - { - QFileInfo f(szFname); - return (f.exists() && f.isFile() && f.isReadable()); - } - - bool isReadable(const char* path) - { - QString szPath=QString::fromUtf8(path); - return isReadable(szPath); - } - - bool isAbsolutePath(const QString &szPath) - { - QFileInfo f(szPath); - return !f.isRelative(); - } -}; - -static char hexchars[16] = { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , 'A' , 'B' , 'C' , 'D' , 'E' , 'F' }; - - -void kvi_encodeFileName(KviStr & path) -{ - QString szPath(path.ptr()); - kvi_encodeFileName(szPath); - path=szPath; -} - -void kvi_encodeFileName(QString & path) -{ - QString src(path); - path=""; - for(int i=0;i<src.length();i++) - { - QChar cur=src[i]; - if( ! (cur.isLetter() || cur.isDigit() || cur==' ' || cur=='_' || cur=='.' || cur=='#' || cur=='%') ) - { - if(cur.row()!=0) - { - path+='%'; - path+=hexchars[cur.row() >> 4]; - path+=hexchars[cur.row() & 15]; - } - path+='%'; - path+=hexchars[cur.cell() >> 4]; - path+=hexchars[cur.cell() & 15]; - } else if (cur=='%') - { - path+="%%"; - } else { - path+=cur; - } - } -} - -//================ kvi_isAbsolutePath ===============// - -bool kvi_isAbsolutePath(const char *path) -{ - if(*path == '/')return true; - if(isalpha(*path)) - { - if((*(path + 1)) == ':')return true; - } - return false; -} - -//=================== kvi_readLine =====================// - -bool kvi_readLine(QFile *f,KviStr &str) -{ - QTextStream stream(f); - QString szBuff=stream.readLine(); - str=szBuff; - return szBuff.isNull() ? 1 : 0; -} - - diff --git a/3.4.0/src/kvilib/file/kvi_fileutils.h b/3.4.0/src/kvilib/file/kvi_fileutils.h deleted file mode 100644 index 2e3689cbf8..0000000000 --- a/3.4.0/src/kvilib/file/kvi_fileutils.h +++ /dev/null @@ -1,112 +0,0 @@ -#ifndef _KVI_FILEUTILS_H_ -#define _KVI_FILEUTILS_H_ - -// -// File : kvi_fileutils.h -// Creation date : Fri Dec 25 1998 18:27:04 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" - -#include <qfile.h> -#include <qstringlist.h> - -#include <time.h> - - -#ifdef COMPILE_ON_WINDOWS - #define KVI_PATH_SEPARATOR "\\" - #define KVI_PATH_SEPARATOR_CHAR '\\' -#else - #define KVI_PATH_SEPARATOR "/" - #define KVI_PATH_SEPARATOR_CHAR '/' -#endif - -// #warning "Add kvi_trashFile(const char * path) ? - is it needed in the whole app" -// #warning "or should it be availible only for dirbrowser module ?" -namespace KviFileUtils -{ - //extern KVILIB_API bool readLine(QFile * f,QString &szBuffer,bool bClearBuffer = true); - //extern KVILIB_API bool loadFileStripCR(const QString &szPath,QString &szBuffer); - - // loads the file at szPath to szBuffer eventually converting from utf8 - extern KVILIB_API bool loadFile(const QString &szPath,QString &szBuffer,bool bUtf8 = true); - extern KVILIB_API bool loadFile(const char* szPath,QString &szBuffer,bool bUtf8 = true); - // adjusts the file path to the current platform - extern KVILIB_API void adjustFilePath(QString &szPath); - // returns true if szPath points to an existing directory - extern KVILIB_API bool directoryExists(const QString &szPath); - extern KVILIB_API bool directoryExists(const char* path); - // returns true if szPath points to an existing file - extern KVILIB_API bool fileExists(const QString &szPath); - extern KVILIB_API bool fileExists(const char* szPath); - // removes a file - extern KVILIB_API bool removeFile(const QString &szPath); - extern KVILIB_API bool removeFile(const char* path); - // removes a dir (must be empty) - extern KVILIB_API bool removeDir(const QString &szPath); - extern KVILIB_API bool removeDir(const char* path); - // removes a dir recursively - extern KVILIB_API bool deleteDir(const QString &szPath); - // writes a complete file (utf8 version) - extern KVILIB_API bool writeFile(const QString &szPath,const QString &szData,bool bAppend = false); - extern KVILIB_API bool writeFile(const char* path,const QString &szData,bool bAppend = false); - // writes a complete file (local 8 bit version) - extern KVILIB_API bool writeFileLocal8Bit(const QString &szPath,const QString &szData,bool bAppend = false); - extern KVILIB_API bool writeFileLocal8Bit(const char* path,const QString &szData,bool bAppend = false); - // reads a complete file and puts it in the string szBuffer, if the file is smaller than uMaxSize bytes - extern KVILIB_API bool readFile(const QString &szPath,QString &szBuffer,unsigned int uMaxSize = 65535); - extern KVILIB_API bool readFile(const char* path,QString &szBuffer,unsigned int uMaxSize = 65535); - // extracts the filename from a complete path (strips leading path) - extern KVILIB_API QString extractFileName(const QString &szFileNameWithPath); - - extern KVILIB_API QString extractFilePath(const QString &szFileNameWithPath); - // cp -f - extern KVILIB_API bool copyFile(const QString &szSrc,const QString &szDst); - extern KVILIB_API bool copyFile(const char* src,const char* dst); - // mv - extern KVILIB_API bool renameFile(const QString &szSrc,const QString &szDst); - extern KVILIB_API bool renameFile(const char* src,const char* dst); - // mkdir - extern KVILIB_API bool makeDir(const QString &szPath); - extern KVILIB_API bool makeDir(const char* path); - // reads a text line, returns false if EOF is reached - extern KVILIB_API bool readLine(QFile * f,QString &szBuffer,bool bUtf8 = true); - extern KVILIB_API bool readLines(QFile * f,QStringList &buffer,int iStartLine = 0, int iCount = -1, bool bUtf8 = true); - extern KVILIB_API bool isReadable(const QString &szFname); - extern KVILIB_API bool isAbsolutePath(const QString &szPath); -}; - -// ALL THIS STUFF BELOW SHOULD DIE: IF YOU SEE IT, REPLACE WITH THE FUNCTIONS IN THE NAMESPACE ABOVE - -// Returns true if the path begins with '/' -KVILIB_API extern bool kvi_isAbsolutePath(const char *path); -// Translates ANY string into a valid filename (with no path!) -// There is NO way to come back to the original string -// the algo is one-way only -KVILIB_API extern void kvi_encodeFileName(KviStr & path); -KVILIB_API extern void kvi_encodeFileName(QString & path); - -// Reads a single line from the file and returns false if EOF was encountered. -KVILIB_API extern bool kvi_readLine(QFile *f,KviStr &str); -// Removes a file - -#endif //_KVI_FILEUTILS_H_INCLUDED_ diff --git a/3.4.0/src/kvilib/file/kvi_packagefile.cpp b/3.4.0/src/kvilib/file/kvi_packagefile.cpp deleted file mode 100644 index 8b62f9249e..0000000000 --- a/3.4.0/src/kvilib/file/kvi_packagefile.cpp +++ /dev/null @@ -1,1028 +0,0 @@ -//============================================================================= -// -// File : kvi_packagefile.cpp -// Created on Tue 26 Dec 2006 05:33:33 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2006 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_packagefile.h" - -#include "kvi_file.h" -#include "kvi_fileutils.h" -#include "kvi_locale.h" -#include "kvi_inttypes.h" - -#include <qprogressdialog.h> -#include <qlabel.h> - -#include <qdir.h> - -#ifdef COMPILE_ZLIB_SUPPORT - #include <zlib.h> -#endif - -// -// A KVIrc Package File is basically a simple zip file with some additional meta-data. -// The package file has the following format -// - -// Field Type Bytes Description -//------------------------------------------------------------------------------- -// Package: -// PackageHeader -// PackageInfo -// PackageData - -// PackageHeader: -// Magic Bytes 4 'KVPF': Signature for the Kvirc Package File -// Version uint32 4 0x00000001: Version of this package file -// Flags uint32 4 0x00000000: Flags, in version 1 is reserved and must be zero -// - -// PackageInfo: -// InfoFieldCount uint32 4 Number of package info fields -// InfoField InfoField Variable A list of informational name-value pairs -// InfoField InfoField Variable A list of informational name-value pairs -// InfoField InfoField Variable A list of informational name-value pairs -// .... .... .... - -// PackageData: -// DataField DataField Variable A list of data fields with format defined below -// DataField DataField Variable A list of data fields with format defined below -// DataField DataField Variable A list of data fields with format defined below -// .... .... .... - -// InfoField: -// Name UniString Variable The "name" element of the info field -// ValueType uint32 4 The type of the following ValueData field -// ValueData ValueData Variable - -// ValueData for ValueType 1 (string field) -// Value UniString Variable The value element of type string of the the info field - -// ValueData for ValueType 2 (binary buffer field) -// BufferLen uint32 4 The length of the binary buffer -// BufferData Bytes Variable The data for the binary buffer - - -// UniString: -// StringLen uint32 4 The length of the string data in BYTES (null terminator NOT included) -// StringData Bytes StringLen An utf8 encoded string (do NOT write the NULL terminator) - -// Bytes: -// Byte uint8 1 A byte -// Byte uint8 1 A byte -// .... .... .... - -// DataField: -// FieldType uint32 4 The type of the field, see below for defined values -// FieldLen uint32 4 FieldData length in bytes (useful for skipping a field if unsupported) -// FieldData Variable FieldLen The data of the field, see below for defined values - -// FieldData for FieldType 1 (file field) -// Flags uint32 4 Bitmask. Bits: 1=FileIsDeflated -// Path UniString Variable A relative path expressed as utf8 string. \ AND / are considered to be separators -// Size uint32 4 Size of the following file data -// FilePayload Bytes Variable - -// Everything is stored in LITTLE ENDIAN byte order. - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Da Base Engine - -KviPackageIOEngine::KviPackageIOEngine() -{ - m_pProgressDialog = 0; - m_pStringInfoFields = new KviPointerHashTable<QString,QString>(); - m_pStringInfoFields->setAutoDelete(true); - m_pBinaryInfoFields = new KviPointerHashTable<QString,QByteArray>(); - m_pBinaryInfoFields->setAutoDelete(true); -} - -KviPackageIOEngine::~KviPackageIOEngine() -{ - if(m_pProgressDialog)delete m_pProgressDialog; - delete m_pStringInfoFields; - delete m_pBinaryInfoFields; -} - - -bool KviPackageIOEngine::updateProgress(int iProgress,const QString &szLabel) -{ - if(!m_pProgressDialog)return true; -#ifdef COMPILE_USE_QT4 - m_pProgressDialog->setValue(iProgress); -#else - m_pProgressDialog->setProgress(iProgress); -#endif - m_pProgressDialogLabel->setText(szLabel); - qApp->processEvents(); - if(m_pProgressDialog->wasCanceled()) - { - setLastError(__tr2qs("Operation cancelled")); - return false; - } - return true; -} - -void KviPackageIOEngine::showProgressDialog(const QString &szCaption,int iTotalSteps) -{ -#ifdef COMPILE_USE_QT4 - m_pProgressDialog = new QProgressDialog(QString(""),__tr2qs("Cancel"),0,iTotalSteps,0); - m_pProgressDialog->setModal(true); - m_pProgressDialog->setWindowTitle(szCaption); -#else - m_pProgressDialog = new QProgressDialog(QString(""),__tr2qs("Cancel"),iTotalSteps,0,"",true); - m_pProgressDialog->setCaption(szCaption); -#endif - m_pProgressDialogLabel = new QLabel(m_pProgressDialog); - m_pProgressDialogLabel->setMaximumSize(500,300); - m_pProgressDialog->setLabel(m_pProgressDialogLabel); -} - -void KviPackageIOEngine::hideProgressDialog() -{ - if(!m_pProgressDialog)return; - delete m_pProgressDialog; - m_pProgressDialog = 0; -} - -bool KviPackageIOEngine::writeError() -{ - setLastError(__tr2qs("File write error")); - return false; -} - -bool KviPackageIOEngine::readError() -{ - setLastError(__tr2qs("File read error")); - return false; -} - - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Da Writer - - -KviPackageWriter::KviPackageWriter() -: KviPackageIOEngine() -{ - m_pDataFields = new KviPointerList<DataField>(); - m_pDataFields->setAutoDelete(true); -} - -KviPackageWriter::~KviPackageWriter() -{ - delete m_pDataFields; -} - -void KviPackageWriter::addInfoField(const QString &szName,const QString &szValue) -{ - m_pStringInfoFields->replace(szName,new QString(szValue)); -} - -void KviPackageWriter::addInfoField(const QString &szName,QByteArray * pValue) -{ - m_pBinaryInfoFields->replace(szName,pValue); -} - -bool KviPackageWriter::addFile(const QString &szLocalFileName,const QString &szTargetFileName,kvi_u32_t uAddFileFlags) -{ - QFileInfo fi(szLocalFileName); - return addFileInternal(&fi,szLocalFileName,szTargetFileName,uAddFileFlags); -} - -bool KviPackageWriter::addFileInternal(const QFileInfo * fi,const QString &szLocalFileName,const QString &szTargetFileName,kvi_u32_t uAddFileFlags) -{ - if(!(fi->isFile() && fi->isReadable())) - return false; - - if(!(uAddFileFlags & FollowSymLinks)) - { - if(fi->isSymLink()) - return true; // do NOT add a symlink - } - - DataField * f = new DataField(); - f->m_uType = KVI_PACKAGE_DATAFIELD_TYPE_FILE; - f->m_bFileAllowCompression = !(uAddFileFlags & NoCompression); - f->m_szFileLocalName = szLocalFileName; - f->m_szFileTargetName = szTargetFileName; - m_pDataFields->append(f); - - return true; -} - -bool KviPackageWriter::addDirectory(const QString &szLocalDirectoryName,const QString &szTargetDirectoryPrefix,kvi_u32_t uAddFileFlags) -{ - QDir d(szLocalDirectoryName); -#ifdef COMPILE_USE_QT4 - QDir::Filters iFlags; -#else - int iFlags; -#endif - iFlags = QDir::Files | QDir::Readable; - if(!(uAddFileFlags & FollowSymLinks)) - iFlags |= QDir::NoSymLinks; - - // QT4SUX: Because the QDir::entryInfoList() breaks really a lot of code by returning an object that behaves in a _totally_ different way.. it's also much slower - -#ifdef COMPILE_USE_QT4 - int j; - QFileInfoList sl = d.entryInfoList(iFlags); - for(j=0;j<sl.size();j++) - { -#else - const QFileInfoList * sl = d.entryInfoList(iFlags); - if(!sl)return false; - QFileInfoListIterator it(*sl); - while(QFileInfo * fi = it.current()) - { -#endif - QString szSFileName = szLocalDirectoryName; - KviQString::ensureLastCharIs(szSFileName,QChar(KVI_PATH_SEPARATOR_CHAR)); -#ifdef COMPILE_USE_QT4 - QFileInfo slowCopy = sl.at(j); - szSFileName += slowCopy.fileName(); -#else - szSFileName += fi->fileName(); -#endif - QString szDFileName = szTargetDirectoryPrefix; - KviQString::ensureLastCharIs(szDFileName,QChar(KVI_PATH_SEPARATOR_CHAR)); -#ifdef COMPILE_USE_QT4 - szDFileName += slowCopy.fileName(); - if(!addFileInternal(&slowCopy,szSFileName,szDFileName,uAddFileFlags)) - return false; -#else - szDFileName += fi->fileName(); - if(!addFileInternal(fi,szSFileName,szDFileName,uAddFileFlags)) - return false; -#endif -#ifndef COMPILE_USE_QT4 - ++it; -#endif - } - iFlags = QDir::Dirs | QDir::Readable; - if(!(uAddFileFlags & FollowSymLinks)) - iFlags |= QDir::NoSymLinks; - sl = d.entryInfoList(iFlags); -#ifdef COMPILE_USE_QT4 - for(j=0;j<sl.size();j++) - { - QString szDir = sl.at(j).fileName(); -#else - if(!sl)return false; - QFileInfoListIterator it2(*sl); - while(QFileInfo * fi2 = it2.current()) - { - QString szDir = fi2->fileName(); -#endif - if(!KviQString::equalCS(szDir,"..") && !KviQString::equalCS(szDir,".")) - { - QString szSDirName = szLocalDirectoryName; - KviQString::ensureLastCharIs(szSDirName,QChar(KVI_PATH_SEPARATOR_CHAR)); - szSDirName += szDir; - QString szDDirName = szTargetDirectoryPrefix; - KviQString::ensureLastCharIs(szDDirName,QChar(KVI_PATH_SEPARATOR_CHAR)); - szDDirName += szDir; - if(!addDirectory(szSDirName,szDDirName,uAddFileFlags)) - return false; - } -#ifndef COMPILE_USE_QT4 - ++it2; -#endif - } - - return true; -} - - - -#define BUFFER_SIZE 32768 - -bool KviPackageWriter::packFile(KviFile * pFile,DataField * pDataField) -{ - QString szProgressText; - KviQString::sprintf(szProgressText,__tr2qs("Packaging file %Q"),&(pDataField->m_szFileLocalName)); - if(!updateProgress(m_iCurrentProgress,szProgressText)) - return false; // aborted - - - KviFile source(pDataField->m_szFileLocalName); - if(!source.openForReading()) - { - setLastError(__tr2qs("Failed to open a source file for reading")); - return false; - } - - kvi_u32_t uSize = source.size(); - - // Flags -#ifdef COMPILE_ZLIB_SUPPORT - kvi_u32_t uFlags = pDataField->m_bFileAllowCompression ? - (uSize > 64 ? KVI_PACKAGE_DATAFIELD_FLAG_FILE_DEFLATE : 0) - : 0; -#else - kvi_u32_t uFlags = 0; -#endif - - if(!pFile->save(uFlags))return writeError(); - - KviQCString szTargetFileName = KviQString::toUtf8(pDataField->m_szFileTargetName); - - // Path - if(!pFile->save(szTargetFileName))return writeError(); - - kvi_file_offset_t savedSizeOffset = pFile->pos(); - - // Size : will update it if compression is requested - if(!pFile->save(uSize))return writeError(); - - pDataField->m_uWrittenFieldLength = 4 + 4 + 4 + szTargetFileName.length(); // sizeof(flags + uncompressed size + path len + path) - - // FilePayload -#ifdef COMPILE_ZLIB_SUPPORT - if(uFlags & KVI_PACKAGE_DATAFIELD_FLAG_FILE_DEFLATE) - { - unsigned char ibuffer[BUFFER_SIZE]; - unsigned char obuffer[BUFFER_SIZE]; - - kvi_i32_t iReaded = source.readBlock((char *)ibuffer,BUFFER_SIZE); - if(iReaded < 0) - return readError(); - - z_stream zstr; - zstr.zalloc = Z_NULL; - zstr.zfree = Z_NULL; - zstr.opaque = Z_NULL; - zstr.next_in = ibuffer; - zstr.avail_in = iReaded; - zstr.next_out = obuffer; - zstr.avail_out = BUFFER_SIZE; - - if(deflateInit(&zstr,9) != Z_OK) - { - setLastError(__tr2qs("Compression library initialization error")); - return false; - } - - while(iReaded > 0) - { - zstr.next_out = obuffer; - zstr.avail_out = BUFFER_SIZE; - - if(deflate(&zstr,Z_NO_FLUSH) != Z_OK) - { - setLastError(__tr2qs("Compression library error")); - return false; - } - - if(zstr.avail_out < BUFFER_SIZE) - { - int iCompressed = zstr.next_out - obuffer; - pDataField->m_uWrittenFieldLength += iCompressed; - if(pFile->writeBlock((char *)obuffer,iCompressed) != iCompressed) - { - deflateEnd(&zstr); - return writeError(); - } - } - - if(zstr.avail_in < BUFFER_SIZE) - { - int iDataToRead = BUFFER_SIZE - zstr.avail_in; - if(iDataToRead < BUFFER_SIZE) - { - if(ibuffer != zstr.next_in) - { - // hum, there is still some data in the buffer to be readed - // and it is not at the beginning...move it to the beginning of ibuffer - memmove(ibuffer,zstr.next_in,zstr.avail_in); - } - } - iReaded = source.readBlock((char *)(ibuffer + zstr.avail_in),iDataToRead); - if(iReaded < 0) - { - deflateEnd(&zstr); - return readError(); - } - zstr.avail_in += iReaded; - zstr.next_in = ibuffer; - - if((zstr.total_in % 2000000) == 0) - { - QString szTmp; - KviQString::sprintf(szTmp,QString(" (%d of %d bytes)"),zstr.total_in,uSize); - QString szPrg = szProgressText + szTmp; - if(!updateProgress(m_iCurrentProgress,szPrg)) - return false; // aborted - } - - - } - } - - // flush pending output - zstr.next_out = obuffer; - zstr.avail_out = BUFFER_SIZE; - - int ret; - do - { - ret = deflate(&zstr,Z_FINISH); - - if((ret == Z_OK) || (ret == Z_STREAM_END)) - { - if(zstr.avail_out < BUFFER_SIZE) - { - int iCompressed = zstr.next_out - obuffer; - pDataField->m_uWrittenFieldLength += iCompressed; - if(pFile->writeBlock((char *)obuffer,iCompressed) != iCompressed) - { - deflateEnd(&zstr); - return writeError(); - } - } else { - deflateEnd(&zstr); - setLastError(__tr2qs("Compression library internal error")); - return false; - } - - zstr.next_out = obuffer; - zstr.avail_out = BUFFER_SIZE; - } - - } while(ret == Z_OK); - - // store the compressed data size - kvi_file_offset_t here = pFile->pos(); - pFile->seek(savedSizeOffset); - uSize = zstr.total_out; - - deflateEnd(&zstr); - if(!pFile->save(uSize))return writeError(); - - if(ret != Z_STREAM_END) - { - setLastError(__tr2qs("Error while compressing a file stream")); - return false; - } - - pFile->seek(here); - } else { -#endif - unsigned char buffer[BUFFER_SIZE]; - int iTotalFileSize = 0; - kvi_i32_t iReaded = source.readBlock((char *)buffer,BUFFER_SIZE); - if(iReaded < 0) - return readError(); - while(iReaded > 0) - { - iTotalFileSize += iReaded; - if((iTotalFileSize % 1000000) == 0) - { - QString szTmp; - KviQString::sprintf(szTmp,QString(" (%d of %d bytes)"),iTotalFileSize,uSize); - QString szPrg = szProgressText + szTmp; - if(!updateProgress(m_iCurrentProgress,szPrg)) - return false; // aborted - } - pDataField->m_uWrittenFieldLength += iReaded; - if(pFile->writeBlock((char *)buffer,iReaded) != iReaded) - return writeError(); - iReaded = source.readBlock((char *)buffer,BUFFER_SIZE); - } -#ifdef COMPILE_ZLIB_SUPPORT - } -#endif - source.close(); - - return true; -} - -bool KviPackageWriter::pack(const QString &szFileName,kvi_u32_t uPackFlags) -{ - m_iCurrentProgress = 0; - if(!(uPackFlags & NoProgressDialog)) - { - showProgressDialog(__tr2qs("Creating package..."),100); - updateProgress(m_iCurrentProgress,__tr2qs("Writing package header")); - } - - bool bRet = packInternal(szFileName,uPackFlags); - - hideProgressDialog(); - return bRet; -} - -bool KviPackageWriter::packInternal(const QString &szFileName,kvi_u32_t uPackFlags) -{ - - KviFile f(szFileName); - if(!f.openForWriting()) - { - setLastError(__tr2qs("Can't open file for writing")); - return false; - } - - // write the PackageHeader - - // Magic - char magic[4]; - magic[0] = 'K'; - magic[1] = 'V'; - magic[2] = 'P'; - magic[3] = 'F'; - if(f.writeBlock(magic,4) != 4)return writeError(); - - // Version - kvi_u32_t uVersion = 0x1; - if(!f.save(uVersion))return writeError(); - - // Flags - kvi_u32_t uFlags = 0x0; - if(!f.save(uFlags))return writeError(); - - // write PackageInfo - - // InfoFieldCount - kvi_u32_t uCount = m_pStringInfoFields->count() + m_pBinaryInfoFields->count(); - if(!f.save(uCount))return writeError(); - - m_iCurrentProgress = 5; - if(!updateProgress(m_iCurrentProgress,__tr2qs("Writing informational fields"))) - return false; // aborted - - // InfoFields (string) - KviPointerHashTableIterator<QString,QString> it(*m_pStringInfoFields); - while(QString * s = it.current()) - { - if(!f.save(it.currentKey()))return writeError(); - kvi_u32_t uType = KVI_PACKAGE_INFOFIELD_TYPE_STRING; - if(!f.save(uType))return writeError(); - if(!f.save(*s))return writeError(); - ++it; - } - - // InfoFields (binary) - KviPointerHashTableIterator<QString,QByteArray> it2(*m_pBinaryInfoFields); - while(QByteArray * b = it2.current()) - { - if(!f.save(it2.currentKey()))return writeError(); - kvi_u32_t uType = KVI_PACKAGE_INFOFIELD_TYPE_BINARYBUFFER; - if(!f.save(uType))return writeError(); - if(!f.save(*b))return writeError(); - ++it2; - } - - m_iCurrentProgress = 10; - if(!updateProgress(m_iCurrentProgress,__tr2qs("Writing package data"))) - return false; // aborted - - // write PackageData - int iIdx = 0; - for(DataField * pDataField = m_pDataFields->first();pDataField;pDataField = m_pDataFields->next()) - { - kvi_u32_t uDataFieldType = pDataField->m_uType; - if(!f.save(uDataFieldType))return writeError(); - - kvi_file_offset_t savedLenOffset = f.pos(); - // here we will store the length of the field once it's written - if(!f.save(uDataFieldType))return writeError(); - - m_iCurrentProgress = 10 + ((90 * iIdx) / m_pDataFields->count()); - - switch(pDataField->m_uType) - { - case KVI_PACKAGE_DATAFIELD_TYPE_FILE: - if(!packFile(&f,pDataField)) - return false; - break; - default: - setLastError(__tr2qs("Internal error")); - return false; - break; - } - - kvi_file_offset_t savedEndOffset = f.pos(); - f.seek(savedLenOffset); - if(!f.save(pDataField->m_uWrittenFieldLength)) - return writeError(); - - f.seek(savedEndOffset); - iIdx++; - } - - return true; -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Da Reader - -KviPackageReader::KviPackageReader() -: KviPackageIOEngine() -{ -} - -KviPackageReader::~KviPackageReader() -{ -} - -bool KviPackageReader::readHeaderInternal(KviFile * pFile,const QString &szLocalFileName) -{ - // read the PackageHeader - - // Magic - char magic[4]; - - if(pFile->readBlock(magic,4) != 4)return readError(); - if((magic[0] != 'K') || (magic[1] != 'V') || (magic[2] != 'P') || (magic[3] != 'F')) - { - setLastError(__tr2qs("The file specified is not a valid KVIrc package")); - return false; - } - - // Version - kvi_u32_t uVersion; - if(!pFile->load(uVersion))return readError(); - if(uVersion != 0x1) - { - setLastError(__tr2qs("The package has an invalid version number, it might have been created by a newer KVIrc")); - return false; - } - - // Flags - kvi_u32_t uFlags; - if(!pFile->load(uFlags))return readError(); - // we ignore them at the moment - - // read PackageInfo - - // InfoFieldCount - kvi_u32_t uCount; - if(!pFile->load(uCount))return writeError(); - - m_pStringInfoFields->clear(); - m_pBinaryInfoFields->clear(); - - kvi_u32_t uIdx = 0; - while(uIdx < uCount) - { - QString szKey; - if(!pFile->load(szKey))return readError(); - kvi_u32_t uFieldType; - if(!pFile->load(uFieldType))return readError(); - switch(uFieldType) - { - case KVI_PACKAGE_INFOFIELD_TYPE_STRING: - { - QString szValue; - if(!pFile->load(szValue))return readError(); - m_pStringInfoFields->replace(szKey,new QString(szValue)); - } - break; - case KVI_PACKAGE_INFOFIELD_TYPE_BINARYBUFFER: - { - QByteArray * pbValue = new QByteArray(); - if(!pFile->load(*pbValue)) - { - delete pbValue; - return readError(); - } - m_pBinaryInfoFields->replace(szKey,pbValue); - } - break; - default: - setLastError(__tr2qs("Invalid info field: the package is probably corrupt")); - break; - } - uIdx++; - } - - return true; -} - - -bool KviPackageReader::readHeader(const QString &szLocalFileName) -{ - KviFile f(szLocalFileName); - if(!f.openForReading()) - { - setLastError(__tr2qs("Can't open file for reading")); - return false; - } - - return readHeaderInternal(&f,szLocalFileName); -} - -bool KviPackageReader::unpackFile(KviFile * pFile,const QString &szUnpackPath) -{ - // Flags - kvi_u32_t uFlags; - if(!pFile->load(uFlags))return readError(); - -#ifndef COMPILE_ZLIB_SUPPORT - if(uFlags & KVI_PACKAGE_DATAFIELD_FLAG_FILE_DEFLATE) - { - setLastError(__tr2qs("The package contains compressed data but this executable does not support compression")); - return false; - } -#endif - - // Path - QString szPath; - if(!pFile->load(szPath))return readError(); - - QString szFileName = szUnpackPath; - KviQString::ensureLastCharIs(szFileName,QChar(KVI_PATH_SEPARATOR_CHAR)); - - szFileName += szPath; - - // no attacks please :) - szFileName.replace(QString("..\\"),QString("")); - szFileName.replace(QString("..//"),QString("")); - - KviFileUtils::adjustFilePath(szFileName); - - int idx = KviQString::findRev(szFileName,QChar(KVI_PATH_SEPARATOR_CHAR)); - if(idx != -1) - { - QString szPrefixPath = szFileName.left(idx); - if(!KviFileUtils::makeDir(szPrefixPath)) - { - setLastError(__tr2qs("Failed to create the target directory")); - return false; - } - } - - KviFile dest(szFileName); - if(!dest.openForWriting()) - { - setLastError(__tr2qs("Failed to open a source file for reading")); - return false; - } - - QString szProgressText; - KviQString::sprintf(szProgressText,__tr2qs("Unpacking file %Q"),&szFileName); - if(!updateProgress(pFile->pos(),szProgressText)) - return false; // aborted - - // Size - kvi_u32_t uSize; - if(!pFile->load(uSize))return readError(); - - - // FilePayload -#ifdef COMPILE_ZLIB_SUPPORT - if(uFlags & KVI_PACKAGE_DATAFIELD_FLAG_FILE_DEFLATE) - { - int iRemainingSize = uSize; - unsigned char ibuffer[BUFFER_SIZE]; - unsigned char obuffer[BUFFER_SIZE]; - - int iToRead = iRemainingSize; - if(iToRead > BUFFER_SIZE)iToRead = BUFFER_SIZE; - int iReaded = pFile->readBlock((char *)ibuffer,iToRead); - iRemainingSize -= iReaded; - - z_stream zstr; - zstr.zalloc = Z_NULL; - zstr.zfree = Z_NULL; - zstr.opaque = Z_NULL; - zstr.next_in = ibuffer; - zstr.avail_in = iReaded; - zstr.next_out = obuffer; - zstr.avail_out = BUFFER_SIZE; - - if(inflateInit(&zstr) != Z_OK) - { - setLastError(__tr2qs("Compression library initialization error")); - return false; - } - - while((iReaded > 0) && (iRemainingSize > 0)) - { - zstr.next_out = obuffer; - zstr.avail_out = BUFFER_SIZE; - - if(inflate(&zstr,Z_NO_FLUSH) != Z_OK) - { - setLastError(__tr2qs("Compression library error")); - return false; - } - - if(zstr.avail_out < BUFFER_SIZE) - { - int iDecompressed = zstr.next_out - obuffer; - if(dest.writeBlock((char *)obuffer,iDecompressed) != iDecompressed) - { - inflateEnd(&zstr); - return writeError(); - } - } - - if(zstr.avail_in < BUFFER_SIZE) - { - int iDataToRead = BUFFER_SIZE - zstr.avail_in; - if(iDataToRead < BUFFER_SIZE) - { - if(ibuffer != zstr.next_in) - { - // hum, there is still some data in the buffer to be readed - // and it is not at the beginning...move it to the beginning of ibuffer - memmove(ibuffer,zstr.next_in,zstr.avail_in); - } - } - - if(iDataToRead > iRemainingSize) - iDataToRead = iRemainingSize; - - iReaded = pFile->readBlock((char *)(ibuffer + zstr.avail_in),iDataToRead); - if(iReaded < 0) - { - inflateEnd(&zstr); - return readError(); - } - - iRemainingSize -= iReaded; - zstr.avail_in += iReaded; - zstr.next_in = ibuffer; - - if((zstr.total_in % 2000000) == 0) - { - QString szTmp; - KviQString::sprintf(szTmp,QString(" (%d of %d bytes)"),zstr.total_in,uSize); - QString szPrg = szProgressText + szTmp; - if(!updateProgress(pFile->pos(),szPrg)) - return false; // aborted - } - } - } - - // flush pending output - zstr.next_out = obuffer; - zstr.avail_out = BUFFER_SIZE; - - int ret; - - do { - ret = inflate(&zstr,Z_FINISH); - - if((ret == Z_OK) || (ret == Z_STREAM_END) || (ret == Z_BUF_ERROR)) - { - if(zstr.avail_out < BUFFER_SIZE) - { - int iDecompressed = zstr.next_out - obuffer; - if(dest.writeBlock((char *)obuffer,iDecompressed) != iDecompressed) - { - inflateEnd(&zstr); - return writeError(); - } - } /* else { THIS HAPPENS FOR ZERO SIZE FILES - debug("hum.... internal, rEWq (ret = %d) (avail_out = %d)",ret,zstr.avail_out); - - inflateEnd(&zstr); - setLastError(__tr2qs("Compression library internal error")); - return false; - } */ - zstr.next_out = obuffer; - zstr.avail_out = BUFFER_SIZE; - } - - } while((ret == Z_OK) || (ret == Z_BUF_ERROR)); - - inflateEnd(&zstr); - - if(ret != Z_STREAM_END) - { - setLastError(__tr2qs("Error in compressed file stream")); - return false; - } - - } else { -#endif - unsigned char buffer[BUFFER_SIZE]; - int iTotalFileSize = 0; - int iRemainingData = uSize; - int iToRead = iRemainingData; - if(iToRead > BUFFER_SIZE)iToRead = BUFFER_SIZE; - int iReaded = 1; - - while((iReaded > 0) && (iToRead > 0)) - { - iReaded = pFile->readBlock((char *)buffer,iToRead); - if(iReaded > 0) - { - iTotalFileSize += iReaded; - iRemainingData -= iReaded; - - if((iTotalFileSize % 3000000) == 0) - { - QString szTmp; - KviQString::sprintf(szTmp,QString(" (%d of %d bytes)"),iTotalFileSize,uSize); - QString szPrg = szProgressText + szTmp; - if(!updateProgress(pFile->pos(),szPrg)) - return false; // aborted - } - - if(dest.writeBlock((char *)buffer,iReaded) != iReaded) - return writeError(); - } - - int iToRead = iRemainingData; - if(iToRead > BUFFER_SIZE)iToRead = BUFFER_SIZE; - } -#ifdef COMPILE_ZLIB_SUPPORT - } -#endif - dest.close(); - - return true; -} - -bool KviPackageReader::getStringInfoField(const QString &szName,QString &szBuffer) -{ - QString * pVal = m_pStringInfoFields->find(szName); - if(!pVal)return false; - szBuffer = *pVal; - return true; -} - -bool KviPackageReader::unpack(const QString &szLocalFileName,const QString &szUnpackPath,kvi_u32_t uUnpackFlags) -{ - bool bRet = unpackInternal(szLocalFileName,szUnpackPath,uUnpackFlags); - hideProgressDialog(); - return bRet; -} - -bool KviPackageReader::unpackInternal(const QString &szLocalFileName,const QString &szUnpackPath,kvi_u32_t uUnpackFlags) -{ - - KviFile f(szLocalFileName); - if(!f.openForReading()) - { - setLastError(__tr2qs("Can't open file for reading")); - return false; - } - - kvi_file_offset_t size = f.size(); - - if(!(uUnpackFlags & NoProgressDialog)) - { - showProgressDialog(__tr2qs("Reading package..."),size); - updateProgress(0,__tr2qs("Reading package header")); - } - - - if(!readHeaderInternal(&f,szLocalFileName)) - return false; - - if(!updateProgress(f.pos(),__tr2qs("Reading package data"))) - return false; // aborted - - while(!f.atEnd()) - { - // DataFieldType - kvi_u32_t uDataFieldType; - if(!f.load(uDataFieldType))return readError(); - // DataFieldLen - kvi_u32_t uDataFieldLen; - if(!f.load(uDataFieldLen))return readError(); - - switch(uDataFieldType) - { - case KVI_PACKAGE_DATAFIELD_TYPE_FILE: - if(!unpackFile(&f,szUnpackPath)) - return false; - break; - default: - setLastError(__tr2qs("Invalid data field: the package is probably corrupt")); - return false; - break; - } - - } - - return true; -} - - - diff --git a/3.4.0/src/kvilib/file/kvi_packagefile.h b/3.4.0/src/kvilib/file/kvi_packagefile.h deleted file mode 100644 index a7c461aa0a..0000000000 --- a/3.4.0/src/kvilib/file/kvi_packagefile.h +++ /dev/null @@ -1,142 +0,0 @@ -#ifndef _KVI_PACKAGEFILE_H_ -#define _KVI_PACKAGEFILE_H_ -//============================================================================= -// -// File : kvi_packagefile.h -// Created on Tue 26 Dec 2006 05:33:33 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2006 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_pointerhashtable.h" -#include "kvi_qcstring.h" // QByteArray anyway -#include <qobject.h> -#include "kvi_pointerlist.h" - -class KviFile; -class QProgressDialog; -class QLabel; -class QFileInfo; - -// -// This class is used for creating KVIrc package files. -// You simply instantiate it, add some info fields, add some files and then call pack(). -// - -class KVILIB_API KviPackageIOEngine -{ -public: - KviPackageIOEngine(); - virtual ~KviPackageIOEngine(); -protected: - QString m_szLastError; - KviPointerHashTable<QString,QString> * m_pStringInfoFields; - KviPointerHashTable<QString,QByteArray> * m_pBinaryInfoFields; - QProgressDialog * m_pProgressDialog; - QLabel * m_pProgressDialogLabel; -public: - const QString & lastError(){ return m_szLastError; }; - void setLastError(const QString &szLastError){ m_szLastError = szLastError; }; - KviPointerHashTable<QString,QString> * stringInfoFields(){ return m_pStringInfoFields; }; - KviPointerHashTable<QString,QByteArray> * binaryInfoFields(){ return m_pBinaryInfoFields; }; -protected: - void showProgressDialog(const QString &szCaption,int iTotalSteps); - void hideProgressDialog(); - bool updateProgress(int iProgress,const QString &szLabel); - bool writeError(); - bool readError(); -}; - -#define KVI_PACKAGE_INFOFIELD_TYPE_STRING 1 -#define KVI_PACKAGE_INFOFIELD_TYPE_BINARYBUFFER 2 - -#define KVI_PACKAGE_DATAFIELD_TYPE_FILE 1 - -#define KVI_PACKAGE_DATAFIELD_FLAG_FILE_DEFLATE 1 - -class KVILIB_API KviPackageWriter : public KviPackageIOEngine -{ -public: - KviPackageWriter(); - virtual ~KviPackageWriter(); -protected: - - class DataField - { - public: - kvi_u32_t m_uType; - // output length of the field - kvi_u32_t m_uWrittenFieldLength; - // data fields for the File DataFieldType - bool m_bFileAllowCompression; - QString m_szFileLocalName; - QString m_szFileTargetName; - }; - - KviPointerList<DataField> * m_pDataFields; - int m_iCurrentProgress; -public: - // Adds a file to the package. The file must be specified as absolute local - // path and as target path relative to the KVIrc local directory. - // ... more ? - enum AddFileFlags { - NoCompression = 1, - FollowSymLinks = 2 - }; - bool addFile(const QString &szLocalFileName,const QString &szTargetFileName,kvi_u32_t uAddFileFlags = 0); - bool addDirectory(const QString &szLocalDirectoryName,const QString &szTargetDirectoryPrefix,kvi_u32_t uAddFileFlags = 0); - // Adds an info field as a name=value pair - void addInfoField(const QString &szName,const QString &szValue); - void addInfoField(const QString &szName,QByteArray * pArray); - // Attempts to pack everything and store it as the specified file. - // There is no mandatory extension but you *should* use KVI_FILEEXTENSION_THEMEPACKAGE for themes - // and KVI_FILEEXTENSION_ADDONPACKAGE for addons. See kvi_fileextension.h - enum PackFlags { - NoProgressDialog = 1 - }; - bool pack(const QString &szFileName,kvi_u32_t uPackFlags = 0); -private: - bool packInternal(const QString &szFileName,kvi_u32_t uPackFlags = 0); - bool packFile(KviFile * pFile,DataField * pDataField); - bool addFileInternal(const QFileInfo * fi,const QString &szLocalFileName,const QString &szTargetFileName,kvi_u32_t uAddFileFlags = 0); -}; - -class KVILIB_API KviPackageReader : public KviPackageIOEngine -{ -public: - KviPackageReader(); - virtual ~KviPackageReader(); -public: - bool readHeader(const QString &szLocalFileName); - enum UnpackFlags { - NoProgressDialog = 1 - }; - bool getStringInfoField(const QString &szName,QString &szBuffer); - bool unpack(const QString &szLocalFileName,const QString &szUnpackPath,kvi_u32_t uUnpackFlags = 0); -private: - bool unpackInternal(const QString &szLocalFileName,const QString &szUnpackPath,kvi_u32_t uUnpackFlags = 0); - bool unpackFile(KviFile * pFile,const QString &szUnpackPath); - bool readHeaderInternal(KviFile * pFile,const QString &szLocalFileName); -}; - - - -#endif //!_KVI_PACKAGEFILE_H_ diff --git a/3.4.0/src/kvilib/include/.svnignore b/3.4.0/src/kvilib/include/.svnignore deleted file mode 100644 index 1d0a3268e2..0000000000 --- a/3.4.0/src/kvilib/include/.svnignore +++ /dev/null @@ -1,19 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -*.o -*.lo -*.la -*.so -*.lai -kvirc -symlinks -*.h diff --git a/3.4.0/src/kvilib/include/Makefile.am b/3.4.0/src/kvilib/include/Makefile.am deleted file mode 100644 index 60838ee762..0000000000 --- a/3.4.0/src/kvilib/include/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - diff --git a/3.4.0/src/kvilib/irc/.svnignore b/3.4.0/src/kvilib/irc/.svnignore deleted file mode 100644 index 1612c03b91..0000000000 --- a/3.4.0/src/kvilib/irc/.svnignore +++ /dev/null @@ -1,20 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -*.o -*.lo -*.la -*.so -*.lai -kvirc -symlinks -moc_*.cpp - diff --git a/3.4.0/src/kvilib/irc/Makefile.am b/3.4.0/src/kvilib/irc/Makefile.am deleted file mode 100644 index c84487eb66..0000000000 --- a/3.4.0/src/kvilib/irc/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -EXTRA_DIST = *.cpp *.h diff --git a/3.4.0/src/kvilib/irc/kvi_avatar.cpp b/3.4.0/src/kvilib/irc/kvi_avatar.cpp deleted file mode 100644 index 3735c2f9d6..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_avatar.cpp +++ /dev/null @@ -1,165 +0,0 @@ -//============================================================================= -// -// File : kvi_avatar.cpp -// Creation date : Fri Dec 01 2000 13:58:12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_avatar.h" -#include "kvi_qstring.h" - -#include <qimage.h> - - -/* - @doc: ctcp_avatar - @title: - The AVATAR idea - @short: - Extending IRC fun: the AVATAR idea - @body: - [big]Introduction[/big] - Starting from version 3.0.0 KVIrc supports the AVATAR protocol. - The AVATAR term dictionary definitions include:[br] - - Hindu mythology incarnation of a God[br] - - Embodiment of a concept or philosophy[br] - - In [b]cyberspace communities[/b], the rappresentation of an - user in a shared virtual reality.[br] - The AVATAR protocol attempts to improve the IRC communication - by adding a method for associating a graphical rappresentation - to an IRC user.[br] - Since this may involve binary data transfers between users, - the protocol is intended to be client based. - [big]The terms[/big] - The user that wants to offer a digital rappresentation of himself - will be called "source user". The ones that will receive the notification - will be called "target users". - Every irc user can be either a source user or target user. - [big]The idea[/big] - Every irc user has a client-side property called AVATAR. Let's say that there - are two users: A and B.[br] - When user A wants to see the B's avatar he simply sends a CTCP AVATAR request - to B (the request is sent through a PRIVMSG irc command).[br] - User B replies with a CTCP AVATAR notification (sent through a NOTICE irc command) - with the name or url of his avatar.[br] - The actual syntax for the notification is:[br] - [b]AVATAR <avatar_file> [<filesize>][/b] - The <avatar_file> may be either the name of a B's local image file or an url - pointing to an image on some web server.[br] - The optional <filesize> parameter is sent only if <avatar_file> is - stored on the B's machine and there will be more info on that later.[br] - Anyway, after A has received the notification he tries to locate the avatar - file in its local cache (yes, <filesize> may help here and more on this later). - If the file can be found - and loaded then it is simply displayed in some way near the B's nickname - otherwise A must download the avatar from some place. - If the <avatar_file> contains a leading url prefix (http://) then - A fetches the image from the specified url and after that displays - it near the B's nickname. If the <avatar_file> does not contain the - leading url prefix then it is assumed that B offers this file for - downloading via DCC from his machine. In this case A may also avoid - requesting the file if the <filesize> is too large and the transfer - would occupy too much bandwidth (for example). - The DCC download is initiated by issuing a DCC GET <avatar_file> request to B. - B may then reply with a standard DCC SEND or a DCC RSEND (kvirc's extension).[br] - The implementation of the DCC GET protocol is defined by other documents here around :).[br] - [br] - The CTCP AVATAR messages can be sent to a single user , a set of users or a channel: - this depends only on the source user and how many clients he wants to reach. - [br] - There should be a convention on the image sizes: not a protocol limit. - For example, the convention could be that all the images should be smaller than - 129x129 pixels. The preferred image format is "png" (Portable Network Graphics) - since it allows good compression rates without compromising the image quality. - Other formats may be accepted as well (Theoretically this protocol could be - extended to allow movies or 3D images). - The "preferred" image size may grow with time, as the network transmission speed grows. -*/ - -KviAvatar::KviAvatar(const QString &szLocalPath,const QString &szName,QPixmap * pix) -{ - m_pPixmap = pix; - m_pScaledPixmap = 0; - if(m_pPixmap == 0)m_pPixmap = new QPixmap(32,32); // cool memory map :) - - m_bRemote = KviQString::equalCIN("http://",szName,7); - - m_szLocalPath = szLocalPath; - m_szName = szName; -} - -KviAvatar::~KviAvatar() -{ - delete m_pPixmap; - if(m_pScaledPixmap)delete m_pScaledPixmap; -} - -QPixmap * KviAvatar::scaledPixmap(unsigned int w,unsigned int h) -{ - if(((unsigned int)(m_pPixmap->width())) == w) - { - if(((unsigned int)(m_pPixmap->height())) == h) - return m_pPixmap; - } - - if(m_pScaledPixmap) - { - if((m_uLastScaleWidth == w) && (m_uLastScaleHeight == h))return m_pScaledPixmap; - delete m_pScaledPixmap; - m_pScaledPixmap = 0; - } - - int curW = m_pPixmap->width(); - int curH = m_pPixmap->height(); - - if(curW < 1)curW = 1; - if(curH < 1)curH = 1; - - m_uLastScaleWidth = w; - m_uLastScaleHeight = h; - - int scaleW = w; - int scaleH; - - /* We want to maintain the aspect of the image instead simply set - height and width. The first step is trying to adapt the image size - by "w" vaule */ - - scaleH = (curH * scaleW) / curW; - - /* Now check the resized image size. If it is too wide or too tall, - resize it again by "h" value */ - if(scaleH > h) { - scaleH = h; - scaleW = (scaleH * curW) / curH; - } - -#ifdef COMPILE_USE_QT4 - m_pScaledPixmap = new QPixmap(m_pPixmap->scaled(scaleW,scaleH)); -#else - QImage img = m_pPixmap->convertToImage(); - - m_pScaledPixmap = new QPixmap(); - m_pScaledPixmap->convertFromImage(img.smoothScale(scaleW,scaleH)); -#endif - return m_pScaledPixmap; -} diff --git a/3.4.0/src/kvilib/irc/kvi_avatar.h b/3.4.0/src/kvilib/irc/kvi_avatar.h deleted file mode 100644 index dd71ef9132..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_avatar.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef _KVI_AVATAR_H_ -#define _KVI_AVATAR_H_ - -//============================================================================= -// -// File : kvi_avatar.h -// Creation date : Fri Dec 01 2000 13:54:04 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_string.h" -#include "kvi_heapobject.h" -#include "kvi_settings.h" - -#include <qpixmap.h> - -class KVILIB_API KviAvatar : public KviHeapObject -{ -public: - KviAvatar(const QString &szLocalPath,const QString &szName,QPixmap * pix); - ~KviAvatar(); -private: - QString m_szLocalPath; - QString m_szName; - bool m_bRemote; - - QPixmap * m_pPixmap; - QPixmap * m_pScaledPixmap; - - unsigned int m_uLastScaleWidth; - unsigned int m_uLastScaleHeight; -public: - QPixmap * pixmap(){ return m_pPixmap; }; - QPixmap * scaledPixmap(unsigned int w,unsigned int h); - - bool isRemote(){ return m_bRemote; }; - - const QString &localPath(){ return m_szLocalPath; }; - const QString &name(){ return m_szName; }; - - // string that uniquely identifies this avatar - // for remote avatars that have name starting with http:// - // the name is used. - // for local avatars the localPath is used instead - const QString &identificationString(){ return m_bRemote ? m_szName : m_szLocalPath; }; - - - // if name is http://xxxx - // then identification is the name - // if name is xxx.png - // then identification is the local path - - - // name : visible name of the avatar : url or filename - // ex: http://www.kvirc.net/img/pragma.png - // ex: pragma.png - // local path : local path - // ex: /home/pragma/.kvirc/avatars/http.www.kvirc.net.img.pragma.png - // ex: /home/pragma/.kvirc/avatars/pragma.png - - // local path->name : strip leading path informations - // name->local path : replace : / and - -}; - -#endif //_KVI_AVATAR_H_ diff --git a/3.4.0/src/kvilib/irc/kvi_avatarcache.cpp b/3.4.0/src/kvilib/irc/kvi_avatarcache.cpp deleted file mode 100644 index 4de5d6c724..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_avatarcache.cpp +++ /dev/null @@ -1,250 +0,0 @@ -//============================================================================= -// -// File : kvi_avatarcache.cpp -// Created on Sat 27 Dec 2003 21:19:47 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_avatarcache.h" -#include "kvi_pointerlist.h" -#include "kvi_config.h" - -// this level triggers a cleanup -#define MAX_AVATARS_IN_CACHE 100 -// this is the level that has be reached by a cleanup -#define CACHE_GUARD_LEVEL 85 -// dictionary size -#define CACHE_DICT_SIZE 101 -// keep the unaccessed avatars for 30 days -#define MAX_UNACCESSED_TIME (3600 * 24 * 30) - - -KviAvatarCache * KviAvatarCache::m_pAvatarCacheInstance = 0; - -void KviAvatarCache::init() -{ - if(m_pAvatarCacheInstance) - { - debug("WARNING: trying to initialize the avatar cache twice"); - return; - } - - m_pAvatarCacheInstance = new KviAvatarCache(); -} - -void KviAvatarCache::done() -{ - if(!m_pAvatarCacheInstance) - { - debug("WARNING: trying to destroy an uninitialized avatar cache"); - return; - } - - delete m_pAvatarCacheInstance; - m_pAvatarCacheInstance = 0; -} - - -KviAvatarCache::KviAvatarCache() -{ - m_pAvatarDict = new KviPointerHashTable<QString,KviAvatarCacheEntry>(CACHE_DICT_SIZE,false); - m_pAvatarDict->setAutoDelete(true); -} - -KviAvatarCache::~KviAvatarCache() -{ - delete m_pAvatarDict; -} - - -void KviAvatarCache::replace(const QString &szIdString,const KviIrcMask &mask,const QString &szNetwork) -{ - QString szKey; - - mask.mask(szKey,KviIrcMask::NickCleanUserSmartNet); - szKey.append(QChar('+')); - szKey.append(szNetwork); - - KviAvatarCacheEntry * e = new KviAvatarCacheEntry; - e->szIdString = szIdString; - e->tLastAccess = kvi_unixTime(); - - m_pAvatarDict->replace(szKey,e); - - if(m_pAvatarDict->count() > MAX_AVATARS_IN_CACHE) - { - cleanup(); - } -} - -void KviAvatarCache::remove(const KviIrcMask &mask,const QString &szNetwork) -{ - QString szKey; - - mask.mask(szKey,KviIrcMask::NickCleanUserSmartNet); - szKey.append(QChar('+')); - szKey.append(szNetwork); - - m_pAvatarDict->remove(szKey); -} - - - -const QString & KviAvatarCache::lookup(const KviIrcMask &mask,const QString &szNetwork) -{ - QString szKey; - - mask.mask(szKey,KviIrcMask::NickCleanUserSmartNet); - szKey.append(QChar('+')); - szKey.append(szNetwork); - - KviAvatarCacheEntry * e = m_pAvatarDict->find(szKey); - if(!e)return KviQString::empty; - e->tLastAccess = kvi_unixTime(); - return e->szIdString; -} - -void KviAvatarCache::load(const QString &szFileName) -{ - m_pAvatarDict->clear(); - - KviConfig cfg(szFileName,KviConfig::Read); - - kvi_time_t tNow = kvi_unixTime(); - - KviConfigIterator it(*(cfg.dict())); - - int cnt = 0; - - while(it.current()) - { - cfg.setGroup(it.currentKey()); - - kvi_time_t tLastAccess = cfg.readUIntEntry("LastAccess",0); - if((tNow - tLastAccess) < MAX_UNACCESSED_TIME) - { - QString szIdString = cfg.readQStringEntry("Avatar",""); - - if(!szIdString.isEmpty()) - { - KviAvatarCacheEntry * e = new KviAvatarCacheEntry; - e->tLastAccess = tLastAccess; - e->szIdString = szIdString; - m_pAvatarDict->replace(it.currentKey(),e); - cnt++; - if(cnt >= MAX_AVATARS_IN_CACHE)return; // done - } - } - ++it; - } -} - -void KviAvatarCache::save(const QString &szFileName) -{ - KviConfig cfg(szFileName,KviConfig::Write); -// cfg.clear(); // not needed with KviConfig::Write - - KviPointerHashTableIterator<QString,KviAvatarCacheEntry> it(*m_pAvatarDict); - - while(KviAvatarCacheEntry * e = it.current()) - { - if(e->tLastAccess) - { - cfg.setGroup(it.currentKey()); - cfg.writeEntry("Avatar",e->szIdString); - cfg.writeEntry("LastAccess",((unsigned int)(e->tLastAccess))); - } - ++it; - } -} - -void KviAvatarCache::cleanup() -{ - // first do a quick run deleting the avatars really too old - KviPointerHashTableIterator<QString,KviAvatarCacheEntry> it(*m_pAvatarDict); - - kvi_time_t tNow = kvi_unixTime(); - - KviPointerList<QString> l; - l.setAutoDelete(false); - - KviAvatarCacheEntry * e; - - while((e = it.current())) - { - if((tNow - e->tLastAccess) > MAX_UNACCESSED_TIME) - { - l.append(new QString(it.currentKey())); - } - ++it; - } - - for(QString *s = l.first();s;s = l.next())m_pAvatarDict->remove(*s); - - if(m_pAvatarDict->count() < CACHE_GUARD_LEVEL)return; - - // not done.. need to kill the last accessed :/ - - it.toFirst(); - - KviPointerList<KviAvatarCacheEntry> ll; - ll.setAutoDelete(true); - - // here we use the cache entries in another way - // szAvatar is the KEY instead of the avatar name - - while((e = it.current())) - { - KviAvatarCacheEntry * current = ll.first(); - unsigned int idx = 0; - while(current) - { - // if the current is newer than the inserted one - // then stop searching and insert it just before - if(current->tLastAccess > e->tLastAccess)break; - // otherwise the current is older and the inserted - // one goes after - current = ll.next(); - idx++; - } - - KviAvatarCacheEntry * xx = new KviAvatarCacheEntry; - xx->szIdString = it.currentKey(); - xx->tLastAccess = e->tLastAccess; - - if(current)ll.insert(idx,xx); - else ll.append(xx); - ++it; - } - - // the oldest keys are at the beginning - int uRemove = ll.count() - CACHE_GUARD_LEVEL; - if(uRemove < 1)return; // huh ? - - // remember that szAvatar contains the key! - for(e = ll.first();e && (uRemove > 0);e = ll.next()) - { - m_pAvatarDict->remove(e->szIdString); - uRemove--; - } - // now we should be ok -} diff --git a/3.4.0/src/kvilib/irc/kvi_avatarcache.h b/3.4.0/src/kvilib/irc/kvi_avatarcache.h deleted file mode 100644 index 2eb14092ec..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_avatarcache.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef _KVI_AVATARCACHE_H_ -#define _KVI_AVATARCACHE_H_ -//============================================================================= -// -// File : kvi_avatarcache.h -// Created on Sat 27 Dec 2003 21:19:47 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_time.h" -#include "kvi_ircmask.h" - -#include "kvi_pointerhashtable.h" - - -typedef struct _KviAvatarCacheEntry -{ - QString szIdString; - kvi_time_t tLastAccess; -} KviAvatarCacheEntry; - - - -class KVILIB_API KviAvatarCache -{ -protected: - KviAvatarCache(); - ~KviAvatarCache(); -public: - KviPointerHashTable<QString,KviAvatarCacheEntry> * m_pAvatarDict; -protected: - static KviAvatarCache * m_pAvatarCacheInstance; -public: - static void init(); - static void done(); - - static KviAvatarCache * instance(){ return m_pAvatarCacheInstance; }; - - void replace(const QString &szIdString,const KviIrcMask &mask,const QString &szNetwork); - void remove(const KviIrcMask &mask,const QString &szNetwork); - const QString & lookup(const KviIrcMask &mask,const QString &szNetwork); - - void cleanup(); - - void load(const QString &szFileName); - void save(const QString &szFileName); -}; - - -#endif //!_KVI_AVATARCACHE_H_ diff --git a/3.4.0/src/kvilib/irc/kvi_ircmask.cpp b/3.4.0/src/kvilib/irc/kvi_ircmask.cpp deleted file mode 100644 index 50afe3dedc..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_ircmask.cpp +++ /dev/null @@ -1,760 +0,0 @@ -//============================================================================= -// -// File : kvi_ircuser.cpp -// Creation date : Fri Jan 8 1999 20:56:07 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_debug.h" -#include "kvi_ircmask.h" - -/* - @doc: irc_masks - @title: - Irc masks - @type: - generic - @short: - Decription of the standard IRC masks - @keyterms: - irc masks , nickname , username , hostname , wildcard - @body: - [big]Simple masks[/big][br] - An irc mask is a string in a special format that identifies an user on irc.[br] - The standard basic format is:[br] - [b]<nick>!<username>@<host>[/b][br] - The <nick> part contains the nickname with that the user is widely known across the network.[br] - The nickname format is generally restricted by the irc network rules: usually it has a maximum - length (9 on actual IrcNet servers for example), and can contain only a defined set of characters. - Just as example, the character '!' obviously can't be included in a nickname.[br] - The <username> part is the machine username of the remote user: this is usually - retrieved by the irc server at connect time by contacting the ident service on the user's machine. - Some IRC servers allow specifying this username inside the login messages and do not connect - to the ident service at all.[br] - The <username> often has a special prefix character added by the irc server:[br] - this is rather server specific protocol , but the prefixes are somewhat standardized and - the common meanings of them are:[br] - noprefix: I line with ident[br] - ^: I line with OTHER type ident[br] - ~: I line, no ident[br] - +: i line with ident[br] - =: i line with OTHER type ident[br] - -: i line, no ident[br] - So finally you can find <username> strings like "~pragma" or "^pragma", where "pragma" - is the system username of the irc-user and ~ and ^ are prefixes.[br] - The <host> part is the hostname of the remote user.[br] - In most cases it is the human-readable format of the host name, but sometimes - it happens to be an IP-address (when the host has no reverse dns entry).[br] - The IP address can be either in IPV4 format or in IPV6 format.[br] - Some (weird from my point of view) servers hide certain parts of the IP address to - prevent attacks to the user's machine.[br] - Here are some examples of full irc-masks:[br] - Pragma!^pragma@staff.kvirc.net[br] - [jazz]!~jazz@jazz.myhome.com[br] - luke!=skywalker@212.213.41.12[br] - HAN!^solo@ff0f:a0a0:1011::ea80:1[br] - Darth!vader@210.11.12.XXX[br] - The irc-masks are [b]case insensitive[/b].[br] - [br] - [big]Wildcard masks[/big][br] - In some contexts the irc-masks can contain '*' and '?' wildcards.[br] - The wild masks are used to "match" an user within a set of them.[br] - '*' matches any sequence (eventually empty) of characters and '?' matches a single character.[br] - Wildcards are allowed only in the <nick> , <user> and <host> part: so the - "wildest" mask possible is:[br] - [b]*!*@*[/b][br] - that designates "any nickname, any username on any host".[br] - Here are some examples of wild masks:[br] - Pragma!*pragma@212.101.102.*: matches any user with nickname "Pragma" , username that ends with "pragma" and - coming from any machine on the 212.101.102 network.[br] - *!solo@*.starwars.org: matches any nick with username solo (no prefix!) coming from any machine in - the starwars.org domain.[br] - Pragma!*@*: matches any user with nickname "Pragma".[br] -*/ - -/* -const char * KviIrcMask::setMask(const char *szMask,char c) -{ - __range_valid(szMask); - //nick!username@host.top - //0123456789 - register const char *p=szMask; - //Run over nick.... - while(*p && (*p != '!'))p++; - int len = p - szMask; - if(len > 0){ - m_nick_ptr = (char *)kvi_realloc(m_nick_ptr,len+1); - kvi_memmove((void *)m_nick_ptr,(void *)szMask,len); - } else { //Empty nick...set it to "*" - len = 1; - m_nick_ptr = (char *)kvi_realloc(m_nick_ptr,len+1); - kvi_memmove((void *)m_nick_ptr,(void *)"*",len); - } - *(m_nick_ptr+len) = '\0'; //With zero length nick it will be just an empty-string - if(!(*p)){ - setHost("*"); - setUsername("*"); - return p; - } - szMask = ++p; - //The username - while(*p && (*p != '@'))p++; - len = p - szMask; - if(len > 0){ - m_user_ptr = (char *)kvi_realloc(m_user_ptr,len+1); - kvi_memmove((void *)m_user_ptr,(void *)szMask,len); - } else { - len = 1; - m_user_ptr = (char *)kvi_realloc(m_user_ptr,len+1); - kvi_memmove((void *)m_user_ptr,(void *)"*",len); - } - *(m_user_ptr+len) = '\0'; - if(!(*p)){ - setHost("*"); - return p; - } - szMask = ++p; - //And finally the host - while(*p && (*p != c))p++; - len = p - szMask; - if(len > 0){ - m_host_ptr = (char *)kvi_realloc(m_host_ptr,len+1); - kvi_memmove((void *)m_host_ptr,(void *)szMask,len); - } else { - len = 1; - m_host_ptr = (char *)kvi_realloc(m_host_ptr,len+1); - kvi_memmove((void *)m_host_ptr,(void *)"*",len); - } - *(m_host_ptr+len) = '\0'; - return p; -} - -const char * KviIrcMask::setUserhostMask(const char *szMask) -{ - __range_valid(szMask); - //nick[*]=<+!->username@host.top - //0123456789 - register const char *p=szMask; - // Run over nick.... - while(*p && (*p != '*') && (*p != '=') && (!isspace(*p)))p++; - // extract it - int len = p - szMask; - if(len > 0){ - m_nick_ptr = (char *)kvi_realloc(m_nick_ptr,len+1); - kvi_memmove((void *)m_nick_ptr,(void *)szMask,len); - } else { //Empty nick...set it to "*" - len = 1; - m_nick_ptr = (char *)kvi_realloc(m_nick_ptr,len+1); - kvi_memmove((void *)m_nick_ptr,(void *)"*",len); - } - *(m_nick_ptr+len) = '\0'; //With zero length nick it will be just an empty-string - // now skip all the flags - while(*p && ((*p=='*')||(*p=='=')||(*p=='+')||(*p=='-')) && (!isspace(*p)))p++; - // check... - if((!(*p)) || isspace(*p)){ - // ooops , finished or isspace - setHost("*"); - setUsername("*"); - while(*p && isspace(*p))p++; - return p; - } - - szMask = p; - //The username - while(*p && (*p != '@') && (!isspace(*p)))p++; - len = p - szMask; - if(len > 0){ - m_user_ptr = (char *)kvi_realloc(m_user_ptr,len+1); - kvi_memmove((void *)m_user_ptr,(void *)szMask,len); - } else { - len = 1; - m_user_ptr = (char *)kvi_realloc(m_user_ptr,len+1); - kvi_memmove((void *)m_user_ptr,(void *)"*",len); - } - *(m_user_ptr+len) = '\0'; - - if((!(*p))||isspace(*p)){ - // oops finished or isspace - setHost("*"); - while(*p && isspace(*p))p++; - return p; - } - szMask = ++p; - //And finally the host - while(*p && (!isspace(*p)))p++; - len = p - szMask; - if(len > 0){ - m_host_ptr = (char *)kvi_realloc(m_host_ptr,len+1); - kvi_memmove((void *)m_host_ptr,(void *)szMask,len); - } else { - len = 1; - m_host_ptr = (char *)kvi_realloc(m_host_ptr,len+1); - kvi_memmove((void *)m_host_ptr,(void *)"*",len); - } - *(m_host_ptr+len) = '\0'; - while(*p && isspace(*p))p++; - return p; -} - -*/ - -KviIrcMask::KviIrcMask() -{ - m_szHost = m_szWild; - m_szUser = m_szWild; - m_szNick = m_szWild; -} - -KviIrcMask::KviIrcMask(const QString &szMask) -{ - static QString szWild("*"); - const QChar * b = KviQString::nullTerminatedArray(szMask); - if(b) - { - const QChar * p = b; - while(p->unicode() && (p->unicode() != '!'))p++; - if(p->unicode()) - { - if(p != b) - { - m_szNick.setUnicode(b,p-b); - } else { - m_szNick = szWild; // ??? - } - } else { - if(p != b)m_szNick.setUnicode(b,p-b); - else m_szNick = szWild; // ??? - m_szUser = szWild; - m_szHost = szWild; - return; - } - p++; - b = p; - while(p->unicode() && (p->unicode() != '@'))p++; - if(p->unicode()) - { - if(p != b) - { - m_szUser.setUnicode(b,p-b); - } else { - m_szUser = szWild; // ??? - } - } else { - if(p != b)m_szUser.setUnicode(b,p-b); - else m_szUser = szWild; // ??? - m_szHost = szWild; - return; - } - p++; - b=p; - while(p->unicode())p++; - if(p != b) - { - m_szHost.setUnicode(b,p-b); - } else { - m_szHost = szWild; // ??? - } - - } else { - m_szUser = szWild; - m_szHost = szWild; - m_szNick = szWild; - } -} - -QString KviIrcMask::m_szWild("*"); - -bool KviIrcMask::hasNumericHost() const -{ - const QChar * p = KviQString::nullTerminatedArray(m_szHost); - if(!p)return false; - int nPoints = 0; - int nDoublePoints = 0; - unsigned short uc; - while((uc = p->unicode())) - { - if(uc == '.')nPoints++; // ipv6 masks can contain dots too! - else { - if(uc == ':')nDoublePoints++; - else { - if((uc < '0') || (uc > '9')) - { -#ifdef COMPILE_USE_QT4 - uc = p->toUpper().unicode(); -#else - uc = p->upper().unicode(); -#endif - if((uc < 'A') || (uc > 'F'))return false; - } - } - } - p++; - } - return ((nPoints == 3) || (nDoublePoints > 1)); -} - - -/** -* Retuns in szMask the specified (if possible) mask of this user.<br> -* If the host or username are not known , the mask may contain less information -* than requested.<br> -* Mask types:<br> -* 0 : nick!user@machine.host.top (nick!user@XXX.XXX.XXX.XXX) (default)<br> -* 1 : nick!user@*.host.top (nick!user@XXX.XXX.XXX.*)<br> -* 2 : nick!user@*<br> -* 3 : nick!*@machine.host.top (nick!user@XXX.XXX.XXX.XXX)<br> -* 4 : nick!*@*.host.top (nick!user@XXX.XXX.XXX.*)<br> -* 5 : nick!*@*<br> -* 6 : *!user@machine.host.top (*!user@XXX.XXX.XXX.XX)<br> -* 7 : *!user@*.host.top (*!user@XXX.XXX.XXX.*)<br> -* 8 : *!user@*<br> -* 9 : *!*@machine.host.top (*!*@XXX.XXX.XXX.XXX)<br> -* 10: *!*@*.host.top (*!*@XXX.XXX.XXX.*)<br> -* 11: nick!*user@machine.host.top (nick!*user@machine.host.top)<br> -* 12: nick!*user@*.host.top (nick!*user@*.host.top)<br> -* 13: nick!*user@*<br> -* 14: *!*user@machine.host.top (*!*user@machine.host.top)<br> -* 15: *!*user@*.host.top (*!*user@*.host.top)<br> -* 16: *!*user@*<br> -* 17: nick!~user@*.host.top (nick!~user@XXX.XXX.*) -* 18: nick!*@*.host.top (nick!*@XXX.XXX.*) -* 19: *!~user@*.host.top (*!~user@XXX.XXX.*) -* 20: nick!*user@*.host.top (nick!*user@XXX.XXX.*) -* 21: *!*user@*.host.top (*!user@*XXX.XXX.*) -* smart versions of the masks 17-21 that try take care of masked ip addresses -* in the form xxx.xxx.INVALID-TOP-MASK -* 22: nick!~user@*.host.top (nick!~user@XXX.XXX.*) -* 23: nick!*@*.host.top (nick!*@XXX.XXX.*) -* 24: *!~user@*.host.top (*!~user@XXX.XXX.*) -* 25: nick!*user@*.host.top (nick!*user@XXX.XXX.*) -* 26: *!*user@*.host.top (*!user@*XXX.XXX.*) -* If some data is missing , these types may change:<br> -* For example , if hostname is missing , the mask type 3 or 4 may be reduced to type 5 -*/ - -/* -** ident is fun.. ahem -** prefixes used: -** none I line with ident -** ^ I line with OTHER type ident -** ~ I line, no ident -** + i line with ident -** = i line with OTHER type ident -** - i line, no ident -*/ - -static unsigned char maskTable[27][3] = { - { 0 , 0 , 0 }, //0 means normal block - { 0 , 0 , 2 }, //2 in the third field means type *.abc.host.top (or XXX.XXX.XXX.*) host mask - { 0 , 0 , 1 }, //2 in the second field means *user (strip prefixes) - { 0 , 1 , 0 }, //1 means * - { 0 , 1 , 2 }, //3 in the third field means type *.host.top (or XXX.XXX.*) host mask - { 0 , 1 , 1 }, //4 in the third field is like 3 but tries to detect masked ip addresses too - { 1 , 0 , 0 }, - { 1 , 0 , 2 }, - { 1 , 0 , 1 }, - { 1 , 1 , 0 }, - { 1 , 1 , 2 }, - { 0 , 2 , 0 }, - { 0 , 2 , 2 }, - { 0 , 2 , 1 }, - { 1 , 2 , 0 }, - { 1 , 2 , 2 }, - { 1 , 2 , 1 }, - { 0 , 0 , 3 }, - { 0 , 1 , 3 }, - { 1 , 0 , 3 }, - { 0 , 2 , 3 }, - { 1 , 2 , 3 }, - { 0 , 0 , 4 }, - { 0 , 1 , 4 }, - { 1 , 0 , 4 }, - { 0 , 2 , 4 }, - { 1 , 2 , 4 } -}; - -void KviIrcMask::mask(QString &szMask,MaskType eMaskType) const -{ - if((((int)eMaskType) > 26)||(((int)eMaskType) < 0))eMaskType = NickUserHost; - szMask = maskTable[((int)eMaskType)][0] ? m_szWild : m_szNick; - szMask.append("!"); - switch(maskTable[((int)eMaskType)][1]) - { - case 0: - szMask.append(m_szUser); - break; - case 1: - szMask.append(m_szWild); - break; - default: - if (m_szUser.length() > 0) { - if(m_szUser[0].unicode() != '*') - szMask.append(m_szWild); - if ((m_szUser[0].unicode() == '~') || - (m_szUser[0].unicode() == '^') || - (m_szUser[0].unicode() == '+') || - (m_szUser[0].unicode() == '-') || - (m_szUser[0].unicode() == '='))szMask.append(m_szUser.right(m_szUser.length() - 1)); - else - szMask.append(m_szUser); - } - break; - } - szMask.append('@'); - switch(maskTable[((int)eMaskType)][2]) - { - case 0: - szMask.append(m_szHost); - break; - case 1: - szMask.append(m_szWild); - break; - case 2: - if(m_szHost != m_szWild) - { - if(hasNumericHost()) - { - QString szHost(m_szHost.left(getIpDomainMaskLen())); - szMask.append(szHost); - szMask.append(m_szWild); - } else { - szMask.append(m_szWild); - szMask.append(getHostDomainMask()); - } - } else { - szMask.append(m_szWild); - } - break; - case 3: - if(m_szHost != m_szWild) - { - if(hasNumericHost()) - { - QString szHost(m_szHost.left(getLargeIpDomainMaskLen())); - szMask.append(szHost); - szMask.append(m_szWild); - } else { - szMask.append(m_szWild); - szMask.append(getLargeHostDomainMask()); - } - } else { - szMask.append(m_szWild); - } - break; - default: // case 4 and others - if(m_szHost != m_szWild) - { - if(hasNumericHost() || hasMaskedIp()) - { - QString szHost(m_szHost.left(getLargeIpDomainMaskLen())); - szMask.append(szHost); - szMask.append(m_szWild); - } else { - szMask.append(m_szWild); - szMask.append(getLargeHostDomainMask()); - } - } else { - szMask.append(m_szWild); - } - break; - } -} - - -/* -bool KviIrcMask::matches(const char *szMask) -{ - const char * ret1; - const char * ret2; - - if(kvi_matchWildExprWithTerminator(szMask,m_nick_ptr,'!',&ret1,&ret2)) - { - if(*ret1 == '!') - { - ret1++; - if(kvi_matchWildExprWithTerminator(ret1,m_user_ptr,'@',&ret1,&ret2)) - { - if(*ret1 == '@') - { - ret1++; - return kvi_matchWildExpr(ret1,m_host_ptr); - } - } - } - } - return false; -} -*/ - -/* -bool KviIrcMask::matchesFixed(const char *szMask) const -{ - const char * ret1; - const char * ret2; - - if(kvi_matchStringWithTerminator(m_nick_ptr,szMask,'!',&ret1,&ret2)) - { - if(*ret2 == '!') - { - ret2++; - if(kvi_matchStringWithTerminator(m_user_ptr,ret2,'@',&ret1,&ret2)) - { - if(*ret2 == '@') - { - ret2++; - return kvi_matchString(m_host_ptr,ret2); - } - } - } - } - return false; -} -*/ - -/* -bool KviIrcMask::matchedBy(const QString &szMask) const -{ - const char * ret1; - const char * ret2; - - if(kvi_matchStringWithTerminator(szMask,m_nick_ptr,'!',&ret1,&ret2)) - { - if(*ret1 == '!') - { - ret1++; - if(kvi_matchStringWithTerminator(ret1,m_user_ptr,'@',&ret1,&ret2)) - { - if(*ret1 == '@') - { - ret1++; - return kvi_matchString(ret1,m_host_ptr); - } - } - } - } - return false; -} -*/ - -bool KviIrcMask::matches(const KviIrcMask &mask) const -{ - if(KviQString::matchWildExpressionsCI(m_szNick,mask.m_szNick)) - { - if(KviQString::matchWildExpressionsCI(m_szUser,mask.m_szUser)) - { - if(KviQString::matchWildExpressionsCI(m_szHost,mask.m_szHost))return true; - } - } - return false; -} - -bool KviIrcMask::matchesFixed(const KviIrcMask &mask) const -{ - if(KviQString::matchStringCI(m_szNick,mask.m_szNick,0,1)) - { - if(KviQString::matchStringCI(m_szUser,mask.m_szUser,0,1)) - { - if(KviQString::matchStringCI(m_szHost,mask.m_szHost,0,1))return true; - } - } - return false; -} - -/* -bool KviIrcMask::matches(const char * nick,const char * user,const char * host) -{ - if(nick) - { - if(!kvi_matchWildExpr(m_nick_ptr,nick))return false; - } - - if(user) - { - if(!kvi_matchWildExpr(m_user_ptr,user))return false; - } - - if(host) - { - if(!kvi_matchWildExpr(m_host_ptr,host))return false; - } - return true; -} -*/ - -bool KviIrcMask::matchesFixed(const QString &nick,const QString &user,const QString &host) const -{ - if(!KviQString::matchStringCI(m_szNick,nick,0,1))return false; - if(!KviQString::matchStringCI(m_szUser,user,0,1))return false; - if(!KviQString::matchStringCI(m_szHost,host,0,1))return false; - return true; -} - -//Internals for mask() - -int KviIrcMask::getIpDomainMaskLen() const -{ - int len = m_szHost.length(); - const QChar *p = m_szHost.unicode(); - const QChar *b = p; - p += len; - if(b < p) - { - p--; - while((b < p) && (p->unicode() != '.') && (p->unicode() != ':'))p--; - } - // 000.000.000.000 - // p - // - return (p == b) ? 0 : ((p-b) + 1); -} - - -int KviIrcMask::getLargeIpDomainMaskLen() const -{ - int len = m_szHost.length(); - const QChar *p = m_szHost.unicode(); - const QChar *b = p; - p += len; - if(b < p) - { - p--; - while((b < p) && (p->unicode() != '.') && (p->unicode() != ':'))p--; - if(b < p) - { - p--; - while((b < p) && (p->unicode() != '.') && (p->unicode() != ':'))p--; - } - } - // 000.000.000.000 - // p - // - return (p == b) ? 0 : ((p-b) + 1); -} - -QString KviIrcMask::getHostDomainMask() const -{ - int len = m_szHost.length(); - const QChar *p=KviQString::nullTerminatedArray(m_szHost); - if(!p)return QString::null; - const QChar *b = p; - while(p->unicode() && p->unicode() != '.')p++; - QString ret(p,len - (p - b)); - return ret; -} - - -QString KviIrcMask::getLargeHostDomainMask() const -{ - int len = m_szHost.length(); - const QChar *p = m_szHost.unicode(); - const QChar *b = p; - p += len; - - if(b < p) - { - p--; - while((b < p) && (p->unicode() != '.'))p--; - if(b < p) - { - p--; - while((b < p) && (p->unicode() != '.'))p--; - } - } - - // xyz.klm.abc.host.top - // p - - QString ret(p,len - (p - b)); - return ret; -} - -// this is just a GUESS and must be called AFTER making sure that it is NOT a plain numeric IP -bool KviIrcMask::hasMaskedIp() const -{ - int len = m_szHost.length(); - const QChar *p = m_szHost.unicode(); - const QChar *b = p; - if(len == 0)return false; - //run to the end - p += len; - const QChar *e = p; - p--; - while((b < p) && (p->unicode() != '.'))p--; - return ((e - p) > 4); // at the moment 4 should be enough : the largest top part is "name" -} - - -bool KviIrcMask::operator==(const KviIrcMask &user) -{ - if(KviQString::equalCI(m_szNick,user.m_szNick)) - { - if(KviQString::equalCI(m_szUser,user.m_szUser)) - { - if(KviQString::equalCI(m_szHost,user.m_szHost))return true; - } - } - return false; -} - -bool KviIrcMask::hasWildNick() -{ - const QChar * aux = KviQString::nullTerminatedArray(m_szNick); - if(!aux)return false; - unsigned short uc; - while((uc = aux->unicode())) - { - if((uc == '*') || (uc == '?'))return true; - aux++; - } - return false; -} - -int KviIrcMask::nonWildChars() -{ - int iCnt = 0; - const QChar * aux = KviQString::nullTerminatedArray(m_szNick); - if(!aux)return 0; - unsigned short uc; - - while((uc = aux->unicode())) - { - if((uc != '*') && (uc != '?'))iCnt++; - aux++; - } - - aux = KviQString::nullTerminatedArray(m_szUser); - while((uc = aux->unicode())) - { - if((uc != '*') && (uc != '?'))iCnt++; - aux++; - } - - - aux = KviQString::nullTerminatedArray(m_szHost); - while((uc = aux->unicode())) - { - if((uc != '*') && (uc != '?'))iCnt++; - aux++; - } - return iCnt; -} diff --git a/3.4.0/src/kvilib/irc/kvi_ircmask.h b/3.4.0/src/kvilib/irc/kvi_ircmask.h deleted file mode 100644 index bded395c79..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_ircmask.h +++ /dev/null @@ -1,164 +0,0 @@ -#ifndef _KVI_IRCMASK_H_ -#define _KVI_IRCMASK_H_ - -//============================================================================= -// -// File : kvi_ircmask.h -// Creation date : Fri Jan 8 1999 19:50:35 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - -// originally this file was named kvi_ircuser.h and the class was KviIrcUser -// ported to UNICODE on 2004.10.28 1:50 am - -#include "kvi_settings.h" -#include "kvi_heapobject.h" -#include "kvi_qstring.h" - -//============================================================================= -// Irc user mask abstraction -//============================================================================= - -class KVILIB_API KviIrcMask : public KviHeapObject -{ - friend class KviIrcUserList; - friend class KviIrcUserChanList; -private: - QString m_szNick; - QString m_szUser; - QString m_szHost; - static QString m_szWild; -public: - // Sets the nick for this user.<br> - // If szNick is NULL or it points to an empty string the nick is set to "*".<br> - void setNick(const QString &szNick){ m_szNick = szNick.isEmpty() ? m_szWild : szNick; }; - // Sets the username for this user.<br> - // If szUsername is NULL or it points to an empty string the username is set to "*".<br> - void setUsername(const QString &szUser){ m_szUser = szUser.isEmpty() ? m_szWild : szUser; }; - void setUser(const QString &szUser){ m_szUser = szUser.isEmpty() ? m_szWild : szUser; }; - // Sets the host for this user.<br> - // If szHost is NULL or it points to an empty string the host is set to "*".<br> - void setHost(const QString &szHost){ m_szHost = szHost.isEmpty() ? m_szWild : szHost; }; - // Sets the host , nick and username extracting it from an irc mask:<br> - // nick!user@host<br> - // The mask is terminated by end-of string null character or a character equal to c in the string.<br> - // Returns the pointer to the end of the mask in the szMask string.(c or null-terminator)<br> - //const char * setMask(const QString &szMask,char c=' '); - // Sets the host , nick and username extracting it from an userhost mask:<br> - // nick[*]=<+|->user@host<br> - // The mask is terminated by end-of string null char or a space character.<br> - // Returns the pointer to the next non-space char in the szMask string or to the null-terminator<br> - // If there are no more masks avaiable. - // WARNING : the szMask pointer can NOT be NULL - //const char *setUserhostMask(const QString &szMask); - // Returns the nick of this user.<br> - // In the worst case you get a string == "*"<br> - const QString &nick() const { return m_szNick; }; - // DEPRECATED! - const QString &username() const { return m_szUser; }; - const QString &user() const { return m_szUser; }; - const QString &host() const { return m_szHost; }; - - bool hasUser() const { return !(m_szUser.isEmpty() || (m_szUser == m_szWild)); }; - bool hasHost() const { return !(m_szHost.isEmpty() || (m_szHost == m_szWild)); }; - - bool hasNumericHost() const; - // Retuns in szMask the specified (if possible) mask of this user.<br> - // If the host or username are not known , the mask may contain less information - // than requested.<br> - - enum MaskType - { - NickUserHost = 0, // nick!~user@machine.host.top (nick!~user@XXX.XXX.XXX.XXX) (default) - NickUserNet = 1, // 1 : nick!~user@*.abc.host.top (nick!~user@XXX.XXX.XXX.*) - NickUser = 2, // 2 : nick!~user@* - NickHost = 3, // 3 : nick!*@machine.host.top (nick!*@XXX.XXX.XXX.XXX) - NickNet = 4, // 4 : nick!*@*.abc.host.top (nick!*@XXX.XXX.XXX.*) - Nick = 5, // 5 : nick!*@* - UserHost = 6, // 6 : *!~user@machine.host.top (*!~user@XXX.XXX.XXX.XXX) - UserNet = 7, // 7 : *!~user@*.abc.host.top (*!~user@XXX.XXX.XXX.*) - User = 8, // 8 : *!~user@* - Host = 9, // 9 : *!*@machine.host.top (*!*@XXX.XXX.XXX.XXX) - Net = 10, // 10: *!*@*.abc.host.top (*!*@XXX.XXX.XXX.*) - NickCleanUserHost = 11, // 11 : nick!*user@machine.host.top (nick!*user@XXX.XXX.XXX.XXX) - NickCleanUserNet = 12, // 12 : nick!*user@*.abc.host.top (nick!*user@XXX.XXX.XXX.*) - NickCleanUser = 13, // 13 : nick!*user@* - CleanUserHost = 14, // 14 : *!*user@machine.host.top (*!user@*XXX.XXX.XXX.XXX) - CleanUserNet = 15, // 15 : *!*user@*.abc.host.top (*!user@*XXX.XXX.XXX.*) - CleanUser = 16, // 16 : *!*user@* - NickUserLargeNet = 17, // 17 : nick!~user@*.host.top (nick!~user@XXX.XXX.*) - NickLargeNet = 18, // 18 : nick!*@*.host.top (nick!*@XXX.XXX.*) - UserLargeNet = 19, // 19 : *!~user@*.host.top (*!~user@XXX.XXX.*) - NickCleanUserLargeNet = 20, // 20 : nick!*user@*.host.top (nick!*user@XXX.XXX.*) - CleanUserLargeNet = 21, // 21 : *!*user@*.host.top (*!user@*XXX.XXX.*) - // smart versions of the masks 17-21 that try take care of masked ip addresses - // in the form xxx.xxx.INVALID-TOP-MASK - NickUserSmartNet = 22, // 22 : nick!~user@*.host.top (nick!~user@XXX.XXX.*) - NickSmartNet = 23, // 23 : nick!*@*.host.top (nick!*@XXX.XXX.*) - UserSmartNet = 24, // 24 : *!~user@*.host.top (*!~user@XXX.XXX.*) - NickCleanUserSmartNet = 25, // 25 : nick!*user@*.host.top (nick!*user@XXX.XXX.*) - CleanUserSmartNet = 26 // 26 : *!*user@*.host.top (*!user@*XXX.XXX.*) - }; - - void mask(QString &szMask,MaskType eMaskType = NickCleanUserHost) const; - bool hasWildNick(); - - // Wild external matches (this and external are wild) - -// bool matches(const char *szMask); -// // passing 0 as one of params here means that it is a match by default -// bool matches(const char *nick,const char *user,const char *host); - bool matches(const KviIrcMask &mask) const; - - - // Fixed external matches (this is wild , external is fixed) - bool matchesFixed(const QString &nick,const QString &user,const QString &host) const; -// bool matchesFixed(const QString &szMask) const; - bool matchesFixed(const KviIrcMask &mask) const; - - // Fixed internal matches (this is fixed , external is wild) - //bool matchedBy(const QString &szMask) const; - bool matchedBy(const KviIrcMask &mask) const { return mask.matchesFixed(*this); }; - - int nonWildChars(); - bool operator==(const KviIrcMask &user); -public: - // Constructs an empty mask (*!*@*) - KviIrcMask(); - // Constructs this KviIrcMask object from a string mask - KviIrcMask(const QString &szMask); - // Carbon copy - KviIrcMask(const KviIrcMask &ircUser) - : m_szNick(ircUser.m_szNick), m_szUser(ircUser.m_szUser), m_szHost(ircUser.m_szHost) {}; - KviIrcMask(const QString &nick,const QString &user,const QString &host) - : m_szNick(nick), m_szUser(user), m_szHost(host) {}; -private: - int getIpDomainMaskLen() const; - QString getHostDomainMask() const; - int getLargeIpDomainMaskLen() const; - QString getLargeHostDomainMask() const; - // this is just a GUESS and must be called AFTER making sure that it is NOT a plain numeric IP - bool hasMaskedIp() const; -}; - - - - -#endif //_KVI_IRCMASK_H_ diff --git a/3.4.0/src/kvilib/irc/kvi_ircserver.cpp b/3.4.0/src/kvilib/irc/kvi_ircserver.cpp deleted file mode 100644 index 373738ed48..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_ircserver.cpp +++ /dev/null @@ -1,373 +0,0 @@ -//============================================================================= -// -// File : kvi_ircserver.cpp -// Creation date : Mon Jul 10 2000 03:42:59 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - -#include "kvi_ircserver.h" -#include "kvi_malloc.h" - -#include "kvi_config.h" -#include "kvi_nickserv.h" -#include "kvi_time.h" -#include "kvi_proxydb.h" -#include <stdlib.h> - -// This is not allowed on windows unless we force the symbol to be undefined -// It works on linux since gcc allows undefined symbols by default -// but it is also "theoretically" wrong: -// kvilib is not linked to kvirc: it's kvirc being linked to kvilib -// thus kvilib should not depend on symbols defined in the kvirc core. -// We must find another way to do that (like having just the id and finding -// the proxy in the kvirc core, or just passing the pointer to the db from outside). -// Pragma - -//extern KVIRC_API KviProxyDataBase * g_pProxyDataBase; - -// FIXME: This should be renamed to KviServer or sth like that -KviIrcServer::KviIrcServer() -{ - m_pReconnectInfo=0; - m_uFlags = 0; - m_uPort = 6667; - m_pChannelList = 0; - m_bAutoConnect = false; - m_iProxy = -1; -} - -KviProxy* KviIrcServer::proxyServer(KviProxyDataBase * pDb) -{ - int i=0; - if(proxy()<0) return 0; - KviPointerList<KviProxy> * proxylist = pDb->proxyList(); - for(KviProxy * p = proxylist->first();p;p = proxylist->next()) - { - if(i==proxy()) return p; - i++; - } - return 0; -} - -KviIrcServer::KviIrcServer(const KviIrcServer &serv) -{ - m_pReconnectInfo = 0; - m_szHostname = serv.m_szHostname; - m_szIp = serv.m_szIp; - m_szDescription = serv.m_szDescription; - m_szUser = serv.m_szUser; - m_szPass = serv.m_szPass; - m_uPort = serv.m_uPort; - m_szNick = serv.m_szNick; - m_szRealName = serv.m_szRealName; - m_szEncoding = serv.m_szEncoding; - m_uFlags = serv.m_uFlags; - m_szInitUMode = serv.m_szInitUMode; - m_szOnConnectCommand = serv.m_szOnConnectCommand; - m_szOnLoginCommand = serv.m_szOnLoginCommand; - m_szLinkFilter = serv.m_szLinkFilter; - m_szId = serv.m_szId; - m_iProxy = serv.m_iProxy; - m_szUserIdentityId = serv.m_szUserIdentityId; - if(serv.m_pChannelList) - m_pChannelList = new QStringList(*(serv.m_pChannelList)); - else m_pChannelList = 0; - m_bAutoConnect = serv.m_bAutoConnect; -} - -void KviIrcServer::operator=(const KviIrcServer &serv) -{ - m_szHostname = serv.m_szHostname; - m_szIp = serv.m_szIp; - m_szDescription = serv.m_szDescription; - m_szUser = serv.m_szUser; - m_szPass = serv.m_szPass; - m_uPort = serv.m_uPort; - m_szNick = serv.m_szNick; - m_szRealName = serv.m_szRealName; - m_szEncoding = serv.m_szEncoding; - m_uFlags = serv.m_uFlags; - m_szInitUMode = serv.m_szInitUMode; - m_szOnConnectCommand = serv.m_szOnConnectCommand; - m_szOnLoginCommand = serv.m_szOnLoginCommand; - m_szLinkFilter = serv.m_szLinkFilter; - m_szId = serv.m_szId; - m_szUserIdentityId = serv.m_szUserIdentityId; - m_iProxy = serv.m_iProxy; - if(m_pChannelList)delete m_pChannelList; - if(serv.m_pChannelList) - m_pChannelList = new QStringList(*(serv.m_pChannelList)); - else m_pChannelList = 0; - m_bAutoConnect = serv.m_bAutoConnect; -} - - -KviIrcServer::~KviIrcServer() -{ - if(m_pChannelList)delete m_pChannelList; - if(m_pReconnectInfo) delete m_pReconnectInfo; -} - -void KviIrcServer::generateUniqueId() -{ - struct timeval tv; - kvi_gettimeofday(&tv,0); - KviQString::sprintf(m_szId,"myserver%d%d%d",tv.tv_usec,rand() % 1000,rand() % 1000); -} - -QString KviIrcServer::ircUri() -{ - QString uri("irc"); - if(useSSL())uri += "s"; - if(isIpV6())uri += "6"; - uri += "://"; - uri += m_szHostname; - - if(m_uPort!=6667) - { - uri += ":"; - QString num; - num.setNum(m_uPort); - uri += num; - } - return uri; -} - -void KviIrcServer::setAutoJoinChannelList(QStringList * pNewChannelList) -{ - if(m_pChannelList)delete m_pChannelList; - m_pChannelList = pNewChannelList; -} - - -bool KviIrcServer::load(KviConfig * cfg,const QString &prefix) -{ - QString tmp; - KviQString::sprintf(tmp,"%QHostname",&prefix); - m_szHostname = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QIp",&prefix); - m_szIp = cfg->readQStringEntry(tmp); - if(m_szHostname.isEmpty() && m_szIp.isEmpty())return false; - KviQString::sprintf(tmp,"%QDescription",&prefix); - m_szDescription = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QUser",&prefix); - m_szUser = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QPass",&prefix); - m_szPass = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QNick",&prefix); - m_szNick = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QRealName",&prefix); - m_szRealName = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QInitUmode",&prefix); - m_szInitUMode = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QAutoJoinChannels",&prefix); - QStringList l = cfg->readStringListEntry(tmp,QStringList()); - if(l.count() > 0)setAutoJoinChannelList(new QStringList(l)); - KviQString::sprintf(tmp,"%QAutoConnect",&prefix); - m_bAutoConnect = cfg->readBoolEntry(tmp,false); - KviQString::sprintf(tmp,"%QEncoding",&prefix); - m_szEncoding = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QOnConnectCommand",&prefix); - m_szOnConnectCommand = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QOnLoginCommand",&prefix); - m_szOnLoginCommand = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QLinkFilter",&prefix); - m_szLinkFilter = cfg->readQStringEntry(tmp); - KviQString::sprintf(tmp,"%QPort",&prefix); - m_uPort = cfg->readUIntEntry(tmp,6667); - KviQString::sprintf(tmp,"%QId",&prefix); - m_szId = cfg->readQStringEntry(tmp); - if(m_szId.isEmpty())generateUniqueId(); - KviQString::sprintf(tmp,"%QIpV6",&prefix); - setIpV6(cfg->readBoolEntry(tmp,false)); - KviQString::sprintf(tmp,"%QCacheIp",&prefix); - setCacheIp(cfg->readBoolEntry(tmp,false)); // true ? - KviQString::sprintf(tmp,"%QSSL",&prefix); - setUseSSL(cfg->readBoolEntry(tmp,false)); - KviQString::sprintf(tmp,"%QProxy",&prefix); - setProxy(cfg->readIntEntry(tmp,-2)); - KviQString::sprintf(tmp,"%QUserIdentityId",&prefix); - m_szUserIdentityId = cfg->readQStringEntry(tmp); - return true; -} - -void KviIrcServer::save(KviConfig * cfg,const QString &prefix) -{ - QString tmp; - KviQString::sprintf(tmp,"%QHostname",&prefix); - cfg->writeEntry(tmp,m_szHostname); - KviQString::sprintf(tmp,"%QId",&prefix); - cfg->writeEntry(tmp,m_szId); - if(!m_szIp.isEmpty()) - { - KviQString::sprintf(tmp,"%QIp",&prefix); - cfg->writeEntry(tmp,m_szIp); - } - if(!m_szDescription.isEmpty()) - { - KviQString::sprintf(tmp,"%QDescription",&prefix); - cfg->writeEntry(tmp,m_szDescription); - } - if(!m_szUser.isEmpty()) - { - KviQString::sprintf(tmp,"%QUser",&prefix); - cfg->writeEntry(tmp,m_szUser); - } - if(!m_szPass.isEmpty()) - { - KviQString::sprintf(tmp,"%QPass",&prefix); - cfg->writeEntry(tmp,m_szPass); - } - if(!m_szNick.isEmpty()) - { - KviQString::sprintf(tmp,"%QNick",&prefix); - cfg->writeEntry(tmp,m_szNick); - } - if(!m_szRealName.isEmpty()) - { - KviQString::sprintf(tmp,"%QRealName",&prefix); - cfg->writeEntry(tmp,m_szRealName); - } - if(!m_szInitUMode.isEmpty()) - { - KviQString::sprintf(tmp,"%QInitUMode",&prefix); - cfg->writeEntry(tmp,m_szInitUMode); - } - if(autoJoinChannelList()) - { - KviQString::sprintf(tmp,"%QAutoJoinChannels",&prefix); - cfg->writeEntry(tmp,*(autoJoinChannelList())); - } - if(autoConnect()) // otherwise it defaults to false anyway - { - KviQString::sprintf(tmp,"%QAutoConnect",&prefix); - cfg->writeEntry(tmp,autoConnect()); - } - if(!m_szEncoding.isEmpty()) - { - KviQString::sprintf(tmp,"%QEncoding",&prefix); - cfg->writeEntry(tmp,m_szEncoding); - } - if(!m_szOnConnectCommand.isEmpty()) - { - KviQString::sprintf(tmp,"%QOnConnectCommand",&prefix); - cfg->writeEntry(tmp,m_szOnConnectCommand); - } - if(!m_szOnLoginCommand.isEmpty()) - { - KviQString::sprintf(tmp,"%QOnLoginCommand",&prefix); - cfg->writeEntry(tmp,m_szOnLoginCommand); - } - if(!m_szLinkFilter.isEmpty()) - { - KviQString::sprintf(tmp,"%QLinkFilter",&prefix); - cfg->writeEntry(tmp,m_szLinkFilter); - } - if(m_uPort != 6667) - { - KviQString::sprintf(tmp,"%QPort",&prefix); - cfg->writeEntry(tmp,m_uPort); - } - if(isIpV6()) - { - KviQString::sprintf(tmp,"%QIpV6",&prefix); - cfg->writeEntry(tmp,isIpV6()); - } - if(cacheIp()) - { - KviQString::sprintf(tmp,"%QCacheIp",&prefix); - cfg->writeEntry(tmp,cacheIp()); - } - if(useSSL()) - { - KviQString::sprintf(tmp,"%QSSL",&prefix); - cfg->writeEntry(tmp,useSSL()); - } - if(proxy()!=-2) - { - KviQString::sprintf(tmp,"%QProxy",&prefix); - cfg->writeEntry(tmp,proxy()); - } - if(!m_szUserIdentityId.isEmpty()) - { - KviQString::sprintf(tmp,"%QUserIdentityId",&prefix); - cfg->writeEntry(tmp,m_szUserIdentityId); - } -} - - - -KviIrcNetwork::KviIrcNetwork(const KviIrcNetwork &src) -{ - m_pChannelList = 0; - m_pNickServRuleSet = 0; - copyFrom(src); -} - -KviIrcNetwork::KviIrcNetwork(const QString &name) -{ - m_szName = name; - m_pChannelList = 0; - m_pNickServRuleSet = 0; - m_bAutoConnect = false; - // m_szEncoding = QString::null; // set by default -} - -KviIrcNetwork::~KviIrcNetwork() -{ - if(m_pChannelList)delete m_pChannelList; - if(m_pNickServRuleSet)delete m_pNickServRuleSet; -} - -void KviIrcNetwork::setAutoJoinChannelList(QStringList * pNewChannelList) -{ - if(m_pChannelList)delete m_pChannelList; - m_pChannelList = pNewChannelList; -} - -void KviIrcNetwork::setNickServRuleSet(KviNickServRuleSet * s) -{ - if(m_pNickServRuleSet)delete m_pNickServRuleSet; - m_pNickServRuleSet = s; -} - - -void KviIrcNetwork::copyFrom(const KviIrcNetwork &src) -{ - m_szName = src.m_szName; - m_szEncoding = src.m_szEncoding; - m_szDescription = src.m_szDescription; - m_szNickName = src.m_szNickName; - m_szRealName = src.m_szRealName; - m_szUserName = src.m_szUserName; - m_bAutoConnect = src.m_bAutoConnect; - m_szUserIdentityId = src.m_szUserIdentityId; - m_szOnConnectCommand = src.m_szOnConnectCommand; - m_szOnLoginCommand = src.m_szOnLoginCommand; - if(m_pChannelList)delete m_pChannelList; - if(src.m_pChannelList)m_pChannelList = new QStringList(*(src.m_pChannelList)); - else m_pChannelList = 0; - if(m_pNickServRuleSet)delete m_pNickServRuleSet; - if(src.m_pNickServRuleSet)m_pNickServRuleSet = new KviNickServRuleSet(*(src.m_pNickServRuleSet)); - else m_pNickServRuleSet = 0; -} - diff --git a/3.4.0/src/kvilib/irc/kvi_ircserver.h b/3.4.0/src/kvilib/irc/kvi_ircserver.h deleted file mode 100644 index 975b50c5dc..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_ircserver.h +++ /dev/null @@ -1,206 +0,0 @@ -#ifndef _KVI_IRCSERVER_H_ -#define _KVI_IRCSERVER_H_ - -//============================================================================= -// -// File : kvi_ircserver.h -// Creation date : Mon Jul 10 2000 03:24:11 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_heapobject.h" -#include "kvi_qstring.h" -#include "kvi_pointerlist.h" - -#include <qstringlist.h> - -class KviConfig; -class KviNickServRuleSet; -class KviProxy; -class KviProxyDataBase; -class KviIrcServer; - -#define KVI_IRCSERVER_FLAG_IPV6 1 -#define KVI_IRCSERVER_FLAG_CACHEIP 2 -#define KVI_IRCSERVER_FLAG_SSL 4 - -class KVILIB_API KviIrcServerReconnectInfo { -public: - QString m_szNick; - QString m_szAwayReason; - QString m_szJoinChannels; - QStringList m_szOpenQueryes; - bool m_bIsAway; -}; - -class KVILIB_API KviIrcServer : public KviHeapObject -{ -public: - KviIrcServer(); - KviIrcServer(const KviIrcServer &serv); - ~KviIrcServer(); -public: - KviIrcServerReconnectInfo *m_pReconnectInfo; - QString m_szHostname; // the server hostname (or ip eventually) - QString m_szIp; // the server's cached ip (if we're caching) - QString m_szDescription; // the server description - kvi_u32_t m_uPort; // the server's port - unsigned short int m_uFlags; // flags - - // Extended data - QString m_szUserIdentityId; // The user identity to use for this server: if empty - // Then use the network identity instead - - QString m_szUser; // special username - QString m_szPass; // special password - QString m_szNick; // special nickname - QString m_szRealName; // special real name - QString m_szInitUMode; // special user mode - QString m_szOnConnectCommand; // the command to run on connect - QString m_szOnLoginCommand; // the command to run after login - QString m_szLinkFilter; // the link filter object - QString m_szEncoding; // if empty, use network encoding - QStringList * m_pChannelList; // Channels to auto join - bool m_bAutoConnect; // autoconnect - QString m_szId; // the server's may-be-unique id, may be auto-generated - int m_iProxy; // proxy server's id -public: - int proxy() { return m_iProxy; }; - KviProxy* proxyServer(KviProxyDataBase * pDb); - - kvi_u32_t port() const { return m_uPort; }; - const QString & ipAddress() const { return m_szIp; }; - const QString & password() const { return m_szPass; }; - const QString & nickName() const { return m_szNick; }; - const QString & initUMode() const { return m_szInitUMode; }; - const QString & hostName() const { return m_szHostname; }; - const QString & ip() const { return m_szIp; }; - const QString & onLoginCommand() const { return m_szOnLoginCommand; }; - const QString & onConnectCommand() const { return m_szOnConnectCommand; }; - const QString & userName() const { return m_szUser; }; - const QString & realName() const { return m_szRealName; }; - const QString & linkFilter() const { return m_szLinkFilter; }; - const QString & description() const { return m_szDescription; }; - const QString & encoding() const { return m_szEncoding; }; - const QString & id() const { return m_szId; }; - const QString & userIdentityId() const { return m_szUserIdentityId; }; - bool autoConnect() const { return m_bAutoConnect; }; - QStringList* autoJoinChannelList(){ return m_pChannelList; }; - bool isIpV6() const { return (m_uFlags & KVI_IRCSERVER_FLAG_IPV6); }; - bool useSSL() const { return (m_uFlags & KVI_IRCSERVER_FLAG_SSL); }; - bool cacheIp() const { return (m_uFlags & KVI_IRCSERVER_FLAG_CACHEIP); }; - - void setProxy(int p){ m_iProxy = p; }; - void setIpAddress(const QString &a){ m_szIp = a; }; - void setPort(kvi_u32_t p){ m_uPort = p; }; - void setHostName(const QString &n){ m_szHostname = n; }; - void setDescription(const QString &d){ m_szDescription = d; }; - void setUserName(const QString &u){ m_szUser = u; }; - void setPassword(const QString &p){ m_szPass = p; }; - void setNickName(const QString &n){ m_szNick = n; }; - void setRealName(const QString &r){ m_szRealName = r; }; - void setEncoding(const QString &e){ m_szEncoding = e; }; - void setInitUMode(const QString &u){ m_szInitUMode = u; }; - void setOnConnectCommand(const QString &cmd){ m_szOnConnectCommand = cmd; }; - void setOnLoginCommand(const QString &cmd){ m_szOnLoginCommand = cmd; }; - void setLinkFilter(const QString &f){ m_szLinkFilter = f; }; - // the channel list must be allocated with new! - void setAutoJoinChannelList(QStringList * pNewChannelList); - void setAutoConnect(bool autoconnect) { m_bAutoConnect = autoconnect; }; - void setUserIdentityId(const QString &szUserIdentityId){ m_szUserIdentityId = szUserIdentityId; }; - void setIpV6(bool bSet) - { - if(bSet)m_uFlags |= KVI_IRCSERVER_FLAG_IPV6; - else m_uFlags &= ((unsigned short)~KVI_IRCSERVER_FLAG_IPV6); - }; - void setUseSSL(bool bSet) - { - if(bSet)m_uFlags |= KVI_IRCSERVER_FLAG_SSL; - else m_uFlags &= ((unsigned short)~KVI_IRCSERVER_FLAG_SSL); - }; - void setCacheIp(bool bSet) - { - if(bSet)m_uFlags |= KVI_IRCSERVER_FLAG_CACHEIP; - else m_uFlags &= ((unsigned short)~KVI_IRCSERVER_FLAG_CACHEIP); - }; - void operator =(const KviIrcServer &s); - - bool load(KviConfig * cfg,const QString &prefix); - void save(KviConfig * cfg,const QString &prefix); - - void generateUniqueId(); - void setId(const QString &szId){ m_szId = szId; if(m_szId.isEmpty())generateUniqueId(); }; - - QString ircUri(); -}; - -class KVILIB_API KviIrcNetwork : public KviHeapObject -{ - friend class KviIrcServerDataBase; -public: - KviIrcNetwork(const KviIrcNetwork &src); - KviIrcNetwork(const QString &name); - ~KviIrcNetwork(); -protected: - QString m_szName; - QString m_szDescription; - QString m_szEncoding; // if empty, use system default - QString m_szNickName; // preferred nick name - QString m_szUserName; // preferred user name - QString m_szRealName; // preferred real name - QString m_szOnConnectCommand; // the command to run on connect - QString m_szOnLoginCommand; // the command to run after login - QStringList * m_pChannelList; // Channels to auto join - KviNickServRuleSet * m_pNickServRuleSet; // set of nick serv rules - bool m_bAutoConnect; // autoconnect - QString m_szUserIdentityId; // The user identity to use for this server: if empty - // Then use the global primary identity -public: - const QString & name() const { return m_szName; }; - const QString & encoding() const { return m_szEncoding; }; - const QString & description() const { return m_szDescription; }; - const QString & nickName() const { return m_szNickName; }; - const QString & realName() const { return m_szRealName; }; - const QString & userName() const { return m_szUserName; }; - const QString & onLoginCommand() const { return m_szOnLoginCommand; }; - const QString & onConnectCommand() const { return m_szOnConnectCommand; }; - const QString & userIdentityId() const { return m_szUserIdentityId; }; - bool autoConnect() const { return m_bAutoConnect; }; - QStringList* autoJoinChannelList(){ return m_pChannelList; }; - KviNickServRuleSet * nickServRuleSet(){ return m_pNickServRuleSet; }; - void setNickServRuleSet(KviNickServRuleSet * s); - void copyFrom(const KviIrcNetwork &d); - void setName(const QString &szName){ m_szName = szName; }; - void setEncoding(const QString &szEncoding){ m_szEncoding = szEncoding; }; - void setDescription(const QString &szDescription){ m_szDescription = szDescription; }; - void setOnConnectCommand(const QString &cmd){ m_szOnConnectCommand = cmd; }; - void setOnLoginCommand(const QString &cmd){ m_szOnLoginCommand = cmd; }; - void setNickName(const QString &n){ m_szNickName = n; }; - void setRealName(const QString &r){ m_szRealName = r; }; - void setUserName(const QString &u){ m_szUserName = u; }; - void setAutoJoinChannelList(QStringList * pNewChannelList); - void setAutoConnect(bool bAutoConnect){ m_bAutoConnect = bAutoConnect; }; - void setUserIdentityId(const QString &szUserIdentityId){ m_szUserIdentityId = szUserIdentityId; }; -}; - - - -#endif //_KVI_IRCSERVER_H_ diff --git a/3.4.0/src/kvilib/irc/kvi_ircserverdb.cpp b/3.4.0/src/kvilib/irc/kvi_ircserverdb.cpp deleted file mode 100644 index 274a1e6dea..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_ircserverdb.cpp +++ /dev/null @@ -1,646 +0,0 @@ -//============================================================================= -// -// File : kvi_ircserverdb.cpp -// Creation date : Mon Jul 10 2000 14:25:00 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include <qapplication.h> -#include <qlayout.h> -#include <qmessagebox.h> -#include <qcheckbox.h> - -#include "kvi_ircserverdb.h" -#include "kvi_config.h" -#include "kvi_locale.h" -#include "kvi_netutils.h" -#include "kvi_nickserv.h" - -KviIrcServerDataBaseRecord::KviIrcServerDataBaseRecord(KviIrcNetwork * n) -{ - m_pNetwork = n; - m_pServerList = new KviPointerList<KviIrcServer>; - m_pServerList->setAutoDelete(true); - m_pCurrentServer = 0; -} - -KviIrcServerDataBaseRecord::~KviIrcServerDataBaseRecord() -{ - delete m_pNetwork; - delete m_pServerList; -} - -void KviIrcServerDataBaseRecord::insertServer(KviIrcServer *srv) -{ - m_pServerList->append(srv); -} - -KviIrcServer * KviIrcServerDataBaseRecord::findServer(const KviIrcServer * pServer) -{ - for(KviIrcServer *s=m_pServerList->first();s;s=m_pServerList->next()) - { - if(KviQString::equalCI(s->m_szHostname,pServer->m_szHostname) && - (s->m_uPort == pServer->m_uPort) && - (s->useSSL() == pServer->useSSL()) && - (s->isIpV6() == pServer->isIpV6()))return s; - } - return 0; -} - -void KviIrcServerDataBaseRecord::setCurrentServer(KviIrcServer *srv) -{ - if(m_pServerList->findRef(srv) != -1)m_pCurrentServer = srv; -} - -KviIrcServer * KviIrcServerDataBaseRecord::currentServer() -{ - if(m_pCurrentServer)return m_pCurrentServer; - m_pCurrentServer = m_pServerList->first(); - return m_pCurrentServer; -} - - - - - - - - - - -KviIrcServerDataBase::KviIrcServerDataBase() -{ - m_pRecords = new KviPointerHashTable<QString,KviIrcServerDataBaseRecord>(17,false); - m_pRecords->setAutoDelete(true); - m_pAutoConnectOnStartupServers = 0; - m_pAutoConnectOnStartupNetworks = 0; -} - -KviIrcServerDataBase::~KviIrcServerDataBase() -{ - delete m_pRecords; - if(m_pAutoConnectOnStartupServers)delete m_pAutoConnectOnStartupServers; - if(m_pAutoConnectOnStartupNetworks)delete m_pAutoConnectOnStartupNetworks; -} - -void KviIrcServerDataBase::clearAutoConnectOnStartupServers() -{ - if(!m_pAutoConnectOnStartupServers)return; - delete m_pAutoConnectOnStartupServers; - m_pAutoConnectOnStartupServers = 0; -} - -void KviIrcServerDataBase::clearAutoConnectOnStartupNetworks() -{ - if(!m_pAutoConnectOnStartupNetworks)return; - delete m_pAutoConnectOnStartupNetworks; - m_pAutoConnectOnStartupNetworks = 0; -} - -void KviIrcServerDataBase::clear() -{ - m_pRecords->clear(); - m_szCurrentNetwork = ""; -} - -KviIrcServerDataBaseRecord * KviIrcServerDataBase::insertNetwork(KviIrcNetwork *n) -{ - KviIrcServerDataBaseRecord * r = new KviIrcServerDataBaseRecord(n); - m_pRecords->replace(n->name(),r); - return r; -} - -KviIrcServerDataBaseRecord * KviIrcServerDataBase::findRecord(const QString &szNetName) -{ - return m_pRecords->find(szNetName); -} - - -KviIrcNetwork * KviIrcServerDataBase::findNetwork(const QString &szName) -{ - KviIrcServerDataBaseRecord * r = m_pRecords->find(szName); - if(!r)return 0; - return r->network(); -} - -KviIrcServerDataBaseRecord * KviIrcServerDataBase::currentRecord() -{ - KviIrcServerDataBaseRecord * r = 0; - if(!m_szCurrentNetwork.isEmpty())r = m_pRecords->find(m_szCurrentNetwork); - if(r)return r; - - KviPointerHashTableIterator<QString,KviIrcServerDataBaseRecord> it(*m_pRecords); - r = it.current(); - if(!r)return 0; - m_szCurrentNetwork = r->network()->name(); - return r; -} - -void KviIrcServerDataBase::updateServerIp(KviIrcServer * pServer,const QString & ip) -{ - KviPointerHashTableIterator<QString,KviIrcServerDataBaseRecord> it(*m_pRecords); - while(KviIrcServerDataBaseRecord * r = it.current()) - { - KviIrcServer * srv = r->findServer(pServer); - if(srv) - { - srv->m_szIp = ip; - return; - } - ++it; - } -} - -bool KviIrcServerDataBase::makeCurrentBestServerInNetwork(const QString &szNetName,KviIrcServerDataBaseRecord * r,QString &szError) -{ - m_szCurrentNetwork = szNetName; - // find a round-robin server in that network - - if(r->m_pServerList->isEmpty()) - { - szError = __tr2qs("The specified network has no server entries"); - return false; - } - - for(KviIrcServer * s = r->m_pServerList->first();s;s = r->m_pServerList->next()) - { -#ifdef COMPILE_USE_QT4 - if(s->m_szDescription.contains("random",Qt::CaseInsensitive) || - (s->m_szDescription.contains("round",Qt::CaseInsensitive) && s->m_szDescription.contains("robin",Qt::CaseInsensitive))) -#else - if(s->m_szDescription.contains("random",false) || - (s->m_szDescription.contains("round",false) && s->m_szDescription.contains("robin",false))) -#endif - { - r->setCurrentServer(s); - return true; - } - } - - // no explicit round robin... try some common names - - QString tryAlso1,tryAlso2,tryAlso3; - - KviQString::sprintf(tryAlso1,"irc.%Q.org",&szNetName); - KviQString::sprintf(tryAlso2,"irc.%Q.net",&szNetName); - KviQString::sprintf(tryAlso3,"irc.%Q.com",&szNetName); - - for(KviIrcServer * ss = r->m_pServerList->first();ss;ss = r->m_pServerList->next()) - { - if(KviQString::equalCI(ss->m_szHostname,tryAlso1) || - KviQString::equalCI(ss->m_szHostname,tryAlso2) || - KviQString::equalCI(ss->m_szHostname,tryAlso3)) - { - r->setCurrentServer(ss); - return true; - } - } - - // a random one in this network - return true; -} - - -bool KviIrcServerDataBase::makeCurrentServer(KviIrcServerDefinition * d,QString &szError) -{ - KviIrcServer * pServer = 0; - - KviPointerHashTableIterator<QString,KviIrcServerDataBaseRecord> it(*m_pRecords); - KviIrcServerDataBaseRecord * r = 0; - KviIrcServer * srv; - - if(KviQString::equalCIN(d->szServer,"net:",4)) - { - // net:networkname form - QString szNet = d->szServer; - szNet.remove(0,4); - KviIrcServerDataBaseRecord * r = m_pRecords->find(szNet); - if(r)return makeCurrentBestServerInNetwork(szNet,r,szError); - szError = __tr2qs("The server specification seems to be in the net:<string> but the network couln't be found in the database"); - return false; - } - - if(KviQString::equalCIN(d->szServer,"id:",3)) - { - // id:serverid form - QString szId = d->szServer; - szId.remove(0,3); - - while((r = it.current())) - { - for(srv = r->serverList()->first();srv && (!pServer);srv = r->serverList()->next()) - { - if(KviQString::equalCI(srv->id(),szId)) - { - pServer = srv; - goto search_finished; - } - } - ++it; - } - szError = __tr2qs("The server specification seems to be in the id:<string> form but the identifier coulnd't be found in the database"); - return false; - } - - it.toFirst(); - - while((r = it.current())) - { - for(srv = r->serverList()->first();srv && (!pServer);srv = r->serverList()->next()) - { - if(KviQString::equalCI(srv->hostName(),d->szServer)) - { - if(d->bIpV6 == srv->isIpV6()) - { - if(d->bSSL == srv->useSSL()) - { - if(d->bPortIsValid) - { - // must match the port - if(d->uPort == srv->port()) - { - // port matches - if(!d->szLinkFilter.isEmpty()) - { - // must match the link filter - if(KviQString::equalCI(d->szLinkFilter,srv->linkFilter())) - { - // link filter matches - pServer = srv; - goto search_finished; - } // else link filter doesn't match - } else { - // no need to match the link filter - pServer = srv; - goto search_finished; - } - } // else port doesn't match - } else { - // no need to match the port - if(!d->szLinkFilter.isEmpty()) - { - // must match the link filter - if(KviQString::equalCI(d->szLinkFilter,srv->linkFilter())) - { - // link filter matches - pServer = srv; - goto search_finished; - } // else link filter doesn't match - } else { - // no need to match the link filter - pServer = srv; - goto search_finished; - } - } - } - } - } - } - ++it; - } - -search_finished: - - if(r && pServer) - { - if(!d->szNick.isEmpty())pServer->m_szNick = d->szNick; - if(!d->szPass.isEmpty())pServer->m_szPass = d->szPass; // don't clear the pass! - if(!d->szInitUMode.isEmpty())pServer->m_szInitUMode = d->szInitUMode; - - m_szCurrentNetwork = r->network()->name(); - r->setCurrentServer(pServer); - return true; - } - - // no such server: is it a valid ip address or hostname ? - bool bIsValidIpV4 = KviNetUtils::isValidStringIp(d->szServer); -#ifdef COMPILE_IPV6_SUPPORT - bool bIsValidIpV6 =KviNetUtils::isValidStringIp_V6(d->szServer); -#else - bool bIsValidIpV6 = false; -#endif - - if(!(bIsValidIpV4 || bIsValidIpV6)) - { - // is it a valid hostname ? (must contain at least one dot) -#ifdef COMPILE_USE_QT4 - if(!d->szServer.contains('.')) -#else - if(d->szServer.contains('.') < 1) -#endif - { - // assume it is a network name! - KviIrcServerDataBaseRecord * r = m_pRecords->find(d->szServer); - if(r)return makeCurrentBestServerInNetwork(d->szServer,r,szError); - // else probably not a network name - } - } - - // a valid hostname or ip address , not found in list : add it and make it current - - r = m_pRecords->find(__tr2qs("Standalone Servers")); - if(!r) - { - r = new KviIrcServerDataBaseRecord(new KviIrcNetwork(__tr2qs("Standalone Servers"))); - m_pRecords->replace(r->network()->name(),r); - } - - KviIrcServer * s = new KviIrcServer(); - s->m_szHostname = d->szServer; - if(bIsValidIpV4) - { - s->m_szIp = d->szServer; - s->setCacheIp(true); -#ifdef COMPILE_IPV6_SUPPORT - } else { - if(bIsValidIpV6) - { - s->m_szIp = d->szServer; - s->setCacheIp(true); - d->bIpV6 = true; - } - } -#else - } -#endif - s->m_uPort = d->bPortIsValid ? d->uPort : 6667; - s->setLinkFilter(d->szLinkFilter); - s->m_szPass= d->szPass; - s->m_szNick= d->szNick; - s->m_szInitUMode = d->szInitUMode; - s->setIpV6(d->bIpV6); - s->setUseSSL(d->bSSL); - r->insertServer(s); - m_szCurrentNetwork = r->network()->name(); - r->setCurrentServer(s); - - return true; -} - -void parseMircServerRecord(QString entry,QString& szNet, - QString& szDescription,QString& szHost,QString& szPort,bool& bSsl,kvi_u32_t& uPort) -{ - bSsl = false; - int idx = KviQString::find(entry,"SERVER:"); - if(idx != -1) - { - szDescription = entry.left(idx); - szNet=szDescription.section(':',0,0); - szDescription=szDescription.section(':',1,1); - - entry.remove(0,idx + 7); - idx = KviQString::find(entry,"GROUP:"); - if(idx != -1) - { - szHost = entry.left(idx); - } else { - szHost = entry; - } - - szPort = szHost.section(':',1,1); - if(szPort[0]=='+') - { - bSsl = true; - szPort.remove(0,1); - } - szHost = szHost.section(':',0,0); - - bool bOk; - uPort = szPort.toUInt(&bOk); - if(!bOk)uPort = 6667; - } -} - -void KviIrcServerDataBase::loadFromMircIni(const QString & filename, const QString & szMircIni, QStringList& recentServers) -{ - clear(); - recentServers.clear(); - QString szDefaultServer; - KviConfig mircCfg(szMircIni,KviConfig::Read,true); - if(mircCfg.hasGroup("mirc")) - { - mircCfg.setGroup("mirc"); - szDefaultServer = mircCfg.readQStringEntry("host"); - } - - KviConfig cfg(filename,KviConfig::Read,true); - int i = 0; - - QString entry; - QString key; - if(cfg.hasGroup("recent")) - { - cfg.setGroup("recent"); - do { - KviQString::sprintf(key,"n%d",i); - entry = cfg.readEntry(key); - if(!entry.isEmpty()) - { - QString szNet; - QString szDescription; - QString szHost; - QString szPort; - bool bSsl = false; - kvi_u32_t uPort = 0; - - parseMircServerRecord(entry,szNet, - szDescription,szHost,szPort,bSsl,uPort); - - recentServers << (bSsl ? "ircs://" : "irc://" ) +szHost+":"+szPort; - } - i++; - } while(!entry.isEmpty()); - } - - i = 0; - if(cfg.hasGroup("servers")) - { - cfg.setGroup("servers"); - do { - KviQString::sprintf(key,"n%d",i); - entry = cfg.readEntry(key); - if(!entry.isEmpty()) - { - bool bDefault = false; - QString szNet; - QString szDescription; - QString szHost; - QString szPort; - bool bSsl = false; - kvi_u32_t uPort = 0; - // <net>:<description>SERVER:<server:port>GROUP:<group???> - if(entry==szDefaultServer) - bDefault = true; - - parseMircServerRecord(entry,szNet, - szDescription,szHost,szPort,bSsl,uPort); - - KviIrcServerDataBaseRecord * r = findRecord(szNet); - - if(!r) { - KviIrcNetwork * n = new KviIrcNetwork(szNet); - r = insertNetwork(n); - } - - KviIrcServer *s = new KviIrcServer(); - s->m_szHostname = szHost; - s->m_szDescription = szDescription; - s->m_uPort = uPort; - - - r->m_pServerList->append(s); - if(bDefault) - { - m_szCurrentNetwork = szNet; - } - } - i++; - } while(!entry.isEmpty()); - } -} - - -void KviIrcServerDataBase::load(const QString & filename) -{ - clear(); - KviConfig cfg(filename,KviConfig::Read); - - KviConfigIterator it(*(cfg.dict())); - - QString tmp; - - while(it.current()) - { - if(it.current()->count() > 0) - { - KviIrcNetwork * n = new KviIrcNetwork(it.currentKey()); - KviIrcServerDataBaseRecord * r = insertNetwork(n); - cfg.setGroup(it.currentKey()); - n->m_szEncoding = cfg.readQStringEntry("Encoding"); - n->m_szDescription = cfg.readQStringEntry("Description"); - n->m_szNickName = cfg.readQStringEntry("NickName"); - n->m_szRealName = cfg.readQStringEntry("RealName"); - n->m_szUserName = cfg.readQStringEntry("UserName"); - n->m_szOnConnectCommand = cfg.readQStringEntry("OnConnectCommand"); - n->m_szOnLoginCommand = cfg.readQStringEntry("OnLoginCommand"); - n->m_pNickServRuleSet = KviNickServRuleSet::load(&cfg,QString::null); - n->m_bAutoConnect = cfg.readBoolEntry("AutoConnect",false); - n->m_szUserIdentityId = cfg.readQStringEntry("UserIdentityId"); - if(n->m_bAutoConnect) - { - if(!m_pAutoConnectOnStartupNetworks) - { - m_pAutoConnectOnStartupNetworks = new KviPointerList<KviIrcServerDataBaseRecord>; - m_pAutoConnectOnStartupNetworks->setAutoDelete(false); - } - m_pAutoConnectOnStartupNetworks->append(r); - } - QStringList l = cfg.readStringListEntry("AutoJoinChannels",QStringList()); - if(l.count() > 0)n->setAutoJoinChannelList(new QStringList(l)); - - if(cfg.readBoolEntry("Current",false))m_szCurrentNetwork = it.currentKey(); - - int nServers = cfg.readIntEntry("NServers",0); - for(int i=0;i < nServers;i++) - { - KviIrcServer *s = new KviIrcServer(); - KviQString::sprintf(tmp,"%d_",i); - if(s->load(&cfg,tmp)) - { - r->m_pServerList->append(s); - KviQString::sprintf(tmp,"%d_Current",i); - if(cfg.readBoolEntry(tmp,false))r->m_pCurrentServer = s; - if(s->autoConnect()) - { - if(!m_pAutoConnectOnStartupServers) - { - m_pAutoConnectOnStartupServers = new KviPointerList<KviIrcServer>; - m_pAutoConnectOnStartupServers->setAutoDelete(false); - } - m_pAutoConnectOnStartupServers->append(s); - } - } else delete s; - } - if(!r->m_pCurrentServer)r->m_pCurrentServer = r->m_pServerList->first(); - } - ++it; - } -} - -void KviIrcServerDataBase::save(const QString &filename) -{ - KviConfig cfg(filename,KviConfig::Write); - - cfg.clear(); // clear any old entry - - KviPointerHashTableIterator<QString,KviIrcServerDataBaseRecord> it(*m_pRecords); - - QString tmp; - - while(KviIrcServerDataBaseRecord * r = it.current()) - { - KviIrcNetwork * n = r->network(); - cfg.setGroup(n->m_szName); - cfg.writeEntry("NServers",r->m_pServerList->count()); - if(n->m_bAutoConnect) - cfg.writeEntry("AutoConnect",true); - if(!n->m_szEncoding.isEmpty()) - cfg.writeEntry("Encoding",n->m_szEncoding); - if(!n->m_szDescription.isEmpty()) - cfg.writeEntry("Description",n->m_szDescription); - if(!n->m_szNickName.isEmpty()) - cfg.writeEntry("NickName",n->m_szNickName); - if(!n->m_szRealName.isEmpty()) - cfg.writeEntry("RealName",n->m_szRealName); - if(!n->m_szUserName.isEmpty()) - cfg.writeEntry("UserName",n->m_szUserName); - if(!n->m_szOnConnectCommand.isEmpty()) - cfg.writeEntry("OnConnectCommand",n->m_szOnConnectCommand); - if(!n->m_szOnLoginCommand.isEmpty()) - cfg.writeEntry("OnLoginCommand",n->m_szOnLoginCommand); - if(n->m_pNickServRuleSet)n->m_pNickServRuleSet->save(&cfg,QString::null); - if(n->autoJoinChannelList()) - cfg.writeEntry("AutoJoinChannels",*(n->autoJoinChannelList())); - if(n->m_szName == m_szCurrentNetwork)cfg.writeEntry("Current",true); - if(!n->m_szUserIdentityId.isEmpty()) - cfg.writeEntry("UserIdentityId",n->m_szUserIdentityId); - int i=0; - for(KviIrcServer *s = r->m_pServerList->first();s;s = r->m_pServerList->next()) - { - KviQString::sprintf(tmp,"%d_",i); - s->save(&cfg,tmp); - - if(s == r->m_pCurrentServer) - { - KviQString::sprintf(tmp,"%d_Current",i); - cfg.writeEntry(tmp,true); - } - - i++; - } - ++it; - } -} - - - diff --git a/3.4.0/src/kvilib/irc/kvi_ircserverdb.h b/3.4.0/src/kvilib/irc/kvi_ircserverdb.h deleted file mode 100644 index 403908d90f..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_ircserverdb.h +++ /dev/null @@ -1,116 +0,0 @@ -#ifndef _KVI_IRCSERVERDB_H_ -#define _KVI_IRCSERVERDB_H_ -//============================================================================= -// -// File : kvi_ircserverdb.h -// Creation date : Mon Jul 10 2000 14:15:42 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_ircserver.h" - -#include "kvi_pointerhashtable.h" - -typedef struct _KviIrcServerDefinition -{ - QString szServer; - kvi_u32_t uPort; - bool bPortIsValid; - bool bIpV6; - bool bSSL; - QString szLinkFilter; - QString szPass; - QString szNick; - QString szInitUMode; -} KviIrcServerDefinition; - - - -class KVILIB_API KviIrcServerDataBaseRecord -{ - friend class KviIrcServerDataBase; -public: - KviIrcServerDataBaseRecord(KviIrcNetwork * n); - ~KviIrcServerDataBaseRecord(); -protected: - KviIrcNetwork * m_pNetwork; - KviPointerList<KviIrcServer> * m_pServerList; - - KviIrcServer * m_pCurrentServer; -public: - KviIrcNetwork * network(){ return m_pNetwork; }; - KviPointerList<KviIrcServer> * serverList(){ return m_pServerList; }; - KviIrcServer * currentServer(); - void insertServer(KviIrcServer *srv); - KviIrcServer * findServer(const KviIrcServer * pServer); - void setCurrentServer(KviIrcServer *srv); -}; - - - - - -class KVILIB_API KviIrcServerDataBase -{ -public: - KviIrcServerDataBase(); - ~KviIrcServerDataBase(); -private: - KviPointerHashTable<QString,KviIrcServerDataBaseRecord> * m_pRecords; - QString m_szCurrentNetwork; - // This list is computed when the data are loaded from disk - // during the startup and is used by KviApp to - // start the connections. - // The pointer is zero if there are no autoConnect servers - // The list is valid only during the startup phase - // because it contains shallow pointers to the servers - // really contained in the server/network list - // and it is never updated later - KviPointerList<KviIrcServer> * m_pAutoConnectOnStartupServers; - KviPointerList<KviIrcServerDataBaseRecord> * m_pAutoConnectOnStartupNetworks; -public: - void clear(); - KviPointerHashTable<QString,KviIrcServerDataBaseRecord> * recordDict(){ return m_pRecords; }; - KviPointerList<KviIrcServer> * autoConnectOnStartupServers(){ return m_pAutoConnectOnStartupServers; }; - KviPointerList<KviIrcServerDataBaseRecord> * autoConnectOnStartupNetworks(){ return m_pAutoConnectOnStartupNetworks; }; - void clearAutoConnectOnStartupServers(); - void clearAutoConnectOnStartupNetworks(); - void setCurrentNetwork(const QString &szNetName){ m_szCurrentNetwork = szNetName; }; - const QString & currentNetworkName(){ return m_szCurrentNetwork; }; - KviIrcServerDataBaseRecord * currentRecord(); - KviIrcServerDataBaseRecord * findRecord(const QString &szNetName); - KviIrcNetwork * findNetwork(const QString &name); - void loadFromMircIni(const QString & filename, const QString & szMircIni, QStringList& recentServers); - void load(const QString & filename); - void save(const QString & filename); - KviIrcServerDataBaseRecord * insertNetwork(KviIrcNetwork * n); - void updateServerIp(KviIrcServer * pServer,const QString &ip); - bool makeCurrentServer(KviIrcServerDefinition * d,QString &szError); - bool makeCurrentBestServerInNetwork(const QString &szNetName,KviIrcServerDataBaseRecord * d,QString &szError); -}; - - - - - - -#endif //_KVI_IRCSERVERDB_H_ diff --git a/3.4.0/src/kvilib/irc/kvi_ircuserdb.cpp b/3.4.0/src/kvilib/irc/kvi_ircuserdb.cpp deleted file mode 100644 index 77aa0cc7a1..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_ircuserdb.cpp +++ /dev/null @@ -1,285 +0,0 @@ -//============================================================================= -// -// File : kvi_ircuserdb.cpp -// Creation date : Mon Jul 31 2000 21:23:22 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_debug.h" -#include "kvi_ircuserdb.h" -#include "kvi_mirccntrl.h" -#include "kvi_qstring.h" -#include "kvi_stringconversion.h" - -//static int cacheHit = 0; -//static int cacheMiss = 0; - -KviIrcUserEntry::KviIrcUserEntry(const QString &user,const QString &host) -{ - m_szUser = user; - m_szHost = host; - m_pAvatar = 0; - m_nRefs = 1; - m_iHops = -1; - m_bAway = false; - m_eGender = Unknown; - m_bBot = false; - m_bNotFoundRegUserLoockup=false; - m_bUseCustomColor=false; -} - -void KviIrcUserEntry::setRealName(const QString &rn) -{ - m_szRealName = rn; - m_szRealName = KviQString::trimmed(m_szRealName); - if(m_szRealName.length()>=3) - { - if( (m_szRealName[0].unicode()==KVI_TEXT_COLOR) && (m_szRealName[2].unicode()==KVI_TEXT_RESET) ) - { - switch(m_szRealName[1].unicode()) - { - case '1': // hum.. encoded as hidden color code eh ? publish is somewhere, so others might implement this... - setGender(Male); - break; - case '2': - setGender(Female); - break; - case '3': - setBot(true); - break; - } - m_szRealName.remove(0,3); - } - } -} - -KviIrcUserEntry::~KviIrcUserEntry() -{ - if(m_pAvatar)delete m_pAvatar; -} - -void KviIrcUserEntry::setAvatar(KviAvatar * av) -{ - if(m_pAvatar)delete m_pAvatar; - m_pAvatar = av; -} - -KviAvatar * KviIrcUserEntry::forgetAvatar() -{ - KviAvatar * ret = m_pAvatar; - m_pAvatar = 0; - return ret; -} - -KviIrcUserDataBase::KviIrcUserDataBase() -: QObject() -{ - // we expect a maximum of ~4000 users (= ~16 KB array on a 32 bit machine) - // ...after that we will loose in performance - // ... well...4000 users is a really big number...say 6-7 really big channels - // (4001 is prime) - // up to 12000 users we will have a reasonably fast access. - // the performance increase since kvirc versions < 3.0.0 - // is really big anyway (there was a linear list instead of a hash!!!) - - m_pDict = new KviPointerHashTable<QString,KviIrcUserEntry>(4001,false); - m_pDict->setAutoDelete(true); - setupConnectionWithReguserDb(); -} - -KviIrcUserDataBase::~KviIrcUserDataBase() -{ - delete m_pDict; -} - -bool KviIrcUserDataBase::haveCustomColor(const QString & nick) -{ - KviIrcUserEntry *u = find(nick); - if(!u) return false; - if( u->m_szLastRegisteredMatchNick!=nick) - registeredUser(nick); - if(!u->m_bNotFoundRegUserLoockup) - { - return u->m_bUseCustomColor; - } - return false; -} - -QColor* KviIrcUserDataBase::customColor(const QString & nick) -{ - KviIrcUserEntry *u = find(nick); - if(!u) return 0; - if( u->m_szLastRegisteredMatchNick!=nick) - registeredUser(nick); - - if(!u->m_bNotFoundRegUserLoockup) - { - return &(u->m_cachedColor); - } - return 0; -} - - -KviRegisteredUser* KviIrcUserDataBase::registeredUser(const QString & nick,const QString & user,const QString & host) -{ - if(nick.isEmpty()) return 0; - KviIrcUserEntry *u = find(nick); - if(!u) return g_pRegisteredUserDataBase->findMatchingUser(nick,user,host); - KviRegisteredUser* pUser=0; - - if(u->m_bNotFoundRegUserLoockup && u->m_szLastRegisteredMatchNick==nick) - { - //cacheHit++; - //debug("cache hits/miss = %i/%i",cacheHit,cacheMiss); - return 0; - } - - if(!u->m_szRegisteredUserName.isEmpty() && u->m_szLastRegisteredMatchNick==nick) - { - pUser = g_pRegisteredUserDataBase->getUser(u->m_szRegisteredUserName); - //if(pUser) cacheHit++; - } - - if(!pUser) { - //user renamed or it is a first loockup - if(u->hasHost() && u->hasUser()) - { - pUser=g_pRegisteredUserDataBase->findMatchingUser(nick,u->user(),u->host()); - //cacheMiss++; - if(pUser) { - u->m_szLastRegisteredMatchNick=nick; - u->m_szRegisteredUserName=pUser->name(); - - u->m_bUseCustomColor=pUser->getBoolProperty("useCustomColor"); - QString szTmp=pUser->getProperty("customColor"); - KviStringConversion::fromString(szTmp,u->m_cachedColor); - - u->m_bNotFoundRegUserLoockup=false; //to be shure - } else { - u->m_szLastRegisteredMatchNick=nick; - u->m_bNotFoundRegUserLoockup=true; - } - } - } - -// debug("cache hits/miss = %i/%i",cacheHit,cacheMiss); - return pUser; -} - -KviRegisteredUser* KviIrcUserDataBase::registeredUser(const QString & nick) -{ - if(nick.isEmpty()) return 0; - KviIrcUserEntry *u = find(nick); - if(!u) return 0; - return registeredUser(nick,u->user(),u->host()); -} - -void KviIrcUserDataBase::clear() -{ - delete m_pDict; - m_pDict = new KviPointerHashTable<QString,KviIrcUserEntry>(4001,false); - m_pDict->setAutoDelete(true); -} - -KviIrcUserEntry * KviIrcUserDataBase::insertUser(const QString &nick,const QString &user,const QString &hostname) -{ - KviIrcUserEntry * e = m_pDict->find(nick); - if(e) - { - e->m_nRefs++; - if(e->m_szUser.isEmpty()) - { - e->m_szUser = user; - e->m_szHost = hostname; - } - } else { - e = new KviIrcUserEntry(user,hostname); - m_pDict->insert(nick,e); - } - return e; -} - -void KviIrcUserDataBase::removeUser(const QString &nick,KviIrcUserEntry * e) -{ - e->m_nRefs--; - if(e->m_nRefs == 0)m_pDict->remove(nick); -} - -void KviIrcUserDataBase::setupConnectionWithReguserDb() -{ - connect(g_pRegisteredUserDataBase,SIGNAL(userRemoved(const QString&)),this,SLOT(registeredUserRemoved(const QString&))); - connect(g_pRegisteredUserDataBase,SIGNAL(userChanged(const QString&)),this,SLOT(registeredUserChanged(const QString&))); - connect(g_pRegisteredUserDataBase,SIGNAL(userAdded(const QString&)),this,SLOT(registeredUserAdded(const QString&))); - connect(g_pRegisteredUserDataBase,SIGNAL(databaseCleared()),this,SLOT(registeredDatabaseCleared())); - - -} - -void KviIrcUserDataBase::registeredUserRemoved(const QString& user) -{ - KviPointerHashTableIterator<QString,KviIrcUserEntry> it( *m_pDict ); - for( ; it.current(); ++it ) - { - if(it.current()->m_szRegisteredUserName==user) - { - it.current()->m_szRegisteredUserName=""; - it.current()->m_bNotFoundRegUserLoockup=false; - } - } -} - -void KviIrcUserDataBase::registeredUserChanged(const QString& user) -{ - //the same as above - KviPointerHashTableIterator<QString,KviIrcUserEntry> it( *m_pDict ); - for( ; it.current(); ++it ) - { - if(it.current()->m_szRegisteredUserName==user) - { - it.current()->m_szRegisteredUserName=""; - it.current()->m_bNotFoundRegUserLoockup=false; - } - } -} - -void KviIrcUserDataBase::registeredUserAdded(const QString& user) -{ - KviPointerHashTableIterator<QString,KviIrcUserEntry> it( *m_pDict ); - for( ; it.current(); ++it ) - { - if(it.current()->m_szRegisteredUserName.isEmpty()) - { - it.current()->m_bNotFoundRegUserLoockup=false; - } - } -} - -void KviIrcUserDataBase::registeredDatabaseCleared() -{ - KviPointerHashTableIterator<QString,KviIrcUserEntry> it( *m_pDict ); - for( ; it.current(); ++it ) - { - it.current()->m_szRegisteredUserName=""; - it.current()->m_bNotFoundRegUserLoockup=false; - } -} diff --git a/3.4.0/src/kvilib/irc/kvi_ircuserdb.h b/3.4.0/src/kvilib/irc/kvi_ircuserdb.h deleted file mode 100644 index e616fc1c06..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_ircuserdb.h +++ /dev/null @@ -1,145 +0,0 @@ -#ifndef _KVI_IRCUSERDB_H_ -#define _KVI_IRCUSERDB_H_ - -//============================================================================= -// -// File : kvi_ircuserdb.h -// Creation date : Mon Jul 31 2000 20:59:12 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_pointerhashtable.h" - -#include "kvi_string.h" -#include "kvi_avatar.h" -#include "kvi_regusersdb.h" - -class KviIrcUserDataBase; - -class KVILIB_API KviIrcUserEntry -{ - friend class KviIrcUserDataBase; -public: - KviIrcUserEntry(const QString &user,const QString &host); - ~KviIrcUserEntry(); - - enum Gender { - Male = 0, - Female = 1, - Unknown = 3 - }; - -protected: - QString m_szUser; - QString m_szHost; - - QString m_szServer; - QString m_szRealName; - int m_iHops; - Gender m_eGender; - - bool m_bAway; - - KviAvatar * m_pAvatar; - - int m_nRefs; - bool m_bBot; - - bool m_bNotFoundRegUserLoockup; - QString m_szRegisteredUserName; - QString m_szLastRegisteredMatchNick; - - QColor m_cachedColor; - bool m_bUseCustomColor; -public: - Gender gender() { return m_eGender; }; - void setBot(bool bIsBot) { m_bBot = bIsBot; }; - bool isBot() { return m_bBot; }; - void setGender(Gender g) { m_eGender=g; }; - void setUser(const QString &user) { m_szUser = user; }; - bool hasUser() { return (!m_szUser.isEmpty()); }; - void setHost(const QString &host) { m_szHost = host; }; - bool hasHost() { return (!m_szHost.isEmpty()); }; - void setServer(const QString &serv) { m_szServer = serv; }; - void setRealName(const QString &rn); - void setHops(int hops) { m_iHops = hops; }; - const QString &user() { return m_szUser; }; - const QString &host() { return m_szHost; }; - bool hasServer() { return (!m_szServer.isEmpty()); }; - const QString &server() { return m_szServer; }; - bool hasRealName() { return (!m_szRealName.isEmpty()); }; - const QString &realName() { return m_szRealName; }; - bool hasHops() { return m_iHops >= 0; }; - int hops() { return m_iHops; }; - KviAvatar * avatar() { return m_pAvatar; }; - int nRefs() { return m_nRefs; }; - bool isAway() const { return m_bAway; }; - void setAway(bool bAway) { m_bAway = bAway; }; - // warning! the ownership passes to this class! - void setAvatar(KviAvatar * av = 0); - KviAvatar * forgetAvatar(); -}; - -// from least powerful to most powerful -#define KVI_USERFLAG_USEROP 1 -#define KVI_USERFLAG_VOICE 2 -#define KVI_USERFLAG_HALFOP 4 -#define KVI_USERFLAG_OP 8 -#define KVI_USERFLAG_CHANADMIN 16 -#define KVI_USERFLAG_CHANOWNER 32 - -// 1 | 2 | 4 | 8 | 16 | 32 -#define KVI_USERFLAG_MASK (KVI_USERFLAG_OP | KVI_USERFLAG_VOICE | KVI_USERFLAG_HALFOP | KVI_USERFLAG_CHANADMIN | KVI_USERFLAG_USEROP | KVI_USERFLAG_CHANOWNER) -// at the moment all the flags are usermodes -#define KVI_USERFLAG_MODEMASK KVI_USERFLAG_MASK - - -class KVILIB_API KviIrcUserDataBase : public QObject -{ - Q_OBJECT -public: - KviIrcUserDataBase(); - ~KviIrcUserDataBase(); -private: - KviPointerHashTable<QString,KviIrcUserEntry> * m_pDict; -public: - void clear(); - KviIrcUserEntry * insertUser(const QString &nick,const QString &user,const QString &hostname); - KviIrcUserEntry * find(const QString &nick){ return m_pDict->find(nick); }; - void removeUser(const QString &nick,KviIrcUserEntry * e); - KviPointerHashTable<QString,KviIrcUserEntry> * dict(){ return m_pDict; }; - - KviRegisteredUser* registeredUser(const QString & nick); - KviRegisteredUser* registeredUser(const QString & nick,const QString & user,const QString & host); - - bool haveCustomColor(const QString & nick); - QColor* customColor(const QString & nick); - - void setupConnectionWithReguserDb(); -protected slots: - void registeredUserRemoved(const QString&); - void registeredUserChanged(const QString&); - void registeredUserAdded (const QString&); - void registeredDatabaseCleared(); -}; - -#endif //_KVI_IRCUSERDB_H_ diff --git a/3.4.0/src/kvilib/irc/kvi_mirccntrl.cpp b/3.4.0/src/kvilib/irc/kvi_mirccntrl.cpp deleted file mode 100644 index f2caf56278..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_mirccntrl.cpp +++ /dev/null @@ -1,307 +0,0 @@ -// -// File : kvi_mirccntrl.cpp -// Creation date : Sat Aug 31 17:07:36 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - -#define _KVI_MIRCCNTRL_CPP_ - -#include "kvi_mirccntrl.h" - -KVILIB_API const char * getColorBytes(const char *data_ptr,unsigned char *byte_1,unsigned char *byte_2) -{ - // - // Scans the data_ptr for a mIrc color code XX,XX - // and fills the color values in the two bytes - // - - //First we can have a digit or a coma - if(((*data_ptr >= '0') && (*data_ptr <='9'))) - { - //Something interesting ok. - (*byte_1)=(*data_ptr)-'0'; //store the code - data_ptr++; //and check the next - if(((*data_ptr >= '0') && (*data_ptr <= '9'))||(*data_ptr==',')) - { - //Yes we can understand it - if(*data_ptr==',') - { - //A coma , need to check for background - data_ptr++; - } else { - //A number - (*byte_1)=((((*byte_1)*10)+((*data_ptr)-'0'))%16); - data_ptr++; - if(*data_ptr==',') - { - //A coma , need to check for background - data_ptr++; - } else { - //Senseless return - (*byte_2)=KVI_NOCHANGE; - return data_ptr; - } - } - } else { - //Senseless character control code OK and return - (*byte_2)=KVI_NOCHANGE; - return data_ptr; - } - } else { - //Senseless character : only a CTRL+K code - (*byte_1)=KVI_NOCHANGE; - (*byte_2)=KVI_NOCHANGE; - return data_ptr; - } - - if((*data_ptr >= '0') && (*data_ptr <='9')) - { - //Background , a color code - (*byte_2)=(*data_ptr)-'0'; - data_ptr++; - if((*data_ptr >= '0') && (*data_ptr <='9')) - { - (*byte_2)=((((*byte_2)*10)+((*data_ptr)-'0'))%16); - data_ptr++; - } - return data_ptr; - } else { - (*byte_2)=KVI_NOCHANGE; - return data_ptr-1; - } -} - - -KVILIB_API const kvi_wchar_t * getColorBytesW(const kvi_wchar_t *data_ptr,unsigned char *byte_1,unsigned char *byte_2) -{ - // - // Scans the data_ptr for a mIrc color code XX,XX - // and fills the color values in the two bytes - // - - //First we can have a digit or a coma - if(((*data_ptr >= '0') && (*data_ptr <='9'))) - { - //Something interesting ok. - (*byte_1)=((*data_ptr)-'0'); //store the code - data_ptr++; //and check the next - if(((*data_ptr >= '0') && (*data_ptr <= '9'))||(*data_ptr==',')) - { - //Yes we can understand it - if(*data_ptr==',') - { - //A coma , need to check for background - data_ptr++; - } else { - //A number - //(*byte_1)=((((*byte_1)*10)+((*data_ptr)-'0'))%16); - (*byte_1)=((*byte_1)*10)+((*data_ptr)-'0'); - data_ptr++; - if(*data_ptr==',') - { - //A coma , need to check for background - data_ptr++; - } else { - //Senseless return - (*byte_2)=KVI_NOCHANGE; - return data_ptr; - } - } - } else { - //Senseless character control code OK and return - (*byte_2)=KVI_NOCHANGE; - return data_ptr; - } - } else { - //Senseless character : only a CTRL+K code - (*byte_1)=KVI_NOCHANGE; - (*byte_2)=KVI_NOCHANGE; - return data_ptr; - } - - if((*data_ptr >= '0') && (*data_ptr <='9')) - { - //Background , a color code - (*byte_2)=(*data_ptr)-'0'; - data_ptr++; - if((*data_ptr >= '0') && (*data_ptr <='9')) - { - //(*byte_2)=((((*byte_2)*10)+((*data_ptr)-'0'))%16); - (*byte_2)=((*byte_2)*10)+((*data_ptr)-'0'); - data_ptr++; - } - return data_ptr; - } else { - (*byte_2)=KVI_NOCHANGE; - return data_ptr-1; - } -} - -KVILIB_API unsigned int getUnicodeColorBytes(const QString &szData,unsigned int charIdx,unsigned char *byte_1,unsigned char *byte_2) -{ - // - // Scans the szData for a mIrc color code XX,XX - // and fills the color values in the two bytes - // - - if(charIdx >= szData.length()) - { - (*byte_1)=KVI_NOCHANGE; - (*byte_2)=KVI_NOCHANGE; - return charIdx; - } - - unsigned short c = szData[(int)charIdx].unicode(); - - //First we can have a digit or a coma - if(((c < '0') || (c > '9'))) - { - // senseless : only a CTRL+K code - (*byte_1)=KVI_NOCHANGE; - (*byte_2)=KVI_NOCHANGE; - return charIdx; - } - - //Something interesting ok. - (*byte_1)=c - '0'; //store the code - charIdx++; - if(charIdx >= szData.length()) - { - (*byte_2)=KVI_NOCHANGE; - return charIdx; - } - - c = szData[(int)charIdx].unicode(); - - if(((c < '0') || (c > '9')) && (c != ',')) - { - (*byte_2)=KVI_NOCHANGE; - return charIdx; - } - - - if((c >= '0') && (c <= '9')) - { - (*byte_1)=(((*byte_1)*10)+(c-'0'))%16; - charIdx++; - if(charIdx >= szData.length()) - { - (*byte_2)=KVI_NOCHANGE; - return charIdx; - } - c = szData[(int)charIdx].unicode(); - } - - if(c == ',') - { - charIdx++; - if(charIdx >= szData.length()) - { - (*byte_2)=KVI_NOCHANGE; - return charIdx; - } - c = szData[(int)charIdx].unicode(); - } else { - (*byte_2)=KVI_NOCHANGE; - return charIdx; - } - - if((c < '0') || (c > '9')) - { - (*byte_2)=KVI_NOCHANGE; - if(szData[(int)(charIdx-1)].unicode()==',') - return charIdx-1; - else - return charIdx; - } - - //Background , a color code - (*byte_2)=c-'0'; - charIdx++; - if(charIdx >= szData.length())return charIdx; - c = szData[(int)charIdx].unicode(); - - if((c >= '0') && (c <='9')) - { - (*byte_2)=(((*byte_2)*10)+(c-'0'))%16; - charIdx++; - } - - return charIdx; -} - - -namespace KviMircCntrl -{ - QString stripControlBytes(const QString &szData) - { - QString ret; - - int i = 0; - int l = szData.length(); - int begin = 0; - unsigned char b1; - unsigned char b2; - while(i < l) - { - switch(szData[i].unicode()) - { - case KVI_TEXT_UNDERLINE: - case KVI_TEXT_BOLD: - case KVI_TEXT_RESET: - case KVI_TEXT_REVERSE: - case KVI_TEXT_CRYPTESCAPE: - case KVI_TEXT_CTCP: - if(i != begin) - ret += szData.mid(begin,i - begin); - i++; - begin = i; - break; - case KVI_TEXT_COLOR: - if(i != begin) - ret += szData.mid(begin,i - begin); - i++; - i = getUnicodeColorBytes(szData,i,&b1,&b2); - begin = i; - break; - case KVI_TEXT_ICON: - if(i != begin) - ret += szData.mid(begin,i - begin); - i++; - while(i < l) - { - if(szData[i].unicode() == ' ')break; - else i++; - } - begin = i; - break; - default: - i++; - break; - } - } - if(i != begin) - ret += szData.mid(begin,i - begin); - return ret; - } -} - - diff --git a/3.4.0/src/kvilib/irc/kvi_mirccntrl.h b/3.4.0/src/kvilib/irc/kvi_mirccntrl.h deleted file mode 100644 index 906bf96926..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_mirccntrl.h +++ /dev/null @@ -1,163 +0,0 @@ -#ifndef _KVI_MIRCCNTRL_H_ -#define _KVI_MIRCCNTRL_H_ - -//============================================================================= -// -// File : kvi_mirccntrl.h -// Creation date : Thu Jun 29 2000 21:06:55 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - -//============================================================================= -// This file contains non-customizable standards -// -// Better do not touch this :) -//============================================================================= - -#include "kvi_settings.h" -#include "kvi_string.h" - -// -// mIrc color codes -// - -#define KVI_WHITE 0 -#define KVI_BLACK 1 -#define KVI_DARKBLUE 2 -#define KVI_DARKGREEN 3 -#define KVI_RED 4 -#define KVI_DARKRED 5 -#define KVI_DARKVIOLET 6 -#define KVI_ORANGE 7 -#define KVI_YELLOW 8 -#define KVI_LIGHTGREEN 9 -#define KVI_BLUEMARINE 10 -#define KVI_LIGHTBLUE 11 -#define KVI_BLUE 12 -#define KVI_LIGHTVIOLET 13 -#define KVI_DARKGRAY 14 -#define KVI_LIGHTGRAY 15 - -#define KVI_MIRCCOLOR_MAX_FOREGROUND 15 -#define KVI_MIRCCOLOR_MAX_BACKGROUND 15 - -// -// Non-standard color codes for KviIrcView -// -#define KVI_TRANSPARENT 100 -#define KVI_NOCHANGE 101 -// -// Internal control codes for KviIrcView -// -// (Totally artificial and internal to KviIrcView) -#define KVI_TEXT_ESCAPE 0x04 -#define KVI_TEXT_UNESCAPE 0x05 -#define KVI_TEXT_UNICON 0x06 -//#define KVI_TEXT_EMOTICON 0x07 - -// ASCII Stuff: the following defines are meant to be escape sequences -// that can go thru an IRC connection - -// The following table is a 30-minute analysis of the escape characters commonly used over the IRC protocol... -// created when looking for a good placement for the CRYPT escape char in KVirc. -// I guess that the best chars to be used were FS,GS,RS,US,DC1,DC2,DC3,DC4...they have the "less defined" -// meaning as ASCII control chars. -// mmmh... :) - -// ASCII IRC Meaning -// 000 NUL Null (Cannot be assigned) -// 001 SOH Start of heading ( CTCP Escape: only beginning of the message ) -// 002 STX Start of text ( Bold text ) -// 003 ETX End of text ( Color text escape sequence ) -// 004 EOT End of transmission ( Assigned internally (escape) ) -// 005 ENQ Enquiry (WRU: Who are you) ( Assigned internally (unescape) ) -// 006 ACK Acknowledge (Not so good, but can be used as last resource) -// 007 BEL Bell ( Recognized as bell by terminals and IRCII ) (Used also by some IRC servers) -// 008 BS Backspace (Should not be assigned: terminal control) -// 009 HT Horizontal tabulation (Should not be assigned: terminal control) -// 010 LF Line feed (Should not be assigned: terminal control) -// 011 VT Vertical tabulation (Should not be assigned: terminal control) -// 012 FF Form feed (Should not be assigned: terminal control) -// 013 CR Carriage return (Should not be assigned: terminal control) -// 014 SO Shift out (Should not be assigned: terminal control) -// 015 SI Shift in ( Resets Bold,Color,Underline and Reverse ) (Conflicting with terminal control) -// 016 DLE Data link escape (Decent , can be assigned) -// 017 DC1 Device control 1 (Good to be assigned) -// 018 DC2 Device control 2 (Good to be assigned) -// 019 DC3 Device control 3 (Good to be assigned) -// 020 DC4 Device control 4 (Good to be assigned) -// 021 NAK Negative acknowledge (Not so good, but could be used as last resource) -// 022 SYN Synchronous idle ( Reverse text ) -// 023 ETB End of transmission block (Decent , can be assigned) -// 024 CAN Cancel (Should not be assigned: terminal control) -// 025 EM End of medium (Decent , can be assigned) -// 026 SUB Substitute (Should not be assigned: terminal control) -// 027 ESC Escape (Should not be assigned: terminal control) -// 028 FS File separator (Excellent , should be used as first candidate) -// 029 GS Group separator ( ICONS Escape: beginning of a word ) -// 030 RS Record separator ( CRYPT Escape: only beginning of the message ) -// 031 US Unit separator ( Underline text ) - - -// -// mIrc control codes -// - -//31 (0001 1111) US (Unit separator) -#define KVI_TEXT_UNDERLINE 0x1f -//2 (0000 0010) STX (Start of text) -#define KVI_TEXT_BOLD 0x02 -//15 (0000 1111) SI (Shift in) -#define KVI_TEXT_RESET 0x0f -//22 (0001 0110) SYN (Synchronous idle) -#define KVI_TEXT_REVERSE 0x16 -//3 (0000 0011) ETX (End of text) -#define KVI_TEXT_COLOR 0x03 - -// -// Irc control codes -// -//1 (0000 0001) SOH (Start of heading) -#define KVI_TEXT_CTCP 0x01 - -// -// KVirc added control codes -// -//30 (0001 1110) RS (Record separator) -#define KVI_TEXT_CRYPTESCAPE 0x1e -//29 (0001 1101) GS (Group separator) -#define KVI_TEXT_ICON 0x1d - -#ifndef _KVI_MIRCCNTRL_CPP_ - extern KVILIB_API const char * getColorBytes(const char *data_ptr,unsigned char *byte_1,unsigned char *byte_2); - extern KVILIB_API const kvi_wchar_t * getColorBytesW(const kvi_wchar_t *data_ptr,unsigned char *byte_1,unsigned char *byte_2); - extern KVILIB_API unsigned int getUnicodeColorBytes(const QString &szData,unsigned int charIdx,unsigned char *byte_1,unsigned char *byte_2); - inline const QChar * getUnicodeColorBytes(const QChar *pData,unsigned char *byte_1,unsigned char *byte_2) - { return (QChar *)getColorBytesW((const kvi_wchar_t *)pData,byte_1,byte_2); }; - -#endif - -namespace KviMircCntrl -{ - KVILIB_API QString stripControlBytes(const QString &szData); -} - - -#endif //_KVI_MIRCCNTRL_H_ diff --git a/3.4.0/src/kvilib/irc/kvi_nickserv.cpp b/3.4.0/src/kvilib/irc/kvi_nickserv.cpp deleted file mode 100644 index 49ccf7ba1a..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_nickserv.cpp +++ /dev/null @@ -1,312 +0,0 @@ -//============================================================================= -// -// File : kvi_nickserv.cpp -// Creation date : Thu Aug 09 2001 17:44:56 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_nickserv.h" -#include "kvi_config.h" -#include "kvi_ircmask.h" - -#include <qregexp.h> - - - -/* - @doc: nickserv_proto - @title: - Authentication with NickServ - @keyterms: - NickServ, automatic authentication with NickServ - @type: - generic - @short: - Automatic authentication with NickServ - @body: - KVIrc supports automatic authentication with the NickServ service.[br] - This service is commonly implemented on major IRC networks: basically - it is a program that allows users to register their nickname and protect - it from being stolen by others.[br] The NickServ protocol is - not standardized (at the time that I'm writing this doc) and automatic - authentication is a pure experimental protocol.[br] - Once you get on IRC with a registered nickname , the NickServ will - ask you for identification by sending you a NOTICE.[br] - The message will look in a way similar to the following:[br] - <b>You're using a registered nickname: if this is your nick, - please type /msg NickServ IDENTIFY password, otherwise please - choose another nickname</b>.[br] - The message is often broken in two or three lines of text.[br] - Please note that many network policies suggest to avoid automatic authentication - with NickServ.[br]I have implemented it because I know that it works on the networks - that I'm usually on.[br]You have to check that this protocol works on your network and - then eventually use it at your own risk.[br] -*/ - - -// FIXME: The doc above is a bit outdated , fix it - -KviNickServRuleSet::KviNickServRuleSet() -: KviHeapObject() -{ - m_bEnabled = false; - m_pRules = 0; -} - -KviNickServRuleSet::KviNickServRuleSet(const KviNickServRuleSet &s) -{ - m_pRules = 0; - copyFrom(s); -} - - -KviNickServRuleSet::~KviNickServRuleSet() -{ - if(m_pRules)delete m_pRules; -} - -void KviNickServRuleSet::save(KviConfig * cfg,const QString &prefix) -{ - if(!m_pRules)return; // nothing to save - if(m_pRules->isEmpty())return; // should never happen anyway - QString tmp; - if(m_bEnabled) - { - KviQString::sprintf(tmp,"%QNSEnabled",&prefix); - cfg->writeEntry(tmp,m_bEnabled); - } - KviQString::sprintf(tmp,"%QNSRules",&prefix); - cfg->writeEntry(tmp,m_pRules->count()); - int idx = 0; - for(KviNickServRule * r = m_pRules->first();r;r = m_pRules->next()) - { - KviQString::sprintf(tmp,"%QNSRule%d_",&prefix,idx); - r->save(cfg,tmp); - idx++; - } -} - -KviNickServRuleSet * KviNickServRuleSet::load(KviConfig * cfg,const QString &prefix) -{ - QString tmp; - KviQString::sprintf(tmp,"%QNSRules",&prefix); - unsigned int cnt = cfg->readUIntEntry(tmp,0); - if(cnt == 0)return 0; - KviNickServRuleSet * s = new KviNickServRuleSet(); - if(s->loadPrivate(cfg,prefix,cnt))return s; - delete s; - return 0; -} - -void KviNickServRuleSet::load(const QString &szConfigFile) -{ - clear(); - KviConfig cfg(szConfigFile,KviConfig::Read); - - QString tmp; - KviQString::sprintf(tmp,"NSRules"); - unsigned int cnt = cfg.readUIntEntry(tmp,0); - if(cnt == 0)return; - loadPrivate(&cfg,QString(""),cnt); -} - -void KviNickServRuleSet::save(const QString &szConfigFile) -{ - KviConfig cfg(szConfigFile,KviConfig::Write); - cfg.clear(); - save(&cfg,QString("")); -} - -bool KviNickServRuleSet::loadPrivate(KviConfig * cfg,const QString &prefix,unsigned int nEntries) -{ - if(m_pRules)m_pRules->clear(); - else { - m_pRules = new KviPointerList<KviNickServRule>; - m_pRules->setAutoDelete(true); - } - - if(nEntries != 0) - { - QString tmp; - KviQString::sprintf(tmp,"%QNSEnabled",&prefix); - m_bEnabled = cfg->readBoolEntry(tmp,false); - for(unsigned int u=0;u<nEntries;u++) - { - KviQString::sprintf(tmp,"%QNSRule%u_",&prefix,u); - KviNickServRule * r = new KviNickServRule(); - if(!r->load(cfg,tmp))delete r; - else m_pRules->append(r); - } - } - - if(m_pRules->isEmpty()) - { - m_bEnabled = false; - delete m_pRules; - m_pRules = 0; - return false; - } - return true; -} - -void KviNickServRuleSet::clear() -{ - if(m_pRules) - { - delete m_pRules; - m_pRules = 0; - } - m_bEnabled = false; -} - -void KviNickServRuleSet::addRule(KviNickServRule * r) -{ - if(!m_pRules) - { - m_pRules = new KviPointerList<KviNickServRule>; - m_pRules->setAutoDelete(true); - } - m_pRules->append(r); -} - -KviNickServRuleSet * KviNickServRuleSet::createInstance() -{ - return new KviNickServRuleSet(); -} - - -KviNickServRule * KviNickServRuleSet::matchRule(const QString &szNick,const KviIrcMask *nickServ,const QString &szMsg,const QString &szServer) -{ - if(!m_pRules)return 0; - for(KviNickServRule *r = m_pRules->first();r;r = m_pRules->next()) - { - if(!KviQString::matchStringCI(r->registeredNick(),szNick,false,true)) continue; - if(!szServer.isEmpty()) - { -#ifdef COMPILE_USE_QT4 - QRegExp res(r->serverMask(),Qt::CaseInsensitive,QRegExp::Wildcard); -#else - QRegExp res(r->serverMask(),false,true); -#endif - if(!res.exactMatch(szServer))continue; - } - if(!nickServ->matchedBy(KviIrcMask(r->nickServMask())))continue; -#ifdef COMPILE_USE_QT4 - QRegExp re(r->messageRegexp(),Qt::CaseInsensitive,QRegExp::Wildcard); -#else - QRegExp re(r->messageRegexp(),false,true); -#endif - if(re.exactMatch(szMsg))return r; - } - return 0; -} - -void KviNickServRuleSet::copyFrom(const KviNickServRuleSet &src) -{ - if(src.m_pRules) - { - if(m_pRules)m_pRules->clear(); - else { - m_pRules = new KviPointerList<KviNickServRule>; - m_pRules->setAutoDelete(true); - } - for(KviNickServRule * r = src.m_pRules->first();r;r = src.m_pRules->next()) - { - KviNickServRule * c = new KviNickServRule(); - c->copyFrom(*r); - m_pRules->append(c); - } - if(m_pRules->isEmpty()) - { - m_bEnabled = false; - delete m_pRules; - m_pRules = 0; - } else { - m_bEnabled = src.m_bEnabled; - } - } else { - m_bEnabled = false; - if(m_pRules) - { - delete m_pRules; - m_pRules = 0; - } - } -} - - -void KviNickServRule::copyFrom(const KviNickServRule &src) -{ - m_szRegisteredNick = src.m_szRegisteredNick; - m_szNickServMask = src.m_szNickServMask; - m_szMessageRegexp = src.m_szMessageRegexp; - m_szIdentifyCommand = src.m_szIdentifyCommand; - m_szServerMask = src.m_szServerMask; -} - -void KviNickServRule::save(KviConfig * cfg,const QString &prefix) -{ - QString tmp; - KviQString::sprintf(tmp,"%QRegisteredNick",&prefix); - cfg->writeEntry(tmp,m_szRegisteredNick); - KviQString::sprintf(tmp,"%QNickServMask",&prefix); - cfg->writeEntry(tmp,m_szNickServMask); - KviQString::sprintf(tmp,"%QMessageRegexp",&prefix); - cfg->writeEntry(tmp,m_szMessageRegexp); - KviQString::sprintf(tmp,"%QIdentifyCommand",&prefix); - cfg->writeEntry(tmp,m_szIdentifyCommand); - KviQString::sprintf(tmp,"%QServerMask",&prefix); - cfg->writeEntry(tmp,m_szServerMask); -} - -bool KviNickServRule::load(KviConfig * cfg,const QString &prefix) -{ - QString tmp; - KviQString::sprintf(tmp,"%QRegisteredNick",&prefix); - m_szRegisteredNick = KviQString::trimmed(cfg->readQStringEntry(tmp)); - if(m_szRegisteredNick.isEmpty())return false; - KviQString::sprintf(tmp,"%QNickServMask",&prefix); - m_szNickServMask = cfg->readQStringEntry(tmp); - if(m_szNickServMask.isEmpty())return false; - KviQString::sprintf(tmp,"%QServerMask",&prefix); - m_szServerMask = cfg->readQStringEntry(tmp,QString::null); - KviQString::sprintf(tmp,"%QMessageRegexp",&prefix); - m_szMessageRegexp = cfg->readQStringEntry(tmp); - if(m_szMessageRegexp.isEmpty())return false; - KviQString::sprintf(tmp,"%QIdentifyCommand",&prefix); - m_szIdentifyCommand = cfg->readQStringEntry(tmp); - return !m_szIdentifyCommand.isEmpty(); -} - -KviNickServRule * KviNickServRule::createInstance(const QString &szRegisteredNick, - const QString &szNickServMask, - const QString &szMessageRegexp, - const QString &szIdentifyCommand, - const QString &szServerMask) -{ - return new KviNickServRule(szRegisteredNick,szNickServMask,szMessageRegexp,szIdentifyCommand,szServerMask); -} - - - - diff --git a/3.4.0/src/kvilib/irc/kvi_nickserv.h b/3.4.0/src/kvilib/irc/kvi_nickserv.h deleted file mode 100644 index 6a15cc5357..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_nickserv.h +++ /dev/null @@ -1,112 +0,0 @@ -#ifndef _KVI_NICKSERV_H_ -#define _KVI_NICKSERV_H_ -//============================================================================= -// -// File : kvi_nickserv.h -// Creation date : Thu Aug 09 2001 16:43:56 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_heapobject.h" -#include "kvi_pointerlist.h" - -class KviConfig; -class KviIrcMask; - -class KVILIB_API KviNickServRule : public KviHeapObject -{ -protected: - QString m_szRegisteredNick; // my registered nickname - QString m_szNickServMask; // the NickServ service mask - QString m_szMessageRegexp; // the NickServ message regexp - QString m_szIdentifyCommand; // the IDENTIFY command to send to server - QString m_szServerMask; // the mask that the server must match (not used in per-network rules) -public: - KviNickServRule() : KviHeapObject() {}; - KviNickServRule( - const QString &szRegisteredNick, - const QString &szNickServMask, - const QString &szMessageRegexp, - const QString &szIdentifyCommand, - const QString &szServerMask = QString::null) - : KviHeapObject(), - m_szRegisteredNick(szRegisteredNick), - m_szNickServMask(szNickServMask), - m_szMessageRegexp(szMessageRegexp), - m_szIdentifyCommand(szIdentifyCommand), - m_szServerMask(szServerMask) - {}; -public: - const QString & registeredNick() const { return m_szRegisteredNick; }; - const QString & nickServMask() const { return m_szNickServMask; }; - const QString & messageRegexp() const { return m_szMessageRegexp; }; - const QString & identifyCommand() const { return m_szIdentifyCommand; }; - const QString & serverMask() const { return m_szServerMask; }; - void setRegisteredNick(const QString &szRegisteredNick){ m_szRegisteredNick = szRegisteredNick; }; - void setNickServMask(const QString &szNickServMask){ m_szNickServMask = szNickServMask; }; - void setMessageRegexp(const QString &szMessageRegexp){ m_szMessageRegexp = szMessageRegexp; }; - void setIdentifyCommand(const QString &szIdentifyCommand){ m_szIdentifyCommand = szIdentifyCommand; }; - void setServerMask(const QString &szServerMask){ m_szServerMask = szServerMask; }; -public: - // avoid crashes under windows - static KviNickServRule * createInstance(const QString &szRegisteredNick, - const QString &szNickServMask, - const QString &szMessageRegexp, - const QString &szIdentifyCommand, - const QString &szServerMask = QString::null); - - void save(KviConfig * cfg,const QString &prefix); - // returns false if the loaded data has no sense - bool load(KviConfig * cfg,const QString &prefix); - void copyFrom(const KviNickServRule &src); -}; - -class KVILIB_API KviNickServRuleSet : public KviHeapObject -{ -public: - KviNickServRuleSet(); - KviNickServRuleSet(const KviNickServRuleSet &s); - ~KviNickServRuleSet(); -protected: - KviPointerList<KviNickServRule> * m_pRules; // FIXME: Replace with KviPointerHashTable<QString,KviPointerList> - bool m_bEnabled; -public: - // avoid crashes under windows - static KviNickServRuleSet * createInstance(); - void clear(); - bool isEnabled(){ return m_bEnabled; }; - void setEnabled(bool bEnabled){ m_bEnabled = bEnabled; }; - bool isEmpty(){ return m_pRules ? m_pRules->isEmpty() : true; }; - void addRule(KviNickServRule * r); - KviNickServRule * matchRule(const QString &szNick,const KviIrcMask *nickServ,const QString &szMsg,const QString &szServer = QString::null); - void copyFrom(const KviNickServRuleSet &src); - void load(const QString &szConfigFile); - void save(const QString &szConfigFile); - void save(KviConfig * cfg,const QString &prefix); - KviPointerList<KviNickServRule> * rules(){ return m_pRules; }; - static KviNickServRuleSet * load(KviConfig * cfg,const QString &prefix); -protected: - bool loadPrivate(KviConfig * cfg,const QString &prefix,unsigned int nEntries); -}; - - -#endif // _KVI_NICKSERV_H_ diff --git a/3.4.0/src/kvilib/irc/kvi_useridentity.cpp b/3.4.0/src/kvilib/irc/kvi_useridentity.cpp deleted file mode 100644 index c896930c1b..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_useridentity.cpp +++ /dev/null @@ -1,252 +0,0 @@ -//============================================================================= -// -// File : kvi_useridentity.cpp -// Created on Sun 21 Jan 2007 04:31:47 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2007 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVILIB__ - -#include "kvi_useridentity.h" -#include "kvi_locale.h" -#include "kvi_defaults.h" - -// FIXME: Put here also the default away message, default away nick, default ctcp replies etc ? - -bool KviUserIdentity::load(KviConfig &cfg) -{ - m_szId = cfg.group(); - m_szNickName = cfg.readQStringEntry("NickName"); - m_szAltNickName1 = cfg.readQStringEntry("AltNickName1"); - m_szAltNickName2 = cfg.readQStringEntry("AltNickName2"); - m_szAltNickName3 = cfg.readQStringEntry("AltNickName3"); - m_szUserName = cfg.readQStringEntry("UserName"); - // FIXME: At least scramble the pass ? - m_szPassword = cfg.readQStringEntry("Password"); - KviPixmap def; - m_pixAvatar = cfg.readPixmapEntry("Avatar",def); - m_szPartMessage = cfg.readQStringEntry("PartMessage"); - m_szQuitMessage= cfg.readQStringEntry("QuitMessage"); - m_szAge = cfg.readQStringEntry("Age"); - m_szGender = cfg.readQStringEntry("Gender"); - m_szLocation = cfg.readQStringEntry("Location"); - m_szLanguages = cfg.readQStringEntry("Languages"); - m_szOtherInfo = cfg.readQStringEntry("OtherInfo"); - m_szUserMode = cfg.readQStringEntry("UserMode"); - m_szOnConnectCommand = cfg.readQStringEntry("OnConnectCommand"); - m_szOnLoginCommand = cfg.readQStringEntry("OnLoginCommand"); - return !(m_szId.isEmpty() || m_szNickName.isEmpty()); -} - -bool KviUserIdentity::save(KviConfig &cfg) -{ - cfg.setGroup(m_szId); - cfg.writeEntry("NickName",m_szNickName); - cfg.writeEntry("AltNickName1",m_szAltNickName1); - cfg.writeEntry("AltNickName2",m_szAltNickName2); - cfg.writeEntry("AltNickName3",m_szAltNickName3); - cfg.writeEntry("UserName",m_szUserName); - // FIXME: At least scramble the pass ? - cfg.writeEntry("Password",m_szPassword); - cfg.writeEntry("Avatar",m_pixAvatar); - cfg.writeEntry("PartMessage",m_szPartMessage); - cfg.writeEntry("QuitMessage",m_szQuitMessage); - cfg.writeEntry("Age",m_szAge); - cfg.writeEntry("Gender",m_szGender); - cfg.writeEntry("Location",m_szLocation); - cfg.writeEntry("Languages",m_szLanguages); - cfg.writeEntry("OtherInfo",m_szOtherInfo); - cfg.writeEntry("UserMode",m_szUserMode); - cfg.writeEntry("OnConnectCommand",m_szOnConnectCommand); - cfg.writeEntry("OnLoginCommand",m_szOnLoginCommand); - return true; -} - -void KviUserIdentity::copyFrom(const KviUserIdentity &src) -{ - m_szId = src.m_szId; - m_szNickName = src.m_szNickName; - - m_szAltNickName1 = src.m_szAltNickName1; - m_szAltNickName2 = src.m_szAltNickName2; - m_szAltNickName3 = src.m_szAltNickName3; - - m_szUserName = src.m_szUserName; - m_szRealName = src.m_szRealName; - m_szPassword = src.m_szPassword; - - m_pixAvatar = src.m_pixAvatar; - - m_szUserName = src.m_szUserName; - m_szRealName = src.m_szRealName; - m_szPassword = src.m_szPassword; - - m_pixAvatar = src.m_pixAvatar; - - m_szPartMessage = src.m_szPartMessage; - m_szQuitMessage = src.m_szQuitMessage; - - m_szAge = src.m_szAge; - m_szGender = src.m_szGender; - m_szLocation = src.m_szLocation; - m_szLanguages = src.m_szLanguages; - m_szOtherInfo = src.m_szOtherInfo; - - m_szUserMode = src.m_szUserMode; - - m_szOnConnectCommand = src.m_szOnConnectCommand; - m_szOnLoginCommand = src.m_szOnLoginCommand; -} - - -KviUserIdentityManager * KviUserIdentityManager::m_pInstance = 0; - -KviUserIdentityManager::KviUserIdentityManager() -: KviHeapObject() -{ - m_pIdentityDict = new KviPointerHashTable<QString,KviUserIdentity>(); - m_pIdentityDict->setAutoDelete(true); -} - -KviUserIdentityManager::~KviUserIdentityManager() -{ - delete m_pIdentityDict; -} - -void KviUserIdentityManager::init() -{ - if(m_pInstance)return; - m_pInstance = new KviUserIdentityManager(); -} - -void KviUserIdentityManager::done() -{ - if(!m_pInstance)return; - delete m_pInstance; - m_pInstance = 0; -} - -const KviUserIdentity * KviUserIdentityManager::defaultIdentity() -{ - KviUserIdentity * ret; - if(!m_szDefaultIdentity.isEmpty()) - { - ret = m_pIdentityDict->find(m_szDefaultIdentity); - if(ret)return ret; - } - - // the default identity is borken :/ - // grab the first one - KviPointerHashTableIterator<QString,KviUserIdentity> it(*m_pIdentityDict); - ret = it.current(); - if(ret) - { - m_szDefaultIdentity = ret->id(); - return ret; - } - // no identities available: create the default - ret = new KviUserIdentity(); - - ret->setId(__tr2qs("Default")); - ret->setNickName(KVI_DEFAULT_NICKNAME1); - ret->setAltNickName1(KVI_DEFAULT_NICKNAME2); - ret->setAltNickName2(KVI_DEFAULT_NICKNAME3); - ret->setAltNickName3(KVI_DEFAULT_NICKNAME4); - ret->setUserName(KVI_DEFAULT_USERNAME); - ret->setRealName(KVI_DEFAULT_REALNAME); - ret->setPartMessage(KVI_DEFAULT_PART_MESSAGE); - ret->setQuitMessage(KVI_DEFAULT_QUIT_MESSAGE); - - m_pIdentityDict->replace(ret->id(),ret); - - return ret; -} - -void KviUserIdentityManager::load(const QString &szFileName) -{ - m_pIdentityDict->clear(); - - KviConfig cfg(szFileName,KviConfig::Read); - - cfg.setGroup("KVIrc"); - - m_szDefaultIdentity = cfg.readQStringEntry("DefaultIdentity",""); - - KviConfigIterator it(*(cfg.dict())); - while(KviConfigGroup * grp = it.current()) - { - if(!KviQString::equalCI(it.currentKey(),"KVIrc")) - { - cfg.setGroup(it.currentKey()); - - KviUserIdentity * id = new KviUserIdentity(); - if(id->load(cfg)) - m_pIdentityDict->replace(id->id(),id); - else - delete id; - } - ++it; - } -} - -void KviUserIdentityManager::save(const QString &szFileName) -{ - KviConfig cfg(szFileName,KviConfig::Write); - cfg.clear(); - - cfg.setGroup("KVIrc"); - - cfg.writeEntry("DefaultIdentity",m_szDefaultIdentity); - - KviPointerHashTableIterator<QString,KviUserIdentity> it(*m_pIdentityDict); - while(KviUserIdentity * id = it.current()) - { - id->save(cfg); - ++it; - } -} - -void KviUserIdentityManager::copyFrom(KviUserIdentityManager * pWorkingCopy) -{ - m_pIdentityDict->clear(); - m_szDefaultIdentity = pWorkingCopy->m_szDefaultIdentity; - KviPointerHashTableIterator<QString,KviUserIdentity> it(*(pWorkingCopy->m_pIdentityDict)); - while(KviUserIdentity * id = it.current()) - { - KviUserIdentity * pNew = new KviUserIdentity(); - pNew->copyFrom(*id); - m_pIdentityDict->replace(pNew->id(),pNew); - ++it; - } -} - -KviUserIdentityManager * KviUserIdentityManager::createWorkingCopy() -{ - KviUserIdentityManager * pCopy = new KviUserIdentityManager(); - pCopy->copyFrom(this); - return pCopy; -} - -void KviUserIdentityManager::releaseWorkingCopy(KviUserIdentityManager * pWorkingCopy) -{ - if(pWorkingCopy)delete pWorkingCopy; -} - - diff --git a/3.4.0/src/kvilib/irc/kvi_useridentity.h b/3.4.0/src/kvilib/irc/kvi_useridentity.h deleted file mode 100644 index 5a3f546dec..0000000000 --- a/3.4.0/src/kvilib/irc/kvi_useridentity.h +++ /dev/null @@ -1,145 +0,0 @@ -#ifndef _KVI_USERIDENTITY_H_ -#define _KVI_USERIDENTITY_H_ -//============================================================================= -// -// File : kvi_useridentity.h -// Created on Sun 21 Jan 2007 04:31:47 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2007 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_heapobject.h" -#include "kvi_pixmap.h" -#include "kvi_config.h" -#include "kvi_pointerhashtable.h" - -class KVILIB_API KviUserIdentity : public KviHeapObject -{ - friend class KviUserIdentityManager; -public: - KviUserIdentity() - : KviHeapObject() - { - } - ~KviUserIdentity() - { - } -protected: - QString m_szId; // the identity set name - - QString m_szNickName; - - QString m_szAltNickName1; - QString m_szAltNickName2; - QString m_szAltNickName3; - - QString m_szUserName; - QString m_szRealName; - QString m_szPassword; - - KviPixmap m_pixAvatar; - - QString m_szPartMessage; - QString m_szQuitMessage; - - QString m_szAge; - QString m_szGender; - QString m_szLocation; - QString m_szLanguages; - QString m_szOtherInfo; - - QString m_szUserMode; - - QString m_szOnConnectCommand; - QString m_szOnLoginCommand; -public: - const QString & id() const { return m_szId; }; - const QString & nickName() const { return m_szNickName; }; - const QString & altNickName1() const { return m_szAltNickName1; }; - const QString & altNickName2() const { return m_szAltNickName2; }; - const QString & altNickName3() const { return m_szAltNickName3; }; - const QString & userName() const { return m_szUserName; }; - const QString & password() const { return m_szPassword; }; - const KviPixmap & avatar() const { return m_pixAvatar; }; - const QString & partMessage() const { return m_szPartMessage; }; - const QString & quitMessage() const { return m_szQuitMessage; }; - const QString & age() const { return m_szAge; }; - const QString & gender() const { return m_szGender; }; - const QString & location() const { return m_szLocation; }; - const QString & languages() const { return m_szLanguages; }; - const QString & otherInfo() const { return m_szOtherInfo; }; - const QString & userMode() const { return m_szUserMode; }; - const QString & onConnectCommand() const { return m_szOnConnectCommand; }; - const QString & onLoginCommand() const { return m_szOnLoginCommand; }; - void setId(const QString &szId){ m_szId = szId; }; - void setNickName(const QString &szNickName){ m_szNickName = szNickName; }; - void setAltNickName1(const QString &szNickName){ m_szAltNickName1 = szNickName; }; - void setAltNickName2(const QString &szNickName){ m_szAltNickName2 = szNickName; }; - void setAltNickName3(const QString &szNickName){ m_szAltNickName3 = szNickName; }; - void setUserName(const QString &szUserName){ m_szUserName = szUserName; }; - void setRealName(const QString &szRealName){ m_szRealName = szRealName; }; - void setPassword(const QString &szPassword){ m_szPassword = szPassword; }; - void setAvatar(const KviPixmap &pix){ m_pixAvatar = pix; }; - void setPartMessage(const QString &szMsg){ m_szPartMessage = szMsg; }; - void setQuitMessage(const QString &szMsg){ m_szQuitMessage = szMsg; }; - void setAge(const QString &szAge){ m_szAge = szAge; }; - void setGender(const QString &szGender){ m_szGender = szGender; }; - void setLocation(const QString &szLocation){ m_szLocation = szLocation; }; - void setLanguages(const QString &szLanguages){ m_szLanguages = szLanguages; }; - void setOtherInfo(const QString &szOtherInfo){ m_szOtherInfo = szOtherInfo; }; - void setUserMode(const QString &szUserMode){ m_szUserMode = szUserMode; }; - void setOnConnectCommand(const QString &szOnConnectCommand){ m_szOnConnectCommand = szOnConnectCommand; }; - void setOnLoginCommand(const QString &szOnLoginCommand){ m_szOnLoginCommand = szOnLoginCommand; }; -protected: - void copyFrom(const KviUserIdentity &src); - bool save(KviConfig &cfg); - bool load(KviConfig &cfg); -}; - -class KVILIB_API KviUserIdentityManager : public KviHeapObject -{ -protected: - KviUserIdentityManager(); - ~KviUserIdentityManager(); -protected: - static KviUserIdentityManager * m_pInstance; - KviPointerHashTable<QString,KviUserIdentity> * m_pIdentityDict; - QString m_szDefaultIdentity; -public: - static void init(); - static void done(); - static KviUserIdentityManager * instance(){ return m_pInstance; }; - - KviPointerHashTable<QString,KviUserIdentity> * identityDict(){ return m_pIdentityDict; }; - const KviUserIdentity * findIdentity(const QString &szId){ return m_pIdentityDict->find(szId); }; - // NEVER NULL - const KviUserIdentity * defaultIdentity(); - - void setDefaultIdentity(const QString &szIdentityId){ m_szDefaultIdentity = szIdentityId; }; - - KviUserIdentityManager * createWorkingCopy(); - void copyFrom(KviUserIdentityManager * pWorkingCopy); - void releaseWorkingCopy(KviUserIdentityManager * pWorkingCopy); - - void save(const QString &szFileName); - void load(const QString &szFileName); -}; - -#endif //!_KVI_USERIDENTITY_H_ diff --git a/3.4.0/src/kvilib/kvilib.dsw b/3.4.0/src/kvilib/kvilib.dsw deleted file mode 100644 index d194024490..0000000000 --- a/3.4.0/src/kvilib/kvilib.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "KVILIB"=.\KVILIB.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/3.4.0/src/kvilib/kvilib.vcproj b/3.4.0/src/kvilib/kvilib.vcproj deleted file mode 100755 index ac91e66f20..0000000000 --- a/3.4.0/src/kvilib/kvilib.vcproj +++ /dev/null @@ -1,816 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="7.10" - Name="kvilib" - ProjectGUID="{122A0296-534F-4A77-B55F-5EF4E642ACD0}" - Keyword="Win32Proj"> - <Platforms> - <Platform - Name="Win32"/> - </Platforms> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin" - IntermediateDirectory="Debug" - ConfigurationType="2" - CharacterSet="2"> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - InlineFunctionExpansion="0" - FavorSizeOrSpeed="1" - AdditionalIncludeDirectories=""$(ProjectDir)\tal";"$(ProjectDir)\system";"$(ProjectDir)\irc";"$(ProjectDir)\file";"$(ProjectDir)\ext";"$(ProjectDir)\net";"$(ProjectDir)\core\wstring";"$(ProjectDir)\core";"$(ProjectDir)\config";"$(SSLINCDIR)";"$(QTDIR)\include"" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;KVILIB_EXPORTS" - MinimalRebuild="TRUE" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" - DebugInformationFormat="4"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt-mtnc321.lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib msvcrt.lib" - OutputFile="$(OutDir)\kvilib.dll" - LinkIncremental="2" - AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(QTDIR)\lib"" - IgnoreAllDefaultLibraries="TRUE" - GenerateDebugInformation="TRUE" - ProgramDatabaseFile="$(OutDir)/kvilib.pdb" - SubSystem="2" - ImportLibrary="$(OutDir)/kvilib.lib" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin" - IntermediateDirectory="Release" - ConfigurationType="2" - CharacterSet="2"> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - GlobalOptimizations="TRUE" - InlineFunctionExpansion="2" - FavorSizeOrSpeed="1" - OmitFramePointers="TRUE" - EnableFiberSafeOptimizations="TRUE" - AdditionalIncludeDirectories=""$(ProjectDir)\tal";"$(ProjectDir)\system";"$(ProjectDir)\irc";"$(ProjectDir)\file";"$(ProjectDir)\ext";"$(ProjectDir)\net";"$(ProjectDir)\core\wstring";"$(ProjectDir)\core";"$(ProjectDir)\config";"$(SSLINCDIR)";"$(QTDIR)\include"" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;KVILIB_EXPORTS" - StringPooling="TRUE" - RuntimeLibrary="0" - EnableFunctionLevelLinking="TRUE" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" - DebugInformationFormat="3"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt-mtnc321.lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib msvcrt.lib" - OutputFile="$(OutDir)\kvilib.dll" - LinkIncremental="1" - AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(QTDIR)\lib"" - IgnoreAllDefaultLibraries="TRUE" - GenerateDebugInformation="TRUE" - SubSystem="2" - OptimizeReferences="2" - EnableCOMDATFolding="2" - OptimizeForWindows98="1" - ImportLibrary="$(OutDir)/kvilib.lib" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> - <File - RelativePath="irc\kvi_avatar.cpp"> - </File> - <File - RelativePath="irc\kvi_avatarcache.cpp"> - </File> - <File - RelativePath="ext\kvi_cmdformatter.cpp"> - </File> - <File - RelativePath="ext\kvi_config.cpp"> - </File> - <File - RelativePath="ext\kvi_crypt.cpp"> - </File> - <File - RelativePath="ext\kvi_databuffer.cpp"> - </File> - <File - RelativePath="ext\kvi_datacontainer.cpp"> - </File> - <File - RelativePath="net\kvi_dns.cpp"> - </File> - <File - RelativePath="system\kvi_env.cpp"> - </File> - <File - RelativePath="core\kvi_error.cpp"> - </File> - <File - RelativePath="file\kvi_file.cpp"> - </File> - <File - RelativePath="file\kvi_fileutils.cpp"> - </File> - <File - RelativePath="ext\kvi_garbage.cpp"> - </File> - <File - RelativePath=".\core\kvi_heapobject.cpp"> - </File> - <File - RelativePath="net\kvi_http.cpp"> - </File> - <File - RelativePath="ext\kvi_imagelib.cpp"> - </File> - <File - RelativePath="irc\kvi_ircmask.cpp"> - </File> - <File - RelativePath="irc\kvi_ircserver.cpp"> - </File> - <File - RelativePath="irc\kvi_ircserverdb.cpp"> - </File> - <File - RelativePath="irc\kvi_ircuserdb.cpp"> - </File> - <File - RelativePath="system\kvi_locale.cpp"> - </File> - <File - RelativePath="core\kvi_malloc.cpp"> - </File> - <File - RelativePath="ext\kvi_md5.cpp"> - </File> - <File - RelativePath="ext\kvi_mediatype.cpp"> - </File> - <File - RelativePath="core\kvi_memmove.cpp"> - </File> - <File - RelativePath="irc\kvi_mirccntrl.cpp"> - </File> - <File - RelativePath="ext\kvi_msgtype.cpp"> - </File> - <File - RelativePath="net\kvi_netutils.cpp"> - </File> - <File - RelativePath="irc\kvi_nickserv.cpp"> - </File> - <File - RelativePath=".\ext\kvi_osinfo.cpp"> - </File> - <File - RelativePath="ext\kvi_parameterlist.cpp"> - </File> - <File - RelativePath="ext\kvi_pixmap.cpp"> - </File> - <File - RelativePath="ext\kvi_proxydb.cpp"> - </File> - <File - RelativePath="core\kvi_qstring.cpp"> - </File> - <File - RelativePath="ext\kvi_regchan.cpp"> - </File> - <File - RelativePath="ext\kvi_regusersdb.cpp"> - </File> - <File - RelativePath="ext\kvi_sharedfiles.cpp"> - </File> - <File - RelativePath="net\kvi_socket.cpp"> - </File> - <File - RelativePath="net\kvi_ssl.cpp"> - </File> - <File - RelativePath="core\kvi_string.cpp"> - </File> - <File - RelativePath="core\kvi_stringarray.cpp"> - </File> - <File - RelativePath="ext\kvi_stringconversion.cpp"> - </File> - <File - RelativePath="tal\kvi_tal_application.cpp"> - </File> - <File - RelativePath="tal\kvi_tal_filedialog.cpp"> - </File> - <File - RelativePath="tal\kvi_tal_mainwindow.cpp"> - </File> - <File - RelativePath="tal\kvi_tal_menubar.cpp"> - </File> - <File - RelativePath="tal\kvi_tal_toolbar.cpp"> - </File> - <File - RelativePath="system\kvi_thread.cpp"> - </File> - <File - RelativePath="system\kvi_time.cpp"> - </File> - <File - RelativePath="net\kvi_url.cpp"> - </File> - <File - RelativePath="ext\moc_kvi_crypt.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__"/> - </FileConfiguration> - </File> - <File - RelativePath="net\moc_kvi_dns.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__"/> - </FileConfiguration> - </File> - <File - RelativePath="ext\moc_kvi_garbage.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__"/> - </FileConfiguration> - </File> - <File - RelativePath="net\moc_kvi_http.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__"/> - </FileConfiguration> - </File> - <File - RelativePath="system\moc_kvi_locale.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__"/> - </FileConfiguration> - </File> - <File - RelativePath="ext\moc_kvi_sharedfiles.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__"/> - </FileConfiguration> - </File> - <File - RelativePath="system\moc_kvi_thread.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__"/> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc"> - <File - RelativePath="irc\kvi_avatar.h"> - </File> - <File - RelativePath="irc\kvi_avatarcache.h"> - </File> - <File - RelativePath="core\kvi_bswap.h"> - </File> - <File - RelativePath="ext\kvi_cmdformatter.h"> - </File> - <File - RelativePath="ext\kvi_config.h"> - </File> - <File - RelativePath="config\kvi_confignames.h"> - </File> - <File - RelativePath="ext\kvi_crypt.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_databuffer.h"> - </File> - <File - RelativePath="ext\kvi_datacontainer.h"> - </File> - <File - RelativePath="config\kvi_debug.h"> - </File> - <File - RelativePath="config\kvi_defaults.h"> - </File> - <File - RelativePath="net\kvi_dns.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="system\kvi_env.h"> - </File> - <File - RelativePath="core\kvi_error.h"> - </File> - <File - RelativePath="file\kvi_file.h"> - </File> - <File - RelativePath="file\kvi_fileutils.h"> - </File> - <File - RelativePath="ext\kvi_garbage.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath=".\core\kvi_heapobject.h"> - </File> - <File - RelativePath="net\kvi_http.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_imagelib.h"> - </File> - <File - RelativePath="core\kvi_inttypes.h"> - </File> - <File - RelativePath="irc\kvi_ircmask.h"> - </File> - <File - RelativePath="irc\kvi_ircserver.h"> - </File> - <File - RelativePath="irc\kvi_ircserverdb.h"> - </File> - <File - RelativePath="irc\kvi_ircuserdb.h"> - </File> - <File - RelativePath="system\kvi_library.h"> - </File> - <File - RelativePath="core\kvi_list.h"> - </File> - <File - RelativePath="system\kvi_locale.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_malloc.h"> - </File> - <File - RelativePath="ext\kvi_md5.h"> - </File> - <File - RelativePath="ext\kvi_mediatype.h"> - </File> - <File - RelativePath="core\kvi_memmove.h"> - </File> - <File - RelativePath="irc\kvi_mirccntrl.h"> - </File> - <File - RelativePath="ext\kvi_msgtype.h"> - </File> - <File - RelativePath="net\kvi_netutils.h"> - </File> - <File - RelativePath="irc\kvi_nickserv.h"> - </File> - <File - RelativePath=".\ext\kvi_osinfo.h"> - </File> - <File - RelativePath="ext\kvi_parameterlist.h"> - </File> - <File - RelativePath="ext\kvi_pixmap.h"> - </File> - <File - RelativePath="ext\kvi_proxydb.h"> - </File> - <File - RelativePath="core\kvi_qstring.h"> - </File> - <File - RelativePath="ext\kvi_regchan.h"> - </File> - <File - RelativePath="ext\kvi_regusersdb.h"> - </File> - <File - RelativePath="config\kvi_settings.h"> - </File> - <File - RelativePath="ext\kvi_sharedfiles.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="net\kvi_socket.h"> - </File> - <File - RelativePath="net\kvi_sockettype.h"> - </File> - <File - RelativePath="net\kvi_ssl.h"> - </File> - <File - RelativePath="core\kvi_strasm.h"> - </File> - <File - RelativePath="core\kvi_string.h"> - </File> - <File - RelativePath="core\kvi_stringarray.h"> - </File> - <File - RelativePath="ext\kvi_stringconversion.h"> - </File> - <File - RelativePath="tal\kvi_tal_application.h"> - </File> - <File - RelativePath="tal\kvi_tal_application_kde.h"> - </File> - <File - RelativePath="tal\kvi_tal_application_qt.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_filedialog.h"> - </File> - <File - RelativePath="tal\kvi_tal_filedialog_kde.h"> - </File> - <File - RelativePath="tal\kvi_tal_filedialog_qt.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_mainwindow.h"> - </File> - <File - RelativePath="tal\kvi_tal_mainwindow_kde.h"> - </File> - <File - RelativePath="tal\kvi_tal_mainwindow_qt.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_menubar.h"> - </File> - <File - RelativePath="tal\kvi_tal_menubar_kde.h"> - </File> - <File - RelativePath="tal\kvi_tal_menubar_qt.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_toolbar.h"> - </File> - <File - RelativePath="tal\kvi_tal_toolbar_kde.h"> - </File> - <File - RelativePath="tal\kvi_tal_toolbar_qt.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_toolbardocktype.h"> - </File> - <File - RelativePath="core\wstring\kvi_textencoding.h"> - </File> - <File - RelativePath="system\kvi_thread.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="system\kvi_time.h"> - </File> - <File - RelativePath="net\kvi_url.h"> - </File> - <File - RelativePath="config\kvi_wincfg.h"> - </File> - <File - RelativePath="ext\kvi_xlib.h"> - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3.4.0/src/kvilib/kvilib_QT4_vc05.vcproj b/3.4.0/src/kvilib/kvilib_QT4_vc05.vcproj deleted file mode 100644 index 99fc0582b6..0000000000 --- a/3.4.0/src/kvilib/kvilib_QT4_vc05.vcproj +++ /dev/null @@ -1,2979 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8,00" - Name="kvilib" - ProjectGUID="{122A0296-534F-4A77-B55F-5EF4E642ACD0}" - RootNamespace="kvilib" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin\" - IntermediateDirectory="Debug" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - FavorSizeOrSpeed="1" - AdditionalIncludeDirectories=""$(ProjectDir)\tal";"$(ProjectDir)\system";"$(ProjectDir)\irc";"$(ProjectDir)\file";"$(ProjectDir)\ext";"$(ProjectDir)\net";"$(ProjectDir)\core\wstring";"$(ProjectDir)\core";"$(ProjectDir)\config";"$(SSLINCDIR)";"$(QTDIR)\include\";"$(QTDIR)\include\Qt3Support";"$(QTDIR)\include\QtCore\";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtNetwork";"$(QTDIR)\include\QtXml";"$(ZLIBINCDIR)"" - PreprocessorDefinitions="WIN32;_DEBUG;QT3_SUPPORT;_WINDOWS;_USRDLL;KVILIB_EXPORTS;_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="false" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt3support4.lib qtcore4.lib qtnetwork4.lib qtgui4.lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib advapi32.lib user32.lib" - OutputFile="$(OutDir)\kvilib.dll" - LinkIncremental="2" - AdditionalLibraryDirectories=""$(QTDIR)\lib";"$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE\";"$(SolutionDir)\win32build\bin\";"$(ZLIBLIBDIR)"" - GenerateManifest="true" - GenerateDebugInformation="true" - ProgramDatabaseFile="$(OutDir)/kvilib.pdb" - SubSystem="2" - TurnOffAssemblyGeneration="true" - ImportLibrary="$(OutDir)/kvilib.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest" - VerboseOutput="true" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin" - IntermediateDirectory="Release" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="1" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - AdditionalIncludeDirectories=""$(ProjectDir)\tal";"$(ProjectDir)\system";"$(ProjectDir)\irc";"$(ProjectDir)\file";"$(ProjectDir)\ext";"$(ProjectDir)\net";"$(ProjectDir)\core\wstring";"$(ProjectDir)\core";"$(ProjectDir)\config";"$(SSLINCDIR)";"$(QTDIR)\include\";"$(QTDIR)\include\Qt3Support";"$(QTDIR)\include\QtCore\";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtNetwork";"$(QTDIR)\include\QtXml";"$(ZLIBINCDIR)"" - PreprocessorDefinitions="WIN32;QT3_SUPPORT;NDEBUG;_WINDOWS;_USRDLL;KVILIB_EXPORTS;_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="false" - ExceptionHandling="1" - RuntimeLibrary="2" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="false" - DebugInformationFormat="0" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt3support4.lib qtcore4.lib qtgui4.lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib advapi32.lib user32.lib" - OutputFile="$(OutDir)\kvilib.dll" - LinkIncremental="2" - AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)"" - GenerateManifest="true" - IgnoreAllDefaultLibraries="false" - SubSystem="2" - OptimizeReferences="0" - TurnOffAssemblyGeneration="true" - ImportLibrary="$(OutDir)/kvilib.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest" - VerboseOutput="true" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm" - > - <File - RelativePath="irc\kvi_avatar.cpp" - > - </File> - <File - RelativePath="irc\kvi_avatarcache.cpp" - > - </File> - <File - RelativePath="ext\kvi_cmdformatter.cpp" - > - </File> - <File - RelativePath="ext\kvi_config.cpp" - > - </File> - <File - RelativePath="ext\kvi_crypt.cpp" - > - </File> - <File - RelativePath="ext\kvi_databuffer.cpp" - > - </File> - <File - RelativePath=".\ext\kvi_dcophelper.cpp" - > - </File> - <File - RelativePath="net\kvi_dns.cpp" - > - </File> - <File - RelativePath=".\ext\kvi_doublebuffer.cpp" - > - </File> - <File - RelativePath="system\kvi_env.cpp" - > - </File> - <File - RelativePath="core\kvi_error.cpp" - > - </File> - <File - RelativePath="file\kvi_file.cpp" - > - </File> - <File - RelativePath="file\kvi_fileutils.cpp" - > - </File> - <File - RelativePath="ext\kvi_garbage.cpp" - > - </File> - <File - RelativePath=".\core\kvi_heapobject.cpp" - > - </File> - <File - RelativePath="net\kvi_http.cpp" - > - </File> - <File - RelativePath="ext\kvi_imagelib.cpp" - > - </File> - <File - RelativePath="irc\kvi_ircmask.cpp" - > - </File> - <File - RelativePath="irc\kvi_ircserver.cpp" - > - </File> - <File - RelativePath="irc\kvi_ircserverdb.cpp" - > - </File> - <File - RelativePath="irc\kvi_ircuserdb.cpp" - > - </File> - <File - RelativePath="system\kvi_locale.cpp" - > - </File> - <File - RelativePath="core\kvi_malloc.cpp" - > - </File> - <File - RelativePath="ext\kvi_md5.cpp" - > - </File> - <File - RelativePath="ext\kvi_mediatype.cpp" - > - </File> - <File - RelativePath="core\kvi_memmove.cpp" - > - </File> - <File - RelativePath="irc\kvi_mirccntrl.cpp" - > - </File> - <File - RelativePath=".\ext\kvi_miscutils.cpp" - > - </File> - <File - RelativePath="ext\kvi_msgtype.cpp" - > - </File> - <File - RelativePath="net\kvi_netutils.cpp" - > - </File> - <File - RelativePath="irc\kvi_nickserv.cpp" - > - </File> - <File - RelativePath=".\ext\kvi_osinfo.cpp" - > - </File> - <File - RelativePath=".\file\kvi_packagefile.cpp" - > - </File> - <File - RelativePath="ext\kvi_parameterlist.cpp" - > - </File> - <File - RelativePath="ext\kvi_pixmap.cpp" - > - </File> - <File - RelativePath="ext\kvi_proxydb.cpp" - > - </File> - <File - RelativePath="core\kvi_qstring.cpp" - > - </File> - <File - RelativePath="ext\kvi_regchan.cpp" - > - </File> - <File - RelativePath="ext\kvi_regusersdb.cpp" - > - </File> - <File - RelativePath="ext\kvi_sharedfiles.cpp" - > - </File> - <File - RelativePath="net\kvi_socket.cpp" - > - </File> - <File - RelativePath="net\kvi_ssl.cpp" - > - </File> - <File - RelativePath="core\kvi_string.cpp" - > - </File> - <File - RelativePath="core\kvi_stringarray.cpp" - > - </File> - <File - RelativePath="ext\kvi_stringconversion.cpp" - > - </File> - <File - RelativePath="tal\kvi_tal_application.cpp" - > - </File> - <File - RelativePath="tal\kvi_tal_filedialog.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_grid.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_groupbox.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_hbox.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_iconview.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_listbox.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_listview.cpp" - > - </File> - <File - RelativePath="tal\kvi_tal_mainwindow.cpp" - > - </File> - <File - RelativePath="tal\kvi_tal_menubar.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_popupmenu.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_scrollview.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_tabdialog.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_textedit.cpp" - > - </File> - <File - RelativePath="tal\kvi_tal_toolbar.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_tooltip.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_vbox.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_widgetstack.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_wizard.cpp" - > - </File> - <File - RelativePath="system\kvi_thread.cpp" - > - </File> - <File - RelativePath="system\kvi_time.cpp" - > - </File> - <File - RelativePath="net\kvi_url.cpp" - > - </File> - <File - RelativePath=".\irc\kvi_useridentity.cpp" - > - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc" - > - <File - RelativePath=".\ext\kvi_accel.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="irc\kvi_avatar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="irc\kvi_avatarcache.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_bswap.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_cmdformatter.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_config.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="config\kvi_confignames.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_crypt.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_databuffer.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ext\kvi_dcophelper.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="config\kvi_debug.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="config\kvi_defaults.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\kvi_dns.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ext\kvi_doublebuffer.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ext\kvi_draganddrop.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="system\kvi_env.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_error.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="file\kvi_file.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="file\kvi_fileutils.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_garbage.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\core\kvi_heapobject.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\kvi_http.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_imagelib.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_inttypes.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="irc\kvi_ircmask.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="irc\kvi_ircserver.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="irc\kvi_ircserverdb.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="irc\kvi_ircuserdb.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Moc'ing kvi_ircuserdb.h..." - CommandLine="$(QTDIR)\bin\moc.exe irc\kvi_ircuserdb.h -o tmp\moc\moc_kvi_ircuserdb.cpp " - AdditionalDependencies="$(QTDIR)\bin\moc.exe;irc\kvi_ircuserdb.h" - Outputs="tmp\moc\moc_kvi_ircuserdb.cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Moc'ing kvi_ircuserdb.h..." - CommandLine="$(QTDIR)\bin\moc.exe irc\kvi_ircuserdb.h -o tmp\moc\moc_kvi_ircuserdb.cpp " - AdditionalDependencies="$(QTDIR)\bin\moc.exe;irc\kvi_ircuserdb.h" - Outputs="tmp\moc\moc_kvi_ircuserdb.cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="system\kvi_library.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_list.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="system\kvi_locale.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_malloc.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_md5.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_mediatype.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_memmove.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="irc\kvi_mirccntrl.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ext\kvi_miscutils.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_msgtype.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\kvi_netutils.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="irc\kvi_nickserv.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ext\kvi_osinfo.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\file\kvi_packagefile.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_parameterlist.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_pixmap.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\system\kvi_process.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_proxydb.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_qstring.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_regchan.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_regusersdb.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Moc'ing kvi_regusersdb.h..." - CommandLine="$(QTDIR)\bin\moc.exe ext\kvi_regusersdb.h -o tmp\moc\moc_kvi_regusersdb.cpp " - AdditionalDependencies="$(QTDIR)\bin\moc.exe;ext\kvi_regusersdb.h" - Outputs="tmp\moc\moc_kvi_regusersdb.cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Moc'ing kvi_regusersdb.h..." - CommandLine="$(QTDIR)\bin\moc.exe ext\kvi_regusersdb.h -o tmp\moc\moc_kvi_regusersdb.cpp " - AdditionalDependencies="$(QTDIR)\bin\moc.exe;ext\kvi_regusersdb.h" - Outputs="tmp\moc\moc_kvi_regusersdb.cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="config\kvi_settings.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_sharedfiles.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\kvi_socket.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\kvi_sockettype.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\kvi_ssl.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_strasm.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_string.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_stringarray.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_stringconversion.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_application.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_application_kde.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_application_qt.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_filedialog.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_filedialog_kde.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_filedialog_qt.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_filedialog_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_grid.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_grid_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_groupbox_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_hbox.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_hbox_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_iconview.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_iconview_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_listbox.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_listbox_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - AdditionalDependencies="" - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_listview.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_listview_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_mainwindow.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_mainwindow_kde.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_mainwindow_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_menubar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_menubar_kde.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_menubar_qt.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_popupmenu.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="" - Outputs="" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_popupmenu_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_scrollview.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_scrollview_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_tabdialog.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_tabdialog_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_textedit.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_textedit_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_toolbar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_toolbar_kde.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_toolbar_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_toolbardocktype.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_tooltip.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Moc'ing kvi_tal_tooltip.h..." - CommandLine="$(QTDIR)\bin\moc.exe .\tal\kvi_tal_tooltip.h -o tmp\moc\moc_kvi_tal_tooltip.cpp " - AdditionalDependencies="$(QTDIR)\bin\moc.exe;.\tal\kvi_tal_tooltip.h" - Outputs="tmp\moc\moc_kvi_tal_tooltip.cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Moc'ing kvi_tal_tooltip.h..." - CommandLine="$(QTDIR)\bin\moc.exe .\tal\kvi_tal_tooltip.h -o tmp\moc\moc_kvi_tal_tooltip.cpp " - AdditionalDependencies="$(QTDIR)\bin\moc.exe;.\tal\kvi_tal_tooltip.h" - Outputs="tmp\moc\moc_kvi_tal_tooltip.cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_vbox.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_vbox_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_widgetstack.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_widgetstack_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_windowstate.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_wizard.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="" - Outputs="" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_wizard_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="system\kvi_thread.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="system\kvi_time.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\kvi_url.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\irc\kvi_useridentity.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="config\kvi_wincfg.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_xlib.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" - > - </Filter> - <Filter - Name="Generated MOC Files" - Filter="moc;cpp" - UniqueIdentifier="{fe6e9830-be46-497d-995d-44b99b58e215}" - ParseFiles="false" - > - <File - RelativePath="ext\moc_kvi_crypt.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\moc_kvi_dns.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\moc_kvi_garbage.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\moc_kvi_http.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tmp\moc\moc_kvi_ircuserdb.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath="system\moc_kvi_locale.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tmp\moc\moc_kvi_regusersdb.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\moc_kvi_sharedfiles.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tmp\moc\moc_kvi_tal_tooltip.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath="system\moc_kvi_thread.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3.4.0/src/kvilib/kvilib_vc05.vcproj b/3.4.0/src/kvilib/kvilib_vc05.vcproj deleted file mode 100644 index 5f374ed781..0000000000 --- a/3.4.0/src/kvilib/kvilib_vc05.vcproj +++ /dev/null @@ -1,3280 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8,00" - Name="kvilib" - ProjectGUID="{122A0296-534F-4A77-B55F-5EF4E642ACD0}" - RootNamespace="kvilib" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin\" - IntermediateDirectory="Debug" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - FavorSizeOrSpeed="1" - AdditionalIncludeDirectories=""$(ProjectDir)\tal";"$(ProjectDir)\system";"$(ProjectDir)\irc";"$(ProjectDir)\file";"$(ProjectDir)\ext";"$(ProjectDir)\net";"$(ProjectDir)\core\wstring";"$(ProjectDir)\core";"$(ProjectDir)\config";"$(SSLINCDIR)";"$(ZLIBINCDIR)";"$(QTDIR)\include"" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;KVILIB_EXPORTS;_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt-$(QTTAG).lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib msvcrt.lib perl58.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib" - OutputFile="$(OutDir)\kvilib.dll" - LinkIncremental="2" - AdditionalLibraryDirectories=""$(QTDIR)\lib";"$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE\";"$(SolutionDir)\win32build\bin\";"$(ZLIBLIBDIR)"" - GenerateManifest="true" - IgnoreAllDefaultLibraries="true" - GenerateDebugInformation="true" - ProgramDatabaseFile="$(OutDir)/kvilib.pdb" - SubSystem="2" - TurnOffAssemblyGeneration="true" - ImportLibrary="$(OutDir)/kvilib.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest" - VerboseOutput="true" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin" - IntermediateDirectory="Release" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="1" - AdditionalIncludeDirectories=""$(ProjectDir)\tal";"$(ProjectDir)\system";"$(ProjectDir)\irc";"$(ProjectDir)\file";"$(ProjectDir)\ext";"$(ProjectDir)\net";"$(ProjectDir)\core\wstring";"$(ProjectDir)\core";"$(ProjectDir)\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ZLIBINCDIR)"" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;KVILIB_EXPORTS;_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - MinimalRebuild="false" - RuntimeLibrary="0" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt-$(QTTAG).lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib msvcrt.lib perl58.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib" - OutputFile="$(OutDir)\kvilib.dll" - LinkIncremental="2" - AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)"" - GenerateManifest="true" - IgnoreAllDefaultLibraries="true" - SubSystem="2" - OptimizeReferences="2" - TurnOffAssemblyGeneration="true" - ImportLibrary="$(OutDir)/kvilib.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest" - VerboseOutput="true" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm" - > - <File - RelativePath="irc\kvi_avatar.cpp" - > - </File> - <File - RelativePath="irc\kvi_avatarcache.cpp" - > - </File> - <File - RelativePath="ext\kvi_cmdformatter.cpp" - > - </File> - <File - RelativePath="ext\kvi_config.cpp" - > - </File> - <File - RelativePath="ext\kvi_crypt.cpp" - > - </File> - <File - RelativePath="ext\kvi_databuffer.cpp" - > - </File> - <File - RelativePath=".\ext\kvi_dcophelper.cpp" - > - </File> - <File - RelativePath="net\kvi_dns.cpp" - > - </File> - <File - RelativePath=".\ext\kvi_doublebuffer.cpp" - > - </File> - <File - RelativePath="system\kvi_env.cpp" - > - </File> - <File - RelativePath="core\kvi_error.cpp" - > - </File> - <File - RelativePath="file\kvi_file.cpp" - > - </File> - <File - RelativePath="file\kvi_fileutils.cpp" - > - </File> - <File - RelativePath="ext\kvi_garbage.cpp" - > - </File> - <File - RelativePath=".\core\kvi_heapobject.cpp" - > - </File> - <File - RelativePath="net\kvi_http.cpp" - > - </File> - <File - RelativePath="ext\kvi_imagelib.cpp" - > - </File> - <File - RelativePath="irc\kvi_ircmask.cpp" - > - </File> - <File - RelativePath="irc\kvi_ircserver.cpp" - > - </File> - <File - RelativePath="irc\kvi_ircserverdb.cpp" - > - </File> - <File - RelativePath="irc\kvi_ircuserdb.cpp" - > - </File> - <File - RelativePath="system\kvi_locale.cpp" - > - </File> - <File - RelativePath="core\kvi_malloc.cpp" - > - </File> - <File - RelativePath="ext\kvi_md5.cpp" - > - </File> - <File - RelativePath="ext\kvi_mediatype.cpp" - > - </File> - <File - RelativePath="core\kvi_memmove.cpp" - > - </File> - <File - RelativePath="irc\kvi_mirccntrl.cpp" - > - </File> - <File - RelativePath=".\ext\kvi_miscutils.cpp" - > - </File> - <File - RelativePath="ext\kvi_msgtype.cpp" - > - </File> - <File - RelativePath="net\kvi_netutils.cpp" - > - </File> - <File - RelativePath="irc\kvi_nickserv.cpp" - > - </File> - <File - RelativePath=".\ext\kvi_osinfo.cpp" - > - </File> - <File - RelativePath=".\file\kvi_packagefile.cpp" - > - </File> - <File - RelativePath="ext\kvi_parameterlist.cpp" - > - </File> - <File - RelativePath="ext\kvi_pixmap.cpp" - > - </File> - <File - RelativePath="ext\kvi_proxydb.cpp" - > - </File> - <File - RelativePath="core\kvi_qstring.cpp" - > - </File> - <File - RelativePath="ext\kvi_regchan.cpp" - > - </File> - <File - RelativePath="ext\kvi_regusersdb.cpp" - > - </File> - <File - RelativePath="ext\kvi_sharedfiles.cpp" - > - </File> - <File - RelativePath="net\kvi_socket.cpp" - > - </File> - <File - RelativePath="net\kvi_ssl.cpp" - > - </File> - <File - RelativePath="core\kvi_string.cpp" - > - </File> - <File - RelativePath="core\kvi_stringarray.cpp" - > - </File> - <File - RelativePath="ext\kvi_stringconversion.cpp" - > - </File> - <File - RelativePath="tal\kvi_tal_application.cpp" - > - </File> - <File - RelativePath="tal\kvi_tal_filedialog.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_grid.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_groupbox.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_hbox.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_iconview.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_listbox.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_listview.cpp" - > - </File> - <File - RelativePath="tal\kvi_tal_mainwindow.cpp" - > - </File> - <File - RelativePath="tal\kvi_tal_menubar.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_popupmenu.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_scrollview.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_tabdialog.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_textedit.cpp" - > - </File> - <File - RelativePath="tal\kvi_tal_toolbar.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_tooltip.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_vbox.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_widgetstack.cpp" - > - </File> - <File - RelativePath=".\tal\kvi_tal_wizard.cpp" - > - </File> - <File - RelativePath="system\kvi_thread.cpp" - > - </File> - <File - RelativePath="system\kvi_time.cpp" - > - </File> - <File - RelativePath="net\kvi_url.cpp" - > - </File> - <File - RelativePath=".\irc\kvi_useridentity.cpp" - > - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc" - > - <File - RelativePath=".\ext\kvi_accel.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="irc\kvi_avatar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="irc\kvi_avatarcache.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_bswap.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_cmdformatter.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_config.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="config\kvi_confignames.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_crypt.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_databuffer.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ext\kvi_dcophelper.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="config\kvi_debug.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="config\kvi_defaults.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\kvi_dns.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ext\kvi_doublebuffer.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ext\kvi_draganddrop.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="system\kvi_env.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_error.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="file\kvi_file.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="file\kvi_fileutils.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_garbage.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\core\kvi_heapobject.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\kvi_http.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_imagelib.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_inttypes.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="irc\kvi_ircmask.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="irc\kvi_ircserver.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="irc\kvi_ircserverdb.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="irc\kvi_ircuserdb.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Moc'ing kvi_ircuserdb.h..." - CommandLine="$(QTDIR)\bin\moc.exe irc\kvi_ircuserdb.h -o tmp\moc\moc_kvi_ircuserdb.cpp " - AdditionalDependencies="$(QTDIR)\bin\moc.exe;irc\kvi_ircuserdb.h" - Outputs="tmp\moc\moc_kvi_ircuserdb.cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Moc'ing kvi_ircuserdb.h..." - CommandLine="$(QTDIR)\bin\moc.exe irc\kvi_ircuserdb.h -o tmp\moc\moc_kvi_ircuserdb.cpp " - AdditionalDependencies="$(QTDIR)\bin\moc.exe;irc\kvi_ircuserdb.h" - Outputs="tmp\moc\moc_kvi_ircuserdb.cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="system\kvi_library.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_list.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="system\kvi_locale.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_malloc.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_md5.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_mediatype.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_memmove.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="irc\kvi_mirccntrl.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ext\kvi_miscutils.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_msgtype.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\kvi_netutils.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="irc\kvi_nickserv.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ext\kvi_osinfo.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\file\kvi_packagefile.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_parameterlist.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_pixmap.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\system\kvi_process.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_proxydb.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_qstring.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_regchan.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_regusersdb.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Moc'ing kvi_regusersdb.h..." - CommandLine="$(QTDIR)\bin\moc.exe ext\kvi_regusersdb.h -o tmp\moc\moc_kvi_regusersdb.cpp " - AdditionalDependencies="$(QTDIR)\bin\moc.exe;ext\kvi_regusersdb.h" - Outputs="tmp\moc\moc_kvi_regusersdb.cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Moc'ing kvi_regusersdb.h..." - CommandLine="$(QTDIR)\bin\moc.exe ext\kvi_regusersdb.h -o tmp\moc\moc_kvi_regusersdb.cpp " - AdditionalDependencies="$(QTDIR)\bin\moc.exe;ext\kvi_regusersdb.h" - Outputs="tmp\moc\moc_kvi_regusersdb.cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="config\kvi_settings.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_sharedfiles.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\kvi_socket.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\kvi_sockettype.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\kvi_ssl.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_strasm.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_string.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\kvi_stringarray.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_stringconversion.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_application.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_application_kde.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_application_qt.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_filedialog.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_filedialog_kde.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_filedialog_qt.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_grid.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_grid_qt3.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_grid_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_groupbox_qt3.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_groupbox_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_hbox.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_hbox_qt3.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_hbox_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_iconview.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_iconview_qt3.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_iconview_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_listbox.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_listbox_qt3.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_listbox_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_listview.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_listview_qt3.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_listview_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_mainwindow.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_mainwindow_kde.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_mainwindow_qt3.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_mainwindow_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_menubar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_menubar_kde.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_menubar_qt.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_popupmenu.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="" - Outputs="" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_popupmenu_qt3.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_popupmenu_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_scrollview.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_scrollview_qt3.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_scrollview_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_tabdialog.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_tabdialog_qt3.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_tabdialog_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_textedit.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_textedit_qt3.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_textedit_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_toolbar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_toolbar_kde.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_toolbar_qt3.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_toolbar_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="tal\kvi_tal_toolbardocktype.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_tooltip.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Moc'ing kvi_tal_tooltip.h..." - CommandLine="$(QTDIR)\bin\moc.exe .\tal\kvi_tal_tooltip.h -o tmp\moc\moc_kvi_tal_tooltip.cpp " - AdditionalDependencies="$(QTDIR)\bin\moc.exe;.\tal\kvi_tal_tooltip.h" - Outputs="tmp\moc\moc_kvi_tal_tooltip.cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Moc'ing kvi_tal_tooltip.h..." - CommandLine="$(QTDIR)\bin\moc.exe .\tal\kvi_tal_tooltip.h -o tmp\moc\moc_kvi_tal_tooltip.cpp " - AdditionalDependencies="$(QTDIR)\bin\moc.exe;.\tal\kvi_tal_tooltip.h" - Outputs="tmp\moc\moc_kvi_tal_tooltip.cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_vbox.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_vbox_qt3.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_vbox_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_widgetstack.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_widgetstack_qt3.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_widgetstack_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_windowstate.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_wizard.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)"" - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\kvi_tal_wizard_qt4.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="core\wstring\kvi_textencoding.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="system\kvi_thread.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="system\kvi_time.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\kvi_url.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\irc\kvi_useridentity.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="config\kvi_wincfg.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\kvi_xlib.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step For $(InputName)" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="Performing Custom Build Step $(InputName)" - /> - </FileConfiguration> - </File> - <File - RelativePath="..\..\data\resources\auto-generated\kvilib-resource.h" - > - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" - > - <File - RelativePath="..\..\data\resources\auto-generated\kvilib.rc" - > - </File> - </Filter> - <Filter - Name="Generated MOC Files" - Filter="moc;cpp" - UniqueIdentifier="{fe6e9830-be46-497d-995d-44b99b58e215}" - ParseFiles="false" - > - <File - RelativePath="ext\moc_kvi_crypt.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\moc_kvi_dns.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\moc_kvi_garbage.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath="net\moc_kvi_http.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tmp\moc\moc_kvi_ircuserdb.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath="system\moc_kvi_locale.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tmp\moc\moc_kvi_regusersdb.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath="ext\moc_kvi_sharedfiles.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tmp\moc\moc_kvi_tal_tooltip.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\tal\moc_kvi_tal_wizard.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - <File - RelativePath="system\moc_kvi_thread.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVILIB__" - /> - </FileConfiguration> - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3.4.0/src/kvilib/net/.svnignore b/3.4.0/src/kvilib/net/.svnignore deleted file mode 100644 index 1612c03b91..0000000000 --- a/3.4.0/src/kvilib/net/.svnignore +++ /dev/null @@ -1,20 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -*.o -*.lo -*.la -*.so -*.lai -kvirc -symlinks -moc_*.cpp - diff --git a/3.4.0/src/kvilib/net/Makefile.am b/3.4.0/src/kvilib/net/Makefile.am deleted file mode 100644 index c84487eb66..0000000000 --- a/3.4.0/src/kvilib/net/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -EXTRA_DIST = *.cpp *.h diff --git a/3.4.0/src/kvilib/net/kvi_dns.cpp b/3.4.0/src/kvilib/net/kvi_dns.cpp deleted file mode 100644 index d3bbfd3ae9..0000000000 --- a/3.4.0/src/kvilib/net/kvi_dns.cpp +++ /dev/null @@ -1,450 +0,0 @@ -//============================================================================= -// -// File : kvi_dns.cpp -// Creation date : Sat Jul 21 2000 17:19:31 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - -#include "kvi_dns.h" -#include "kvi_error.h" -#include "kvi_netutils.h" - -#include <errno.h> - -#ifdef COMPILE_ON_WINDOWS - #include <winsock2.h> - - #ifdef COMPILE_IPV6_SUPPORT - #ifdef WIN2K - #include <ws2ip6.h> - #else - #include <ws2tcpip.h> - //#include <tpipv6.h> - #endif - #endif -#else - #include <sys/types.h> - #include <sys/socket.h> - #include <netdb.h> -#endif - -// this is for FreeBSD -#ifndef EAI_ADDRFAMILY - #define EAI_ADDRFAMILY EAI_FAMILY -#endif - -#ifndef EAI_NODATA - #define EAI_NODATA 0 -#endif - - - -KviDnsResult::KviDnsResult() -{ - m_iError = KviError_success; - m_pHostnameList = new KviPointerList<QString>; - m_pHostnameList->setAutoDelete(true); - m_pIpAddressList = new KviPointerList<QString>; - m_pIpAddressList->setAutoDelete(true); - -} - -KviDnsResult::~KviDnsResult() -{ - delete m_pHostnameList; - delete m_pIpAddressList; -} - -void KviDnsResult::appendHostname(const QString &host) -{ - m_pHostnameList->append(new QString(host)); -} - - -void KviDnsResult::appendAddress(const QString &addr) -{ - m_pIpAddressList->append(new QString(addr)); -} - - - -KviDnsThread::KviDnsThread(KviDns * pDns) -{ - m_pParentDns = pDns; -} - -KviDnsThread::~KviDnsThread() -{ -} - -int KviDnsThread::translateDnsError(int iErr) -{ -#if defined(COMPILE_IPV6_SUPPORT) || !defined(COMPILE_ON_WINDOWS) - - switch(iErr) - { - case EAI_FAMILY: return KviError_unsupportedAddressFamily; break; -#if !defined(COMPILE_ON_WINDOWS) && defined(EAI_ADDRFAMILY) && (EAI_ADDRFAMILY != EAI_FAMILY) - case EAI_ADDRFAMILY: return KviError_unsupportedAddressFamily; break; -#endif -// NOT FreeBSD ARE WE? -#if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME) -// YARR - case EAI_NODATA: return KviError_validNameButNoIpAddress; break; -#endif - case EAI_FAIL: return KviError_unrecoverableNameserverError; break; - case EAI_AGAIN: return KviError_dnsTemporaneousFault; break; - // this should never happen - case EAI_BADFLAGS: return KviError_dnsInternalErrorBadFlags; break; - case EAI_MEMORY: return KviError_dnsInternalErrorOutOfMemory; break; - // got this when experimenting with protocols - case EAI_SERVICE: return KviError_dnsInternalErrorServiceNotSupported; break; -#ifndef COMPILE_ON_WINDOWS - case EAI_NONAME: return KviError_dnsNoName; break; -#endif - // got this when experimenting with protocols - case EAI_SOCKTYPE: return KviError_dnsInternalErrorUnsupportedSocketType; break; -#ifndef COMPILE_ON_WINDOWS - case EAI_SYSTEM: return -errno; -#endif - } - -#endif - return KviError_dnsQueryFailed; -} - -void KviDnsThread::postDnsError(KviDnsResult * dns,int iErr) -{ - dns->setError(iErr); - KviThreadDataEvent<KviDnsResult> * e = new KviThreadDataEvent<KviDnsResult>(KVI_DNS_THREAD_EVENT_DATA); - e->setData(dns); - postEvent(m_pParentDns,e); -} - -void KviDnsThread::run() -{ - KviDnsResult * dns = new KviDnsResult(); - - dns->setQuery(m_szQuery); - - if(m_szQuery.isEmpty()) - { - postDnsError(dns,KviError_noHostToResolve); - return; - } - -#ifndef COMPILE_IPV6_SUPPORT - if(m_queryType != KviDns::IpV4) - { - if(m_queryType == KviDns::IpV6) - { - postDnsError(dns,KviError_noIpV6Support); - return; - } - m_queryType = KviDns::IpV4; - } -#endif - -#if defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_IPV6_SUPPORT) - - if(m_queryType == KviDns::IpV6) - { - postDnsError(dns,KviError_noIpV6Support); - return; - } - - // gethostbyaddr and gethostbyname are thread-safe on Windoze - struct in_addr inAddr; - struct hostent *pHostEntry = 0; - - - // DIE DIE!....I hope that this stuff will disappear sooner or later :) - - if(KviNetUtils::stringIpToBinaryIp(m_szQuery,&inAddr)) - { - pHostEntry = gethostbyaddr((const char *)&inAddr,sizeof(inAddr),AF_INET); - } else { - pHostEntry = gethostbyname(m_szQuery); - } - - if(!pHostEntry) - { - switch(h_errno) - { - case HOST_NOT_FOUND: dns->setError(KviError_hostNotFound); break; - case NO_ADDRESS: dns->setError(KviError_validNameButNoIpAddress); break; - case NO_RECOVERY: dns->setError(KviError_unrecoverableNameserverError); break; - case TRY_AGAIN: dns->setError(KviError_dnsTemporaneousFault); break; - default: dns->setError(KviError_dnsQueryFailed); break; - } - } else { - dns->appendHostname(pHostEntry->h_name); - QString szIp; - KviNetUtils::binaryIpToStringIp(* ((struct in_addr*)(pHostEntry->h_addr)),szIp); - dns->appendAddress(szIp); - - int idx = 1; - while(pHostEntry->h_addr_list[idx]) - { - QString tmp; - KviNetUtils::binaryIpToStringIp(* ((struct in_addr*)(pHostEntry->h_addr_list[idx])),tmp); - if(tmp.hasData())dns->appendAddress(tmp); - ++idx; - } - if(pHostEntry->h_aliases[0]) - { - dns->appendHostname(QString::fromUtf8(pHostEntry->h_aliases[0])); - if(pHostEntry->h_aliases[1])dns->appendHostname(QString::fromUtf8(pHostEntry->h_aliases[1])); - } - } - - -#else //!COMPILE_ON_WINDOWS || COMPILE_IPV6_SUPPORT - - int retVal; - - -//#ifdef HAVE_GETNAMEINFO - struct sockaddr_in ipv4Addr; - -#ifdef COMPILE_IPV6_SUPPORT - struct sockaddr_in6 ipv6Addr; - bool bIsIpV6Ip = false; -#endif - - bool bIsIpV4Ip = KviNetUtils::stringIpToBinaryIp(m_szQuery,(struct in_addr *)&(ipv4Addr.sin_addr)); - -#ifdef COMPILE_IPV6_SUPPORT - if(!bIsIpV4Ip)bIsIpV6Ip = KviNetUtils::stringIpToBinaryIp_V6(m_szQuery,(struct in6_addr *)&(ipv6Addr.sin6_addr)); -#endif - -//#ifdef HAVE_GETNAMEINFO - -#ifdef COMPILE_IPV6_SUPPORT - if(bIsIpV4Ip || bIsIpV6Ip) - { -#else - if(bIsIpV4Ip) - { -#endif - // use getnameinfo... - char retname[1025]; // should be enough.... - -#ifdef COMPILE_IPV6_SUPPORT - if(bIsIpV4Ip) - { -#endif - ipv4Addr.sin_family = AF_INET; - ipv4Addr.sin_port = 0; - // NI_NAMEREQD as last param ? - retVal = getnameinfo((struct sockaddr *)&ipv4Addr,sizeof(ipv4Addr),retname,1025,0,0,NI_NAMEREQD); -#ifdef COMPILE_IPV6_SUPPORT - } else { - ipv6Addr.sin6_family = AF_INET6; - ipv6Addr.sin6_port = 0; - retVal = getnameinfo((struct sockaddr *)&ipv6Addr,sizeof(ipv6Addr),retname,1025,0,0,NI_NAMEREQD); - } -#endif - - if(retVal != 0)dns->setError(translateDnsError(retVal)); - else { - dns->appendHostname(retname); - dns->appendAddress(m_szQuery); - } - - } else { -//#endif //HAVE_GETNAMEINFO - - -//#ifdef COMPILE_IPV6_SUPPORT -// struct in6_addr in6Addr; -//#endif - struct addrinfo * pRet = 0; - struct addrinfo * pNext; - struct addrinfo hints; - hints.ai_flags = 0; //AI_CANONNAME; <-- for IPV6 it makes cannoname to point to the IP address! -#ifdef COMPILE_IPV6_SUPPORT - hints.ai_family = (m_queryType == KviDns::IpV6) ? PF_INET6 : ((m_queryType == KviDns::IpV4) ? PF_INET : PF_UNSPEC); -#else - hints.ai_family = PF_INET; -#endif - hints.ai_socktype = SOCK_STREAM; - hints.ai_protocol = 0; - hints.ai_addrlen = 0; - hints.ai_canonname = 0; - hints.ai_addr = 0; - hints.ai_next = 0; - - retVal = getaddrinfo(KviQString::toUtf8(m_szQuery).data(),0,&hints,&pRet); - - if(retVal != 0)dns->setError(translateDnsError(retVal)); - else { - dns->appendHostname(pRet->ai_canonname ? QString::fromUtf8(pRet->ai_canonname) : m_szQuery); - QString szIp; -#ifdef COMPILE_IPV6_SUPPORT - if(pRet->ai_family == PF_INET6)KviNetUtils::binaryIpToStringIp_V6(((sockaddr_in6 *)(pRet->ai_addr))->sin6_addr,szIp); - else { -#endif - KviNetUtils::binaryIpToStringIp(((sockaddr_in *)(pRet->ai_addr))->sin_addr,szIp); -#ifdef COMPILE_IPV6_SUPPORT - } -#endif - dns->appendAddress(szIp); - - pNext = pRet->ai_next; - while(pNext) - { - QString tmp; -#ifdef COMPILE_IPV6_SUPPORT - if(pNext->ai_family == PF_INET6)KviNetUtils::binaryIpToStringIp_V6(((sockaddr_in6 *)(pNext->ai_addr))->sin6_addr,tmp); - else { -#endif - KviNetUtils::binaryIpToStringIp(((sockaddr_in *)(pNext->ai_addr))->sin_addr,tmp); -#ifdef COMPILE_IPV6_SUPPORT - } -#endif - if(!tmp.isEmpty())dns->appendAddress(tmp); - - if(pNext->ai_canonname) - { - // FIXME: only of not equal to other names ? - dns->appendHostname(QString::fromUtf8(pNext->ai_canonname)); - } - - pNext = pNext->ai_next; - - } - } - if(pRet)freeaddrinfo(pRet); -//#ifdef HAVE_GETNAMEINFO - } -//#endif //HAVE_GETNAMEINFO - -#endif // !COMPILE_ON_WINDOWS - - - KviThreadDataEvent<KviDnsResult> * e = new KviThreadDataEvent<KviDnsResult>(KVI_DNS_THREAD_EVENT_DATA); - e->setData(dns); - postEvent(m_pParentDns,e); -} - - - - -KviDns::KviDns() -: QObject() -{ - m_pSlaveThread = new KviDnsThread(this); - m_pDnsResult = new KviDnsResult(); - m_pAuxData = 0; - m_state = Idle; -} - -KviDns::~KviDns() -{ - if(m_pSlaveThread)delete m_pSlaveThread; // will eventually terminate it (but it will also block us!!!) - KviThreadManager::killPendingEvents(this); - if(m_pDnsResult)delete m_pDnsResult; - if(m_pAuxData)debug("You're leaking memory man! m_pAuxData is non 0!"); -} - - -bool KviDns::isRunning() const -{ - return (m_state == Busy); -}; - -bool KviDns::lookup(const QString &query,QueryType type) -{ - if(m_state == Busy)return false; - m_pSlaveThread->setQuery(KviQString::trimmed(query),type); - bool bStarted = m_pSlaveThread->start(); - m_state = bStarted ? Busy : Failure; - return bStarted; -} - -int KviDns::error() -{ - if(!m_pDnsResult)return KviError_dnsQueryFailed; - return m_pDnsResult->error(); -} - -KviDnsResult * KviDns::result() -{ - if(!m_pDnsResult)m_pDnsResult = new KviDnsResult(); - return m_pDnsResult; -} - -KviPointerList<QString> * KviDns::hostnameList() -{ - return result()->hostnameList(); -} - -KviPointerList<QString> * KviDns::ipAddressList() -{ - return result()->ipAddressList(); -} - -int KviDns::hostnameCount() -{ - return result()->hostnameList()->count(); -} - -int KviDns::ipAddressCount() -{ - return result()->ipAddressList()->count(); -} - -const QString & KviDns::firstHostname() -{ - QString * pStr = result()->hostnameList()->first(); - if(pStr)return *pStr; - return KviQString::empty; -} - -const QString & KviDns::firstIpAddress() -{ - QString * pStr = result()->ipAddressList()->first(); - if(pStr)return *pStr; - return KviQString::empty; -} - -const QString & KviDns::query() -{ - return result()->query(); -} - -bool KviDns::event(QEvent *e) -{ - if(e->type() == KVI_THREAD_EVENT) - { - if(((KviThreadEvent *)e)->id() == KVI_DNS_THREAD_EVENT_DATA) - { - if(m_pDnsResult)delete m_pDnsResult; - m_pDnsResult = ((KviThreadDataEvent<KviDnsResult> *)e)->getData(); - m_state = (m_pDnsResult->error() == KviError_success) ? Success : Failure; - emit lookupDone(this); - return true; - } // else ops... unknown thread event ? - } - return QObject::event(e); -} - diff --git a/3.4.0/src/kvilib/net/kvi_dns.h b/3.4.0/src/kvilib/net/kvi_dns.h deleted file mode 100644 index 0fa1ed9e94..0000000000 --- a/3.4.0/src/kvilib/net/kvi_dns.h +++ /dev/null @@ -1,142 +0,0 @@ -#ifndef _KVI_DNS_H_ -#define _KVI_DNS_H_ - -//============================================================================= -// -// File : kvi_dns.h -// Creation date : Sat Jul 21 2000 13:59:11 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_heapobject.h" -#include "kvi_thread.h" -#include "kvi_qstring.h" - - -class KviDnsThread; // not part of the API - - -class KVILIB_API KviDnsResult : public KviHeapObject -{ - friend class KviDns; - friend class KviDnsThread; -protected: - KviDnsResult(); -public: - ~KviDnsResult(); -protected: - int m_iError; - KviPointerList<QString> * m_pHostnameList; - KviPointerList<QString> * m_pIpAddressList; - QString m_szQuery; -public: - int error(){ return m_iError; }; - // never store nor delete these pointers! - // (these are NEVER 0) - KviPointerList<QString> * hostnameList(){ return m_pHostnameList; }; - KviPointerList<QString> * ipAddressList(){ return m_pIpAddressList; }; - const QString &query(){ return m_szQuery; }; -protected: - void setError(int iError){ m_iError = iError; }; - void setQuery(const QString &query){ m_szQuery = query; }; - void appendHostname(const QString &host); - void appendAddress(const QString &addr); -}; - - - -class KVILIB_API KviDns : public QObject, public KviHeapObject -{ - Q_OBJECT - Q_PROPERTY(bool blockingDelete READ isRunning) -public: - KviDns(); - ~KviDns(); -public: - enum QueryType { IpV4 , IpV6 , Any }; - enum State { Idle , Busy , Failure , Success }; -protected: - void * m_pAuxData; - KviDnsThread * m_pSlaveThread; - KviDnsResult * m_pDnsResult; - State m_state; -public: - ///////////////////////////////////////////////////////////////////////////////////////////////////// - // - // Public interface - // - - // Lookup start - bool lookup(const QString &szQuery,QueryType type); - - // Current object state - State state(){ return m_state; }; - - // Results (return always non null-data..but valid results only if state() == Success or Failure) - int error(); - const QString & firstHostname(); - const QString & firstIpAddress(); - int hostnameCount(); - int ipAddressCount(); - KviPointerList<QString> * hostnameList(); - KviPointerList<QString> * ipAddressList(); - const QString & query(); - bool isRunning() const; - - // Auxiliary data store - void setAuxData(void * pAuxData){ m_pAuxData = pAuxData; }; - void * releaseAuxData(){ void * pData = m_pAuxData; m_pAuxData = 0; return pData; }; -protected: - virtual bool event(QEvent *e); -private: - KviDnsResult * result(); -signals: - void lookupDone(KviDns *); -}; - - - -/////////////////////////////////////////////////////////////////////////////////////////////////////////// -// INTERNAL CLASSES -// - -#define KVI_DNS_THREAD_EVENT_DATA (KVI_THREAD_USER_EVENT_BASE + 7432) - -class KviDnsThread : public KviThread -{ - friend class KviDns; -protected: - KviDnsThread(KviDns * pDns); - ~KviDnsThread(); -protected: - QString m_szQuery; - KviDns::QueryType m_queryType; - KviDns * m_pParentDns; -public: - void setQuery(const QString &query,KviDns::QueryType type){ m_szQuery = query; m_queryType = type; }; -protected: - virtual void run(); - int translateDnsError(int iErr); - void postDnsError(KviDnsResult * dns,int iErr); -}; - - -#endif //_KVI_DNS_H_ diff --git a/3.4.0/src/kvilib/net/kvi_http.cpp b/3.4.0/src/kvilib/net/kvi_http.cpp deleted file mode 100644 index 91b02bd84c..0000000000 --- a/3.4.0/src/kvilib/net/kvi_http.cpp +++ /dev/null @@ -1,1440 +0,0 @@ -//============================================================================= -// -// File : kvi_http.cpp -// Creation date : Sat Aug 17 13:43:32 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002-2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include <qdir.h> -#include <qtimer.h> -//#include <zlib.h> - -#include "kvi_http.h" -#include "kvi_locale.h" -#include "kvi_netutils.h" -#include "kvi_dns.h" -#include "kvi_error.h" -#include "kvi_debug.h" -#include "kvi_socket.h" -#include "kvi_time.h" -#ifdef COMPILE_SSL_SUPPORT - #include "kvi_ssl.h" -#endif - - -#define KVI_HTTP_REQUEST_THREAD_EVENT_CONNECTED (KVI_THREAD_USER_EVENT_BASE + 0xCAFE) -#define KVI_HTTP_REQUEST_THREAD_EVENT_REQUESTSENT (KVI_THREAD_USER_EVENT_BASE + 0xCAFF) - -KviHttpRequest::KviHttpRequest() -: QObject() -{ - m_pDns = 0; - m_pThread = 0; - m_pFile = 0; - m_pPrivateData = 0; - m_bHeaderProcessed = false; - m_pBuffer = new KviDataBuffer(); - - resetStatus(); - resetData(); -} - -KviHttpRequest::~KviHttpRequest() -{ - resetInternalStatus(); - delete m_pBuffer; -} - -void KviHttpRequest::abort() -{ - resetInternalStatus(); - m_szLastError = __tr2qs("Aborted"); - emit terminated(false); -} - -void KviHttpRequest::resetInternalStatus() -{ - if(m_pThread)delete m_pThread; - if(m_pDns)delete m_pDns; - - m_pDns = 0; - m_pThread = 0; - - if(!m_pFile)return; - m_pFile->close(); - delete m_pFile; - m_pFile = 0; - - m_pBuffer->clear(); - m_bHeaderProcessed = false; - - KviThreadManager::killPendingEvents(this); -} - -void KviHttpRequest::resetStatus() -{ - m_szLastError = __tr2qs("No request"); - m_uTotalSize = 0; - m_uReceivedSize = 0; -} - -void KviHttpRequest::resetData() -{ - m_szFileName = ""; - m_eProcessingType = WholeFile; - m_eExistingFileAction = RenameIncoming; - m_url = ""; - m_uMaxContentLength = 0; - m_uContentOffset = 0; - m_bChunkedTransferEncoding = false; - m_bGzip = false; - m_bIgnoreRemainingData = false; - m_uRemainingChunkSize = 0; -} - -void KviHttpRequest::reset() -{ - resetStatus(); - resetData(); - resetInternalStatus(); -} - -bool KviHttpRequest::get(const KviUrl &u,ProcessingType p,const QString &szFileName) -{ - reset(); - setUrl(u); - setProcessingType(p); - setFileName(szFileName); - return start(); -} - -bool KviHttpRequest::start() -{ - // ensure that the file is closed - resetInternalStatus(); - resetStatus(); - - if(m_eProcessingType == StoreToFile) - { - if(m_szFileName.isEmpty()) - { - m_szLastError = __tr2qs("No filename specified for the \"StoreToFile\" processing type"); - return false; - } - - if((m_eExistingFileAction == Resume) && (m_uContentOffset == 0)) - { - // determine the content offset automatically - if(KviFile::exists(m_szFileName)) - { - // we check it - QFileInfo fi(m_szFileName); - m_uContentOffset = fi.size(); - } - } - } - - if(m_url.host().isEmpty()) - { - resetInternalStatus(); - m_szLastError = __tr2qs("Invalid URL: Missing hostname"); - return false; - } - - if((!kvi_strEqualCI(m_url.protocol().ptr(),"http")) && (!kvi_strEqualCI(m_url.protocol().ptr(),"https"))) - { - resetInternalStatus(); - m_szLastError=__tr2qs("Unsupported protocol %1").arg(m_url.protocol().ptr()); - return false; - } - - if(kvi_isValidStringIp(m_url.host().ptr())) - { - m_szIp = m_url.host(); - QTimer::singleShot(10,this,SLOT(haveServerIp())); - return true; - } - - return startDnsLookup(); -} - -bool KviHttpRequest::startDnsLookup() -{ - m_pDns = new KviDns(); - connect(m_pDns,SIGNAL(lookupDone(KviDns *)),this,SLOT(dnsLookupDone(KviDns *))); - - if(!m_pDns->lookup(m_url.host().ptr(),KviDns::IpV4)) - { - resetInternalStatus(); - m_szLastError = __tr2qs("Unable to start the DNS lookup"); - return false; - } - - QString tmp; - KviQString::sprintf(tmp,__tr2qs("Looking up host %s"),m_url.host().ptr()); - emit status(tmp); // FIXME - - emit resolvingHost(QString(m_url.host().ptr())); - - return true; -} - -void KviHttpRequest::dnsLookupDone(KviDns *d) -{ - if(d->state() == KviDns::Success) - { - m_szIp = d->firstIpAddress(); - delete m_pDns; - m_pDns = 0; - QString tmp; - KviQString::sprintf(tmp,__tr2qs("Host %s resolved to %Q"),m_url.host().ptr(),&m_szIp); - emit status(tmp); - haveServerIp(); - } else { - int iErr = d->error(); - resetInternalStatus(); - m_szLastError = KviError::getDescription(iErr); - emit terminated(false); - } -} - -void KviHttpRequest::haveServerIp() -{ - unsigned short uPort = m_url.port(); - if(uPort == 0)uPort = 80; - - QString tmp; - KviQString::sprintf(tmp,"%Q:%u",&m_szIp,uPort); - emit contactingHost(tmp); - - if(m_pThread)delete m_pThread; - - m_pThread = new KviHttpRequestThread( - this, - m_url.host().ptr(), - m_szIp, - uPort, - m_url.path().ptr(), - m_uContentOffset, - (m_eProcessingType == HeadersOnly) ? KviHttpRequestThread::Head : (m_szPostData.isEmpty() ? KviHttpRequestThread::Get : KviHttpRequestThread::Post), - m_szPostData, - kvi_strEqualCI(m_url.protocol().ptr(),"https")); - - if(!m_pThread->start()) - { - resetInternalStatus(); - m_szLastError = __tr2qs("Unable to start the request slave thread"); - emit terminated(false); - return; - } - - KviQString::sprintf(tmp,__tr2qs("Contacting host %Q on port %u"),&m_szIp,uPort); - emit status(tmp); -} - -bool KviHttpRequest::event(QEvent *e) -{ - if(e->type() == KVI_THREAD_EVENT) - { - switch(((KviThreadEvent *)e)->id()) - { - case KVI_THREAD_EVENT_BINARYDATA: - { - KviDataBuffer * b = ((KviThreadDataEvent<KviDataBuffer> *)e)->getData(); - processData(b); - delete b; - return true; - } - break; - case KVI_HTTP_REQUEST_THREAD_EVENT_CONNECTED: - emit connectionEstabilished(); - emit status(__tr2qs("Connection established, sending request")); - return true; - break; - case KVI_HTTP_REQUEST_THREAD_EVENT_REQUESTSENT: - { - QString * req = ((KviThreadDataEvent<QString> *)e)->getData(); -#ifdef COMPILE_USE_QT4 - QStringList sl = req->split("\r\n"); -#else - QStringList sl = QStringList::split("\r\n",*req); -#endif - emit requestSent(sl); - delete req; - return true; - } - break; - case KVI_THREAD_EVENT_SUCCESS: - if(!m_pThread && !m_bHeaderProcessed) - { - // the thread has already been deleted - // probably because the response was something like a 404 - // just ignore the event - return true; - } - switch(m_eProcessingType) - { - case WholeFile: - // happens always - emit binaryData(*m_pBuffer); - break; - case Blocks: - // an unprocessed block ?.. should never happend.. but well :D - if(m_pBuffer->size() > 0)emit binaryData(*m_pBuffer); - break; - case Lines: - if(m_pBuffer->size() > 0) - { - // something left in the buffer and has no trailing LF - KviStr tmp((const char *)(m_pBuffer->data()),m_pBuffer->size()); - emit data(tmp); - } - break; - case StoreToFile: - // same as above... should never happen.. but well :D - if(m_pFile && m_pBuffer->size() > 0)m_pFile->writeBlock((const char *)(m_pBuffer->data()),m_pBuffer->size()); - break; - default: - // nothing... just make gcc happy - break; - } - resetInternalStatus(); - m_szLastError = __tr2qs("Success"); - emit terminated(true); - return true; - break; - case KVI_THREAD_EVENT_ERROR: - { - KviStr * err = ((KviThreadDataEvent<KviStr> *)e)->getData(); - m_szLastError = __tr2qs_no_xgettext(err->ptr()); - delete err; - resetInternalStatus(); - emit terminated(false); - return true; - } - break; - case KVI_THREAD_EVENT_MESSAGE: - { - KviStr * msg = ((KviThreadDataEvent<KviStr> *)e)->getData(); - emit status(__tr2qs_no_xgettext(msg->ptr())); - delete msg; - return true; - } - break; - } - } - return QObject::event(e); -} - -void KviHttpRequest::emitLines(KviDataBuffer * pDataBuffer) -{ - int idx = pDataBuffer->find((const unsigned char *)"\n",1); - while(idx != -1) - { - KviStr tmp((const char *)(m_pBuffer->data()),idx); - tmp.stripRight('\r'); - pDataBuffer->remove(idx + 1); - idx = pDataBuffer->find((const unsigned char *)"\n",1); - emit data(tmp); - } -} - -// header += "Accept: "; -// QString acceptHeader = metaData("accept"); -// if (!acceptHeader.isEmpty()) -// header += acceptHeader; -// else -// header += DEFAULT_ACCEPT_HEADER; -// header += "\r\n"; -// -//#ifdef DO_GZIP -// if (m_request.allowCompressedPage) -// header += "Accept-Encoding: x-gzip, x-deflate, gzip, deflate, identity\r\n"; -//#endif -// -// if (!m_request.charsets.isEmpty()) -// header += "Accept-Charset: " + m_request.charsets + "\r\n"; -// -// if (!m_request.languages.isEmpty()) -// header += "Accept-Language: " + m_request.languages + "\r\n"; -// -// -// /* support for virtual hosts and required by HTTP 1.1 */ -// header += "Host: "; -// header += "Pragma: no-cache\r\n"; /* for HTTP/1.0 caches */ -// header += "Cache-control: no-cache\r\n"; /* for HTTP >=1.1 caches */ - -// header += "Referer: "; //Don't try to correct spelling! -// header += m_request.referrer; -// header += "\r\n"; -bool KviHttpRequest::openFile() -{ - if(m_eProcessingType != StoreToFile)return true; - - bool bAppend = false; - - // take action when the file is existing - if(KviFile::exists(m_szFileName)) - { - switch(m_eExistingFileAction) - { - case Resume: - { - bAppend = true; - } - break; - case RenameIncoming: - { - int i=0; - QString tmp = m_szFileName; - do { - i++; - m_szFileName = tmp + QString(".kvirnm-%1").arg(i); - } while(KviFile::exists(m_szFileName)); - } - break; - case RenameExisting: - { - int i=0; - QString tmp; - do { - i++; - tmp = m_szFileName + QString(".kvirnm-%1").arg(i); - } while(KviFile::exists(tmp)); - QDir d; - if(!d.rename(m_szFileName,tmp)) - { - // fail :( - resetInternalStatus(); - m_szLastError = __tr2qs("Failed to rename the existing file, please rename manually and retry"); - emit terminated(false); - return false; - } - } - break; - case Overwrite: - default: - // nothing - break; - } - } - - m_pFile = new KviFile(m_szFileName); - - if(!m_pFile->openForWriting(bAppend)) - { - resetInternalStatus(); - KviQString::sprintf(m_szLastError,__tr2qs("Can't open file \"%Q\" for writing"),&m_szFileName); - emit terminated(false); - return false; - } - - return true; -} - - - - - -bool KviHttpRequest::processHeader(KviStr &szHeader) -{ - int idx = szHeader.findFirstIdx("\r\n"); - KviStr szResponse; - if(idx != -1) - { - szResponse = szHeader.left(idx); - szHeader.cutLeft(idx + 2); - } else { - szResponse = szHeader; - szHeader = ""; - } - - szResponse.stripWhiteSpace(); - - bool bValid = false; - - unsigned int uStatus = 0; - - // check the response value - if(kvi_strEqualCSN(szResponse.ptr(),"HTTP",4)) - { - KviStr szR = szResponse; - szR.cutToFirst(' '); - szR.stripWhiteSpace(); - int idx = szR.findFirstIdx(' '); - KviStr szNumber; - if(idx != -1)szNumber = szR.left(idx); - else szNumber = szR; - bool bOk; - uStatus = szNumber.toUInt(&bOk); - if(bOk)bValid = true; - } - - if(!bValid) - { - // the response is invalid ? - resetInternalStatus(); - m_szLastError=__tr2qs("Invalid HTTP response: %s").arg(szResponse.ptr()); - emit terminated(false); - return false; - } - - QString tmp; - KviQString::sprintf(tmp,__tr2qs("Received HTTP response: %s"),szResponse.ptr()); - - emit status(tmp); - emit receivedResponse(QString(szResponse.ptr())); - - KviPointerList<KviStr> hlist; - hlist.setAutoDelete(true); - - idx = szHeader.findFirstIdx("\r\n"); - while(idx != -1) - { - if(idx > 0) - { - hlist.append(new KviStr(szHeader.ptr(),idx)); - szHeader.cutLeft(idx + 2); - } - idx = szHeader.findFirstIdx("\r\n"); - } - if(szHeader.hasData())hlist.append(new KviStr(szHeader)); - - KviPointerHashTable<const char *,KviStr> hdr(11,false,true); - hdr.setAutoDelete(true); - - for(KviStr * s = hlist.first();s;s = hlist.next()) - { - idx = s->findFirstIdx(":"); - if(idx != -1) - { - KviStr szName = s->left(idx); - s->cutLeft(idx + 1); - s->stripWhiteSpace(); - hdr.replace(szName.ptr(),new KviStr(*s)); - //debug("FOUND HEADER (%s)=(%s)",szName.ptr(),s->ptr()); - } - } - - KviStr * size = hdr.find("Content-length"); - if(size) - { - bool bOk; - m_uTotalSize = size->toUInt(&bOk); - if(!bOk)m_uTotalSize = 0; - } - - KviStr * contentEncoding = hdr.find("Content-encoding"); - if(contentEncoding) - { - m_bGzip = contentEncoding->equalsCI("gzip"); - } - - KviStr * transferEncoding = hdr.find("Transfer-Encoding"); - if(transferEncoding) - { - if(kvi_strEqualCI(transferEncoding->ptr(),"chunked")) - { - // be prepared to handle the chunked transfer encoding as required by HTTP/1.1 - m_bChunkedTransferEncoding = true; - m_uRemainingChunkSize = 0; - } - } - - emit header(&hdr); - - // check the status - - // case 200: // OK - // case 206: // Partial content - - // case 100: // Continue ?? - // case 101: // Switching protocols ??? - // case 201: // Created - // case 202: // Accepted - // case 203: // Non-Authoritative Information - // case 204: // No content - // case 205: // Reset content - // case 300: // Multiple choices - // case 301: // Moved permanently - // case 302: // Found - // case 303: // See Other - // case 304: // Not modified - // case 305: // Use Proxy - // case 306: // ??? - // case 307: // Temporary Redirect - // case 400: // Bad request - // case 401: // Unauthorized - // case 402: // Payment Required - // case 403: // Forbidden - // case 404: // Not found - // case 405: // Method not allowed - // case 406: // Not acceptable - // case 407: // Proxy authentication required - // case 408: // Request timeout - // case 409: // Conflict - // case 410: // Gone - // case 411: // Length required - // case 412: // Precondition failed - // case 413: // Request entity too large - // case 414: // Request-URI Too Long - // case 415: // Unsupported media type - // case 416: // Requested range not satisfiable - // case 417: // Expectation Failed - // case 500: // Internal server error - // case 501: // Not implemented - // case 502: // Bad gateway - // case 503: // Service unavailable - // case 504: // Gateway timeout - // case 505: // HTTP Version not supported - - if((uStatus != 200) && (uStatus != 206)) - { - // this is not "OK" and not "Partial content" - // Error , redirect or something confusing - if(m_eProcessingType != HeadersOnly) - { - // this is an error then - resetInternalStatus(); - m_szLastError = szResponse.ptr(); - emit terminated(false); - return false; - } // else the server will terminate (it was a HEAD request) - } - - if((m_uMaxContentLength > 0) && (m_uTotalSize > ((unsigned int)m_uMaxContentLength))) - { - resetInternalStatus(); - m_szLastError=__tr2qs("Stream exceeding maximum length"); - emit terminated(false); - return false; - } - - // fixme: could check for data type etc... - - return true; -} -#define BUFFER_SIZE 32768 - -void KviHttpRequest::processData(KviDataBuffer * data) -{ -// unsigned char obuffer[BUFFER_SIZE]; - if(m_bChunkedTransferEncoding && m_bIgnoreRemainingData) - { - // In chunked transfer encoding mode there may be additional headers - // after the last chunk of data. We simply ignore them. - return; - } - - if(!m_bHeaderProcessed) - { - // time to process the header - m_pBuffer->append(*data); - - int idx = m_pBuffer->find((const unsigned char *)"\r\n\r\n",4); - if(idx == -1) - { - // header not complete - if(m_pBuffer->size() > 4096) - { - resetInternalStatus(); - m_szLastError = __tr2qs("Header too long: exceeded 4096 bytes"); - emit terminated(false); - } - return; - } - KviStr szHeader((const char *)(m_pBuffer->data()),idx); - m_pBuffer->remove(idx + 4); - - if(!processHeader(szHeader))return; - m_bHeaderProcessed = true; - - if(m_eProcessingType == StoreToFile) - { - if(!openFile())return; - } - - m_uReceivedSize = m_pBuffer->size(); - - - // here the header is complete and the eventual remaining data is in m_pBuffer. data has been already used. - - } else { - // header already processed - m_uReceivedSize += data->size(); - - // here the header is complete and some data *might* be already in m_pBuffer. data is unused yet. - - // Optimisation: If the transfer is NOT chunked (so we don't have to parse it) - // and the requested processing type is either Blocks or StoreToFile - // then we just can avoid to copy the data to m_pBuffer. - // This is a good optimisation since for large files we can save allocating - // space for and moving megabytes of data... - - - if((!m_bChunkedTransferEncoding) && ((m_eProcessingType == Blocks) || (m_eProcessingType == StoreToFile))) - { - switch(m_eProcessingType) - { - case Blocks: - emit binaryData(*data); - break; - case StoreToFile: - m_pFile->writeBlock((const char *)(data->data()),data->size()); - break; - } - - if(((m_uTotalSize > 0) && (m_uReceivedSize > m_uTotalSize)) || ((m_uMaxContentLength > 0) && (m_uReceivedSize > m_uMaxContentLength))) - { - resetInternalStatus(); - m_szLastError=__tr2qs("Stream exceeded expected length"); - emit terminated(false); - } - - return; - } - - // need to append to m_pBuffer and process it - m_pBuffer->append(*data); - } - - // we're processing data in m_pBuffer here - if(m_bChunkedTransferEncoding) - { - // The transfer encoding is chunked: the buffer contains - // chunks of data with an initial header composed - // of a hexadecimal length, an optional bullshit and a single CRLF - // The transfer terminates when we read a last chunk of size 0 - // that may be followed by optional headers... - // This sux :) - while(m_pBuffer->size() > 0) // <-- note that we may exit from this loop also for other conditions (there is a goto below) - { - // we process chunks of parts of chunks at a time. - if(m_uRemainingChunkSize > 0) - { - // process the current chunk data - unsigned int uProcessSize = m_uRemainingChunkSize; - if(uProcessSize > m_pBuffer->size())uProcessSize = m_pBuffer->size(); - m_uRemainingChunkSize -= uProcessSize; - - switch(m_eProcessingType) - { - case Blocks: - if(m_pBuffer->size() == uProcessSize) - { - // avoid copying to a new buffer - emit binaryData(*m_pBuffer); - } else { - // must copy - KviDataBuffer tmp(uProcessSize,m_pBuffer->data()); - emit binaryData(tmp); - m_pBuffer->remove(uProcessSize); - } - break; - case Lines: - if(m_pBuffer->size() == uProcessSize) - { - // avoid copying to a new buffer - emitLines(m_pBuffer); - } else { - // must copy - KviDataBuffer tmp(uProcessSize,m_pBuffer->data()); - emitLines(&tmp); - m_pBuffer->remove(uProcessSize); - } - break; - case StoreToFile: - m_pFile->writeBlock((const char *)(m_pBuffer->data()),uProcessSize); - m_pBuffer->remove(uProcessSize); - break; - default: - // nothing.. just make gcc happy - break; - } - // now either the buffer is empty or there is another chunk header: continue looping - } else { - // We're looking for the beginning of a chunk now. - // Note that we might be at the end of a previous chunk that has a CRLF terminator - // we need to skip it. - int crlf = m_pBuffer->find((const unsigned char *)"\r\n",2); - if(crlf != -1) - { - if(crlf == 0) - { - // This is a plain CRLF at the beginning of the buffer BEFORE a chunk header. - // It comes from the previous chunk terminator. Skip it. - m_pBuffer->remove(2); - } else { - // got a chunk header - KviStr szHeader((const char *)(m_pBuffer->data()),crlf); - szHeader.cutFromFirst(' '); - // now szHeader should contain a hexadecimal chunk length... (why the hell it is hex and not decimal ????) - QString szHexHeader = szHeader.ptr(); - bool bOk; - m_uRemainingChunkSize = szHexHeader.toLong(&bOk,16); - if(!bOk) - { - resetInternalStatus(); - m_szLastError = __tr2qs("Protocol error: invalid chunk size"); - emit terminated(false); - return; - } - m_pBuffer->remove(crlf+2); - if(m_uRemainingChunkSize == 0) - { - // this is the last chunk of data. It may be followed by optional headers - // but we actually don't need them (since we're surely not in HEAD mode) - m_bIgnoreRemainingData = true; - m_pBuffer->clear(); - goto check_stream_length; - } - } - // the rest is valid data of a non-zero chunk: continue looping - } else { - // chunk header not complete - if(m_pBuffer->size() > 4096) - { - resetInternalStatus(); - m_szLastError = __tr2qs("Chunk header too long: exceeded 4096 bytes"); - emit terminated(false); - return; - } - goto check_stream_length; - } - } - } - } else { - // the transfer encoding is not chunked: m_pBuffer contains only valid data - switch(m_eProcessingType) - { - case Blocks: - if(m_pBuffer->size() > 0)emit binaryData(*m_pBuffer); - m_pBuffer->clear(); - break; - case Lines: - if(m_pBuffer->size() > 0)emitLines(m_pBuffer); - break; - case StoreToFile: - m_pFile->writeBlock((const char *)(m_pBuffer->data()),m_pBuffer->size()); - m_pBuffer->clear(); - break; - default: - // nothing.. just make gcc happy - break; - } - } - -check_stream_length: - - if(((m_uTotalSize > 0) && (m_uReceivedSize > m_uTotalSize)) || ((m_uMaxContentLength > 0) && (m_uReceivedSize > m_uMaxContentLength))) - { - resetInternalStatus(); - m_szLastError=__tr2qs("Stream exceeded expected length"); - emit terminated(false); - } - return; -} - - - - - - - - - - - - - - - - -KviHttpRequestThread::KviHttpRequestThread( - KviHttpRequest * r, - const QString &szHost, - const QString &szIp, - unsigned short uPort, - const QString & szPath, - unsigned int uContentOffset, - RequestMethod m, - const QString &szPostData, - bool bUseSSL -) : KviSensitiveThread() -{ - m_pRequest = r; - m_szHost = szHost; - m_szIp = szIp; - m_szPath = szPath; - m_uPort = uPort > 0 ? uPort : 80; - m_uContentOffset = uContentOffset; - m_eRequestMethod = m; - m_szPostData = szPostData; - m_sock = KVI_INVALID_SOCKET; - m_bUseSSL = bUseSSL; -#ifdef COMPILE_SSL_SUPPORT - m_pSSL = 0; -#endif -} - -KviHttpRequestThread::~KviHttpRequestThread() -{ -} - -bool KviHttpRequestThread::processInternalEvents() -{ - while(KviThreadEvent *e = dequeueEvent()) - { - switch(e->id()) - { - case KVI_THREAD_EVENT_TERMINATE: - { - delete e; - return false; - } - break; - default: - debug("Unrecognized event in http thread"); - delete e; - return false; - break; - } - } - - return true; -} - -bool KviHttpRequestThread::failure(const char *error) -{ - if(error) - { - postEvent(m_pRequest,new KviThreadDataEvent<KviStr>(KVI_THREAD_EVENT_ERROR,new KviStr(error))); - } /*else { - postEvent(m_pRequest,new KviThreadDataEvent<KviStr>(KVI_THREAD_EVENT_ERROR,new KviStr(__tr2qs("Aborted")))); - }*/ - return false; -} - - -bool KviHttpRequestThread::selectForWrite(int iTimeoutInSecs) -{ - - kvi_time_t startTime = kvi_unixTime(); - - for(;;) - { - if(!processInternalEvents()) - { - return failure(0); - } - - fd_set writeSet; - - FD_ZERO(&writeSet); - - FD_SET(m_sock,&writeSet); - - struct timeval tmv; - tmv.tv_sec = 0; - tmv.tv_usec = 1000; // we wait 1000 usecs for an event - - - int nRet = kvi_socket_select(m_sock + 1,0,&writeSet,0,&tmv); - - if(nRet > 0) - { - if(FD_ISSET(m_sock,&writeSet)) - { - // connected! - return true; - } - } else { - if(nRet < 0) - { - int err = kvi_socket_error(); -#ifdef COMPILE_ON_WINDOWS - if((err != EAGAIN) && (err != EINTR) && (err != WSAEWOULDBLOCK)) -#else - if((err != EAGAIN) && (err != EINTR)) -#endif - { - return failure(KviError::getUntranslatedDescription(KviError::translateSystemError(err))); - } - } - } - - - if((time(0) - startTime) > iTimeoutInSecs)return failure(__tr_no_lookup("Operation timed out")); - - usleep(100000); // 1/10 sec - } - - return false; -} - -bool KviHttpRequestThread::sslFailure() -{ -#ifdef COMPILE_SSL_SUPPORT - KviStr buffer; - if(m_pSSL->getLastErrorString(buffer)) - { - failure(buffer.ptr()); - } else { - failure(__tr_no_lookup("Unexpected SSL error")); - } -#endif - return false; -} - -bool KviHttpRequestThread::connectToRemoteHost() -{ - m_sock = kvi_socket_create(KVI_SOCKET_PF_INET,KVI_SOCKET_TYPE_STREAM,0); //tcp - if(m_sock == KVI_INVALID_SOCKET) - return failure(__tr_no_lookup("Failed to create the socket")); - - if(!kvi_socket_setNonBlocking(m_sock)) - return failure(__tr_no_lookup("Failed to enter non blocking mode")); - - sockaddr_in saddr; - - if(!KviNetUtils::stringIpToBinaryIp(m_szIp,&(saddr.sin_addr))) - return failure(__tr_no_lookup("Invalid target address")); - - saddr.sin_port = htons(m_uPort); - saddr.sin_family = AF_INET; - - if(!kvi_socket_connect(m_sock,(struct sockaddr *)&saddr,sizeof(saddr))) - { - int err = kvi_socket_error(); - if(!kvi_socket_recoverableConnectError(err)) - { - return failure(KviError::getUntranslatedDescription(KviError::translateSystemError(err))); - } - } - - // now loop selecting for write - - //#warning "This should be a tuneable timeout" - if(!selectForWrite(60))return false; - - int sockError; - int iSize=sizeof(sockError); - if(!kvi_socket_getsockopt(m_sock,SOL_SOCKET,SO_ERROR,(void *)&sockError,&iSize))sockError = -1; - if(sockError != 0) - { - //failed - if(sockError > 0)sockError = KviError::translateSystemError(sockError); - else sockError = KviError_unknownError; - return failure(KviError::getUntranslatedDescription(sockError)); - } - -#ifdef COMPILE_SSL_SUPPORT - if(m_bUseSSL) - { - m_pSSL = new KviSSL(); - if(!m_pSSL->initContext(KviSSL::Client)) - return failure(__tr_no_lookup("Failed to initialize the SSL context")); - if(!m_pSSL->initSocket(m_sock)) - return failure(__tr_no_lookup("Failed to initialize the SSL connection")); - - for(;;) - { - switch(m_pSSL->connect()) - { - case KviSSL::Success: - // done: connected. - return true; - break; - case KviSSL::WantRead: - if(!selectForRead(60))return false; - break; - case KviSSL::WantWrite: - if(!selectForWrite(60))return false; - break; - case KviSSL::RemoteEndClosedConnection: - return failure(__tr_no_lookup("Remote end has closed the connection")); - break; - case KviSSL::SSLError: - return sslFailure(); - break; - case KviSSL::SyscallError: - { - // syscall problem - int err = kvi_socket_error(); - if(!kvi_socket_recoverableError(err)) - { - // Declare problems :) - return failure(__tr_no_lookup("Unrecoverable SSL error during handshake")); - } // else can recover ? (EAGAIN , EINTR ?) ... should select for read or for write - } - break; - default: - return sslFailure(); - break; - } - } - - // never here - return true; - } -#endif - - return true; -} - - -bool KviHttpRequestThread::sendBuffer(const char * buffer,int bufLen,int iTimeoutInSecs) -{ - const char * ptr = buffer; - int curLen = bufLen; - - time_t startTime = time(0); - - for(;;) - { - if(!processInternalEvents())return failure(); - - int wrtn; -#ifdef COMPILE_SSL_SUPPORT - if(m_pSSL) - { - wrtn = m_pSSL->write((char *)ptr,curLen); - } else { -#endif - wrtn = kvi_socket_send(m_sock,ptr,curLen); -#ifdef COMPILE_SSL_SUPPORT - } -#endif - - if(wrtn > 0) - { - curLen -= wrtn; - - if(curLen <= 0)break; - - ptr += wrtn; - } else { - if(wrtn < 0) - { -#ifdef COMPILE_SSL_SUPPORT - if(m_pSSL) - { - // ops...might be an SSL error - switch(m_pSSL->getProtocolError(wrtn)) - { - case KviSSL::WantWrite: - if(!selectForWrite(60))return false; - break; - case KviSSL::WantRead: - if(!selectForRead(60))return false; - break; - case KviSSL::SyscallError: - if(wrtn == 0) - { - return failure(__tr_no_lookup("Remote end has closed the connection")); - } else { - int iSSLErr = m_pSSL->getLastError(true); - if(iSSLErr != 0) - { - return sslFailure(); - } else { - goto handle_system_error; - } - } - break; - case KviSSL::SSLError: - return sslFailure(); - break; - default: - return sslFailure(); - break; - } - } else { -#endif //COMPILE_SSL_SUPPORT - -handle_system_error: - int err = kvi_socket_error(); -#ifdef COMPILE_ON_WINDOWS - if((err != EAGAIN) && (err != EINTR) && (err != WSAEWOULDBLOCK)) -#else - if((err != EAGAIN) && (err != EINTR)) -#endif - { - return failure(KviError::getUntranslatedDescription(KviError::translateSystemError(err))); - } -#ifdef COMPILE_SSL_SUPPORT - } -#endif - } - } - - int diff = time(0) - startTime; - if(diff > iTimeoutInSecs) - return failure(__tr_no_lookup("Operation timed out")); - - usleep(10000); - } - - return true; -} - - -int KviHttpRequestThread::selectForReadStep() -{ - // calls select on the main socket - // returns 1 if there is data available for reading - // returns 0 if there is no data available but there was no error - // returns -1 if there was a critical error (socket closed) - fd_set readSet; - - FD_ZERO(&readSet); - - FD_SET(m_sock,&readSet); - - struct timeval tmv; - tmv.tv_sec = 0; - tmv.tv_usec = 1000; // we wait 1000 usecs for an event - - - int nRet = kvi_socket_select(m_sock + 1,&readSet,0,0,&tmv); - - if(nRet > 0) - { - if(FD_ISSET(m_sock,&readSet)) - { - // ok - return 1; - } - } else { - if(nRet < 0) - { - int err = kvi_socket_error(); -#ifdef COMPILE_ON_WINDOWS - if((err != EAGAIN) && (err != EINTR) && (err != WSAEWOULDBLOCK)) -#else - if((err != EAGAIN) && (err != EINTR)) -#endif - { - failure(KviError::getUntranslatedDescription(KviError::translateSystemError(err))); - return -1; - } - } - } - - return 0; -} - - -bool KviHttpRequestThread::selectForRead(int iTimeoutInSecs) -{ - // waits for some data to arrive on the socket - // up to iTimeoutInSecs seconds - // returns true if data is available on the socket - // or false if there was a select() error or no data - // was available in the specified amount of time - - time_t startTime = time(0); - - for(;;) - { - if(!processInternalEvents()) - { - return failure(); // ensure that the socket is closed - } - - int nRet = selectForReadStep(); - - if(nRet < 0)return false; - if(nRet > 0)return true; - - int diff = time(0) - startTime; - if(diff > iTimeoutInSecs) - return failure(__tr_no_lookup("Operation timed out (while selecting for read)")); - - usleep(100000); // 1/10 sec - } - - return false; -} - -bool KviHttpRequestThread::readDataStep() -{ - unsigned char buffer[2048]; - int readed; - - -#ifdef COMPILE_SSL_SUPPORT - if(m_pSSL) - { - readed = m_pSSL->read((char *)buffer,2048); - if(readed <= 0) - { - // ssl error....? - switch(m_pSSL->getProtocolError(readed)) - { - case KviSSL::ZeroReturn: - readed = 0; - break; - case KviSSL::WantRead: - return selectForRead(120); - break; - case KviSSL::WantWrite: - return selectForWrite(120); - break; - case KviSSL::SyscallError: - { - int iE = m_pSSL->getLastError(true); - if(iE != 0)return sslFailure(); - } - break; - case KviSSL::SSLError: - return sslFailure(); - break; - default: - return sslFailure(); - break; - } - } - } else { -#endif - readed = kvi_socket_read(m_sock,buffer,2048); -#ifdef COMPILE_SSL_SUPPORT - } -#endif - - if(readed > 0) - { - postEvent(m_pRequest,new KviThreadDataEvent<KviDataBuffer>(KVI_THREAD_EVENT_BINARYDATA,new KviDataBuffer(readed,buffer))); - } else { - if(readed < 0) - { - // Read error ? - int err = kvi_socket_error(); -#ifdef COMPILE_ON_WINDOWS - if((err != EAGAIN) && (err != EINTR) && (err != WSAEWOULDBLOCK)) -#else - if((err != EAGAIN) && (err != EINTR)) -#endif - { - // yes...read error - return failure(KviError::getUntranslatedDescription(KviError::translateSystemError(err))); - } - return selectForRead(120); // EINTR or EAGAIN...transient problem - } else { - // readed == 0 - // Connection closed by remote host - postEvent(m_pRequest,new KviThreadEvent(KVI_THREAD_EVENT_SUCCESS)); - return false; - } - } - return selectForRead(120); -} - -void KviHttpRequestThread::run() -{ - // setup: - // nothing needed - - // run: - runInternal(); - - // cleanup: -#ifdef COMPILE_SSL_SUPPORT - if(m_pSSL) - { - delete m_pSSL; - m_pSSL = 0; - } -#endif - - if(kvi_socket_isValid(m_sock)) - { - kvi_socket_close(m_sock); - m_sock = KVI_INVALID_SOCKET; - } -} - -void KviHttpRequestThread::runInternal() -{ -#ifndef COMPILE_SSL_SUPPORT - if(m_bUseSSL) - { - failure(__tr_no_lookup("This KVIrc executable has no SSL support")); - return; - } -#endif - - if(!connectToRemoteHost())return; - - postEvent(m_pRequest,new KviThreadEvent(KVI_HTTP_REQUEST_THREAD_EVENT_CONNECTED)); - - // FIXME: Other headers ? - - KviStr szMethod; - switch(m_eRequestMethod) - { - case Head: szMethod = "HEAD"; break; - case Post: szMethod = "POST"; break; - case Get: szMethod = "GET"; break; - } - - KviStr szRequest(KviStr::Format,"%s %s HTTP/1.1\r\n" \ - "Host: %s\r\n" \ - "Connection: Close\r\n" \ - "User-Agent: KVIrc-http-slave/1.0.0\r\n" \ - "Accept: */*\r\n", - szMethod.ptr(),KviQString::toUtf8(m_szPath).data(),KviQString::toUtf8(m_szHost).data()); - - if(m_uContentOffset > 0) - szRequest.append(KviStr::Format,"Range: bytes=%u-\r\n",m_uContentOffset); - - if(m_eRequestMethod == Post) - { - szRequest.append(KviStr::Format,"Content-Type: application/x-www-form-urlencoded\r\n" \ - "Content-Length: %u\r\n" \ - "Cache-control: no-cache\r\n" \ - "Pragma: no-cache\r\n",m_szPostData.length()); - } - - szRequest += "\r\n"; - - if(m_eRequestMethod == Post) - { - if(!m_szPostData.isEmpty()) - szRequest.append(m_szPostData); - szRequest += "\r\n"; - } - - //debug("SENDING REQUEST:\n%s",szRequest.ptr()); - - if(!sendBuffer(szRequest.ptr(),szRequest.len(),60))return; - - // now loop reading data - postEvent(m_pRequest,new KviThreadDataEvent<QString>(KVI_HTTP_REQUEST_THREAD_EVENT_REQUESTSENT,new QString(szRequest))); - - for(;;) - { - if(!readDataStep())return; - } -} - diff --git a/3.4.0/src/kvilib/net/kvi_http.h b/3.4.0/src/kvilib/net/kvi_http.h deleted file mode 100644 index 23fbf407aa..0000000000 --- a/3.4.0/src/kvilib/net/kvi_http.h +++ /dev/null @@ -1,209 +0,0 @@ -#ifndef _KVI_HTTP_H_ -#define _KVI_HTTP_H_ -//============================================================================= -// -// File : kvi_http.h -// Creation date : Sat Aug 17 13:43:31 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 33, Boston, MA 02111-1307, USA. -// -//============================================================================= - -#include "kvi_settings.h" -#include "kvi_heapobject.h" -#include "kvi_string.h" -#include "kvi_thread.h" -#include "kvi_sockettype.h" -#include "kvi_databuffer.h" -#include "kvi_inttypes.h" -#include "kvi_url.h" - -#include <qobject.h> -#include "kvi_pointerhashtable.h" -#include "kvi_file.h" -#include <qstringlist.h> - -class KviDns; -class KviSSL; -class KviHttpRequestThread; - -// -// This class implements a HTTP protocol client. -// It's able to send GET, POST and HEAD requests, -// download stuff to a file or to a qt SLOT(). -// - -class KVILIB_API KviHttpRequest : public QObject, public KviHeapObject -{ - Q_OBJECT -public: - enum ProcessingType - { - HeadersOnly, // Download headers only (HEAD request) - WholeFile, // Emit the data as whole file (binaryData() is emitted) - Blocks, // Emit the data as blocks (binaryData() is emitted) - Lines, // Emit the data as ASCII text lines (the client must take care of decoding the data) - StoreToFile // Store the data to a file - }; - enum ExistingFileAction - { - Overwrite, // Overwrite existing file - RenameIncoming, // Automatically rename the incoming file - RenameExisting, // Automatically rename the existing file - Resume // Attempt to resume the file (get partial content) - }; -public: - KviHttpRequest(); - ~KviHttpRequest(); -protected: - // data - KviUrl m_url; - QString m_szFileName; - ProcessingType m_eProcessingType; - ExistingFileAction m_eExistingFileAction; - void * m_pPrivateData; - unsigned int m_uMaxContentLength; - unsigned int m_uContentOffset; - QString m_szPostData; - // status - QString m_szLastError; - unsigned int m_uTotalSize; - unsigned int m_uReceivedSize; - // internal status - QString m_szIp; - KviDns * m_pDns; - KviHttpRequestThread * m_pThread; - KviDataBuffer * m_pBuffer; - bool m_bHeaderProcessed; - bool m_bChunkedTransferEncoding; - bool m_bGzip; - unsigned int m_uRemainingChunkSize; - bool m_bIgnoreRemainingData; // used in chunked transfer after the last chunk has been seen - KviFile * m_pFile; -protected: - bool startDnsLookup(); - virtual bool event(QEvent *e); - void processData(KviDataBuffer * data); - bool processHeader(KviStr &szHeader); - bool openFile(); - void emitLines(KviDataBuffer * pDataBuffer); - - void resetStatus(); - void resetData(); - void resetInternalStatus(); -protected slots: - void dnsLookupDone(KviDns *d); - void haveServerIp(); -public: - const KviUrl & url(){ return m_url; }; - ProcessingType processingType(){ return m_eProcessingType; }; - ExistingFileAction existingFileAction(){ return m_eExistingFileAction; }; - const QString &fileName(){ return m_szFileName; }; - void * privateData(){ return m_pPrivateData; }; - unsigned int maxContentLength(){ return m_uMaxContentLength; }; - unsigned int contentOffset(){ return m_uContentOffset; }; - unsigned int totalSize(){ return m_uTotalSize; }; - unsigned int receivedSize(){ return m_uReceivedSize; }; - - void reset(); - - void setPostData(const QString &szPostData){ m_szPostData = szPostData; }; - void setUrl(const KviUrl &u){ m_url = u; }; - void setProcessingType(ProcessingType t){ m_eProcessingType = t; }; - void setExistingFileAction(ExistingFileAction a){ m_eExistingFileAction = a; }; - void setFileName(const QString &szFileName){ m_szFileName = szFileName; }; - void setPrivateData(void * ptr){ m_pPrivateData = ptr; }; - void setMaxContentLength(int uMaxContentLength){ m_uMaxContentLength = uMaxContentLength; }; //0 means unlimited - // this will work regardless of ExistingFileAction : even if the file doesn't exist - void setContentOffset(int uContentOffset){ m_uContentOffset = uContentOffset; }; - - bool start(); - - // this is a shortcut for reset()+setUrl()+setProcessingType()+setFileName()+start() - bool get(const KviUrl &u,ProcessingType p = WholeFile,const QString &szFileName = QString::null); - - const QString & lastError(){ return m_szLastError; }; - - void abort(); -signals: - void resolvingHost(const QString &hostname); - void contactingHost(const QString &ipandport); - void connectionEstabilished(); - void receivedResponse(const QString &response); - - void terminated(bool bSuccess); - - - void status(const QString &message); - void data(const KviStr &data); - void binaryData(const KviDataBuffer &data); - void header(KviPointerHashTable<const char *,KviStr> * hdr); - void requestSent(const QStringList &request); -}; - - -class KviHttpRequestThread : public KviSensitiveThread -{ - friend class KviHttpRequest; -public: - enum RequestMethod { Post, Get , Head }; -protected: - KviHttpRequestThread(KviHttpRequest * r, - const QString &szHost, - const QString &szIp, - unsigned short uPort, - const QString &szPath, - unsigned int uContentOffset, - RequestMethod m, - const QString &szPostData = QString::null, - bool bUseSSL = false); - -public: - ~KviHttpRequestThread(); -protected: - KviHttpRequest * m_pRequest; - - QString m_szHost; - QString m_szIp; - QString m_szPath; - unsigned int m_uContentOffset; - RequestMethod m_eRequestMethod; - QString m_szPostData; - - unsigned short m_uPort; - kvi_socket_t m_sock; - bool m_bUseSSL; -#ifdef COMPILE_SSL_SUPPORT - KviSSL * m_pSSL; -#endif -protected: - int selectForReadStep(); - bool selectForRead(int iTimeoutInSecs); - bool readDataStep(); - bool sendBuffer(const char *buffer,int bufLen,int iTimeoutInSecs); - bool failure(const char *error=0); - bool sslFailure(); - bool selectForWrite(int iTimeoutInSecs); - bool connectToRemoteHost(); - bool processInternalEvents(); - void runInternal(); - virtual void run(); -}; - - -#endif //_KVI_HTTP_H_ diff --git a/3.4.0/src/kvilib/net/kvi_netutils.cpp b/3.4.0/src/kvilib/net/kvi_netutils.cpp deleted file mode 100644 index 4ddb8b7015..0000000000 --- a/3.4.0/src/kvilib/net/kvi_netutils.cpp +++ /dev/null @@ -1,1504 +0,0 @@ -//============================================================================= - -// - -// File : kvi_netutlis.cpp - -// Creation date : Sun Jun 18 2000 18:37:27 by Szymon Stefanek - -// - -// This file is part of the KVirc irc client distribution - -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) - -// - -// 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 opinion) 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. - -// - -//============================================================================= - -// AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARGH! -// This effect is caused by the combination of broken CVS installation and -// the ugly windows "text mode" files - -#define __KVILIB__ - - - - - -#define _KVI_NETUTILS_CPP_ - - - -#include "kvi_netutils.h" - -#include "kvi_memmove.h" -#include <qstringlist.h> - - -#ifndef COMPILE_ON_WINDOWS - -#include <sys/time.h> // struct timeval - -#endif - - - -#include <sys/types.h> - - - -#include "kvi_qstring.h" - - - -#ifndef COMPILE_ON_WINDOWS - - #include <unistd.h> - - #include <netdb.h> - -#endif - - - -#ifdef COMPILE_GET_INTERFACE_ADDRESS - - #include <sys/ioctl.h> - - #include <net/if.h> - -#endif //COMPILE_GET_INTERFACE_ADDRESS - - - -#ifndef HAVE_INET_ATON - - - - - -// FIXME: #warning "Your system lacks the inet_aton function," - -// FIXME: #warning "you're trying to compile this file without" - -// FIXME: #warning "the config.h created by the configure script," - -// FIXME: #warning "Using own internal implementation of inet_aton." - - - -#include <ctype.h> - - - - - -// Need own inet_aton implementation - - - -// - -// Check whether "cp" is a valid ascii representation - -// of an Internet address and convert to a binary address. - -// Returns 1 if the address is valid, 0 if not. - -// This replaces inet_addr, the return value from which - -// cannot distinguish between failure and a local broadcast address. - -// - -// Original code comes from the ircd source. - -// - - - -bool kvi_stringIpToBinaryIp(const char *szIp,struct in_addr *address) - -{ - - register unsigned long val; - - register int base, n; - - register char c; - - unsigned int parts[4]; - - register unsigned int *pp = parts; - - if(!szIp)return false; - - c = *szIp; - - for(;;){ - - // Collect number up to ``.''. - - // Values are specified as for C: - - // 0x=hex, 0=octal, isdigit=decimal. - - if(!isdigit(c))return false; - - val = 0; - - base = 10; - - if(c == '0'){ - - c = *++szIp; - - if((c == 'x')||(c == 'X'))base = 16, c = *++szIp; - - else base = 8; - - } - - for (;;) { - - if(isascii(c) && isdigit(c)) { - - val = (val * base) + (c - '0'); - - c = *++szIp; - - } else if (base == 16 && isascii(c) && isxdigit(c)) { - - val = (val << 4) | (c + 10 - (islower(c) ? 'a' : 'A')); - - c = *++szIp; - - } else break; - - } - - if(c == '.'){ - - // Internet format: - - // a.b.c.d - - // a.b.c (with c treated as 16 bits) - - // a.b (with b treated as 24 bits) - - if(pp >= (parts + 3)) return false; - - *pp++ = val; - - c = *++szIp; - - } else break; - - } - - // Check for trailing characters. - - if ((c != '\0') && (!isascii(c) || !isspace(c)))return false; - - // Concact the address according to - - // the number of parts specified. - - n = pp - parts + 1; - - switch (n) { - - case 0: return false; // initial nondigit - - case 1: break; // a -- 32 bits - - case 2: // a.b -- 8.24 bits - - if(val > 0xffffff) return false; - - val |= parts[0] << 24; - - break; - - case 3: // a.b.c -- 8.8.16 bits - - if(val > 0xffff)return false; - - val |= (parts[0] << 24) | (parts[1] << 16); - - break; - - case 4: // a.b.c.d -- 8.8.8.8 bits - - if(val > 0xff)return false; - - val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); - - break; - - } - - if(address)address->s_addr = htonl(val); - - return true; - -} - - - -#else //!HAVE_INET_ATON - - - -bool kvi_stringIpToBinaryIp(const char *szIp,struct in_addr *address) - -{ - - if(!szIp)return false; - - return (inet_aton(szIp,address) != 0); - -} - - - -#endif //!HAVE_INET_ATON - - - -#ifndef HAVE_INET_NTOA - - - -// FIXME: #warning "Your system lacks the inet_ntoa function," - -// FIXME: #warning "you're trying to compile this file without" - -// FIXME: #warning "the config.h created by the configure script," - -// FIXME: #warning "Using own internal implementation of inet_ntoa." - - - -// - -// Original code comes from the ircd source. - -// - - - -bool kvi_binaryIpToStringIp(struct in_addr in,QString &szBuffer) - -{ - - unsigned char *s = (unsigned char *)∈ - - int a,b,c,d; - - a = (int)*s++; - - b = (int)*s++; - - c = (int)*s++; - - d = (int)*s; - - szBuffer.sprintf("%d.%d.%d.%d", a,b,c,d ); - - return true; - -} - - - -#else //HAVE_INET_NTOA - - - -bool kvi_binaryIpToStringIp(struct in_addr in,QString &szBuffer) - -{ - -// FIXME: #warning "This is NOT thread safe!" - - char * ptr = inet_ntoa(in); - - if(!ptr)return false; - - szBuffer = ptr; - - return true; - -} - - - -#endif //HAVE_INET_NTOA - - - -bool kvi_isValidStringIp(const char *szIp) - -{ - - struct in_addr address; - - if(!szIp)return false; - - if(!isdigit(*szIp))return false; - - return kvi_stringIpToBinaryIp(szIp,&address); - -} - - - - - -#ifdef COMPILE_IPV6_SUPPORT - - - -#ifdef COMPILE_ON_WINDOWS - - - -//#include <stdlib.h> - -//#include <sys/socket.h> - -//#include <arpa/inet.h>/ - -//#include <errno.h> - -//#include "dietfeatures.h" - - - -static unsigned int scan_ip6(const char *s,char ip[16]) - -{ - - unsigned int i; - - unsigned int len=0; - - unsigned long u; - - - - char suffix[16]; - - unsigned int prefixlen=0; - - unsigned int suffixlen=0; - - - - for (i=0; i<16; i++) ip[i]=0; - - - - for (;;) { - - if (*s == ':') { - - len++; - - if (s[1] == ':') { /* Found "::", skip to part 2 */ - - s+=2; - - len++; - - break; - - } - - s++; - - } - - { - - char *tmp; - - u=strtoul(s,&tmp,16); - - i=tmp-s; - - } - - - - if (!i) return 0; - - if (prefixlen==12 && s[i]=='.') { - - /* the last 4 bytes may be written as IPv4 address */ - - if (kvi_stringIpToBinaryIp(s,(struct in_addr*)(ip+12))) - - return i+len; - - else - - return 0; - - } - - ip[prefixlen++] = (u >> 8); - - ip[prefixlen++] = (u & 255); - - s += i; len += i; - - if (prefixlen==16) - - return len; - - } - - - -/* part 2, after "::" */ - - for (;;) { - - if (*s == ':') { - - if (suffixlen==0) - - break; - - s++; - - len++; - - } else if (suffixlen!=0) - - break; - - { - - char *tmp; - - u=strtol(s,&tmp,16); - - i=tmp-s; - - } - - if (!i) { - - if (*s) len--; - - break; - - } - - if (suffixlen+prefixlen<=12 && s[i]=='.') { - - if (kvi_stringIpToBinaryIp(s,(struct in_addr*)(suffix+suffixlen))) { - - suffixlen+=4; - - len+=(unsigned int)strlen(s); - - break; - - } else - - prefixlen=12-suffixlen; /* make end-of-loop test true */ - - } - - suffix[suffixlen++] = (u >> 8); - - suffix[suffixlen++] = (u & 255); - - s += i; len += i; - - if (prefixlen+suffixlen==16) - - break; - - } - - for (i=0; i<suffixlen; i++) - - ip[16-suffixlen+i] = suffix[i]; - - return len; - -} - - - -#ifndef WIN2K - - - -int inet_pton(int AF, const char *CP, void *BUF) { - - int len; - - if (AF==AF_INET) { - - if (!kvi_stringIpToBinaryIp(CP,(struct in_addr*)BUF)) - - return 0; - - } else if (AF==AF_INET6) { - - if (CP[len=scan_ip6(CP,(char *)BUF)]) - - return 0; - - } else { - - errno=WSAEPFNOSUPPORT; - - return -1; - - } - - return 1; - -} - - - -#endif //WIN2K - - - -//#include <sys/socket.h> - -//#include <arpa/inet.h> - - - -//extern char *inet_ntoa_r(struct in_addr in,char* buf); - - - -static const unsigned char V4mappedprefix[12]={0,0,0,0,0,0,0,0,0,0,0xff,0xff}; - - - -static char tohex(char hexdigit) { - - return hexdigit>9?hexdigit+'a'-10:hexdigit+'0'; - -} - - - -static int fmt_xlong(char* s,unsigned int i) - -{ - - char* bak=s; - - *s=tohex((i>>12)&0xf); if (s!=bak || *s!='0') ++s; - - *s=tohex((i>>8)&0xf); if (s!=bak || *s!='0') ++s; - - *s=tohex((i>>4)&0xf); if (s!=bak || *s!='0') ++s; - - *s=tohex(i&0xf); - - return s-bak+1; - -} - - - -static unsigned int i2a(char* dest,unsigned int x) - -{ - - register unsigned int tmp=x; - - register unsigned int len=0; - - if (x>=100) { *dest++=tmp/100+'0'; tmp=tmp%100; ++len; } - - if (x>=10) { *dest++=tmp/10+'0'; tmp=tmp%10; ++len; } - - *dest++=tmp+'0'; - - return len+1; - -} - - - -char *inet_ntoa_r(struct in_addr in,char* buf) - -{ - - unsigned int len; - - unsigned char *ip=(unsigned char*)∈ - - len=i2a(buf,ip[0]); buf[len]='.'; ++len; - - len+=i2a(buf+ len,ip[1]); buf[len]='.'; ++len; - - len+=i2a(buf+ len,ip[2]); buf[len]='.'; ++len; - - len+=i2a(buf+ len,ip[3]); buf[len]=0; - - return buf; - -} - - - - - -unsigned int fmt_ip6(char *s,const char ip[16]) - -{ - - unsigned int len; - - unsigned int i; - - unsigned int temp; - - unsigned int compressing; // 0 not compressing , 1 compressing now , 2 already compressed once - - - - len = 0; - - compressing = 0; - - - - for(int j=0;j<16;j+=2) - - { - - if (j==12 && !memcmp(ip,V4mappedprefix,12)) - - { - - inet_ntoa_r(*(struct in_addr*)(ip+12),s); - - temp=(unsigned int)strlen(s); - - return len+temp; - - } - - temp = ((unsigned long) (unsigned char) ip[j] << 8) + (unsigned long) (unsigned char) ip[j+1]; - - if(temp == 0) - - { - - if(compressing == 0) - - { - - compressing=1; - - if (j==0) - - { - - *s++=':'; - - ++len; - - } - - } - - } else { - - if(compressing == 1) - - { - - compressing=2; // don't do it again - - *s++=':'; ++len; - - } - - i = fmt_xlong(s,temp); - - len += i; - - s += i; - - if (j<14) - - { - - *s++ = ':'; - - ++len; - - } - - } - - } - - if(compressing == 1) - - { - - *s++=':'; - - ++len; - - } - - *s=0; - - return len; - -} - - - -const char* inet_ntop(int AF, const void *CP, char *BUF, size_t LEN) - -{ - - char buf[100]; - - size_t len; - - if (AF==AF_INET) - - { - - inet_ntoa_r(*(struct in_addr*)CP,buf); - - len=strlen(buf); - - } else if (AF==AF_INET6) - - { - - len=fmt_ip6(buf,(char *)CP); - - } else - - return 0; - - if (len<LEN) - - { - - strcpy(BUF,buf); - - return BUF; - - } - - return 0; - -} - - - - - - - - - - - -#endif - - - - - -bool kvi_stringIpToBinaryIp_V6(const char *szIp,struct in6_addr *address) - -{ - - if(!szIp)return false; - - return (inet_pton(AF_INET6,szIp,(void *)address) == 1); - -} - - - -bool kvi_isValidStringIp_V6(const char *szIp) - -{ - - struct in6_addr address; - - if(!szIp)return false; - - return kvi_stringIpToBinaryIp_V6(szIp,&address); - -} - - - - - - - -bool kvi_binaryIpToStringIp_V6(struct in6_addr in,QString &szBuffer) - -{ - - char buf[46]; - - bool bRet = inet_ntop(AF_INET6,(void *)&in,buf,46); - - szBuffer= buf; - - return bRet; - -} - - - -#endif - - - -#include <errno.h> - - - -bool kvi_select(int fd,bool * bCanRead,bool * bCanWrite,int iUSecs) - -{ - - // FIXME: This stuff should DIE! - - fd_set rs; - - fd_set ws; - - FD_ZERO(&rs); - - FD_ZERO(&ws); - - FD_SET(fd,&rs); - - FD_SET(fd,&ws); - - struct timeval tv; - - tv.tv_sec = 0; - - tv.tv_usec = iUSecs; - - int ret = select(fd + 1,&rs,&ws,0,&tv); - - if(ret < 1)return false; // EINTR or ENOSTUFFATALL - - *bCanRead = FD_ISSET(fd,&rs); - - *bCanWrite = FD_ISSET(fd,&ws); - - return true; - -} - - - -namespace KviNetUtils - -{ - - bool stringIpToBinaryIp(const QString &szStringIp,struct in_addr * address) - { -#ifndef HAVE_INET_ATON - QString szAddr = szStringIp.simplifyWhiteSpace(); - Q_UINT32 iAddr=0; - QStringList ipv4 = QStringList::split(".", szAddr, FALSE); - if (ipv4.count() == 4) { - int i = 0; - bool ok = TRUE; - while(ok && i < 4) { - uint byteValue = ipv4[i].toUInt(&ok); - if ( (byteValue > 255) && ok ) - ok = FALSE; - if (ok) - iAddr = (iAddr << 8) + byteValue; - ++i; - } - if (ok) - { - if(address)address->s_addr = htonl(iAddr); - return true; - } - } - return FALSE; -#else //HAVE_INET_ATON - if(szStringIp.isEmpty())return false; - return (inet_aton(KviQString::toUtf8(szStringIp).data(),address) != 0); -#endif //HAVE_INET_ATON - } - - - bool isValidStringIp(const QString &szIp) - - { - - struct in_addr address; - - if(szIp.isEmpty())return false; - - if(!szIp[0].isNumber())return false; - - return stringIpToBinaryIp(szIp,&address); - - } - - - -#ifdef COMPILE_IPV6_SUPPORT - - bool stringIpToBinaryIp_V6(const QString &szStringIp,struct in6_addr * address) - - { - - return (inet_pton(AF_INET6,KviQString::toUtf8(szStringIp).data(),(void *)address) == 1); - - } - - - - bool isValidStringIp_V6(const QString &szIp) - - { - - struct in6_addr address; - - if(szIp.isEmpty())return false; - - return stringIpToBinaryIp_V6(szIp,&address); - - } - - bool binaryIpToStringIp_V6(struct in6_addr in,QString &szBuffer) - { - char buf[46]; - bool bRet = inet_ntop(AF_INET6,(void *)&in,buf,46); - szBuffer= buf; - return bRet; - } - - -#endif //COMPILE_IPV6_SUPPORT - - - - bool binaryIpToStringIp(struct in_addr in,QString &szBuffer) - - { - - char * ptr = inet_ntoa(in); - - if(!ptr)return false; - - szBuffer = ptr; - - return true; - - } - - - - bool isRoutableIpString(const QString &szIpString) - - { - - struct in_addr a; - - if(szIpString.isEmpty())return false; - - stringIpToBinaryIp(szIpString,&a); - - return isRoutableIp((const char *)&a); - - } - - - - bool isRoutableIp(const char * ipaddr) - - { - - if(!ipaddr)return false; - - const unsigned char * ip = (const unsigned char *)ipaddr; - - if(ip[0] == 0)return false; // old-style broadcast - - if(ip[0] == 10)return false; // Class A VPN - - if(ip[0] == 127)return false; // loopback - - if((ip[0] == 172) && (ip[1] >= 16) && (ip[1] <= 31))return false; // Class B VPN - - if((ip[0] == 192) && (ip[1] == 168))return false; // Class C VPN - - if((ip[0] == 169) && (ip[1] == 254))return false; // APIPA - - if((ip[0] == 192) && (ip[1] == 0) && (ip[2] == 2))return false; // Class B VPN - - if(ip[0] >= 224)return false; // class D multicast and class E reserved - - - - return true; - - } - - - - bool getInterfaceAddress(const QString &szInterfaceName,QString &szBuffer) - - { - -#ifdef COMPILE_GET_INTERFACE_ADDRESS - - struct sockaddr *sa; - - struct sockaddr_in *sin; - - struct ifreq ifr; - - int len = szInterfaceName.length(); - - if(len > (IFNAMSIZ - 1))return false; // invalid interface anyway - - - - kvi_memmove(ifr.ifr_name,KviQString::toUtf8(szInterfaceName).data(),len + 1); - - - - int fd = socket(AF_INET,SOCK_STREAM,0); - - if(fd < 0)return false; - - - - if(ioctl(fd,SIOCGIFADDR,&ifr) == -1)return false; // supports only IPV4 ? - - - - close(fd); - - - - sa = (struct sockaddr *)&(ifr.ifr_addr); - - - - if (sa->sa_family != AF_INET) return false; - - sin = (struct sockaddr_in*) sa; - - return binaryIpToStringIp(sin->sin_addr,szBuffer); - - // (this seems to work for AF_INET only anyway) - -#else //!COMPILE_GET_INTERFACE_ADDRESS - - return false; - -#endif //!COMPILE_GET_INTERFACE_ADDRESS - - } - - - - void formatNetworkBandwidthString(QString &szBuffer,unsigned int uBytesPerSec) - - { - - if(uBytesPerSec > (1024 * 1024)) - - { - - unsigned int uMB = uBytesPerSec / (1024 * 1024); - - unsigned int uRem = ((uBytesPerSec % (1024 * 1024)) * 100) / (1024 * 1024); - - KviQString::sprintf(szBuffer,"%u.%u%u MB/s",uMB,uRem / 10,uRem % 10); - - return; - - } - - if(uBytesPerSec >= 1024) - - { - - unsigned int uKB = uBytesPerSec / 1024; - - unsigned int uRem = ((uBytesPerSec % 1024) * 100) / 1024; - - KviQString::sprintf(szBuffer,"%u.%u%u KB/s",uKB,uRem / 10,uRem % 10); - - return; - - } - - KviQString::sprintf(szBuffer,"%u B/s",uBytesPerSec); - - } - - - - - -}; - - - -bool kvi_getInterfaceAddress(const char * ifname,QString &buffer) - -{ - - debug("kvi_getInterfaceAddress is deprecated: use KviNetUtils::getInterfaceAddress"); - - QString szRet; - - bool bRes = KviNetUtils::getInterfaceAddress(QString(ifname),szRet); - - buffer = szRet; - - return bRes; - -} - - - -bool kvi_isRoutableIpString(const char * ipstring) - -{ - - struct in_addr a; - - if(!ipstring)return false; - - kvi_stringIpToBinaryIp(ipstring,&a); - - return kvi_isRoutableIp((const char *)&a); - -} - - - -bool kvi_isRoutableIp(const char * ipaddr) - -{ - - if(!ipaddr)return false; - - const unsigned char * ip = (const unsigned char *)ipaddr; - - if(ip[0] == 0)return false; // old-style broadcast - - if(ip[0] == 10)return false; // Class A VPN - - if(ip[0] == 127)return false; // loopback - - if((ip[0] == 172) && (ip[1] >= 16) && (ip[1] <= 31))return false; // Class B VPN - - if((ip[0] == 192) && (ip[1] == 168))return false; // Class C VPN - - if((ip[0] == 169) && (ip[1] == 254))return false; // APIPA - - if((ip[0] == 192) && (ip[1] == 0) && (ip[2] == 2))return false; // Class B VPN - - if(ip[0] >= 224)return false; // class D multicast and class E reserved - - - - return true; - -} - - - -bool kvi_getLocalHostAddress(QString &buffer) - -{ - - // This will work only on windoze... - - char buf[1024]; - - if(gethostname(buf,1024) != 0)return false; - - struct hostent * h = gethostbyname(buf); - - if(!h)return false; - - QString tmp; - - int i=0; - - while(h->h_addr_list[i]) - - { - - if(kvi_binaryIpToStringIp(*((struct in_addr *)(h->h_addr_list[i])),tmp)) - - { - - if(kvi_isRoutableIp(h->h_addr_list[i])) - - { - - buffer = tmp; - - return true; - - } - - } - - i++; - - } - - buffer = tmp; - - return true; - -} - - - - - - - - - - - -KviSockaddr::KviSockaddr(const char * szIpAddress,kvi_u32_t uPort,bool bIpV6,bool bUdp) - -{ - struct addrinfo hints; - kvi_memset((void *)&hints,0,sizeof(hints)); - hints.ai_flags = AI_NUMERICHOST; -#ifdef COMPILE_IPV6_SUPPORT - hints.ai_family = bIpV6 ? PF_INET6 : PF_INET; -#else - hints.ai_family = PF_INET; -#endif - - hints.ai_socktype = bUdp ? SOCK_DGRAM : SOCK_STREAM; - - hints.ai_protocol = 0; - m_pData = 0; - KviStr szPort(KviStr::Format,"%u",uPort); - getaddrinfo(szIpAddress,szPort.ptr(),&hints,(struct addrinfo **)&m_pData); - -} - - -KviSockaddr::KviSockaddr(kvi_u32_t uPort,bool bIpV6,bool bUdp) // passive sockaddr - -{ - struct addrinfo hints; - kvi_memset((void *)&hints,0,sizeof(hints)); - hints.ai_flags = AI_NUMERICHOST | AI_PASSIVE; -#ifdef COMPILE_IPV6_SUPPORT - hints.ai_family = bIpV6 ? PF_INET6 : PF_INET; -#else - hints.ai_family = PF_INET; -#endif - hints.ai_socktype = bUdp ? SOCK_DGRAM : SOCK_STREAM; - hints.ai_protocol = 0; - m_pData = 0; - KviStr szPort(KviStr::Format,"%u",uPort); - getaddrinfo(0,szPort.ptr(),&hints,(struct addrinfo **)&m_pData); - -} - - - -KviSockaddr::~KviSockaddr() - -{ - - if(m_pData) - - { - - freeaddrinfo((struct addrinfo *)m_pData); - - m_pData = 0; - - } - -} - - - -struct sockaddr * KviSockaddr::socketAddress() - -{ - - if(!m_pData)return 0; - - return ((struct addrinfo *)m_pData)->ai_addr; - -} - - - -size_t KviSockaddr::addressLength() - -{ - - if(!m_pData)return 0; - - return ((struct addrinfo *)m_pData)->ai_addrlen; - -} - - - -int KviSockaddr::addressFamily() - -{ - - if(!m_pData)return 0; - - return ((struct addrinfo *)m_pData)->ai_family; - -} - - - -bool KviSockaddr::isIpV6() - -{ - - if(!m_pData)return false; - -#ifdef COMPILE_IPV6_SUPPORT - - return false; - -#else - - return (addressFamily() == AF_INET6); - -#endif - -} - - - -kvi_u32_t KviSockaddr::port() - -{ - if(!m_pData)return 0; -#ifdef COMPILE_IPV6_SUPPORT - switch(((struct addrinfo *)m_pData)->ai_family) - { - case AF_INET: - return ntohs(((struct sockaddr_in *)(((struct addrinfo *)m_pData)->ai_addr))->sin_port); - break; - case AF_INET6: - return ntohs(((struct sockaddr_in6 *)(((struct addrinfo *)m_pData)->ai_addr))->sin6_port); - break; - } - return 0; -#else - return ntohs(((struct sockaddr_in *)(((struct addrinfo *)m_pData)->ai_addr))->sin_port); -#endif - -} - - - -bool KviSockaddr::getStringAddress(QString &szBuffer) - -{ - - if(!m_pData)return 0; - -#ifdef COMPILE_IPV6_SUPPORT - - switch(((struct addrinfo *)m_pData)->ai_family) - - { - - case AF_INET: - - return kvi_binaryIpToStringIp(((struct sockaddr_in *)(((struct addrinfo *)m_pData)->ai_addr))->sin_addr,szBuffer); - - break; - - case AF_INET6: - - return kvi_binaryIpToStringIp_V6(((struct sockaddr_in6 *)(((struct addrinfo *)m_pData)->ai_addr))->sin6_addr,szBuffer); - - break; - - } - - return false; - -#else - - return kvi_binaryIpToStringIp(((struct sockaddr_in *)(((struct addrinfo *)m_pData)->ai_addr))->sin_addr,szBuffer); - -#endif - -} - diff --git a/3.4.0/src/kvilib/net/kvi_netutils.h b/3.4.0/src/kvilib/net/kvi_netutils.h deleted file mode 100644 index 1d4fe82b71..0000000000 --- a/3.4.0/src/kvilib/net/kvi_netutils.h +++ /dev/null @@ -1,104 +0,0 @@ -#ifndef _KVI_NETUTILS_H_ -#define _KVI_NETUTILS_H_ - -// -// File : kvi_netutlis.h -// Creation date : Sun Jun 18 2000 18:37:27 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_inttypes.h" - -#ifdef COMPILE_ON_WINDOWS - #include <winsock2.h> - #ifdef COMPILE_IPV6_SUPPORT - #ifdef WIN2K - #include <ws2ip6.h> - #else - #include <ws2tcpip.h> - //#include <tpipv6.h> - #define in6_addr in_addr6 - #endif - #endif -#else - #include <sys/types.h> - #include <sys/socket.h> - #include <netinet/in.h> //in_addr - #include <arpa/inet.h> //inet_ntoa inet_ntop and inet_pton depend on this one. -#endif - -#include "kvi_string.h" - - -KVILIB_API extern bool kvi_isValidStringIp(const char * szIp); -KVILIB_API extern bool kvi_stringIpToBinaryIp(const char * szIp,struct in_addr * address); -KVILIB_API extern bool kvi_binaryIpToStringIp(struct in_addr in,QString &szBuffer); - -#ifdef COMPILE_IPV6_SUPPORT - KVILIB_API extern bool kvi_isValidStringIp_V6(const char * szIp); - KVILIB_API extern bool kvi_stringIpToBinaryIp_V6(const char * szIp,struct in6_addr * address); - KVILIB_API extern bool kvi_binaryIpToStringIp_V6(struct in6_addr in,QString &szBuffer); -#endif - -class KVILIB_API KviSockaddr -{ -public: - KviSockaddr(const char * szIpAddress,kvi_u32_t uPort,bool bIpV6,bool bUdp = false); - KviSockaddr(kvi_u32_t uPort,bool bIpV6,bool bUdp = false); // passive - ~KviSockaddr(); -private: - void * m_pData; //addrinfo -public: - struct sockaddr * socketAddress(); - size_t addressLength(); - int addressFamily(); - bool isIpV6(); - bool getStringAddress(QString &szBuffer); - kvi_u32_t port(); - -}; - - -KVILIB_API extern bool kvi_select(int fd,bool * bCanRead,bool * bCanWrite,int iUSecs = 0); -KVILIB_API extern bool kvi_getInterfaceAddress(const char * ifname,QString &buffer); - -// Warning : NOT THREAD SAFE! -KVILIB_API extern bool kvi_getLocalHostAddress(QString &buffer); -KVILIB_API extern bool kvi_isRoutableIp(const char * ipaddr); -KVILIB_API extern bool kvi_isRoutableIpString(const char * ipstring); - -namespace KviNetUtils -{ - KVILIB_API bool stringIpToBinaryIp(const QString &szStringIp,struct in_addr * address); - KVILIB_API bool isValidStringIp(const QString &szStringIp); - KVILIB_API bool binaryIpToStringIp(struct in_addr in,QString &szBuffer); - KVILIB_API bool getInterfaceAddress(const QString &szInterfaceName,QString &szBuffer); -#ifdef COMPILE_IPV6_SUPPORT - KVILIB_API bool isValidStringIp_V6(const QString &szStringIp); - KVILIB_API bool stringIpToBinaryIp_V6(const QString &szStringIp,struct in6_addr * address); - KVILIB_API bool binaryIpToStringIp_V6(struct in6_addr in,QString &szBuffer); -#endif - KVILIB_API bool isRoutableIp(const char * ipaddr); - KVILIB_API bool isRoutableIpString(const QString &szIpString); - KVILIB_API void formatNetworkBandwidthString(QString &szBuffer,unsigned int uBytesPerSec); -}; - - -#endif //!_KVI_NETUTILS_H_ diff --git a/3.4.0/src/kvilib/net/kvi_socket.cpp b/3.4.0/src/kvilib/net/kvi_socket.cpp deleted file mode 100644 index 198eaf1cfa..0000000000 --- a/3.4.0/src/kvilib/net/kvi_socket.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// -// File : kvi_socket.cpp -// Creation date : Thu Sep 20 03:50:24 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 _KVI_SOCKET_CPP_ - -#define __KVILIB__ - -#include "kvi_socket.h" -#include "kvi_inttypes.h" - -KVILIB_API kvi_u64_t g_uOutgoingTraffic; -KVILIB_API kvi_u64_t g_uIncomingTraffic; diff --git a/3.4.0/src/kvilib/net/kvi_socket.h b/3.4.0/src/kvilib/net/kvi_socket.h deleted file mode 100644 index 95352f120c..0000000000 --- a/3.4.0/src/kvilib/net/kvi_socket.h +++ /dev/null @@ -1,356 +0,0 @@ -#ifndef _KVI_SOCKET_H_ -#define _KVI_SOCKET_H_ -//============================================================================= -// -// File : kvi_socket.h -// Creation date : Thu Sep 20 03:50:22 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - -//============================================================================= -// Socket stuff abstraction layer -//============================================================================= - -#include "kvi_settings.h" -#include "kvi_sockettype.h" // <--- this includes <winsock2.h> if needed - -#include <errno.h> - -#include "kvi_inttypes.h" - -//#ifndef _KVI_SOCKET_CPP_ - extern KVILIB_API kvi_u64_t g_uOutgoingTraffic; - extern KVILIB_API kvi_u64_t g_uIncomingTraffic; -//#endif //!_KVI_SOCKET_CPP_ - - - -#ifdef COMPILE_ON_WINDOWS - - #define KVI_INVALID_SOCKET INVALID_SOCKET - -#else - - #include <sys/time.h> - #include <sys/types.h> - #include <sys/socket.h> - #include <netinet/tcp.h> - #include <netinet/in.h> - #include <fcntl.h> - #include <unistd.h> - - #define KVI_INVALID_SOCKET (-1) - -#endif - -#ifndef MSG_NOSIGNAL - // At least solaris seems to not have it - #define MSG_NOSIGNAL 0 -#endif - -//#include "kvi_socketcalls.h" - - -//================================================================================================ -// Constants for kvi_socket_create -// - -#define KVI_SOCKET_PF_INET PF_INET -#define KVI_SOCKET_PF_INET6 PF_INET6 -#define KVI_SOCKET_PF_UNIX PF_UNIX - -#define KVI_SOCKET_TYPE_STREAM SOCK_STREAM -#define KVI_SOCKET_TYPE_DGRAM SOCK_DGRAM - -#define KVI_SOCKET_PROTO_TCP 0 - -//================================================================================================ -// kvi_socket_create -// kvi_socket_open -// -// Open a socket of the specified protocol family , type and protocol -// You should always use the KVI_SOCKET_* constants as parameters -// Returns KVI_INVALID_SOCKET if the socket creation has failed. -// The returned socket is in blocking mode! -// - -#define kvi_socket_open kvi_socket_create - -inline kvi_socket_t kvi_socket_create(int pf,int type,int proto) -{ - return (kvi_socket_t)socket(pf,type,proto); -}; - -//================================================================================================ -// kvi_socket_isValid -// -// Check if a socket is valid or not -// - -inline void kvi_socket_flushTrafficCounters() -{ - g_uOutgoingTraffic = 0; - g_uIncomingTraffic = 0; -} - -inline bool kvi_socket_isValid(kvi_socket_t sock) -{ - return (sock != ((kvi_socket_t)(KVI_INVALID_SOCKET))); -} - -//================================================================================================ -// kvi_socket_destroy -// kvi_socket_close -// -// Close a socket...that's all :) -// - -#define kvi_socket_close kvi_socket_destroy - -inline void kvi_socket_destroy(kvi_socket_t sock) -{ -#ifdef COMPILE_ON_WINDOWS - closesocket(sock); -#else - close(sock); -#endif -}; - -//================================================================================================ -// kvi_socket_setNonBlocking -// -// Sets the socket in nonBlocking mode. Obviously returns false in case of failure -// - -inline bool kvi_socket_setNonBlocking(kvi_socket_t sock) -{ -#ifdef COMPILE_ON_WINDOWS - unsigned long arg = 1; - return (ioctlsocket(sock,FIONBIO,(unsigned long FAR *)&arg) == 0); -#else - return (fcntl(sock,F_SETFL,O_NONBLOCK) == 0); -#endif -}; - -//================================================================================================ -// kvi_socket_bind -// -// Standard bind() call on the socket. Returns false in case of failure -// - -inline bool kvi_socket_bind(kvi_socket_t sock,const struct sockaddr * sa,int salen) -{ - return (::bind(sock,sa,salen) == 0); -}; - -//================================================================================================ -// kvi_socket_connect -// -// Starts a connection to the specified remote address -// returns false if the connection can not be started. -// You might take a look at kvi_socket_errno() then. -// - -inline bool kvi_socket_connect(kvi_socket_t sock,const struct sockaddr *sa,int salen) -{ -#ifdef COMPILE_ON_WINDOWS - return (WSAConnect(sock,sa,salen,0,0,0,0) == 0); -#else - return (::connect(sock,sa,salen) == 0); -#endif -}; - -inline bool kvi_socket_recoverableConnectError(int err) -{ -#ifdef COMPILE_ON_WINDOWS - return ((err == WSAEINPROGRESS) || (err == WSAEWOULDBLOCK)); -#else - return (err == EINPROGRESS); -#endif -}; - -inline bool kvi_socket_recoverableError(int err) -{ -#ifdef COMPILE_ON_WINDOWS - return ((err == WSAEWOULDBLOCK) || (err == EINTR) || (err == EAGAIN)); -#else - return ((err == EINTR) || (err = EAGAIN)); -#endif -} - -//================================================================================================ -// kvi_socket_accept -// -// Standard accept() call. Returns KVI_INVALID_SOCKET in case of failure -// You should check kvi_socket_errno() then. -// - -inline kvi_socket_t kvi_socket_accept(kvi_socket_t sock,struct sockaddr *sa,int * salen) -{ -#ifdef COMPILE_ON_WINDOWS - return (kvi_socket_t)::accept(sock,sa,salen); -#else - return (kvi_socket_t)::accept(sock,sa,(socklen_t *)salen); -#endif -}; - -//================================================================================================ -// kvi_socket_listen -// -// Standard listen() call. Returns false in case of failure -// You should check kvi_socket_errno() then. -// - -inline bool kvi_socket_listen(kvi_socket_t sock,int backlog) -{ - return (::listen(sock,backlog) == 0); -}; - -//================================================================================================ -// kvi_socket_select -// -// Standard select() call. This is complex so here is a mini-reminder: -// nhpo is the number of the highest file descriptor in the sets plus one! -// Returns the number of sockets with data available (or space available) -// or something that is less than 0 in case of error. You should check kvi_socket_errno() then. -// - -inline int kvi_socket_select(int nhpo,fd_set *r,fd_set *w,fd_set *e,struct timeval * t) -{ - return ::select(nhpo,r,w,e,t); -}; - -//================================================================================================ -// kvi_socket_send -// kvi_socket_write -// -// Standard send() call. On UNIX ignores SIGPIPE. Returns the number of bytes sent or -// -1 in case of failure. You should check kvi_socket_errno() then. -// - -#define kvi_socket_write kvi_socket_send - -inline int kvi_socket_send(kvi_socket_t sock,const void * buf,int size) -{ - g_uOutgoingTraffic+=size; -#ifdef COMPILE_ON_WINDOWS - return ::send(sock,(const char *)buf,size,0); -#else - return ::send(sock,buf,size,MSG_NOSIGNAL | MSG_DONTWAIT); -#endif -}; - -//================================================================================================ -// kvi_socket_recv -// kvi_socket_read -// -// Standard read() call. On UNIX ignores SIGPIPE. Returns the number of bytes readed or -// -1 in case of failure. You should check kvi_socket_errno() then. -// - -#define kvi_socket_read kvi_socket_recv - -inline int kvi_socket_recv(kvi_socket_t sock,void * buf,int maxlen) -{ - int iReceived; -#ifdef COMPILE_ON_WINDOWS - iReceived = ::recv(sock,(char *)buf,maxlen,0); -#else - iReceived = ::recv(sock,buf,maxlen,MSG_NOSIGNAL); -#endif - g_uIncomingTraffic+=iReceived; - return iReceived; -}; - -//================================================================================================ -// kvi_socket_getsockopt -// -// Standard getsockopt() call. Returns false in case of failure. -// You should check kvi_socket_errno() then. -// - -inline bool kvi_socket_getsockopt(kvi_socket_t sock,int level,int optname,void *optval,int *optlen) -{ -#ifdef COMPILE_ON_WINDOWS - return (::getsockopt(sock,level,optname,(char FAR *)optval,optlen) == 0); -#else - return (::getsockopt(sock,level,optname,optval,(socklen_t *)optlen) == 0); -#endif -} - -//================================================================================================ -// kvi_socket_setsockopt -// -// Standard setsockopt() call. Returns false in case of failure. -// You should check kvi_socket_errno() then. -// - -inline bool kvi_socket_setsockopt(kvi_socket_t sock,int level,int optname,const void *optval,int optlen) -{ -#ifdef COMPILE_ON_WINDOWS - return (::setsockopt(sock,level,optname,(char FAR *)optval,optlen) == 0); -#else - return (::setsockopt(sock,level,optname,optval,optlen) == 0); -#endif -} - - -//================================================================================================ -// kvi_socket_disableNagle -// -// Disables the nagle algorithm (sets TCP_NODELAY) -// - -/* - unused for now -inline bool kvi_socket_disableNagle(kvi_socket_t sock) -{ - int opt = 1; - return kvi_socket_setsockopt(sock,IPPROTO_TCP,TCP_NODELAY,&opt,sizeof(opt)); -}; -*/ - -//================================================================================================ -// kvi_socket_getsockname -// -// Standard getsockname() call. Returns false in case of failure. -// You should check kvi_socket_errno() then. -// - -inline bool kvi_socket_getsockname(kvi_socket_t sock,struct sockaddr * addr,int * addrlen) -{ -#ifdef COMPILE_ON_WINDOWS - return (::getsockname(sock,addr,addrlen) == 0); -#else - return (::getsockname(sock,addr,(socklen_t *)addrlen) == 0); -#endif -} - -inline int kvi_socket_error() -{ -#ifdef COMPILE_ON_WINDOWS - return WSAGetLastError(); -#else - return errno; -#endif -} - - -#endif //_KVI_SOCKET_H_ diff --git a/3.4.0/src/kvilib/net/kvi_sockettype.h b/3.4.0/src/kvilib/net/kvi_sockettype.h deleted file mode 100644 index f8b5e100ac..0000000000 --- a/3.4.0/src/kvilib/net/kvi_sockettype.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _KVI_SOCKETTYPE_H_ -#define _KVI_SOCKETTYPE_H_ -//============================================================================= -// -// File : kvi_sockettype.h -// Creation date : Thu Sep 20 05:41:46 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - -//============================================================================= -// Socket stuff abstraction layer -//============================================================================= - -#include "kvi_settings.h" - -#ifdef COMPILE_ON_WINDOWS - - #include <winsock2.h> - - typedef SOCKET kvi_socket_t; - -#else - - typedef int kvi_socket_t; - -#endif - -#endif //_KVI_SOCKETTYPE_H_ diff --git a/3.4.0/src/kvilib/net/kvi_ssl.cpp b/3.4.0/src/kvilib/net/kvi_ssl.cpp deleted file mode 100644 index 974bd4d136..0000000000 --- a/3.4.0/src/kvilib/net/kvi_ssl.cpp +++ /dev/null @@ -1,687 +0,0 @@ -//============================================================================= -// -// File : kvi_ssl.cpp -// Creation date : Mon May 27 2002 21:36:12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_ssl.h" -#include "kvi_locale.h" - -#ifdef COMPILE_SSL_SUPPORT - -#include "kvi_thread.h" -#include "kvi_memmove.h" -#include "kvi_malloc.h" - -#include <openssl/asn1.h> -#include <openssl/err.h> -#include <openssl/dh.h> - -#include <stdio.h> - -static bool g_bSSLInitialized = false; -static KviMutex * g_pSSLMutex = 0; - - -static inline void my_ssl_lock() -{ - g_pSSLMutex->lock(); -} - -static inline void my_ssl_unlock() -{ - g_pSSLMutex->unlock(); -} - - -// THIS PART OF OpenSSL SUCKS - -static DH * dh_512 = 0; -static DH * dh_1024 = 0; -static DH * dh_2048 = 0; -static DH * dh_4096 = 0; - -static unsigned char dh512_p[]={ - 0x90,0x86,0xDD,0x06,0xE8,0x0F,0x10,0x86,0xF0,0x91,0xC5,0x55, - 0x4D,0x6B,0xAF,0x69,0x4F,0x01,0xED,0xF9,0x57,0x8F,0x3B,0xB8, - 0x9C,0x87,0xAE,0x85,0xC1,0xBF,0x57,0xA5,0xD5,0xBA,0x81,0x24, - 0xE7,0x99,0xE3,0xF6,0xCD,0xB4,0x41,0xB7,0x7F,0x6E,0x7B,0xB1, - 0xD2,0xF3,0xE9,0x0F,0xB9,0x0E,0x4D,0xEB,0x9D,0xD4,0xA9,0xE5, - 0x03,0x67,0xA7,0x27 -}; -static unsigned char dh512_g[]={ 0x05 }; - -static unsigned char dh1024_p[]={ - 0xA5,0x4C,0xB9,0xB9,0xC4,0x35,0x88,0x68,0x9B,0x79,0x48,0x6C, - 0x21,0xA7,0x8E,0xE2,0x9C,0xAF,0x2F,0x04,0xBF,0x45,0xBC,0xF5, - 0xAB,0x35,0x86,0xC8,0xBB,0x9B,0x75,0x18,0x7C,0x9B,0xAB,0xE8, - 0x52,0x7F,0x57,0x3E,0xD8,0x65,0x7D,0x2B,0xE1,0x6D,0x3D,0xA5, - 0x32,0xE8,0xA0,0x2B,0x7A,0x58,0x6B,0x47,0x16,0x4E,0xB1,0xFC, - 0x09,0xB7,0x7C,0xC6,0xE9,0x6E,0xC7,0xC7,0xA1,0x42,0x0F,0x4B, - 0x43,0xFB,0x58,0xBA,0xC7,0x66,0xD6,0xCA,0x6B,0xC7,0x45,0x7C, - 0x99,0xE4,0x46,0x02,0x93,0x3F,0x28,0xD2,0xCE,0x0C,0x8A,0xDD, - 0x6A,0x22,0x2E,0xA9,0x9A,0xCA,0x16,0x48,0x4E,0x67,0x4C,0xE9, - 0xC8,0x54,0xCD,0x18,0xC9,0xF3,0x30,0x3A,0x74,0xAB,0xF9,0xAF, - 0xE4,0xA4,0x0D,0x56,0x62,0x28,0x07,0xBF -}; -static unsigned char dh1024_g[]={ 0x05 }; - -static unsigned char dh2048_p[]={ - 0xBF,0x67,0x7B,0x79,0xA5,0x22,0xD3,0xB5,0x0C,0x13,0xE6,0x92, - 0x54,0xFD,0x64,0xBF,0x57,0x25,0xBD,0x02,0x7C,0xFD,0x72,0x97, - 0x82,0xA4,0xA6,0x0A,0xB9,0xE6,0x4B,0xFA,0xBD,0xFA,0x71,0x8A, - 0x2E,0x36,0xF9,0x03,0x58,0x1B,0xB6,0x3A,0xFD,0x15,0xCC,0x87, - 0x5D,0x04,0xF7,0x45,0xE0,0xE2,0x34,0x7F,0x54,0x5F,0x5D,0x14, - 0xD3,0xCA,0x3E,0xFD,0x2A,0x92,0x10,0x89,0xA0,0xB0,0xB4,0xE5, - 0x80,0x05,0x13,0xBE,0xA3,0xD0,0x42,0x4B,0x98,0x44,0x54,0xB3, - 0xE0,0x23,0x26,0xF5,0x6B,0x0E,0x4D,0x2A,0x81,0xB2,0x8A,0x06, - 0xC8,0x00,0x9E,0xAB,0x1B,0x77,0xDC,0x87,0x9C,0x6C,0xD5,0xEE, - 0xB4,0xB4,0xDD,0xDA,0x3F,0x40,0xA3,0xFA,0xC1,0x1E,0xC0,0xA2, - 0x9E,0xB8,0xAC,0x31,0xE8,0x12,0x93,0x9C,0x71,0xF6,0xE7,0xF0, - 0x65,0x7F,0xA5,0x20,0xF7,0x49,0x3D,0xD6,0xF9,0xD3,0xF0,0x3F, - 0xB3,0xF0,0xD0,0x23,0x22,0x82,0xA5,0xDD,0xFB,0xD9,0x9C,0x7D, - 0xE7,0xA0,0x78,0xE8,0xF9,0x02,0x0C,0x2F,0x1D,0x52,0xC7,0x61, - 0xED,0xA0,0xC9,0x06,0x14,0xDF,0xE7,0xB1,0x1E,0x50,0x98,0x4F, - 0x10,0xB9,0x87,0x4C,0x1C,0x9C,0xB3,0xD2,0x98,0x23,0x7C,0x47, - 0xD2,0x3C,0xC5,0x29,0x65,0xC5,0x67,0x4E,0xC0,0x76,0x0F,0x43, - 0x27,0x28,0x89,0x69,0x30,0x7D,0x04,0xFD,0xF7,0x89,0xE5,0xD6, - 0xE6,0x97,0x7D,0xBB,0x54,0x5F,0xB7,0x94,0x1D,0xBC,0x82,0xAB, - 0x9A,0xF5,0x0A,0x0C,0x89,0x68,0xE7,0x0A,0x8C,0x2D,0x0D,0x82, - 0x44,0xA7,0xB8,0xF9,0x0B,0x8E,0xCB,0xA4,0x6A,0xA7,0xEC,0x5F, - 0x0A,0xF8,0x5F,0xE7 -}; -static unsigned char dh2048_g[]={ 0x05 }; - -static unsigned char dh4096_p[]={ - 0xFA,0x14,0x72,0x52,0xC1,0x4D,0xE1,0x5A,0x49,0xD4,0xEF,0x09, - 0x2D,0xC0,0xA8,0xFD,0x55,0xAB,0xD7,0xD9,0x37,0x04,0x28,0x09, - 0xE2,0xE9,0x3E,0x77,0xE2,0xA1,0x7A,0x18,0xDD,0x46,0xA3,0x43, - 0x37,0x23,0x90,0x97,0xF3,0x0E,0xC9,0x03,0x50,0x7D,0x65,0xCF, - 0x78,0x62,0xA6,0x3A,0x62,0x22,0x83,0xA1,0x2F,0xFE,0x79,0xBA, - 0x35,0xFF,0x59,0xD8,0x1D,0x61,0xDD,0x1E,0x21,0x13,0x17,0xFE, - 0xCD,0x38,0x87,0x9E,0xF5,0x4F,0x79,0x10,0x61,0x8D,0xD4,0x22, - 0xF3,0x5A,0xED,0x5D,0xEA,0x21,0xE9,0x33,0x6B,0x48,0x12,0x0A, - 0x20,0x77,0xD4,0x25,0x60,0x61,0xDE,0xF6,0xB4,0x4F,0x1C,0x63, - 0x40,0x8B,0x3A,0x21,0x93,0x8B,0x79,0x53,0x51,0x2C,0xCA,0xB3, - 0x7B,0x29,0x56,0xA8,0xC7,0xF8,0xF4,0x7B,0x08,0x5E,0xA6,0xDC, - 0xA2,0x45,0x12,0x56,0xDD,0x41,0x92,0xF2,0xDD,0x5B,0x8F,0x23, - 0xF0,0xF3,0xEF,0xE4,0x3B,0x0A,0x44,0xDD,0xED,0x96,0x84,0xF1, - 0xA8,0x32,0x46,0xA3,0xDB,0x4A,0xBE,0x3D,0x45,0xBA,0x4E,0xF8, - 0x03,0xE5,0xDD,0x6B,0x59,0x0D,0x84,0x1E,0xCA,0x16,0x5A,0x8C, - 0xC8,0xDF,0x7C,0x54,0x44,0xC4,0x27,0xA7,0x3B,0x2A,0x97,0xCE, - 0xA3,0x7D,0x26,0x9C,0xAD,0xF4,0xC2,0xAC,0x37,0x4B,0xC3,0xAD, - 0x68,0x84,0x7F,0x99,0xA6,0x17,0xEF,0x6B,0x46,0x3A,0x7A,0x36, - 0x7A,0x11,0x43,0x92,0xAD,0xE9,0x9C,0xFB,0x44,0x6C,0x3D,0x82, - 0x49,0xCC,0x5C,0x6A,0x52,0x42,0xF8,0x42,0xFB,0x44,0xF9,0x39, - 0x73,0xFB,0x60,0x79,0x3B,0xC2,0x9E,0x0B,0xDC,0xD4,0xA6,0x67, - 0xF7,0x66,0x3F,0xFC,0x42,0x3B,0x1B,0xDB,0x4F,0x66,0xDC,0xA5, - 0x8F,0x66,0xF9,0xEA,0xC1,0xED,0x31,0xFB,0x48,0xA1,0x82,0x7D, - 0xF8,0xE0,0xCC,0xB1,0xC7,0x03,0xE4,0xF8,0xB3,0xFE,0xB7,0xA3, - 0x13,0x73,0xA6,0x7B,0xC1,0x0E,0x39,0xC7,0x94,0x48,0x26,0x00, - 0x85,0x79,0xFC,0x6F,0x7A,0xAF,0xC5,0x52,0x35,0x75,0xD7,0x75, - 0xA4,0x40,0xFA,0x14,0x74,0x61,0x16,0xF2,0xEB,0x67,0x11,0x6F, - 0x04,0x43,0x3D,0x11,0x14,0x4C,0xA7,0x94,0x2A,0x39,0xA1,0xC9, - 0x90,0xCF,0x83,0xC6,0xFF,0x02,0x8F,0xA3,0x2A,0xAC,0x26,0xDF, - 0x0B,0x8B,0xBE,0x64,0x4A,0xF1,0xA1,0xDC,0xEE,0xBA,0xC8,0x03, - 0x82,0xF6,0x62,0x2C,0x5D,0xB6,0xBB,0x13,0x19,0x6E,0x86,0xC5, - 0x5B,0x2B,0x5E,0x3A,0xF3,0xB3,0x28,0x6B,0x70,0x71,0x3A,0x8E, - 0xFF,0x5C,0x15,0xE6,0x02,0xA4,0xCE,0xED,0x59,0x56,0xCC,0x15, - 0x51,0x07,0x79,0x1A,0x0F,0x25,0x26,0x27,0x30,0xA9,0x15,0xB2, - 0xC8,0xD4,0x5C,0xCC,0x30,0xE8,0x1B,0xD8,0xD5,0x0F,0x19,0xA8, - 0x80,0xA4,0xC7,0x01,0xAA,0x8B,0xBA,0x53,0xBB,0x47,0xC2,0x1F, - 0x6B,0x54,0xB0,0x17,0x60,0xED,0x79,0x21,0x95,0xB6,0x05,0x84, - 0x37,0xC8,0x03,0xA4,0xDD,0xD1,0x06,0x69,0x8F,0x4C,0x39,0xE0, - 0xC8,0x5D,0x83,0x1D,0xBE,0x6A,0x9A,0x99,0xF3,0x9F,0x0B,0x45, - 0x29,0xD4,0xCB,0x29,0x66,0xEE,0x1E,0x7E,0x3D,0xD7,0x13,0x4E, - 0xDB,0x90,0x90,0x58,0xCB,0x5E,0x9B,0xCD,0x2E,0x2B,0x0F,0xA9, - 0x4E,0x78,0xAC,0x05,0x11,0x7F,0xE3,0x9E,0x27,0xD4,0x99,0xE1, - 0xB9,0xBD,0x78,0xE1,0x84,0x41,0xA0,0xDF -}; -static unsigned char dh4096_g[]={ 0x02 }; - -static DH * my_get_dh(int keylength) -{ - DH * dh = 0; - unsigned char * p = 0; - unsigned char * g = 0; - int sp = 0; - int sg = 0; - switch(keylength) - { - case 512: - dh = dh_512; - p = dh512_p; - g = dh512_g; - sp = sizeof(dh512_p); - sg = sizeof(dh512_g); - break; - case 1024: - dh = dh_1024; - p = dh1024_p; - g = dh1024_g; - sp = sizeof(dh1024_p); - sg = sizeof(dh1024_g); - break; - case 2048: - dh = dh_2048; - p = dh2048_p; - g = dh2048_g; - sp = sizeof(dh2048_p); - sg = sizeof(dh2048_g); - break; - case 4096: - dh = dh_4096; - p = dh4096_p; - g = dh4096_g; - sp = sizeof(dh4096_p); - sg = sizeof(dh4096_g); - break; - default: - // What the hell do you want from me ? - debug("OpenSSL is asking for a DH param with keylen %d: no way :D",keylength); - break; - - } - - if(dh)return dh; - dh = DH_new(); - if(!dh)return 0; - dh->p=BN_bin2bn(p,sp,0); - dh->g=BN_bin2bn(g,sg,0); - if((dh->p == 0) || (dh->g == 0)) - { - DH_free(dh); - return 0; - } - return dh; -} - -DH * my_ugly_dh_callback(SSL *s, int is_export, int keylength) -{ - my_ssl_lock(); - DH *dh = my_get_dh(keylength); - my_ssl_unlock(); - return dh; -} - -void KviSSL::globalInit() -{ - if(g_pSSLMutex)return; - g_pSSLMutex = new KviMutex(); -} - -void KviSSL::globalDestroy() -{ - if(!g_pSSLMutex)return; - if(dh_512)DH_free(dh_512); - if(dh_1024)DH_free(dh_1024); - if(dh_2048)DH_free(dh_2048); - if(dh_4096)DH_free(dh_4096); - delete g_pSSLMutex; - g_pSSLMutex = 0; -} - -KviSSL::KviSSL() -{ - my_ssl_lock(); - if(!g_bSSLInitialized) - { - // FIXME: this should be done only if SSL is really needed - SSL_library_init(); - SSL_load_error_strings(); - g_bSSLInitialized = true; - } - my_ssl_unlock(); - m_pSSL = 0; - m_pSSLCtx = 0; -} - -KviSSL::~KviSSL() -{ - shutdown(); -} - -#ifdef COMPILE_ON_WINDOWS - - // On windows we need to override new and delete operators - // to ensure that always the right new/delete pair is called for an object instance - // This bug is present in all the classes exported by a module that - // can be instantiated/destroyed from external modules. - // (this is a well known bug described in Q122675 of MSDN) - - void * KviSSL::operator new(size_t tSize) - { - return kvi_malloc(tSize); - } - - void KviSSL::operator delete(void * p) - { - kvi_free(p); - } - -#endif - -void KviSSL::shutdown() -{ - if(m_pSSL) - { - // At least attempt to shutdown the connection gracefully - SSL_shutdown(m_pSSL); - SSL_free(m_pSSL); - m_pSSL = 0; - } - if(m_pSSLCtx) - { - SSL_CTX_free(m_pSSLCtx); - m_pSSLCtx = 0; - } -} - - -bool KviSSL::initContext(Method m) -{ - if(m_pSSL)return false; - m_pSSLCtx = SSL_CTX_new(m == Client ? SSLv23_client_method() : SSLv23_server_method()); - if(!m_pSSLCtx)return false; - // FIXME: this should be configurable ? - SSL_CTX_set_cipher_list(m_pSSLCtx,"ALL:eNULL"); - SSL_CTX_set_tmp_dh_callback(m_pSSLCtx,my_ugly_dh_callback); - return true; -} - -bool KviSSL::initSocket(kvi_socket_t fd) -{ - if(!m_pSSLCtx)return false; - m_pSSL = SSL_new(m_pSSLCtx); - if(!m_pSSL)return false; - if(!SSL_set_fd(m_pSSL,fd))return false; - return true; - -} - -static int cb(char *buf, int size, int rwflag, void *u) -{ - KviStr * p = (KviStr *)u; - int len = p->len(); - if(len >= size)return 0; - kvi_memmove(buf,p->ptr(),len + 1); -// debug("PASS REQYESTED: %s",p->ptr()); - return len; -} - -KviSSL::Result KviSSL::useCertificateFile(const char * cert,const char * pass) -{ - if(!m_pSSLCtx)return NotInitialized; - m_szPass = pass; - if(m_szPass.len() < 4)m_szPass.append("xxxx"); - X509 * x509 = 0; - - FILE * f = fopen(cert,"r"); - if(!f)return FileIoError; - -// debug("READING CERTIFICATE %s",cert); - if(PEM_read_X509(f,&x509,cb,&m_szPass)) - { - if(!SSL_CTX_use_certificate(m_pSSLCtx,x509)) - { - X509_free(x509); - return SSLError; - } - } - - fclose(f); - return Success; -} - - -KviSSL::Result KviSSL::usePrivateKeyFile(const char * key,const char * pass) -{ - if(!m_pSSLCtx)return NotInitialized; - m_szPass = pass; - if(m_szPass.len() < 4)m_szPass.append("xxxx"); - - EVP_PKEY * k = 0; - - FILE * f = fopen(key,"r"); - if(!f)return FileIoError; - -// debug("READING KEY %s",key); - if(PEM_read_PrivateKey(f,&k,cb,&m_szPass)) - { - if(!SSL_CTX_use_PrivateKey(m_pSSLCtx,k)) - { - EVP_PKEY_free(k); - return SSLError; - } - } - - fclose(f); - return Success; -} - -unsigned long KviSSL::getLastError(bool bPeek) -{ - return bPeek ? ERR_peek_error() : ERR_get_error(); -} - -bool KviSSL::getLastErrorString(KviStr &buffer,bool bPeek) -{ - unsigned long uErr = getLastError(bPeek); - if(uErr != 0) - { - const char * err = ERR_reason_error_string(uErr); - buffer = err ? err : "Unknown error"; - return true; - } - return false; -} - -KviSSL::Result KviSSL::connect() -{ - if(!m_pSSL)return NotInitialized; - int ret = SSL_connect(m_pSSL); - return connectOrAcceptError(ret); -} - -KviSSL::Result KviSSL::accept() -{ - if(!m_pSSL)return NotInitialized; - int ret = SSL_accept(m_pSSL); - return connectOrAcceptError(ret); -} - -KviSSL::Result KviSSL::connectOrAcceptError(int ret) -{ - switch(SSL_get_error(m_pSSL,ret)) - { - case SSL_ERROR_NONE: return Success; break; - case SSL_ERROR_WANT_READ: return WantRead; break; - case SSL_ERROR_WANT_WRITE: return WantWrite; break; - case SSL_ERROR_ZERO_RETURN: return RemoteEndClosedConnection; break; - case SSL_ERROR_WANT_X509_LOOKUP: return ObscureError; break; - case SSL_ERROR_SYSCALL: - { - if(getLastError(true) != 0)return SSLError; - if(ret == 0)return RemoteEndClosedConnection; - return SyscallError; - } - break; - case SSL_ERROR_SSL: return SSLError; break; - default: return UnknownError; break; - } - return UnknownError; -} - -int KviSSL::read(char * buffer,int len) -{ -// if(!m_pSSL)return -1; - return SSL_read(m_pSSL,buffer,len); -} -int KviSSL::write(const char * buffer,int len) -{ -// if(!m_pSSL)return -1; - return SSL_write(m_pSSL,buffer,len); -} - -KviSSL::Result KviSSL::getProtocolError(int ret) -{ - if(!m_pSSL)return NotInitialized; - switch(SSL_get_error(m_pSSL,ret)) - { - case SSL_ERROR_NONE: return Success; break; - case SSL_ERROR_WANT_READ: return WantRead; break; - case SSL_ERROR_WANT_WRITE: return WantWrite; break; - case SSL_ERROR_ZERO_RETURN: return ZeroReturn; break; - case SSL_ERROR_WANT_X509_LOOKUP: return ObscureError; break; - case SSL_ERROR_SYSCALL: return SyscallError; break; - case SSL_ERROR_SSL: return SSLError; break; - default: return UnknownError; break; - } - return UnknownError; -} - -KviSSLCertificate * KviSSL::getPeerCertificate() -{ - if(!m_pSSL)return 0; - X509 * x509 = SSL_get_peer_certificate(m_pSSL); - if(!x509)return 0; - return new KviSSLCertificate(x509); -} - -KviSSLCipherInfo * KviSSL::getCurrentCipherInfo() -{ - if(!m_pSSL)return 0; - SSL_CIPHER * c = SSL_get_current_cipher(m_pSSL); - if(!c)return 0; - return new KviSSLCipherInfo(c); -} - - - -KviSSLCertificate::KviSSLCertificate(X509 * x509) -{ - m_pSubject = new KviPointerHashTable<const char *,KviStr>(17); - m_pSubject->setAutoDelete(true); - m_pIssuer = new KviPointerHashTable<const char *,KviStr>(17); - m_pIssuer->setAutoDelete(true); - m_pX509 = 0; - setX509(x509); -} - -KviSSLCertificate::~KviSSLCertificate() -{ - X509_free(m_pX509); - delete m_pSubject; - delete m_pIssuer; -} - -#ifdef COMPILE_ON_WINDOWS - - // On windows we need to override new and delete operators - // to ensure that always the right new/delete pair is called for an object instance - // This bug is present in all the classes exported by a module that - // can be instantiated/destroyed from external modules. - // (this is a well known bug described in Q122675 of MSDN) - - void * KviSSLCertificate::operator new(size_t tSize) - { - return kvi_malloc(tSize); - } - - void KviSSLCertificate::operator delete(void * p) - { - kvi_free(p); - } - -#endif - -void KviSSLCertificate::setX509(X509 * x509) -{ - if(m_pX509)X509_free(m_pX509); - m_pX509 = x509; - m_iVersion = X509_get_version(x509); - extractSubject(); - extractIssuer(); - extractPubKeyInfo(); - extractSerialNumber(); - extractSignature(); -} - -void KviSSLCertificate::extractSubject() -{ - char buffer[1024]; - char * t = X509_NAME_oneline(X509_get_subject_name(m_pX509),buffer,1024); - if (!t)return; - m_pSubject->clear(); - splitX509String(m_pSubject,t); -} - -void KviSSLCertificate::extractIssuer() -{ - char buffer[1024]; - char * t = X509_NAME_oneline(X509_get_issuer_name(m_pX509),buffer,1024); - if (!t)return; - m_pIssuer->clear(); - splitX509String(m_pIssuer,t); -} - -void KviSSLCertificate::splitX509String(KviPointerHashTable<const char *,KviStr> * dict,const char * t) -{ - KviStr buf = t; - int cnt; - KviStr ** arr = buf.splitToArray('/',50,&cnt); - if(arr) - { - if(cnt > 0) - { - for(int i=0;i<cnt;i++) - { - int idx = arr[i]->findFirstIdx('='); - if(idx != -1) - { - KviStr szTok = arr[i]->left(idx); - arr[i]->cutLeft(idx + 1); - if(szTok.hasData() && arr[i]->hasData()) - { - dict->replace(szTok.ptr(),new KviStr(arr[i]->ptr())); - } - } - } - } - - KviStr::freeArray(arr); - } -} - - -const char * KviSSLCertificate::dictEntry(KviPointerHashTable<const char *,KviStr> * dict,const char * entry) -{ - KviStr * t = dict->find(entry); - if(!t)return __tr("Unknown"); - return t->ptr(); -} - - -/* -void KviSSLCertificate::getPKeyType(int type,KviStr &buffer) -{ - switch(type) - { -#ifndef NO_RSA - case EVP_PKEY_RSA: buffer = "RSA"; break; -#endif -#ifndef NO_DSA - case EVP_PKEY_DSA: buffer = "DSA"; break; -#endif -#ifndef NO_DH - case EVP_PKEY_DH: buffer = "DH"; break; -#endif - case EVP_PKEY_NONE: buffer = "NONE"; break; - } -} -*/ - -void KviSSLCertificate::extractPubKeyInfo() -{ - EVP_PKEY *p = X509_get_pubkey(m_pX509); - if(p) - { - m_iPubKeyBits = EVP_PKEY_bits(p); - m_szPubKeyType = (p->type == NID_undef) ? __tr("Unknown") : OBJ_nid2ln(p->type); -// getPKeyType(p->type,m_szPubKeyType); - } else { - m_iPubKeyBits = 0; - m_szPubKeyType = "None"; - } - -} - -void KviSSLCertificate::extractSerialNumber() -{ - ASN1_INTEGER * i = X509_get_serialNumber(m_pX509); - if(i)m_iSerialNumber = ASN1_INTEGER_get(i); - else m_iSerialNumber = -1; -} - -void KviSSLCertificate::extractSignature() -{ - static char hexdigits[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; - - //getPKeyType(X509_get_signature_type(m_pX509),m_szSignatureType); - - int i = OBJ_obj2nid(m_pX509->sig_alg->algorithm); - m_szSignatureType = (i == NID_undef) ? __tr("Unknown") : OBJ_nid2ln(i); - - m_szSignatureContents = ""; - - for(i = 0;i < m_pX509->signature->length;i++) - { - if(m_szSignatureContents.hasData())m_szSignatureContents.append(":"); - m_szSignatureContents.append(hexdigits[(m_pX509->signature->data[i] & 0xf0) >> 4]); - m_szSignatureContents.append(hexdigits[(m_pX509->signature->data[i] & 0x0f)]); - } -} - -/* -const char * KviSSLCertificate::verify() -{ - -} -*/ - - -KviSSLCipherInfo::KviSSLCipherInfo(SSL_CIPHER * c) -{ - m_szVersion = SSL_CIPHER_get_version(c); - m_iNumBitsUsed = SSL_CIPHER_get_bits(c,&m_iNumBits); - m_szName = SSL_CIPHER_get_name(c); - char buf[1024]; - m_szDescription = SSL_CIPHER_description(c,buf,1024); -} - -KviSSLCipherInfo::~KviSSLCipherInfo() -{ -} - -#ifdef COMPILE_ON_WINDOWS - - // On windows we need to override new and delete operators - // to ensure that always the right new/delete pair is called for an object instance - // This bug is present in all the classes exported by a module that - // can be instantiated/destroyed from external modules. - // (this is a well known bug described in Q122675 of MSDN) - - void * KviSSLCipherInfo::operator new(size_t tSize) - { - return kvi_malloc(tSize); - } - - void KviSSLCipherInfo::operator delete(void * p) - { - kvi_free(p); - } - -#endif - -#endif //COMPILE_SSL_SUPPORT diff --git a/3.4.0/src/kvilib/net/kvi_ssl.h b/3.4.0/src/kvilib/net/kvi_ssl.h deleted file mode 100644 index c8ee8a299d..0000000000 --- a/3.4.0/src/kvilib/net/kvi_ssl.h +++ /dev/null @@ -1,180 +0,0 @@ -#ifndef _KVI_SSL_H_ -#define _KVI_SSL_H_ -// -// File : kvi_ssl.h -// Creation date : Mon May 27 2002 21:36:12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_SSL_SUPPORT - -#include "kvi_string.h" -#include "kvi_sockettype.h" - -#include "kvi_pointerhashtable.h" - -#include <openssl/ssl.h> - - -class KVILIB_API KviSSLCertificate -{ -public: - KviSSLCertificate(X509 * x509); - ~KviSSLCertificate(); -protected: - X509 * m_pX509; - KviPointerHashTable<const char *,KviStr> * m_pSubject; - KviPointerHashTable<const char *,KviStr> * m_pIssuer; - int m_iPubKeyBits; - KviStr m_szPubKeyType; - int m_iSerialNumber; - int m_iVersion; - KviStr m_szSignatureType; - KviStr m_szSignatureContents; -private: - void extractSubject(); - void extractIssuer(); - void extractPubKeyInfo(); - void extractSerialNumber(); - void extractSignature(); - const char * dictEntry(KviPointerHashTable<const char *,KviStr> * dict,const char * entry); - void splitX509String(KviPointerHashTable<const char *,KviStr> * dict,const char * t); -// void getPKeyType(int type,KviStr &buffer); -public: - void setX509(X509 * x509); - - const char * signatureType(){ return m_szSignatureType.ptr(); }; - const char * signatureContents(){ return m_szSignatureContents.ptr(); }; - - const char * subjectCountry(){ return dictEntry(m_pSubject,"C"); }; - const char * subjectStateOrProvince(){ return dictEntry(m_pSubject,"ST"); }; - const char * subjectLocality(){ return dictEntry(m_pSubject,"L"); }; - const char * subjectOrganization(){ return dictEntry(m_pSubject,"O"); }; - const char * subjectOrganizationalUnit(){ return dictEntry(m_pSubject,"OU"); }; - const char * subjectCommonName(){ return dictEntry(m_pSubject,"CN"); }; - - const char * issuerCountry(){ return dictEntry(m_pIssuer,"C"); }; - const char * issuerStateOrProvince(){ return dictEntry(m_pIssuer,"ST"); }; - const char * issuerLocality(){ return dictEntry(m_pIssuer,"L"); }; - const char * issuerOrganization(){ return dictEntry(m_pIssuer,"O"); }; - const char * issuerOrganizationalUnit(){ return dictEntry(m_pIssuer,"OU"); }; - const char * issuerCommonName(){ return dictEntry(m_pIssuer,"CN"); }; - - int publicKeyBits(){ return m_iPubKeyBits; }; - const char * publicKeyType(){ return m_szPubKeyType.ptr(); }; - - int serialNumber(){ return m_iSerialNumber; }; - - int version(){ return m_iVersion; }; -#ifdef COMPILE_ON_WINDOWS - // On windows we need to override new and delete operators - // to ensure that always the right new/delete pair is called for an object instance - // This bug is present in all the classes exported by a module that - // can be instantiated/destroyed from external modules. - // (this is a well known bug described in Q122675 of MSDN) - void * operator new(size_t tSize); - void operator delete(void * p); -#endif -}; - -class KVILIB_API KviSSLCipherInfo -{ -public: - KviSSLCipherInfo(SSL_CIPHER * c); - ~KviSSLCipherInfo(); -protected: - KviStr m_szVersion; - int m_iNumBits; - int m_iNumBitsUsed; - KviStr m_szName; - KviStr m_szDescription; -public: - const char * name(){ return m_szName.ptr(); }; - const char * description(){ return m_szDescription.ptr(); }; - int bits(){ return m_iNumBits; }; - int bitsUsed(){ return m_iNumBitsUsed; }; - const char * version(){ return m_szVersion.ptr(); }; -#ifdef COMPILE_ON_WINDOWS - // On windows we need to override new and delete operators - // to ensure that always the right new/delete pair is called for an object instance - // This bug is present in all the classes exported by a module that - // can be instantiated/destroyed from external modules. - // (this is a well known bug described in Q122675 of MSDN) - void * operator new(size_t tSize); - void operator delete(void * p); -#endif -}; - -#ifdef Success - #undef Success -#endif - - -class KVILIB_API KviSSL -{ -public: - enum Method { Client , Server }; - enum Result { Success , NotInitialized , WantRead , WantWrite , ZeroReturn , FileIoError , - UnknownError , ObscureError , SSLError , SyscallError , RemoteEndClosedConnection }; -public: - KviSSL(); - ~KviSSL(); -public: - SSL * m_pSSL; - SSL_CTX * m_pSSLCtx; - KviStr m_szPass; -public: - static void globalInit(); - static void globalDestroy(); -public: - bool initSocket(kvi_socket_t fd); - bool initContext(KviSSL::Method m); - void shutdown(); - KviSSL::Result connect(); - KviSSL::Result accept(); - int read(char * buffer,int len); - int write(const char * buffer,int len); - // SSL ERRORS - unsigned long getLastError(bool bPeek = false); - bool getLastErrorString(KviStr &buffer,bool bPeek = false); - // Protocol error - KviSSL::Result getProtocolError(int ret); - KviSSLCertificate * getPeerCertificate(); - KviSSLCipherInfo * getCurrentCipherInfo(); - KviSSL::Result useCertificateFile(const char * cert,const char * pass); - KviSSL::Result usePrivateKeyFile(const char * key,const char * pass); -#ifdef COMPILE_ON_WINDOWS - // On windows we need to override new and delete operators - // to ensure that always the right new/delete pair is called for an object instance - // This bug is present in all the classes exported by a module that - // can be instantiated/destroyed from external modules. - // (this is a well known bug described in Q122675 of MSDN) - void * operator new(size_t tSize); - void operator delete(void * p); -#endif -private: - KviSSL::Result connectOrAcceptError(int ret); -}; - - -#endif //COMPILE_SSL_SUPPORT - -#endif //_KVI_SSL_H_ diff --git a/3.4.0/src/kvilib/net/kvi_url.cpp b/3.4.0/src/kvilib/net/kvi_url.cpp deleted file mode 100644 index a6216f254d..0000000000 --- a/3.4.0/src/kvilib/net/kvi_url.cpp +++ /dev/null @@ -1,164 +0,0 @@ -// -// File : kvi_url.cpp -// Creation date : Sat Aug 17 14:09:18 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_url.h" - -KviUrl::KviUrl() -{ -} - -KviUrl::KviUrl(const KviUrl & u) -{ - *this = u; -} - -KviUrl::KviUrl(const char * szUrl) -{ - m_szUrl = szUrl; - parse(); -} - -KviUrl::KviUrl(const QString &szUrl) -{ - m_szUrl = szUrl; - parse(); -} - -KviUrl::~KviUrl() -{ - -} - -void KviUrl::parse() -{ - m_szProtocol = ""; - m_szHost = ""; - m_szPath = ""; - m_szUser = ""; - m_szPass = ""; - - m_szUrl.stripWhiteSpace(); - - KviStr u = m_szUrl; - - // proto - - kvi_u32_t uDefaultPort = 80; - - int i = u.findFirstIdx(":/"); - if(i != -1) - { - // there is a protocol path - m_szProtocol = u.left(i); - u.cutLeft(i + 2); - u.stripLeft('/'); - u.stripWhiteSpace(); - - // fix the default ports - if(kvi_strEqualCI(m_szProtocol,"https"))uDefaultPort = 443; - else if(kvi_strEqualCI(m_szProtocol,"ftp"))uDefaultPort = 21; - } else { - // no proto... assume http - u.stripLeft('/'); - m_szProtocol = "http"; - } - - m_uPort = uDefaultPort; - - // user and pass - - i = u.findFirstIdx('@'); - - if(i != -1) - { - KviStr szUserPass = u.left(i); - szUserPass.stripWhiteSpace(); - u.cutLeft(i + 1); - - i = szUserPass.findFirstIdx(':'); - if(i != -1) - { - m_szUser = szUserPass.left(i); - szUserPass.cutLeft(i + 1); - m_szPass = szUserPass; - m_szPass.stripWhiteSpace(); - } else { - m_szUser = szUserPass; - } - } - - // host - - i = u.findFirstIdx('/'); - if(i != -1) - { - KviStr h = u.left(i); - u.cutLeft(i + 1); - i = h.findFirstIdx(':'); - if(i != -1) - { - // has a port part - m_szHost = h.left(i); - h.cutLeft(i + 1); - h.stripWhiteSpace(); - bool bOk; - m_uPort = h.toUInt(&bOk); - if(!bOk)m_uPort = uDefaultPort; - } else { - // no port : assume default - m_szHost = h; - } - m_szPath = u; - } else { - m_szHost = u; - } - - m_szHost.stripWhiteSpace(); - m_szPath.stripWhiteSpace(); - if(!m_szPath.firstCharIs('/'))m_szPath.prepend('/'); -} - - -KviUrl & KviUrl::operator=(const char * szUrl) -{ - m_szUrl = szUrl; - parse(); - return *this; -} - -KviUrl & KviUrl::operator=(const KviUrl &u) -{ - m_szUrl = u.m_szUrl; - m_szProtocol = u.m_szProtocol; - m_szHost = u.m_szHost; - m_szPath = u.m_szPath; - m_szUser = u.m_szUser; - m_szPass = u.m_szPass; - m_uPort = u.m_uPort; - return *this; -} - - diff --git a/3.4.0/src/kvilib/net/kvi_url.h b/3.4.0/src/kvilib/net/kvi_url.h deleted file mode 100644 index 0aa124a2c8..0000000000 --- a/3.4.0/src/kvilib/net/kvi_url.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef _KVI_URL_H_ -#define _KVI_URL_H_ -// -// File : kvi_url.h -// Creation date : Sat Aug 17 14:09:16 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_string.h" -#include "kvi_heapobject.h" -#include "kvi_inttypes.h" - -class KVILIB_API KviUrl : public KviHeapObject -{ -public: - KviUrl(); - KviUrl(const char * szUrl); - KviUrl(const QString &szUrl); - KviUrl(const KviUrl &u); - ~KviUrl(); -protected: - KviStr m_szUrl; - - KviStr m_szProtocol; - KviStr m_szHost; - KviStr m_szPath; - KviStr m_szUser; - KviStr m_szPass; - kvi_u32_t m_uPort; -protected: - void parse(); -public: - const KviStr & url() const { return m_szUrl; }; - const KviStr & protocol() const { return m_szProtocol; }; - const KviStr & host() const { return m_szHost; }; - const KviStr & path() const { return m_szPath; }; - const KviStr & user() const { return m_szUser; }; - const KviStr & pass() const { return m_szPass; }; - kvi_u32_t port() const { return m_uPort; }; - - KviUrl & operator = (const char * szUrl); - KviUrl & operator = (const KviUrl &u); - -}; - - -#endif //_KVI_URL_H_ diff --git a/3.4.0/src/kvilib/system/.svnignore b/3.4.0/src/kvilib/system/.svnignore deleted file mode 100644 index 1612c03b91..0000000000 --- a/3.4.0/src/kvilib/system/.svnignore +++ /dev/null @@ -1,20 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -*.o -*.lo -*.la -*.so -*.lai -kvirc -symlinks -moc_*.cpp - diff --git a/3.4.0/src/kvilib/system/Makefile.am b/3.4.0/src/kvilib/system/Makefile.am deleted file mode 100644 index c84487eb66..0000000000 --- a/3.4.0/src/kvilib/system/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -EXTRA_DIST = *.cpp *.h diff --git a/3.4.0/src/kvilib/system/kvi_byteorder.h b/3.4.0/src/kvilib/system/kvi_byteorder.h deleted file mode 100644 index 19b07e632d..0000000000 --- a/3.4.0/src/kvilib/system/kvi_byteorder.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef _KVI_BYTEORDER_H_ -#define _KVI_BYTEORDER_H_ - -//============================================================================= -// -// File : kvi_byteorder.h -// Creation date : Mon Dec 25 2006 19:56:16 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_bswap.h" -#include "kvi_inttypes.h" - - -// -// Byte Orders Reminder -// Number 0xaabbccdd -// Little Endian Stores 0xdd 0xcc 0xbb 0xaa -// Big Endian Stores 0xaa 0xbb 0xcc 0xdd -// Perverse Middle Endian 0xbb 0xaa 0xdd 0xcc or another braindamaged combination (unsupported) -// Network Byte Order is Big Endian -// Intel Stuff uses Little Endian -// - -#ifdef BIG_ENDIAN_MACHINE_BYTE_ORDER - #define kvi_localCpuToLittleEndian16(u) kvi_swap16((kvi_u16_t)(u)) - #define kvi_localCpuToLittleEndian32(u) kvi_swap32((kvi_u32_t)(u)) - #define kvi_localCpuToLittleEndian64(u) kvi_swap64((kvi_u64_t)(u)) - #define kvi_littleEndianToLocalCpu16(u) kvi_swap16((kvi_u16_t)(u)) - #define kvi_littleEndianToLocalCpu32(u) kvi_swap32((kvi_u32_t)(u)) - #define kvi_littleEndianToLocalCpu64(u) kvi_swap64((kvi_u64_t)(u)) -#else - // We ASSUME that the local cpu is little endian.. if it isn't.. well :) - #define LOCAL_CPU_LITTLE_ENDIAN - #define kvi_localCpuToLittleEndian16(u) (u) - #define kvi_localCpuToLittleEndian32(u) (u) - #define kvi_localCpuToLittleEndian64(u) (u) - #define kvi_littleEndianToLocalCpu16(u) (u) - #define kvi_littleEndianToLocalCpu32(u) (u) - #define kvi_littleEndianToLocalCpu64(u) (u) -#endif - - -#endif // !_KVI_BYTEORDER_H_ diff --git a/3.4.0/src/kvilib/system/kvi_env.cpp b/3.4.0/src/kvilib/system/kvi_env.cpp deleted file mode 100644 index e7a69a27a4..0000000000 --- a/3.4.0/src/kvilib/system/kvi_env.cpp +++ /dev/null @@ -1,89 +0,0 @@ -//============================================================================= -// -// File : kvi_env.cpp -// Creation date : Sat May 05 2002 02:15:21 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma@kvirc.net) -// -// 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 opinion) 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 __KVILIB__ - -#define _KVI_ENV_CPP_ - -#include "kvi_env.h" -#include "kvi_string.h" -#include "kvi_malloc.h" -#include "kvi_memmove.h" - -#ifndef COMPILE_ON_WINDOWS - -bool kvi_setenv(const char * name,const char * value) -{ -#ifdef HAVE_SETENV - return (setenv(name,value,1) == 0); -#else - #ifdef HAVE_PUTENV - int iLen1 = kvi_strLen(name); - int iLen2 = kvi_strLen(value); - char * buf = (char *)kvi_malloc(iLen1 + iLen2 + 2); - kvi_memmove(buf,name,iLen1); - *(buf + iLen1) = '='; - kvi_memmove(buf + iLen1 + 1,value,iLen2); - *(buf + iLen1 + iLen2 + 1) = '\0'; - int iRet = putenv(buf); - if(iRet != 0) - { - kvi_free(buf); - return false; - } - return true; - #else - // no setenv , no putenv.. what the hell of system is this ? - return false; - #endif -#endif -} - -void kvi_unsetenv(const char * name) -{ -#ifdef HAVE_UNSETENV - unsetenv(name); -#else - #ifdef HAVE_PUTENV - int iLen1 = kvi_strLen(name); - char * buf = (char *)kvi_malloc(iLen1 + 1); - kvi_memmove(buf,name,iLen1); - *(buf + iLen1) = '\0'; - int iRet = putenv(buf); - if(iRet != 0) - { - kvi_free(buf); - } else { - // hmmm - if(kvi_getenv(name) == 0) - { - // ok , the string is not in the environment - // we can free it - kvi_free(buf); - } // else this system sux - } - #endif -#endif -} - -#endif //!COMPILE_ON_WINDOWS diff --git a/3.4.0/src/kvilib/system/kvi_env.h b/3.4.0/src/kvilib/system/kvi_env.h deleted file mode 100644 index d5c9c1d989..0000000000 --- a/3.4.0/src/kvilib/system/kvi_env.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef _KVI_ENV_H_ -#define _KVI_ENV_H_ - -//============================================================================= -// -// File : kvi_env.h -// Creation date : Sat May 05 2002 02:15:21 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma@kvirc.net) -// -// 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 opinion) 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. -// -//============================================================================= - -//============================================================================= -// Enviroinement function wrappers -//============================================================================= - -#include "kvi_settings.h" - - - -#include <stdlib.h> - -inline char * kvi_getenv(const char * name) -{ -#ifdef HAVE_GETENV - return getenv(name); -#else - return 0; -#endif -} - -#ifdef COMPILE_ON_WINDOWS - #define kvi_setenv(__name,__value) SetEnvironmentVariable(__name,__value) - #define kvi_unsetenv(__name) SetEnvironmentVariable(__name,NULL) -#else - #ifndef _KVI_ENV_CPP_ - KVILIB_API extern bool kvi_setenv(const char * name,const char * value); - KVILIB_API extern void kvi_unsetenv(const char * name); - #endif -#endif - - - - -#endif //_KVI_ENV_H_ diff --git a/3.4.0/src/kvilib/system/kvi_library.h b/3.4.0/src/kvilib/system/kvi_library.h deleted file mode 100644 index 3898bd750b..0000000000 --- a/3.4.0/src/kvilib/system/kvi_library.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef _KVI_LIBRARY_H_ -#define _KVI_LIBRARY_H_ - -//===================================================================================== -// -// File : kvi_library.h -// Creation date : Tue Sep 25 16:20:40 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//===================================================================================== - - -//===================================================================================== -// System dynamic linker interface abstraction -//===================================================================================== - - -#include "kvi_settings.h" - - -#ifdef COMPILE_ON_WINDOWS - - //#include <windows.h> - #include <winsock2.h> // this will pull in windows.h - - typedef HMODULE kvi_library_t; - - inline kvi_library_t kvi_library_open(const char * path) - { -#ifndef DEBUG - // this is to avoid the ugly message boxes when the dll has - // ... but do it only in release mode - UINT nOldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS); -#endif - kvi_library_t ret = LoadLibrary(path); -#ifndef DEBUG - SetErrorMode(nOldErrorMode); -#endif - return ret; - }; - - inline void kvi_library_close(kvi_library_t lib) - { - FreeLibrary(lib); - }; - - inline void * kvi_library_symbol(kvi_library_t lib,const char * symName) - { - return GetProcAddress(lib,symName); - }; - - inline const char * kvi_library_error() - { - return "Windoze-like error"; - }; - -#else - - #include <dlfcn.h> - - // sparc-unknown-openbsd3.0 (At least) has only RTLD_LAZY - #ifndef RTLD_NOW - #define RTLD_NOW RTLD_LAZY - #endif - #ifndef RTLD_GLOBAL - #define RTLD_GLOBAL 0 - #endif - - typedef void * kvi_library_t; - - inline kvi_library_t kvi_library_open(const char * path) - { - return dlopen(path,RTLD_GLOBAL | RTLD_NOW); - }; - - inline void kvi_library_close(kvi_library_t lib) - { - dlclose(lib); - }; - - - inline void * kvi_library_symbol(kvi_library_t lib,const char * symName) - { - return dlsym(lib,symName); - }; - - inline const char * kvi_library_error() - { - return dlerror(); - }; - - -#endif //!COMPILE_ON_WINDOWS - - -#define kvi_library_load kvi_library_open -#define kvi_library_unload kvi_library_close - -#endif //_KVI_LIBRARY_H_ diff --git a/3.4.0/src/kvilib/system/kvi_locale.cpp b/3.4.0/src/kvilib/system/kvi_locale.cpp deleted file mode 100644 index e137eb9c1c..0000000000 --- a/3.4.0/src/kvilib/system/kvi_locale.cpp +++ /dev/null @@ -1,1191 +0,0 @@ -//============================================================================= -// -// File : kvi_locale.cpp -// Creation date : Fri Mar 19 1999 19:08:41 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -//#define _KVI_DEBUG_CHECK_RANGE_ -#include "kvi_debug.h" -#include "kvi_malloc.h" -#include "kvi_bswap.h" - -#define _KVI_LOCALE_CPP_ -#include "kvi_locale.h" - -#include <qglobal.h> //for debug() -#include <qtextcodec.h> -#include <qdir.h> - -#ifdef COMPILE_USE_QT4 - #include <qlocale.h> -#endif - -#include "kvi_string.h" -#include "kvi_qcstring.h" -#include "kvi_env.h" -#include "kvi_fileutils.h" -#include "kvi_file.h" - - -KVILIB_API KviMessageCatalogue * g_pMainCatalogue = 0; - -static KviStr g_szLang; -static KviTranslator * g_pTranslator = 0; -static KviPointerHashTable<const char *,KviMessageCatalogue> * g_pCatalogueDict = 0; -static QTextCodec * g_pUtf8TextCodec = 0; - - -///////////////////////////////////////////////////////////////////////////////////////////////////// -// -// The following code was extracted and adapted from gutf8.c -// from the GNU GLIB2 package. -// -// gutf8.c - Operations on UTF-8 strings. -// -// Copyright (C) 1999 Tom Tromey -// Copyright (C) 2000 Red Hat, Inc. -// -// 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 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. -// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -typedef char gchar; -typedef unsigned char guchar; -typedef signed int gssize; -typedef unsigned int gunichar; - - - -#define UNICODE_VALID(Char) \ - ((Char) < 0x110000 && \ - (((Char) & 0xFFFFF800) != 0xD800) && \ - ((Char) < 0xFDD0 || (Char) > 0xFDEF) && \ - ((Char) & 0xFFFE) != 0xFFFE) - -#define CONTINUATION_CHAR \ - if ((*(guchar *)p & 0xc0) != 0x80) /* 10xxxxxx */ \ - goto error; \ - val <<= 6; \ - val |= (*(guchar *)p) & 0x3f; - - -static const char * -fast_validate (const char *str) - -{ - gunichar val = 0; - gunichar min = 0; - const gchar *p; - - for (p = str; *p; p++) - { - if (*(guchar *)p < 128) - /* done */; - else - { - const gchar *last; - - last = p; - if ((*(guchar *)p & 0xe0) == 0xc0) /* 110xxxxx */ - { - if ((*(guchar *)p & 0x1e) == 0) - goto error; - p++; - if ((*(guchar *)p & 0xc0) != 0x80) /* 10xxxxxx */ - goto error; - } - else - { - if ((*(guchar *)p & 0xf0) == 0xe0) /* 1110xxxx */ - { - min = (1 << 11); - val = *(guchar *)p & 0x0f; - goto TWO_REMAINING; - } - else if ((*(guchar *)p & 0xf8) == 0xf0) /* 11110xxx */ - { - min = (1 << 16); - val = *(guchar *)p & 0x07; - } - else - goto error; - - p++; - CONTINUATION_CHAR; - TWO_REMAINING: - p++; - CONTINUATION_CHAR; - p++; - CONTINUATION_CHAR; - - if (val < min) - goto error; - - if (!UNICODE_VALID(val)) - goto error; - } - - continue; - - error: - return last; - } - } - - return p; -} - -static const gchar * -fast_validate_len (const char *str, - gssize max_len) - -{ - gunichar val = 0; - gunichar min = 0; - const gchar *p; - - for (p = str; (max_len < 0 || (p - str) < max_len) && *p; p++) - { - if (*(guchar *)p < 128) - /* done */; - else - { - const gchar *last; - - last = p; - if ((*(guchar *)p & 0xe0) == 0xc0) /* 110xxxxx */ - { - if (max_len >= 0 && max_len - (p - str) < 2) - goto error; - - if ((*(guchar *)p & 0x1e) == 0) - goto error; - p++; - if ((*(guchar *)p & 0xc0) != 0x80) /* 10xxxxxx */ - goto error; - } - else - { - if ((*(guchar *)p & 0xf0) == 0xe0) /* 1110xxxx */ - { - if (max_len >= 0 && max_len - (p - str) < 3) - goto error; - - min = (1 << 11); - val = *(guchar *)p & 0x0f; - goto TWO_REMAINING; - } - else if ((*(guchar *)p & 0xf8) == 0xf0) /* 11110xxx */ - { - if (max_len >= 0 && max_len - (p - str) < 4) - goto error; - - min = (1 << 16); - val = *(guchar *)p & 0x07; - } - else - goto error; - - p++; - CONTINUATION_CHAR; - TWO_REMAINING: - p++; - CONTINUATION_CHAR; - p++; - CONTINUATION_CHAR; - - if (val < min) - goto error; - if (!UNICODE_VALID(val)) - goto error; - } - - continue; - - error: - return last; - } - } - - return p; -} - -static bool g_utf8_validate (const char *str, - gssize max_len, - const gchar **end) - -{ - const gchar *p; - - if (max_len < 0) - p = fast_validate (str); - else - p = fast_validate_len (str, max_len); - - if (end) - *end = p; - - if ((max_len >= 0 && p != str + max_len) || - (max_len < 0 && *p != '\0')) - return false; - else - return true; -} - -/////////////////////////////////////////////////////////////////////////////////////////////// -// End of gutf8.c -/////////////////////////////////////////////////////////////////////////////////////////////// - - -class KviSmartTextCodec : public QTextCodec -{ -protected: - KviQCString m_szName; - QTextCodec * m_pRecvCodec; - QTextCodec * m_pSendCodec; -public: - KviSmartTextCodec(const char * szName,const char * szChildCodecName,bool bSendInUtf8) - : QTextCodec() - { - m_szName = szName; - if(!g_pUtf8TextCodec) - { - g_pUtf8TextCodec = QTextCodec::codecForName("UTF-8"); - if(!g_pUtf8TextCodec) - { - debug("Can't find the global utf8 text codec!"); - g_pUtf8TextCodec = QTextCodec::codecForLocale(); // try anything else... - } - } - m_pRecvCodec = QTextCodec::codecForName(szChildCodecName); - if(!m_pRecvCodec) - { - debug("Can't find the codec for name %s (composite codec creation)",szName); - m_pRecvCodec = g_pUtf8TextCodec; - } - if(bSendInUtf8) - m_pSendCodec = g_pUtf8TextCodec; - else - m_pSendCodec = m_pRecvCodec; - } -public: - bool ok(){ return m_pRecvCodec && g_pUtf8TextCodec; }; - - virtual int mibEnum () const { return 0; }; - -#ifdef COMPILE_USE_QT4 - virtual QByteArray name() const { return m_szName; }; -protected: - virtual QByteArray convertFromUnicode(const QChar * input,int number,ConverterState * state) const - { - return m_pSendCodec->fromUnicode(input,number,state); - } - virtual QString convertToUnicode(const char * chars,int len,ConverterState * state) const - { - if(g_utf8_validate(chars,len,NULL))return g_pUtf8TextCodec->toUnicode(chars,len,state); - return m_pRecvCodec->toUnicode(chars,len,state); - } -#else -public: - virtual const char * mimeName () const { return m_pRecvCodec->mimeName(); }; - virtual const char * name () const { return m_szName.data(); }; - virtual QTextDecoder * makeDecoder () const { return m_pRecvCodec->makeDecoder(); }; - virtual QTextEncoder * makeEncoder () const { return m_pSendCodec->makeEncoder(); }; - QCString fromUnicode (const QString & uc) const { return m_pSendCodec->fromUnicode(uc); }; - virtual QCString fromUnicode (const QString & uc,int & lenInOut) const { return m_pSendCodec->fromUnicode(uc,lenInOut); }; - QString toUnicode(const char * chars) const - { - if(g_utf8_validate(chars,-1,NULL))return g_pUtf8TextCodec->toUnicode(chars); - return m_pRecvCodec->toUnicode(chars); - }; - virtual QString toUnicode(const char * chars,int len) const - { - if(g_utf8_validate(chars,len,NULL))return g_pUtf8TextCodec->toUnicode(chars,len); - return m_pRecvCodec->toUnicode(chars,len); - }; - QString toUnicode(const QByteArray & a,int len) const - { - if(g_utf8_validate(a.data(),len,NULL))return g_pUtf8TextCodec->toUnicode(a,len); - return m_pRecvCodec->toUnicode(a,len); - }; - QString toUnicode(const QByteArray & a) const - { - if(g_utf8_validate(a.data(),a.size(),NULL))return g_pUtf8TextCodec->toUnicode(a); - return m_pRecvCodec->toUnicode(a); - }; - QString toUnicode(const QCString & a,int len) const - { - if(g_utf8_validate(a.data(),len,NULL))return g_pUtf8TextCodec->toUnicode(a,len); - return m_pRecvCodec->toUnicode(a,len); - }; - QString toUnicode(const QCString & a) const - { - if(g_utf8_validate(a.data(),-1,NULL))return g_pUtf8TextCodec->toUnicode(a); - return m_pRecvCodec->toUnicode(a); - }; - - virtual bool canEncode(QChar ch) const { return m_pSendCodec->canEncode(ch); }; - virtual bool canEncode(const QString &s) const { return m_pSendCodec->canEncode(s); }; - virtual int heuristicContentMatch(const char * chars,int len) const - { - int iii = g_pUtf8TextCodec->heuristicContentMatch(chars,len); - if(iii < 0)return m_pRecvCodec->heuristicContentMatch(chars,len); - return iii; - } - virtual int heuristicNameMatch(const char * hint) const { return 0; }; -#endif -}; - -static KviPointerHashTable<const char *,KviSmartTextCodec> * g_pSmartCodecDict = 0; - - - -///////////////////////////////////////////////////////////////////////////////////////////////////// -// -// The following code was extracted and adapted from gettext.h and gettextP.h -// from the GNU gettext package. -// -// Internal header for GNU gettext internationalization functions. -// Copyright (C) 1995, 1997 Free Software Foundation, Inc. -// -// 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, 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 Library General Public -// License along with the GNU C Library; see the file COPYING.LIB. If not, -// write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -// Boston, MA 02111-1307, USA. -// -///////////////////////////////////////////////////////////////////////////////////////////////////// - -#include <stdio.h> - -#if HAVE_LIMITS_H || _LIBC - #include <limits.h> -#endif - -// The magic number of the GNU message catalog format. -#define KVI_LOCALE_MAGIC 0x950412de -#define KVI_LOCALE_MAGIC_SWAPPED 0xde120495 - -// Revision number of the currently used .mo (binary) file format. -#define MO_REVISION_NUMBER 0 - - -// Header for binary .mo file format. -struct GnuMoFileHeader -{ - // The magic number. - kvi_u32_t magic; - // The revision number of the file format. - kvi_u32_t revision; - // The number of strings pairs. - kvi_u32_t nstrings; - // Offset of table with start offsets of original strings. - kvi_u32_t orig_tab_offset; - // Offset of table with start offsets of translation strings. - kvi_u32_t trans_tab_offset; - // Size of hashing table. - kvi_u32_t hash_tab_size; - // Offset of first hashing entry. - kvi_u32_t hash_tab_offset; -}; - -struct GnuMoStringDescriptor -{ - // Length of addressed string. - kvi_u32_t length; - // Offset of string in file. - kvi_u32_t offset; -}; - -#define KVI_SWAP_IF_NEEDED(flag,value) (flag ? kvi_swap32(value) : (value)) - -/////////////////////////////////////////////////////////////////////////////////////////////// -// End of gettext.h & gettextP.h -/////////////////////////////////////////////////////////////////////////////////////////////// - - -// HELPERS - -static int somePrimeNumbers[90]= -{ - 257 , 521 , 769 , 1031, 1087, 1091, 1103, 1117, 1123, 1151, // Incomplete *.mo files - 1163, 1171, 1181, 1193, 1201, 1213, 1217, 1223, 1229, 1231, // Complete *.mo files - 1237, 1249, 1259, 1277, 1283, 1289, 1291, 1297, 1307, 1319, - 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1433, - 1447, 1459, 1471, 1481, 1493, 1511, 1523, 1531, 1543, 1553, - 1567, 1571, 1583, 1597, 1609, 1619, 1627, 1637, 1657, 1667, // Too big for KVIrc *.mo files - 1693, 1709, 1721, 1733, 1741, 1753, 1777, 1789, 1811, 1831, - 1907, 2069, 2111, 2221, 2309, 2441, 2531, 2617, 2731, 2837, - 2903, 3121, 3329, 3331, 3767, 4127, 5051, 6089, 7039, 9973 -}; - -int kvi_getFirstBiggerPrime(int number) -{ - for(int i=0;i<90;i++){ - if(somePrimeNumbers[i] >= number)return somePrimeNumbers[i]; - } - return 9973; //error! -} - - -KviMessageCatalogue::KviMessageCatalogue() -{ - //m_uEncoding = 0; - m_pTextCodec = QTextCodec::codecForLocale(); - - //m_pMessages = new KviPointerHashTable<const char *,KviTranslationEntry>(1123,true,false); // dictSize, case sensitive , don't copy keys - m_pMessages = new KviPointerHashTable<const char *,KviTranslationEntry>(32,true,false); // dictSize, case sensitive , don't copy keys - m_pMessages->setAutoDelete(true); -} - -KviMessageCatalogue::~KviMessageCatalogue() -{ - if(m_pMessages) - delete m_pMessages; -} - -bool KviMessageCatalogue::load(const QString& name) -{ - QString szCatalogueFile(name); - - // Try to load the header - KviFile f(szCatalogueFile); - if(!f.openForReading()) - { - debug("[KviLocale]: Failed to open the messages file %s: probably doesn't exist",KviQString::toUtf8(szCatalogueFile).data()); - return false; - } - - GnuMoFileHeader hdr; - - if(f.readBlock((char *)&hdr,sizeof(GnuMoFileHeader)) < (int)sizeof(GnuMoFileHeader)) - { - debug("KviLocale: Failed to read header of %s",KviQString::toUtf8(szCatalogueFile).data()); - f.close(); - return false; - } - - bool bMustSwap = false; - - if(hdr.magic != KVI_LOCALE_MAGIC) - { - if(hdr.magic == KVI_LOCALE_MAGIC_SWAPPED) - { - debug("KviLocale: Swapped magic for file %s: swapping data too",KviQString::toUtf8(szCatalogueFile).data()); - bMustSwap = true; - } else { - debug("KviLocale: Bad locale magic for file %s: not a *.mo file ?",KviQString::toUtf8(szCatalogueFile).data()); - f.close(); - return false; - } - } - - if(KVI_SWAP_IF_NEEDED(bMustSwap,hdr.revision) != MO_REVISION_NUMBER) - { - debug("KviLocale: Invalid *.mo file revision number for file %s",KviQString::toUtf8(szCatalogueFile).data()); - f.close(); - return false; - } - - int numberOfStrings = KVI_SWAP_IF_NEEDED(bMustSwap,hdr.nstrings); - - if(numberOfStrings <= 0) - { - debug("KviLocale: No translated messages found in file %s",KviQString::toUtf8(szCatalogueFile).data()); - f.close(); - return false; - } - - if(numberOfStrings >= 9972) - { - debug("Number of strings too big...sure that it is a KVIrc catalog file ?"); - numberOfStrings = 9972; - } - - // return back - f.seek(0); - - unsigned int fSize = f.size(); - char * buffer = (char *)kvi_malloc(fSize); - - // FIXME: maybe read it in blocks eh ? - if(f.readBlock(buffer,fSize) < (int)fSize) - { - debug("KviLocale: Error while reading the translation file %s",KviQString::toUtf8(szCatalogueFile).data()); - kvi_free(buffer); - f.close(); - return false; - } - - // Check for broken *.mo files - if(fSize < (24 + (sizeof(GnuMoStringDescriptor) * numberOfStrings))) - { - debug("KviLocale: Broken translation file %s (too small for all descriptors)",KviQString::toUtf8(szCatalogueFile).data()); - kvi_free(buffer); - f.close(); - return false; - } - - GnuMoStringDescriptor * origDescriptor = (GnuMoStringDescriptor *)(buffer + KVI_SWAP_IF_NEEDED(bMustSwap,hdr.orig_tab_offset)); - GnuMoStringDescriptor * transDescriptor = (GnuMoStringDescriptor *)(buffer + KVI_SWAP_IF_NEEDED(bMustSwap,hdr.trans_tab_offset)); - - // Check again for broken *.mo files - int expectedFileSize = KVI_SWAP_IF_NEEDED(bMustSwap,transDescriptor[numberOfStrings - 1].offset) + - KVI_SWAP_IF_NEEDED(bMustSwap,transDescriptor[numberOfStrings - 1].length); - - if(fSize < (unsigned int)expectedFileSize) - { - debug("KviLocale: Broken translation file %s (too small for all the message strings)",KviQString::toUtf8(szCatalogueFile).data()); - kvi_free(buffer); - f.close(); - return false; - } - - // Ok...we can run now - - int dictSize = kvi_getFirstBiggerPrime(numberOfStrings); - if(m_pMessages) - delete m_pMessages; - m_pMessages = new KviPointerHashTable<const char *,KviTranslationEntry>(dictSize,true,false); // dictSize, case sensitive , don't copy keys - m_pMessages->setAutoDelete(true); - - KviStr szHeader; - - for(int i=0;i < numberOfStrings;i++) - { - // FIXME: "Check for NULL inside strings here ?" - //debug("original seems to be at %u and %u byttes long",KVI_SWAP_IF_NEEDED(bMustSwap,origDescriptor[i].offset), - // KVI_SWAP_IF_NEEDED(bMustSwap,origDescriptor[i].length)); - //debug("translated seems to be at %u and %u byttes long",KVI_SWAP_IF_NEEDED(bMustSwap,transDescriptor[i].offset), - // KVI_SWAP_IF_NEEDED(bMustSwap,transDescriptor[i].length)); - - KviTranslationEntry * e = new KviTranslationEntry( - (char *)(buffer + KVI_SWAP_IF_NEEDED(bMustSwap,origDescriptor[i].offset)), - KVI_SWAP_IF_NEEDED(bMustSwap,origDescriptor[i].length), - (char *)(buffer + KVI_SWAP_IF_NEEDED(bMustSwap,transDescriptor[i].offset)), - KVI_SWAP_IF_NEEDED(bMustSwap,transDescriptor[i].length)); - - // In some (or all?) *.mo files the first string - // is zero bytes long and the translated one contains - // informations about the translation - if(e->m_szKey.len() == 0) - { - szHeader = e->m_szEncodedTranslation; - delete e; - continue; - } - - m_pMessages->insert(e->m_szKey.ptr(),e); - } - - kvi_free(buffer); - f.close(); - - m_pTextCodec = 0; - - // find out the text encoding , if possible - if(szHeader.hasData()) - { - // find "charset=*\n" - int idx = szHeader.findFirstIdx("charset="); - if(idx != -1) - { - szHeader.cutLeft(idx + 8); - szHeader.cutFromFirst('\n'); - szHeader.stripWhiteSpace(); - m_pTextCodec = KviLocale::codecForName(szHeader.ptr()); - if(!m_pTextCodec) - { - debug("Can't find the codec for charset=%s",szHeader.ptr()); - debug("Falling back to codecForLocale()"); - m_pTextCodec = QTextCodec::codecForLocale(); - } - } - } - - if(!m_pTextCodec) - { - debug("The message catalogue does not have a \"charset\" header"); - debug("Assuming utf8"); // FIXME: or codecForLocale() ? - m_pTextCodec = QTextCodec::codecForName("UTF-8"); - } - - return true; -} - -const char * KviMessageCatalogue::translate(const char *text) -{ - KviTranslationEntry * aux = m_pMessages->find(text); - if(aux)return aux->m_szEncodedTranslation.ptr(); - return text; -} - -const QString & KviMessageCatalogue::translateToQString(const char *text) -{ - KviTranslationEntry * aux = m_pMessages->find(text); - if(aux) - { - if(aux->m_pQTranslation)return *(aux->m_pQTranslation); - aux->m_pQTranslation = new QString(m_pTextCodec->toUnicode(aux->m_szEncodedTranslation.ptr())); - return *(aux->m_pQTranslation); - } - // no translation is available: let's avoid continous string decoding - aux = new KviTranslationEntry(text); - m_pMessages->insert(aux->m_szKey.ptr(),aux); - aux->m_pQTranslation = new QString(m_pTextCodec->toUnicode(aux->m_szEncodedTranslation.ptr())); - return *(aux->m_pQTranslation); -} - - - - -namespace KviLocale -{ -#ifndef QT_NO_BIG_CODECS - #define NUM_ENCODINGS 109 -#else - #define NUM_ENCODINGS 85 -#endif - - - - static EncodingDescription supported_encodings[]= - { - { "UTF-8" , 0 , 0 , "8-bit Unicode" }, - { "ISO-8859-1" , 0 , 0 , "Western, Latin-1" }, - { "ISO-8859-2" , 0 , 0 , "Central European 1" }, - { "ISO-8859-3" , 0 , 0 , "Central European 2" }, - { "ISO-8859-4" , 0 , 0 , "Baltic, Standard" }, - { "ISO-8859-5" , 0 , 0 , "Cyrillic, ISO" }, - { "ISO-8859-6" , 0 , 0 , "Arabic, Standard" }, - { "ISO-8859-7" , 0 , 0 , "Greek" }, - { "ISO-8859-8" , 0 , 0 , "Hebrew, visually ordered" }, - { "ISO-8859-8-i" , 0 , 0 , "Hebrew, logically ordered" }, - { "ISO-8859-9" , 0 , 0 , "Turkish, Latin-5" }, - { "ISO-8859-15" , 0 , 0 , "Western, Latin-1 + Euro" }, - { "KOI8-R" , 0 , 0 , "Cyrillic, KOI" }, - { "KOI8-U" , 0 , 0 , "Ukrainian" }, - { "CP-1250" , 0 , 0 , "Central European 3" }, - { "CP-1251" , 0 , 0 , "Cyrillic, Windows" }, - { "CP-1252" , 0 , 0 , "Western, CP" }, - { "CP-1253" , 0 , 0 , "Greek, CP" }, - { "CP-1256" , 0 , 0 , "Arabic, CP" }, - { "CP-1257" , 0 , 0 , "Baltic, CP" }, - { "CP-1255" , 0 , 0 , "Hebrew, CP" }, - { "CP-1254" , 0 , 0 , "Turkish, CP" }, - { "TIS-620" , 0 , 0 , "Thai" }, -#ifndef QT_NO_BIG_CODECS - { "Big5" , 0 , 0 , "Chinese Traditional" }, - { "Big5-HKSCS" , 0 , 0 , "Chinese Traditional, Hong Kong" }, - { "GB18030" , 0 , 0 , "Chinese Simplified" }, - { "JIS7" , 0 , 0 , "Japanese (JIS7)" }, - { "Shift-JIS" , 0 , 0 , "Japanese (Shift-JIS)" }, - { "EUC-JP" , 0 , 0 , "Japanese (EUC-JP)" }, - { "EUC-KR" , 0 , 0 , "Korean" }, - { "TSCII" , 0 , 0 , "Tamil" }, -#endif - { "ISO-8859-10" , 0 , 0 , "ISO-8859-10" }, - { "ISO-8859-13" , 0 , 0 , "ISO-8859-13" }, - { "ISO-8859-14" , 0 , 0 , "ISO-8859-14" }, - { "IBM-850" , 0 , 0 , "IBM-850" }, - { "IBM-866" , 0 , 0 , "IBM-866" }, - { "CP874" , 0 , 0 , "CP874" }, - - // smart codecs that send in the local charset - { "ISO-8859-1 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Western Latin-1, O: Western Latin-1" }, - { "ISO-8859-2 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Central European 1, O: Central European 1" }, - { "ISO-8859-3 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Central European 2, O: Central European 2" }, - { "ISO-8859-4 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Baltic, Standard, O: Baltic, Standard" }, - { "ISO-8859-5 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Cyrillic, ISO, O: Cyrillic, ISO" }, - { "ISO-8859-6 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Arabic, Standard, O: Arabic, Standard" }, - { "ISO-8859-7 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Greek, O: Greek" }, - { "ISO-8859-8 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Hebrew, visually ordered, O: Hebrew, visually ordered" }, - { "ISO-8859-8-i [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Hebrew, logically ordered, O: Hebrew, logically ordered" }, - { "ISO-8859-9 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Turkish, Latin-5, O: Turkish, Latin-5" }, - { "ISO-8859-15 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Western, Latin-1 + Euro, O: Western, Latin-1 + Euro" }, - { "KOI8-R [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Cyrillic, KOI, O: Cyrillic, KOI" }, - { "KOI8-U [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Ukrainian, O: Ukrainian" }, - { "CP-1250 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Central European 3, O: Central European 3" }, - { "CP-1251 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Cyrillic, Windows, O: Cyrillic, Windows" }, - { "CP-1252 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Western, CP, O: Western, CP" }, - { "CP-1253 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Greek, CP, O: Greek, CP" }, - { "CP-1256 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Arabic, CP, O: Arabic, CP" }, - { "CP-1257 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Baltic, CP, O: Baltic, CP" }, - { "CP-1255 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Hebrew, CP, O: Hebrew, CP" }, - { "CP-1254 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Turkish, CP, O: Turkish, CP" }, - { "TIS-620 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Thai, O: Thai" }, -#ifndef QT_NO_BIG_CODECS - { "Big5 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Chinese Traditional, O: Chinese Traditional" }, - { "Big5-HKSCS [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Chinese Traditional, Hong Kong, O: Chinese Traditional, Hong Kong" }, - { "GB18030 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Chinese Simplified, O: Chinese Simplified" }, - { "JIS7 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Japanese (JIS7), O: Japanese " }, - { "Shift-JIS [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Japanese (Shift-JIS), O: Japanese (Shift-JIS)" }, - { "EUC-JP [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Japanese (EUC-JP), O: Japanese (EUC-JP)" }, - { "EUC-KR [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Korean, O: Korean" }, - { "TSCII [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / Tamil, O: Tamil" }, -#endif - { "ISO-8859-10 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / ISO-8859-10, O: ISO-8859-10" }, - { "ISO-8859-13 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / ISO-8859-13, O: ISO-8859-13" }, - { "ISO-8859-14 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / ISO-8859-14, O: ISO-8859-14" }, - { "IBM-850 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / IBM-850, O: IBM-850" }, - { "IBM-866 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / IBM-866, O: IBM-866" }, - { "CP874 [UTF-8]" , 1 , 0 , "I: 8-bit Unicode / CP874, O: CP874" }, - - // smart codecs that send in utf8 - { "UTF-8 [ISO-8859-1]" , 1 , 1 , "I: 8-bit Unicode / Western Latin-1, O: 8-bit Unicode" }, - { "UTF-8 [ISO-8859-2]" , 1 , 1 , "I: 8-bit Unicode / Central European 1, O: 8-bit Unicode" }, - { "UTF-8 [ISO-8859-3]" , 1 , 1 , "I: 8-bit Unicode / Central European 2, O: 8-bit Unicode" }, - { "UTF-8 [ISO-8859-4]" , 1 , 1 , "I: 8-bit Unicode / Baltic, Standard, O: 8-bit Unicode" }, - - { "UTF-8 [ISO-8859-5]" , 1 , 1 , "I: 8-bit Unicode / Cyrillic, ISO, O: 8-bit Unicode" }, - { "UTF-8 [ISO-8859-6]" , 1 , 1 , "I: 8-bit Unicode / Arabic, Standard, O: 8-bit Unicode" }, - { "UTF-8 [ISO-8859-7]" , 1 , 1 , "I: 8-bit Unicode / Greek, O: 8-bit Unicode" }, - { "UTF-8 [ISO-8859-8]" , 1 , 1 , "I: 8-bit Unicode / Hebrew, visually ordered, O: 8-bit Unicode" }, - - { "UTF-8 [ISO-8859-8-i]" , 1 , 1 , "I: 8-bit Unicode / Hebrew, logically ordered, O: 8-bit Unicode" }, - { "UTF-8 [ISO-8859-9]" , 1 , 1 , "I: 8-bit Unicode / Turkish, Latin-5, O: 8-bit Unicode" }, - { "UTF-8 [ISO-8859-15]" , 1 , 1 , "I: 8-bit Unicode / Western, Latin-1 + Euro, O: 8-bit Unicode" }, - { "UTF-8 [KOI8-R]" , 1 , 1 , "I: 8-bit Unicode / Cyrillic, KOI, O: 8-bit Unicode" }, - - { "UTF-8 [KOI8-U]" , 1 , 1 , "I: 8-bit Unicode / Ukrainian, O: 8-bit Unicode" }, - { "UTF-8 [CP-1250]" , 1 , 1 , "I: 8-bit Unicode / Central European 3, O: 8-bit Unicode" }, - { "UTF-8 [CP-1251]" , 1 , 1 , "I: 8-bit Unicode / Cyrillic, Windows, O: 8-bit Unicode" }, - { "UTF-8 [CP-1252]" , 1 , 1 , "I: 8-bit Unicode / Western, CP, O: 8-bit Unicode" }, - - { "UTF-8 [CP-1253]" , 1 , 1 , "I: 8-bit Unicode / Greek, CP, O: 8-bit Unicode" }, - { "UTF-8 [CP-1256]" , 1 , 1 , "I: 8-bit Unicode / Arabic, CP, O: 8-bit Unicode" }, - { "UTF-8 [CP-1257]" , 1 , 1 , "I: 8-bit Unicode / Baltic, CP, O: 8-bit Unicode" }, - { "UTF-8 [CP-1255]" , 1 , 1 , "I: 8-bit Unicode / Hebrew, CP, O: 8-bit Unicode" }, - - { "UTF-8 [CP-1254]" , 1 , 1 , "I: 8-bit Unicode / Turkish, CP, O: 8-bit Unicode" }, - { "UTF-8 [TIS-620]" , 1 , 1 , "I: 8-bit Unicode / Thai, O: 8-bit Unicode" }, -#ifndef QT_NO_BIG_CODECS - { "UTF-8 [Big5]" , 1 , 1 , "I: 8-bit Unicode / Chinese Traditional, O: 8-bit Unicode" }, - { "UTF-8 [Big5-HKSCS]" , 1 , 1 , "I: 8-bit Unicode / Chinese Traditional, Hong Kong, O: 8-bit Unicode" }, - - { "UTF-8 [GB18030]" , 1 , 1 , "I: 8-bit Unicode / Chinese Simplified, O: 8-bit Unicode" }, - { "UTF-8 [JIS7]" , 1 , 1 , "I: 8-bit Unicode / Japanese (JIS7), O: 8-bit Unicode" }, - { "UTF-8 [Shift-JIS]" , 1 , 1 , "I: 8-bit Unicode / Japanese (Shift-JIS), O: Japanese (Shift-JIS)" }, - { "UTF-8 [EUC-JP]" , 1 , 1 , "I: 8-bit Unicode / Japanese (EUC-JP), O: Japanese (EUC-JP)" }, - - { "UTF-8 [EUC-KR]" , 1 , 1 , "I: 8-bit Unicode / Korean, O: 8-bit Unicode" }, - { "UTF-8 [TSCII]" , 1 , 1 , "I: 8-bit Unicode / Tamil, O: 8-bit Unicode" }, -#endif - { "UTF-8 [ISO-8859-10]" , 1 , 1 , "I: 8-bit Unicode / ISO-8859-10, O: 8-bit Unicode" }, - { "UTF-8 [ISO-8859-13]" , 1 , 1 , "I: 8-bit Unicode / ISO-8859-13, O: 8-bit Unicode" }, - - { "UTF-8 [ISO-8859-14]" , 1 , 1 , "I: 8-bit Unicode / ISO-8859-14, O: 8-bit Unicode" }, - { "UTF-8 [IBM-850]" , 1 , 1 , "I: 8-bit Unicode / IBM-850, O: 8-bit Unicode" }, - { "UTF-8 [IBM-866]" , 1 , 1 , "I: 8-bit Unicode / IBM-866, O: 8-bit Unicode" }, - { "UTF-8 [CP874]" , 1 , 1 , "I: 8-bit Unicode / CP874, O: 8-bit Unicode" }, - - { 0 , 0 , 0 , 0 } - }; - - EncodingDescription * encodingDescription(int iIdx) - { - if(iIdx > NUM_ENCODINGS)return &(supported_encodings[NUM_ENCODINGS]); - return &(supported_encodings[iIdx]); - } - - QTextCodec * codecForName(const char * szName) - { - KviStr szTmp = szName; - int idx = szTmp.findFirstIdx('['); - if(idx != -1) - { - // composite codec: either UTF-8 [child codec] or child codec [UTF-8] - KviSmartTextCodec * c = g_pSmartCodecDict->find(szName); - if(c)return c; - - - if(kvi_strEqualCIN("UTF-8 [",szName,7)) - { - szTmp.replaceAll("UTF-8 [",""); - szTmp.replaceAll("]",""); - // smart codec that sends UTF-8 - c = new KviSmartTextCodec(szName,szTmp.ptr(),true); - } else { - szTmp.cutFromFirst(' '); - // smart codec that sends child encoding - c = new KviSmartTextCodec(szName,szTmp.ptr(),false); - } - if(c->ok()) - { - g_pSmartCodecDict->replace(szName,c); - return c; - } else { - delete c; - } - } - return QTextCodec::codecForName(szName); - } - - const KviStr & localeName() - { - return g_szLang; - } - - bool loadCatalogue(const QString &name,const QString &szLocaleDir) - { - //debug("Looking up catalogue %s",name); - if(g_pCatalogueDict->find(KviQString::toUtf8(name).data()))return true; // already loaded - - QString szBuffer; - - if(findCatalogue(szBuffer,name,szLocaleDir)) - { - KviMessageCatalogue * c = new KviMessageCatalogue(); - if(c->load(szBuffer)) - { - //debug("KviLocale: loaded catalogue %s",name); - g_pCatalogueDict->insert(KviQString::toUtf8(name).data(),c); - return true; - } - } - return false; - } - - bool unloadCatalogue(const QString &name) - { - //debug("Unloading catalogue : %s",name); - return g_pCatalogueDict->remove(KviQString::toUtf8(name).data()); - } - - bool findCatalogue(QString &szBuffer,const QString& name,const QString& szLocaleDir) - { - KviStr szLocale = g_szLang; - - QString szLocDir = szLocaleDir; - KviQString::ensureLastCharIs(szLocDir,KVI_PATH_SEPARATOR_CHAR); - - KviQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr()); - - if(KviFileUtils::fileExists(szBuffer))return true; - - if(szLocale.findFirstIdx('.') != -1) - { - // things like en_GB.utf8 - // kill them - szLocale.cutFromFirst('.'); - - KviQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr()); - if(KviFileUtils::fileExists(szBuffer))return true; - } - - if(szLocale.findFirstIdx('@') != -1) - { - // things like @euro ? - // kill them - szLocale.cutFromFirst('@'); - KviQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr()); - if(KviFileUtils::fileExists(szBuffer))return true; - } - - if(szLocale.findFirstIdx('_') != -1) - { - // things like en_GB - // kill them - szLocale.cutFromFirst('_'); - KviQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr()); - if(KviFileUtils::fileExists(szBuffer))return true; - } - - // try the lower case version too - szLocale.toLower(); - KviQString::sprintf(szBuffer,"%Q%Q_%s.mo",&szLocDir,&name,szLocale.ptr()); - if(KviFileUtils::fileExists(szBuffer))return true; - - return false; - } - - // - // This function attempts to determine the current locale - // and then load the corresponding translation file - // from the KVIrc locale directory - // Returns true if the locale was correctly set - // i.e. the locale is C or POSIX (no translation needed) - // or the locale is correctly defined and the - // translation map was sucesfully loaded - // - - void init(QApplication * app,const QString &localeDir) - { - // first of all try to find out the current locale - g_szLang=""; -#ifdef COMPILE_USE_QT4 - QString szLangFile=QString("%1/.kvirc_force_locale").arg(QDir::homePath()); -#else - QString szLangFile=QString("%1/.kvirc_force_locale").arg(QDir::homeDirPath()); -#endif - if(KviFileUtils::fileExists(szLangFile)) - { - QString szTmp; - KviFileUtils::readFile(szLangFile,szTmp); - g_szLang=szTmp; - } - if(g_szLang.isEmpty())g_szLang = kvi_getenv("KVIRC_LANG"); -#ifdef COMPILE_USE_QT4 - if(g_szLang.isEmpty())g_szLang = QLocale::system().name(); -#else - if(g_szLang.isEmpty())g_szLang = QTextCodec::locale(); -#endif - if(g_szLang.isEmpty())g_szLang = kvi_getenv("LC_MESSAGES"); - if(g_szLang.isEmpty())g_szLang = kvi_getenv("LANG"); - if(g_szLang.isEmpty())g_szLang = "en"; - g_szLang.stripWhiteSpace(); - - // the main catalogue is supposed to be kvirc_<language>.mo - g_pMainCatalogue = new KviMessageCatalogue(); - // the catalogue dict - g_pCatalogueDict = new KviPointerHashTable<const char *,KviMessageCatalogue>; - g_pCatalogueDict->setAutoDelete(true); - - // the smart codec dict - g_pSmartCodecDict = new KviPointerHashTable<const char *,KviSmartTextCodec>; - // the Qt docs explicitly state that we shouldn't delete - // the codecs by ourselves... - g_pSmartCodecDict->setAutoDelete(false); - - if(g_szLang.hasData()) - { - QString szBuffer; - if(findCatalogue(szBuffer,"kvirc",localeDir)) - { - g_pMainCatalogue->load(szBuffer); - g_pTranslator = new KviTranslator(app,"kvirc_translator"); - app->installTranslator(g_pTranslator); - } else { - KviStr szTmp = g_szLang; - szTmp.cutFromFirst('.'); - szTmp.cutFromFirst('_'); - szTmp.cutFromFirst('@'); - szTmp.toLower(); - if(!(kvi_strEqualCI(szTmp.ptr(),"en") || - kvi_strEqualCI(szTmp.ptr(),"c") || - kvi_strEqualCI(szTmp.ptr(),"us") || - kvi_strEqualCI(szTmp.ptr(),"gb") || - kvi_strEqualCI(szTmp.ptr(),"posix"))) - { - // FIXME: THIS IS NO LONGER VALID!!! - debug("Can't find the catalogue for locale \"%s\" (%s)",g_szLang.ptr(),szTmp.ptr()); - debug("There is no such translation or the $LANG variable was incorrectly set"); - debug("You can use $KVIRC_LANG to override the catalogue name"); - debug("For example you can set KVIRC_LANG to it_IT to force usage of the it.mo catalogue"); - } - } - } - - //g_pTextCodec = QTextCodec::codecForLocale(); - //if(!g_pTextCodec)g_pTextCodec = QTextCodec::codecForLocale(); - } - - void done(QApplication * app) - { - delete g_pMainCatalogue; - delete g_pCatalogueDict; - delete g_pSmartCodecDict; - g_pMainCatalogue = 0; - g_pCatalogueDict = 0; - g_pSmartCodecDict = 0; - if(g_pTranslator) - { - app->removeTranslator(g_pTranslator); - delete g_pTranslator; - g_pTranslator = 0; - } - } - - KviMessageCatalogue * getLoadedCatalogue(const QString& name) - { - return g_pCatalogueDict->find(KviQString::toUtf8(name).data()); - } - - - const char * translate(const char * text,const char * context) - { - if(context) - { - KviMessageCatalogue * c = g_pCatalogueDict->find(context); - if(!c) - { - // FIXME: Should really try to load the catalogue here! - c = new KviMessageCatalogue(); - g_pCatalogueDict->insert(context,c); - } - return c->translate(text); - } - return g_pMainCatalogue->translate(text); - } - - const QString & translateToQString(const char * text,const char * context) - { - if(context) - { - KviMessageCatalogue * c = g_pCatalogueDict->find(context); - if(!c) - { - // FIXME: Should really try to load the catalogue here! - c = new KviMessageCatalogue(); - g_pCatalogueDict->insert(context,c); - } - return c->translateToQString(text); - } - return g_pMainCatalogue->translateToQString(text); - } -}; - -KviTranslator::KviTranslator(QObject * par,const char * nam) -#ifdef COMPILE_USE_QT4 -: QTranslator(par) -#else -: QTranslator(par,nam) -#endif -{ -} - -KviTranslator::~KviTranslator() -{ -} - -#ifdef COMPILE_USE_QT4 -QString KviTranslator::translate(const char *context,const char * message,const char * comment) const -{ - // we ignore contexts and comments for qt translations - return g_pMainCatalogue->translateToQString(message); -} -#endif - -QString KviTranslator::find(const char *context,const char * message) const -{ - // we ignore contexts for qt translations - return g_pMainCatalogue->translateToQString(message); -} - -#ifndef COMPILE_USE_QT4 -QTranslatorMessage KviTranslator::findMessage(const char * context,const char * sourceText,const char * comment) const -{ - // we ignore contexts for qt translations - return QTranslatorMessage(context,sourceText,comment,g_pMainCatalogue->translateToQString(sourceText)); -} -#endif - -#if 0 - -// a fake table that will force these translations -// to be included in the *.pot file - -static QString fake_translations_table[]= -{ - // global - __tr2qs("OK"), - __tr2qs("Cancel"), - // color dialog - __tr2qs("Select color"), - __tr2qs("&Basic colors"), - __tr2qs("&Custom colors"), - __tr2qs("&Red"), - __tr2qs("&Green"), - __tr2qs("Bl&ue"), - __tr2qs("&Define Custom Colors >>"), - __tr2qs("&Add to Custom Colors"), - // font dialog - __tr2qs("Select Font"), - __tr2qs("&Font"), - __tr2qs("Font st&yle"), - __tr2qs("&Size"), - __tr2qs("Sample"), - __tr2qs("Effects"), - __tr2qs("Stri&keout"), - __tr2qs("&Underline"), - __tr2qs("Scr&ipt"), - //File selector - __tr2qs("Parent Directory"), - __tr2qs("Back"), - __tr2qs("Forward"), - __tr2qs("Reload"), - __tr2qs("New Directory"), - __tr2qs("Bookmarks"), - __tr2qs("Add Bookmark"), - __tr2qs("&Edit Bookmarks"), - __tr2qs("New Bookmark Folder..."), - __tr2qs("Configure"), - __tr2qs("Sorting"), - __tr2qs("By Name"), - __tr2qs("By Date"), - __tr2qs("By Size"), - __tr2qs("Reverse"), - __tr2qs("Directories First"), - __tr2qs("Case Insensitive"), - __tr2qs("Short View"), - __tr2qs("Detailed View"), - __tr2qs("Show Hidden Files"), - __tr2qs("Show Quick Access Navigation Panel"), - __tr2qs("Show Preview"), - __tr2qs("Separate Directories"), - __tr2qs("Often used directories"), - __tr2qs("Desktop"), - __tr2qs("Home Directory"), - __tr2qs("Floppy"), - __tr2qs("Temporary Files"), - __tr2qs("Network"), - __tr2qs("New Directory..."), - __tr2qs("Delete"), - __tr2qs("Thumbnail Previews"), - __tr2qs("Large Icons"), - __tr2qs("Small Icons"), - __tr2qs("Properties..."), - __tr2qs("&Automatic Preview"), - __tr2qs("&Preview"), - __tr2qs("&Location:"), - __tr2qs("&Filter:"), - __tr2qs("All Files"), - __tr2qs("&OK"), - __tr2qs("&Cancel") - -} - -#endif diff --git a/3.4.0/src/kvilib/system/kvi_locale.h b/3.4.0/src/kvilib/system/kvi_locale.h deleted file mode 100644 index ec9d2d78f1..0000000000 --- a/3.4.0/src/kvilib/system/kvi_locale.h +++ /dev/null @@ -1,146 +0,0 @@ -#ifndef _KVI_LOCALE_H_ -#define _KVI_LOCALE_H_ - -//============================================================================= -// -// File : kvi_locale.h -// Creation date : Sat Jan 16 1999 18:15:01 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_string.h" -#include "kvi_pointerhashtable.h" - -#include <qapplication.h> - -class QTextCodec; -class KviMessageCatalogue; - -namespace KviLocale -{ - typedef struct _EncodingDescription - { - char * szName; - char bSmart; // is it a smart codec ? - char bSendUtf8; // does it send utf8 or the local charset ? - char * szDescription; - } EncodingDescription; - - // you MUST start iterating from 0 and terminate when - // you get an entry with a NULL szName - KVILIB_API EncodingDescription * encodingDescription(int iIdx); - KVILIB_API QTextCodec * codecForName(const char * szName); - KVILIB_API const KviStr & localeName(); - KVILIB_API bool findCatalogue(QString &szBuffer,const QString& name,const QString& szLocaleDir); - KVILIB_API bool loadCatalogue(const QString& name,const QString& szLocaleDir); - KVILIB_API KviMessageCatalogue * getLoadedCatalogue(const QString& name); - KVILIB_API bool unloadCatalogue(const QString& name); - KVILIB_API void init(QApplication * app,const QString& localeDir); - KVILIB_API void done(QApplication * app); - KVILIB_API const char * translate(const char * text,const char * context); - KVILIB_API const QString & translateToQString(const char * text,const char * context); -}; - -// not exported -class KviTranslationEntry -{ -public: - KviStr m_szKey; - KviStr m_szEncodedTranslation; - QString * m_pQTranslation; -public: - KviTranslationEntry(char * keyptr,int keylen,char * trptr,int trlen) - : m_szKey(keyptr,keylen) , m_szEncodedTranslation(trptr,trlen) - { - m_pQTranslation = 0; - } - - KviTranslationEntry(const char * keyandtr) - : m_szKey(keyandtr) , m_szEncodedTranslation(keyandtr) - { - m_pQTranslation = 0; - } - - ~KviTranslationEntry() - { - if(m_pQTranslation)delete m_pQTranslation; - } -}; - - -class KVILIB_API KviMessageCatalogue -{ -public: - KviMessageCatalogue(); - ~KviMessageCatalogue(); -protected: - //KviPointerHashTable<const char *,KviTranslationEntry> * m_pMessages; - KviPointerHashTable<const char *,KviTranslationEntry> * m_pMessages; - QTextCodec * m_pTextCodec; -public: - bool load(const QString& name); - const char * translate(const char * text); - const QString & translateToQString(const char * text); -}; - -#ifndef _KVI_LOCALE_CPP_ - extern KVILIB_API KviMessageCatalogue * g_pMainCatalogue; -#endif // !_KVI_LOCALE_CPP_ - -#define __tr(__text__) g_pMainCatalogue->translate(__text__) -#define __tr_no_lookup(__text__) __text__ -#define __tr_no_xgettext(__text__) g_pMainCatalogue->translate(__text__) - -#define __tr2qs(__text__) g_pMainCatalogue->translateToQString(__text__) -#define __tr2qs_no_xgettext(__text__) g_pMainCatalogue->translateToQString(__text__) - -#define __tr_ctx(__text__,__context__) KviLocale::translate(__text__,__context__) -#define __tr_no_lookup_ctx(__text__,__context__) __text__ -#define __tr_no_xgettext_ctx(__text__,__context__) KviLocale::translate(__text__,__context__) -#define __tr2qs_ctx(__text__,__context__) KviLocale::translateToQString(__text__,__context__) -#define __tr2qs_ctx_no_xgettext(__text__,__context__) KviLocale::translateToQString(__text__,__context__) -#define __tr2qs_no_lookup(__text__) __text__ - -#include <qtranslator.h> -#include <qstring.h> - -class KVILIB_API KviTranslator : public QTranslator -{ - Q_OBJECT - public: - KviTranslator(QObject * parent,const char * name); - ~KviTranslator(); - public: -#ifdef COMPILE_USE_QT4 - virtual QString translate(const char * context,const char * message,const char * comment) const; -#endif - // Deprecated in qt 4.x - virtual QString find(const char * context,const char * message) const; -#ifndef COMPILE_USE_QT4 - // Dead in qt 4.x - virtual QTranslatorMessage findMessage(const char * context,const char * sourceText,const char * comment = 0) const; -#endif -}; - - -#endif //!_KVI_LOCALE_H_ diff --git a/3.4.0/src/kvilib/system/kvi_process.h b/3.4.0/src/kvilib/system/kvi_process.h deleted file mode 100644 index 5b4a1ffb9f..0000000000 --- a/3.4.0/src/kvilib/system/kvi_process.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _KVI_PROCESS_H_ -#define _KVI_PROCESS_H_ -//============================================================================= -// -// File : kvi_process.h -// Creation date : Tue Jan 30 2007 04:05:41 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include <q3process.h> - #define KviProcess Q3Process -#else - #include <qprocess.h> - #define KviProcess QProcess -#endif - -#endif //!_KVI_PROCESS_H_ diff --git a/3.4.0/src/kvilib/system/kvi_stdarg.h b/3.4.0/src/kvilib/system/kvi_stdarg.h deleted file mode 100644 index d061eff2e6..0000000000 --- a/3.4.0/src/kvilib/system/kvi_stdarg.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef _KVI_STDARG_H_ -#define _KVI_STDARG_H_ - -//============================================================================= -// -// File : kvi_stdarg.h -// Creation date : Sat Jan 03 2004 02:08:14 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include <stdarg.h> - -#define kvi_va_list va_list -#define kvi_va_start va_start -// -// kvi_va_start_by_reference should be used when the last known argument -// is a reference type and not a pointer -// -// int SomeClass::sprintf(const QString &fmt,...) -// { -// kvi_va_list list; -// kvi_va_start_by_reference(list,fmt); -// ... -// } -// -// -#ifdef COMPILE_ON_WINDOWS - #define kvi_va_start_by_reference(__list,__arg) \ - { \ - int supercalifragilisticoespiralidoso=_INTSIZEOF(__arg); \ - __asm lea eax,__arg \ - __asm add eax,supercalifragilisticoespiralidoso \ - __asm mov __list,eax \ - } -#elif defined(__GNUC__) - // gcc doesn't use the second argument - // so we just fool it to avoid the warnings - #define kvi_va_start_by_reference(__list,__arg) va_start(__list,((const char *)(&(__arg)))) -#else - #define kvi_va_start_by_reference va_start -#endif -#define kvi_va_arg va_arg -#define kvi_va_end va_end - - - -#endif //_KVI_STDARG_H_ diff --git a/3.4.0/src/kvilib/system/kvi_thread.cpp b/3.4.0/src/kvilib/system/kvi_thread.cpp deleted file mode 100644 index f046204d49..0000000000 --- a/3.4.0/src/kvilib/system/kvi_thread.cpp +++ /dev/null @@ -1,644 +0,0 @@ -//============================================================================= -// -// File : kvi_thread.cpp -// Creation date : Tue Jul 6 1999 16:04:45 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2005 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#ifndef _GNU_SOURCE - #define _GNU_SOURCE -#endif - -#include "kvi_thread.h" - -#ifdef COMPILE_ON_WINDOWS - #include <io.h> // for _pipe() -#else - #include <unistd.h> //for pipe() and other tricks - #include <signal.h> // on Windows it is useless - #include <fcntl.h> -#endif - -#include <errno.h> - - -#include "kvi_string.h" -#include "kvi_settings.h" -#include "kvi_error.h" - - -#include <qapplication.h> - - -static void kvi_threadIgnoreSigalarm() -{ - // On Windows this stuff is useless anyway -#ifdef COMPILE_IGNORE_SIGALARM - #ifndef COMPILE_ON_WINDOWS - // Funky hack for some Solaris machines (maybe others ?) - // For an obscure (at least to me) reason - // when using threads ,some part of the system - // starts kidding us by sending a SIGALRM in apparently - // "random" circumstances. (Xlib ?) (XServer ?) - // The default action for SIGALRM is to exit the application. - // Could not guess more about this stuff... - // Here goes a "blind" hack for that. - - // Update: now we have an explaination too - // - // From: "Andre Stechert" (astechert at email dot com) - // To: pragma at kvirc dot net - // Subject: sigalarm on solaris ... - // Date: 26/7/2005 09:36 - - // Hi, - //    I noticed in your readme that you were having problems with sigalarm - // in your solaris port and you weren't sure why.  I quickly scanned your - // source code and noticed that you use usleep and threads.  That's the problem, - // if you haven't already figured it out. On Solaris, usleep is implemented with - // SIGALARM. So is threading. So if you the active thread changes while - // a usleep is in progress, bang, the process is dead. - // - // There is no real feedback on this at the moment: if somebody - // experiences the problems please drop me a mail at pragma at kvirc dot net - // and we'll try to look for a better solution. - // If the explaination is correct then KVIrc could even lock up on those machines - // (never returning from an usleep() call ?)... - - struct sigaction ignr_act; - ignr_act.sa_handler = SIG_IGN; - sigemptyset(&ignr_act.sa_mask); - - #ifdef SA_NOMASK - ignr_act.sa_flags = SA_NOMASK; - #else - ignr_act.sa_flags = 0; - #endif - - #ifdef SA_RESTART - ignr_act.sa_flags |= SA_RESTART; - #endif - - if(sigaction(SIGALRM,&ignr_act,0) == -1)debug("Failed to set SIG_IGN for SIGALRM."); - #endif -#endif -} - -#ifndef COMPILE_ON_WINDOWS - -static void kvi_threadSigpipeHandler(int) -{ - debug("Thread ????: Caught SIGPIPE: ignoring."); -} - -#endif - -static void kvi_threadCatchSigpipe() -{ - // On windows this stuff is useless -#ifndef COMPILE_ON_WINDOWS - struct sigaction act; - act.sa_handler=&kvi_threadSigpipeHandler; - sigemptyset(&(act.sa_mask)); - sigaddset(&(act.sa_mask), SIGPIPE); - // CC: take care of SunOS which automatically restarts interrupted system - // calls (and thus does not have SA_RESTART) -#ifdef SA_NOMASK - act.sa_flags = SA_NOMASK; -#else - act.sa_flags = 0; -#endif - -#ifdef SA_RESTART - act.sa_flags |= SA_RESTART; -#endif - - if(sigaction(SIGPIPE,&act,0L) == -1)debug("Failed to set the handler for SIGPIPE."); -#endif -} - -static void kvi_threadInitialize() -{ -#ifndef COMPILE_ON_WINDOWS - kvi_threadIgnoreSigalarm(); - kvi_threadCatchSigpipe(); -#endif -} - - - -#define KVI_THREAD_PIPE_SIDE_MASTER 0 -#define KVI_THREAD_PIPE_SIDE_SLAVE 1 - -// the maximum length of the slave->master queue -// over this length , the slave is forced to usleep() -#define KVI_THREAD_MAX_EVENT_QUEUE_LENGTH 50 - -static KviThreadManager * g_pThreadManager = 0; - -void KviThreadManager::globalInit() -{ - kvi_threadInitialize(); // we want this to apply to the main thread too - g_pThreadManager = new KviThreadManager(); -} - -void KviThreadManager::globalDestroy() -{ - delete g_pThreadManager; - g_pThreadManager = 0; -} - -KviThreadManager::KviThreadManager() -: QObject() -{ - if(g_pThreadManager)debug("Hey...what are ya doing ?"); - - - m_pMutex = new KviMutex(); - m_pThreadList = new KviPointerList<KviThread>; - m_pThreadList->setAutoDelete(false); - - m_iWaitingThreads = 0; - -#ifndef COMPILE_ON_WINDOWS - - m_iTriggerCount = 0; - - m_pEventQueue = new KviPointerList<KviThreadPendingEvent>; - m_pEventQueue->setAutoDelete(true); - - if(pipe(m_fd) != 0) - { - debug("Ops...thread manager pipe creation failed (%s)",KviQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data()); - } - - if(fcntl(m_fd[KVI_THREAD_PIPE_SIDE_SLAVE],F_SETFL,O_NONBLOCK) == -1) - { - debug("Ops...thread manager slave pipe initialisation failed (%s)",KviQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data()); - } - - if(fcntl(m_fd[KVI_THREAD_PIPE_SIDE_MASTER],F_SETFL,O_NONBLOCK) == -1) - { - debug("Ops...thread manager master pipe initialisation failed (%s)",KviQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data()); - } - - m_pSn = new QSocketNotifier(m_fd[KVI_THREAD_PIPE_SIDE_MASTER],QSocketNotifier::Read); - connect(m_pSn,SIGNAL(activated(int)),this,SLOT(eventsPending(int))); - m_pSn->setEnabled(true); -#endif -} - - -KviThreadManager::~KviThreadManager() -{ - m_pMutex->lock(); - // Terminate all the slaves - while(KviThread *t = m_pThreadList->first()) - { - m_pMutex->unlock(); - delete t; - m_pMutex->lock(); - } - - // there are no more child threads - // thus no more slave events are sent. - // Disable the socket notifier, we no longer need it -#ifndef COMPILE_ON_WINDOWS - m_pSn->setEnabled(false); - delete m_pSn; - m_pSn = 0; -#endif - - // we're no longer in this world - g_pThreadManager = 0; - -#ifndef COMPILE_ON_WINDOWS - // close the pipes - close(m_fd[KVI_THREAD_PIPE_SIDE_SLAVE]); - close(m_fd[KVI_THREAD_PIPE_SIDE_MASTER]); - // Kill the pending events - while(KviThreadPendingEvent *ev = m_pEventQueue->first()) - { - delete ev->e; - m_pEventQueue->removeFirst(); - } - delete m_pEventQueue; - m_pEventQueue = 0; -#endif - - m_pMutex->unlock(); - - // finish the cleanup - delete m_pMutex; - m_pMutex = 0; - delete m_pThreadList; - m_pThreadList = 0; - - // byez :) -} - -void KviThreadManager::killPendingEvents(QObject * receiver) -{ -#ifndef COMPILE_ON_WINDOWS - if(!g_pThreadManager)return; - g_pThreadManager->killPendingEventsByReceiver(receiver); -#endif -} - -void KviThreadManager::killPendingEventsByReceiver(QObject * receiver) -{ -#ifndef COMPILE_ON_WINDOWS - KviPointerList<KviThreadPendingEvent> l; - l.setAutoDelete(false); - m_pMutex->lock(); - for(KviThreadPendingEvent * ev = m_pEventQueue->first();ev;ev = m_pEventQueue->next()) - { - if(ev->o == receiver)l.append(ev); - } - for(KviThreadPendingEvent * ev = l.first();ev;ev = l.next()) - { - delete ev->e; - m_pEventQueue->removeRef(ev); - } - m_pMutex->unlock(); -#endif -} - -void KviThreadManager::registerSlaveThread(KviThread *t) -{ - m_pMutex->lock(); - m_pThreadList->append(t); - m_pMutex->unlock(); -} - -void KviThreadManager::unregisterSlaveThread(KviThread *t) -{ - m_pMutex->lock(); - m_pThreadList->removeRef(t); - m_pMutex->unlock(); -} - -void KviThreadManager::postSlaveEvent(QObject *o,QEvent *e) -{ -#ifdef COMPILE_ON_WINDOWS - QApplication::postEvent(o,e); // we believe this to be thread-safe -#else - KviThreadPendingEvent * ev = new KviThreadPendingEvent; - ev->o = o; - ev->e = e; - - m_pMutex->lock(); - - // if the queue gets too long , make this (slave) thread sleep - - // there is a special case where we can't stop the slaves posting events - // it's when a thread-master-side is waiting for it's thread-slave-side - // it the thread-master-side runs in the application main thread then - // the main thread is sleeping and can't process events. - // Since we can't be really sure that the thread-master-side will be running - // on the main application thread we also can't artificially process the events. - // So the solution is to skip this algorithm when at least one - // thread is in waiting state. - while((m_pEventQueue->count() > KVI_THREAD_MAX_EVENT_QUEUE_LENGTH) && (m_iWaitingThreads < 1)) - { - // wait for the master to process the queue - - m_pMutex->unlock(); - - // WARNING : This will fail if for some reason - // the master thread gets here! It will wait indefinitely for itself - // if(pthread_self() != m_hMasterThread) ... ???? - -#ifdef COMPILE_ON_WINDOWS - ::Sleep(1); // 1ms -#else - // FIXME : use nanosleep() ? - ::usleep(1000); // 1 ms -#endif - m_pMutex->lock(); - } - - m_pEventQueue->append(ev); - // Write bulk to the pipe... but only if there is no other wakeup pending - if(m_iTriggerCount < 1) - { - // I don't know if writing to a pipe is reentrant - // thus, in doubt, the write is interlocked (it's non blocking anyway) - int written = write(m_fd[KVI_THREAD_PIPE_SIDE_SLAVE],"?",1); - if(written < 1) - { - // ops.. failed to write down the event.. - // this is quite irritating now... - debug("Ops.. failed to write down the trigger"); - // FIXME: maybe a single shot timer ? - } else { - m_iTriggerCount++; - } - } // else no need to trigger : there is a wakeup pending in there - - m_pMutex->unlock(); - -#endif -} - -void KviThreadManager::eventsPending(int fd) -{ -#ifndef COMPILE_ON_WINDOWS - char buf[10]; - // do we need to check for errors here ? - int readed = read(fd,buf,10); - - m_pMutex->lock(); - // welcome to the critical section :) - - // grab the first event in the queue - while(KviThreadPendingEvent *ev = m_pEventQueue->first()) - { - // allow the other threads to post events: - // unlock the event queue - m_pMutex->unlock(); - // let the app process the event - // DANGER ! - QApplication::postEvent(ev->o,ev->e); - - // jump out of the loop if we have been destroyed - if(!g_pThreadManager)return; - // ufff... we're still alive :))) - - // regrab the event queue - m_pMutex->lock(); - // remove the event we have just processed - m_pEventQueue->removeRef(ev); - // here we're looping locked and havn't decremended the trigger count - } - // decrement the trigger count on the line: still atomic - if(readed >= 0) - { - if(readed < m_iTriggerCount) - { - m_iTriggerCount -= readed; - } else { - m_iTriggerCount = 0; - } - } - - // ok , job done.. can relax now - m_pMutex->unlock(); - -#endif -} - -void KviThreadManager::threadEnteredWaitState() -{ - m_pMutex->lock(); - m_iWaitingThreads++; - m_pMutex->unlock(); -} - -void KviThreadManager::threadLeftWaitState() -{ - m_pMutex->lock(); - m_iWaitingThreads--; - if(m_iWaitingThreads < 0) - { - debug("Ops.. got a negative number of waiting threads ?"); - m_iWaitingThreads = 0; - } - m_pMutex->unlock(); -} - -#ifndef COMPILE_ON_WINDOWS - bool KviMutex::locked() - { - if(!kvi_threadMutexTryLock(&m_mutex))return true; - kvi_threadMutexUnlock(&m_mutex); - return false; - } -#endif - -#ifdef COMPILE_ON_WINDOWS -DWORD WINAPI internal_start_thread(LPVOID arg) -{ - // Slave thread... - ((KviThread *)arg)->internalThreadRun_doNotTouchThis(); - return 0; -} -#else -static void * internal_start_thread(void * arg) -{ - // Slave thread... - ((KviThread *)arg)->internalThreadRun_doNotTouchThis(); - return 0; -} -#endif - -KviThread::KviThread() -{ - g_pThreadManager->registerSlaveThread(this); - m_pRunningMutex = new KviMutex(); - setRunning(false); - setStartingUp(false); -} - -KviThread::~KviThread() -{ -// debug(">> KviThread::~KviThread() : (this = %d)",this); - wait(); - delete m_pRunningMutex; - g_pThreadManager->unregisterSlaveThread(this); -// debug("<< KviThread::~KviThread() : (this = %d)",this); -} - -void KviThread::setRunning(bool bRunning) -{ - m_pRunningMutex->lock(); - m_bRunning = bRunning; - m_pRunningMutex->unlock(); -} - -void KviThread::setStartingUp(bool bStartingUp) -{ - m_pRunningMutex->lock(); - m_bStartingUp = bStartingUp; - m_pRunningMutex->unlock(); -} - -bool KviThread::isRunning() -{ - bool bRunning = true; - m_pRunningMutex->lock(); - bRunning = m_bRunning; - m_pRunningMutex->unlock(); - return bRunning; -} - -bool KviThread::isStartingUp() -{ - bool bIsStartingUp = true; - m_pRunningMutex->lock(); - bIsStartingUp = m_bStartingUp; - m_pRunningMutex->unlock(); - return bIsStartingUp; -} - -bool KviThread::start() -{ - // We're on the master side thread here! - if(isStartingUp() || isRunning())return false; - setStartingUp(true); - return kvi_threadCreate(&m_thread,internal_start_thread,this); -} - -void KviThread::wait() -{ - // We're on the master side here...and we're waiting the slave to exit -// debug(">> KviThread::wait() (this=%d)",this); - while(isStartingUp())usleep(500); // sleep 500 microseconds -// debug("!! KviThread::wait() (this=%d)",this); - g_pThreadManager->threadEnteredWaitState(); - while(isRunning()) - { - usleep(500); // sleep 500 microseconds - } - g_pThreadManager->threadLeftWaitState(); -// debug("<< KviThread::wait() (this=%d)",this); -} - -void KviThread::exit() -{ - // We're on the slave side thread here! (m_bRunning is true , m_bStartingUp is false) - setRunning(false); - kvi_threadExit(); -} - -void KviThread::internalThreadRun_doNotTouchThis() -{ - // we're on the slave thread here! -// debug(">> KviThread::internalRun (this=%d)",this); - setRunning(true); - setStartingUp(false); - kvi_threadInitialize(); - run(); - setRunning(false); -// debug("<< KviThread::internalRun (this=%d",this); -} - -void KviThread::usleep(unsigned long usec) -{ -#ifdef COMPILE_ON_WINDOWS - int s = usec / 1000; - if(s < 1)s = 1; - ::Sleep(s); // Sleep one millisecond...this is the best that we can do -#else - // FIXME : use nanosleep() ? - ::usleep(usec); -#endif -} - -void KviThread::msleep(unsigned long msec) -{ -#ifdef COMPILE_ON_WINDOWS - ::Sleep(msec); -#else - // FIXME : use nanosleep() ? - ::usleep(msec * 1000); -#endif -} - -void KviThread::sleep(unsigned long sec) -{ -#ifdef COMPILE_ON_WINDOWS - ::Sleep(sec * 1000); -#else - ::sleep(sec); -#endif -} - -void KviThread::postEvent(QObject * o,QEvent *e) -{ - // slave side - g_pThreadManager->postSlaveEvent(o,e); -} - - - -KviSensitiveThread::KviSensitiveThread() -: KviThread() -{ - m_pLocalEventQueueMutex = new KviMutex(); - m_pLocalEventQueue = new KviPointerList<KviThreadEvent>; - m_pLocalEventQueue->setAutoDelete(false); -} - -KviSensitiveThread::~KviSensitiveThread() -{ -// debug("Entering KviSensitiveThread::~KviSensitiveThread (this=%d)",this); - terminate(); -// debug("KviSensitiveThread::~KviSensitiveThread : terminate called (This=%d)",this); - m_pLocalEventQueueMutex->lock(); - m_pLocalEventQueue->setAutoDelete(true); - delete m_pLocalEventQueue; - m_pLocalEventQueue = 0; - m_pLocalEventQueueMutex->unlock(); - delete m_pLocalEventQueueMutex; - m_pLocalEventQueueMutex = 0; -// debug("Exiting KviSensitiveThread::~KviSensitiveThread (this=%d)",this); -} - -void KviSensitiveThread::enqueueEvent(KviThreadEvent *e) -{ -// debug(">>> KviSensitiveThread::enqueueEvent() (this=%d)",this); - m_pLocalEventQueueMutex->lock(); - if(!m_pLocalEventQueue) - { - // ops...already terminated (???)...eat the event and return - delete e; - m_pLocalEventQueueMutex->unlock(); - return; - } - m_pLocalEventQueue->append(e); - m_pLocalEventQueueMutex->unlock(); -// debug("<<< KviSensitiveThread::enqueueEvent() (this=%d)",this); -} - -KviThreadEvent * KviSensitiveThread::dequeueEvent() -{ -// debug(">>> KviSensitiveThread::dequeueEvent() (this=%d)",this); - KviThreadEvent * ret; - m_pLocalEventQueueMutex->lock(); - ret = m_pLocalEventQueue->first(); - if(ret)m_pLocalEventQueue->removeFirst(); - m_pLocalEventQueueMutex->unlock(); -// debug("<<< KviSensitiveThread::dequeueEvent() (this=%d)",this); - return ret; -} - -void KviSensitiveThread::terminate() -{ -// debug("Entering KviSensitiveThread::terminate (this=%d)",this); - enqueueEvent(new KviThreadEvent(KVI_THREAD_EVENT_TERMINATE)); -// debug("KviSensitiveThread::terminate() : event enqueued waiting (this=%d)",this); - wait(); -// debug("Exiting KviSensitiveThread::terminate (this=%d)",this); -} - diff --git a/3.4.0/src/kvilib/system/kvi_thread.h b/3.4.0/src/kvilib/system/kvi_thread.h deleted file mode 100644 index 005a32cadf..0000000000 --- a/3.4.0/src/kvilib/system/kvi_thread.h +++ /dev/null @@ -1,378 +0,0 @@ -#ifndef _KVI_THREAD_H_ -#define _KVI_THREAD_H_ -// -// File : kvi_thread.h -// Creation date : Mon May 17 1999 04:26:41 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_heapobject.h" -#include "kvi_string.h" - -#include <qnamespace.h> -#include <qobject.h> -#include <qsocketnotifier.h> -#include "kvi_pointerlist.h" -#include <qevent.h> - - -// -// Simple thread implementation -// This is enough for KVIrc needs -// HANDLE WITH CARE -// - - -// Portability stuff - -#ifdef COMPILE_ON_WINDOWS - - #include <winsock2.h> // this will pull in windows.h and will avoid windock.h inclusion - //#include <windows.h> - // Windoze thread abstraction layer - #define kvi_mutex_t HANDLE - inline void kvi_threadMutexInit(kvi_mutex_t * _pMutex_t) - { - *_pMutex_t = CreateMutex(0,0,NULL); - } - #define kvi_threadMutexLock(_pMutex_t) WaitForSingleObject(*_pMutex_t,INFINITE) - #define kvi_threadMutexUnlock(_pMutex_t) ReleaseMutex(*_pMutex_t) - #define kvi_threadMutexDestroy(_pMutex_t) CloseHandle(*_pMutex_t) - inline bool kvi_threadMutexTryLock(kvi_mutex_t *_pMutex_t) - { - return (WaitForSingleObject(*_pMutex_t,0) == WAIT_OBJECT_0); - } - - #define kvi_thread_t HANDLE - - inline bool kvi_threadCreate(kvi_thread_t *t,LPTHREAD_START_ROUTINE start_routine,void * arg) - { - DWORD dwThreadId; - *t = CreateThread(NULL,0,start_routine,arg,0,&dwThreadId); - return (*t != NULL); - } - - #define kvi_threadExit() ExitThread(0) - -#else - #ifdef COMPILE_THREADS_USE_POSIX - // Glibc pthread implementation - - #include <pthread.h> - #include <errno.h> // for EBUSY - - // Mutex stuff - #define kvi_mutex_t pthread_mutex_t - #define kvi_threadMutexInit(_pMutex_t) pthread_mutex_init(_pMutex_t,0) - #define kvi_threadMutexLock(_pMutex_t) pthread_mutex_lock(_pMutex_t) - #define kvi_threadMutexUnlock(_pMutex_t) pthread_mutex_unlock(_pMutex_t) - #define kvi_threadMutexDestroy(_pMutex_t) pthread_mutex_destroy(_pMutex_t) - inline bool kvi_threadMutexTryLock(kvi_mutex_t *_pMutex_t) - { - return (pthread_mutex_trylock(_pMutex_t) != EBUSY); - } - // Actually unused - // #define kvi_threadMutexTryLock(_pMutex_t) pthread_mutex_trylock(_pMutex_t) - - // Thread stuff - #define kvi_thread_t pthread_t - - inline bool kvi_threadCreate(kvi_thread_t *t,void * (*start_routine)(void *),void * arg) - { - pthread_attr_t a; - pthread_attr_init(&a); - pthread_attr_setinheritsched(&a,PTHREAD_INHERIT_SCHED); - pthread_attr_setdetachstate(&a,PTHREAD_CREATE_DETACHED); - - int ret = pthread_create(t,&a,start_routine,arg); - - pthread_attr_destroy(&a); - return (ret == 0); - } - - // We don't care about exit codes at all - #define kvi_threadExit() pthread_exit(0) - #else - #ifdef COMPILE_THREADS_USE_SOLARIS_LIBTHREAD - // Native solaris implementation - #include <thread.h> - #include <synch.h> - #include <errno.h> - - // Mutex stuff - #define kvi_mutex_t mutex_t - #define kvi_threadMutexInit(_pMutex_t) mutex_init(_pMutex_t,0,0) - #define kvi_threadMutexLock(_pMutex_t) mutex_lock(_pMutex_t) - #define kvi_threadMutexUnlock(_pMutex_t) mutex_unlock(_pMutex_t) - #define kvi_threadMutexDestroy(_pMutex_t) mutex_destroy(_pMutex_t) - inline bool kvi_threadMutexTryLock(kvi_mutex_t *_pMutex_t) - { - return (mutex_trylock(_pMutex_t) != EBUSY); - }; - // Actually unused - // #define kvi_threadMutexTryLock(_pMutex_t) mutex_trylock(_pMutex_t) - - // Thread stuff - #define kvi_thread_t thread_t - - inline bool kvi_threadCreate(kvi_thread_t *t,void * (*start_routine)(void *),void *arg) - { - return (thr_create(0,0,start_routine,arg,THR_DETACHED,t) == 0); - } - - // We don't care about exit codes at all - #define kvi_threadExit() thr_exit(0) - #else -// FIXME: #warning "Missing a decent thread implementation: we're going to fail , sorry!" - #endif - #endif -#endif - -class KVILIB_API KviMutex : public KviHeapObject -{ -private: - kvi_mutex_t m_mutex; -#ifdef COMPILE_ON_WINDOWS - bool m_bLocked; -#endif -public: - KviMutex(){ kvi_threadMutexInit(&m_mutex); }; - virtual ~KviMutex(){ kvi_threadMutexDestroy(&m_mutex); }; -public: -#ifdef COMPILE_ON_WINDOWS - void lock(){ kvi_threadMutexLock(&m_mutex); m_bLocked = true; }; - void unlock(){ m_bLocked = false; kvi_threadMutexUnlock(&m_mutex); }; - bool locked(){ return m_bLocked; }; -#else - void lock(){ kvi_threadMutexLock(&m_mutex); }; - void unlock(){ kvi_threadMutexUnlock(&m_mutex); }; - bool locked(); -#endif -}; - - -// simple thread class implementation -// this is also called "Blind" thread class - -class KVILIB_API KviThread : public KviHeapObject -{ -public: - KviThread(); - virtual ~KviThread(); -private: - kvi_thread_t m_thread; - bool m_bRunning; - bool m_bStartingUp; - KviMutex * m_pRunningMutex; - KviPointerList<QEvent> * m_pLocalEventQueue; -public: - // public KviThread interface - // HANDLE WITH CARE - - // Runs the thread...call only from external threads!!! :) - // This function returns true if the child thread has been succesfully created - // this des not mean that run() is being already executed... - // isStartingUp() will return true from this moment until - // the child thread jumps into run() where it will be set to running state (isRunning() == true) - // and removed from startingUp state. - bool start(); - // Returns the state of the thread...safe to call from anywhere - bool isRunning(); - // Returns the state of the thread...safe to call from anywhere - bool isStartingUp(); // start() called , but not in run() yet... - // Waits for the termination of this thread: call only from external threads!!! :) - void wait(); - // DO NOT TOUCH THIS ONE! - void internalThreadRun_doNotTouchThis(); - - static void sleep(unsigned long sec); - static void msleep(unsigned long msec); - static void usleep(unsigned long usec); -protected: - // protected KviThread interface - // HANDLE WITH CARE TOO! - - // Reimplement this with your job - virtual void run(){}; - // Terminates the execution of the calling thread - void exit(); - // The tricky part: threadsafe event dispatching - // Slave thread -> main thread objects - void postEvent(QObject *o,QEvent *e); -private: - void setRunning(bool bRunning); - void setStartingUp(bool bStartingUp); -}; - -// QEvent::Type for Thread events -#define KVI_THREAD_EVENT (((int)QEvent::User) + 2000) - -// CONSTANTS FOR KviThreadEvent::eventId(); - -/////////////////////////////////////////////////////////////// -// extern -> slave thread - -// Your reimplementation of KviSensitiveThread MUST handle this -// and exit when this event is received - -// Terminate is a plain KviThreadEvent -#define KVI_THREAD_EVENT_TERMINATE 0 - -/////////////////////////////////////////////////////////////// -// slave thread -> master object - -// The following standard events are sent from the thread to the master object - -// The following are plain KviThreadEvent objects -#define KVI_THREAD_EVENT_SUCCESS 100 - -// The following are KviThreadDataEvent<int> -#define KVI_THREAD_EVENT_STATECHANGE 150 - -// The following are KviThreadDataEvent<KviStr> -#define KVI_THREAD_EVENT_MESSAGE 200 -#define KVI_THREAD_EVENT_WARNING 201 -#define KVI_THREAD_EVENT_ERROR 202 -#define KVI_THREAD_EVENT_DATA 203 - -// The following is KviThreadDataEvent<KviDataBuffer> -#define KVI_THREAD_EVENT_BINARYDATA 300 - -// The user events -#define KVI_THREAD_USER_EVENT_BASE 1000 - -// #warning "Get rid of the m_szMessage member of KviThreadEvent : eventual data should be passed with a KviThreadDataEvent" - -// Base class for all thread events -class KVILIB_API KviThreadEvent : public QEvent, public KviHeapObject -{ -protected: - int m_eventId; - KviThread * m_pSender; -public: - KviThreadEvent(int evId,KviThread * sender = 0) - : QEvent((QEvent::Type)KVI_THREAD_EVENT) , m_eventId(evId) , m_pSender(sender) {}; - virtual ~KviThreadEvent(){}; -public: - // This is the sender of the event - // WARNING : this MAY be null , threads CAN send anonymous events - KviThread * sender(){ return m_pSender; }; - int id(){ return m_eventId; }; -}; - -template<class TData> class KviThreadDataEvent : public KviThreadEvent -{ -protected: - TData * m_pData; -public: - KviThreadDataEvent(int evId,TData * pData = 0,KviThread * sender = 0) - : KviThreadEvent(evId,sender){ m_pData = pData; }; - virtual ~KviThreadDataEvent(){ if(m_pData)delete m_pData; }; -public: - void setData(TData * d){ if(m_pData)delete m_pData; m_pData = d; }; - TData * getData(){ TData * aux = m_pData; m_pData = 0; return aux; }; - TData * data(){ return m_pData; }; -}; - -// A thread that has also an internal event queue -// so events can be posted from the master side to the slave one -// Reimplementations of this class should periodically check -// dequeueEvent() and eventually process the incoming events (and then DELETE it) - -// KVI_THREAD_EVENT_TERMINATE should be always handled by the reimplementation -// and it should always exit (cleanly) when this event is received - - -class KVILIB_API KviSensitiveThread : public KviThread -{ -public: - KviSensitiveThread(); - virtual ~KviSensitiveThread(); -protected: - KviMutex * m_pLocalEventQueueMutex; - KviPointerList<KviThreadEvent> * m_pLocalEventQueue; -public: - // enqueues an event directed to THIS thread - // the event must be allocated with NEW and - // will be destroyed on the slave side - void enqueueEvent(KviThreadEvent *e); - // enqueues a terminate event and waits() for the slave thread - // the slave thread MUST handle KVI_THREAD_EVENT_TERMINATE - void terminate(); -protected: - // slave side: - // returns the first event in the local queue - // the event MUST BE DELETED after processing - KviThreadEvent * dequeueEvent(); -}; - -// =============================================================================================// -// This is private stuff...only KviThread and KviApp may use it -// and may call only specific functions...don't touch. - -typedef struct _KviThreadPendingEvent -{ - QObject *o; - QEvent *e; -} KviThreadPendingEvent; - -class KVILIB_API KviThreadManager : public QObject -{ - friend class KviApp; - friend class KviThread; - Q_OBJECT -protected: - // These should be private...but we don't want anyone to complain - // Treat as private plz. - KviThreadManager(); - ~KviThreadManager(); -public: - static void killPendingEvents(QObject * receiver); -private: -#ifndef COMPILE_ON_WINDOWS - QSocketNotifier * m_pSn; -#endif - KviMutex * m_pMutex; // This class performs only atomic operations - KviPointerList<KviThread> * m_pThreadList; - int m_iWaitingThreads; -#ifndef COMPILE_ON_WINDOWS - KviPointerList<KviThreadPendingEvent> * m_pEventQueue; - int m_fd[2]; - int m_iTriggerCount; -#endif -protected: - // Public to KviThread only - void registerSlaveThread(KviThread *t); - void unregisterSlaveThread(KviThread *t); - - void threadEnteredWaitState(); - void threadLeftWaitState(); - - void postSlaveEvent(QObject *o,QEvent *e); - void killPendingEventsByReceiver(QObject * receiver); - // Public to KviApp only - static void globalInit(); - static void globalDestroy(); -private slots: - void eventsPending(int fd); -}; - - -#endif //!_KVI_THREAD_H_ diff --git a/3.4.0/src/kvilib/system/kvi_time.cpp b/3.4.0/src/kvilib/system/kvi_time.cpp deleted file mode 100644 index 3f1d85856a..0000000000 --- a/3.4.0/src/kvilib/system/kvi_time.cpp +++ /dev/null @@ -1,135 +0,0 @@ -//============================================================================= -// -// File : kvi_time.cpp -// Creation date : Tue Sep 25 17:35:13 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_time.h" -#include "kvi_qstring.h" -#include "kvi_locale.h" - -#ifdef COMPILE_ON_WINDOWS - #include <windows.h> // GetSystemTime - - // Call SystemTimeToFileTime to copy the system time to a FILETIME structure. - // Call GetSystemTime to get the current system time to pass to SystemTimeToFileTime. - // Copy the contents of the FILETIME structure to a ULARGE_INTEGER structure. - // Initialize a SYSTEMTIME structure with the date and time of the first second of January 1, 1970. - // Call SystemTimeToFileTime, passing the SYSTEMTIME structure initialized in Step 3 to the call. - // Copy the contents of the FILETIME structure returned by SystemTimeToFileTime in Step 4 to - // a second ULARGE_INTEGER. The copied value should be greater than or equal to the value copied - // in Step 2. Subtract the 64-bit value in the ULARGE_INTEGER structure initialized in Step 2 - // from the 64-bit value of the ULARGE_INTEGER structure initialized in Step 5. - // This produces a value in 100-nanosecond intervals since January 1, 1970. - // To convert this value to seconds, divide by 10,000,000. - - // buah buah buahhhh lol ghgh :DDDDDDDDD - - void kvi_gettimeofday(struct timeval * tmv,struct timezone *) - { - SYSTEMTIME st; - GetSystemTime(&st); - - // this is simply fucked up.. - // to minimize the possibility of wrapping we use also the day field. - // we actually give something that is near the number of seconds from the beginning - // of the current month... - // We cannot use the wMonth field since the months have variable length :/ - tmv->tv_sec = (st.wDay * 86400) + (st.wHour * 3600) + (st.wMinute * 60) + (st.wSecond); - tmv->tv_usec = st.wMilliseconds * 1000; - } -#endif - -KviMSecTimeInterval::KviMSecTimeInterval() -{ - m_uReferenceSecs = 0; - m_uReferenceUSecs = 0; -} - - -unsigned long KviMSecTimeInterval::mark() -{ - struct timeval tmv; - kvi_gettimeofday(&tmv,0); - unsigned long uDiff = ((((unsigned long)(tmv.tv_sec)) - m_uReferenceSecs) * 1000); - if(((unsigned long)(tmv.tv_usec)) > m_uReferenceUSecs)uDiff += (((unsigned long)(tmv.tv_usec) - m_uReferenceUSecs) / 1000); - else uDiff -= ((m_uReferenceUSecs - (unsigned long)(tmv.tv_usec)) / 1000); - m_uReferenceSecs = (unsigned long)tmv.tv_sec; - m_uReferenceUSecs = (unsigned long)tmv.tv_usec; - return uDiff; -} - -namespace KviTimeUtils -{ - void secondsToDaysHoursMinsSecs(unsigned int uSecs, - unsigned int * uD,unsigned int * uH,unsigned int * uM,unsigned int * uS) - { - *uD = uSecs / 86400; - uSecs = uSecs % 86400; - *uH = uSecs / 3600; - uSecs = uSecs % 3600; - *uM = uSecs / 60; - *uS = uSecs % 60; - } - - QString formatTimeInterval(unsigned int uSeconds,int iFlags) - { - unsigned int d,h,m,s; - secondsToDaysHoursMinsSecs(uSeconds,&d,&h,&m,&s); - QString ret; - // the following tricks maybe will help translators a bit... - if(iFlags & FillWithHypens) - { - ret = __tr2qs("- d -- h -- m -- s"); - } else { - if((iFlags & NoLeadingEmptyIntervals) && (d == 0)) - { - if(h > 0) - { - if(iFlags & NoLeadingZeroes) - KviQString::sprintf(ret,__tr2qs("%u h %u m %u s"),h,m,s); - else - KviQString::sprintf(ret,__tr2qs("%u h %u%u m %u%u s"),h,m / 10,m % 10,s / 10,s % 10); - } else { - if(m > 0) - { - if(iFlags & NoLeadingZeroes) - KviQString::sprintf(ret,__tr2qs("%u m %u s"),m,s); - else - KviQString::sprintf(ret,__tr2qs("%u m %u%u s"),m,s / 10,s % 10); - } else { - KviQString::sprintf(ret,__tr2qs("%u s"),s); - } - } - } else { - if(iFlags & NoLeadingZeroes) - KviQString::sprintf(ret,__tr2qs("%u d %u h %u m %u s"),d,h,m,s); - else - KviQString::sprintf(ret,__tr2qs("%u d %u%u h %u%u m %u%u s"),d,h / 10,h % 10,m / 10,m % 10,s / 10,s % 10); - } - } - return ret; - } - -} diff --git a/3.4.0/src/kvilib/system/kvi_time.h b/3.4.0/src/kvilib/system/kvi_time.h deleted file mode 100644 index 98cc4e3310..0000000000 --- a/3.4.0/src/kvilib/system/kvi_time.h +++ /dev/null @@ -1,92 +0,0 @@ -#ifndef _KVI_TIME_H_ -#define _KVI_TIME_H_ - -//============================================================================= -// -// File : kvi_time.h -// Creation date : Tue Sep 25 17:28:46 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include <qstring.h> - - -#include <time.h> // for time() - -#define kvi_unixTime() time(0) -#define kvi_timeSpan(_time_now,_time_before) ((_time_now) - (_time_before)) -#define kvi_secondsSince(_that_time_t) kvi_timeSpan(kvi_unixTime(),_that_time_t) - -#define kvi_time_t time_t - -#ifdef COMPILE_ON_WINDOWS - - #include <winsock2.h> // struct timeval - - extern KVILIB_API void kvi_gettimeofday(struct timeval * tmv,struct timezone * tmz); - -#else //!COMPILE_ON_WINDOWS - - #include <sys/time.h> // gettimeofday() , struct timeval - - inline void kvi_gettimeofday(struct timeval * tmv,struct timezone * tmz) - { - gettimeofday(tmv,tmz); - }; - -#endif //!COMPILE_ON_WINDOWS - -// this works for time intervals a bit longer than 24 days -class KVILIB_API KviMSecTimeInterval -{ -public: - KviMSecTimeInterval(); -protected: - unsigned long m_uReferenceSecs; - unsigned long m_uReferenceUSecs; -public: - // returns the number of milliseconds since - // mark() was last called (and thus marks - // the beginning of a new interval). - unsigned long mark(); - // this wors ONLY in the same second that mark was called in - // and returns the tv_sec field of the gettimeofday() - // (remember that gettimeofday() is broken on windows) - unsigned long secondsCounter(){ return m_uReferenceSecs; }; -}; - -namespace KviTimeUtils -{ - - - // splits the time span uSecs in days, hours, minutes and seconds - KVILIB_API void secondsToDaysHoursMinsSecs(unsigned int uSecs, - unsigned int * uD,unsigned int * uH,unsigned int * uM,unsigned int * uS); - // returns a string formatted like x d x h xx m xx s - enum FormatTimeSpanFlags { - NoLeadingEmptyIntervals = 1, // causes the leading empty intervals to be omitted - NoLeadingZeroes = 2, // no leading zeroes are printed in hours and seconds - FillWithHypens = 4 // uses only -- %d -- %h -- etc.. discards all other flags - }; - KVILIB_API QString formatTimeInterval(unsigned int uSeconds,int iFlags = 0); -}; - -#endif //_KVI_TIME_H_ diff --git a/3.4.0/src/kvilib/tal/.svnignore b/3.4.0/src/kvilib/tal/.svnignore deleted file mode 100644 index 1612c03b91..0000000000 --- a/3.4.0/src/kvilib/tal/.svnignore +++ /dev/null @@ -1,20 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -*.o -*.lo -*.la -*.so -*.lai -kvirc -symlinks -moc_*.cpp - diff --git a/3.4.0/src/kvilib/tal/Makefile.am b/3.4.0/src/kvilib/tal/Makefile.am deleted file mode 100644 index c84487eb66..0000000000 --- a/3.4.0/src/kvilib/tal/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -EXTRA_DIST = *.cpp *.h diff --git a/3.4.0/src/kvilib/tal/kvi_tal_application.cpp b/3.4.0/src/kvilib/tal/kvi_tal_application.cpp deleted file mode 100644 index 9f63218f0d..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_application.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// -// File : kvi_tal_application.coo -// Creation date : Sun Aug 12 2001 04:34:21 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_tal_application.h" - -#ifdef COMPILE_KDE_SUPPORT - - // The constructor below triggers a warning - // ../tal/kvi_tal_application.cpp: In constructor - // `KviTalApplication::KviTalApplication(int, char**)': - // ../tal/kvi_tal_application.cpp:31: warning: `__base_ctor' is deprecated - // (declared at /opt/kde/include/kapplication.h:198) - // - // The KApplication constructor has been declared as deprecated - // in favor of a complexier initialization that uses KCmdLineArgs - // and can't be abstracted easily. - // The other constructors are not "old" and "stable" enough - // to be safely used at this time. We'll rethink this when KDE 4 is out. - - KviTalApplication::KviTalApplication(int &argc,char ** argv) - : KApplication(argc,argv,"kvirc") - { - - - - } - - KviTalApplication::~KviTalApplication() - { - } - - #include "kvi_tal_application_kde.moc" - -#else - - KviTalApplication::KviTalApplication(int &argc,char ** argv) - : QApplication(argc,argv) - { - } - - KviTalApplication::~KviTalApplication() - { - } - - #include "kvi_tal_application_qt.moc" - -#endif diff --git a/3.4.0/src/kvilib/tal/kvi_tal_application.h b/3.4.0/src/kvilib/tal/kvi_tal_application.h deleted file mode 100644 index 2a582cbf44..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_application.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef _KVI_TAL_APPLICATION_H_ -#define _KVI_TAL_APPLICATION_H_ - -// -// File : kvi_appbase_kde.h -// Creation date : Sun Jun 18 2000 12:53:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_KDE_SUPPORT - #include "kvi_tal_application_kde.h" -#else - #include "kvi_tal_application_qt.h" -#endif - -#endif // _KVI_TAL_APPLICATION_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_application_kde.h b/3.4.0/src/kvilib/tal/kvi_tal_application_kde.h deleted file mode 100644 index b8f258ae67..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_application_kde.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _KVI_TAL_APPLICATION_KDE_H_ -#define _KVI_TAL_APPLICATION_KDE_H_ - -// -// File : kvi_tal_application_kde.h -// Creation date : Sun Aug 12 2001 04:32:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <kapp.h> - - -class KVILIB_API KviTalApplication : public KApplication -{ - Q_OBJECT -public: - KviTalApplication(int &argc,char ** argv); - ~KviTalApplication(); -}; - -#endif // _KVI_TAL_APPLICATION_KDE_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_application_qt.h b/3.4.0/src/kvilib/tal/kvi_tal_application_qt.h deleted file mode 100644 index cca765db14..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_application_qt.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _KVI_TAL_APPLICATION_QT_H_ -#define _KVI_TAL_APPLICATION_QT_H_ - -// -// File : kvi_tal_application_qt.h -// Creation date : Sun Aug 12 2001 04:33:21 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <qapplication.h> - - -class KVILIB_API KviTalApplication : public QApplication -{ - Q_OBJECT -public: - KviTalApplication(int &argc,char ** argv); - ~KviTalApplication(); -}; - -#endif // _KVI_TAL_APPLICATION_QT_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_filedialog.cpp b/3.4.0/src/kvilib/tal/kvi_tal_filedialog.cpp deleted file mode 100644 index 8d15c27aa3..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_filedialog.cpp +++ /dev/null @@ -1,176 +0,0 @@ -//============================================================================= -// -// File : kvi_tal_filedialog.coo -// Creation date : Thu Sep 11 2003 04:09:24 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_tal_filedialog.h" - -#ifdef COMPILE_USE_QT4 - - #include <qdir.h> - - KviTalFileDialog::KviTalFileDialog(const QString &dirName,const QString &filter,QWidget *parent,const char *name,bool modal) - : QFileDialog(parent,"",dirName,filter) - { - setModal(modal); - } - - KviTalFileDialog::~KviTalFileDialog() - { - } - - void KviTalFileDialog::setFileMode(FileMode m) - { - switch(m) - { - case AnyFile: - QFileDialog::setFileMode(QFileDialog::AnyFile); - break; - case ExistingFile: - QFileDialog::setFileMode(QFileDialog::ExistingFile); - break; - case ExistingFiles: - QFileDialog::setFileMode(QFileDialog::ExistingFiles); - break; - case Directory: - QFileDialog::setFileMode(QFileDialog::Directory); - break; - case DirectoryOnly: - QFileDialog::setFileMode(QFileDialog::DirectoryOnly); - break; - default: - QFileDialog::setFileMode(QFileDialog::AnyFile); - break; - } - } - - void KviTalFileDialog::setDirectory(const QString &szDirectory) - { - QFileDialog::setDirectory(szDirectory); - } - - - #include "kvi_tal_filedialog_qt4.moc" - -#else - - #ifdef COMPILE_KDE_SUPPORT - - KviTalFileDialog::KviTalFileDialog(const QString &dirName,const QString &filter,QWidget *parent,const char *name,bool modal) - : KFileDialog(dirName,filter,parent,name,modal) - { - clearWFlags(WDestructiveClose); - } - - KviTalFileDialog::~KviTalFileDialog() - { - } - - void KviTalFileDialog::setFileMode(FileMode m) - { - switch(m) - { - case AnyFile: - setMode(KFile::File | KFile::LocalOnly); - setOperationMode(Saving); - break; - case ExistingFile: - setMode(KFile::File | KFile::ExistingOnly | KFile::LocalOnly); - setOperationMode(Opening); - break; - case ExistingFiles: - setMode(KFile::Files | KFile::ExistingOnly | KFile::LocalOnly); - setOperationMode(Opening); - break; - case Directory: - setMode(KFile::Directory); - break; - case DirectoryOnly: - setMode(KFile::Directory); - break; - default: - setMode(KFile::File | KFile::LocalOnly); - setOperationMode(Saving); - break; - } - } - - void KviTalFileDialog::setDirectory(const QString &szDirectory) - { - setURL(szDirectory); - } - - - #include "kvi_tal_filedialog_kde.moc" - - #else - - #include <qdir.h> - - KviTalFileDialog::KviTalFileDialog(const QString &dirName,const QString &filter,QWidget *parent,const char *name,bool modal) - : QFileDialog(dirName,filter,parent,name,modal) - { - clearWFlags(WDestructiveClose); - } - - KviTalFileDialog::~KviTalFileDialog() - { - } - - void KviTalFileDialog::setFileMode(FileMode m) - { - switch(m) - { - case AnyFile: - setMode(QFileDialog::AnyFile); - break; - case ExistingFile: - setMode(QFileDialog::ExistingFile); - break; - case ExistingFiles: - setMode(QFileDialog::ExistingFiles); - break; - case Directory: - setMode(QFileDialog::Directory); - break; - case DirectoryOnly: - setMode(QFileDialog::DirectoryOnly); - break; - default: - setMode(QFileDialog::AnyFile); - break; - } - } - - void KviTalFileDialog::setDirectory(const QString &szDirectory) - { - setDir(QDir(szDirectory)); - } - - - #include "kvi_tal_filedialog_qt.moc" - - #endif -#endif diff --git a/3.4.0/src/kvilib/tal/kvi_tal_filedialog.h b/3.4.0/src/kvilib/tal/kvi_tal_filedialog.h deleted file mode 100644 index 4de6b6f907..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_filedialog.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef _KVI_TAL_FILEDIALOG_H_ -#define _KVI_TAL_FILEDIALOG_H_ - -//============================================================================= -// -// File : kvi_tal_filedialog.h -// Creation date : Thu Sep 11 2003 04:41:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_filedialog_qt4.h" -#else - #ifdef COMPILE_KDE_SUPPORT - #include "kvi_tal_filedialog_kde.h" - #else - #include "kvi_tal_filedialog_qt.h" - #endif -#endif - -#endif // _KVI_TAL_FILEDIALOG_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_filedialog_kde.h b/3.4.0/src/kvilib/tal/kvi_tal_filedialog_kde.h deleted file mode 100644 index 4670215a3c..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_filedialog_kde.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _KVI_TAL_FILEDIALOG_KDE_H_ -#define _KVI_TAL_FILEDIALOG_KDE_H_ - -// -// File : kvi_tal_filedialog_kde.h -// Creation date : Thu Aug 11 2003 04:43:58 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <kfiledialog.h> -#include <qfiledialog.h> - -class KVILIB_API KviTalFileDialog : public KFileDialog -{ - Q_OBJECT -public: - KviTalFileDialog(const QString &dirName,const QString &filter = QString::null,QWidget *parent = 0,const char *name = 0,bool modal = FALSE); - ~KviTalFileDialog(); -public: - enum FileMode { AnyFile, ExistingFile, ExistingFiles, Directory, DirectoryOnly }; - - void setFileMode(FileMode m); - void setDirectory(const QString &szDirectory); - - - static QString getExistingDirectoryPath(const QString &dir = QString::null,const QString &caption = QString::null,QWidget *parent = 0) - { - // QFileDialog allows making new directories...kfiledialog not :/ - return QFileDialog::getExistingDirectory(dir,parent,0,caption); - //return getExistingDirectory(dir,parent,caption); - }; -}; - -#endif // _KVI_TAL_FILEDIALOG_KDE_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_filedialog_qt.h b/3.4.0/src/kvilib/tal/kvi_tal_filedialog_qt.h deleted file mode 100644 index 931cd12067..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_filedialog_qt.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef _KVI_TAL_FILEDIALOG_QT_H_ -#define _KVI_TAL_FILEDIALOG_QT_H_ - -// -// File : kvi_tal_filedialog_qt.h -// Creation date : Thu Aug 11 2003 04:43:58 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <qfiledialog.h> - -class KVILIB_API KviTalFileDialog : public QFileDialog -{ - Q_OBJECT -public: - KviTalFileDialog(const QString &dirName,const QString &filter = QString::null,QWidget *parent = 0,const char *name = 0,bool modal = FALSE); - ~KviTalFileDialog(); -public: - enum FileMode { AnyFile, ExistingFile, ExistingFiles, Directory, DirectoryOnly }; - - void setFileMode(FileMode m); - void setDirectory(const QString &szDirectory); - - static QString getExistingDirectoryPath(const QString &dir = QString::null,const QString &caption = QString::null,QWidget *parent = 0) - { return getExistingDirectory(dir,parent,0 /* name */,caption); }; -}; - -#endif // _KVI_TAL_FILEDIALOG_QT_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_filedialog_qt4.h b/3.4.0/src/kvilib/tal/kvi_tal_filedialog_qt4.h deleted file mode 100644 index 7407cfec4b..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_filedialog_qt4.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef _KVI_TAL_FILEDIALOG_QT4_H_ -#define _KVI_TAL_FILEDIALOG_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_filedialog_qt4.h -// Creation date : Fri 19 Jan 2007 02:17:12 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <qfiledialog.h> - -class KVILIB_API KviTalFileDialog : public QFileDialog -{ - Q_OBJECT -public: - KviTalFileDialog(const QString &dirName,const QString &filter = QString::null,QWidget *parent = 0,const char *name = 0,bool modal = FALSE); - ~KviTalFileDialog(); -public: - enum FileMode { AnyFile, ExistingFile, ExistingFiles, Directory, DirectoryOnly }; - - void setFileMode(FileMode m); - void setDirectory(const QString &szDirectory); - - static QString getExistingDirectoryPath(const QString &dir = QString::null,const QString &caption = QString::null,QWidget *parent = 0) - { return getExistingDirectory(parent,caption,dir); }; -}; - -#endif // _KVI_TAL_FILEDIALOG_QT_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_grid.cpp b/3.4.0/src/kvilib/tal/kvi_tal_grid.cpp deleted file mode 100644 index a72b06384f..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_grid.cpp +++ /dev/null @@ -1,34 +0,0 @@ -//============================================================================= -// -// File : kvi_tal_grid.cpp -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_tal_grid.h" - - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_grid_qt4.moc" -#else - #include "kvi_tal_grid_qt3.moc" -#endif - diff --git a/3.4.0/src/kvilib/tal/kvi_tal_grid.h b/3.4.0/src/kvilib/tal/kvi_tal_grid.h deleted file mode 100644 index d0794b9968..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_grid.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _KVI_TAL_GRID_H_ -#define _KVI_TAL_GRID_H_ - -//============================================================================= -// -// File : kvi_tal_grid.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_grid_qt4.h" -#else - #include "kvi_tal_grid_qt3.h" -#endif - -#endif // _KVI_TAL_GRID_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_grid_qt3.h b/3.4.0/src/kvilib/tal/kvi_tal_grid_qt3.h deleted file mode 100644 index b6163a2809..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_grid_qt3.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _KVI_TAL_GRID_QT3_H_ -#define _KVI_TAL_GRID_QT3_H_ - -//============================================================================= -// -// File : kvi_tal_grid_qt3.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <qgrid.h> - -class KVILIB_API KviTalGrid : public QGrid -{ - Q_OBJECT -public: - KviTalGrid(int n,Qt::Orientation orient,QWidget * pParent = 0) - : QGrid(n,orient,pParent) {}; - ~KviTalGrid() {}; -}; - -#endif // _KVI_TAL_GRID_QT3_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_grid_qt4.h b/3.4.0/src/kvilib/tal/kvi_tal_grid_qt4.h deleted file mode 100644 index c0c6938d0b..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_grid_qt4.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _KVI_TAL_GRID_QT4_H_ -#define _KVI_TAL_GRID_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_grid_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <q3grid.h> - -class KVILIB_API KviTalGrid : public Q3Grid -{ - Q_OBJECT -public: - KviTalGrid(int n,Qt::Orientation orient,QWidget * pParent = 0) - : Q3Grid(n,orient,pParent) {}; - ~KviTalGrid() {}; -}; - -#endif // _KVI_TAL_GRID_QT4_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_groupbox.cpp b/3.4.0/src/kvilib/tal/kvi_tal_groupbox.cpp deleted file mode 100644 index 830df938eb..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_groupbox.cpp +++ /dev/null @@ -1,34 +0,0 @@ -//============================================================================= -// -// File : kvi_tal_groupbox.cpp -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_tal_groupbox.h" - - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_groupbox_qt4.moc" -#else - #include "kvi_tal_groupbox_qt3.moc" -#endif - diff --git a/3.4.0/src/kvilib/tal/kvi_tal_groupbox.h b/3.4.0/src/kvilib/tal/kvi_tal_groupbox.h deleted file mode 100644 index c13660e1ef..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_groupbox.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _KVI_TAL_GROUPBOX_H_ -#define _KVI_TAL_GROUPBOX_H_ - -//============================================================================= -// -// File : kvi_tal_groupbox.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_groupbox_qt4.h" -#else - #include "kvi_tal_groupbox_qt3.h" -#endif - -#endif // _KVI_TAL_GROUPBOX_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_groupbox_qt3.h b/3.4.0/src/kvilib/tal/kvi_tal_groupbox_qt3.h deleted file mode 100644 index d11ffe8422..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_groupbox_qt3.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _KVI_TAL_GROUPBOX_QT3_H_ -#define _KVI_TAL_GROUPBOX_QT3_H_ - -//============================================================================= -// -// File : kvi_tal_groupbox_qt3.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <qgroupbox.h> - -class KVILIB_API KviTalGroupBox : public QGroupBox -{ - Q_OBJECT -public: - KviTalGroupBox(QWidget * parent = 0) - : QGroupBox(parent) {}; - KviTalGroupBox(const QString & title,QWidget * parent = 0) - : QGroupBox(title,parent) {}; - KviTalGroupBox(int strips,Qt::Orientation orientation,QWidget * parent = 0) - : QGroupBox(strips,orientation,parent) {}; - KviTalGroupBox(int strips,Qt::Orientation orientation,const QString & title,QWidget * parent = 0) - : QGroupBox(strips,orientation,title,parent) {}; - ~KviTalGroupBox() {}; -}; - - - -#endif // _KVI_TAL_GROUPBOX_QT3_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_groupbox_qt4.h b/3.4.0/src/kvilib/tal/kvi_tal_groupbox_qt4.h deleted file mode 100644 index f795ee3d37..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_groupbox_qt4.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _KVI_TAL_GROUPBOX_QT4_H_ -#define _KVI_TAL_GROUPBOX_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_groupbox_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <q3groupbox.h> - -class KVILIB_API KviTalGroupBox : public Q3GroupBox -{ - Q_OBJECT -public: - KviTalGroupBox(QWidget * parent = 0) - : Q3GroupBox(parent) {}; - KviTalGroupBox(const QString & title,QWidget * parent = 0) - : Q3GroupBox(title,parent) {}; - KviTalGroupBox(int strips,Qt::Orientation orientation,QWidget * parent = 0) - : Q3GroupBox(strips,orientation,parent) {}; - KviTalGroupBox(int strips,Qt::Orientation orientation,const QString & title,QWidget * parent = 0) - : Q3GroupBox(strips,orientation,title,parent) {}; - ~KviTalGroupBox() {}; -}; - - - -#endif // _KVI_TAL_GROUPBOX_QT4_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_hbox.cpp b/3.4.0/src/kvilib/tal/kvi_tal_hbox.cpp deleted file mode 100644 index 7496644981..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_hbox.cpp +++ /dev/null @@ -1,32 +0,0 @@ -//============================================================================= -// -// File : kvi_tal_hbox.cpp -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_tal_hbox.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_hbox_qt4.moc" -#else - #include "kvi_tal_hbox_qt3.moc" -#endif diff --git a/3.4.0/src/kvilib/tal/kvi_tal_hbox.h b/3.4.0/src/kvilib/tal/kvi_tal_hbox.h deleted file mode 100644 index 1122ea3d1c..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_hbox.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _KVI_TAL_HBOX_H_ -#define _KVI_TAL_HBOX_H_ - -//============================================================================= -// -// File : kvi_tal_hbox.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_hbox_qt4.h" -#else - #include "kvi_tal_hbox_qt3.h" -#endif - -#endif // _KVI_TAL_HBOX_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_hbox_qt3.h b/3.4.0/src/kvilib/tal/kvi_tal_hbox_qt3.h deleted file mode 100644 index 2749143db6..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_hbox_qt3.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _KVI_TAL_HBOX_QT3_H_ -#define _KVI_TAL_HBOX_QT3_H_ - -//============================================================================= -// -// File : kvi_tal_hbox_qt3.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qhbox.h> - -class KVILIB_API KviTalHBox : public QHBox -{ - Q_OBJECT -public: - KviTalHBox(QWidget * pParent) - : QHBox(pParent) {}; - virtual ~KviTalHBox() {}; -}; - -#endif // _KVI_TAL_HBOX_QT3_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_hbox_qt4.h b/3.4.0/src/kvilib/tal/kvi_tal_hbox_qt4.h deleted file mode 100644 index e58dbd20ba..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_hbox_qt4.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _KVI_TAL_HBOX_QT4_H_ -#define _KVI_TAL_HBOX_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_hbox_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <q3hbox.h> - -class KVILIB_API KviTalHBox : public Q3HBox -{ - Q_OBJECT -public: - KviTalHBox(QWidget * pParent,char* name=0) - : Q3HBox(pParent,name) {}; - virtual ~KviTalHBox() {}; -}; - -#endif // _KVI_TAL_HBOX_QT4_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_iconview.cpp b/3.4.0/src/kvilib/tal/kvi_tal_iconview.cpp deleted file mode 100644 index b045fe44b1..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_iconview.cpp +++ /dev/null @@ -1,215 +0,0 @@ -//============================================================================= -// -// File : kvi_tal_iconview.cpp -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_tal_iconview.h" - -#ifdef COMPILE_USE_QT4 - - KviTalIconView::KviTalIconView(QWidget * pParent,Qt::WFlags f) - : Q3IconView(pParent,0,f) - { - connect(this,SIGNAL(selectionChanged(Q3IconViewItem *)),this,SLOT(redirect_selectionChanged(Q3IconViewItem *))); - connect(this,SIGNAL(currentChanged(Q3IconViewItem *)),this,SLOT(redirect_currentChanged(Q3IconViewItem *))); - connect(this,SIGNAL(clicked(Q3IconViewItem *)),this,SLOT(redirect_clicked(Q3IconViewItem *))); - connect(this,SIGNAL(clicked(Q3IconViewItem *,const QPoint &)),this,SLOT(redirect_clicked(Q3IconViewItem *,const QPoint &))); - connect(this,SIGNAL(pressed(Q3IconViewItem *)),this,SLOT(redirect_pressed(Q3IconViewItem *))); - connect(this,SIGNAL(pressed(Q3IconViewItem *,const QPoint &)),this,SLOT(redirect_pressed(Q3IconViewItem *,const QPoint &))); - connect(this,SIGNAL(doubleClicked(Q3IconViewItem *)),this,SLOT(redirect_doubleClicked(Q3IconViewItem *))); - connect(this,SIGNAL(returnPressed(Q3IconViewItem *)),this,SLOT(redirect_returnPressed(Q3IconViewItem *))); - connect(this,SIGNAL(rightButtonClicked(Q3IconViewItem *,const QPoint &)),this,SLOT(redirect_rightButtonClicked(Q3IconViewItem *,const QPoint &))); - connect(this,SIGNAL(rightButtonPressed(Q3IconViewItem *,const QPoint &)),this,SLOT(redirect_rightButtonPressed(Q3IconViewItem *,const QPoint &))); - connect(this,SIGNAL(mouseButtonClicked(int,Q3IconViewItem *,const QPoint &)),this,SLOT(redirect_mouseButtonClicked(int,Q3IconViewItem *,const QPoint &))); - connect(this,SIGNAL(mouseButtonPressed(int,Q3IconViewItem *,const QPoint &)),this,SLOT(redirect_mouseButtonPressed(int,Q3IconViewItem *,const QPoint &))); - connect(this,SIGNAL(contextMenuRequested(Q3IconViewItem *,const QPoint &)),this,SLOT(redirect_contextMenuRequested(Q3IconViewItem *,const QPoint &))); - connect(this,SIGNAL(onItem(Q3IconViewItem *)),this,SLOT(redirect_onItem(Q3IconViewItem *))); - } - - void KviTalIconView::redirect_selectionChanged(Q3IconViewItem * pItem) - { - emit selectionChanged((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_currentChanged(Q3IconViewItem * pItem) - { - emit currentChanged((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_clicked(Q3IconViewItem * pItem) - { - emit clicked((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_clicked(Q3IconViewItem * pItem,const QPoint &pnt) - { - emit clicked((KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_pressed(Q3IconViewItem * pItem) - { - emit pressed((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_pressed(Q3IconViewItem * pItem,const QPoint &pnt) - { - emit pressed((KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_doubleClicked(Q3IconViewItem * pItem) - { - emit doubleClicked((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_returnPressed(Q3IconViewItem * pItem) - { - emit returnPressed((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_rightButtonClicked(Q3IconViewItem * pItem,const QPoint &pnt) - { - emit rightButtonClicked((KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_rightButtonPressed(Q3IconViewItem * pItem,const QPoint &pnt) - { - emit rightButtonPressed((KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_mouseButtonClicked(int iButton,Q3IconViewItem * pItem,const QPoint &pnt) - { - emit mouseButtonClicked(iButton,(KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_mouseButtonPressed(int iButton,Q3IconViewItem * pItem,const QPoint &pnt) - { - emit mouseButtonPressed(iButton,(KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_contextMenuRequested(Q3IconViewItem * pItem,const QPoint &pnt) - { - emit contextMenuRequested((KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_onItem(Q3IconViewItem * pItem) - { - emit onItem((KviTalIconViewItem *)pItem); - } - - - #include "kvi_tal_iconview_qt4.moc" -#else - - KviTalIconView::KviTalIconView(QWidget * pParent,Qt::WFlags f) - : QIconView(pParent,0,f) - { - connect(this,SIGNAL(selectionChanged(QIconViewItem *)),this,SLOT(redirect_selectionChanged(QIconViewItem *))); - connect(this,SIGNAL(currentChanged(QIconViewItem *)),this,SLOT(redirect_currentChanged(QIconViewItem *))); - connect(this,SIGNAL(clicked(QIconViewItem *)),this,SLOT(redirect_clicked(QIconViewItem *))); - connect(this,SIGNAL(clicked(QIconViewItem *,const QPoint &)),this,SLOT(redirect_clicked(QIconViewItem *,const QPoint &))); - connect(this,SIGNAL(pressed(QIconViewItem *)),this,SLOT(redirect_pressed(QIconViewItem *))); - connect(this,SIGNAL(pressed(QIconViewItem *,const QPoint &)),this,SLOT(redirect_pressed(QIconViewItem *,const QPoint &))); - connect(this,SIGNAL(doubleClicked(QIconViewItem *)),this,SLOT(redirect_doubleClicked(QIconViewItem *))); - connect(this,SIGNAL(returnPressed(QIconViewItem *)),this,SLOT(redirect_returnPressed(QIconViewItem *))); - connect(this,SIGNAL(rightButtonClicked(QIconViewItem *,const QPoint &)),this,SLOT(redirect_rightButtonClicked(QIconViewItem *,const QPoint &))); - connect(this,SIGNAL(rightButtonPressed(QIconViewItem *,const QPoint &)),this,SLOT(redirect_rightButtonPressed(QIconViewItem *,const QPoint &))); - connect(this,SIGNAL(mouseButtonClicked(int,QIconViewItem *,const QPoint &)),this,SLOT(redirect_mouseButtonClicked(int,QIconViewItem *,const QPoint &))); - connect(this,SIGNAL(mouseButtonPressed(int,QIconViewItem *,const QPoint &)),this,SLOT(redirect_mouseButtonPressed(int,QIconViewItem *,const QPoint &))); - connect(this,SIGNAL(contextMenuRequested(QIconViewItem *,const QPoint &)),this,SLOT(redirect_contextMenuRequested(QIconViewItem *,const QPoint &))); - connect(this,SIGNAL(onItem(QIconViewItem *)),this,SLOT(redirect_onItem(QIconViewItem *))); - } - - void KviTalIconView::redirect_selectionChanged(QIconViewItem * pItem) - { - emit selectionChanged((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_currentChanged(QIconViewItem * pItem) - { - emit currentChanged((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_clicked(QIconViewItem * pItem) - { - emit clicked((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_clicked(QIconViewItem * pItem,const QPoint &pnt) - { - emit clicked((KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_pressed(QIconViewItem * pItem) - { - emit pressed((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_pressed(QIconViewItem * pItem,const QPoint &pnt) - { - emit pressed((KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_doubleClicked(QIconViewItem * pItem) - { - emit doubleClicked((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_returnPressed(QIconViewItem * pItem) - { - emit returnPressed((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_rightButtonClicked(QIconViewItem * pItem,const QPoint &pnt) - { - emit rightButtonClicked((KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_rightButtonPressed(QIconViewItem * pItem,const QPoint &pnt) - { - emit rightButtonPressed((KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_mouseButtonClicked(int iButton,QIconViewItem * pItem,const QPoint &pnt) - { - emit mouseButtonClicked(iButton,(KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_mouseButtonPressed(int iButton,QIconViewItem * pItem,const QPoint &pnt) - { - emit mouseButtonPressed(iButton,(KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_contextMenuRequested(QIconViewItem * pItem,const QPoint &pnt) - { - emit contextMenuRequested((KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_onItem(QIconViewItem * pItem) - { - emit onItem((KviTalIconViewItem *)pItem); - } - - - #include "kvi_tal_iconview_qt3.moc" -#endif - diff --git a/3.4.0/src/kvilib/tal/kvi_tal_iconview.h b/3.4.0/src/kvilib/tal/kvi_tal_iconview.h deleted file mode 100644 index 1ef7ee8d15..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_iconview.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _KVI_TAL_ICONVIEW_H_ -#define _KVI_TAL_ICONVIEW_H_ - -//============================================================================= -// -// File : kvi_tal_iconview.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_iconview_qt4.h" -#else - #include "kvi_tal_iconview_qt3.h" -#endif - -#endif // _KVI_TAL_ICONVIEW_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_iconview_qt3.h b/3.4.0/src/kvilib/tal/kvi_tal_iconview_qt3.h deleted file mode 100644 index 371a296d6b..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_iconview_qt3.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef _KVI_TAL_ICONVIEW_QT3_H_ -#define _KVI_TAL_ICONVIEW_QT3_H_ - -//============================================================================= -// -// File : kvi_tal_iconview_qt3.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" - -#include <qiconview.h> - -class KviTalIconViewItem; - - -class KVILIB_API KviTalIconView : public QIconView -{ - Q_OBJECT -public: - KviTalIconView(QWidget * pParent,Qt::WFlags f = 0); - virtual ~KviTalIconView() {}; -signals: - void selectionChanged(KviTalIconViewItem * pItem); - void currentChanged(KviTalIconViewItem * pItem); - void clicked(KviTalIconViewItem * pItem); - void clicked(KviTalIconViewItem * pItem,const QPoint &pnt); - void pressed(KviTalIconViewItem * pItem); - void pressed(KviTalIconViewItem * pItem,const QPoint &pnt); - void doubleClicked(KviTalIconViewItem * pItem); - void returnPressed(KviTalIconViewItem * pItem); - void rightButtonClicked(KviTalIconViewItem * pItem,const QPoint &pnt); - void rightButtonPressed(KviTalIconViewItem * pItem,const QPoint &pnt); - void mouseButtonClicked(int iButton,KviTalIconViewItem * pItem,const QPoint &pnt); - void mouseButtonPressed(int iButton,KviTalIconViewItem * pItem,const QPoint &pnt); - void contextMenuRequested(KviTalIconViewItem * pItem,const QPoint &pnt); - void onItem(KviTalIconViewItem * pItem); -protected slots: - void redirect_selectionChanged(QIconViewItem * pItem); - void redirect_currentChanged(QIconViewItem * pItem); - void redirect_clicked(QIconViewItem * pItem); - void redirect_clicked(QIconViewItem * pItem,const QPoint &pnt); - void redirect_pressed(QIconViewItem * pItem); - void redirect_pressed(QIconViewItem * pItem,const QPoint &pnt); - void redirect_doubleClicked(QIconViewItem * pItem); - void redirect_returnPressed(QIconViewItem * pItem); - void redirect_rightButtonClicked(QIconViewItem * pItem,const QPoint &pnt); - void redirect_rightButtonPressed(QIconViewItem * pItem,const QPoint &pnt); - void redirect_mouseButtonClicked(int iButton,QIconViewItem * pItem,const QPoint &pnt); - void redirect_mouseButtonPressed(int iButton,QIconViewItem * pItem,const QPoint &pnt); - void redirect_contextMenuRequested(QIconViewItem * pItem,const QPoint &pnt); - void redirect_onItem(QIconViewItem * pItem); -public: - KviTalIconViewItem * firstItem() const { return (KviTalIconViewItem *)QIconView::firstItem(); }; - KviTalIconViewItem * lastItem() const { return (KviTalIconViewItem *)QIconView::lastItem(); }; - KviTalIconViewItem * currentItem() const { return (KviTalIconViewItem *)QIconView::currentItem(); }; -}; - -class KVILIB_API KviTalIconViewItem : public QIconViewItem -{ -public: - KviTalIconViewItem(KviTalIconView * parent) - : QIconViewItem(parent) {}; - KviTalIconViewItem(KviTalIconView * parent,KviTalIconViewItem * after) - : QIconViewItem(parent,after) {}; - KviTalIconViewItem(KviTalIconView * parent, const QString & text) - : QIconViewItem(parent,text) {}; - KviTalIconViewItem(KviTalIconView * parent, KviTalIconViewItem * after, const QString & text) - : QIconViewItem(parent,after,text) {}; - KviTalIconViewItem(KviTalIconView * parent, const QString & text, const QPixmap & icon) - : QIconViewItem(parent,text,icon) {}; - KviTalIconViewItem(KviTalIconView * parent, KviTalIconViewItem * after, const QString & text, const QPixmap & icon) - : QIconViewItem(parent,after,text,icon) {}; -public: - KviTalIconView * iconView() const { return (KviTalIconView *)QIconViewItem::iconView(); }; - KviTalIconViewItem * prevItem() const { return (KviTalIconViewItem *)QIconViewItem::prevItem(); }; - KviTalIconViewItem * nextItem() const { return (KviTalIconViewItem *)QIconViewItem::nextItem(); }; -}; - - -#endif // _KVI_TAL_ICONVIEW_QT3_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_iconview_qt4.h b/3.4.0/src/kvilib/tal/kvi_tal_iconview_qt4.h deleted file mode 100644 index 899acaac26..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_iconview_qt4.h +++ /dev/null @@ -1,99 +0,0 @@ -#ifndef _KVI_TAL_ICONVIEW_QT4_H_ -#define _KVI_TAL_ICONVIEW_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_iconview_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 440, Boston, MA 02111-1407, USA. -// -//============================================================================= - -#include "kvi_settings.h" -#include "kvi_qstring.h" - -#include <q3iconview.h> - -class KviTalIconViewItem; - -class KVILIB_API KviTalIconView : public Q3IconView -{ - Q_OBJECT -public: - KviTalIconView(QWidget * pParent,Qt::WFlags f = 0); - virtual ~KviTalIconView() {}; -signals: - void selectionChanged(KviTalIconViewItem * pItem); - void currentChanged(KviTalIconViewItem * pItem); - void clicked(KviTalIconViewItem * pItem); - void clicked(KviTalIconViewItem * pItem,const QPoint &pnt); - void pressed(KviTalIconViewItem * pItem); - void pressed(KviTalIconViewItem * pItem,const QPoint &pnt); - void doubleClicked(KviTalIconViewItem * pItem); - void returnPressed(KviTalIconViewItem * pItem); - void rightButtonClicked(KviTalIconViewItem * pItem,const QPoint &pnt); - void rightButtonPressed(KviTalIconViewItem * pItem,const QPoint &pnt); - void mouseButtonClicked(int iButton,KviTalIconViewItem * pItem,const QPoint &pnt); - void mouseButtonPressed(int iButton,KviTalIconViewItem * pItem,const QPoint &pnt); - void contextMenuRequested(KviTalIconViewItem * pItem,const QPoint &pnt); - void onItem(KviTalIconViewItem * pItem); -protected slots: - void redirect_selectionChanged(Q3IconViewItem * pItem); - void redirect_currentChanged(Q3IconViewItem * pItem); - void redirect_clicked(Q3IconViewItem * pItem); - void redirect_clicked(Q3IconViewItem * pItem,const QPoint &pnt); - void redirect_pressed(Q3IconViewItem * pItem); - void redirect_pressed(Q3IconViewItem * pItem,const QPoint &pnt); - void redirect_doubleClicked(Q3IconViewItem * pItem); - void redirect_returnPressed(Q3IconViewItem * pItem); - void redirect_rightButtonClicked(Q3IconViewItem * pItem,const QPoint &pnt); - void redirect_rightButtonPressed(Q3IconViewItem * pItem,const QPoint &pnt); - void redirect_mouseButtonClicked(int iButton,Q3IconViewItem * pItem,const QPoint &pnt); - void redirect_mouseButtonPressed(int iButton,Q3IconViewItem * pItem,const QPoint &pnt); - void redirect_contextMenuRequested(Q3IconViewItem * pItem,const QPoint &pnt); - void redirect_onItem(Q3IconViewItem * pItem); -public: - KviTalIconViewItem * firstItem() const { return (KviTalIconViewItem *)Q3IconView::firstItem(); }; - KviTalIconViewItem * lastItem() const { return (KviTalIconViewItem *)Q3IconView::lastItem(); }; - KviTalIconViewItem * currentItem() const { return (KviTalIconViewItem *)Q3IconView::currentItem(); }; -}; - -class KVILIB_API KviTalIconViewItem : public Q3IconViewItem -{ -public: - KviTalIconViewItem(KviTalIconView * parent) - : Q3IconViewItem(parent) {}; - KviTalIconViewItem(KviTalIconView * parent,KviTalIconViewItem * after) - : Q3IconViewItem(parent,after) {}; - KviTalIconViewItem(KviTalIconView * parent, const QString & text) - : Q3IconViewItem(parent,text) {}; - KviTalIconViewItem(KviTalIconView * parent, KviTalIconViewItem * after, const QString & text) - : Q3IconViewItem(parent,after,text) {}; - KviTalIconViewItem(KviTalIconView * parent, const QString & text, const QPixmap & icon) - : Q3IconViewItem(parent,text,icon) {}; - KviTalIconViewItem(KviTalIconView * parent, KviTalIconViewItem * after, const QString & text, const QPixmap & icon) - : Q3IconViewItem(parent,after,text,icon) {}; -public: - KviTalIconView * iconView() const { return (KviTalIconView *)Q3IconViewItem::iconView(); }; - KviTalIconViewItem * prevItem() const { return (KviTalIconViewItem *)Q3IconViewItem::prevItem(); }; - KviTalIconViewItem * nextItem() const { return (KviTalIconViewItem *)Q3IconViewItem::nextItem(); }; -}; - - -#endif // _KVI_TAL_ICONVIEW_QT4_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_listbox.cpp b/3.4.0/src/kvilib/tal/kvi_tal_listbox.cpp deleted file mode 100644 index 76eaa4dc76..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_listbox.cpp +++ /dev/null @@ -1,513 +0,0 @@ -//============================================================================= -// -// File : kvi_tal_listbox.cpp -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_tal_listbox.h" - -#ifdef COMPILE_USE_QT4 - #include <qpainter.h> - #include <qstyle.h> - #include <qapplication.h> - - KviTalListBox::KviTalListBox(QWidget * pParent,Qt::WFlags f) - : Q3ListBox(pParent,0,f) - { - connect(this,SIGNAL(highlighted(Q3ListBoxItem *)),this,SLOT(redirect_highlighted(Q3ListBoxItem *))); - connect(this,SIGNAL(selected(Q3ListBoxItem *)),this,SLOT(redirect_selected(Q3ListBoxItem *))); - connect(this,SIGNAL(selectionChanged(Q3ListBoxItem *)),this,SLOT(redirect_selectionChanged(Q3ListBoxItem *))); - connect(this,SIGNAL(currentChanged(Q3ListBoxItem *)),this,SLOT(redirect_currentChanged(Q3ListBoxItem *))); - connect(this,SIGNAL(clicked(Q3ListBoxItem *)),this,SLOT(redirect_clicked(Q3ListBoxItem *))); - connect(this,SIGNAL(clicked(Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_clicked(Q3ListBoxItem *,const QPoint &))); - connect(this,SIGNAL(pressed(Q3ListBoxItem *)),this,SLOT(redirect_pressed(Q3ListBoxItem *))); - connect(this,SIGNAL(pressed(Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_pressed(Q3ListBoxItem *,const QPoint &))); - connect(this,SIGNAL(doubleClicked(Q3ListBoxItem *)),this,SLOT(redirect_doubleClicked(Q3ListBoxItem *))); - connect(this,SIGNAL(returnPressed(Q3ListBoxItem *)),this,SLOT(redirect_returnPressed(Q3ListBoxItem *))); - connect(this,SIGNAL(rightButtonClicked(Q3ListBoxItem *, const QPoint &)),this,SLOT(redirect_rightButtonClicked(Q3ListBoxItem *, const QPoint &))); - connect(this,SIGNAL(rightButtonPressed(Q3ListBoxItem *, const QPoint &)),this,SLOT(redirect_rightButtonPressed(Q3ListBoxItem *, const QPoint &))); - connect(this,SIGNAL(mouseButtonPressed(int,Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_mouseButtonPressed(int,Q3ListBoxItem *,const QPoint &))); - connect(this,SIGNAL(mouseButtonClicked(int,Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_mouseButtonClicked(int,Q3ListBoxItem *,const QPoint &))); - connect(this,SIGNAL(contextMenuRequested(Q3ListBoxItem *,const QPoint &)),this,SLOT(redirect_contextMenuRequested(Q3ListBoxItem *,const QPoint &))); - connect(this,SIGNAL(onItem(Q3ListBoxItem *)),this,SLOT(redirect_onItem(Q3ListBoxItem *))); - } - - void KviTalListBox::redirect_highlighted(Q3ListBoxItem *item) - { - emit highlighted((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_selected(Q3ListBoxItem *item) - { - emit selected((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_selectionChanged(Q3ListBoxItem * item) - { - emit selectionChanged((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_currentChanged(Q3ListBoxItem * item) - { - emit currentChanged((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_clicked(Q3ListBoxItem * item) - { - emit clicked((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_clicked(Q3ListBoxItem * item,const QPoint & pnt) - { - emit clicked((KviTalListBoxItem *)item,pnt); - } - - void KviTalListBox::redirect_pressed(Q3ListBoxItem * item) - { - emit pressed((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_pressed(Q3ListBoxItem * item,const QPoint & pnt) - { - emit pressed((KviTalListBoxItem *)item,pnt); - } - - void KviTalListBox::redirect_doubleClicked(Q3ListBoxItem * item) - { - emit doubleClicked((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_returnPressed(Q3ListBoxItem * item) - { - emit returnPressed((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_rightButtonClicked(Q3ListBoxItem * item, const QPoint &pnt) - { - emit rightButtonClicked((KviTalListBoxItem *)item,pnt); - } - - void KviTalListBox::redirect_rightButtonPressed(Q3ListBoxItem * item, const QPoint &pnt) - { - emit rightButtonPressed((KviTalListBoxItem *)item,pnt); - } - - void KviTalListBox::redirect_mouseButtonPressed(int button,Q3ListBoxItem * item,const QPoint & pos) - { - emit mouseButtonPressed(button,(KviTalListBoxItem *)item,pos); - } - - void KviTalListBox::redirect_mouseButtonClicked(int button,Q3ListBoxItem * item,const QPoint & pos) - { - emit mouseButtonClicked(button,(KviTalListBoxItem *)item,pos); - } - - void KviTalListBox::redirect_contextMenuRequested(Q3ListBoxItem * item,const QPoint & pos) - { - emit contextMenuRequested((KviTalListBoxItem *)item,pos); - } - - void KviTalListBox::redirect_onItem(Q3ListBoxItem * i) - { - emit onItem((KviTalListBoxItem *)i); - } - - KviTalListBoxText::KviTalListBoxText(KviTalListBox *listbox, const QString &text) - :KviTalListBoxItem(listbox) - { - setText(text); - } - - KviTalListBoxText::KviTalListBoxText(const QString &text) - :KviTalListBoxItem() - { - setText(text); - } - - KviTalListBoxText::KviTalListBoxText(KviTalListBox* listbox, const QString &text, KviTalListBoxItem *after) - : KviTalListBoxItem(listbox, after) - { - setText(text); - } - - KviTalListBoxText::~KviTalListBoxText() - { - } - - void KviTalListBoxText::paint(QPainter *painter) - { - int itemHeight = height(listBox()); - QFontMetrics fm = painter->fontMetrics(); - int yPos = ((itemHeight - fm.height()) / 2) + fm.ascent(); - painter->drawText(3, yPos, text()); - } - - int KviTalListBoxText::height(const KviTalListBox* lb) const - { - int h = lb ? lb->fontMetrics().lineSpacing() + 2 : 0; - return qMax(h, QApplication::globalStrut().height()); - } - - int KviTalListBoxText::width(const KviTalListBox* lb) const - { - int w = lb ? lb->fontMetrics().width(text()) + 6 : 0; - return qMax(w, QApplication::globalStrut().width()); - } - - int KviTalListBoxText::rtti() const - { - return RTTI; - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &pixmap) - : KviTalListBoxItem(listbox) - { - pm = pixmap; - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(const QPixmap &pixmap) - : KviTalListBoxItem() - { - pm = pixmap; - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &pixmap, KviTalListBoxItem *after) - : KviTalListBoxItem(listbox, after) - { - pm = pixmap; - } - - KviTalListBoxPixmap::~KviTalListBoxPixmap() - { - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &pix, const QString& text) - : KviTalListBoxItem(listbox) - { - pm = pix; - setText(text); - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(const QPixmap & pix, const QString& text) - : KviTalListBoxItem() - { - pm = pix; - setText(text); - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap & pix, const QString& text, - KviTalListBoxItem *after) - : KviTalListBoxItem(listbox, after) - { - pm = pix; - setText(text); - } - - void KviTalListBoxPixmap::paint(QPainter *painter) - { - int itemHeight = height(listBox()); - int yPos; - - const QPixmap *pm = pixmap(); - if (pm && ! pm->isNull()) { - yPos = (itemHeight - pm->height()) / 2; - painter->drawPixmap(3, yPos, *pm); - } - - if (!text().isEmpty()) { - QFontMetrics fm = painter->fontMetrics(); - yPos = ((itemHeight - fm.height()) / 2) + fm.ascent(); - painter->drawText(pm->width() + 5, yPos, text()); - } - } - - int KviTalListBoxPixmap::height(const KviTalListBox* lb) const - { - int h; - if (text().isEmpty()) - h = pm.height(); - else - h = qMax(pm.height(), lb->fontMetrics().lineSpacing() + 2); - return qMax(h, QApplication::globalStrut().height()); - } - - int KviTalListBoxPixmap::width(const KviTalListBox* lb) const - { - if (text().isEmpty()) - return qMax(pm.width() + 6, QApplication::globalStrut().width()); - return qMax(pm.width() + lb->fontMetrics().width(text()) + 6, - QApplication::globalStrut().width()); - } - - int KviTalListBoxPixmap::rtti() const - { - return RTTI; - } - - - #include "kvi_tal_listbox_qt4.moc" -#else - #include <qpainter.h> - #include <qstyle.h> - #include <qapplication.h> - - - KviTalListBox::KviTalListBox(QWidget * pParent,Qt::WFlags f) - : QListBox(pParent,0,f) - { - connect(this,SIGNAL(highlighted(QListBoxItem *)),this,SLOT(redirect_highlighted(QListBoxItem *))); - connect(this,SIGNAL(selected(QListBoxItem *)),this,SLOT(redirect_selected(QListBoxItem *))); - connect(this,SIGNAL(selectionChanged(QListBoxItem *)),this,SLOT(redirect_selectionChanged(QListBoxItem *))); - connect(this,SIGNAL(currentChanged(QListBoxItem *)),this,SLOT(redirect_currentChanged(QListBoxItem *))); - connect(this,SIGNAL(clicked(QListBoxItem *)),this,SLOT(redirect_clicked(QListBoxItem *))); - connect(this,SIGNAL(clicked(QListBoxItem *,const QPoint &)),this,SLOT(redirect_clicked(QListBoxItem *,const QPoint &))); - connect(this,SIGNAL(pressed(QListBoxItem *)),this,SLOT(redirect_pressed(QListBoxItem *))); - connect(this,SIGNAL(pressed(QListBoxItem *,const QPoint &)),this,SLOT(redirect_pressed(QListBoxItem *,const QPoint &))); - connect(this,SIGNAL(doubleClicked(QListBoxItem *)),this,SLOT(redirect_doubleClicked(QListBoxItem *))); - connect(this,SIGNAL(returnPressed(QListBoxItem *)),this,SLOT(redirect_returnPressed(QListBoxItem *))); - connect(this,SIGNAL(rightButtonClicked(QListBoxItem *, const QPoint &)),this,SLOT(redirect_rightButtonClicked(QListBoxItem *, const QPoint &))); - connect(this,SIGNAL(rightButtonPressed(QListBoxItem *, const QPoint &)),this,SLOT(redirect_rightButtonPressed(QListBoxItem *, const QPoint &))); - connect(this,SIGNAL(mouseButtonPressed(int,QListBoxItem *,const QPoint &)),this,SLOT(redirect_mouseButtonPressed(int,QListBoxItem *,const QPoint &))); - connect(this,SIGNAL(mouseButtonClicked(int,QListBoxItem *,const QPoint &)),this,SLOT(redirect_mouseButtonClicked(int,QListBoxItem *,const QPoint &))); - connect(this,SIGNAL(contextMenuRequested(QListBoxItem *,const QPoint &)),this,SLOT(redirect_contextMenuRequested(QListBoxItem *,const QPoint &))); - connect(this,SIGNAL(onItem(QListBoxItem *)),this,SLOT(redirect_onItem(QListBoxItem *))); - } - - void KviTalListBox::redirect_highlighted(QListBoxItem *item) - { - emit highlighted((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_selected(QListBoxItem *item) - { - emit selected((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_selectionChanged(QListBoxItem * item) - { - emit selectionChanged((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_currentChanged(QListBoxItem * item) - { - emit currentChanged((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_clicked(QListBoxItem * item) - { - emit clicked((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_clicked(QListBoxItem * item,const QPoint & pnt) - { - emit clicked((KviTalListBoxItem *)item,pnt); - } - - void KviTalListBox::redirect_pressed(QListBoxItem * item) - { - emit pressed((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_pressed(QListBoxItem * item,const QPoint & pnt) - { - emit pressed((KviTalListBoxItem *)item,pnt); - } - - void KviTalListBox::redirect_doubleClicked(QListBoxItem * item) - { - emit doubleClicked((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_returnPressed(QListBoxItem * item) - { - emit returnPressed((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_rightButtonClicked(QListBoxItem * item, const QPoint &pnt) - { - emit rightButtonClicked((KviTalListBoxItem *)item,pnt); - } - - void KviTalListBox::redirect_rightButtonPressed(QListBoxItem * item, const QPoint &pnt) - { - emit rightButtonPressed((KviTalListBoxItem *)item,pnt); - } - - void KviTalListBox::redirect_mouseButtonPressed(int button,QListBoxItem * item,const QPoint & pos) - { - emit mouseButtonPressed(button,(KviTalListBoxItem *)item,pos); - } - - void KviTalListBox::redirect_mouseButtonClicked(int button,QListBoxItem * item,const QPoint & pos) - { - emit mouseButtonClicked(button,(KviTalListBoxItem *)item,pos); - } - - void KviTalListBox::redirect_contextMenuRequested(QListBoxItem * item,const QPoint & pos) - { - emit contextMenuRequested((KviTalListBoxItem *)item,pos); - } - - void KviTalListBox::redirect_onItem(QListBoxItem * i) - { - emit onItem((KviTalListBoxItem *)i); - } - - KviTalListBoxText::KviTalListBoxText( KviTalListBox *listbox, const QString &text ) - :KviTalListBoxItem( listbox ) - { - setText( text ); - } - - KviTalListBoxText::KviTalListBoxText( const QString &text ) - :KviTalListBoxItem() - { - setText( text ); - } - - KviTalListBoxText::KviTalListBoxText( KviTalListBox* listbox, const QString &text, KviTalListBoxItem *after ) - : KviTalListBoxItem( listbox, after ) - { - setText( text ); - } - - KviTalListBoxText::~KviTalListBoxText() - { - } - - void KviTalListBoxText::paint( QPainter *painter ) - { - int itemHeight = height( listBox() ); - QFontMetrics fm = painter->fontMetrics(); - int yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent(); - painter->drawText( 3, yPos, text() ); - } - - int KviTalListBoxText::height( const KviTalListBox* lb ) const - { - int h = lb ? lb->fontMetrics().lineSpacing() + 2 : 0; - return QMAX( h, QApplication::globalStrut().height() ); - } - - int KviTalListBoxText::width( const KviTalListBox* lb ) const - { - int w = lb ? lb->fontMetrics().width( text() ) + 6 : 0; - return QMAX( w, QApplication::globalStrut().width() ); - } - - int KviTalListBoxText::RTTI = 1; - - int KviTalListBoxText::rtti() const - { - return RTTI; - } - - KviTalListBoxPixmap::KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap &pixmap ) - : KviTalListBoxItem( listbox ) - { - pm = pixmap; - } - - KviTalListBoxPixmap::KviTalListBoxPixmap( const QPixmap &pixmap ) - : KviTalListBoxItem() - { - pm = pixmap; - } - - KviTalListBoxPixmap::KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap &pixmap, KviTalListBoxItem *after ) - : KviTalListBoxItem( listbox, after ) - { - pm = pixmap; - } - - KviTalListBoxPixmap::~KviTalListBoxPixmap() - { - } - - KviTalListBoxPixmap::KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap &pix, const QString& text) - : KviTalListBoxItem( listbox ) - { - pm = pix; - setText( text ); - } - - KviTalListBoxPixmap::KviTalListBoxPixmap( const QPixmap & pix, const QString& text) - : KviTalListBoxItem() - { - pm = pix; - setText( text ); - } - - KviTalListBoxPixmap::KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap & pix, const QString& text, - KviTalListBoxItem *after ) - : KviTalListBoxItem( listbox, after ) - { - pm = pix; - setText( text ); - } - - void KviTalListBoxPixmap::paint( QPainter *painter ) - { - int itemHeight = height( listBox() ); - int yPos; - - const QPixmap *pm = pixmap(); - if ( pm && ! pm->isNull() ) { - yPos = ( itemHeight - pm->height() ) / 2; - painter->drawPixmap( 3, yPos, *pm); - } - - if ( !text().isEmpty() ) { - QFontMetrics fm = painter->fontMetrics(); - yPos = ( ( itemHeight - fm.height() ) / 2 ) + fm.ascent(); - painter->drawText( pm->width() + 5, yPos, text() ); - } - } - - int KviTalListBoxPixmap::height( const KviTalListBox* lb ) const - { - int h; - if ( text().isEmpty() ) - h = pm.height(); - else - h = QMAX( pm.height(), lb->fontMetrics().lineSpacing() + 2 ); - return QMAX( h, QApplication::globalStrut().height() ); - } - - int KviTalListBoxPixmap::width( const KviTalListBox* lb ) const - { - if ( text().isEmpty() ) - return QMAX( pm.width() + 6, QApplication::globalStrut().width() ); - return QMAX( pm.width() + lb->fontMetrics().width( text() ) + 6, - QApplication::globalStrut().width() ); - } - - int KviTalListBoxPixmap::RTTI = 2; - - int KviTalListBoxPixmap::rtti() const - { - return RTTI; - } - - #include "kvi_tal_listbox_qt3.moc" -#endif - diff --git a/3.4.0/src/kvilib/tal/kvi_tal_listbox.h b/3.4.0/src/kvilib/tal/kvi_tal_listbox.h deleted file mode 100644 index 89c4af14ce..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_listbox.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _KVI_TAL_LISTBOX_H_ -#define _KVI_TAL_LISTBOX_H_ - -//============================================================================= -// -// File : kvi_tal_listbox.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -// -// This is the only reasonable CROSS-QT3-QT4-COMPATIBLE implementation -// of QListBox I've been able to find. -// Note that using macros for the items will NOT work since moc -// doesn't expand them. Note also that KviTalListBoxText must -// be fully reimplemented and not be inherited from QListBoxText -// to build up a consistent item object hierarchy. To complete -// the obscenity, we need TWO COMPLETE implementations: one for Qt3 -// and one for Qt4... bleah :D -// -// The code for KviTalListBoxText is adapted from qlistbox.h/cpp -// present in qt 3.3.6 AND in qt 4.1.2. -// - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_listbox_qt4.h" -#else - #include "kvi_tal_listbox_qt3.h" -#endif - -#endif // _KVI_TAL_LISTBOX_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_listbox_qt3.h b/3.4.0/src/kvilib/tal/kvi_tal_listbox_qt3.h deleted file mode 100644 index 91a2849668..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_listbox_qt3.h +++ /dev/null @@ -1,157 +0,0 @@ -#ifndef _KVI_TAL_LISTBOX_QT3_H_ -#define _KVI_TAL_LISTBOX_QT3_H_ - -//============================================================================= -// -// File : kvi_tal_listbox_qt3.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include <qlistbox.h> - -class KviTalListBoxItem; - -class KVILIB_API KviTalListBox : public QListBox -{ - Q_OBJECT -public: - KviTalListBox(QWidget * pParent,Qt::WFlags f = 0); - virtual ~KviTalListBox() {}; -public: - KviTalListBoxItem * firstItem() const { return (KviTalListBoxItem *)QListBox::firstItem(); }; - KviTalListBoxItem * selectedItem() const { return (KviTalListBoxItem *)QListBox::selectedItem(); }; - KviTalListBoxItem * item(int iIndex) const { return (KviTalListBoxItem *)QListBox::item(iIndex); }; -signals: - void highlighted(KviTalListBoxItem *); - void selected(KviTalListBoxItem *); - void selectionChanged(KviTalListBoxItem * item); - void currentChanged(KviTalListBoxItem * item); - void clicked(KviTalListBoxItem * item); - void clicked(KviTalListBoxItem * item,const QPoint & pnt); - void pressed(KviTalListBoxItem * item); - void pressed(KviTalListBoxItem * item,const QPoint & pnt); - void doubleClicked(KviTalListBoxItem * item); - void returnPressed(KviTalListBoxItem * item); - void rightButtonClicked(KviTalListBoxItem *, const QPoint &); - void rightButtonPressed(KviTalListBoxItem *, const QPoint &); - void mouseButtonPressed(int button,KviTalListBoxItem * item,const QPoint & pos); - void mouseButtonClicked(int button,KviTalListBoxItem * item,const QPoint & pos); - void contextMenuRequested(KviTalListBoxItem * item,const QPoint & pos); - void onItem(KviTalListBoxItem * i); -protected slots: - void redirect_highlighted(QListBoxItem *item); - void redirect_selected(QListBoxItem *item); - void redirect_selectionChanged(QListBoxItem * item); - void redirect_currentChanged(QListBoxItem * item); - void redirect_clicked(QListBoxItem * item); - void redirect_clicked(QListBoxItem * item,const QPoint & pnt); - void redirect_pressed(QListBoxItem * item); - void redirect_pressed(QListBoxItem * item,const QPoint & pnt); - void redirect_doubleClicked(QListBoxItem * item); - void redirect_returnPressed(QListBoxItem * item); - void redirect_rightButtonClicked(QListBoxItem * item, const QPoint &pnt); - void redirect_rightButtonPressed(QListBoxItem * item, const QPoint &pnt); - void redirect_mouseButtonPressed(int button,QListBoxItem * item,const QPoint & pos); - void redirect_mouseButtonClicked(int button,QListBoxItem * item,const QPoint & pos); - void redirect_contextMenuRequested(QListBoxItem * item,const QPoint & pos); - void redirect_onItem(QListBoxItem * i); -}; - -class KVILIB_API KviTalListBoxItem : public QListBoxItem -{ -public: - KviTalListBoxItem() - : QListBoxItem() {}; - KviTalListBoxItem(KviTalListBox * pParent) - : QListBoxItem(pParent) {}; - KviTalListBoxItem(KviTalListBox * pParent,KviTalListBoxItem * pAfter) - : QListBoxItem(pParent,pAfter) {}; - virtual ~KviTalListBoxItem() {}; -public: - KviTalListBoxItem * next() const { return (KviTalListBoxItem *)QListBoxItem::next(); }; - KviTalListBoxItem * prev() const { return (KviTalListBoxItem *)QListBoxItem::prev(); }; - KviTalListBox * listBox() const { return (KviTalListBox *)QListBoxItem::listBox(); }; - virtual int height(const KviTalListBox *) const { return 0; }; - int height(const QListBox *lb) const { return height((KviTalListBox *)lb); }; - virtual int width(const KviTalListBox *) const { return 0; }; - int width(const QListBox *lb) const { return width((KviTalListBox *)lb); }; -}; - -class KVILIB_API KviTalListBoxText : public KviTalListBoxItem -{ -public: - KviTalListBoxText( KviTalListBox* listbox, const QString & text=QString::null ); - KviTalListBoxText( const QString & text=QString::null ); - KviTalListBoxText( KviTalListBox* listbox, const QString & text, KviTalListBoxItem *after ); - ~KviTalListBoxText(); - - int height( const KviTalListBox * ) const; - int width( const KviTalListBox * ) const; - - int rtti() const; - static int RTTI; - -protected: - virtual void paint( QPainter * ); - -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - KviTalListBoxText( const KviTalListBoxText & ); - KviTalListBoxText &operator=( const KviTalListBoxText & ); -#endif -}; - - -class KVILIB_API KviTalListBoxPixmap : public KviTalListBoxItem -{ -public: - KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap & ); - KviTalListBoxPixmap( const QPixmap & ); - KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap & pix, KviTalListBoxItem *after ); - KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap &, const QString& ); - KviTalListBoxPixmap( const QPixmap &, const QString& ); - KviTalListBoxPixmap( KviTalListBox* listbox, const QPixmap & pix, const QString&, KviTalListBoxItem *after ); - ~KviTalListBoxPixmap(); - - const QPixmap *pixmap() const { return ± } - - int height( const KviTalListBox * ) const; - int width( const KviTalListBox * ) const; - - int rtti() const; - static int RTTI; - -protected: - virtual void paint( QPainter * ); - -private: - QPixmap pm; -private: // Disabled copy constructor and operator= -#if defined(Q_DISABLE_COPY) - KviTalListBoxPixmap( const KviTalListBoxPixmap & ); - KviTalListBoxPixmap &operator=( const KviTalListBoxPixmap & ); -#endif -}; - - -#endif // _KVI_TAL_LISTBOX_QT3_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_listbox_qt4.h b/3.4.0/src/kvilib/tal/kvi_tal_listbox_qt4.h deleted file mode 100644 index d77dc9e764..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_listbox_qt4.h +++ /dev/null @@ -1,152 +0,0 @@ -#ifndef _KVI_TAL_LISTBOX_QT4_H_ -#define _KVI_TAL_LISTBOX_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_listbox_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <q3listbox.h> - -class KviTalListBoxItem; - - -class KVILIB_API KviTalListBox : public Q3ListBox -{ - Q_OBJECT -public: - KviTalListBox(QWidget * pParent,Qt::WFlags f = 0); - virtual ~KviTalListBox() {}; -public: - KviTalListBoxItem * firstItem() const { return (KviTalListBoxItem *)Q3ListBox::firstItem(); }; - KviTalListBoxItem * selectedItem() const { return (KviTalListBoxItem *)Q3ListBox::selectedItem(); }; - KviTalListBoxItem * item(int iIndex) const { return (KviTalListBoxItem *)Q3ListBox::item(iIndex); }; -signals: - void highlighted(KviTalListBoxItem *); - void selected(KviTalListBoxItem *); - void selectionChanged(KviTalListBoxItem * item); - void currentChanged(KviTalListBoxItem * item); - void clicked(KviTalListBoxItem * item); - void clicked(KviTalListBoxItem * item,const QPoint & pnt); - void pressed(KviTalListBoxItem * item); - void pressed(KviTalListBoxItem * item,const QPoint & pnt); - void doubleClicked(KviTalListBoxItem * item); - void returnPressed(KviTalListBoxItem * item); - void rightButtonClicked(KviTalListBoxItem *, const QPoint &); - void rightButtonPressed(KviTalListBoxItem *, const QPoint &); - void mouseButtonPressed(int button,KviTalListBoxItem * item,const QPoint & pos); - void mouseButtonClicked(int button,KviTalListBoxItem * item,const QPoint & pos); - void contextMenuRequested(KviTalListBoxItem * item,const QPoint & pos); - void onItem(KviTalListBoxItem * i); -protected slots: - void redirect_highlighted(Q3ListBoxItem *); - void redirect_selected(Q3ListBoxItem *); - void redirect_selectionChanged(Q3ListBoxItem * item); - void redirect_currentChanged(Q3ListBoxItem * item); - void redirect_clicked(Q3ListBoxItem * item); - void redirect_clicked(Q3ListBoxItem * item,const QPoint & pnt); - void redirect_pressed(Q3ListBoxItem * item); - void redirect_pressed(Q3ListBoxItem * item,const QPoint & pnt); - void redirect_doubleClicked(Q3ListBoxItem * item); - void redirect_returnPressed(Q3ListBoxItem *); - void redirect_rightButtonClicked(Q3ListBoxItem *, const QPoint &); - void redirect_rightButtonPressed(Q3ListBoxItem *, const QPoint &); - void redirect_mouseButtonPressed(int button,Q3ListBoxItem * item,const QPoint & pos); - void redirect_mouseButtonClicked(int button,Q3ListBoxItem * item,const QPoint & pos); - void redirect_contextMenuRequested(Q3ListBoxItem * item,const QPoint & pos); - void redirect_onItem(Q3ListBoxItem * i); -}; - -class KVILIB_API KviTalListBoxItem : public Q3ListBoxItem -{ -public: - KviTalListBoxItem() - : Q3ListBoxItem() {}; - KviTalListBoxItem(KviTalListBox * pParent) - : Q3ListBoxItem(pParent) {}; - KviTalListBoxItem(KviTalListBox * pParent,KviTalListBoxItem * pAfter) - : Q3ListBoxItem(pParent,pAfter) {}; - virtual ~KviTalListBoxItem() {}; -public: - KviTalListBoxItem * next() const { return (KviTalListBoxItem *)Q3ListBoxItem::next(); }; - KviTalListBoxItem * prev() const { return (KviTalListBoxItem *)Q3ListBoxItem::prev(); }; - KviTalListBox * listBox() const { return (KviTalListBox *)Q3ListBoxItem::listBox(); }; - virtual int height(const KviTalListBox *) const { return 0; }; - int height(const Q3ListBox *lb) const { return height((KviTalListBox *)lb); }; - virtual int width(const KviTalListBox *) const { return 0; }; - int width(const Q3ListBox *lb) const { return width((KviTalListBox *)lb); }; -}; - - -class KVILIB_API KviTalListBoxText : public KviTalListBoxItem -{ -public: - KviTalListBoxText(KviTalListBox* listbox, const QString & text=QString()); - KviTalListBoxText(const QString & text=QString()); - KviTalListBoxText(KviTalListBox* listbox, const QString & text, KviTalListBoxItem *after); - ~KviTalListBoxText(); - - int height(const KviTalListBox *) const; - int width(const KviTalListBox *) const; - - int rtti() const; - enum { RTTI = 1 }; - -protected: - virtual void paint(QPainter *); - -private: - Q_DISABLE_COPY(KviTalListBoxText) -}; - - -class KVILIB_API KviTalListBoxPixmap : public KviTalListBoxItem -{ -public: - KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &); - KviTalListBoxPixmap(const QPixmap &); - KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap & pix, KviTalListBoxItem *after); - KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap &, const QString&); - KviTalListBoxPixmap(const QPixmap &, const QString&); - KviTalListBoxPixmap(KviTalListBox* listbox, const QPixmap & pix, const QString&, KviTalListBoxItem *after); - ~KviTalListBoxPixmap(); - - const QPixmap *pixmap() const { return ± } - - int height(const KviTalListBox *) const; - int width(const KviTalListBox *) const; - - int rtti() const; - enum { RTTI = 2 }; - -protected: - virtual void paint(QPainter *); - -private: - Q_DISABLE_COPY(KviTalListBoxPixmap) - - QPixmap pm; -}; - -#endif // _KVI_TAL_LISTBOX_QT4_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_listview.cpp b/3.4.0/src/kvilib/tal/kvi_tal_listview.cpp deleted file mode 100644 index 1fd3b31575..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_listview.cpp +++ /dev/null @@ -1,1542 +0,0 @@ -//============================================================================= -// -// File : kvi_tal_listview.cpp -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_tal_listview.h" - -#include "kvi_pointerhashtable.h" - - -#ifdef COMPILE_USE_QT4 - #include <qpainter.h> - #include <qstyle.h> - #include <q3header.h> - #include <qapplication.h> - #include <qhash.h> - #include <qstyleoption.h> - #include <qaccessible.h> - - static QStyleOptionQ3ListView getStyleOption(const Q3ListView *lv, const Q3ListViewItem *item) - { - QStyleOptionQ3ListView opt; - opt.init(lv); - opt.subControls = QStyle::SC_None; - opt.activeSubControls = QStyle::SC_None; - QWidget *vp = lv->viewport(); - opt.viewportPalette = vp->palette(); - opt.viewportBGRole = vp->backgroundRole(); - opt.itemMargin = lv->itemMargin(); - opt.sortColumn = 0; - opt.treeStepSize = lv->treeStepSize(); - opt.rootIsDecorated = lv->rootIsDecorated(); - bool firstItem = true; - while (item) { - QStyleOptionQ3ListViewItem lvi; - lvi.height = item->height(); - lvi.totalHeight = item->totalHeight(); - lvi.itemY = item->itemPos(); - lvi.childCount = item->childCount(); - lvi.features = QStyleOptionQ3ListViewItem::None; - lvi.state = QStyle::State_None; - if (item->isEnabled()) - lvi.state |= QStyle::State_Enabled; - if (item->isOpen()) - lvi.state |= QStyle::State_Open; - if (item->isExpandable()) - lvi.features |= QStyleOptionQ3ListViewItem::Expandable; - if (item->multiLinesEnabled()) - lvi.features |= QStyleOptionQ3ListViewItem::MultiLine; - if (item->isVisible()) - lvi.features |= QStyleOptionQ3ListViewItem::Visible; - if (item->parent() && item->parent()->rtti() == 1 - && static_cast<Q3CheckListItem *>(item->parent())->type() == Q3CheckListItem::Controller) - lvi.features |= QStyleOptionQ3ListViewItem::ParentControl; - opt.items.append(lvi); - if (!firstItem) { - item = item->nextSibling(); - } else { - firstItem = false; - item = item->firstChild(); - } - } - return opt; - } - - KviTalListView::KviTalListView(QWidget * pParent) - : Q3ListView(pParent) - { - connect(this,SIGNAL(selectionChanged(Q3ListViewItem *)),this,SLOT(redirect_selectionChanged(Q3ListViewItem *))); - connect(this,SIGNAL(currentChanged(Q3ListViewItem *)),this,SLOT(redirect_currentChanged(Q3ListViewItem *))); - connect(this,SIGNAL(clicked(Q3ListViewItem *)),this,SLOT(redirect_clicked(Q3ListViewItem *))); - connect(this,SIGNAL(clicked(Q3ListViewItem *,const QPoint &,int)),this,SLOT(redirect_clicked(Q3ListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(pressed(Q3ListViewItem *)),this,SLOT(redirect_pressed(Q3ListViewItem *))); - connect(this,SIGNAL(pressed(Q3ListViewItem *,const QPoint &,int)),this,SLOT(redirect_pressed(Q3ListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(doubleClicked(Q3ListViewItem *)),this,SLOT(redirect_doubleClicked(Q3ListViewItem *))); - connect(this,SIGNAL(doubleClicked(Q3ListViewItem *,const QPoint &,int)),this,SLOT(redirect_doubleClicked(Q3ListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(returnPressed(Q3ListViewItem *)),this,SLOT(redirect_returnPressed(Q3ListViewItem *))); - connect(this,SIGNAL(spacePressed(Q3ListViewItem *)),this,SLOT(redirect_spacePressed(Q3ListViewItem *))); - connect(this,SIGNAL(rightButtonClicked(Q3ListViewItem *,const QPoint &,int)),this,SLOT(redirect_rightButtonClicked(Q3ListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(rightButtonPressed(Q3ListViewItem *,const QPoint &,int)),this,SLOT(redirect_rightButtonPressed(Q3ListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(mouseButtonClicked(int,Q3ListViewItem *,const QPoint &,int)),this,SLOT(redirect_mouseButtonClicked(int,Q3ListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(mouseButtonPressed(int,Q3ListViewItem *,const QPoint &,int)),this,SLOT(redirect_mouseButtonPressed(int,Q3ListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(contextMenuRequested(Q3ListViewItem *,const QPoint &,int)),this,SLOT(redirect_contextMenuRequested(Q3ListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(onItem(Q3ListViewItem *)),this,SLOT(redirect_onItem(Q3ListViewItem *))); - connect(this,SIGNAL(expanded(Q3ListViewItem *)),this,SLOT(redirect_expanded(Q3ListViewItem *))); - connect(this,SIGNAL(collapsed(Q3ListViewItem *)),this,SLOT(redirect_collapsed(Q3ListViewItem *))); - } - - void KviTalListView::redirect_selectionChanged(Q3ListViewItem * pItem) - { - emit selectionChanged((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_currentChanged(Q3ListViewItem * pItem) - { - emit currentChanged((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_clicked(Q3ListViewItem * pItem) - { - emit clicked((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_clicked(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn) - { - emit clicked((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_pressed(Q3ListViewItem * pItem) - { - emit pressed((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_pressed(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn) - { - emit pressed((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_doubleClicked(Q3ListViewItem * pItem) - { - emit doubleClicked((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_doubleClicked(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn) - { - emit doubleClicked((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_returnPressed(Q3ListViewItem * pItem) - { - emit returnPressed((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_spacePressed(Q3ListViewItem * pItem) - { - emit spacePressed((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_rightButtonClicked(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn) - { - emit rightButtonClicked((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_rightButtonPressed(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn) - { - emit rightButtonPressed((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_mouseButtonClicked(int iButton,Q3ListViewItem * pItem,const QPoint &pnt,int uColumn) - { - emit mouseButtonClicked(iButton,(KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_mouseButtonPressed(int iButton,Q3ListViewItem * pItem,const QPoint &pnt,int uColumn) - { - emit mouseButtonPressed(iButton,(KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_contextMenuRequested(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn) - { - emit contextMenuRequested((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_onItem(Q3ListViewItem * pItem) - { - emit onItem((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_expanded(Q3ListViewItem * pItem) - { - emit expanded((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_collapsed(Q3ListViewItem * pItem) - { - emit collapsed((KviTalListViewItem *)pItem); - } - - - struct KviTalCheckListItemPrivate - { - KviTalCheckListItemPrivate(): - exclusive(0), - currentState(KviTalCheckListItem::Off), - tristate(false) {} - - KviTalCheckListItem *exclusive; - KviTalCheckListItem::ToggleState currentState; - QHash<KviTalCheckListItem *, KviTalCheckListItem::ToggleState> statesDict; - bool tristate; - }; - - KviTalCheckListItem::KviTalCheckListItem(KviTalCheckListItem *parent, const QString &text, - Type tt) - : KviTalListViewItem(parent, text, QString()) - { - myType = tt; - init(); - if (myType == RadioButton) { - if (parent->type() != RadioButtonController) - qWarning("KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a controller"); - else - d->exclusive = parent; - } - } - - KviTalCheckListItem::KviTalCheckListItem(KviTalCheckListItem *parent, KviTalListViewItem *after, - const QString &text, Type tt) - : KviTalListViewItem(parent, after, text) - { - myType = tt; - init(); - if (myType == RadioButton) { - if (parent->type() != RadioButtonController) - qWarning("KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a controller"); - else - d->exclusive = parent; - } - } - - KviTalCheckListItem::KviTalCheckListItem(KviTalListViewItem *parent, const QString &text, - Type tt) - : KviTalListViewItem(parent, text, QString()) - { - myType = tt; - if (myType == RadioButton) { - qWarning("KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a KviTalCheckListItem"); - } - init(); - } - - KviTalCheckListItem::KviTalCheckListItem(KviTalListViewItem *parent, KviTalListViewItem *after, - const QString &text, Type tt) - : KviTalListViewItem(parent, after, text) - { - myType = tt; - if (myType == RadioButton) { - qWarning("KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a KviTalCheckListItem"); - } - init(); - } - - KviTalCheckListItem::KviTalCheckListItem(KviTalListView *parent, const QString &text, - Type tt) - : KviTalListViewItem(parent, text) - { - myType = tt; - if (tt == RadioButton) - qWarning("KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a KviTalCheckListItem"); - init(); - } - - KviTalCheckListItem::KviTalCheckListItem(KviTalListView *parent, KviTalListViewItem *after, - const QString &text, Type tt) - : KviTalListViewItem(parent, after, text) - { - myType = tt; - if (tt == RadioButton) - qWarning("KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a KviTalCheckListItem"); - init(); - } - - int KviTalCheckListItem::rtti() const - { - return RTTI; - } - - KviTalCheckListItem::KviTalCheckListItem(KviTalListView *parent, const QString &text, - const QPixmap & p) - : KviTalListViewItem(parent, text) - { - myType = RadioButtonController; - setPixmap(0, p); - init(); - } - - KviTalCheckListItem::KviTalCheckListItem(KviTalListViewItem *parent, const QString &text, - const QPixmap & p) - : KviTalListViewItem(parent, text) - { - myType = RadioButtonController; - setPixmap(0, p); - init(); - } - - void KviTalCheckListItem::init() - { - d = new KviTalCheckListItemPrivate(); - on = false; // ### remove on ver 4 - // CheckBoxControllers by default have tristate set to true - if (myType == CheckBoxController) - setTristate(true); - } - - KviTalCheckListItem::~KviTalCheckListItem() - { - if (myType == RadioButton - && d->exclusive && d->exclusive->d - && d->exclusive->d->exclusive == this) - d->exclusive->turnOffChild(); - d->exclusive = 0; // so the children won't try to access us. - delete d; - d = 0; - } - - void KviTalCheckListItem::setTristate(bool b) - { - if ((myType != CheckBoxController) && (myType != CheckBox)) { - qWarning("KviTalCheckListItem::setTristate(), has no effect on RadioButton " - "or RadioButtonController."); - return; - } - d->tristate = b; - } - - bool KviTalCheckListItem::isTristate() const - { - return d->tristate; - } - - KviTalCheckListItem::ToggleState KviTalCheckListItem::state() const - { - if (!isTristate() && internalState() == NoChange) - return Off; - else - return d->currentState; - } - - KviTalCheckListItem::ToggleState KviTalCheckListItem::internalState() const - { - return d->currentState; - } - - void KviTalCheckListItem::setState(ToggleState s) - { - if (myType == CheckBoxController && state() == NoChange) - updateStoredState(this); - setState(s, true, true); - } - - void KviTalCheckListItem::setState(ToggleState s, bool update, bool store) - { - - if (s == internalState()) - return; - - if (myType == CheckBox) { - setCurrentState(s); - stateChange(state()); - if (update && parent() && parent()->rtti() == 1 - && ((KviTalCheckListItem*)parent())->type() == CheckBoxController) - ((KviTalCheckListItem*)parent())->updateController(update, store); - } else if (myType == CheckBoxController) { - if (s == NoChange && childCount()) { - restoreState(this); - } else { - KviTalListViewItem *item = firstChild(); - int childCount = 0; - while(item) { - if (item->rtti() == 1 && - (((KviTalCheckListItem*)item)->type() == CheckBox || - ((KviTalCheckListItem*)item)->type() == CheckBoxController)) { - KviTalCheckListItem *checkItem = (KviTalCheckListItem*)item; - checkItem->setState(s, false, false); - childCount++; - } - item = item->nextSibling(); - } - if (update) { - if (childCount > 0) { - ToggleState oldState = internalState(); - updateController(false, false); - if (oldState != internalState() && - parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*)parent())->type() == CheckBoxController) - ((KviTalCheckListItem*)parent())->updateController(update, store); - - updateController(update, store); - } else { - // if there are no children we simply set the CheckBoxController and update its parent - setCurrentState(s); - stateChange(state()); - if (parent() && parent()->rtti() == 1 - && ((KviTalCheckListItem*)parent())->type() == CheckBoxController) - ((KviTalCheckListItem*)parent())->updateController(update, store); - } - } else { - setCurrentState(s); - stateChange(state()); - } - - } - } else if (myType == RadioButton) { - if (s == On) { - if (d->exclusive && d->exclusive->d->exclusive != this) - d->exclusive->turnOffChild(); - setCurrentState(s); - if (d->exclusive) - d->exclusive->d->exclusive = this; - } else { - if (d->exclusive && d->exclusive->d->exclusive == this) - d->exclusive->d->exclusive = 0; - setCurrentState(Off); - } - stateChange(state()); - } - repaint(); - } - - void KviTalCheckListItem::setCurrentState(ToggleState s) - { - ToggleState old = d->currentState; - d->currentState = s; - if (d->currentState == On) - on = true; - else - on = false; - - //#ifndef QT_NO_ACCESSIBILITY - // if (old != d->currentState && listView()) - // QAccessible::updateAccessibility(listView()->viewport(), indexOfItem(this), QAccessible::StateChanged); - //#else - // Q_UNUSED(old); - //#endif - } - - void KviTalCheckListItem::setStoredState(ToggleState newState, KviTalCheckListItem *key) - { - if (myType == CheckBox || myType == CheckBoxController) - d->statesDict[key] = newState; - } - - KviTalCheckListItem::ToggleState KviTalCheckListItem::storedState(KviTalCheckListItem *key) const - { - QHash<KviTalCheckListItem *, KviTalCheckListItem::ToggleState>::Iterator it = d->statesDict.find(key); - if (it != d->statesDict.end()) - return it.value(); - else - return Off; - } - - void KviTalCheckListItem::turnOffChild() - { - if (myType == RadioButtonController && d->exclusive) - d->exclusive->setOn(false); - } - - void KviTalCheckListItem::activate() - { - KviTalListView * lv = listView(); - - if (lv && !lv->isEnabled() || !isEnabled()) - return; - - QPoint pos; - int boxsize = lv->style()->pixelMetric(QStyle::PM_CheckListButtonSize, 0, lv); - if (activatedPos(pos)) { - bool parentControl = false; - if (parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*) parent())->type() == RadioButtonController) - parentControl = true; - - int x = parentControl ? 0 : 3; - int align = lv->columnAlignment(0); - int marg = lv->itemMargin(); - int y = 0; - - if (align & Qt::AlignVCenter) - y = ((height() - boxsize) / 2) + marg; - else - y = (lv->fontMetrics().height() + 2 + marg - boxsize) / 2; - - QRect r(x, y, boxsize-3, boxsize-3); - // columns might have been swapped - r.moveBy(lv->header()->sectionPos(0), 0); - if (!r.contains(pos)) - return; - } - if ((myType == CheckBox) || (myType == CheckBoxController)) { - //lv->d->startEdit = FALSE; - switch (internalState()) { - case On: - setState(Off); - break; - case Off: - if (!isTristate() && myType == CheckBox) { - setState(On); - } else { - setState(NoChange); - if (myType == CheckBoxController && internalState() != NoChange) - setState(On); - } - break; - case NoChange: - setState(On); - break; - } - ignoreDoubleClick(); - } else if (myType == RadioButton) { - setOn(true); - ignoreDoubleClick(); - } - } - - void KviTalCheckListItem::setOn(bool b ) - { - if (b) - setState(On , true, true); - else - setState(Off , true, true); - } - - void KviTalCheckListItem::stateChange(bool) - { - } - - void KviTalCheckListItem::stateChange(ToggleState s) - { - stateChange(s == On); - } - - void KviTalCheckListItem::restoreState(KviTalCheckListItem *key, int depth) - { - switch (type()) { - case CheckBox: - setCurrentState(storedState(key)); - stateChange(state()); - repaint(); - break; - case CheckBoxController: { - KviTalListViewItem *item = firstChild(); - int childCount = 0; - while (item) { - // recursively calling restoreState for children of type CheckBox and CheckBoxController - if (item->rtti() == 1 && - (((KviTalCheckListItem*)item)->type() == CheckBox || - ((KviTalCheckListItem*)item)->type() == CheckBoxController)) { - ((KviTalCheckListItem*)item)->restoreState(key , depth+1); - childCount++; - } - item = item->nextSibling(); - } - if (childCount > 0) { - if (depth == 0) - updateController(true); - else - updateController(false); - } else { - // if there are no children we retrieve the CheckBoxController state directly. - setState(storedState(key), true, false); - } - } - break; - default: - break; - } - } - - void KviTalCheckListItem::updateController(bool update , bool store) - { - if (myType != CheckBoxController) - return; - - KviTalCheckListItem *controller = 0; - // checks if this CheckBoxController has another CheckBoxController as parent - if (parent() && parent()->rtti() == 1 - && ((KviTalCheckListItem*)parent())->type() == CheckBoxController) - controller = (KviTalCheckListItem*)parent(); - - ToggleState theState = Off; - bool first = true; - KviTalListViewItem *item = firstChild(); - while(item && theState != NoChange) { - if (item->rtti() == 1 && - (((KviTalCheckListItem*)item)->type() == CheckBox || - ((KviTalCheckListItem*)item)->type() == CheckBoxController)) { - KviTalCheckListItem *checkItem = (KviTalCheckListItem*)item; - if (first) { - theState = checkItem->internalState(); - first = false; - } else { - if (checkItem->internalState() == NoChange || - theState != checkItem->internalState()) - theState = NoChange; - else - theState = checkItem->internalState(); - } - } - item = item->nextSibling(); - } - if (internalState() != theState) { - setCurrentState(theState); - if (store && (internalState() == On || internalState() == Off)) - updateStoredState(this); - stateChange(state()); - if (update && controller) { - controller->updateController(update, store); - } - repaint(); - } - } - - void KviTalCheckListItem::updateStoredState(KviTalCheckListItem *key) - { - if (myType != CheckBoxController) - return; - - KviTalListViewItem *item = firstChild(); - while(item) { - if (item->rtti() == 1) { - KviTalCheckListItem *checkItem = (KviTalCheckListItem*)item; - if (checkItem->type() == CheckBox) - checkItem->setStoredState(checkItem->internalState(), key); - else if (checkItem->type() == CheckBoxController) - checkItem->updateStoredState(key); - } - item = item->nextSibling(); - } - // this state is only needed if the CheckBoxController has no CheckBox / CheckBoxController children. - setStoredState(internalState() , key); - } - - void KviTalCheckListItem::setup() - { - KviTalListViewItem::setup(); - int h = height(); - KviTalListView *lv = listView(); - if (lv) - h = qMax(lv->style()->pixelMetric(QStyle::PM_CheckListButtonSize, 0, lv), - h); - h = qMax(h, QApplication::globalStrut().height()); - setHeight(h); - } - - int KviTalCheckListItem::width(const QFontMetrics& fm, const KviTalListView* lv, int column) const - { - int r = KviTalListViewItem::width(fm, lv, column); - if (column == 0) { - r += lv->itemMargin(); - if (myType == RadioButtonController && pixmap(0)) { - // r += 0; - } else { - r += lv->style()->pixelMetric(QStyle::PM_CheckListButtonSize, 0, lv) + 4; - } - } - return qMax(r, QApplication::globalStrut().width()); - } - - void KviTalCheckListItem::paintCell(QPainter * p, const QColorGroup & cg, - int column, int width, int align) - { - if (!p) - return; - - KviTalListView *lv = listView(); - if (!lv) - return; - - const QPalette::ColorRole crole = lv->foregroundRole(); - if (cg.brush(crole) != lv->palette().brush(crole)) - p->fillRect(0, 0, width, height(), cg.brush(crole)); - else - lv->paintEmptyArea(p, QRect(0, 0, width, height())); - - if (column != 0) { - // The rest is text, or for subclasses to change. - KviTalListViewItem::paintCell(p, cg, column, width, align); - return; - } - - bool parentControl = false; - if (parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*) parent())->type() == RadioButtonController) - parentControl = true; - - QFontMetrics fm(lv->fontMetrics()); - int boxsize = lv->style()->pixelMetric(myType == RadioButtonController ? QStyle::PM_CheckListControllerSize : - QStyle::PM_CheckListButtonSize, 0, lv); - int marg = lv->itemMargin(); - int r = marg; - - // Draw controller / checkbox / radiobutton --------------------- - QStyle::State styleflags = QStyle::State_None; - if (internalState() == On) { - styleflags |= QStyle::State_On; - } else if (internalState() == NoChange) { - if (myType == CheckBoxController && !isTristate()) - styleflags |= QStyle::State_Off; - else - styleflags |= QStyle::State_NoChange; - } else { - styleflags |= QStyle::State_Off; - } - if (isSelected()) - styleflags |= QStyle::State_Selected; - if (isEnabled() && lv->isEnabled()) - styleflags |= QStyle::State_Enabled; - if (lv->window()->isActiveWindow()) - styleflags |= QStyle::State_Active; - - if (myType == RadioButtonController) { - int x = 0; - if(!parentControl) - x += 3; - if (!pixmap(0)) { - QStyleOptionQ3ListView opt = getStyleOption(lv, this); - opt.rect.setRect(x, 0, boxsize, fm.height() + 2 + marg); - opt.palette = cg; - opt.state = styleflags; - lv->style()->drawPrimitive(QStyle::PE_Q3CheckListController, &opt, p, lv); - r += boxsize + 4; - } - } else { - Q_ASSERT(lv); //### - int x = 0; - int y = 0; - if (!parentControl) - x += 3; - if (align & Qt::AlignVCenter) - y = ((height() - boxsize) / 2) + marg; - else - y = (fm.height() + 2 + marg - boxsize) / 2; - - QStyleOptionQ3ListView opt = getStyleOption(lv, this); - opt.rect.setRect(x, y, boxsize, fm.height() + 2 + marg); - opt.palette = cg; - opt.state = styleflags; - lv->style()->drawPrimitive((myType == CheckBox || myType == CheckBoxController) - ? QStyle::PE_Q3CheckListIndicator - : QStyle::PE_Q3CheckListExclusiveIndicator, &opt, p, lv); - r += boxsize + 4; - } - - // Draw text ---------------------------------------------------- - p->translate(r, 0); - p->setPen(QPen(cg.text())); - KviTalListViewItem::paintCell(p, cg, column, width - r, align); - } - - void KviTalCheckListItem::paintFocus(QPainter *p, const QColorGroup & cg, - const QRect & r) - { - bool intersect = true; - KviTalListView *lv = listView(); - if (lv && lv->header()->mapToActual(0) != 0) { - int xdepth = lv->treeStepSize() * (depth() + (lv->rootIsDecorated() ? 1 : 0)) + lv->itemMargin(); - int p = lv->header()->cellPos(lv->header()->mapToActual(0)); - xdepth += p; - intersect = r.intersects(QRect(p, r.y(), xdepth - p + 1, r.height())); - } - bool parentControl = false; - if (parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*) parent())->type() == RadioButtonController) - parentControl = true; - if (myType != RadioButtonController && intersect && - (lv->rootIsDecorated() || myType == RadioButton || - (myType == CheckBox && parentControl))) { - QRect rect; - int boxsize = lv->style()->pixelMetric(QStyle::PM_CheckListButtonSize, 0, lv); - if (lv->columnAlignment(0) == Qt::AlignCenter) { - QFontMetrics fm(lv->font()); - int bx = (lv->columnWidth(0) - (boxsize + fm.width(text())))/2 + boxsize; - if (bx < 0) bx = 0; - rect.setRect(r.x() + bx + 5, r.y(), r.width() - bx - 5, - r.height()); - } else - rect.setRect(r.x() + boxsize + 5, r.y(), r.width() - boxsize - 5, - r.height()); - KviTalListViewItem::paintFocus(p, cg, rect); - } else { - KviTalListViewItem::paintFocus(p, cg, r); - } - } - - - #include "kvi_tal_listview_qt4.moc" -#else - #include <qpainter.h> - #include <qstyle.h> - #include <qheader.h> - #include <qapplication.h> - - KviTalListView::KviTalListView(QWidget * pParent) - : QListView(pParent) - { - connect(this,SIGNAL(selectionChanged(QListViewItem *)),this,SLOT(redirect_selectionChanged(QListViewItem *))); - connect(this,SIGNAL(currentChanged(QListViewItem *)),this,SLOT(redirect_currentChanged(QListViewItem *))); - connect(this,SIGNAL(clicked(QListViewItem *)),this,SLOT(redirect_clicked(QListViewItem *))); - connect(this,SIGNAL(clicked(QListViewItem *,const QPoint &,int)),this,SLOT(redirect_clicked(QListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(pressed(QListViewItem *)),this,SLOT(redirect_pressed(QListViewItem *))); - connect(this,SIGNAL(pressed(QListViewItem *,const QPoint &,int)),this,SLOT(redirect_pressed(QListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(doubleClicked(QListViewItem *)),this,SLOT(redirect_doubleClicked(QListViewItem *))); - connect(this,SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)),this,SLOT(redirect_doubleClicked(QListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(returnPressed(QListViewItem *)),this,SLOT(redirect_returnPressed(QListViewItem *))); - connect(this,SIGNAL(spacePressed(QListViewItem *)),this,SLOT(redirect_spacePressed(QListViewItem *))); - connect(this,SIGNAL(rightButtonClicked(QListViewItem *,const QPoint &,int)),this,SLOT(redirect_rightButtonClicked(QListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(rightButtonPressed(QListViewItem *,const QPoint &,int)),this,SLOT(redirect_rightButtonPressed(QListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(mouseButtonClicked(int,QListViewItem *,const QPoint &,int)),this,SLOT(redirect_mouseButtonClicked(int,QListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(mouseButtonPressed(int,QListViewItem *,const QPoint &,int)),this,SLOT(redirect_mouseButtonPressed(int,QListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(contextMenuRequested(QListViewItem *,const QPoint &,int)),this,SLOT(redirect_contextMenuRequested(QListViewItem *,const QPoint &,int))); - connect(this,SIGNAL(onItem(QListViewItem *)),this,SLOT(redirect_onItem(QListViewItem *))); - connect(this,SIGNAL(expanded(QListViewItem *)),this,SLOT(redirect_expanded(QListViewItem *))); - connect(this,SIGNAL(collapsed(QListViewItem *)),this,SLOT(redirect_collapsed(QListViewItem *))); - } - - void KviTalListView::redirect_selectionChanged(QListViewItem * pItem) - { - emit selectionChanged((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_currentChanged(QListViewItem * pItem) - { - emit currentChanged((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_clicked(QListViewItem * pItem) - { - emit clicked((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_clicked(QListViewItem * pItem,const QPoint &pnt,int uColumn) - { - emit clicked((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_pressed(QListViewItem * pItem) - { - emit pressed((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_pressed(QListViewItem * pItem,const QPoint &pnt,int uColumn) - { - emit pressed((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_doubleClicked(QListViewItem * pItem) - { - emit doubleClicked((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_doubleClicked(QListViewItem * pItem,const QPoint &pnt,int uColumn) - { - emit doubleClicked((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_returnPressed(QListViewItem * pItem) - { - emit returnPressed((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_spacePressed(QListViewItem * pItem) - { - emit spacePressed((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_rightButtonClicked(QListViewItem * pItem,const QPoint &pnt,int uColumn) - { - emit rightButtonClicked((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_rightButtonPressed(QListViewItem * pItem,const QPoint &pnt,int uColumn) - { - emit rightButtonPressed((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_mouseButtonClicked(int iButton,QListViewItem * pItem,const QPoint &pnt,int uColumn) - { - emit mouseButtonClicked(iButton,(KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_mouseButtonPressed(int iButton,QListViewItem * pItem,const QPoint &pnt,int uColumn) - { - emit mouseButtonPressed(iButton,(KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_contextMenuRequested(QListViewItem * pItem,const QPoint &pnt,int uColumn) - { - emit contextMenuRequested((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_onItem(QListViewItem * pItem) - { - emit onItem((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_expanded(QListViewItem * pItem) - { - emit expanded((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_collapsed(QListViewItem * pItem) - { - emit collapsed((KviTalListViewItem *)pItem); - } - - struct KviTalCheckListItemPrivate - { - KviTalCheckListItemPrivate(): - exclusive( 0 ), - currentState( KviTalCheckListItem::Off ), - statesDict( 0 ), - tristate( FALSE ) {} - - KviTalCheckListItem *exclusive; - KviTalCheckListItem::ToggleState currentState; - KviPointerHashTable<void *,KviTalCheckListItem::ToggleState> *statesDict; - bool tristate; - }; - - // ### obscenity is warranted. - - KviTalCheckListItem::KviTalCheckListItem( KviTalCheckListItem *parent, const QString &text, - Type tt ) - : KviTalListViewItem( parent, text, QString::null ) - { - myType = tt; - init(); - if ( myType == RadioButton ) { - if ( parent->type() != RadioButtonController ) - qWarning( "KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a controller" ); - else - d->exclusive = parent; - } - } - - KviTalCheckListItem::KviTalCheckListItem( KviTalCheckListItem *parent, KviTalListViewItem *after, - const QString &text, Type tt ) - : KviTalListViewItem( parent, after, text ) - { - myType = tt; - init(); - if ( myType == RadioButton ) { - if ( parent->type() != RadioButtonController ) - qWarning( "KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a controller" ); - else - d->exclusive = parent; - } - } - - KviTalCheckListItem::KviTalCheckListItem( KviTalListViewItem *parent, const QString &text, - Type tt ) - : KviTalListViewItem( parent, text, QString::null ) - { - myType = tt; - if ( myType == RadioButton ) { - qWarning( "KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a KviTalCheckListItem" ); - } - init(); - } - - KviTalCheckListItem::KviTalCheckListItem( KviTalListViewItem *parent, KviTalListViewItem *after, - const QString &text, Type tt ) - : KviTalListViewItem( parent, after, text ) - { - myType = tt; - if ( myType == RadioButton ) { - qWarning( "KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a KviTalCheckListItem" ); - } - init(); - } - - KviTalCheckListItem::KviTalCheckListItem( KviTalListView *parent, const QString &text, - Type tt ) - : KviTalListViewItem( parent, text ) - { - myType = tt; - if ( tt == RadioButton ) - qWarning( "KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a KviTalCheckListItem" ); - init(); - } - - KviTalCheckListItem::KviTalCheckListItem( KviTalListView *parent, KviTalListViewItem *after, - const QString &text, Type tt ) - : KviTalListViewItem( parent, after, text ) - { - myType = tt; - if ( tt == RadioButton ) - qWarning( "KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a KviTalCheckListItem" ); - init(); - } - - - int KviTalCheckListItem::RTTI = 1; - - int KviTalCheckListItem::rtti() const - { - return RTTI; - } - - KviTalCheckListItem::KviTalCheckListItem( KviTalListView *parent, const QString &text, - const QPixmap & p ) - : KviTalListViewItem( parent, text ) - { - myType = RadioButtonController; - setPixmap( 0, p ); - init(); - } - - KviTalCheckListItem::KviTalCheckListItem( KviTalListViewItem *parent, const QString &text, - const QPixmap & p ) - : KviTalListViewItem( parent, text ) - { - myType = RadioButtonController; - setPixmap( 0, p ); - init(); - } - - void KviTalCheckListItem::init() - { - d = new KviTalCheckListItemPrivate(); - on = FALSE; // ### remove on ver 4 - if ( myType == CheckBoxController || myType == CheckBox ) { - d->statesDict = new KviPointerHashTable<void *,ToggleState>(101); - d->statesDict->setAutoDelete( TRUE ); - } - // CheckBoxControllers by default have tristate set to TRUE - if ( myType == CheckBoxController ) - setTristate( TRUE ); - } - - KviTalCheckListItem::~KviTalCheckListItem() - { - if ( myType == RadioButton - && d->exclusive && d->exclusive->d - && d->exclusive->d->exclusive == this ) - d->exclusive->turnOffChild(); - d->exclusive = 0; // so the children won't try to access us. - if ( d->statesDict ) - delete d->statesDict; - delete d; - d = 0; - } - - void KviTalCheckListItem::setTristate( bool b ) - { - if ( ( myType != CheckBoxController ) && ( myType != CheckBox ) ) { - qWarning( "KviTalCheckListItem::setTristate(), has no effect on RadioButton " - "or RadioButtonController." ); - return; - } - d->tristate = b; - } - - bool KviTalCheckListItem::isTristate() const - { - return d->tristate; - } - - KviTalCheckListItem::ToggleState KviTalCheckListItem::state() const - { - if ( !isTristate() && internalState() == NoChange ) - return Off; - else - return d->currentState; - } - - KviTalCheckListItem::ToggleState KviTalCheckListItem::internalState() const - { - return d->currentState; - } - - void KviTalCheckListItem::setState( ToggleState s ) - { - if ( myType == CheckBoxController && state() == NoChange ) - updateStoredState( (void*) this ); - setState( s, TRUE, TRUE ); - } - - void KviTalCheckListItem::setState( ToggleState s, bool update, bool store) - { - - if ( s == internalState() ) - return; - - if ( myType == CheckBox ) { - setCurrentState( s ); - stateChange( state() ); - if ( update && parent() && parent()->rtti() == 1 - && ((KviTalCheckListItem*)parent())->type() == CheckBoxController ) - ((KviTalCheckListItem*)parent())->updateController( update, store ); - } else if ( myType == CheckBoxController ) { - if ( s == NoChange && childCount()) { - restoreState( (void*) this ); - } else { - KviTalListViewItem *item = firstChild(); - int childCount = 0; - while( item ) { - if ( item->rtti() == 1 && - ( ((KviTalCheckListItem*)item)->type() == CheckBox || - ((KviTalCheckListItem*)item)->type() == CheckBoxController ) ) { - KviTalCheckListItem *checkItem = (KviTalCheckListItem*)item; - checkItem->setState( s, FALSE, FALSE ); - childCount++; - } - item = item->nextSibling(); - } - if ( update ) { - if ( childCount > 0 ) { - ToggleState oldState = internalState(); - updateController( FALSE, FALSE ); - if ( oldState != internalState() && - parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*)parent())->type() == CheckBoxController ) - ((KviTalCheckListItem*)parent())->updateController( update, store ); - - updateController( update, store ); - } else { - // if there are no children we simply set the CheckBoxController and update its parent - setCurrentState( s ); - stateChange( state() ); - if ( parent() && parent()->rtti() == 1 - && ((KviTalCheckListItem*)parent())->type() == CheckBoxController ) - ((KviTalCheckListItem*)parent())->updateController( update, store ); - } - } else { - setCurrentState( s ); - stateChange( state() ); - } - - } - } else if ( myType == RadioButton ) { - if ( s == On ) { - if ( d->exclusive && d->exclusive->d->exclusive != this ) - d->exclusive->turnOffChild(); - setCurrentState( s ); - if ( d->exclusive ) - d->exclusive->d->exclusive = this; - } else { - if ( d->exclusive && d->exclusive->d->exclusive == this ) - d->exclusive->d->exclusive = 0; - setCurrentState( Off ); - } - stateChange( state() ); - } - repaint(); - } - - void KviTalCheckListItem::setCurrentState( ToggleState s ) - { - ToggleState old = d->currentState; - d->currentState = s; - if (d->currentState == On) - on = TRUE; - else - on = FALSE; - - #if defined(QT_ACCESSIBILITY_SUPPORT) - if ( old != d->currentState && listView() ) - QAccessible::updateAccessibility( listView()->viewport(), indexOfItem( this ), QAccessible::StateChanged ); - #else - Q_UNUSED( old ); - #endif - } - - void KviTalCheckListItem::setStoredState( ToggleState newState, void *key ) - { - if ( myType == CheckBox || myType == CheckBoxController ) - d->statesDict->replace( key, new ToggleState(newState) ); - } - - KviTalCheckListItem::ToggleState KviTalCheckListItem::storedState( void *key ) const - { - if ( !d->statesDict ) - return Off; - - ToggleState *foundState = d->statesDict->find( key ); - if ( foundState ) - return ToggleState( *foundState ); - else - return Off; - } - - void KviTalCheckListItem::turnOffChild() - { - if ( myType == RadioButtonController && d->exclusive ) - d->exclusive->setOn( FALSE ); - } - - void KviTalCheckListItem::activate() - { - KviTalListView * lv = listView(); - - if ( lv && !lv->isEnabled() || !isEnabled() ) - return; - - QPoint pos; - int boxsize = lv->style().pixelMetric(QStyle::PM_CheckListButtonSize, lv); - if ( activatedPos( pos ) ) { - bool parentControl = FALSE; - if ( parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*) parent())->type() == RadioButtonController ) - parentControl = TRUE; - - int x = parentControl ? 0 : 3; - int align = lv->columnAlignment( 0 ); - int marg = lv->itemMargin(); - int y = 0; - - if ( align & AlignVCenter ) - y = ( ( height() - boxsize ) / 2 ) + marg; - else - y = (lv->fontMetrics().height() + 2 + marg - boxsize) / 2; - - QRect r( x, y, boxsize-3, boxsize-3 ); - // columns might have been swapped - r.moveBy( lv->header()->sectionPos( 0 ), 0 ); - if ( !r.contains( pos ) ) - return; - } - if ( ( myType == CheckBox ) || ( myType == CheckBoxController) ) { - switch ( internalState() ) { - case On: - setState( Off ); - break; - case Off: - if ( !isTristate() && myType == CheckBox ) { - setState( On ); - } else { - setState( NoChange ); - if ( myType == CheckBoxController && internalState() != NoChange ) - setState( On ); - } - break; - case NoChange: - setState( On ); - break; - } - ignoreDoubleClick(); - } else if ( myType == RadioButton ) { - setOn( TRUE ); - ignoreDoubleClick(); - } - } - - void KviTalCheckListItem::setOn( bool b ) - { - if ( b ) - setState( On , TRUE, TRUE ); - else - setState( Off , TRUE, TRUE ); - } - - void KviTalCheckListItem::stateChange( bool ) - { - } - - void KviTalCheckListItem::stateChange( ToggleState s ) - { - stateChange( s == On ); - } - - void KviTalCheckListItem::restoreState( void *key, int depth ) - { - switch ( type() ) { - case CheckBox: - setCurrentState( storedState( key ) ); - stateChange( state() ); - repaint(); - break; - case CheckBoxController: { - KviTalListViewItem *item = firstChild(); - int childCount = 0; - while ( item ) { - // recursively calling restoreState for children of type CheckBox and CheckBoxController - if ( item->rtti() == 1 && - ( ((KviTalCheckListItem*)item)->type() == CheckBox || - ((KviTalCheckListItem*)item)->type() == CheckBoxController ) ) { - ((KviTalCheckListItem*)item)->restoreState( key , depth+1 ); - childCount++; - } - item = item->nextSibling(); - } - if ( childCount > 0 ) { - if ( depth == 0 ) - updateController( TRUE ); - else - updateController( FALSE ); - } else { - // if there are no children we retrieve the CheckBoxController state directly. - setState( storedState( key ), TRUE, FALSE ); - } - } - break; - default: - break; - } - } - - void KviTalCheckListItem::updateController( bool update , bool store ) - { - if ( myType != CheckBoxController ) - return; - - KviTalCheckListItem *controller = 0; - // checks if this CheckBoxController has another CheckBoxController as parent - if ( parent() && parent()->rtti() == 1 - && ((KviTalCheckListItem*)parent())->type() == CheckBoxController ) - controller = (KviTalCheckListItem*)parent(); - - ToggleState theState = Off; - bool first = TRUE; - KviTalListViewItem *item = firstChild(); - while( item && theState != NoChange ) { - if ( item->rtti() == 1 && - ( ((KviTalCheckListItem*)item)->type() == CheckBox || - ((KviTalCheckListItem*)item)->type() == CheckBoxController ) ) { - KviTalCheckListItem *checkItem = (KviTalCheckListItem*)item; - if ( first ) { - theState = checkItem->internalState(); - first = FALSE; - } else { - if ( checkItem->internalState() == NoChange || - theState != checkItem->internalState() ) - theState = NoChange; - else - theState = checkItem->internalState(); - } - } - item = item->nextSibling(); - } - if ( internalState() != theState ) { - setCurrentState( theState ); - if ( store && ( internalState() == On || internalState() == Off ) ) - updateStoredState( (void*) this ); - stateChange( state() ); - if ( update && controller ) { - controller->updateController( update, store ); - } - repaint(); - } - } - - void KviTalCheckListItem::updateStoredState( void *key ) - { - if ( myType != CheckBoxController ) - return; - - KviTalListViewItem *item = firstChild(); - while( item ) { - if ( item->rtti() == 1 ) { - KviTalCheckListItem *checkItem = (KviTalCheckListItem*)item; - if ( checkItem->type() == CheckBox ) - checkItem->setStoredState( checkItem->internalState(), key ); - else if (checkItem->type() == CheckBoxController ) - checkItem->updateStoredState( key ); - } - item = item->nextSibling(); - } - // this state is only needed if the CheckBoxController has no CheckBox / CheckBoxController children. - setStoredState( internalState() , key ); - } - - void KviTalCheckListItem::setup() - { - KviTalListViewItem::setup(); - int h = height(); - KviTalListView *lv = listView(); - if ( lv ) - h = QMAX( lv->style().pixelMetric(QStyle::PM_CheckListButtonSize, lv), - h ); - h = QMAX( h, QApplication::globalStrut().height() ); - setHeight( h ); - } - - int KviTalCheckListItem::width( const QFontMetrics& fm, const KviTalListView* lv, int column) const - { - int r = KviTalListViewItem::width( fm, lv, column ); - if ( column == 0 ) { - r += lv->itemMargin(); - if ( myType == RadioButtonController && pixmap( 0 ) ) { - // r += 0; - } else { - r += lv->style().pixelMetric(QStyle::PM_CheckListButtonSize, lv) + 4; - } - } - return QMAX( r, QApplication::globalStrut().width() ); - } - - void KviTalCheckListItem::paintCell( QPainter * p, const QColorGroup & cg, - int column, int width, int align ) - { - if ( !p ) - return; - - KviTalListView *lv = listView(); - if ( !lv ) - return; - - const BackgroundMode bgmode = lv->viewport()->backgroundMode(); - const QColorGroup::ColorRole crole = QPalette::backgroundRoleFromMode( bgmode ); - if ( cg.brush( crole ) != lv->colorGroup().brush( crole ) ) - p->fillRect( 0, 0, width, height(), cg.brush( crole ) ); - else - lv->paintEmptyArea( p, QRect( 0, 0, width, height() ) ); - - if ( column != 0 ) { - // The rest is text, or for subclasses to change. - KviTalListViewItem::paintCell( p, cg, column, width, align ); - return; - } - - bool parentControl = FALSE; - if ( parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*) parent())->type() == RadioButtonController ) - parentControl = TRUE; - - QFontMetrics fm( lv->fontMetrics() ); - int boxsize = lv->style().pixelMetric( myType == RadioButtonController ? QStyle::PM_CheckListControllerSize : - QStyle::PM_CheckListButtonSize, lv); - int marg = lv->itemMargin(); - int r = marg; - - // Draw controller / checkbox / radiobutton --------------------- - int styleflags = QStyle::Style_Default; - if ( internalState() == On ) { - styleflags |= QStyle::Style_On; - } else if ( internalState() == NoChange ) { - if ( myType == CheckBoxController && !isTristate() ) - styleflags |= QStyle::Style_Off; - else - styleflags |= QStyle::Style_NoChange; - } else { - styleflags |= QStyle::Style_Off; - } - if ( isSelected() ) - styleflags |= QStyle::Style_Selected; - if ( isEnabled() && lv->isEnabled() ) - styleflags |= QStyle::Style_Enabled; - - if ( myType == RadioButtonController ) { - int x = 0; - if(!parentControl) - x += 3; - if ( !pixmap( 0 ) ) { - lv->style().drawPrimitive(QStyle::PE_CheckListController, p, - QRect(x, 0, boxsize, - fm.height() + 2 + marg), - cg, styleflags, QStyleOption(this)); - r += boxsize + 4; - } - } else { - Q_ASSERT( lv ); //### - int x = 0; - int y = 0; - if ( !parentControl ) - x += 3; - if ( align & AlignVCenter ) - y = ( ( height() - boxsize ) / 2 ) + marg; - else - y = (fm.height() + 2 + marg - boxsize) / 2; - - if ( ( myType == CheckBox ) || ( myType == CheckBoxController ) ) { - lv->style().drawPrimitive(QStyle::PE_CheckListIndicator, p, - QRect(x, y, boxsize, - fm.height() + 2 + marg), - cg, styleflags, QStyleOption(this)); - } else { //radio button look - lv->style().drawPrimitive(QStyle::PE_CheckListExclusiveIndicator, - p, QRect(x, y, boxsize, - fm.height() + 2 + marg), - cg, styleflags, QStyleOption(this)); - } - r += boxsize + 4; - } - - // Draw text ---------------------------------------------------- - p->translate( r, 0 ); - p->setPen( QPen( cg.text() ) ); - KviTalListViewItem::paintCell( p, cg, column, width - r, align ); - } - - void KviTalCheckListItem::paintFocus( QPainter *p, const QColorGroup & cg,const QRect & r ) - { - bool intersect = TRUE; - KviTalListView *lv = listView(); - if ( lv && lv->header()->mapToActual( 0 ) != 0 ) { - int xdepth = lv->treeStepSize() * ( depth() + ( lv->rootIsDecorated() ? 1 : 0) ) + lv->itemMargin(); - int p = lv->header()->cellPos( lv->header()->mapToActual( 0 ) ); - xdepth += p; - intersect = r.intersects( QRect( p, r.y(), xdepth - p + 1, r.height() ) ); - } - bool parentControl = FALSE; - if ( parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*) parent())->type() == RadioButtonController ) - parentControl = TRUE; - if ( myType != RadioButtonController && intersect && - (lv->rootIsDecorated() || myType == RadioButton || - (myType == CheckBox && parentControl) ) ) { - QRect rect; - int boxsize = lv->style().pixelMetric(QStyle::PM_CheckListButtonSize, lv); - if ( lv->columnAlignment(0) == AlignCenter ) { - QFontMetrics fm( lv->font() ); - int bx = (lv->columnWidth(0) - (boxsize + fm.width(text())))/2 + boxsize; - if ( bx < 0 ) bx = 0; - rect.setRect( r.x() + bx + 5, r.y(), r.width() - bx - 5, - r.height() ); - } else - rect.setRect( r.x() + boxsize + 5, r.y(), r.width() - boxsize - 5, - r.height() ); - KviTalListViewItem::paintFocus(p, cg, rect); - } else { - KviTalListViewItem::paintFocus(p, cg, r); - } - } - - #include "kvi_tal_listview_qt3.moc" -#endif - - - diff --git a/3.4.0/src/kvilib/tal/kvi_tal_listview.h b/3.4.0/src/kvilib/tal/kvi_tal_listview.h deleted file mode 100644 index 5fe825495b..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_listview.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef _KVI_TAL_LISTVIEW_H_ -#define _KVI_TAL_LISTVIEW_H_ - -//============================================================================= -// -// File : kvi_tal_listview.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - - -// -// This is the only reasonable CROSS-QT3-QT4-COMPATIBLE implementation -// of QListView I've been able to find. -// Note that using macros for the items will NOT work since moc -// doesn't expand them. Note also that KviTalCheckListItem must -// be fully reimplemented and not be inherited from QCheckListItem -// to build up a consistent item object hierarchy. To complete -// the obscenity, we need TWO COMPLETE implementations: one for Qt3 -// and one for Qt4... bleah :D -// -// The code for KviTalCheckListItem is adapted from qlistview.h/cpp -// present in qt 3.3.6 AND in qt 4.1.2. -// - -#include "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_listview_qt4.h" -#else - #include "kvi_tal_listview_qt3.h" -#endif - -#endif // _KVI_TAL_LISTVIEW_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_listview_qt3.h b/3.4.0/src/kvilib/tal/kvi_tal_listview_qt3.h deleted file mode 100644 index 955b1c326d..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_listview_qt3.h +++ /dev/null @@ -1,190 +0,0 @@ -#ifndef _KVI_TAL_LISTVIEW_QT3_H_ -#define _KVI_TAL_LISTVIEW_QT3_H_ - -//============================================================================= -// -// File : kvi_tal_listview_qt3.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_qstring.h" - -#include <qlistview.h> - -class KviTalListViewItem; - -class KVILIB_API KviTalListView : public QListView -{ - friend class KviTalCheckListItem; - Q_OBJECT -public: - KviTalListView(QWidget * pParent); - virtual ~KviTalListView() {}; -public: - // Shadow the internal Qt methods - KviTalListViewItem * firstChild() const { return (KviTalListViewItem *)QListView::firstChild(); }; - KviTalListViewItem * lastItem() const { return (KviTalListViewItem *)QListView::lastItem(); }; - KviTalListViewItem * selectedItem() const { return (KviTalListViewItem *)QListView::selectedItem(); }; - KviTalListViewItem * currentItem() const { return (KviTalListViewItem *)QListView::currentItem(); }; - KviTalListViewItem * itemAt(const QPoint &pnt) const { return (KviTalListViewItem *)QListView::itemAt(pnt); }; -signals: - void selectionChanged(KviTalListViewItem * pItem); - void currentChanged(KviTalListViewItem * pItem); - void clicked(KviTalListViewItem * pItem); - void clicked(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void pressed(KviTalListViewItem * pItem); - void pressed(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void doubleClicked(KviTalListViewItem * pItem); - void doubleClicked(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void returnPressed(KviTalListViewItem * pItem); - void spacePressed(KviTalListViewItem * pItem); - void rightButtonClicked(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void rightButtonPressed(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void mouseButtonClicked(int iButton,KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void mouseButtonPressed(int iButton,KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void contextMenuRequested(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void onItem(KviTalListViewItem * pItem); - void expanded(KviTalListViewItem * pItem); - void collapsed(KviTalListViewItem * pItem); -protected slots: - void redirect_selectionChanged(QListViewItem * pItem); - void redirect_currentChanged(QListViewItem * pItem); - void redirect_clicked(QListViewItem * pItem); - void redirect_clicked(QListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_pressed(QListViewItem * pItem); - void redirect_pressed(QListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_doubleClicked(QListViewItem * pItem); - void redirect_doubleClicked(QListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_returnPressed(QListViewItem * pItem); - void redirect_spacePressed(QListViewItem * pItem); - void redirect_rightButtonClicked(QListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_rightButtonPressed(QListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_mouseButtonClicked(int iButton,QListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_mouseButtonPressed(int iButton,QListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_contextMenuRequested(QListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_onItem(QListViewItem * pItem); - void redirect_expanded(QListViewItem * pItem); - void redirect_collapsed(QListViewItem * pItem); -}; - - -class KVILIB_API KviTalListViewItem : public QListViewItem -{ -public: - KviTalListViewItem(KviTalListView * pParent) - : QListViewItem(pParent) {}; - KviTalListViewItem(KviTalListViewItem * pParent) - : QListViewItem(pParent) {}; - KviTalListViewItem(KviTalListView * pParent,KviTalListViewItem * pAfter) - : QListViewItem(pParent,pAfter) {}; - KviTalListViewItem(KviTalListViewItem * pParent,KviTalListViewItem * pAfter) - : QListViewItem(pParent,pAfter) {}; - KviTalListViewItem(KviTalListView * pParent,const QString &szLabel1,const QString &szLabel2 = KviQString::empty,const QString &szLabel3 = KviQString::empty,const QString &szLabel4 = KviQString::empty,const QString &szLabel5 = KviQString::empty) - : QListViewItem(pParent,szLabel1,szLabel2,szLabel3,szLabel4,szLabel5) {}; - KviTalListViewItem(KviTalListView * pParent,KviTalListViewItem * pAfter,const QString &szLabel1,const QString &szLabel2 = KviQString::empty,const QString &szLabel3 = KviQString::empty,const QString &szLabel4 = KviQString::empty,const QString &szLabel5 = KviQString::empty) - : QListViewItem(pParent,pAfter,szLabel1,szLabel2,szLabel3,szLabel4,szLabel5) {}; - KviTalListViewItem(KviTalListViewItem * pParent,const QString &szLabel1,const QString &szLabel2 = KviQString::empty,const QString &szLabel3 = KviQString::empty,const QString &szLabel4 = KviQString::empty) - : QListViewItem(pParent,szLabel1,szLabel2,szLabel3,szLabel4) {}; - KviTalListViewItem(KviTalListViewItem * pParent,KviTalListViewItem * pAfter,const QString &szLabel1,const QString &szLabel2 = KviQString::empty,const QString &szLabel3 = KviQString::empty,const QString &szLabel4 = KviQString::empty) - : QListViewItem(pParent,pAfter,szLabel1,szLabel2,szLabel3,szLabel4) {}; - virtual ~KviTalListViewItem() {}; -public: - // Shadow the internal Qt methods - KviTalListViewItem * firstChild() const { return (KviTalListViewItem *)QListViewItem::firstChild(); }; - KviTalListViewItem * nextSibling() const { return (KviTalListViewItem *)QListViewItem::nextSibling(); }; - KviTalListViewItem * parent() const { return (KviTalListViewItem *)QListViewItem::parent(); }; - KviTalListView * listView() const { return (KviTalListView *)QListViewItem::listView(); }; - KviTalListViewItem * itemAbove() { return (KviTalListViewItem *)QListViewItem::itemAbove(); }; - KviTalListViewItem * itemBelow() { return (KviTalListViewItem *)QListViewItem::itemBelow(); }; -}; - -struct KviTalCheckListItemPrivate; - -class KVILIB_API KviTalCheckListItem : public KviTalListViewItem -{ -public: - enum Type { - RadioButton, - CheckBox, - Controller, - RadioButtonController=Controller, - CheckBoxController - }; - enum ToggleState { Off, NoChange, On }; - - KviTalCheckListItem(KviTalCheckListItem *parent, const QString &text,Type = RadioButtonController); - KviTalCheckListItem(KviTalCheckListItem *parent, KviTalListViewItem *after,const QString &text, Type = RadioButtonController); - KviTalCheckListItem( KviTalListViewItem *parent, const QString &text,Type = RadioButtonController ); - KviTalCheckListItem( KviTalListViewItem *parent, KviTalListViewItem *after,const QString &text, Type = RadioButtonController ); - KviTalCheckListItem( KviTalListView *parent, const QString &text,Type = RadioButtonController ); - KviTalCheckListItem( KviTalListView *parent, KviTalListViewItem *after,const QString &text, Type = RadioButtonController ); - KviTalCheckListItem( KviTalListViewItem *parent, const QString &text,const QPixmap & ); - KviTalCheckListItem( KviTalListView *parent, const QString &text,const QPixmap & ); - ~KviTalCheckListItem(); - - void paintCell( QPainter *,const QColorGroup & cg,int column, int width, int alignment ); - virtual void paintFocus( QPainter *, const QColorGroup & cg, - const QRect & r ); - int width( const QFontMetrics&, const KviTalListView*, int column) const; - void setup(); - - virtual void setOn( bool ); // ### should be replaced by setChecked in ver4 - bool isOn() const { return on; } - Type type() const { return myType; } - QString text() const { return KviTalListViewItem::text( 0 ); } - QString text( int n ) const { return KviTalListViewItem::text( n ); } - - void setTristate( bool ); - bool isTristate() const; - ToggleState state() const; - void setState( ToggleState s); - - int rtti() const; - static int RTTI; - -protected: - void activate(); - void turnOffChild(); - virtual void stateChange( bool ); - -private: - void init(); - ToggleState internalState() const; - void setStoredState( ToggleState newState, void *key ); - ToggleState storedState( void *key ) const; - void stateChange( ToggleState s ); - void restoreState( void *key, int depth = 0 ); - void updateController( bool update = TRUE , bool store = FALSE ); - void updateStoredState( void *key ); - void setState( ToggleState s, bool update, bool store ); - void setCurrentState( ToggleState s ); - - Type myType; - bool on; // ### remove in ver4 - KviTalCheckListItemPrivate *d; -}; - - -#define KviTalListViewItemIterator QListViewItemIterator - -#endif // _KVI_TAL_LISTVIEW_QT3_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_listview_qt4.h b/3.4.0/src/kvilib/tal/kvi_tal_listview_qt4.h deleted file mode 100644 index bef1ef9762..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_listview_qt4.h +++ /dev/null @@ -1,199 +0,0 @@ -#ifndef _KVI_TAL_LISTVIEW_QT4_H_ -#define _KVI_TAL_LISTVIEW_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_listview_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_qstring.h" - -#include <q3listview.h> - -class KviTalListViewItem; - - -class KVILIB_API KviTalListView : public Q3ListView -{ - friend class KviTalCheckListItem; - Q_OBJECT -public: - KviTalListView(QWidget * pParent); - virtual ~KviTalListView() {}; -public: - // Shadow the internal Qt methods - KviTalListViewItem * firstChild() const { return (KviTalListViewItem *)Q3ListView::firstChild(); }; - KviTalListViewItem * lastItem() const { return (KviTalListViewItem *)Q3ListView::lastItem(); }; - KviTalListViewItem * selectedItem() const { return (KviTalListViewItem *)Q3ListView::selectedItem(); }; - KviTalListViewItem * currentItem() const { return (KviTalListViewItem *)Q3ListView::currentItem(); }; - KviTalListViewItem * itemAt(const QPoint &pnt) const { return (KviTalListViewItem *)Q3ListView::itemAt(pnt); }; -signals: - void selectionChanged(KviTalListViewItem * pItem); - void currentChanged(KviTalListViewItem * pItem); - void clicked(KviTalListViewItem * pItem); - void clicked(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void pressed(KviTalListViewItem * pItem); - void pressed(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void doubleClicked(KviTalListViewItem * pItem); - void doubleClicked(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void returnPressed(KviTalListViewItem * pItem); - void spacePressed(KviTalListViewItem * pItem); - void rightButtonClicked(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void rightButtonPressed(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void mouseButtonClicked(int iButton,KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void mouseButtonPressed(int iButton,KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void contextMenuRequested(KviTalListViewItem * pItem,const QPoint &pnt,int uColumn); - void onItem(KviTalListViewItem * pItem); - void expanded(KviTalListViewItem * pItem); - void collapsed(KviTalListViewItem * pItem); -protected slots: - void redirect_selectionChanged(Q3ListViewItem * pItem); - void redirect_currentChanged(Q3ListViewItem * pItem); - void redirect_clicked(Q3ListViewItem * pItem); - void redirect_clicked(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_pressed(Q3ListViewItem * pItem); - void redirect_pressed(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_doubleClicked(Q3ListViewItem * pItem); - void redirect_doubleClicked(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_returnPressed(Q3ListViewItem * pItem); - void redirect_spacePressed(Q3ListViewItem * pItem); - void redirect_rightButtonClicked(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_rightButtonPressed(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_mouseButtonClicked(int iButton,Q3ListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_mouseButtonPressed(int iButton,Q3ListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_contextMenuRequested(Q3ListViewItem * pItem,const QPoint &pnt,int uColumn); - void redirect_onItem(Q3ListViewItem * pItem); - void redirect_expanded(Q3ListViewItem * pItem); - void redirect_collapsed(Q3ListViewItem * pItem); - -}; - - -class KVILIB_API KviTalListViewItem : public Q3ListViewItem -{ -public: - KviTalListViewItem(KviTalListView * pParent) - : Q3ListViewItem(pParent) {}; - KviTalListViewItem(KviTalListViewItem * pParent) - : Q3ListViewItem(pParent) {}; - KviTalListViewItem(KviTalListView * pParent,KviTalListViewItem * pAfter) - : Q3ListViewItem(pParent,pAfter) {}; - KviTalListViewItem(KviTalListViewItem * pParent,KviTalListViewItem * pAfter) - : Q3ListViewItem(pParent,pAfter) {}; - KviTalListViewItem(KviTalListView * pParent,const QString &szLabel1,const QString &szLabel2 = KviQString::empty,const QString &szLabel3 = KviQString::empty,const QString &szLabel4 = KviQString::empty,const QString &szLabel5 = KviQString::empty) - : Q3ListViewItem(pParent,szLabel1,szLabel2,szLabel3,szLabel4,szLabel5) {}; - KviTalListViewItem(KviTalListView * pParent,KviTalListViewItem * pAfter,const QString &szLabel1,const QString &szLabel2 = KviQString::empty,const QString &szLabel3 = KviQString::empty,const QString &szLabel4 = KviQString::empty,const QString &szLabel5 = KviQString::empty) - : Q3ListViewItem(pParent,pAfter,szLabel1,szLabel2,szLabel3,szLabel4,szLabel5) {}; - KviTalListViewItem(KviTalListViewItem * pParent,const QString &szLabel1,const QString &szLabel2 = KviQString::empty,const QString &szLabel3 = KviQString::empty,const QString &szLabel4 = KviQString::empty) - : Q3ListViewItem(pParent,szLabel1,szLabel2,szLabel3,szLabel4) {}; - KviTalListViewItem(KviTalListViewItem * pParent,KviTalListViewItem * pAfter,const QString &szLabel1,const QString &szLabel2 = KviQString::empty,const QString &szLabel3 = KviQString::empty,const QString &szLabel4 = KviQString::empty) - : Q3ListViewItem(pParent,pAfter,szLabel1,szLabel2,szLabel3,szLabel4) {}; -public: - // Shadow the internal Qt methods - KviTalListViewItem * firstChild() const { return (KviTalListViewItem *)Q3ListViewItem::firstChild(); }; - KviTalListViewItem * nextSibling() const { return (KviTalListViewItem *)Q3ListViewItem::nextSibling(); }; - KviTalListViewItem * parent() const { return (KviTalListViewItem *)Q3ListViewItem::parent(); }; - KviTalListView * listView() const { return (KviTalListView *)Q3ListViewItem::listView(); }; - KviTalListViewItem * itemAbove() { return (KviTalListViewItem *)Q3ListViewItem::itemAbove(); }; - KviTalListViewItem * itemBelow() { return (KviTalListViewItem *)Q3ListViewItem::itemBelow(); }; -}; - -struct KviTalCheckListItemPrivate; - -class KVILIB_API KviTalCheckListItem : public KviTalListViewItem -{ -public: - enum Type { RadioButton, - CheckBox, - Controller, - RadioButtonController=Controller, - CheckBoxController }; - - enum ToggleState { Off, NoChange, On }; - - KviTalCheckListItem(KviTalCheckListItem *parent, const QString &text, - Type = RadioButtonController); - KviTalCheckListItem(KviTalCheckListItem *parent, KviTalListViewItem *after, - const QString &text, Type = RadioButtonController); - KviTalCheckListItem(KviTalListViewItem *parent, const QString &text, - Type = RadioButtonController); - KviTalCheckListItem(KviTalListViewItem *parent, KviTalListViewItem *after, - const QString &text, Type = RadioButtonController); - KviTalCheckListItem(KviTalListView *parent, const QString &text, - Type = RadioButtonController); - KviTalCheckListItem(KviTalListView *parent, KviTalListViewItem *after, - const QString &text, Type = RadioButtonController); - KviTalCheckListItem(KviTalListViewItem *parent, const QString &text, - const QPixmap &); - KviTalCheckListItem(KviTalListView *parent, const QString &text, - const QPixmap &); - ~KviTalCheckListItem(); - - void paintCell(QPainter *, const QColorGroup & cg, - int column, int width, int alignment); - virtual void paintFocus(QPainter *, const QColorGroup &cg, - const QRect & r); - int width(const QFontMetrics&, const KviTalListView*, int column) const; - void setup(); - - virtual void setOn(bool); - bool isOn() const { return on; } - Type type() const { return myType; } - QString text() const { return KviTalListViewItem::text(0); } - QString text(int n) const { return KviTalListViewItem::text(n); } - - void setTristate(bool); - bool isTristate() const; - ToggleState state() const; - void setState(ToggleState s); - - int rtti() const; - enum { RTTI = 1 }; - -protected: - void activate(); - void turnOffChild(); - virtual void stateChange(bool); - -private: - void init(); - ToggleState internalState() const; - void setStoredState(ToggleState newState, KviTalCheckListItem *key); - ToggleState storedState(KviTalCheckListItem *key) const; - void stateChange(ToggleState s); - void restoreState(KviTalCheckListItem *key, int depth = 0); - void updateController(bool update = true , bool store = false); - void updateStoredState(KviTalCheckListItem *key); - void setState(ToggleState s, bool update, bool store); - void setCurrentState(ToggleState s); - - Type myType; - bool on; - KviTalCheckListItemPrivate *d; -}; - -#define KviTalListViewItemIterator Q3ListViewItemIterator - - -#endif // _KVI_TAL_LISTVIEW_QT4_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_mainwindow.cpp b/3.4.0/src/kvilib/tal/kvi_tal_mainwindow.cpp deleted file mode 100644 index accfe17bfd..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_mainwindow.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// -// File : kvi_tal_mainwindow.coo -// Creation date : Sun Aug 12 2001 04:40:24 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_tal_mainwindow.h" - -#ifdef COMPILE_KDE_SUPPORT - - KviTalMainWindow::KviTalMainWindow(QWidget * par,const char * nam) - : KMainWindow(par,nam) - { - } - - #include "kvi_tal_mainwindow_kde.moc" - -#else - - #ifdef COMPILE_USE_QT4 - KviTalMainWindow::KviTalMainWindow(QWidget * par,const char * nam) - : QMainWindow(par,nam) - { - } - - bool KviTalMainWindow::usesBigPixmaps() - { - return (iconSize().width() > 40); - } - - void KviTalMainWindow::setUsesBigPixmaps(bool b) - { - if(b)setIconSize(QSize(48,48)); - else setIconSize(QSize(24,24)); - } - #include "kvi_tal_mainwindow_qt4.moc" - #else - KviTalMainWindow::KviTalMainWindow(QWidget * par,const char * nam) - : QMainWindow(par,nam) - { - } - #include "kvi_tal_mainwindow_qt3.moc" - #endif - -#endif - -KviTalMainWindow::~KviTalMainWindow() -{ -} - diff --git a/3.4.0/src/kvilib/tal/kvi_tal_mainwindow.h b/3.4.0/src/kvilib/tal/kvi_tal_mainwindow.h deleted file mode 100644 index a1ca4d7904..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_mainwindow.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef _KVI_TAL_MAINWINDOW_H_ -#define _KVI_TAL_MAINWINDOW_H_ - -// -// File : kvi_tal_mainwindow.h -// Creation date : Sun Aug 12 2001 04:41:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_KDE_SUPPORT - #include "kvi_tal_mainwindow_kde.h" -#else - #ifdef COMPILE_USE_QT4 - #include "kvi_tal_mainwindow_qt4.h" - #else - #include "kvi_tal_mainwindow_qt3.h" - #endif -#endif - -#endif // _KVI_TAL_MAINWINDOW_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_mainwindow_kde.h b/3.4.0/src/kvilib/tal/kvi_tal_mainwindow_kde.h deleted file mode 100644 index f04473d2ca..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_mainwindow_kde.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _KVI_TAL_MAINWINDOW_KDE_H_ -#define _KVI_TAL_MAINWINDOW_KDE_H_ - -// -// File : kvi_tal_mainwindow_kde.h -// Creation date : Sun Aug 12 2001 04:41:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <kmainwindow.h> - -class KVILIB_API KviTalMainWindow : public KMainWindow -{ - Q_OBJECT -public: - KviTalMainWindow(QWidget * par,const char * nam); - ~KviTalMainWindow(); -}; - -#endif // _KVI_TAL_MAINWINDOW_KDE_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_mainwindow_qt3.h b/3.4.0/src/kvilib/tal/kvi_tal_mainwindow_qt3.h deleted file mode 100644 index 9e80abf709..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_mainwindow_qt3.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _KVI_TAL_MAINWINDOW_QT_H_ -#define _KVI_TAL_MAINWINDOW_QT_H_ - -// -// File : kvi_tal_mainwindow_qt.h -// Creation date : Sun Aug 12 2001 04:43:58 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <qmainwindow.h> - -class KVILIB_API KviTalMainWindow : public QMainWindow -{ - Q_OBJECT -public: - KviTalMainWindow(QWidget * par,const char * nam); - ~KviTalMainWindow(); -}; - -#endif // _KVI_TAL_MAINWINDOW_QT_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_mainwindow_qt4.h b/3.4.0/src/kvilib/tal/kvi_tal_mainwindow_qt4.h deleted file mode 100644 index f979b465ab..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_mainwindow_qt4.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _KVI_TAL_MAINWINDOW_QT_H_ -#define _KVI_TAL_MAINWINDOW_QT_H_ - -// -// File : kvi_tal_mainwindow_qt.h -// Creation date : Sun Aug 12 2001 04:43:58 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <qmainwindow.h> - -class KVILIB_API KviTalMainWindow : public QMainWindow -{ - Q_OBJECT -public: - KviTalMainWindow(QWidget * par,const char * nam); - ~KviTalMainWindow(); -public: - bool usesBigPixmaps(); - void setUsesBigPixmaps(bool b); -}; - -#endif // _KVI_TAL_MAINWINDOW_QT_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_menubar.cpp b/3.4.0/src/kvilib/tal/kvi_tal_menubar.cpp deleted file mode 100644 index 72f38a8008..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_menubar.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// -// File : kvi_tal_menubar.cpp -// Creation date : Sun Aug 12 06:35:18 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_tal_menubar.h" - -#ifdef COMPILE_KDE_SUPPORT - - KviTalMenuBar::KviTalMenuBar(QWidget * par,const char * nam) - : KMenuBar(par,nam) - { - } - - KviTalMenuBar::~KviTalMenuBar() - { - } - - #include "kvi_tal_menubar_kde.moc" - -#else - - KviTalMenuBar::KviTalMenuBar(QWidget * par,const char * nam) -#ifdef COMPILE_USE_QT4 - : QMenuBar(par) -#else - : QMenuBar(par,nam) -#endif - { - } - - KviTalMenuBar::~KviTalMenuBar() - { - } - - #include "kvi_tal_menubar_qt.moc" - -#endif diff --git a/3.4.0/src/kvilib/tal/kvi_tal_menubar.h b/3.4.0/src/kvilib/tal/kvi_tal_menubar.h deleted file mode 100644 index e67c8f5263..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_menubar.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef _KVI_TAL_MENUBAR_H_ -#define _KVI_TAL_MENUBAR_H_ -// -// File : kvi_tal_menubar.h -// Creation date : Sun Aug 12 06:35:15 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_KDE_SUPPORT - #include "kvi_tal_menubar_kde.h" -#else - #include "kvi_tal_menubar_qt.h" -#endif - -#endif //_KVI_TAL_MENUBAR_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_menubar_kde.h b/3.4.0/src/kvilib/tal/kvi_tal_menubar_kde.h deleted file mode 100644 index fe0fd12b18..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_menubar_kde.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef _KVI_TAL_MENUBAR_KDE_H_ -#define _KVI_TAL_MENUBAR_KDE_H_ -// -// File : kvi_tal_menubar_kde.h -// Creation date : Sun Aug 12 06:35:22 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <kmenubar.h> - -class KVILIB_API KviTalMenuBar : public KMenuBar -{ - Q_OBJECT -public: - KviTalMenuBar(QWidget * par,const char * nam); - ~KviTalMenuBar(); -}; - -#endif //_KVI_TAL_MENUBAR_KDE_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_menubar_qt.h b/3.4.0/src/kvilib/tal/kvi_tal_menubar_qt.h deleted file mode 100644 index 1ad7f04c38..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_menubar_qt.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef _KVI_TAL_MENUBAR_QT_H_ -#define _KVI_TAL_MENUBAR_QT_H_ -// -// File : kvi_tal_menubar_qt.h -// Creation date : Sun Aug 12 06:35:24 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <qmenubar.h> - -class KVILIB_API KviTalMenuBar : public QMenuBar -{ - Q_OBJECT -public: - KviTalMenuBar(QWidget * par,const char * nam); - ~KviTalMenuBar(); -}; - -#endif //_KVI_TAL_MENUBAR_QT_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_popupmenu.cpp b/3.4.0/src/kvilib/tal/kvi_tal_popupmenu.cpp deleted file mode 100644 index fcc57edccc..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_popupmenu.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//============================================================================= -// -// File : kvi_tal_popupmenu.cpp -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_tal_popupmenu.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_popupmenu_qt4.moc" -#else - #include "kvi_tal_popupmenu_qt3.moc" -#endif - diff --git a/3.4.0/src/kvilib/tal/kvi_tal_popupmenu.h b/3.4.0/src/kvilib/tal/kvi_tal_popupmenu.h deleted file mode 100644 index 6aa1c1a58f..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_popupmenu.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _KVI_TAL_POPUPMENU_H_ -#define _KVI_TAL_POPUPMENU_H_ - -//============================================================================= -// -// File : kvi_tal_popupmenu.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_popupmenu_qt4.h" -#else - #include "kvi_tal_popupmenu_qt3.h" -#endif - -#endif // _KVI_TAL_POPUPMENU_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_popupmenu_qt3.h b/3.4.0/src/kvilib/tal/kvi_tal_popupmenu_qt3.h deleted file mode 100644 index f29e601d55..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_popupmenu_qt3.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _KVI_TAL_POPUPMENU_QT3_H_ -#define _KVI_TAL_POPUPMENU_QT3_H_ - -//============================================================================= -// -// File : kvi_tal_popupmenu.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" - -#include <qpopupmenu.h> - -class KVILIB_API KviTalPopupMenu : public QPopupMenu -{ - Q_OBJECT -public: - KviTalPopupMenu(QWidget * pParent=0,const QString &szName = KviQString::empty) - : QPopupMenu(pParent,KviQString::toUtf8(szName).data()) {}; - virtual ~KviTalPopupMenu() {}; -}; - -#endif // _KVI_TAL_POPUPMENU_QT3_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_popupmenu_qt4.h b/3.4.0/src/kvilib/tal/kvi_tal_popupmenu_qt4.h deleted file mode 100644 index cb7a864b58..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_popupmenu_qt4.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef _KVI_TAL_POPUPMENU_QT4_H_ -#define _KVI_TAL_POPUPMENU_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_popupmenu_qt3.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" - -#include <q3popupmenu.h> -#include <qwidgetaction.h> - -class KVILIB_API KviTalPopupMenu : public Q3PopupMenu -{ - Q_OBJECT -public: - KviTalPopupMenu(QWidget * pParent=0,const QString &szName = KviQString::empty) - : Q3PopupMenu(pParent) - { - setName(szName); - }; - virtual ~KviTalPopupMenu() {}; - - int insertItem(const QString &szText) - { - return Q3PopupMenu::insertItem(szText); - } - int insertItem(const QPixmap &pix,const QString &szText) - { - return Q3PopupMenu::insertItem(QIcon(pix),szText,-1,-1); - } - int insertItem(const QString &szText,int id) - { - return Q3PopupMenu::insertItem(szText,id); - } - int insertItem(const QPixmap &pix,const QString &szText,int id) - { - return Q3PopupMenu::insertItem(QIcon(pix),szText,id,-1); - } - int insertItem(const QString &szText,const QObject * pReceiver,const char * szSlot) - { - return Q3PopupMenu::insertItem(szText,pReceiver,szSlot); - } - int insertItem(const QPixmap &pix,const QString &szText,const QObject * pReceiver,const char * szSlot) - { - return Q3PopupMenu::insertItem(QIcon(pix),szText,pReceiver,szSlot); - } - int insertItem(const QPixmap &pix,const QString &szText,QMenu *pMenu) - { - return Q3PopupMenu::insertItem(QIcon(pix),szText,pMenu,-1,-1); - } - int insertItem(const QString &szText,QMenu *pMenu) - { - return Q3PopupMenu::insertItem(szText,pMenu,-1,-1); - } - int insertItem(QWidget * pWidget) - { - // needs Qt 4.2 - QWidgetAction * pAct = new QWidgetAction(this); - pAct->setDefaultWidget(pWidget); - addAction(pAct); - return 0; - } - - -}; - -#endif // _KVI_TAL_POPUPMENU_QT4_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_scrollview.cpp b/3.4.0/src/kvilib/tal/kvi_tal_scrollview.cpp deleted file mode 100644 index dea4833c68..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_scrollview.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//============================================================================= -// -// File : kvi_tal_scrollview.cpp -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_tal_scrollview.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_scrollview_qt4.moc" -#else - #include "kvi_tal_scrollview_qt3.moc" -#endif - diff --git a/3.4.0/src/kvilib/tal/kvi_tal_scrollview.h b/3.4.0/src/kvilib/tal/kvi_tal_scrollview.h deleted file mode 100644 index b230692685..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_scrollview.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _KVI_TAL_SCROLLVIEW_H_ -#define _KVI_TAL_SCROLLVIEW_H_ - -//============================================================================= -// -// File : kvi_tal_scrollview.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_scrollview_qt4.h" -#else - #include "kvi_tal_scrollview_qt3.h" -#endif - -#endif // _KVI_TAL_SCROLLVIEW_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_scrollview_qt3.h b/3.4.0/src/kvilib/tal/kvi_tal_scrollview_qt3.h deleted file mode 100644 index c1306b1422..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_scrollview_qt3.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _KVI_TAL_SCROLLVIEW_QT3_H_ -#define _KVI_TAL_SCROLLVIEW_QT3_H_ - -//============================================================================= -// -// File : kvi_tal_scrollview_qt3.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qscrollview.h> - -class KVILIB_API KviTalScrollView : public QScrollView -{ - Q_OBJECT -public: - KviTalScrollView(QWidget * pParent) - : QScrollView(pParent) {}; - virtual ~KviTalScrollView() {}; -}; - -#endif // _KVI_TAL_SCROLLVIEW_QT3_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_scrollview_qt4.h b/3.4.0/src/kvilib/tal/kvi_tal_scrollview_qt4.h deleted file mode 100644 index d3d3562cf8..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_scrollview_qt4.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _KVI_TAL_SCROLLVIEW_QT4_H_ -#define _KVI_TAL_SCROLLVIEW_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_scrollview_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <q3scrollview.h> - -class KVILIB_API KviTalScrollView : public Q3ScrollView -{ - Q_OBJECT -public: - KviTalScrollView(QWidget * pParent) - : Q3ScrollView(pParent) {}; - virtual ~KviTalScrollView() {}; -}; - -#endif // _KVI_TAL_SCROLLVIEW_QT4_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_tabdialog.cpp b/3.4.0/src/kvilib/tal/kvi_tal_tabdialog.cpp deleted file mode 100644 index ea5f09b6a7..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_tabdialog.cpp +++ /dev/null @@ -1,34 +0,0 @@ -//============================================================================= -// -// File : kvi_tal_tabdialog.cpp -// Creation date : Tue Feb 06 2007 14:35:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_tal_tabdialog.h" - - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_tabdialog_qt4.moc" -#else - #include "kvi_tal_tabdialog_qt3.moc" -#endif - diff --git a/3.4.0/src/kvilib/tal/kvi_tal_tabdialog.h b/3.4.0/src/kvilib/tal/kvi_tal_tabdialog.h deleted file mode 100644 index 2372bf63cb..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_tabdialog.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _KVI_TAL_TABDIALOG_H_ -#define _KVI_TAL_TABDIALOG_H_ - -//============================================================================= -// -// File : kvi_tal_tabdialog.h -// Creation date : Tue Feb 06 2007 14:35:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_tabdialog_qt4.h" -#else - #include "kvi_tal_tabdialog_qt3.h" -#endif - -#endif // _KVI_TAL_TABDIALOG_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_tabdialog_qt3.h b/3.4.0/src/kvilib/tal/kvi_tal_tabdialog_qt3.h deleted file mode 100644 index 3941c99ff0..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_tabdialog_qt3.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _KVI_TAL_TABDIALOG_QT3_H_ -#define _KVI_TAL_TABDIALOG_QT3_H_ - -//============================================================================= -// -// File : kvi_tal_tabdialog_qt3.h -// Creation date : Tue Feb 06 2007 14:35:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <qtabdialog.h> - -class KVILIB_API KviTalTabDialog : public QTabDialog -{ - Q_OBJECT -public: - KviTalTabDialog(QWidget * pParent = 0,const char * name = 0,bool bModal = false) - : QTabDialog(pParent,name,bModal) {}; - ~KviTalTabDialog() {}; -}; - -#endif // _KVI_TAL_TABDIALOG_QT3_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_tabdialog_qt4.h b/3.4.0/src/kvilib/tal/kvi_tal_tabdialog_qt4.h deleted file mode 100644 index 4862596a36..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_tabdialog_qt4.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _KVI_TAL_TABDIALOG_QT4_H_ -#define _KVI_TAL_TABDIALOG_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_tabdialog_qt4.h -// Creation date : Tue Feb 06 2007 14:35:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <q3tabdialog.h> - -class KVILIB_API KviTalTabDialog : public Q3TabDialog -{ - Q_OBJECT -public: - KviTalTabDialog(QWidget * pParent = 0,const char * name = 0,bool bModal = false) - : Q3TabDialog(pParent,name,bModal) {}; - ~KviTalTabDialog() {}; -}; - -#endif // _KVI_TAL_TABDIALOG_QT3_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_textedit.cpp b/3.4.0/src/kvilib/tal/kvi_tal_textedit.cpp deleted file mode 100644 index 4ee16dcb2b..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_textedit.cpp +++ /dev/null @@ -1,34 +0,0 @@ -//============================================================================= -// -// File : kvi_tal_textedit.cpp -// Creation date : Tue Feb 06 2007 14:35:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_tal_textedit.h" - - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_textedit_qt4.moc" -#else - #include "kvi_tal_textedit_qt3.moc" -#endif - diff --git a/3.4.0/src/kvilib/tal/kvi_tal_textedit.h b/3.4.0/src/kvilib/tal/kvi_tal_textedit.h deleted file mode 100644 index c3c9045167..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_textedit.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _KVI_TAL_TEXTEDIT_H_ -#define _KVI_TAL_TEXTEDIT_H_ - -//============================================================================= -// -// File : kvi_tal_textedit.h -// Creation date : Tue Feb 06 2007 14:35:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_textedit_qt4.h" -#else - #include "kvi_tal_textedit_qt3.h" -#endif - -#endif // _KVI_TAL_TEXTEDIT_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_textedit_qt3.h b/3.4.0/src/kvilib/tal/kvi_tal_textedit_qt3.h deleted file mode 100644 index ca5d2dfb00..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_textedit_qt3.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _KVI_TAL_TEXTEDIT_QT3_H_ -#define _KVI_TAL_TEXTEDIT_QT3_H_ - -//============================================================================= -// -// File : kvi_tal_textedit_qt3.h -// Creation date : Tue Feb 06 2007 14:35:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <qtextedit.h> - -class KVILIB_API KviTalTextEdit : public QTextEdit -{ - Q_OBJECT -public: - KviTalTextEdit(QWidget * pParent = 0,const char * name = 0) - : QTextEdit(pParent,name) {}; - ~KviTalTextEdit() {}; -}; - -#endif // _KVI_TAL_TEXTEDIT_QT3_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_textedit_qt4.h b/3.4.0/src/kvilib/tal/kvi_tal_textedit_qt4.h deleted file mode 100644 index 22c3a76d26..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_textedit_qt4.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _KVI_TAL_TEXTEDIT_QT4_H_ -#define _KVI_TAL_TEXTEDIT_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_textedit_qt4.h -// Creation date : Tue Feb 06 2007 14:35:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <q3textedit.h> - -class KVILIB_API KviTalTextEdit : public Q3TextEdit -{ - Q_OBJECT -public: - KviTalTextEdit(QWidget * pParent = 0,const char * name = 0) - : Q3TextEdit(pParent,name) {}; - ~KviTalTextEdit() {}; -}; - -#endif // _KVI_TAL_TEXTEDIT_QT4_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_toolbar.cpp b/3.4.0/src/kvilib/tal/kvi_tal_toolbar.cpp deleted file mode 100644 index e1e3a37b67..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_toolbar.cpp +++ /dev/null @@ -1,107 +0,0 @@ -// -// File : kvi_tal_toolbar.cpp -// Creation date : Mon Aug 13 05:05:45 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ - - -#include "kvi_tal_toolbar.h" - -#ifdef COMPILE_KDE_SUPPORT - - KviTalToolBar::KviTalToolBar(const QString &label,QMainWindow *w,QT_TOOLBARDOCK_TYPE dock,bool bNewLine,const char * nam) - : KToolBar(w,dock,bNewLine,nam) - { - setLabel(label); - } - - KviTalToolBar::~KviTalToolBar() - { - } - - #include "kvi_tal_toolbar_kde.moc" - -#else - - #ifdef COMPILE_USE_QT4 - - KviTalToolBar::KviTalToolBar(const QString &label,QMainWindow *w,QT_TOOLBARDOCK_TYPE dock,bool bNewLine,const char * nam) - //: Q3ToolBar(label,w,dock,bNewLine,nam) - : QToolBar(label,w) - { - //setFrameStyle(QFrame::NoFrame); - setObjectName(nam); - if(!layout()) - this->setLayout(new QBoxLayout(QBoxLayout::LeftToRight)); - w->addToolBar(dock,this); - } - KviTalToolBar::KviTalToolBar(QMainWindow *w,const char * name) - : QToolBar(w) - { - //setFrameStyle(QFrame::NoFrame); - setObjectName(name); - if(!layout()) - this->setLayout(new QBoxLayout(QBoxLayout::LeftToRight)); - w->addToolBar(this); - } - - QBoxLayout * KviTalToolBar::boxLayout() - { - return (QBoxLayout*)this->layout(); - } - - void KviTalToolBar::setBoxLayout(QBoxLayout * l) - { - this->setLayout(l); - } - - bool KviTalToolBar::usesBigPixmaps() - { - return (iconSize().width() > 40); - } - - void KviTalToolBar::setUsesBigPixmaps(bool b) - { - if(b)setIconSize(QSize(48,48)); - else setIconSize(QSize(22,22)); - } - - #include "kvi_tal_toolbar_qt4.moc" - - #else - KviTalToolBar::KviTalToolBar(const QString &label,QMainWindow *w,QT_TOOLBARDOCK_TYPE dock,bool bNewLine,const char * nam) - : QToolBar(label,w,dock,bNewLine,nam) - { - } - KviTalToolBar::KviTalToolBar(QMainWindow *w,const char * name) - : QToolBar(w,name) - { - } - - #include "kvi_tal_toolbar_qt3.moc" - #endif - - KviTalToolBar::~KviTalToolBar() - { - } - - -#endif diff --git a/3.4.0/src/kvilib/tal/kvi_tal_toolbar.h b/3.4.0/src/kvilib/tal/kvi_tal_toolbar.h deleted file mode 100644 index 48bf0a2330..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_toolbar.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _KVI_TAL_TOOLBAR_H_ -#define _KVI_TAL_TOOLBAR_H_ -// -// File : kvi_tal_toolbar.h -// Creation date : Mon Aug 13 05:05:44 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_KDE_SUPPORT - #include "kvi_tal_toolbar_kde.h" -#else - #ifdef COMPILE_USE_QT4 - #include "kvi_tal_toolbar_qt4.h" - #else - #include "kvi_tal_toolbar_qt3.h" - #endif -#endif - -#endif //_KVI_TAL_TOOLBAR_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_toolbar_kde.h b/3.4.0/src/kvilib/tal/kvi_tal_toolbar_kde.h deleted file mode 100644 index 2427825c79..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_toolbar_kde.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _KVI_TAL_TOOLBAR_KDE_H_ -#define _KVI_TAL_TOOLBAR_KDE_H_ -// -// File : kvi_tal_toolbar_kde.h -// Creation date : Mon Aug 13 05:05:52 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <ktoolbar.h> - -#include "kvi_tal_toolbardocktype.h" - -class KVILIB_API KviTalToolBar : public KToolBar -{ - Q_OBJECT -public: - KviTalToolBar(const QString &label,QMainWindow *w,QT_TOOLBARDOCK_TYPE dock = QT_DOCK_TOP,bool bNewLine = false,const char * nam = 0); - ~KviTalToolBar(); -}; - -#endif //_KVI_TAL_TOOLBAR_KDE_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_toolbar_qt3.h b/3.4.0/src/kvilib/tal/kvi_tal_toolbar_qt3.h deleted file mode 100644 index 801a066c08..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_toolbar_qt3.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _KVI_TAL_TOOLBAR_QT_H_ -#define _KVI_TAL_TOOLBAR_QT_H_ -// -// File : kvi_tal_toolbar_qt.h -// Creation date : Mon Aug 13 05:05:50 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <qtoolbar.h> -#include <qmainwindow.h> - -#include "kvi_tal_toolbardocktype.h" - -class KVILIB_API KviTalToolBar : public QToolBar -{ - Q_OBJECT -public: - KviTalToolBar(const QString &label,QMainWindow *w,QT_TOOLBARDOCK_TYPE dock = QT_DOCK_TOP,bool bNewLine = false,const char * nam = 0); - KviTalToolBar(QMainWindow *w,const char * name=0); - ~KviTalToolBar(); -}; - -#endif //_KVI_TAL_TOOLBAR_QT_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_toolbar_qt4.h b/3.4.0/src/kvilib/tal/kvi_tal_toolbar_qt4.h deleted file mode 100644 index c2f9ae3350..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_toolbar_qt4.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _KVI_TAL_TOOLBAR_QT4_H_ -#define _KVI_TAL_TOOLBAR_QT4_H_ -// -// File : kvi_tal_toolbar_qt4.h -// Creation date : Wed Feb 1 2007 04:11:11 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_tal_toolbardocktype.h" - -#include <QToolBar> -#include <QMainWindow> -#include <QBoxLayout> - - -class KVILIB_API KviTalToolBar : public QToolBar -{ - Q_OBJECT -public: - KviTalToolBar(const QString &label,QMainWindow *w,QT_TOOLBARDOCK_TYPE dock = QT_DOCK_TOP,bool bNewLine = false,const char * nam = 0); - KviTalToolBar(QMainWindow *w,const char * name=0); - ~KviTalToolBar(); -public: - QBoxLayout * boxLayout(); - void setBoxLayout(QBoxLayout *l); - bool usesBigPixmaps(); - void setUsesBigPixmaps(bool b); -}; - -#endif //_KVI_TAL_TOOLBAR_QT_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_toolbardocktype.h b/3.4.0/src/kvilib/tal/kvi_tal_toolbardocktype.h deleted file mode 100644 index c25babee30..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_toolbardocktype.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef _KVI_TAL_TOOLBARDOCKTYPE_H_ -#define _KVI_TAL_TOOLBARDOCKTYPE_H_ -// -// File : kvi_tal_toolbardocktype.h -// Creation date : Tue Sep 17 02:11:28 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -//#define COMPILE_USE_QT4 -#ifdef COMPILE_USE_QT4 -/* - #define QT_TOOLBARDOCK_TYPE Qt::Dock - #define QT_DOCK_TOP Qt::DockTop - #define QT_DOCK_LEFT Qt::DockLeft - #define QT_DOCK_RIGHT Qt::DockRight - #define QT_DOCK_BOTTOM Qt::DockBottom - #define QT_DOCK_MINIMIZED Qt::DockMinimized - #define QT_DOCK_TORNOFF Qt::DockTornOff - #define QT_DOCK_UNMANAGED Qt::DockUnmanaged -*/ - // We will need these when we'll use the real QToolBar in Qt 4.x - #define QT_TOOLBARDOCK_TYPE Qt::ToolBarArea - #define QT_DOCK_TOP Qt::TopToolBarArea - #define QT_DOCK_LEFT Qt::LeftToolBarArea - #define QT_DOCK_RIGHT Qt::RightToolBarArea - #define QT_DOCK_BOTTOM Qt::BottomToolBarArea - // THESE ARE UNSUPPORTED UNDER QT4! - #define QT_DOCK_MINIMIZED Qt::TopToolBarArea - #define QT_DOCK_TORNOFF Qt::TopToolBarArea - #define QT_DOCK_UNMANAGED Qt::TopToolBarArea - -#else - #if QT_VERSION >= 300 - #define QT_TOOLBARDOCK_TYPE Qt::Dock - #define QT_DOCK_TOP Qt::DockTop - #define QT_DOCK_LEFT Qt::DockLeft - #define QT_DOCK_RIGHT Qt::DockRight - #define QT_DOCK_BOTTOM Qt::DockBottom - #define QT_DOCK_MINIMIZED Qt::DockMinimized - #define QT_DOCK_TORNOFF Qt::DockTornOff - #define QT_DOCK_UNMANAGED Qt::DockUnmanaged - #else - #define QT_TOOLBARDOCK_TYPE QMainWindow::ToolBarDock - #define QT_DOCK_TOP QMainWindow::Top - #define QT_DOCK_LEFT QMainWindow::Left - #define QT_DOCK_RIGHT QMainWindow::Right - #define QT_DOCK_BOTTOM QMainWindow::Bottom - #define QT_DOCK_MINIMIZED QMainWindow::Minimized - #define QT_DOCK_TORNOFF QMainWindow::TornOff - #define QT_DOCK_UNMANAGED QMainWindow::Unmanaged - #endif -#endif - -#endif //_KVI_TAL_TOOLBARDOCKTYPE_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_tooltip.cpp b/3.4.0/src/kvilib/tal/kvi_tal_tooltip.cpp deleted file mode 100644 index 6b51b9ab3f..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_tooltip.cpp +++ /dev/null @@ -1,125 +0,0 @@ -//============================================================================= -// -// File : kvi_tal_tooltip.cpp -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_tal_tooltip.h" - -#include <qevent.h> - -KviTalToolTipHelper::KviTalToolTipHelper(KviTalToolTip * pToolTip,QWidget * pWidget) -: QObject(pWidget) -{ -#ifdef COMPILE_USE_QT4 - m_pToolTip = pToolTip; - pWidget->installEventFilter(this); -#endif -} - -KviTalToolTipHelper::~KviTalToolTipHelper() -{ -#ifdef COMPILE_USE_QT4 - if(m_pToolTip) - { - m_pToolTip->helperDying(); - delete m_pToolTip; - } -#endif -} - -void KviTalToolTipHelper::toolTipDying() -{ -#ifdef COMPILE_USE_QT4 - m_pToolTip = 0; -#endif -} - -bool KviTalToolTipHelper::eventFilter(QObject * pObject,QEvent * pEvent) -{ -#ifdef COMPILE_USE_QT4 - if((pEvent->type() == QEvent::ToolTip) && m_pToolTip) - { - debug("TOOL TIP EVENT WITH POSITION %d,%d",((QHelpEvent *)pEvent)->pos().x(),((QHelpEvent *)pEvent)->pos().y()); - m_pToolTip->maybeTip(((QHelpEvent *)pEvent)->pos()); - return true; - } -#endif - return false; -} - - -KviTalToolTip::KviTalToolTip(QWidget * pParent) -#ifndef COMPILE_USE_QT4 -: QToolTip(pParent) -#endif -{ -#ifdef COMPILE_USE_QT4 - m_pHelper = new KviTalToolTipHelper(this,pParent); - m_pParent = pParent; -#endif -} - -KviTalToolTip::~KviTalToolTip() -{ -#ifdef COMPILE_USE_QT4 - if(m_pHelper) - { - m_pHelper->toolTipDying(); - delete m_pHelper; - } -#endif -} - -#ifdef COMPILE_USE_QT4 -void KviTalToolTip::helperDying() -{ - m_pHelper = 0; -} -#endif - -#ifdef COMPILE_USE_QT4 -void KviTalToolTip::add(QWidget * widget,const QString & text) -{ - QToolTip::add(widget,text); -} - -void KviTalToolTip::remove(QWidget * widget) -{ - QToolTip::remove(widget); -} - -void KviTalToolTip::tip(const QRect & rect,const QString & text) -{ - debug("TOOL TIP AT %d,%d",rect.topLeft().x(),rect.topLeft().y()); - QToolTip::showText(m_pParent->mapToGlobal(rect.topLeft()),text); -} -#endif - -void KviTalToolTip::maybeTip(const QPoint & p) -{ - // does nothing here.. and in Qt 4.x will even fail to work -} - -#ifndef COMPILE_ON_WINDOWS - #include "kvi_tal_tooltip.moc" -#endif diff --git a/3.4.0/src/kvilib/tal/kvi_tal_tooltip.h b/3.4.0/src/kvilib/tal/kvi_tal_tooltip.h deleted file mode 100644 index 34ae6220c2..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_tooltip.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef _KVI_TAL_TOOLTIP_H_ -#define _KVI_TAL_TOOLTIP_H_ - -//============================================================================= -// -// File : kvi_tal_tooltip.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qtooltip.h> -#include <qobject.h> - -class KviTalToolTip; - -// This is useful only with Qt4, but we put it here anyway -// to have both a consistent API and make moc happy -class KviTalToolTipHelper : public QObject -{ - friend class KviTalToolTip; - Q_OBJECT -public: - KviTalToolTipHelper(KviTalToolTip * pToolTip,QWidget * pWidget); - ~KviTalToolTipHelper(); -protected: - KviTalToolTip * m_pToolTip; -protected: - virtual bool eventFilter(QObject * pObject,QEvent * pEvent); - void toolTipDying(); -}; - - -class KVILIB_API KviTalToolTip -#ifndef COMPILE_USE_QT4 - : public QToolTip -#endif -{ - friend class KviTalToolTipHelper; -public: - KviTalToolTip(QWidget * pParent); - virtual ~KviTalToolTip(); -protected: -#ifdef COMPILE_USE_QT4 - KviTalToolTipHelper * m_pHelper; - QWidget * m_pParent; -#endif -public: -#ifdef COMPILE_USE_QT4 - static void add(QWidget * widget,const QString & text); - static void remove(QWidget * widget); - virtual void tip(const QRect & rect,const QString & text); -#endif -protected: - virtual void maybeTip(const QPoint & p); -#ifdef COMPILE_USE_QT4 - void helperDying(); -#endif -}; - -#endif // _KVI_TAL_TOOLTIP_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_vbox.cpp b/3.4.0/src/kvilib/tal/kvi_tal_vbox.cpp deleted file mode 100644 index 6ac47d2f6b..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_vbox.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//============================================================================= -// -// File : kvi_tal_vbox.cpp -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_tal_vbox.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_vbox_qt4.moc" -#else - #include "kvi_tal_vbox_qt3.moc" -#endif - diff --git a/3.4.0/src/kvilib/tal/kvi_tal_vbox.h b/3.4.0/src/kvilib/tal/kvi_tal_vbox.h deleted file mode 100644 index ee35a98d7c..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_vbox.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _KVI_TAL_VBOX_H_ -#define _KVI_TAL_VBOX_H_ - -//============================================================================= -// -// File : kvi_tal_vbox.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_vbox_qt4.h" -#else - #include "kvi_tal_vbox_qt3.h" -#endif - -#endif // _KVI_TAL_VBOX_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_vbox_qt3.h b/3.4.0/src/kvilib/tal/kvi_tal_vbox_qt3.h deleted file mode 100644 index 1bd01bb2e1..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_vbox_qt3.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _KVI_TAL_VBOX_QT3_H_ -#define _KVI_TAL_VBOX_QT3_H_ - -//============================================================================= -// -// File : kvi_tal_vbox_qt3.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qvbox.h> - -class KVILIB_API KviTalVBox : public QVBox -{ - Q_OBJECT -public: - KviTalVBox(QWidget * pParent) - : QVBox(pParent) {}; - virtual ~KviTalVBox() {}; -}; - - -#endif // _KVI_TAL_VBOX_QT3_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_vbox_qt4.h b/3.4.0/src/kvilib/tal/kvi_tal_vbox_qt4.h deleted file mode 100644 index 661b25eedf..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_vbox_qt4.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _KVI_TAL_VBOX_QT4_H_ -#define _KVI_TAL_VBOX_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_vbox_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <q3vbox.h> - -class KVILIB_API KviTalVBox : public Q3VBox -{ - Q_OBJECT -public: - KviTalVBox(QWidget * pParent) - : Q3VBox(pParent) {}; - virtual ~KviTalVBox() {}; -}; - - -#endif // _KVI_TAL_VBOX_QT4_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_widgetstack.cpp b/3.4.0/src/kvilib/tal/kvi_tal_widgetstack.cpp deleted file mode 100644 index 8fc4ee62ed..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_widgetstack.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//============================================================================= -// -// File : kvi_tal_widgetstack.cpp -// Creation date : Mon Jan 22 2007 11:17:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_tal_widgetstack.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_widgetstack_qt4.moc" -#else - #include "kvi_tal_widgetstack_qt3.moc" -#endif - diff --git a/3.4.0/src/kvilib/tal/kvi_tal_widgetstack.h b/3.4.0/src/kvilib/tal/kvi_tal_widgetstack.h deleted file mode 100644 index 792982020f..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_widgetstack.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _KVI_TAL_WIDGETSTACK_H_ -#define _KVI_TAL_WIDGETSTACK_H_ - -//============================================================================= -// -// File : kvi_tal_widgetstack.h -// Creation date : Mon Jan 22 2007 11:17:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_widgetstack_qt4.h" -#else - #include "kvi_tal_widgetstack_qt3.h" -#endif - -#endif // _KVI_TAL_WIDGETSTACK_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_widgetstack_qt3.h b/3.4.0/src/kvilib/tal/kvi_tal_widgetstack_qt3.h deleted file mode 100644 index 8679dcfde3..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_widgetstack_qt3.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _KVI_TAL_WIDGETSTACK_QT3_H_ -#define _KVI_TAL_WIDGETSTACK_QT3_H_ - -//============================================================================= -// -// File : kvi_tal_widgetstack_qt3.h -// Creation date : Mon Jan 22 2007 11:17:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qwidgetstack.h> - - -class KVILIB_API KviTalWidgetStack : public QWidgetStack -{ - Q_OBJECT -public: - KviTalWidgetStack(QWidget * pParent) - : QWidgetStack(pParent) {}; - virtual ~KviTalWidgetStack() {}; -}; - -#endif // _KVI_TAL_WIDGETSTACK_QT3_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_widgetstack_qt4.h b/3.4.0/src/kvilib/tal/kvi_tal_widgetstack_qt4.h deleted file mode 100644 index 5d47586e45..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_widgetstack_qt4.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _KVI_TAL_WIDGETSTACK_QT4_H_ -#define _KVI_TAL_WIDGETSTACK_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_widgetstack_qt4.h -// Creation date : Mon Jan 22 2007 11:17:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -//#include <qstackedwidget.h> -#include <q3widgetstack.h> - -class KVILIB_API KviTalWidgetStack : public Q3WidgetStack -{ - Q_OBJECT -public: - KviTalWidgetStack(QWidget * pParent) - : Q3WidgetStack(pParent) {}; - virtual ~KviTalWidgetStack() {}; -}; - -#endif // _KVI_TAL_WIDGETSTACK_QT4_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_windowstate.h b/3.4.0/src/kvilib/tal/kvi_tal_windowstate.h deleted file mode 100644 index cff64b224a..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_windowstate.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _KVI_TAL_WINDOWSTATE_H_ -#define _KVI_TAL_WINDOWSTATE_H_ - -//============================================================================= -// -// File : kvi_tal_windowstate.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #define QT_WINDOWSTATE_FLAGS Qt::WindowState - - #define QT_WINDOWSTATE_MAXIMIZED Qt::WindowMaximized - #define QT_WINDOWSTATE_MINIMIZED Qt::WindowMinimized -#else - #define QT_WINDOWSTATE_FLAGS Qt::WidgetState - - #define QT_WINDOWSTATE_MAXIMIZED Qt::WState_Maximized - #define QT_WINDOWSTATE_MINIMIZED Qt::WState_Minimized -#endif - -#endif // _KVI_TAL_WINDOWSTATE_H_ diff --git a/3.4.0/src/kvilib/tal/kvi_tal_wizard.cpp b/3.4.0/src/kvilib/tal/kvi_tal_wizard.cpp deleted file mode 100644 index 6acc5a10cd..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_wizard.cpp +++ /dev/null @@ -1,584 +0,0 @@ -//============================================================================= -// -// File : kvi_tal_wizard.cpp -// Creation date : Tue Feb 06 2007 14:35:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVILIB__ -#include "kvi_tal_wizard.h" -#include "kvi_tal_hbox.h" -#include "kvi_pointerlist.h" -#include "kvi_locale.h" - -#ifdef COMPILE_USE_QT4 - #include <QShowEvent> - #include <QLabel> - #include <QPushButton> - #include <QGridLayout> - #include <QFrame> - #include <QStackedWidget> - #include <QPalette> -#else - #include <qlabel.h> - #include <qpushbutton.h> - #include <qlayout.h> - #include <qevent.h> - #include <qframe.h> - #include <qwidgetstack.h> - #include <qpalette.h> -#endif - - -class KviTalWizardPageData -{ -public: - enum EnableFlags - { - EnableNext = 1, - EnableBack = 2, - EnableHelp = 4, - EnableCancel = 8, - EnableFinish = 16 - }; -public: - QWidget * pWidget; - QString szTitle; - bool bEnabled; - int iEnableFlags; - int iVisibleIndex; -}; - -class KviTalWizardPrivate -{ -public: - KviPointerList<KviTalWizardPageData> * pPageList; - int iEnabledPageCount; - KviTalWizardPageData * pCurrentPage; - QGridLayout * pLayout; - QLabel * pTitleLabel; - QLabel * pStepsLabel; - QPushButton * pBackButton; - QPushButton * pCancelButton; - QPushButton * pHelpButton; - QPushButton * pNextButton; - QWidget * pNextSpacer; - QPushButton * pFinishButton; - QWidget * pFinishSpacer; -#ifdef COMPILE_USE_QT4 - QStackedWidget * pWidgetStack; -#else - QWidgetStack * pWidgetStack; -#endif -public: - KviTalWizardPageData * findPage(QWidget * pWidget) - { - for(KviTalWizardPageData * pData = pPageList->first();pData;pData = pPageList->next()) - { - if(pData->pWidget == pWidget) - return pData; - } - return NULL; - } - - KviTalWizardPageData * findFirstEnabledPage() - { - KviTalWizardPageData * pData; - for(pData = pPageList->first();pData;pData = pPageList->next()) - { - if(pData->bEnabled) - return pData; - } - return NULL; - } - - KviTalWizardPageData * findLastEnabledPage() - { - KviTalWizardPageData * pData; - for(pData = pPageList->last();pData;pData = pPageList->prev()) - { - if(pData->bEnabled) - return pData; - } - return NULL; - } - - KviTalWizardPageData * findNextEnabledPage(QWidget * pReference) - { - if(!pReference) - return findFirstEnabledPage(); - KviTalWizardPageData * pData = findPage(pReference); - if(!pData) - return NULL; - for(pData = pPageList->next();pData;pData = pPageList->next()) - { - if(pData->bEnabled) - return pData; - } - return NULL; - } - - KviTalWizardPageData * findPrevEnabledPage(QWidget * pReference) - { - if(!pReference) - return findLastEnabledPage(); - KviTalWizardPageData * pData = findPage(pReference); - if(!pData) - return NULL; - for(pData = pPageList->prev();pData;pData = pPageList->prev()) - { - if(pData->bEnabled) - return pData; - } - return NULL; - } - - int reindexPages() - { - int iEnabledCount = 0; - for(KviTalWizardPageData * pData = pPageList->next();pData;pData = pPageList->next()) - { - if(pData->bEnabled) - { - iEnabledCount++; - pData->iVisibleIndex = iEnabledCount; - } - } - return iEnabledCount; - } -}; - - -KviTalWizard::KviTalWizard(QWidget * pParent) -: QDialog(pParent) -{ - m_p = new KviTalWizardPrivate; - m_p->pPageList = new KviPointerList<KviTalWizardPageData>; - m_p->pPageList->setAutoDelete(true); - m_p->pCurrentPage = NULL; - m_p->iEnabledPageCount = 0; - m_p->pLayout = new QGridLayout(this); - - m_p->pTitleLabel = new QLabel(this); -#ifdef COMPILE_USE_QT4 - m_p->pLayout->addWidget(m_p->pTitleLabel,0,0,1,3); -#else - m_p->pLayout->addMultiCellWidget(m_p->pTitleLabel,0,0,0,3); -#endif - m_p->pStepsLabel = new QLabel(this); - m_p->pStepsLabel->setMinimumWidth(80); - m_p->pStepsLabel->setAlignment(Qt::AlignRight); -#ifdef COMPILE_USE_QT4 - m_p->pLayout->addWidget(m_p->pStepsLabel,0,4,1,3); -#else - m_p->pLayout->addMultiCellWidget(m_p->pStepsLabel,0,0,4,6); -#endif - - QFrame * f1 = new QFrame(this); - f1->setFrameStyle(QFrame::Sunken | QFrame::HLine); -#ifdef COMPILE_USE_QT4 - m_p->pLayout->addWidget(f1,1,0,1,7); -#else - m_p->pLayout->addMultiCellWidget(f1,1,1,0,6); -#endif - -#ifdef COMPILE_USE_QT4 - m_p->pWidgetStack = new QStackedWidget(this); - m_p->pLayout->addWidget(m_p->pWidgetStack,2,0,1,7); -#else - m_p->pWidgetStack = new QWidgetStack(this); - m_p->pLayout->addMultiCellWidget(m_p->pWidgetStack,2,2,0,6); -#endif - - QFrame * f2 = new QFrame(this); - f2->setFrameStyle(QFrame::Sunken | QFrame::HLine); -#ifdef COMPILE_USE_QT4 - m_p->pLayout->addWidget(f2,3,0,1,7); -#else - m_p->pLayout->addMultiCellWidget(f2,3,3,0,6); -#endif - - KviTalHBox * pButtonBox = new KviTalHBox(this); -#ifdef COMPILE_USE_QT4 - m_p->pLayout->addWidget(pButtonBox,4,0,1,7); -#else - m_p->pLayout->addMultiCellWidget(pButtonBox,4,4,0,6); -#endif - - pButtonBox->setMargin(0); - pButtonBox->setSpacing(0); - - - m_p->pCancelButton = new QPushButton(__tr("Cancel"),pButtonBox); - m_p->pCancelButton->setMinimumWidth(80); - QObject::connect( - m_p->pCancelButton, - SIGNAL(clicked()), - this, - SLOT(cancelButtonClicked()) - ); - - QWidget * pSpacer = new QWidget(pButtonBox); - pSpacer->setFixedWidth(4); - - m_p->pHelpButton = new QPushButton(__tr("Help"),pButtonBox); - m_p->pHelpButton->setMinimumWidth(80); - QObject::connect( - m_p->pHelpButton, - SIGNAL(clicked()), - this, - SLOT(helpButtonClicked()) - ); - - QWidget * pLargeSpacer = new QWidget(pButtonBox); - pLargeSpacer->setMinimumWidth(50); - pButtonBox->setStretchFactor(pLargeSpacer,100); - - QString szText = "< "; - szText += __tr("Back"); - m_p->pBackButton = new QPushButton(szText,pButtonBox); - m_p->pBackButton->setMinimumWidth(80); - QObject::connect( - m_p->pBackButton, - SIGNAL(clicked()), - this, - SLOT(backButtonClicked()) - ); - - m_p->pNextSpacer = new QWidget(pButtonBox); - m_p->pNextSpacer->setFixedWidth(4); - - szText = __tr("Next"); - szText += " >"; - m_p->pNextButton = new QPushButton(szText,pButtonBox); - m_p->pNextButton->setMinimumWidth(80); - QObject::connect( - m_p->pNextButton, - SIGNAL(clicked()), - this, - SLOT(nextButtonClicked()) - ); - - m_p->pFinishSpacer = new QWidget(pButtonBox); - m_p->pFinishSpacer->setFixedWidth(4); - - m_p->pFinishButton = new QPushButton(__tr("Finish"),pButtonBox); - m_p->pFinishButton->setMinimumWidth(80); - QObject::connect( - m_p->pFinishButton, - SIGNAL(clicked()), - this, - SLOT(finishButtonClicked()) - ); - - m_p->pLayout->setMargin(8); - m_p->pLayout->setSpacing(4); - m_p->pLayout->setRowStretch(2,1); - m_p->pLayout->setColStretch(0,1); -} - -KviTalWizard::~KviTalWizard() -{ - delete m_p->pPageList; - delete m_p; -} - -void KviTalWizard::insertPage(QWidget * pWidget,const QString &szTitle,int iIndex) -{ - KviTalWizardPageData * pPageData = m_p->findPage(pWidget); - if(!pPageData) - { - pPageData = new KviTalWizardPageData; - pPageData->pWidget = pWidget; - pPageData->iEnableFlags = \ - KviTalWizardPageData::EnableNext | \ - KviTalWizardPageData::EnableCancel | \ - KviTalWizardPageData::EnableBack; - if(iIndex < 0) - { - m_p->pPageList->append(pPageData); - m_p->iEnabledPageCount++; - pPageData->iVisibleIndex = m_p->iEnabledPageCount; - } else { - m_p->pPageList->insert(iIndex,pPageData); - m_p->iEnabledPageCount = m_p->reindexPages(); - } - m_p->pWidgetStack->addWidget(pWidget); - } - pPageData->szTitle = szTitle; - pPageData->bEnabled = true; - -} - -void KviTalWizard::addPage(QWidget * pWidget,const QString &szTitle) -{ - insertPage(pWidget,szTitle,-1); -} - -bool KviTalWizard::setPageEnabled(QWidget * pWidget,bool bEnabled) -{ - KviTalWizardPageData * pData = m_p->findPage(pWidget); - if(!pData) - return false; - pData->bEnabled = bEnabled; - m_p->iEnabledPageCount = m_p->reindexPages(); - setCurrentPage(m_p->pCurrentPage); - return true; -} - -bool KviTalWizard::setPageTitle(QWidget * pWidget,const QString &szTitle) -{ - KviTalWizardPageData * pData = m_p->findPage(pWidget); - if(!pData) - return false; - pData->szTitle = szTitle; - return true; -} - -bool KviTalWizard::setCurrentPage(QWidget * pWidget) -{ - KviTalWizardPageData * pData = m_p->findPage(pWidget); - if(!pData) - return false; - setCurrentPage(pData); - return true; -} - -QWidget * KviTalWizard::currentPage() -{ - if(!m_p->pCurrentPage) - return NULL; - return m_p->pCurrentPage->pWidget; -} - -void KviTalWizard::setCurrentPage(KviTalWizardPageData * pData) -{ - m_p->pCurrentPage = pData; - - bool bCancelEnabled = true; - bool bNextEnabled = false; - bool bBackEnabled = false; - bool bHelpEnabled = false; - bool bFinishEnabled = false; - - QString szTitle; - QString szSteps; - - if(pData) - { - bNextEnabled = (pData->iEnableFlags & KviTalWizardPageData::EnableNext) && m_p->findNextEnabledPage(pData->pWidget); - bBackEnabled = (pData->iEnableFlags & KviTalWizardPageData::EnableBack) && m_p->findPrevEnabledPage(pData->pWidget); - bCancelEnabled = (pData->iEnableFlags & KviTalWizardPageData::EnableCancel); - bFinishEnabled = (pData->iEnableFlags & KviTalWizardPageData::EnableFinish); - bHelpEnabled = (pData->iEnableFlags & KviTalWizardPageData::EnableHelp); -#ifdef COMPILE_USE_QT4 - m_p->pWidgetStack->setCurrentWidget(pData->pWidget); -#else - m_p->pWidgetStack->raiseWidget(pData->pWidget); -#endif - szTitle = "<b>"; - szTitle += pData->szTitle; - szTitle += "</b>"; - QPalette pal = m_p->pStepsLabel->palette(); -#ifdef COMPILE_USE_QT4 - QColor clrWin = pal.color(QPalette::Normal,QPalette::Window); - QColor clrTxt = pal.color(QPalette::Normal,QPalette::WindowText); -#else - QColor clrWin = pal.color(QPalette::Normal,QColorGroup::Foreground); - QColor clrTxt = pal.color(QPalette::Normal,QColorGroup::Background); -#endif - QColor clrMid = qRgb( - (clrWin.red() + clrTxt.red()) / 2, - (clrWin.green() + clrTxt.green()) / 2, - (clrWin.blue() + clrTxt.blue()) / 2 - ); - - szSteps = "<nobr><font color=\""; - szSteps += clrMid.name(); - szSteps += "\"><b>["; - szSteps += QString("Step %1 of %2").arg(pData->iVisibleIndex).arg(m_p->iEnabledPageCount); - szSteps += "]</b></font></nobr>"; - } - - m_p->pTitleLabel->setText(szTitle); - m_p->pStepsLabel->setText(szSteps); - - m_p->pNextButton->setEnabled(bNextEnabled); - if(bNextEnabled) - { - m_p->pNextButton->show(); - m_p->pNextSpacer->show(); - } else { - m_p->pNextButton->hide(); - m_p->pNextSpacer->hide(); - } - m_p->pBackButton->setEnabled(bBackEnabled); - m_p->pHelpButton->setEnabled(bHelpEnabled); - if(bHelpEnabled) - m_p->pHelpButton->show(); - else - m_p->pHelpButton->hide(); - m_p->pCancelButton->setEnabled(bCancelEnabled); - m_p->pFinishButton->setEnabled(bFinishEnabled); - if(bFinishEnabled) - { - m_p->pFinishButton->show(); - m_p->pFinishSpacer->show(); - } else { - m_p->pFinishButton->hide(); - m_p->pFinishSpacer->hide(); - } -} - -void KviTalWizard::showEvent(QShowEvent * e) -{ - if(!(m_p->pCurrentPage)) - { - // display the first page - KviTalWizardPageData * pData = m_p->findFirstEnabledPage(); - if(pData) - setCurrentPage(pData->pWidget); - } - QDialog::showEvent(e); -} - -void KviTalWizard::closeEvent(QCloseEvent * e) -{ - e->ignore(); - cancelButtonClicked(); -} - -void KviTalWizard::backButtonClicked() -{ - if(!m_p->pCurrentPage) - return; - setCurrentPage(m_p->findPrevEnabledPage(m_p->pCurrentPage->pWidget)); -} - -void KviTalWizard::nextButtonClicked() -{ - setCurrentPage(m_p->findNextEnabledPage(m_p->pCurrentPage->pWidget)); -} - -void KviTalWizard::helpButtonClicked() -{ - emit helpClicked(); -} - -void KviTalWizard::cancelButtonClicked() -{ - reject(); -} - -void KviTalWizard::finishButtonClicked() -{ - accept(); -} - -void KviTalWizard::setHelpEnabled(QWidget * pWidget,bool bEnabled) -{ - KviTalWizardPageData * pData = m_p->findPage(pWidget); - if(!pData) - return; - if(bEnabled) - pData->iEnableFlags |= KviTalWizardPageData::EnableHelp; - else - pData->iEnableFlags &= ~KviTalWizardPageData::EnableHelp; - if(pData == m_p->pCurrentPage) - setCurrentPage(pData); -} - -void KviTalWizard::setCancelEnabled(QWidget * pWidget,bool bEnabled) -{ - KviTalWizardPageData * pData = m_p->findPage(pWidget); - if(!pData) - return; - if(bEnabled) - pData->iEnableFlags |= KviTalWizardPageData::EnableCancel; - else - pData->iEnableFlags &= ~KviTalWizardPageData::EnableCancel; - if(pData == m_p->pCurrentPage) - setCurrentPage(pData); -} - -void KviTalWizard::setFinishEnabled(QWidget * pWidget,bool bEnabled) -{ - KviTalWizardPageData * pData = m_p->findPage(pWidget); - if(!pData) - return; - if(bEnabled) - pData->iEnableFlags |= KviTalWizardPageData::EnableFinish; - else - pData->iEnableFlags &= ~KviTalWizardPageData::EnableFinish; - if(pData == m_p->pCurrentPage) - setCurrentPage(pData); -} - -void KviTalWizard::setNextEnabled(QWidget * pWidget,bool bEnabled) -{ - KviTalWizardPageData * pData = m_p->findPage(pWidget); - if(!pData) - return; - if(bEnabled) - pData->iEnableFlags |= KviTalWizardPageData::EnableNext; - else - pData->iEnableFlags &= ~KviTalWizardPageData::EnableNext; - if(pData == m_p->pCurrentPage) - setCurrentPage(pData); -} - -void KviTalWizard::setBackEnabled(QWidget * pWidget,bool bEnabled) -{ - KviTalWizardPageData * pData = m_p->findPage(pWidget); - if(!pData) - return; - if(bEnabled) - pData->iEnableFlags |= KviTalWizardPageData::EnableBack; - else - pData->iEnableFlags &= ~KviTalWizardPageData::EnableBack; - if(pData == m_p->pCurrentPage) - setCurrentPage(pData); -} - -QPushButton * KviTalWizard::cancelButton() -{ - return m_p->pCancelButton; -} - -QPushButton * KviTalWizard::helpButton() -{ - return m_p->pHelpButton; -} - -QPushButton * KviTalWizard::finishButton() -{ - return m_p->pFinishButton; -} - -QPushButton * KviTalWizard::nextButton() -{ - return m_p->pNextButton; -} - -QPushButton * KviTalWizard::backButton() -{ - return m_p->pBackButton; -} - diff --git a/3.4.0/src/kvilib/tal/kvi_tal_wizard.h b/3.4.0/src/kvilib/tal/kvi_tal_wizard.h deleted file mode 100644 index 8cd38d3891..0000000000 --- a/3.4.0/src/kvilib/tal/kvi_tal_wizard.h +++ /dev/null @@ -1,169 +0,0 @@ -#ifndef _KVI_TAL_WIZARD_H_ -#define _KVI_TAL_WIZARD_H_ - -//============================================================================= -// -// File : kvi_tal_wizard.h -// Creation date : Tue Feb 06 2007 14:35:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - #include <QDialog> -#else - #include <qdialog.h> -#endif - -class QShowEvent; -class QPushButton; -class KviTalWizardPrivate; -class KviTalWizardPageData; - -/// -/// \class KviTalWizard -/// -/// \brief Provides a wizard-style dialog with steps -/// -class KVILIB_API KviTalWizard : public QDialog -{ - Q_OBJECT -public: - KviTalWizard(QWidget * pParent); - ~KviTalWizard(); -protected: - KviTalWizardPrivate * m_p; -public: - /// - /// Adds a page to the wizard with the specified title. - /// The pages are displayed in order they're added. - /// Adding a page a second time is equivalent to calling - /// setPageTitle() and enabling the page. - /// - void addPage(QWidget * pWidget,const QString &szTitle); - /// - /// Adds a page to the wizard with the specified title - /// and in the specified position. - /// Adding a page a second time is equivalent to calling - /// setPageTitle() and enabling the page. - /// - void insertPage(QWidget * pWidget,const QString &szTitle,int iIndex); - /// - /// Enables or disables a page. A disabled page - /// is skipped when the user presses "Next" in the - /// previous page or "Back" in the page after. - /// Disabling the current page has no effect. - /// - /// Returns true on success or false if the pWidget - /// does not identify a page that has been added to this wizard. - /// - bool setPageEnabled(QWidget * pWidget,bool bEnabled); - /// - /// Changes a page title. - /// - /// Returns true on success or false if the pWidget - /// does not identify a page that has been added to this wizard. - /// - bool setPageTitle(QWidget * pWidget,const QString &szTitle); - /// - /// Switches the wizard to the specified page. - /// Please note that this class handles page switching - /// automatically so you usually don't need to call this function. - /// - /// Returns true on success or false if the pWidget - /// does not identify a page that has been added to this wizard. - /// - bool setCurrentPage(QWidget * pWidget); - /// - /// Returns a pointer to the current page - /// - QWidget * currentPage(); - /// - /// Enables or disables the help button for the specified page. - /// By default the help button is always disabled. - /// - void setHelpEnabled(QWidget * pWidget,bool bEnabled); - /// - /// Enables or disables the cancel button for the specified page. - /// By default the cancel button is always enabled. - /// - void setCancelEnabled(QWidget * pWidget,bool bEnabled); - /// - /// Enables or disables the finish button for the specified page. - /// By default the finish button is always disabled. - /// - void setFinishEnabled(QWidget * pWidget,bool bEnabled); - /// - /// Enables or disables the next button for the specified page. - /// By default the next button is always enabled. - /// - void setNextEnabled(QWidget * pWidget,bool bEnabled); - /// - /// Enables or disables the prev button for the specified page. - /// By default the prev button is always enabled. - /// - void setBackEnabled(QWidget * pWidget,bool bEnabled); - /// - /// Returns a pointer to the cancel button displayed in the dialog. - /// - QPushButton * cancelButton(); - /// - /// Returns a pointer to the help button displayed in the dialog. - /// - QPushButton * helpButton(); - /// - /// Returns a pointer to the finish button displayed in the dialog. - /// - QPushButton * finishButton(); - /// - /// Returns a pointer to the next button displayed in the dialog. - /// - QPushButton * nextButton(); - /// - /// Returns a pointer to the back button displayed in the dialog. - /// - QPushButton * backButton(); -signals: - /// - /// Emitted when the help button is clicked. - /// - void helpClicked(); -protected: - /// - /// Displays the first page if no other page is shown yet. - /// - virtual void showEvent(QShowEvent * e); - /// - /// Handles redirects the close button to the "cancel" operation. - /// - virtual void closeEvent(QCloseEvent * e); -protected: - void setCurrentPage(KviTalWizardPageData * pData); -protected slots: - void backButtonClicked(); - void nextButtonClicked(); - void helpButtonClicked(); - void cancelButtonClicked(); - void finishButtonClicked(); -}; - - -#endif // _KVI_TAL_WIZARD_H_ diff --git a/3.4.0/src/kvirc/.svnignore b/3.4.0/src/kvirc/.svnignore deleted file mode 100644 index 4314e23d16..0000000000 --- a/3.4.0/src/kvirc/.svnignore +++ /dev/null @@ -1,16 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -*.o -*.lo -*.la -*.so -*.lai diff --git a/3.4.0/src/kvirc/Makefile.am b/3.4.0/src/kvirc/Makefile.am deleted file mode 100644 index e65e65cff0..0000000000 --- a/3.4.0/src/kvirc/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -SUBDIRS = build include kernel kvs module sparser ui diff --git a/3.4.0/src/kvirc/build/.svnignore b/3.4.0/src/kvirc/build/.svnignore deleted file mode 100644 index dad045668c..0000000000 --- a/3.4.0/src/kvirc/build/.svnignore +++ /dev/null @@ -1,18 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -*.o -*.lo -*.la -*.so -*.lai -kvirc -symlinks diff --git a/3.4.0/src/kvirc/build/Makefile.am b/3.4.0/src/kvirc/build/Makefile.am deleted file mode 100644 index 44db487eb1..0000000000 --- a/3.4.0/src/kvirc/build/Makefile.am +++ /dev/null @@ -1,537 +0,0 @@ -######################################################################################################################## -# -# KVIrc executable Makefile -# Szymon Stefanek 21.09.2001 -# -######################################################################################################################## - -AM_CPPFLAGS = -I$(SS_TOPSRCDIR)/src/kvilib/include/ -I$(SS_TOPSRCDIR)/src/kvirc/include/ \ -$(SS_INCDIRS) $(SS_CPPFLAGS) -DGLOBAL_KVIRC_DIR=\"$(globalkvircdir)\" - -kvirc_LDFLAGS = -export-dynamic $(SS_LDFLAGS) $(SS_LIBDIRS) $(SS_RPATH) -kvirc_LDADD = $(SS_LIBLINK) ../../kvilib/build/libkvilib.la - -bin_PROGRAMS = kvirc - -# -# Command useful to find out all the sources -# SRC=`find ../ -name *.cpp | sort` -# echo $SRC -# - -nodist_kvirc_SOURCES = ../kernel/moc_kvi_action.cpp \ -../kernel/moc_kvi_actionmanager.cpp \ -../kernel/moc_kvi_coreactions.cpp \ -../kernel/moc_kvi_filetransfer.cpp \ -../kernel/moc_kvi_ircconnection.cpp \ -../kernel/moc_kvi_irccontext.cpp \ -../kernel/moc_kvi_irclink.cpp \ -../kernel/moc_kvi_ircsocket.cpp \ -../kernel/moc_kvi_ircconnectiontargetresolver.cpp \ -../kvs/moc_kvi_kvs_action.cpp \ -../kvs/moc_kvi_kvs_asyncdnsoperation.cpp \ -../kvs/moc_kvi_kvs_asyncoperation.cpp \ -../kvs/moc_kvi_kvs_dnsmanager.cpp \ -../kvs/moc_kvi_kvs_timermanager.cpp \ -../kvs/moc_kvi_kvs_object.cpp \ -../kvs/moc_kvi_kvs_popupmenu.cpp \ -../kvs/moc_kvi_kvs_processmanager.cpp \ -../kvs/moc_kvi_kvs_useraction.cpp \ -../module/moc_kvi_mexlinkfilter.cpp \ -../module/moc_kvi_mexserverimport.cpp \ -../module/moc_kvi_mextoolbar.cpp \ -../module/moc_kvi_modulemanager.cpp \ -../ui/moc_kvi_actiondrawer.cpp \ -../ui/moc_kvi_customtoolbar.cpp \ -../ui/moc_kvi_debugwindow.cpp \ -../ui/moc_kvi_htmldialog.cpp \ -../ui/moc_kvi_imagedialog.cpp \ -../ui/moc_kvi_ircviewtools.cpp \ -../ui/moc_kvi_mdicaption.cpp \ -../ui/moc_kvi_mdichild.cpp \ -../ui/moc_kvi_mdimanager.cpp \ -../ui/moc_kvi_statusbar.cpp \ -../ui/moc_kvi_statusbarapplet.cpp \ -../ui/moc_kvi_toolwindows_container.cpp \ -../ui/moc_kvi_listview.cpp - -kvirc_SOURCES = ../kernel/kvi_action.cpp \ -../kernel/kvi_actionmanager.cpp \ -../kernel/kvi_app.cpp \ -../kernel/kvi_coreactions.cpp \ -../kernel/kvi_filetransfer.cpp \ -../kernel/kvi_app_fs.cpp \ -../kernel/kvi_app_setup.cpp \ -../kernel/kvi_asynchronousconnectiondata.cpp \ -../kernel/kvi_customtoolbardescriptor.cpp \ -../kernel/kvi_customtoolbarmanager.cpp \ -../kernel/kvi_iconmanager.cpp \ -../kernel/kvi_internalcmd.cpp \ -../kernel/kvi_ipc.cpp \ -../kernel/kvi_ircdatastreammonitor.cpp \ -../kernel/kvi_ircconnection.cpp \ -../kernel/kvi_ircconnectionantictcpflooddata.cpp \ -../kernel/kvi_ircconnectionasyncwhoisdata.cpp \ -../kernel/kvi_ircconnectionnetsplitdetectordata.cpp \ -../kernel/kvi_ircconnectiontarget.cpp \ -../kernel/kvi_ircconnectiontargetresolver.cpp \ -../kernel/kvi_ircconnectionserverinfo.cpp \ -../kernel/kvi_ircconnectionstatedata.cpp \ -../kernel/kvi_ircconnectionstatistics.cpp \ -../kernel/kvi_ircconnectionuserinfo.cpp \ -../kernel/kvi_irccontext.cpp \ -../kernel/kvi_irclink.cpp \ -../kernel/kvi_ircsocket.cpp \ -../kernel/kvi_ircurl.cpp \ -../kernel/kvi_main.cpp \ -../kernel/kvi_lagmeter.cpp \ -../kernel/kvi_notifylist.cpp \ -../kernel/kvi_options.cpp \ -../kernel/kvi_sslmaster.cpp \ -../kernel/kvi_texticonmanager.cpp \ -../kernel/kvi_theme.cpp \ -../kernel/kvi_useraction.cpp \ -../kernel/kvi_userinput.cpp \ -../kvs/kvi_kvs.cpp \ -../kvs/kvi_kvs_action.cpp \ -../kvs/kvi_kvs_aliasmanager.cpp \ -../kvs/kvi_kvs_array.cpp \ -../kvs/kvi_kvs_arraycast.cpp \ -../kvs/kvi_kvs_asyncdnsoperation.cpp \ -../kvs/kvi_kvs_asyncoperation.cpp \ -../kvs/kvi_kvs_callbackobject.cpp \ -../kvs/kvi_kvs_corecallbackcommands.cpp \ -../kvs/kvi_kvs_corefunctions.cpp \ -../kvs/kvi_kvs_corefunctions_af.cpp \ -../kvs/kvi_kvs_corefunctions_gl.cpp \ -../kvs/kvi_kvs_corefunctions_mr.cpp \ -../kvs/kvi_kvs_corefunctions_sz.cpp \ -../kvs/kvi_kvs_coresimplecommands.cpp \ -../kvs/kvi_kvs_coresimplecommands_af.cpp \ -../kvs/kvi_kvs_coresimplecommands_gl.cpp \ -../kvs/kvi_kvs_coresimplecommands_mr.cpp \ -../kvs/kvi_kvs_coresimplecommands_sz.cpp \ -../kvs/kvi_kvs_dnsmanager.cpp \ -../kvs/kvi_kvs_event.cpp \ -../kvs/kvi_kvs_eventhandler.cpp \ -../kvs/kvi_kvs_eventmanager.cpp \ -../kvs/kvi_kvs_eventtable.cpp \ -../kvs/kvi_kvs_hash.cpp \ -../kvs/kvi_kvs_kernel.cpp \ -../kvs/kvi_kvs_moduleinterface.cpp \ -../kvs/kvi_kvs_object.cpp \ -../kvs/kvi_kvs_object_class.cpp \ -../kvs/kvi_kvs_object_controller.cpp \ -../kvs/kvi_kvs_object_functioncall.cpp \ -../kvs/kvi_kvs_object_functionhandler.cpp \ -../kvs/kvi_kvs_object_functionhandlerimpl.cpp \ -../kvs/kvi_kvs_parameterprocessor.cpp \ -../kvs/kvi_kvs_parser.cpp \ -../kvs/kvi_kvs_parser_command.cpp \ -../kvs/kvi_kvs_parser_comment.cpp \ -../kvs/kvi_kvs_parser_dollar.cpp \ -../kvs/kvi_kvs_parser_expression.cpp \ -../kvs/kvi_kvs_parser_lside.cpp \ -../kvs/kvi_kvs_parser_specialcommands.cpp \ -../kvs/kvi_kvs_popupmanager.cpp \ -../kvs/kvi_kvs_popupmenu.cpp \ -../kvs/kvi_kvs_processmanager.cpp \ -../kvs/kvi_kvs_report.cpp \ -../kvs/kvi_kvs_runtimecall.cpp \ -../kvs/kvi_kvs_runtimecontext.cpp \ -../kvs/kvi_kvs_rwevaluationresult.cpp \ -../kvs/kvi_kvs_script.cpp \ -../kvs/kvi_kvs_scriptaddonmanager.cpp \ -../kvs/kvi_kvs_switchlist.cpp \ -../kvs/kvi_kvs_timermanager.cpp \ -../kvs/kvi_kvs_treenode_aliasfunctioncall.cpp \ -../kvs/kvi_kvs_treenode_aliassimplecommand.cpp \ -../kvs/kvi_kvs_treenode_arraycount.cpp \ -../kvs/kvi_kvs_treenode_arrayelement.cpp \ -../kvs/kvi_kvs_treenode_arrayorhashelement.cpp \ -../kvs/kvi_kvs_treenode_arrayreferenceassert.cpp \ -../kvs/kvi_kvs_treenode_base.cpp \ -../kvs/kvi_kvs_treenode_baseobjectfunctioncall.cpp \ -../kvs/kvi_kvs_treenode_callbackcommand.cpp \ -../kvs/kvi_kvs_treenode_command.cpp \ -../kvs/kvi_kvs_treenode_commandevaluation.cpp \ -../kvs/kvi_kvs_treenode_commandwithparameters.cpp \ -../kvs/kvi_kvs_treenode_compositedata.cpp \ -../kvs/kvi_kvs_treenode_constantdata.cpp \ -../kvs/kvi_kvs_treenode_corecallbackcommand.cpp \ -../kvs/kvi_kvs_treenode_corefunctioncall.cpp \ -../kvs/kvi_kvs_treenode_coresimplecommand.cpp \ -../kvs/kvi_kvs_treenode_data.cpp \ -../kvs/kvi_kvs_treenode_datalist.cpp \ -../kvs/kvi_kvs_treenode_expression.cpp \ -../kvs/kvi_kvs_treenode_expressionreturn.cpp \ -../kvs/kvi_kvs_treenode_extendedscopevariable.cpp \ -../kvs/kvi_kvs_treenode_functioncall.cpp \ -../kvs/kvi_kvs_treenode_globalvariable.cpp \ -../kvs/kvi_kvs_treenode_hashcount.cpp \ -../kvs/kvi_kvs_treenode_hashelement.cpp \ -../kvs/kvi_kvs_treenode_hashreferenceassert.cpp \ -../kvs/kvi_kvs_treenode_indirectdata.cpp \ -../kvs/kvi_kvs_treenode_instruction.cpp \ -../kvs/kvi_kvs_treenode_instructionblock.cpp \ -../kvs/kvi_kvs_treenode_localvariable.cpp \ -../kvs/kvi_kvs_treenode_modulecallbackcommand.cpp \ -../kvs/kvi_kvs_treenode_modulefunctioncall.cpp \ -../kvs/kvi_kvs_treenode_modulesimplecommand.cpp \ -../kvs/kvi_kvs_treenode_multipleparameteridentifier.cpp \ -../kvs/kvi_kvs_treenode_objectfield.cpp \ -../kvs/kvi_kvs_treenode_objectfunctioncall.cpp \ -../kvs/kvi_kvs_treenode_operation.cpp \ -../kvs/kvi_kvs_treenode_parameterreturn.cpp \ -../kvs/kvi_kvs_treenode_rebindingswitch.cpp \ -../kvs/kvi_kvs_treenode_scopeoperator.cpp \ -../kvs/kvi_kvs_treenode_simplecommand.cpp \ -../kvs/kvi_kvs_treenode_singleparameteridentifier.cpp \ -../kvs/kvi_kvs_treenode_specialcommand.cpp \ -../kvs/kvi_kvs_treenode_specialcommandbreak.cpp \ -../kvs/kvi_kvs_treenode_specialcommandclass.cpp \ -../kvs/kvi_kvs_treenode_specialcommanddefpopup.cpp \ -../kvs/kvi_kvs_treenode_specialcommanddo.cpp \ -../kvs/kvi_kvs_treenode_specialcommandfor.cpp \ -../kvs/kvi_kvs_treenode_specialcommandforeach.cpp \ -../kvs/kvi_kvs_treenode_specialcommandif.cpp \ -../kvs/kvi_kvs_treenode_specialcommandswitch.cpp \ -../kvs/kvi_kvs_treenode_specialcommandunset.cpp \ -../kvs/kvi_kvs_treenode_specialcommandwhile.cpp \ -../kvs/kvi_kvs_treenode_stringcast.cpp \ -../kvs/kvi_kvs_treenode_switchlist.cpp \ -../kvs/kvi_kvs_treenode_thisobjectfunctioncall.cpp \ -../kvs/kvi_kvs_treenode_variable.cpp \ -../kvs/kvi_kvs_useraction.cpp \ -../kvs/kvi_kvs_variant.cpp \ -../kvs/kvi_kvs_variantlist.cpp \ -../kvs/kvi_kvs_treenode_voidfunctioncall.cpp \ -../module/kvi_mexlinkfilter.cpp \ -../module/kvi_mexserverimport.cpp ../module/kvi_mextoolbar.cpp \ -../module/kvi_module.cpp ../module/kvi_moduleextension.cpp ../module/kvi_modulemanager.cpp \ -../sparser/kvi_antispam.cpp ../sparser/kvi_ircmessage.cpp ../sparser/kvi_sparser.cpp \ -../sparser/kvi_sp_ctcp.cpp ../sparser/kvi_sp_literal.cpp ../sparser/kvi_sp_numeric.cpp \ -../sparser/kvi_sp_tables.cpp \ -../ui/kvi_actiondrawer.cpp \ -../ui/kvi_channel.cpp \ -../ui/kvi_colorwin.cpp \ -../ui/kvi_console.cpp \ -../ui/kvi_cryptcontroller.cpp \ -../ui/kvi_ctcppagedialog.cpp \ -../ui/kvi_customtoolbar.cpp \ -../ui/kvi_debugwindow.cpp \ -../ui/kvi_dynamictooltip.cpp \ -../ui/kvi_filedialog.cpp \ -../ui/kvi_frame.cpp \ -../ui/kvi_historywin.cpp \ -../ui/kvi_htmldialog.cpp \ -../ui/kvi_imagedialog.cpp \ -../ui/kvi_input.cpp \ -../ui/kvi_ipeditor.cpp \ -../ui/kvi_irctoolbar.cpp \ -../ui/kvi_ircview.cpp \ -../ui/kvi_ircviewtools.cpp \ -../ui/kvi_listview.cpp \ -../ui/kvi_maskeditor.cpp \ -../ui/kvi_mdicaption.cpp \ -../ui/kvi_mdichild.cpp \ -../ui/kvi_mdimanager.cpp \ -../ui/kvi_menubar.cpp \ -../ui/kvi_modeeditor.cpp \ -../ui/kvi_modew.cpp \ -../ui/kvi_msgbox.cpp \ -../ui/kvi_optionswidget.cpp \ -../ui/kvi_query.cpp \ -../ui/kvi_scriptbutton.cpp\ -../ui/kvi_scripteditor.cpp \ -../ui/kvi_selectors.cpp \ -../ui/kvi_splash.cpp \ -../ui/kvi_statusbar.cpp \ -../ui/kvi_statusbarapplet.cpp \ -../ui/kvi_taskbar.cpp \ -../ui/kvi_texticonwin.cpp \ -../ui/kvi_themedlabel.cpp \ -../ui/kvi_toolbar.cpp \ -../ui/kvi_toolwindows_container.cpp \ -../ui/kvi_topicw.cpp \ -../ui/kvi_styled_controls.cpp \ -../ui/kvi_userlistview.cpp \ -../ui/kvi_window.cpp - -# -# Command useful to find out all the headers -# rm -f ../include/*.h -# SRC=`find ../ -name *.h | sort` -# echo $SRC -# - - -headers_HEADERS = ../kernel/kvi_action.h \ -../kernel/kvi_actionmanager.h \ -../kernel/kvi_app.h \ -../kernel/kvi_asynchronousconnectiondata.h \ -../kernel/kvi_coreactions.h \ -../kernel/kvi_coreactionnames.h \ -../kernel/kvi_customtoolbardescriptor.h \ -../kernel/kvi_customtoolbarmanager.h \ -../kernel/kvi_filetransfer.h \ -../kernel/kvi_iconmanager.h \ -../kernel/kvi_internalcmd.h \ -../kernel/kvi_ipc.h \ -../kernel/kvi_ircdatastreammonitor.h \ -../kernel/kvi_ircconnection.h \ -../kernel/kvi_ircconnectionantictcpflooddata.h \ -../kernel/kvi_ircconnectionasyncwhoisdata.h \ -../kernel/kvi_ircconnectionnetsplitdetectordata.h \ -../kernel/kvi_ircconnectiontarget.h \ -../kernel/kvi_ircconnectiontargetresolver.h \ -../kernel/kvi_ircconnectionserverinfo.h \ -../kernel/kvi_ircconnectionstatedata.h \ -../kernel/kvi_ircconnectionstatistics.h \ -../kernel/kvi_ircconnectionuserinfo.h \ -../kernel/kvi_irccontext.h \ -../kernel/kvi_irclink.h \ -../kernel/kvi_ircsocket.h \ -../kernel/kvi_ircurl.h \ -../kernel/kvi_lagmeter.h \ -../kernel/kvi_notifylist.h \ -../kernel/kvi_options.h \ -../kernel/kvi_out.h \ -../kernel/kvi_sslmaster.h \ -../kernel/kvi_texticonmanager.h \ -../kernel/kvi_theme.h \ -../sparser/kvi_antispam.h \ -../sparser/kvi_ircmessage.h \ -../kernel/kvi_useraction.h \ -../kernel/kvi_userinput.h \ -../kvs/kvi_kvs.h \ -../kvs/kvi_kvs_action.h \ -../kvs/kvi_kvs_aliasmanager.h \ -../kvs/kvi_kvs_array.h \ -../kvs/kvi_kvs_arraycast.h \ -../kvs/kvi_kvs_asyncdnsoperation.h \ -../kvs/kvi_kvs_asyncoperation.h \ -../kvs/kvi_kvs_callbackobject.h \ -../kvs/kvi_kvs_corecallbackcommands.h \ -../kvs/kvi_kvs_corefunctions.h \ -../kvs/kvi_kvs_coresimplecommands.h \ -../kvs/kvi_kvs_dnsmanager.h \ -../kvs/kvi_kvs_event.h \ -../kvs/kvi_kvs_eventhandler.h \ -../kvs/kvi_kvs_eventmanager.h \ -../kvs/kvi_kvs_eventtriggers.h \ -../kvs/kvi_kvs_eventtable.h \ -../kvs/kvi_kvs_hash.h \ -../kvs/kvi_kvs_kernel.h \ -../kvs/kvi_kvs_moduleinterface.h \ -../kvs/kvi_kvs_object.h \ -../kvs/kvi_kvs_object_class.h \ -../kvs/kvi_kvs_object_controller.h \ -../kvs/kvi_kvs_object_functioncall.h \ -../kvs/kvi_kvs_object_functionhandler.h \ -../kvs/kvi_kvs_object_functionhandlerimpl.h \ -../kvs/kvi_kvs_parameterprocessor.h \ -../kvs/kvi_kvs_parser.h \ -../kvs/kvi_kvs_parser_macros.h \ -../kvs/kvi_kvs_popupmanager.h \ -../kvs/kvi_kvs_popupmenu.h \ -../kvs/kvi_kvs_processmanager.h \ -../kvs/kvi_kvs_report.h \ -../kvs/kvi_kvs_runtimecall.h \ -../kvs/kvi_kvs_runtimecontext.h \ -../kvs/kvi_kvs_rwevaluationresult.h \ -../kvs/kvi_kvs_script.h \ -../kvs/kvi_kvs_scriptaddonmanager.h \ -../kvs/kvi_kvs_switchlist.h \ -../kvs/kvi_kvs_timermanager.h \ -../kvs/kvi_kvs_treenode.h \ -../kvs/kvi_kvs_treenode_aliasfunctioncall.h \ -../kvs/kvi_kvs_treenode_aliassimplecommand.h \ -../kvs/kvi_kvs_treenode_arraycount.h \ -../kvs/kvi_kvs_treenode_arrayelement.h \ -../kvs/kvi_kvs_treenode_arrayorhashelement.h \ -../kvs/kvi_kvs_treenode_arrayreferenceassert.h \ -../kvs/kvi_kvs_treenode_base.h \ -../kvs/kvi_kvs_treenode_baseobjectfunctioncall.h \ -../kvs/kvi_kvs_treenode_callbackcommand.h \ -../kvs/kvi_kvs_treenode_command.h \ -../kvs/kvi_kvs_treenode_commandevaluation.h \ -../kvs/kvi_kvs_treenode_commandwithparameters.h \ -../kvs/kvi_kvs_treenode_compositedata.h \ -../kvs/kvi_kvs_treenode_constantdata.h \ -../kvs/kvi_kvs_treenode_corecallbackcommand.h \ -../kvs/kvi_kvs_treenode_corefunctioncall.h \ -../kvs/kvi_kvs_treenode_coresimplecommand.h \ -../kvs/kvi_kvs_treenode_data.h \ -../kvs/kvi_kvs_treenode_datalist.h \ -../kvs/kvi_kvs_treenode_expression.h \ -../kvs/kvi_kvs_treenode_expressionreturn.h \ -../kvs/kvi_kvs_treenode_extendedscopevariable.h \ -../kvs/kvi_kvs_treenode_functioncall.h \ -../kvs/kvi_kvs_treenode_globalvariable.h \ -../kvs/kvi_kvs_treenode_hashcount.h \ -../kvs/kvi_kvs_treenode_hashelement.h \ -../kvs/kvi_kvs_treenode_hashreferenceassert.h \ -../kvs/kvi_kvs_treenode_indirectdata.h \ -../kvs/kvi_kvs_treenode_instruction.h \ -../kvs/kvi_kvs_treenode_instructionblock.h \ -../kvs/kvi_kvs_treenode_localvariable.h \ -../kvs/kvi_kvs_treenode_modulecallbackcommand.h \ -../kvs/kvi_kvs_treenode_modulefunctioncall.h \ -../kvs/kvi_kvs_treenode_modulesimplecommand.h \ -../kvs/kvi_kvs_treenode_multipleparameteridentifier.h \ -../kvs/kvi_kvs_treenode_objectfield.h \ -../kvs/kvi_kvs_treenode_objectfunctioncall.h \ -../kvs/kvi_kvs_treenode_operation.h \ -../kvs/kvi_kvs_treenode_parameterreturn.h \ -../kvs/kvi_kvs_treenode_rebindingswitch.h \ -../kvs/kvi_kvs_treenode_scopeoperator.h \ -../kvs/kvi_kvs_treenode_simplecommand.h \ -../kvs/kvi_kvs_treenode_singleparameteridentifier.h \ -../kvs/kvi_kvs_treenode_specialcommand.h \ -../kvs/kvi_kvs_treenode_specialcommandbreak.h \ -../kvs/kvi_kvs_treenode_specialcommandclass.h \ -../kvs/kvi_kvs_treenode_specialcommanddefpopup.h \ -../kvs/kvi_kvs_treenode_specialcommanddo.h \ -../kvs/kvi_kvs_treenode_specialcommandfor.h \ -../kvs/kvi_kvs_treenode_specialcommandforeach.h \ -../kvs/kvi_kvs_treenode_specialcommandif.h \ -../kvs/kvi_kvs_treenode_specialcommandswitch.h \ -../kvs/kvi_kvs_treenode_specialcommandunset.h \ -../kvs/kvi_kvs_treenode_specialcommandwhile.h \ -../kvs/kvi_kvs_treenode_stringcast.h \ -../kvs/kvi_kvs_treenode_switchlist.h \ -../kvs/kvi_kvs_treenode_thisobjectfunctioncall.h \ -../kvs/kvi_kvs_treenode_variable.h \ -../kvs/kvi_kvs_treenode_voidfunctioncall.h \ -../kvs/kvi_kvs_types.h \ -../kvs/kvi_kvs_useraction.h \ -../kvs/kvi_kvs_variant.h \ -../kvs/kvi_kvs_variantlist.h \ -../module/kvi_mexlinkfilter.h ../module/kvi_mexserverimport.h ../module/kvi_mextoolbar.h \ -../module/kvi_module.h ../module/kvi_moduleextension.h ../module/kvi_modulemanager.h \ -../sparser/kvi_numeric.h \ -../sparser/kvi_sparser.h \ -../ui/kvi_actiondrawer.h \ -../ui/kvi_channel.h \ -../ui/kvi_colorwin.h \ -../ui/kvi_console.h \ -../ui/kvi_cryptcontroller.h \ -../ui/kvi_ctcppagedialog.h \ -../ui/kvi_customtoolbar.h \ -../ui/kvi_debugwindow.h \ -../ui/kvi_dynamictooltip.h \ -../ui/kvi_filedialog.h \ -../ui/kvi_frame.h \ -../ui/kvi_historywin.h \ -../ui/kvi_htmldialog.h \ -../ui/kvi_imagedialog.h \ -../ui/kvi_input.h \ -../ui/kvi_ipeditor.h \ -../ui/kvi_irctoolbar.h \ -../ui/kvi_ircview.h \ -../ui/kvi_ircviewprivate.h \ -../ui/kvi_ircviewtools.h \ -../ui/kvi_listview.h \ -../ui/kvi_maskeditor.h \ -../ui/kvi_mdicaption.h \ -../ui/kvi_mdichild.h \ -../ui/kvi_mdimanager.h \ -../ui/kvi_menubar.h \ -../ui/kvi_modeeditor.h \ -../ui/kvi_msgbox.h \ -../ui/kvi_optionswidget.h \ -../ui/kvi_query.h \ -../ui/kvi_scriptbutton.h \ -../ui/kvi_scripteditor.h \ -../ui/kvi_selectors.h \ -../ui/kvi_splash.h \ -../ui/kvi_statusbar.h \ -../ui/kvi_statusbarapplet.h \ -../ui/kvi_taskbar.h ../ui/kvi_texticonwin.h ../ui/kvi_themedlabel.h \ -../ui/kvi_toolbar.h ../ui/kvi_topicw.h ../ui/kvi_userlistview.h \ -../ui/kvi_window.h \ -../ui/kvi_modew.h \ -../ui/kvi_styled_controls.h \ -../ui/kvi_toolwindows_container.h - -%.moc: %.h - $(SS_QT_MOC) $(SS_QT_MOC_FLAGS) $< -o $@ - -# Command useful to find the moc dependancies -# DIRS="kernel sparser ui uparser" -# for dire in $DIRS; do grep "\.moc" ../$dire/*.cpp | sort | sed -e 's/[[:space:]]*#include//' | sed -e s/\\\"/..\\\/$dire\\\// | sed -e 's/\"//'; done - -../kernel/kvi_app.cpp: ../kernel/kvi_app.moc -../kernel/kvi_iconmanager.cpp: ../kernel/kvi_iconmanager.moc -../kernel/kvi_ipc.cpp: ../kernel/kvi_ipc.moc -../kernel/kvi_lagmeter.cpp: ../kernel/kvi_lagmeter.moc -../kernel/kvi_notifylist.cpp: ../kernel/kvi_notifylist.moc -../kernel/kvi_texticonmanager.cpp: ../kernel/kvi_texticonmanager.moc -../sparser/kvi_sparser.cpp: ../sparser/kvi_sparser.moc -../ui/kvi_channel.cpp: ../ui/kvi_channel.moc -../ui/kvi_colorwin.cpp: ../ui/kvi_colorwin.moc -../ui/kvi_console.cpp: ../ui/kvi_console.moc -../ui/kvi_cryptcontroller.cpp: ../ui/kvi_cryptcontroller.moc -../ui/kvi_ctcppagedialog.cpp: ../ui/kvi_ctcppagedialog.moc -../ui/kvi_dynamictooltip.cpp: ../ui/kvi_dynamictooltip.moc -../ui/kvi_filedialog.cpp: ../ui/kvi_filedialog.moc -../ui/kvi_frame.cpp: ../ui/kvi_frame.moc -../ui/kvi_historywin.cpp: ../ui/kvi_historywin.moc -../ui/kvi_input.cpp: ../ui/kvi_input.moc -../ui/kvi_ipeditor.cpp: ../ui/kvi_ipeditor.moc -../ui/kvi_irctoolbar.cpp: ../ui/kvi_irctoolbar.moc -../ui/kvi_ircview.cpp: ../ui/kvi_ircview.moc -../ui/kvi_maskeditor.cpp: ../ui/kvi_maskeditor.moc -../ui/kvi_menubar.cpp: ../ui/kvi_menubar.moc -../ui/kvi_modeeditor.cpp: ../ui/kvi_modeeditor.moc -../ui/kvi_optionswidget.cpp: ../ui/kvi_optionswidget.moc -../ui/kvi_query.cpp: ../ui/kvi_query.moc -../ui/kvi_scriptbutton.cpp: ../ui/kvi_scriptbutton.moc -../ui/kvi_scripteditor.cpp: ../ui/kvi_scripteditor.moc -../ui/kvi_selectors.cpp: ../ui/kvi_selectors.moc -../ui/kvi_splash.cpp: ../ui/kvi_splash.moc -../ui/kvi_taskbar.cpp: ../ui/kvi_taskbar.moc -../ui/kvi_texticonwin.cpp: ../ui/kvi_texticonwin.moc -../ui/kvi_themedlabel.cpp: ../ui/kvi_themedlabel.moc -../ui/kvi_toolbar.cpp: ../ui/kvi_toolbar.moc -../ui/kvi_topicw.cpp: ../ui/kvi_topicw.moc -../ui/kvi_modew.cpp: ../ui/kvi_modew.moc -../ui/kvi_styled_controls.cpp: ../ui/kvi_styled_controls.moc -../ui/kvi_userlistview.cpp: ../ui/kvi_userlistview.moc -../ui/kvi_window.cpp: ../ui/kvi_window.moc - - -../kvs/moc_%.cpp: ../kvs/%.h - $(SS_QT_MOC) $(SS_QT_MOC_FLAGS) $< -o $@ - -../kernel/moc_%.cpp: ../kernel/%.h - $(SS_QT_MOC) $(SS_QT_MOC_FLAGS) $< -o $@ - -../module/moc_%.cpp: ../module/%.h - $(SS_QT_MOC) $(SS_QT_MOC_FLAGS) $< -o $@ - -../ui/moc_%.cpp: ../ui/%.h - $(SS_QT_MOC) $(SS_QT_MOC_FLAGS) $< -o $@ - - -# -# All the cpp files depend on symlinks beging up-to-date -# - -../*/kvi_*.cpp: symlinks -../*/*/kvi_*.cpp: symlinks - -# -# Symlinks depend on all the header files: symlink is rebuilt whenewer an *.h file changes -# - -symlinks: ../kernel/*.h ../kvs/*.h ../module/*h ../sparser/*.h ../ui/*.h - cd ../include; for i in kvi_*.h; do if [ ! -f $$i ]; then rm -f $$i; fi; done; for i in $(SS_TOPSRCDIR)/src/kvirc/*/kvi_*.h; do $(LN_S) $$i . >/dev/null 2>&1; echo "Created link to $$i"; done - touch symlinks - -# -# When cleaning...remove also the symlinks -# - -CLEANFILES = ../include/*.h symlinks ../*/*.moc ../*/moc_kvi_*.cpp diff --git a/3.4.0/src/kvirc/include/.svnignore b/3.4.0/src/kvirc/include/.svnignore deleted file mode 100644 index 1d0a3268e2..0000000000 --- a/3.4.0/src/kvirc/include/.svnignore +++ /dev/null @@ -1,19 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -*.o -*.lo -*.la -*.so -*.lai -kvirc -symlinks -*.h diff --git a/3.4.0/src/kvirc/include/Makefile.am b/3.4.0/src/kvirc/include/Makefile.am deleted file mode 100644 index 6847f08585..0000000000 --- a/3.4.0/src/kvirc/include/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### diff --git a/3.4.0/src/kvirc/kernel/.svnignore b/3.4.0/src/kvirc/kernel/.svnignore deleted file mode 100644 index 74e3b9a7ca..0000000000 --- a/3.4.0/src/kvirc/kernel/.svnignore +++ /dev/null @@ -1,19 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -moc_kvi_*.cpp -*.o -*.lo -*.la -*.so -*.lai -kvirc -symlinks diff --git a/3.4.0/src/kvirc/kernel/Makefile.am b/3.4.0/src/kvirc/kernel/Makefile.am deleted file mode 100644 index c84487eb66..0000000000 --- a/3.4.0/src/kvirc/kernel/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -EXTRA_DIST = *.cpp *.h diff --git a/3.4.0/src/kvirc/kernel/kvi_action.cpp b/3.4.0/src/kvirc/kernel/kvi_action.cpp deleted file mode 100644 index 50c26280f3..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_action.cpp +++ /dev/null @@ -1,434 +0,0 @@ -//============================================================================= -// -// File : kvi_action.cpp -// Created on Sun 21 Nov 2004 03:36:34 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_action.h" -#include "kvi_customtoolbar.h" -#include "kvi_frame.h" -#include "kvi_irccontext.h" -#include "kvi_ircconnection.h" -#include "kvi_iconmanager.h" -#include "kvi_app.h" -#include "kvi_window.h" -#include "kvi_channel.h" -#include "kvi_console.h" -#include "kvi_query.h" -#include "kvi_styled_controls.h" - -#include <qtoolbutton.h> -#include "kvi_tal_popupmenu.h" - - -KviAction::~KviAction() -{ - if(m_pWidgetList) - { - for(QWidget * b = m_pWidgetList->first();b;b = m_pWidgetList->next()) - disconnect(b,SIGNAL(destroyed()),this,SLOT(widgetDestroyed())); - m_pWidgetList->setAutoDelete(true); - delete m_pWidgetList; - } -} - -const QString & KviAction::visibleName() -{ - return m_szVisibleName; -} - -const QString & KviAction::description() -{ - return m_szDescription; -} - -bool KviAction::isKviUserActionNeverOverrideThis() -{ - return false; -} - -void KviAction::registerAccelerator() -{ - if(!m_szKeySequence.isEmpty()) - m_iAccelId = g_pFrame->registerAccelerator(m_szKeySequence,this,SLOT(activate())); -} - -void KviAction::unregisterAccelerator() -{ - if(m_iAccelId != 0) - { - if(g_pFrame) - g_pFrame->unregisterAccelerator(m_iAccelId); - m_iAccelId = 0; - } -} - -void KviAction::setEnabled(bool bEnabled) -{ - if(bEnabled) - m_uInternalFlags |= KVI_ACTION_FLAG_ENABLED; - else - m_uInternalFlags &= ~KVI_ACTION_FLAG_ENABLED; - - if(m_pWidgetList) - { - if(bEnabled) - { - for(QWidget * t = m_pWidgetList->first();t;t = m_pWidgetList->next()) - if(!t->isEnabled())t->setEnabled(true); - } else { - for(QWidget * t = m_pWidgetList->first();t;t = m_pWidgetList->next()) - if(t->isEnabled())t->setEnabled(false); - } - } -} - -int KviAction::validateFlags(int iFlagsToValidate) -{ - if(iFlagsToValidate & EnableAtLogin) - iFlagsToValidate |= NeedsConnection; - if(iFlagsToValidate & NeedsConnection) - iFlagsToValidate |= NeedsContext; - if(iFlagsToValidate & WindowOnlyIfUsersSelected) - { - if(!(iFlagsToValidate & InternalWindowMask)) - iFlagsToValidate &= ~WindowOnlyIfUsersSelected; - } - return iFlagsToValidate; -} - -QPixmap * KviAction::smallIcon() -{ - if(m_iSmallIconId != 0)return g_pIconManager->getSmallIcon(m_iSmallIconId); - return 0; -} - -QPixmap * KviAction::bigIcon() -{ - return g_pIconManager->getBigIcon(m_szBigIcon); -} - -void KviAction::setup() -{ - connect(g_pApp,SIGNAL(reloadImages()),this,SLOT(reloadImages())); - if(m_uFlags & InternalWindowMask) - { - connect(g_pFrame,SIGNAL(activeWindowChanged()),this,SLOT(activeWindowChanged())); - if((m_uFlags & WindowOnlyIfUsersSelected) && (m_uFlags & (WindowChannel | WindowConsole | WindowQuery))) - connect(g_pFrame,SIGNAL(activeWindowSelectionStateChanged(bool)),this,SLOT(activeWindowSelectionStateChanged(bool))); - activeWindowChanged(); - } else { - if(m_uFlags & NeedsConnection) - { - connect(g_pFrame,SIGNAL(activeContextChanged()),this,SLOT(activeContextChanged())); - connect(g_pFrame,SIGNAL(activeContextStateChanged()),this,SLOT(activeContextStateChanged())); - KviIrcContext * c = g_pFrame->activeContext(); - if(!c)setEnabled(false); - else { - switch(c->state()) - { - case KviIrcContext::LoggingIn: - setEnabled(m_uFlags & EnableAtLogin); - break; - case KviIrcContext::Connected: - setEnabled(true); - break; - default: - setEnabled(false); - break; - } - } - } else { - if(m_uFlags & NeedsContext) - { - connect(g_pFrame,SIGNAL(activeContextChanged()),this,SLOT(activeContextChanged())); - if(!g_pFrame->activeContext())setEnabled(false); - else setEnabled(true); - } - } - } - - m_uInternalFlags |= KVI_ACTION_FLAG_SETUPDONE; -} - - -void KviAction::reloadImages() -{ - if(!m_pWidgetList)return; - QPixmap * p = bigIcon(); - for(QWidget * b = m_pWidgetList->first();b;b = m_pWidgetList->next()) - { - if(b->inherits("QToolButton")) - ((QToolButton *)b)->setIconSet(p ? *p : QPixmap()); - } -} - -void KviAction::activeWindowChanged() -{ - if(m_uFlags & NeedsContext) - { - if(!g_pFrame->activeContext()) - { - if(isEnabled())setEnabled(false); - return; - } - } - - if(m_uFlags & NeedsConnection) - { - switch(g_pFrame->activeContext()->state()) - { - case KviIrcContext::LoggingIn: - if(!(m_uFlags & EnableAtLogin)) - { - if(isEnabled())setEnabled(false); - return; - } - break; - case KviIrcContext::Connected: - // this is ok - break; - default: - if(isEnabled())setEnabled(false); - return; - break; - } - } - - if(!g_pActiveWindow) - { - if(isEnabled())setEnabled(false); - return; - } - - switch(g_pActiveWindow->type()) - { - case KVI_WINDOW_TYPE_CONSOLE: - if(m_uFlags & WindowConsole) - { - if(m_uFlags & WindowOnlyIfUsersSelected) - { - bool bEnabled = ((KviConsole *)g_pActiveWindow)->selectedCount() > 0; - if(bEnabled != isEnabled())setEnabled(bEnabled); - } else { - if(!isEnabled())setEnabled(true); - } - } else { - if(isEnabled())setEnabled(false); - } - break; - case KVI_WINDOW_TYPE_CHANNEL: - if(m_uFlags & WindowChannel) - { - if(m_uFlags & WindowOnlyIfUsersSelected) - { - bool bEnabled = ((KviChannel *)g_pActiveWindow)->selectedCount() > 0; - if(bEnabled != isEnabled())setEnabled(bEnabled); - } else { - if(!isEnabled())setEnabled(true); - } - } else { - if(isEnabled())setEnabled(false); - } - break; - case KVI_WINDOW_TYPE_QUERY: - if(m_uFlags & WindowQuery) - { - if(m_uFlags & WindowOnlyIfUsersSelected) - { - bool bEnabled = ((KviQuery *)g_pActiveWindow)->selectedCount() > 0; - if(bEnabled != isEnabled())setEnabled(bEnabled); - } else { - if(!isEnabled())setEnabled(true); - } - } else { - if(isEnabled())setEnabled(false); - } - break; - case KVI_WINDOW_TYPE_DCCCHAT: - if(m_uFlags & WindowDccChat) - { - if(!isEnabled())setEnabled(true); - } else { - if(isEnabled())setEnabled(false); - } - break; - default: - if(m_uFlags & InternalWindowMask) - if(isEnabled())setEnabled(false); - else - if(!isEnabled())setEnabled(true); - break; - } -} - - -void KviAction::activeWindowSelectionStateChanged(bool bSelectedNow) -{ - // we jump here ONLY if m_uFlags & WindowOnlyIfUsersSelected - // and thus also m_uFlags & InternalWindowMask - switch(g_pActiveWindow->type()) - { - case KVI_WINDOW_TYPE_CONSOLE: - if(m_uFlags & WindowConsole) - { - if(bSelectedNow != isEnabled())setEnabled(bSelectedNow); - } else { - if(isEnabled())setEnabled(false); - } - break; - case KVI_WINDOW_TYPE_CHANNEL: - if(m_uFlags & WindowChannel) - { - if(bSelectedNow != isEnabled())setEnabled(bSelectedNow); - } else { - if(isEnabled())setEnabled(false); - } - break; - case KVI_WINDOW_TYPE_QUERY: - if(m_uFlags & WindowQuery) - { - if(bSelectedNow != isEnabled())setEnabled(bSelectedNow); - } else { - if(isEnabled())setEnabled(false); - } - break; - case KVI_WINDOW_TYPE_DCCCHAT: - if(m_uFlags & WindowDccChat) - { - if(!isEnabled())setEnabled(true); - } else { - if(isEnabled())setEnabled(false); - } - break; - default: - if(isEnabled())setEnabled(false); - break; - } -} - - -void KviAction::activeContextChanged() -{ - // works only if NeedsContext is specified! - KviIrcContext * c = g_pFrame->activeContext(); - if(c) - { - if(m_uFlags & NeedsConnection) - activeContextStateChanged(); - else - if(!isEnabled())setEnabled(true); - } else { - if(isEnabled())setEnabled(false); - } -} - -void KviAction::activeContextStateChanged() -{ - KviIrcContext * c = g_pFrame->activeContext(); - if(c) - { - switch(c->state()) - { - case KviIrcContext::Idle: - case KviIrcContext::Connecting: - if(isEnabled())setEnabled(false); - break; - case KviIrcContext::LoggingIn: - if(m_uFlags & EnableAtLogin) - { - if(!isEnabled())setEnabled(true); - } else { - if(isEnabled())setEnabled(false); - } - break; - case KviIrcContext::Connected: - if(!isEnabled())setEnabled(true); - break; - default: - if(isEnabled())setEnabled(false); - break; - } - } else { - if(isEnabled())setEnabled(false); - } -} - -bool KviAction::addToPopupMenu(KviTalPopupMenu *pMenu) -{ - if(!setupDone())setup(); - QPixmap * p = smallIcon(); - int id; - QString t = visibleName(); - if(!m_szKeySequence.isEmpty())t += '\t' + m_szKeySequence; - if(p) - { - id = pMenu->insertItem(*p,t,this,SLOT(activate())); - } else { - id = pMenu->insertItem(t,this,SLOT(activate())); - } - if(!isEnabled())pMenu->setItemEnabled(id,false); - return true; -} - -void KviAction::widgetDestroyed() -{ - if(!m_pWidgetList)return; - QWidget * b = (QWidget *)sender(); - m_pWidgetList->removeRef(b); -} - -void KviAction::registerWidget(QWidget * b) -{ - connect(b,SIGNAL(destroyed()),this,SLOT(widgetDestroyed())); - if(!m_pWidgetList) - { - m_pWidgetList = new KviPointerList<QWidget>; - m_pWidgetList->setAutoDelete(false); - } - m_pWidgetList->append(b); -} - -QWidget * KviAction::addToCustomToolBar(KviCustomToolBar *pParentToolBar) -{ - if(!setupDone())setup(); - QPixmap * p = bigIcon(); - QToolButton * b = new KviStyledToolButton( - p ? *p : QPixmap(), - visibleName(), - visibleName(), - this,SLOT(activate()),pParentToolBar,m_szName); -#ifdef COMPILE_USE_QT4 - pParentToolBar->addWidget(b); -#endif - if(!isEnabled())b->setEnabled(false); - registerWidget(b); - return b; -} - -void KviAction::activate() -{ - if(isEnabled()) - emit activated(); -} - diff --git a/3.4.0/src/kvirc/kernel/kvi_action.h b/3.4.0/src/kvirc/kernel/kvi_action.h deleted file mode 100644 index 609d434a15..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_action.h +++ /dev/null @@ -1,157 +0,0 @@ -#ifndef _KVI_ACTION_H_ -#define _KVI_ACTION_H_ -//============================================================================= -// -// File : kvi_action.h -// Created on Sun 21 Nov 2004 03:36:34 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_pointerlist.h" - -#include <qobject.h> -#include <qstring.h> - -// The action name is INTERNAL: it should be never shown to the user -// if it contains a dot then the part before the dot is considered to -// be a module name to be loaded when the - -// Known categories are: general (or empty), irc, script -// - -class KviTalPopupMenu; -class QWidget; -class KviCustomToolBar; -class QPixmap; -class KviKvsScript; - -class KVIRC_API KviActionCategory -{ -protected: - QString m_szName; - QString m_szVisibleName; - QString m_szDescription; -public: - KviActionCategory(const QString &szName,const QString &szVisibleName,const QString &szDescription) - : m_szName(szName), m_szVisibleName(szVisibleName), m_szDescription(szDescription) {}; - ~KviActionCategory(){}; -public: - const QString & name(){ return m_szName; }; - const QString & visibleName(){ return m_szVisibleName; }; - const QString & description(){ return m_szDescription; }; -}; - -// these flags are INTERNAL -#define KVI_ACTION_FLAG_ENABLED 1 -#define KVI_ACTION_FLAG_SETUPDONE 2 - -class KVIRC_API KviAction : public QObject -{ - friend class KviActionManager; - Q_OBJECT -protected: - QString m_szName; // the internal name of the action, must be in form [module.]name - QString m_szVisibleName; - QString m_szDescription; - KviActionCategory * m_pCategory; // may be 0, not owned! - QString m_szBigIcon; - int m_iSmallIconId; - KviPointerList<QWidget> * m_pWidgetList; - unsigned short int m_uInternalFlags; - unsigned int m_uFlags; - QString m_szKeySequence; - int m_iAccelId; -public: - enum Flags { - NeedsContext = 1, - NeedsConnection = 2, // implies NeedsContext - WindowConsole = 4, - WindowChannel = 8, - WindowQuery = 16, - WindowDccChat = 32, - InternalWindowMask = WindowConsole | WindowChannel | WindowQuery | WindowDccChat, - EnableAtLogin = 64, // implies NeedsConnection - WindowOnlyIfUsersSelected = 128 // implies at least one of WindowConsole | WindowChannel | WindowQuery - }; -public: - KviAction(QObject * pParent, // can be 0, but using a QObject will help in deleting this action :) - const QString &szName, // internal name of this action, in form [module.]name - const QString &szVisibleName, // permanent visible name, visible at least in the action drawer - const QString &szDescription, // what this action does ? - KviActionCategory * pCategory = 0, // one of KviActionManager::category*() or 0 (default category) - const QString &szBigIcon = QString::null, - int iSmallIconId = 0, - unsigned int uFlags = 0, - const QString &szKeySequence = QString::null) - : QObject(pParent), - m_szName(szName), - m_szVisibleName(szVisibleName), - m_szDescription(szDescription), - m_pCategory(pCategory), - m_szBigIcon(szBigIcon), - m_iSmallIconId(iSmallIconId), - m_pWidgetList(0), - m_uInternalFlags(KVI_ACTION_FLAG_ENABLED), - m_uFlags(uFlags), - m_szKeySequence(szKeySequence), - m_iAccelId(0) {} - virtual ~KviAction(); -public: - static int validateFlags(int iFlagsToValidate); - const QString & name() const { return m_szName; }; - virtual const QString & visibleName(); - virtual const QString & description(); - const QString & keySequence() const { return m_szKeySequence; }; - const QString & bigIconString() const { return m_szBigIcon; }; - KviActionCategory * category() const { return m_pCategory; }; - bool isEnabled() const { return (m_uInternalFlags & KVI_ACTION_FLAG_ENABLED); }; - unsigned int flags(){ return m_uFlags; }; - virtual bool isKviUserActionNeverOverrideThis(); - virtual void setEnabled(bool bEnabled); - virtual QPixmap * smallIcon(); - virtual QPixmap * bigIcon(); - virtual bool addToPopupMenu(KviTalPopupMenu *pMenu); - virtual QWidget * addToCustomToolBar(KviCustomToolBar *pParentToolBar); - void suicide() { delete this; }; -protected: - // called once before the FIRST button or menu item is created - bool setupDone() const { return (m_uInternalFlags & KVI_ACTION_FLAG_SETUPDONE); }; - virtual void setup(); - KviPointerList<QWidget> * widgetList(){ return m_pWidgetList; }; - void registerAccelerator(); - void unregisterAccelerator(); - void registerWidget(QWidget * b); -protected slots: - virtual void widgetDestroyed(); - virtual void reloadImages(); - virtual void activeContextChanged(); - virtual void activeContextStateChanged(); - virtual void activeWindowChanged(); - virtual void activeWindowSelectionStateChanged(bool bSelectedNow); -public slots: - virtual void activate(); -signals: - void activated(); -}; - - - -#endif //!_KVI_ACTION_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_actionmanager.cpp b/3.4.0/src/kvirc/kernel/kvi_actionmanager.cpp deleted file mode 100644 index 0a3dc7e127..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_actionmanager.cpp +++ /dev/null @@ -1,321 +0,0 @@ -//============================================================================= -// -// File : kvi_actionmanager.cpp -// Created on Sun 21 Nov 2004 03:37:57 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_actionmanager.h" -#include "kvi_modulemanager.h" -#include "kvi_coreactions.h" -#include "kvi_customtoolbar.h" -#include "kvi_customtoolbarmanager.h" -#include "kvi_app.h" -#include "kvi_locale.h" -#include "kvi_kvs_useraction.h" -#include "kvi_config.h" -#include "kvi_qstring.h" -#include "kvi_frame.h" - -KviActionManager * KviActionManager::m_pInstance = 0; -KviActionCategory * KviActionManager::m_pCategoryIrc = 0; -KviActionCategory * KviActionManager::m_pCategoryGeneric = 0; -KviActionCategory * KviActionManager::m_pCategorySettings = 0; -KviActionCategory * KviActionManager::m_pCategoryScripting = 0; -KviActionCategory * KviActionManager::m_pCategoryGUI = 0; -KviActionCategory * KviActionManager::m_pCategoryChannel = 0; -KviActionCategory * KviActionManager::m_pCategoryTools = 0; -bool KviActionManager::m_bCustomizingToolBars = false; -KviCustomToolBar * KviActionManager::m_pCurrentToolBar = 0; -// kvi_coreactions.cpp -extern void register_core_actions(KviActionManager *); - -KviActionManager::KviActionManager() -: QObject() -{ - m_pActions = new KviPointerHashTable<QString,KviAction>(101); - m_pActions->setAutoDelete(false); - - m_pCategories = new KviPointerHashTable<QString,KviActionCategory>(17,false); - m_pCategories->setAutoDelete(true); - -#define CATEGORY(__var,__name,__vname,__descr) \ - __var = new KviActionCategory(__name,__vname,__descr); \ - m_pCategories->replace(__name,__var) - - CATEGORY(m_pCategoryIrc,"irc",__tr2qs("IRC"),__tr2qs("IRC Context related actions")); - CATEGORY(m_pCategoryGeneric,"generic",__tr2qs("Generic"),__tr2qs("Generic actions")); - CATEGORY(m_pCategorySettings,"settings",__tr2qs("Settings"),__tr2qs("Actions related to settings")); - CATEGORY(m_pCategoryScripting,"scripting",__tr2qs("Scripting"),__tr2qs("Scripting related actions")); - CATEGORY(m_pCategoryGUI,"gui",__tr2qs("GUI"),__tr2qs("Actions related to the Graphic User Interface")); - CATEGORY(m_pCategoryChannel,"channel",__tr2qs("Channel"),__tr2qs("IRC Channel related actions")); - CATEGORY(m_pCategoryTools,"tools",__tr2qs("Tools"),__tr2qs("Actions that will appear in the \"Tools\" menu")); - - m_bCustomizingToolBars = false; - m_pCurrentToolBar = 0; - m_bCoreActionsRegistered = false; -} - -KviActionManager::~KviActionManager() -{ - // the customizeToolBars dialog has been already - // destroyed since the module manager has already - // killed all the modules at this point... - //KviActionDialog::cleanup(); - - KviPointerHashTableIterator<QString,KviAction> it(*m_pActions); - while(KviAction * a = it.current()) - { - disconnect(a,SIGNAL(destroyed()),this,SLOT(actionDestroyed())); - ++it; - } - delete m_pActions; - - delete m_pCategories; -} - -void KviActionManager::load(const QString &szFileName) -{ - KviConfig cfg(szFileName,KviConfig::Read); - - KviConfigIterator it(*(cfg.dict())); - while(it.current()) - { - cfg.setGroup(it.currentKey()); - KviKvsUserAction * a = new KviKvsUserAction(this); - if(a->load(&cfg))registerAction(a); - else delete a; - ++it; - } -} - -void KviActionManager::save(const QString &szFileName) -{ - KviConfig cfg(szFileName,KviConfig::Write); - cfg.clear(); - - KviPointerHashTableIterator<QString,KviAction> it(*m_pActions); - while(KviAction * a = it.current()) - { - if(a->isKviUserActionNeverOverrideThis()) - { - cfg.setGroup(a->name()); - ((KviKvsUserAction *)a)->save(&cfg); - } - ++it; - } -} - -void KviActionManager::killAllKvsUserActions() -{ - KviPointerList<KviKvsUserAction> dying; - dying.setAutoDelete(true); - - KviPointerHashTableIterator<QString,KviAction> it(*m_pActions); - while(KviAction * a = it.current()) - { - if(a->isKviUserActionNeverOverrideThis()) - { - dying.append(((KviKvsUserAction *)a)); - } - ++it; - } - - dying.clear(); // bye :) -} - - -bool KviActionManager::coreActionExists(const QString &szName) -{ - KviAction *a = m_pActions->find(szName); - if(a)return (!a->isKviUserActionNeverOverrideThis()); - return false; -} - -QString KviActionManager::nameForAutomaticAction(const QString &szTemplate) -{ - QString ret; - - int i = 1; - do { - KviQString::sprintf(ret,"%Q%d",&szTemplate,i); - i++; - } while(m_pActions->find(ret)); - - return ret; -} - -void KviActionManager::emitRemoveActionsHintRequest() -{ - emit removeActionsHintRequest(); -} - -KviActionCategory * KviActionManager::category(const QString &szName) -{ - if(!szName.isEmpty()) - { - KviActionCategory * c = m_pCategories->find(szName); - if(c)return c; - } - return m_pCategoryGeneric; -} - -void KviActionManager::customizeToolBarsDialogCreated() -{ - m_bCustomizingToolBars = true; - m_pCurrentToolBar = KviCustomToolBarManager::instance()->firstExistingToolBar(); - if(m_pCurrentToolBar)m_pCurrentToolBar->update(); - emit beginCustomizeToolBars(); -} - -void KviActionManager::customizeToolBarsDialogDestroyed() -{ - m_bCustomizingToolBars = false; - emit endCustomizeToolBars(); - if(m_pCurrentToolBar) - { - m_pCurrentToolBar->update(); - m_pCurrentToolBar = 0; - } - g_pApp->saveToolBars(); -} - -void KviActionManager::setCurrentToolBar(KviCustomToolBar * t) -{ - if(m_pCurrentToolBar == t)return; - KviCustomToolBar * old = m_pCurrentToolBar; - m_pCurrentToolBar = t; - if(old)old->update(); - if(!m_pCurrentToolBar && m_bCustomizingToolBars) - m_pCurrentToolBar = KviCustomToolBarManager::instance()->firstExistingToolBar(); - if(m_pCurrentToolBar)m_pCurrentToolBar->update(); - emit currentToolBarChanged(); -} - -void KviActionManager::loadAllAvailableActions() -{ - // make sure that the core actions are registered now - if(!KviActionManager::instance()->m_bCoreActionsRegistered) - { - register_core_actions(KviActionManager::instance()); - KviActionManager::instance()->m_bCoreActionsRegistered = true; - } - g_pModuleManager->loadModulesByCaps("action"); -} - -void KviActionManager::init() -{ - if(!m_pInstance)m_pInstance = new KviActionManager(); -} - -void KviActionManager::done() -{ - if(m_pInstance) - { - delete m_pInstance; - m_pInstance = 0; - } -} - -void KviActionManager::delayedRegisterAccelerators() -{ - KviPointerHashTableIterator<QString,KviAction> it(*m_pActions); - while(KviAction * a = it.current()) - { - a->registerAccelerator(); - ++it; - } -} - -bool KviActionManager::registerAction(KviAction * a) -{ - if(m_pActions->find(a->name()))return false; - connect(a,SIGNAL(destroyed()),this,SLOT(actionDestroyed())); - m_pActions->insert(a->name(),a); - if(g_pFrame)a->registerAccelerator(); // otherwise it is delayed! - return true; -} - -void KviActionManager::actionDestroyed() -{ - KviAction * a = (KviAction *)sender(); - m_pActions->remove(a->name()); -} - -bool KviActionManager::unregisterAction(const QString &szName) -{ - KviAction * a = m_pActions->find(szName); - if(!a)return false; - disconnect(a,SIGNAL(destroyed()),this,SLOT(actionDestroyed())); - a->unregisterAccelerator(); - return m_pActions->remove(szName); -} - -KviAction * KviActionManager::getAction(const QString &szName) -{ - KviAction * a = m_pActions->find(szName); - if(a)return a; - int idx = szName.find('.'); - if(idx < 0) - { - // backward compatibility: try to lookup the name with the kvirc. prefix - QString s = "kvirc."; - s += szName; - return m_pActions->find(s); - } - if((idx == 5) && (!m_bCoreActionsRegistered)) - { - // the core actions are all like kvirc.name - // so the dot is at poisition 5 (6th char) - // the first requested core action will trigger this - // the nice thing is that we will probably already have a frame when - // the core actions are registered thus stuff like mdiManager() can be accessed... - if(szName.left(5) == "kvirc") - { - register_core_actions(this); - m_bCoreActionsRegistered = true; - a = m_pActions->find(szName); - return a; - } - } - // try to preload the module that might register this action... - QString szModule = szName.left(idx); - if(!g_pModuleManager->getModule(szModule))return 0; - return m_pActions->find(szName); -} - -void KviActionManager::listActionsByCategory(const QString &szCatName,KviPointerList<KviAction> * pBuffer) -{ - loadAllAvailableActions(); - KviActionCategory * pCat = category(szCatName); - pBuffer->setAutoDelete(false); - pBuffer->clear(); - if(!pCat)return; - KviPointerHashTableIterator<QString,KviAction> it(*m_pActions); - while(KviAction * a = it.current()) - { - if(a->category() == pCat) - pBuffer->append(a); - ++it; - } -} - diff --git a/3.4.0/src/kvirc/kernel/kvi_actionmanager.h b/3.4.0/src/kvirc/kernel/kvi_actionmanager.h deleted file mode 100644 index 9daad5c4dd..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_actionmanager.h +++ /dev/null @@ -1,118 +0,0 @@ -#ifndef _KVI_ACTIONMANAGER_H_ -#define _KVI_ACTIONMANAGER_H_ -//============================================================================= -// -// File : kvi_actionmanager.h -// Created on Sun 21 Nov 2004 03:37:57 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_action.h" - -#include <qobject.h> -#include "kvi_pointerhashtable.h" - -class KviActionDrawer; -class KviCustomToolBar; - -class KVIRC_API KviActionManager : public QObject -{ - friend class KviActionDrawer; - friend class KviCustomizeToolBarsDialog; - friend class KviCustomToolBar; - friend class KviFrame; - Q_OBJECT -public: - KviActionManager(); - ~KviActionManager(); -protected: - static KviActionManager * m_pInstance; - KviPointerHashTable<QString,KviAction> * m_pActions; - KviPointerHashTable<QString,KviActionCategory> * m_pCategories; - static bool m_bCustomizingToolBars; - - // action categories - static KviActionCategory * m_pCategoryIrc; - static KviActionCategory * m_pCategoryGeneric; - static KviActionCategory * m_pCategorySettings; - static KviActionCategory * m_pCategoryScripting; - static KviActionCategory * m_pCategoryGUI; - static KviActionCategory * m_pCategoryChannel; - static KviActionCategory * m_pCategoryTools; - // internal , current toolbar to be edited (only when customizing) - static KviCustomToolBar * m_pCurrentToolBar; - bool m_bCoreActionsRegistered; -public: - static void init(); - static void done(); - static KviActionManager * instance(){ return m_pInstance; }; - static void loadAllAvailableActions(); - static bool customizingToolBars(){ return m_bCustomizingToolBars; }; - static KviActionCategory * categoryIrc(){ return m_pCategoryIrc; }; - static KviActionCategory * categoryGeneric(){ return m_pCategoryGeneric; }; - static KviActionCategory * categorySettings(){ return m_pCategorySettings; }; - static KviActionCategory * categoryScripting(){ return m_pCategoryScripting; }; - static KviActionCategory * categoryGUI(){ return m_pCategoryGUI; }; - static KviActionCategory * categoryChannel(){ return m_pCategoryChannel; }; - static KviActionCategory * categoryTools(){ return m_pCategoryTools; }; - - KviPointerHashTable<QString,KviAction> * actions(){ return m_pActions; }; - KviActionCategory * category(const QString &szName); - KviPointerHashTable<QString,KviActionCategory> * categories(){ return m_pCategories; }; - - void killAllKvsUserActions(); - - static KviCustomToolBar * currentToolBar(){ return m_pCurrentToolBar; }; - KviAction * getAction(const QString &szName); - void listActionsByCategory(const QString &szCatName,KviPointerList<KviAction> * pBuffer); - QString nameForAutomaticAction(const QString &szTemplate); - bool coreActionExists(const QString &szName); - - void load(const QString &szFileName); - void save(const QString &szFileName); - - bool registerAction(KviAction * a); - bool unregisterAction(const QString &szName); - - void emitRemoveActionsHintRequest(); -protected: - void setCurrentToolBar(KviCustomToolBar * t); - KviAction * findAction(const QString &szName){ return m_pActions->find(szName); }; - void customizeToolBarsDialogCreated(); - void customizeToolBarsDialogDestroyed(); - void tryFindCurrentToolBar(); - void delayedRegisterAccelerators(); // this is called ONCE by KviFrame, at startup -protected slots: - void actionDestroyed(); -signals: - void beginCustomizeToolBars(); - void endCustomizeToolBars(); - void currentToolBarChanged(); // emitted only when customizing! - void removeActionsHintRequest(); // connected by the KviCustomToolBarDialog to flash the trashcan - // when the user tries to remove an action from the toolbar - // and it fails to drag it on the trashcan -}; - -#define ACTION_POPUP_ITEM(__name,__popup) \ - { KviAction * a = KviActionManager::instance()->getAction(__name); if(a)a->addToPopupMenu(__popup); } - - -#endif //!_KVI_ACTIONMANAGER_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_app.cpp b/3.4.0/src/kvirc/kernel/kvi_app.cpp deleted file mode 100644 index 2ef96c13aa..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_app.cpp +++ /dev/null @@ -1,2064 +0,0 @@ -//============================================================================= -// -// File : kvi_app.cpp -// Creation date : Sun Jun 18 2000 12:39:45 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#define _KVI_APP_CPP_ - -#include "kvi_socket.h" -#include "kvi_app.h" -#include "kvi_debug.h" -#include "kvi_frame.h" -#include "kvi_msgbox.h" -#include "kvi_iconmanager.h" -#include "kvi_input.h" -#include "kvi_config.h" -#include "kvi_colorwin.h" -#include "kvi_window.h" -#include "kvi_ircserverdb.h" -#include "kvi_proxydb.h" -#include "kvi_menubar.h" -#include "kvi_options.h" -#include "kvi_sparser.h" -#include "kvi_modulemanager.h" -#include "kvi_mediatype.h" -#include "kvi_regusersdb.h" -#include "kvi_thread.h" -#include "kvi_sharedfiles.h" -#include "kvi_confignames.h" -#include "kvi_taskbar.h" -#include "kvi_defaults.h" -#include "kvi_locale.h" -#include "kvi_out.h" -#include "kvi_splash.h" -#include "kvi_nickserv.h" -#include "kvi_xlib.h" -#include "kvi_garbage.h" -#include "kvi_texticonmanager.h" -#include "kvi_texticonwin.h" -#include "kvi_historywin.h" -#include "kvi_ctcppagedialog.h" -#include "kvi_regchan.h" -#include "kvi_moduleextension.h" -#include "kvi_internalcmd.h" -#include "kvi_filetransfer.h" -#include "kvi_kvs.h" -#include "kvi_ircurl.h" -#include "kvi_avatarcache.h" -#include "kvi_actionmanager.h" -#include "kvi_customtoolbarmanager.h" -#include "kvi_fileutils.h" -#include "kvi_time.h" -#include "kvi_doublebuffer.h" -#include "kvi_stringconversion.h" -#include "kvi_useridentity.h" - -#ifndef COMPILE_NO_IPC - #include "kvi_ipc.h" -#endif - -#include "kvi_kvs_script.h" -#include "kvi_kvs_popupmanager.h" -#include "kvi_kvs_kernel.h" -#include "kvi_kvs_object_controller.h" -#include "kvi_kvs_eventtriggers.h" -#include "kvi_sourcesdate.h" - -#include "kvi_tal_popupmenu.h" -#include <qsplitter.h> -#include <qstringlist.h> -#include "kvi_pointerhashtable.h" -#include <qmime.h> -#ifdef COMPILE_USE_QT4 - #include <q3mimefactory.h> -#endif -#include "kvi_tal_listbox.h" -#include <qclipboard.h> -#include <qmessagebox.h> -#include <qtextcodec.h> -#include <qmetaobject.h> - -#ifdef COMPILE_SSL_SUPPORT - #include "kvi_ssl.h" -#endif - -#ifdef COMPILE_USE_QT4 -#ifdef COMPILE_ON_WINDOWS -#include <QPluginLoader> -#endif -#endif - -KVIRC_API KviApp * g_pApp = 0; // global application pointer - -KviConfig * g_pWinPropertiesConfig = 0; -KVIRC_API KviIrcServerDataBase * g_pIrcServerDataBase = 0; -KVIRC_API KviProxyDataBase * g_pProxyDataBase = 0; - -// Global windows - -KVIRC_API KviColorWindow * g_pColorWindow = 0; -KVIRC_API KviTextIconWindow * g_pTextIconWindow = 0; -KVIRC_API KviTalPopupMenu * g_pInputPopup = 0; -KVIRC_API QStringList * g_pRecentTopicList = 0; -//KVIRC_API QStringList * g_pBookmarkList = 0; -KVIRC_API KviPointerHashTable<const char *,KviWindow> * g_pGlobalWindowDict = 0; -KVIRC_API KviMediaManager * g_pMediaManager = 0; -//KVIRC_API KviRegisteredUserDataBase * g_pRegisteredUserDataBase = 0; -KVIRC_API KviSharedFilesManager * g_pSharedFilesManager = 0; -KVIRC_API KviNickServRuleSet * g_pNickServRuleSet = 0; -//KVIRC_API KviTimerManager * g_pTimerManager = 0; -KVIRC_API KviGarbageCollector * g_pGarbageCollector = 0; -KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog = 0; -KVIRC_API KviRegisteredChannelDataBase * g_pRegisteredChannelDataBase = 0; -KVIRC_API KviInputHistory * g_pInputHistory = 0; -KVIRC_API KviHistoryWindow * g_pHistoryWindow = 0; - - -KVIRC_API int g_iIdentDaemonRunningUsers = 0; // this is eventually set by libkviident - -KVIRC_API KviSplashScreen * g_pSplashScreen = 0; - - -// Loaded and destroyed by KviIconManager -QPixmap * g_pUserChanStatePixmap = 0; -QPixmap * g_pActivityMeterPixmap = 0; - - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - - #ifdef COMPILE_KDE_SUPPORT - #include <ksharedpixmap.h> - #include <netwm.h> - #include <kimageeffect.h> - #include <dcopclient.h> - #include <qdatastream.h> - #include <qcstring.h> - - KSharedPixmap * g_pKdeDesktopBackground = 0; // the shared pixmap that we get from KWin - #endif - - #include <qimage.h> - - KVIRC_API QPixmap * g_pShadedParentGlobalDesktopBackground = 0; // the pixmap that we use for MdiManager - KVIRC_API QPixmap * g_pShadedChildGlobalDesktopBackground = 0; // the pixmap that we use for MdiChild -#endif - -#ifdef COMPILE_CRYPT_SUPPORT - #include "kvi_crypt.h" - KVIRC_API KviCryptEngineManager * g_pCryptEngineManager = 0; // global crypt engine manager -#endif - -KviApp::KviApp(int &argc,char ** argv) -: KviTalApplication(argc,argv) -{ - // Ok...everything begins here - g_pApp = this; - m_szConfigFile = QString::null; - m_bCreateConfig = false; - m_bShowSplashScreen = true; - m_bUpdateGuiPending = false; - m_pPendingAvatarChanges = 0; - m_pRecentChannelsDict = 0; - m_pIpcSentinel = 0; - m_iHeartbeatTimerId = -1; - // next step is setup() - m_bSetupDone = false; - kvi_socket_flushTrafficCounters(); -} - -void KviApp::setup() -{ - // Here we start up all the substystems. - // This is a really critical phase since in general subsystems depend - // on each other and we must activate them in the right order. - // Don't move stuff around unless you really know what you're doing. - -#ifdef COMPILE_ON_WINDOWS - // setup winsock.dll - WSADATA w; - WSAStartup(MAKELONG((unsigned short)2,(unsigned short)0),&w); -#endif - -#ifndef COMPILE_NO_IPC - // Create this very early - // FIXME: this is still not early enough... we actually HAVE race conditions (should use a file for locking this ?) - createIpcSentinel(); -#endif - - // Initialize the thread manager early - KviThreadManager::globalInit(); - -#ifdef COMPILE_SSL_SUPPORT - KviSSL::globalInit(); -#endif - - // Setup our filesystem and initalize locale - loadDirectories(); - KviStringConversion::init(m_szGlobalKvircDir,m_szLocalKvircDir); - -#ifdef COMPILE_USE_QT4 -#ifdef COMPILE_ON_WINDOWS - //need to load image plugins:( - QString szPluginsDir; - getGlobalKvircDirectory(szPluginsDir,None,"qt-plugins/"); - setLibraryPaths(QStringList(szPluginsDir)); - //KviMessageBox::information(libraryPaths().join(";")); - //debug("%1",loader.isLoaded()); -#endif -#endif - - // check if we want to permanently disable the splash screen - // we do it once for every version: the user should see the new splash screens at least once - - QString szSplashDisableFile; - getLocalKvircDirectory(szSplashDisableFile,Pics,"disable-splash." KVI_VERSION); - - if(KviFileUtils::fileExists(szSplashDisableFile)) - m_bShowSplashScreen = false; - - // Now we can create the splash screen (we can locate the splash image) - if(m_bShowSplashScreen) - createSplashScreen(); - - KVI_SPLASH_SET_PROGRESS(0) - - // Make sure that the C strings are translated to utf8 - // This is a fallback solution anyway: we should use the appropriate - // encoding every time. - QTextCodec::setCodecForCStrings(KviLocale::codecForName("UTF-8")); - - // Set the default help files search path - QStringList list; - QString tmp; - getLocalKvircDirectory(tmp,Help); // localized help/lang or help if help/lang doesn't exist - list.append(tmp); - getLocalKvircDirectory(tmp,HelpEN); // help/en - list.append(tmp); - getLocalKvircDirectory(tmp,HelpNoIntl); // just help/ - list.append(tmp); - getGlobalKvircDirectory(tmp,Help); - list.append(tmp); - getGlobalKvircDirectory(tmp,HelpEN); - list.append(tmp); - getGlobalKvircDirectory(tmp,HelpNoIntl); - list.append(tmp); -#ifdef COMPILE_USE_QT4 - Q3MimeSourceFactory::defaultFactory()->setFilePath(list); -#else - QMimeSourceFactory::defaultFactory()->setFilePath(list); -#endif - - KVI_SPLASH_SET_PROGRESS(1) - - // Initialize the scripting engine - KviKvs::init(); - - KVI_SPLASH_SET_PROGRESS(2) - - // Initialize the action manager - KviActionManager::init(); - - KVI_SPLASH_SET_PROGRESS(3) - - // Create the module manager early: so the other managers can load modules - g_pModuleExtensionManager = new KviModuleExtensionManager(); - g_pModuleManager = new KviModuleManager(); - - KVI_SPLASH_SET_PROGRESS(4); - - g_pIconManager = new KviIconManager(); - - KVI_SPLASH_SET_PROGRESS(5) - - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_USERACTIONS)) - KviActionManager::instance()->load(tmp); - - KVI_SPLASH_SET_PROGRESS(8); - - // Initialize and load the identities - KviUserIdentityManager::init(); - - KVI_SPLASH_SET_PROGRESS(9); - - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_IDENTITIES)) - KviUserIdentityManager::instance()->load(tmp); - - KVI_SPLASH_SET_PROGRESS(12); - - // Load the remaining configuration - // Note that loadOptions() assumes that the current progress is 12 and - // will bump it up to 45 in small steps - loadOptions(); - - KVI_SPLASH_SET_PROGRESS(47) - - // set the global font if needed - updateApplicationFont(); - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - updatePseudoTransparency(); -#endif - - KVI_SPLASH_SET_PROGRESS(48) - - // Load the win properties config - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_WINPROPERTIES); - g_pWinPropertiesConfig = new KviConfig(tmp,KviConfig::ReadWrite); - - KVI_SPLASH_SET_PROGRESS(50) - - // Load the server database - g_pIrcServerDataBase = new KviIrcServerDataBase(); - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_SERVERDB)) - g_pIrcServerDataBase->load(tmp); - - KVI_SPLASH_SET_PROGRESS(53) - - // Load the proxy database - g_pProxyDataBase = new KviProxyDataBase(); - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_PROXYDB)) - g_pProxyDataBase->load(tmp); - - KVI_SPLASH_SET_PROGRESS(54) - - // Event manager - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_EVENTS)) - KviKvs::loadAppEvents(tmp); - - KVI_SPLASH_SET_PROGRESS(59) - - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_RAWEVENTS)) - KviKvs::loadRawEvents(tmp); - - KVI_SPLASH_SET_PROGRESS(62) - - // Popup manager - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_POPUPS)) - KviKvs::loadPopups(tmp); - - KVI_SPLASH_SET_PROGRESS(67) - - KviCustomToolBarManager::init(); - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_CUSTOMTOOLBARS)) - KviCustomToolBarManager::instance()->load(tmp); - // THIS IS A COMPATIBILITY ENTRY ADDED AT 3.0.2 TIME THAT SHOULD BE DROPPED IN A COUPLE OF VERSION BUMPS! - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_SCRIPTTOOLBARS); - if(KviFileUtils::fileExists(tmp)) - KviCustomToolBarManager::instance()->loadScripttoolbarsCompat(tmp); - // EOF COMPATIBILITY - - KVI_SPLASH_SET_PROGRESS(70) - - // Alias manager - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_ALIASES)) - KviKvs::loadAliases(tmp); - - KVI_SPLASH_SET_PROGRESS(75) - - // Script addons manager (this in fact has delayed loading, so we don't even care - // about showing up an entry in the splash screen) - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_SCRIPTADDONS)) - KviKvs::loadScriptAddons(tmp); - - KVI_SPLASH_SET_PROGRESS(77) - - g_pTextIconManager = new KviTextIconManager(); - g_pTextIconManager->load(); - - KVI_SPLASH_SET_PROGRESS(80) - - // load the recent data lists - g_pRecentTopicList = new QStringList(); - //g_pBookmarkList = new QStringList(); - loadRecentEntries(); - - KVI_SPLASH_SET_PROGRESS(81) - - // media manager - g_pMediaManager = new KviMediaManager(); - g_pMediaManager->lock(); - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_MEDIATYPES)) - g_pMediaManager->load(tmp); - g_pMediaManager->unlock(); - - - KVI_SPLASH_SET_PROGRESS(82) - - // registered user data base - g_pRegisteredUserDataBase = new KviRegisteredUserDataBase(); - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_REGUSERDB)) - g_pRegisteredUserDataBase->load(tmp); - - KVI_SPLASH_SET_PROGRESS(84) - - // registered channel data base - g_pRegisteredChannelDataBase = new KviRegisteredChannelDataBase(); - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_REGCHANDB)) - g_pRegisteredChannelDataBase->load(tmp); - - KVI_SPLASH_SET_PROGRESS(85) - - // file trader - g_pSharedFilesManager = new KviSharedFilesManager(); - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_SHAREDFILES)) - g_pSharedFilesManager->load(tmp); - - KVI_SPLASH_SET_PROGRESS(86) - - // nick serv data base - g_pNickServRuleSet = new KviNickServRuleSet(); - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_NICKSERVDATABASE)) - g_pNickServRuleSet->load(tmp); - - KVI_SPLASH_SET_PROGRESS(88) - - g_pInputHistory = new KviInputHistory(); - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_INPUTHISTORY)) - g_pInputHistory->load(tmp); - - KVI_SPLASH_SET_PROGRESS(89) - KviAvatarCache::init(); - if(getReadOnlyConfigPath(tmp,KVI_CONFIGFILE_AVATARCACHE)) - KviAvatarCache::instance()->load(tmp); - - KVI_SPLASH_SET_PROGRESS(90) - - // Eventually initialize the crypt engine manager -#ifdef COMPILE_CRYPT_SUPPORT - g_pCryptEngineManager = new KviCryptEngineManager(); -#endif - - g_pGarbageCollector = new KviGarbageCollector(); - - // and the input popup - g_pInputPopup = new KviTalPopupMenu(); - - // create the server parser - g_pServerParser = new KviServerParser(); - - KVI_SPLASH_SET_PROGRESS(91) - - // Global window dictionary - g_pGlobalWindowDict = new KviPointerHashTable<const char *,KviWindow>(41); - g_pGlobalWindowDict->setAutoDelete(false); - // Script object controller - //g_pScriptObjectController = new KviScriptObjectController(); gone - - KVI_SPLASH_SET_PROGRESS(92) - - KviDoubleBuffer::init(); - -#ifdef COMPILE_USE_QT4 - QString szStylesheetFile; - getGlobalKvircDirectory(szStylesheetFile,Config,"style.css"); - if(KviFileUtils::fileExists(szStylesheetFile)) - { - QString szStyleData; - KviFileUtils::readFile(szStylesheetFile,szStyleData); - szStyleData.replace("global://",m_szGlobalKvircDir); - szStyleData.replace("local://",m_szLocalKvircDir); - setStyleSheet(szStyleData); - } -#endif - - // create the frame window, we're almost up and running... - createFrame(); - - // ok, we also have an UI now - - // check if this is the first time this version of KVIrc runs... - if(firstTimeRun()) - { - // Finish the setup... - setupFinish(); - } - - // hello world! - m_bSetupDone = true; - - // We're REALLY up and running! - // kill the splash screen - - KVI_SPLASH_SET_PROGRESS(100) - //KVI_SPLASH_SET_TEXT(__tr2qs("Have fun! :)")) - - if(KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart)) - g_pFrame->executeInternalCommand(KVI_INTERNALCOMMAND_SERVERSJOIN_OPEN); - - destroySplashScreen(); - - // check if we're in trouble... - checkSuggestRestoreDefaultScript(); - - // start our heartbeat now - m_iHeartbeatTimerId = startTimer(1000); -} - -void KviApp::frameDestructorCallback() -{ - // here we should kill anything that depends on g_pFrame , g_pActiveWindow and related being non zero... - - // kill all the objects, while we have windows... - if(KviKvsKernel::instance()) - { - if(KviKvsKernel::instance()->objectController()) - { - KviKvsKernel::instance()->objectController()->clearInstances(); - } - } -} - - - -KviApp::~KviApp() -{ - // Another critical phase. - // We shutdown our subsystems in the right order here. - -#ifndef COMPILE_NO_IPC - destroyIpcSentinel(); -#endif - - if(g_pSplashScreen)delete g_pSplashScreen; - if(g_pCtcpPageDialog)delete g_pCtcpPageDialog; - - // if we still have a frame: kill it - if(g_pFrame)delete g_pFrame; - g_pActiveWindow = 0; // .. but it should be already 0 anyway - - // execute pending deletes (this may still contain some UI elements) - delete g_pGarbageCollector; - - if(!m_bSetupDone)return; // killed with IPC (nothing except the m_pFrameList was created yet) - - KviFileTransferManager::cleanup(); - - // No more events are triggered from now on and no KVS commands are executed - - // Dangerous part.... we're unloading all the modules - // We need to unload them early since they may use other subsystems - // that we are going to kill now. - delete g_pModuleManager; - delete g_pModuleExtensionManager; - // No more external modules exist: all that happens from now is generated - // from inside the kvirc core. - - // We should have almost no UI here: only certain dialogs or popup windows may - // still exist: they should be harmless tough. - saveOptions(); - saveIdentities(); - KviUserIdentityManager::done(); - if(m_pRecentChannelsDict) delete m_pRecentChannelsDict; - // now kill the stuff that the frame depends on - saveIrcServerDataBase(); - delete g_pIrcServerDataBase; - saveProxyDataBase(); - delete g_pProxyDataBase; - delete g_pWinPropertiesConfig; - saveTextIcons(); - if(g_pTextIconWindow)delete g_pTextIconWindow; - delete g_pTextIconManager; - delete g_pIconManager; - delete g_pServerParser; - saveMediaTypes(); - delete g_pMediaManager; - saveRecentEntries(); - saveAvatarCache(); - KviAvatarCache::done(); - //delete g_pBookmarkList; - delete g_pRecentTopicList; - saveRegisteredUsers(); - delete g_pRegisteredUserDataBase; - saveRegisteredChannels(); - delete g_pRegisteredChannelDataBase; - saveNickServ(); - delete g_pNickServRuleSet; - saveSharedFiles(); - delete g_pSharedFilesManager; - saveAppEvents(); - saveRawEvents(); - saveToolBars(); - KviCustomToolBarManager::done(); - savePopups(); - saveAliases(); - delete g_pGlobalWindowDict; - saveScriptAddons(); - // kill the remaining resources - delete g_pColorWindow; - if(g_pHistoryWindow)delete g_pHistoryWindow; - saveInputHistory(); - delete g_pInputHistory; - delete g_pInputPopup; - //delete g_pScriptObjectController; -#ifdef COMPILE_CRYPT_SUPPORT - delete g_pCryptEngineManager; -#endif -#ifdef COMPILE_PSEUDO_TRANSPARENCY - destroyPseudoTransparency(); -#endif - KviDoubleBuffer::done(); - if(m_pPendingAvatarChanges)delete m_pPendingAvatarChanges; - // Kill the thread manager.... all the slave threads should have been already terminated ... -#ifdef COMPILE_SSL_SUPPORT - KviSSL::globalDestroy(); -#endif - KviThreadManager::globalDestroy(); - // kill the scripting engine - KviKvs::done(); - // shut up the action manager - saveActions(); - KviActionManager::done(); - -#ifdef COMPILE_ON_WINDOWS - WSACleanup(); -#endif - - KviLocale::done(this); - - // goodbye cruel world... -} - -static int g_iGloballyUniqueId = 0; - -int KviApp::getGloballyUniqueId() -{ - g_iGloballyUniqueId++; - return g_iGloballyUniqueId; -} - -typedef struct _NotifierMessageSupaDupaParameterStruct -{ - KviWindow * pWindow; - QString szIcon; - QString szMessage; - unsigned int uMessageLifetime; // 0 means no hide -} NotifierMessageSupaDupaParameterStruct; - -void KviApp::notifierMessage(KviWindow * pWnd,int iIconId,const QString &szMsg,unsigned int uMessageLifetime) -{ - KviModule * m = g_pModuleManager->getModule("notifier"); - if(!m)return; - - NotifierMessageSupaDupaParameterStruct s; - s.pWindow = pWnd; - s.szIcon.sprintf("%d",iIconId); - s.szMessage = szMsg; - s.uMessageLifetime = uMessageLifetime; - - m->ctrl("notifier::message",(void *)&s); -} - -QTextCodec * KviApp::defaultTextCodec() -{ - QTextCodec * c = 0; - if(!KVI_OPTION_STRING(KviOption_stringDefaultTextEncoding).isEmpty()) - { - c = KviLocale::codecForName(KVI_OPTION_STRING(KviOption_stringDefaultTextEncoding).latin1()); - if(c)return c; - } - c = QTextCodec::codecForLocale(); - if(c)return c; - c = KviLocale::codecForName("UTF-8"); - if(!c)debug("KviApp::defaultTextCodec(): cannot find a suitable text codec for locale :/"); - return c; -} - -void KviApp::contextSensitiveHelp() -{ - // this stuff doesn't work with Qt 4.x -#ifndef COMPILE_USE_QT4 - // the F1 Key has been pressed - // try to pass it to the active widget or one of its parents - QWidget * w = g_pApp->focusWidget(); - while(w) - { - //QVariant v = w->property("contextSensitiveHelp"); <-- this prints a lot of warnings: this is a QT BUG - QMetaObject * o = w->metaObject(); - if(o) - { - int i = o->findProperty("contextSensitiveHelp",true); - if(i != -1) - { - QVariant v = w->property("contextSensitiveHelp"); - if(v.isValid() && v.toBool()) - return; // done! - } - } - w = w->parentWidget(); - } - // no way - // FIXME: just show up simple plain online help - //debug("No way: found no focus widget for that..."); -#endif -} - - -void KviApp::collectGarbage(QObject * garbage) -{ -// if(!g_pGarbageCollector)debug("Ops... no garbage collector ?"); - g_pGarbageCollector->collect(garbage); -} - -void KviApp::loadDefaultScript() -{ - QString cmd; - getGlobalKvircDirectory(cmd,KviApp::DefScript,"default.kvs"); - cmd.prepend("parse \""); - cmd.append("\""); -#ifdef COMPILE_ON_WINDOWS - cmd.replace("\\","\\\\"); -#endif - KviKvsScript::run(cmd,g_pFrame->firstConsole()); - // now line up the toolbars (they may get messed while loading the script) -#ifndef COMPILE_USE_QT4 - g_pFrame->lineUpDockWindows(); // missing on Qt 4.x -#endif -} - -// 07.01.2005 06:01: Got this curious gcc error while writing -// the functions below... -// The problem is gone by simply typing make again. -// Memory/Disk transfer error ? -// -// if g++ -DHAVE_CONFIG_H -I. -I. -I../../../src -I/usr/build/kvirccvs/kvirc/src/kvilib/include/ -I/usr/build/kvirccvs/kvirc/src/kvirc/include/ -I/opt/qt/include -I/usr/X11R6/include -I/usr/X11R6/include -I/opt/kde/include -D_REENTRANT -DREENTRANT -I/usr/X11R6/include -DGLOBAL_KVIRC_DIR=\"/usr/local/share/kvirc/3.0.1.99\" -g -MT kvi_ircconnection.o -MD -MP -MF ".deps/kvi_ircconnection.Tpo" -// -c -o kvi_ircconnection.o `test -f '../kernel/kvi_ircconnection.cpp' || echo './'`../kernel/kvi_ircconnection.cpp; -// then mv -f ".deps/kvi_ircconnection.Tpo" ".deps/kvi_ircconnection.Po"; -// else rm -f ".deps/kvi_ircconnection.Tpo"; exit 1; -// fi -// /opt/qt/include/qstringlist.h:62: sorry, not implemented: ` -// expr_with_file_location' not supported by dump_decl -// /opt/qt/include/qstringlist.h: In function `<declaration error>': -// /opt/qt/include/qstringlist.h:62: internal error: Segmentation fault -// Please submit a full bug report, -// with preprocessed source if appropriate. -// See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. - - -void KviApp::checkSuggestRestoreDefaultScript() -{ - static bool bSuggestedOnce = false; - if(KVI_OPTION_BOOL(KviOption_boolDoNotSuggestRestoreDefaultScript))return; - if(bSuggestedOnce)return; // already suggested in this kvirc session - - int score = 0; - - if(KviCustomToolBarManager::instance()->descriptorCount() < 1)score += 100; // straight suggest - else if(KviKvsPopupManager::instance()->popupCount() < 1)score += 100; // straight suggest - else { - // other stuff is not that critical - if(!KviKvsEventManager::instance()->hasAppHandlers(KviEvent_OnChannelNickPopupRequest))score += 80; - if(!KviKvsEventManager::instance()->hasAppHandlers(KviEvent_OnDCCChatPopupRequest))score += 20; - if(!KviKvsEventManager::instance()->hasAppHandlers(KviEvent_OnConsolePopupRequest))score += 20; - if(!KviKvsEventManager::instance()->hasAppHandlers(KviEvent_OnChannelPopupRequest))score += 20; - if(!KviKvsEventManager::instance()->hasAppHandlers(KviEvent_OnChannelNickPopupRequest))score += 20; - if(!KviKvsEventManager::instance()->hasAppHandlers(KviEvent_OnQueryPopupRequest))score += 20; - if(!KviKvsEventManager::instance()->hasAppHandlers(KviEvent_OnQueryNickPopupRequest))score += 20; - if(KviCustomToolBarManager::instance()->descriptorCount() < 4)score += 20; - if(KviKvsPopupManager::instance()->popupCount() < 3)score += 20; - if(KviCustomToolBarManager::instance()->visibleToolBarCount() < 2) - { - score += 20; - if(KviCustomToolBarManager::instance()->visibleToolBarCount() < 1)score += 20; - } - } - - if(score < 100)return; - - bSuggestedOnce = true; - - switch(QMessageBox::question(0,__tr2qs("Installation problems ?"), - __tr2qs("<b>Ooops...</b><br><br>" \ - "<b>There are some reasons that make me think that your KVIrc installation is incomplete.</b><br><br>" \ - "I might be wrong, but you seem to miss some of the features that the default KVIrc script provides." \ - "This may happen because you have upgraded to an unstable cvs version, " \ - "because you have accidentally deleted or damaged your configuration files, " \ - "because you have installed an incomplete script " \ - "or because you have hit a bug in KVIrc.<br><br>" \ - "I can repeat the installation of the default script in order " \ - "to restore the missing features.<br>" \ - "<b>Do you want the default script to be restored ?</b><br><br>" \ - "<font size=\"-1\">Hint: If you're a scripter and have intentionally removed some of the scripting features " \ - "then you may safely click on \"No and Don't Ask Me Again\", otherwise it might be " \ - "a good idea to click \"Yes\". If you still want to choose \"No\" you can always restore the " \ - "default script by choosing the appropriate entry from the \"Scripting\" menu.</font>"), - __tr2qs("No and Don't Ask Me Again"), - __tr2qs("No"), - __tr2qs("Yes"), - 1, - 1)) - { - case 0: - KVI_OPTION_BOOL(KviOption_boolDoNotSuggestRestoreDefaultScript) = true; - return; - break; - case 1: - return; - break; - default: - restoreDefaultScript(); - break; - } -} - - - -void KviApp::restoreDefaultScript() -{ - if(QMessageBox::warning(0,__tr2qs("Restore Default Script - KVIrc"), - __tr2qs("You are about to restore the default script.<br>This will erase any script changes you have made.<br>Do you wish to proceed?"), - QMessageBox::Yes,QMessageBox::No|QMessageBox::Default|QMessageBox::Escape) != QMessageBox::Yes)return; - - KviKvs::clearAliases(); - KviKvs::clearAppEvents(); - KviKvs::clearRawEvents(); - KviKvs::clearPopups(); - KviKvs::clearScriptAddons(); - - KviActionManager::instance()->killAllKvsUserActions(); - KviCustomToolBarManager::instance()->clear(); - - loadDefaultScript(); - - // and save settings to be sure... - saveOptions(); -} - -#ifndef COMPILE_NO_IPC - - -void KviApp::createIpcSentinel() -{ - m_pIpcSentinel = new KviIpcSentinel(); -} - -void KviApp::destroyIpcSentinel() -{ - if(m_pIpcSentinel)delete m_pIpcSentinel; - m_pIpcSentinel = 0; -} - -void KviApp::ipcMessage(char * message) -{ - if(!g_pFrame)return; - KviConsole * cns = g_pFrame->firstConsole(); - if(!cns)return; - if(_OUTPUT_VERBOSE) - { - KviStr cmd = message; - if(cmd.len() > 30)cmd.cutRight(cmd.len() - 30); - int idx = cmd.findFirstIdx('\n'); - if(idx != -1)cmd.cutRight(cmd.len() - (idx + 1)); - cns->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Remote command received (%s ...)"),cmd.ptr()); - } - KviKvsScript::run(message,cns); -} - -#endif // COMPILE_NO_IPC - - -void KviApp::createSplashScreen() -{ - g_pSplashScreen = new KviSplashScreen(); - g_pSplashScreen->show(); -} - -void KviApp::destroySplashScreen() -{ - if(g_pSplashScreen)g_pSplashScreen->die(); -} - - -QString KviApp::getClipboardText() -{ - /* - QString buffer; -#if QT_VERSION >= 300 - bool bOldMode = clipboard()->selectionModeEnabled(); - clipboard()->setSelectionMode(false); -#endif - buffer = clipboard()->text(); -#if QT_VERSION >= 300 - if(buffer.isEmpty()) - { - // lookup the global clipboard - clipboard()->setSelectionMode(true); - buffer = clipboard()->text(); - } - clipboard()->setSelectionMode(bOldMode); -#endif - return buffer; - */ - - QString buffer = clipboard()->text(QClipboard::Clipboard); - if(buffer.isEmpty())return clipboard()->text(QClipboard::Selection); - return buffer; -} - - -void KviApp::getClipboardText(KviStr &buffer) -{ - buffer = getClipboardText(); -} - -void KviApp::setClipboardText(const QString &str) -{ - /* -#if QT_VERSION >= 300 - if(clipboard()->supportsSelection()) - { - bool bOldMode = clipboard()->selectionModeEnabled(); - clipboard()->setSelectionMode(true); - clipboard()->setText(str); - clipboard()->setSelectionMode(false); - clipboard()->setText(str); - clipboard()->setSelectionMode(bOldMode); - } else { -#endif - clipboard()->setText(str); -#if QT_VERSION >= 300 - } -#endif*/ - clipboard()->setText(str,QClipboard::Clipboard); - clipboard()->setText(str,QClipboard::Selection); -} - -void KviApp::setClipboardText(const KviStr &str) -{ - debug("WARNING : KviApp::setClipboardText(const KviStr &) is deprecated!"); - setClipboardText(QString(str.ptr())); -} - -void KviApp::setAvatarFromOptions() -{ - KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict); - - while(it.current()) - { - if(it.current()->type() == KVI_WINDOW_TYPE_CONSOLE) - { - ((KviConsole *)it.current())->setAvatarFromOptions(); - } - ++it; - } - -} - -void KviApp::setAvatarOnFileReceived(KviConsole * pConsole,const QString &szRemoteUrl,const QString &szNick,const QString &szUser,const QString &szHost) -{ - if(!m_pPendingAvatarChanges) - { - m_pPendingAvatarChanges = new KviPointerList<KviPendingAvatarChange>; - m_pPendingAvatarChanges->setAutoDelete(true); - } - - if(m_pPendingAvatarChanges->count() >= KVI_MAX_PENDING_AVATARS) // can't be... - { - m_pPendingAvatarChanges->removeFirst(); // kill the first entry - } - - KviPendingAvatarChange * p = new KviPendingAvatarChange; - p->pConsole = pConsole; - p->szRemoteUrl = szRemoteUrl; - p->szNick = szNick; - p->szUser = szUser; - p->szHost = szHost; - - m_pPendingAvatarChanges->append(p); -} - -KviPendingAvatarChange * KviApp::findPendingAvatarChange(KviConsole * pConsole,const QString &szNick,const QString &szRemoteUrl) -{ - if(!m_pPendingAvatarChanges)return 0; - - KviPendingAvatarChange * p; - - for(p = m_pPendingAvatarChanges->first();p;p = m_pPendingAvatarChanges->next()) - { - if(!pConsole || (p->pConsole == pConsole)) - { - if(szNick.isNull() || (szNick == p->szNick)) - { - if(szRemoteUrl == p->szRemoteUrl)return p; - } - } - } - - return 0; -} - -void KviApp::fileDownloadTerminated(bool bSuccess,const QString &szRemoteUrl,const QString &szLocalFileName,const QString &szNick,const QString &szError,bool bQuiet) -{ - - KviPendingAvatarChange * p; - - if(m_pPendingAvatarChanges)p = findPendingAvatarChange(0,szNick,szRemoteUrl); - else p = 0; - - if(!p) - { - // signal dcc completion only for NON-avatars - // FIXME: This option is misnamed and misplaced in the options dialog :( - // it seems to refer only to DCC while it refers to any file transfer - if(KVI_OPTION_BOOL(KviOption_boolNotifyDccSendSuccessInNotifier) && (!bQuiet)) - { - if(!g_pActiveWindow)return; - if(g_pActiveWindow->hasAttention())return; - QString szMsg; - int iIconId; - if(!bSuccess) - { - iIconId = KVI_SMALLICON_DCCERROR; - if(szNick.isEmpty()) - szMsg = __tr2qs("File download failed"); - else - szMsg = __tr2qs("File download from %1 failed").arg(szNick); - szMsg += ": "; - szMsg += szError; - szMsg += " ("; - szMsg += szLocalFileName; - szMsg += ")"; - } else { - iIconId = KVI_SMALLICON_DCCMSG; - if(szNick.isEmpty()) - szMsg = __tr2qs("File download successfully complete"); - else - szMsg = __tr2qs("File download from %1 successfully complete").arg(szNick); - szMsg += " ("; - szMsg += szLocalFileName; - szMsg += ")"; - } - notifierMessage(0,iIconId,szMsg,30); - } - return; - } - - if(bSuccess) - { - if(windowExists(p->pConsole)) - { - p->pConsole->setAvatar(p->szNick,p->szUser,p->szHost, - szLocalFileName,KviQString::equalCIN("http://",szRemoteUrl,7) ? szRemoteUrl : QString::null); - } - } else { - if((!_OUTPUT_MUTE) && (!bQuiet)) - { - p->pConsole->output(KVI_OUT_AVATAR,__tr2qs("Avatar download failed for %Q!%Q@%Q and url %Q: %Q"), - &(p->szNick),&(p->szUser),&(p->szHost),&(szRemoteUrl),&(szError)); - } - } - - m_pPendingAvatarChanges->removeRef(p); - - if(m_pPendingAvatarChanges->count() == 0) - { - delete m_pPendingAvatarChanges; - m_pPendingAvatarChanges = 0; - } -} - - - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - - #ifdef COMPILE_KDE_SUPPORT - - #include <netwm.h> - - void KviApp::downloadKdeRootPixmap() - { - if(g_pKdeDesktopBackground) - { - delete g_pKdeDesktopBackground; - g_pKdeDesktopBackground = 0; - // this signal shouldn't be connected ,but well.. let's make sure - disconnect(this,SIGNAL(backgroundChanged(int)),this,SLOT(kdeRootPixmapChanged(int))); - } - g_pKdeDesktopBackground = 0; - - // This has been extracted from the KDELIBS KRootPixmap interface -#if 0 - #warning "The following warning will disappear soon..." - // FIXME: this form should be used starting from KDE 3.2 - unsigned long l = NET::CurrentDesktop; - NETRootInfo rinfo( qt_xdisplay(), &l ,1 ,-1,true); -#else - NETRootInfo rinfo(qt_xdisplay(),NET::CurrentDesktop); -#endif - rinfo.activate(); - - QString name = QString("DESKTOP%1").arg(rinfo.currentDesktop()); - - g_pKdeDesktopBackground = new KSharedPixmap(); - connect(g_pKdeDesktopBackground,SIGNAL(done(bool)),this,SLOT(kdeRootPixmapDownloadComplete(bool))); - - if(!(g_pKdeDesktopBackground->isAvailable(name))) - { - // Pixmap not available!!! - delete g_pKdeDesktopBackground; - g_pKdeDesktopBackground = 0; - if(m_bUpdatePseudoTransparencyPending)return; // Already sent a request.... - // Send a request to kdesktop.... - DCOPClient *client = kapp->dcopClient(); - if(!client->isAttached())client->attach(); - QByteArray data; - QDataStream args(data,IO_WriteOnly); - args << 1; - client->send("kdesktop","KBackgroundIface","setExport(int)",data); - m_bUpdatePseudoTransparencyPending = true; - // Now wait a while and try again.... - QTimer::singleShot(500,this,SLOT(updatePseudoTransparency())); - return; - } - - if(!g_pKdeDesktopBackground->loadFromShared(QString("DESKTOP%1").arg(rinfo.currentDesktop()))) - { - debug("Can't load the KDE root background image..."); - delete g_pKdeDesktopBackground; - g_pKdeDesktopBackground = 0; - } //else { - // debug("Root pixmap downalod initiated"); - //} - } - - #endif //COMPILE_KDE_SUPPORT - - void KviApp::destroyPseudoTransparency() - { -#ifdef COMPILE_KDE_SUPPORT - if(g_pKdeDesktopBackground) - { - delete g_pKdeDesktopBackground; - g_pKdeDesktopBackground = 0; - } - // forget the backgroundChanged signal (will do nothing if it is not connected) - disconnect(this,SIGNAL(backgroundChanged(int)),this,SLOT(kdeRootPixmapChanged(int))); -#endif //COMPILE_KDE_SUPPORT - if(g_pShadedParentGlobalDesktopBackground) - { - delete g_pShadedParentGlobalDesktopBackground; - g_pShadedParentGlobalDesktopBackground = 0; - } - if(g_pShadedChildGlobalDesktopBackground) - { - delete g_pShadedChildGlobalDesktopBackground; - g_pShadedChildGlobalDesktopBackground = 0; - } - } - - void KviApp::triggerUpdatePseudoTransparency() - { - if(m_bUpdatePseudoTransparencyPending)return; - m_bUpdatePseudoTransparencyPending = true; - QTimer::singleShot(0,this,SLOT(updatePseudoTransparency())); - } - -#ifdef COMPILE_KDE_SUPPORT - - #define kimageeffect_fade KImageEffect::fade - -#else //!COMPILE_KDE_SUPPORT - - // - // This function is taken from the KDE kimageeffect.cpp - // The authors listed at the top of the file are :) - // Copyright (C) 1998, 1999 Christian Tibirna <ctibirna@total.net> - // (C) 1998, 1999 Daniel M. Duley <mosfet@kde.org> - // (C) 1998, 1999 Dirk A. Mueller <mueller@kde.org> - // (C) 2000 Josef Weidendorfer <weidendo@in.tum.de> - // - - QImage& kimageeffect_fade(QImage &img,float val,const QColor &color) - { - if(img.width() == 0 || img.height() == 0)return img; - - // We don't handle bitmaps - if (img.depth() == 1)return img; - - unsigned char tbl[256]; - for (int i=0; i<256; i++)tbl[i] = (int) (val * i + 0.5); - - int red = color.red(); - int green = color.green(); - int blue = color.blue(); - - QRgb col; - int r, g, b, cr, cg, cb; - - if (img.depth() <= 8) - { - // pseudo color - for(int i=0; i<img.numColors(); i++) - { - col = img.color(i); - cr = qRed(col); cg = qGreen(col); cb = qBlue(col); - if (cr > red)r = cr - tbl[cr - red]; - else r = cr + tbl[red - cr]; - if (cg > green)g = cg - tbl[cg - green]; - else g = cg + tbl[green - cg]; - if (cb > blue)b = cb - tbl[cb - blue]; - else b = cb + tbl[blue - cb]; - img.setColor(i, qRgb(r, g, b)); - } - } else { - // truecolor - for(int y=0; y<img.height(); y++) - { - QRgb *data = (QRgb *) img.scanLine(y); - for (int x=0; x<img.width(); x++) - { - col = *data; - cr = qRed(col); cg = qGreen(col); cb = qBlue(col); - if (cr > red)r = cr - tbl[cr - red]; - else r = cr + tbl[red - cr]; - if (cg > green)g = cg - tbl[cg - green]; - else g = cg + tbl[green - cg]; - if (cb > blue)b = cb - tbl[cb - blue]; - else b = cb + tbl[blue - cb]; - *data++ = qRgb(r, g, b); - } - } - } - return img; - } - -#endif //!COMPILE_KDE_SUPPORT - - void KviApp::createGlobalBackgrounds(QPixmap * pix) - { - // create shaded copies... - if(g_pShadedParentGlobalDesktopBackground)delete g_pShadedParentGlobalDesktopBackground; - if(g_pShadedChildGlobalDesktopBackground)delete g_pShadedChildGlobalDesktopBackground; - g_pShadedParentGlobalDesktopBackground = new QPixmap(); - g_pShadedChildGlobalDesktopBackground = new QPixmap(); - QImage img = pix->convertToImage(); - // play with the fade factors - KVI_OPTION_UINT(KviOption_uintGlobalTransparencyParentFadeFactor) %= 100; - if(KVI_OPTION_UINT(KviOption_uintGlobalTransparencyParentFadeFactor) > 0) - { - g_pShadedParentGlobalDesktopBackground->convertFromImage( - kimageeffect_fade(img, - (float)((float)KVI_OPTION_UINT(KviOption_uintGlobalTransparencyParentFadeFactor) / (float)100), - KVI_OPTION_COLOR(KviOption_colorGlobalTransparencyFade)),0); - } - KVI_OPTION_UINT(KviOption_uintGlobalTransparencyChildFadeFactor) %= 100; - if(KVI_OPTION_UINT(KviOption_uintGlobalTransparencyChildFadeFactor) > 0) - { - g_pShadedChildGlobalDesktopBackground->convertFromImage( - kimageeffect_fade(img, - (float)((float)KVI_OPTION_UINT(KviOption_uintGlobalTransparencyChildFadeFactor) / (float)100), - KVI_OPTION_COLOR(KviOption_colorGlobalTransparencyFade)),0); - } - if(g_pFrame)g_pFrame->updatePseudoTransparency(); - } - -#endif //COMPILE_PSEUDO_TRANSPARENCY - -void KviApp::kdeRootPixmapChanged(int iDesktop) -{ -#ifdef COMPILE_PSEUDO_TRANSPARENCY - #ifdef COMPILE_KDE_SUPPORT - if(!KVI_OPTION_BOOL(KviOption_boolUpdateKdeBackgroundOnChange))return; - NETRootInfo rinfo(qt_xdisplay(),NET::CurrentDesktop); - rinfo.activate(); - if(iDesktop == rinfo.currentDesktop()) - updatePseudoTransparency(); - #endif -#endif //COMPILE_PSEUDO_TRANSPARENCY -} - -void KviApp::kdeRootPixmapDownloadComplete(bool bSuccess) -{ -#ifdef COMPILE_PSEUDO_TRANSPARENCY - #ifdef COMPILE_KDE_SUPPORT - if(!bSuccess) - { - debug("Failed to download the KDE root background image..."); - } else { - // downloaded! - // create shaded copies... - createGlobalBackgrounds(g_pKdeDesktopBackground); - // make sure that this signal is not connected twice - disconnect(this,SIGNAL(backgroundChanged(int)),this,SLOT(kdeRootPixmapChanged(int))); - // connect it - connect(this,SIGNAL(backgroundChanged(int)),this,SLOT(kdeRootPixmapChanged(int))); - } - delete g_pKdeDesktopBackground; - g_pKdeDesktopBackground = 0; - #endif //COMPILE_KDE_SUPPORT -#endif //COMPILE_PSEUDO_TRANSPARENCY -} - - -void KviApp::updatePseudoTransparency() -{ -#ifdef COMPILE_PSEUDO_TRANSPARENCY - m_bUpdatePseudoTransparencyPending = false; - if(KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency)) - { -#ifdef COMPILE_KDE_SUPPORT - if(KVI_OPTION_BOOL(KviOption_boolObtainGlobalBackgroundFromKde)) - { - downloadKdeRootPixmap(); - } else { -#endif //COMPILE_KDE_SUPPORT - if(KVI_OPTION_PIXMAP(KviOption_pixmapGlobalTransparencyBackground).pixmap()) - { - createGlobalBackgrounds(KVI_OPTION_PIXMAP(KviOption_pixmapGlobalTransparencyBackground).pixmap()); - } else { - destroyPseudoTransparency(); - KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency) = false; - } -#ifdef COMPILE_KDE_SUPPORT - } -#endif //COMPILE_KDE_SUPPORT - } else { - destroyPseudoTransparency(); - if(g_pFrame)g_pFrame->updatePseudoTransparency(); - } -#endif //COMPILE_PSEUDO_TRANSPARENCY -} - - -void KviApp::triggerUpdateGui() -{ - if(m_bUpdateGuiPending)return; - m_bUpdateGuiPending = true; - QTimer::singleShot(0,this,SLOT(updateGui())); -} - -void KviApp::updateGui() -{ - m_bUpdateGuiPending = false; - g_pFrame->applyOptions(); -} - -void KviApp::updateApplicationFont() -{ - if(KVI_OPTION_BOOL(KviOption_boolUseGlobalApplicationFont)) - { - if(font() != KVI_OPTION_FONT(KviOption_fontApplication)) - setFont(KVI_OPTION_FONT(KviOption_fontApplication),true); - } - // FIXME: #warning "And what if this option is turned off ?...a reboot only" -} - -void KviApp::loadRecentEntries() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_RECENT); - KviConfig cfg(tmp,KviConfig::Read); - *g_pRecentTopicList = cfg.readStringListEntry("RecentTopicList",QStringList()); - //*g_pBookmarkList = cfg.readStringListEntry("Bookmarks",QStringList()); -} -void KviApp::saveRecentEntries() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_RECENT); - KviConfig cfg(tmp,KviConfig::Write); - cfg.writeEntry("RecentTopicList",*g_pRecentTopicList); - //cfg.writeEntry("Bookmarks",*g_pBookmarkList); -} - -void KviApp::saveAvatarCache() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_AVATARCACHE); - KviAvatarCache::instance()->save(tmp); -} - - -void KviApp::saveToolBars() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_CUSTOMTOOLBARS); - KviCustomToolBarManager::instance()->save(tmp); -} - -void KviApp::savePopups() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_POPUPS); - KviKvs::savePopups(tmp); -} - -void KviApp::saveInputHistory() -{ - if(!KVI_OPTION_BOOL(KviOption_boolDisableInputHistory)) - { - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_INPUTHISTORY); - g_pInputHistory->save(tmp); - } -} - - -void KviApp::saveAliases() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_ALIASES); - KviKvs::saveAliases(tmp); -} - -void KviApp::saveScriptAddons() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_SCRIPTADDONS); - KviKvs::saveScriptAddons(tmp); -} - -void KviApp::saveTextIcons() -{ - g_pTextIconManager->save(); -} - -void KviApp::saveAppEvents() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_EVENTS); - KviKvs::saveAppEvents(tmp); -} - -void KviApp::saveRawEvents() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_RAWEVENTS); - KviKvs::saveRawEvents(tmp); -} - -void KviApp::saveMediaTypes() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_MEDIATYPES); - g_pMediaManager->lock(); - g_pMediaManager->save(tmp); - g_pMediaManager->unlock(); -} - -void KviApp::saveIrcServerDataBase() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_SERVERDB); - g_pIrcServerDataBase->save(tmp); -} - -void KviApp::saveProxyDataBase() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_PROXYDB); - g_pProxyDataBase->save(tmp); -} - -void KviApp::saveRegisteredUsers() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_REGUSERDB); - g_pRegisteredUserDataBase->save(tmp); -} - -void KviApp::saveRegisteredChannels() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_REGCHANDB); - g_pRegisteredChannelDataBase->save(tmp); -} - -void KviApp::saveNickServ() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_NICKSERVDATABASE); - g_pNickServRuleSet->save(tmp); -} - -void KviApp::saveSharedFiles() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_SHAREDFILES); - g_pSharedFilesManager->save(tmp); -} - -void KviApp::saveActions() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_USERACTIONS); - KviActionManager::instance()->save(tmp); -} - -void KviApp::saveIdentities() -{ - QString tmp; - getLocalKvircDirectory(tmp,Config,KVI_CONFIGFILE_IDENTITIES); - KviUserIdentityManager::instance()->save(tmp); -} - -void KviApp::saveConfiguration() -{ - // this is NOT called when the application is closing down - KviCustomToolBarManager::instance()->storeVisibilityState(); - saveOptions(); - saveIdentities(); - saveActions(); - saveIrcServerDataBase(); - saveProxyDataBase(); - saveRecentEntries(); - saveAvatarCache(); - saveAppEvents(); - saveRawEvents(); - saveMediaTypes(); - saveRegisteredUsers(); - saveRegisteredChannels(); - saveNickServ(); - saveSharedFiles(); - savePopups(); - saveToolBars(); - saveAliases(); - saveTextIcons(); - saveInputHistory(); - saveScriptAddons(); - KviKvs::flushUserClasses(); - g_pWinPropertiesConfig->sync(); -} - -void KviApp::autoConnectToServers() -{ - KviPointerList<KviIrcServer> * l = g_pIrcServerDataBase->autoConnectOnStartupServers(); - if(l) - { - for(KviIrcServer * s = l->first();s;s = l->next()) - { - QString szCommand = "server -u \"id:"; - if(s->id().isEmpty())s->generateUniqueId(); - szCommand += s->id(); - szCommand += "\""; - KviKvsScript::run(szCommand,activeConsole()); - } - g_pIrcServerDataBase->clearAutoConnectOnStartupServers(); - } - - KviPointerList<KviIrcServerDataBaseRecord> * lr = g_pIrcServerDataBase->autoConnectOnStartupNetworks(); - if(lr) - { - for(KviIrcServerDataBaseRecord * r = lr->first();r;r = lr->next()) - { - QString szCommandx = "server -u \"net:"; - szCommandx += r->network()->name(); - szCommandx += "\""; - KviKvsScript::run(szCommandx,activeConsole()); - } - g_pIrcServerDataBase->clearAutoConnectOnStartupNetworks(); - } -} - - -void KviApp::createFrame() -{ - if(g_pFrame)debug("WARNING: Creating the main frame twice!"); - g_pFrame = new KviFrame(); - g_pFrame->createNewConsole(true); - - if(m_szExecAfterStartup.hasData()) - { - // FIXME , this should be a QString - KviKvsScript::run(m_szExecAfterStartup.ptr(),g_pFrame->firstConsole()); - m_szExecAfterStartup = ""; - } - - // auto connect to servers if needed - if(g_pIrcServerDataBase->autoConnectOnStartupServers() || g_pIrcServerDataBase->autoConnectOnStartupNetworks()) - { - autoConnectToServers(); - } - - if(KVI_OPTION_BOOL(KviOption_boolShowDockExtension)) - g_pFrame->executeInternalCommand(KVI_INTERNALCOMMAND_DOCKWIDGET_SHOW); - - if(KVI_OPTION_BOOL(KviOption_boolStartupMinimized)) - { - if(KVI_OPTION_BOOL(KviOption_boolMinimizeInTray) && KVI_OPTION_BOOL(KviOption_boolShowDockExtension)) - { - g_pFrame->hide(); - } else { - g_pFrame->showMinimized(); - } - } else { - g_pFrame->show(); - } -} - -void KviApp::destroyFrame() -{ - if(g_pFrame)delete g_pFrame; - g_pActiveWindow = 0; - quit(); -} - -bool KviApp::connectionExists(KviIrcConnection *cnn) -{ - KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict); - - while(it.current()) - { - if(it.current()->connection() == cnn)return true; - ++it; - } - return false; -} - - -bool KviApp::windowExists(KviWindow *wnd) -{ - KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict); - - while(it.current()) - { - if(it.current() == wnd)return true; - ++it; - } - return false; -} - -unsigned int KviApp::windowCount() -{ - return g_pGlobalWindowDict->count(); -} - -KviConsole * KviApp::findConsole(QString &server,QString &nick) -{ - KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict); - - while(it.current()) - { - if(it.current()->type() == KVI_WINDOW_TYPE_CONSOLE) - { - if(((KviConsole *)it.current())->isConnected()) - { - if(!server.isEmpty()) - { - if(KviQString::equalCI(server, - ((KviConsole *)it.current())->connection()->currentServerName())) - { - if(!nick.isEmpty()) - { - if(KviQString::equalCI(nick, - ((KviConsole *)it.current())->connection()->currentNickName())) - return ((KviConsole *)it.current()); - } else return ((KviConsole *)it.current()); - } - } else { - if(!nick.isEmpty()) - { - if(KviQString::equalCI(nick, - ((KviConsole *)it.current())->connection()->currentNickName())) - return ((KviConsole *)it.current()); - } - } - } - } - ++it; - } - return 0; -} - -KviConsole * KviApp::findConsole(KviStr &server,KviStr &nick) -{ - // DEPRECATED: TO BE KILLED (if nobody is using it) - QString s = server.ptr(); - QString n = nick.ptr(); - return findConsole(s,n); -} - -void KviApp::restartLagMeters() -{ - KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict); - - while(it.current()) - { - if(it.current()->type() == KVI_WINDOW_TYPE_CONSOLE) - { - if(((KviConsole *)it.current())->connection()) - ((KviConsole *)it.current())->connection()->restartLagMeter(); - } - ++it; - } -} - -void KviApp::restartNotifyLists() -{ - KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict); - - while(it.current()) - { - if(it.current()->type() == KVI_WINDOW_TYPE_CONSOLE) - { - if(((KviConsole *)it.current())->connection()) - ((KviConsole *)it.current())->connection()->restartNotifyList(); - } - ++it; - } -} - -void KviApp::resetAvatarForMatchingUsers(KviRegisteredUser * u) -{ - KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict); - - while(it.current()) - { - if(it.current()->type() == KVI_WINDOW_TYPE_CONSOLE) - { - ((KviConsole *)it.current())->resetAvatarForMatchingUsers(u); - } - ++it; - } -} - -KviConsole * KviApp::findConsole(unsigned int ircContextId) -{ - KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict); - - while(it.current()) - { - if(it.current()->type() == KVI_WINDOW_TYPE_CONSOLE) - { - if(((KviConsole *)it.current())->ircContextId() == ircContextId) - return ((KviConsole *)it.current()); - } - ++it; - } - return 0; -} - - - -KviConsole * KviApp::topmostConnectedConsole() -{ - // check the foreground window console - - KviConsole * c = activeConsole(); - if(!c)return 0; - if(c->isConnected())return c; - - // try ANY connected console - - KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict); - - while(it.current()) - { - if(it.current()->type() == KVI_WINDOW_TYPE_CONSOLE) - { - if(((KviConsole *)it.current())->isConnected())return (KviConsole *)(it.current()); - } - ++it; - } - - return 0; -} - -KviWindow * KviApp::findWindow(const char * windowId) -{ - return g_pGlobalWindowDict->find(windowId); -} - -KviWindow * KviApp::findWindowByCaption(const QString &windowCaption,int iContextId) -{ - KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict); - - while(it.current()) - { - if(KviQString::equalCI(windowCaption,it.current()->plainTextCaption()) && - (iContextId==-1 || it.current()->context()->id() == iContextId)) - return it.current(); - ++it; - } - return 0; -} - -void KviApp::registerWindow(KviWindow *wnd) -{ - g_pGlobalWindowDict->insert(wnd->id(),wnd); -} - -void KviApp::unregisterWindow(KviWindow *wnd) -{ - g_pGlobalWindowDict->remove(wnd->id()); -} - - -KviConsole * KviApp::activeConsole() -{ - if(!g_pFrame)return 0; - if(g_pActiveWindow) - { - if(g_pActiveWindow->console())return g_pActiveWindow->console(); - } - return g_pFrame->firstConsole(); -} - - -/////////////////// RECENT STUFF LISTS & POPUPS HANDLING - -// Helper for KviApp::addRecent*() -static void merge_to_stringlist_option(const QString &item,int iOption,int iMaxEntries) -{ - for(QStringList::Iterator it = KVI_OPTION_STRINGLIST(iOption).begin(); - it != KVI_OPTION_STRINGLIST(iOption).end(); ++it) - { - // Do a case-insensitive search (for nicknames, servers, and channels) - if(!QString::compare(item.lower(),(*it).lower())) - { - // In the recent list, remove and put as first so more recent items - // are always first - it = KVI_OPTION_STRINGLIST(iOption).remove(it); - --it; - } - } - while(KVI_OPTION_STRINGLIST(iOption).count() >= (unsigned int)iMaxEntries) - { - KVI_OPTION_STRINGLIST(iOption).remove(KVI_OPTION_STRINGLIST(iOption).fromLast()); - } - KVI_OPTION_STRINGLIST(iOption).prepend(item); -} - -void KviApp::addRecentUrl(const QString& text) -{ - merge_to_stringlist_option(text,KviOption_stringlistRecentIrcUrls,50); - emit(recentUrlsChanged()); -} - -void KviApp::addRecentNickname(const char * newNick) -{ - QString nk(newNick); - merge_to_stringlist_option(nk,KviOption_stringlistRecentNicknames,KVI_MAX_RECENT_NICKNAMES); -} - -void KviApp::addRecentNickname(const QString& newNick) -{ - merge_to_stringlist_option(newNick,KviOption_stringlistRecentNicknames,KVI_MAX_RECENT_NICKNAMES); -} - -void KviApp::addRecentChannel(const QString& szChan,const QString& net) -{ - if(!m_pRecentChannelsDict) - buildRecentChannels(); - QStringList* pList=m_pRecentChannelsDict->find(net.utf8().data()); - if(pList) - { - if(!pList->contains(szChan)) pList->append(szChan); - } - else - { - pList=new QStringList(szChan); - m_pRecentChannelsDict->insert(net.utf8().data(),pList); - } -} - -void KviApp::buildRecentChannels() -{ - if(m_pRecentChannelsDict) - delete m_pRecentChannelsDict; - m_pRecentChannelsDict = new KviPointerHashTable<const char *,QStringList>; - m_pRecentChannelsDict->setAutoDelete(TRUE); - QString szChan,szNet; - for ( - QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistRecentChannels).begin(); - it != KVI_OPTION_STRINGLIST(KviOption_stringlistRecentChannels).end(); - ++it - ) - { - if(!(*it).isEmpty()) - { - szChan = (*it).section( KVI_RECENT_CHANNELS_SEPARATOR, 0, 0 ); - szNet = (*it).section( KVI_RECENT_CHANNELS_SEPARATOR, 1 ); - if(!szNet.isEmpty()) - { - QStringList* pList=m_pRecentChannelsDict->find(szNet.utf8().data()); - if(pList) - { - if(!pList->contains(szChan)) pList->append(szChan); - } - else - { - pList=new QStringList(szChan); - m_pRecentChannelsDict->insert(szNet.utf8().data(),pList); - } - } - } - } -} - -void KviApp::saveRecentChannels() -{ - if(!m_pRecentChannelsDict) return; - QString szTmp; - KVI_OPTION_STRINGLIST(KviOption_stringlistRecentChannels).clear(); - KviPointerHashTableIterator<const char *,QStringList> it( *m_pRecentChannelsDict ); - for( ; it.current(); ++it ) - { - for ( QStringList::Iterator it_str = it.current()->begin(); it_str != it.current()->end(); ++it_str ) { - szTmp=*it_str; - szTmp.append(KVI_RECENT_CHANNELS_SEPARATOR); - szTmp.append(it.currentKey()); - KVI_OPTION_STRINGLIST(KviOption_stringlistRecentChannels).append(szTmp); - } - } -} - -QStringList* KviApp::getRecentChannels(const QString& net) -{ - if(!m_pRecentChannelsDict) buildRecentChannels(); - return m_pRecentChannelsDict->find(net.utf8().data()); -} - - -void KviApp::addRecentServer(const QString& server) -{ - merge_to_stringlist_option(server,KviOption_stringlistRecentServers,KVI_MAX_RECENT_SERVERS); -} - -void KviApp::fillRecentServersPopup(KviTalPopupMenu * m) -{ -// FIXME: #warning "MAYBE DISABLE THE SERVERS THAT WE ARE ALREADY CONNECTED TO ?" - m->clear(); - for(QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers).begin(); it != KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers).end(); ++it) - { - m->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SERVER)),*it); - } -} - -void KviApp::fillRecentNicknamesPopup(KviTalPopupMenu * m,KviConsole * pConsole) -{ - m->clear(); - int id; - bool bAlreadyFound = false; - for(QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistRecentNicknames).begin(); it != KVI_OPTION_STRINGLIST(KviOption_stringlistRecentNicknames).end(); ++it) - { - id = m->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NICK)),*it); - if(!pConsole->isConnected())m->setItemEnabled(id,false); - else { - if(!bAlreadyFound) - { - bool bIsCurrent = KviQString::equalCS(pConsole->connection()->currentNickName(),*it); - m->setItemEnabled(id,!bIsCurrent); - if(bIsCurrent)bAlreadyFound = true; - } - } - } -} - -void KviApp::fillRecentChannelsPopup(KviTalPopupMenu * m,KviConsole * pConsole) -{ - m->clear(); - int id; - QStringList* pList=getRecentChannels(pConsole->currentNetworkName()); - if(pList) - { - for(QStringList::Iterator it = pList->begin(); it != pList->end(); ++it) - { - id = m->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)),*it); - if(!pConsole->isConnected())m->setItemEnabled(id,false); - else { - m->setItemEnabled(id,!(pConsole->connection()->findChannel(*it))); - } - } - } -} - - -/* -void KviApp::fillRecentServersListBox(KviTalListBox * l) -{ - l->clear(); - for(QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers).begin(); it != KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers).end(); ++it) - l->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SERVER)),*it); -} -*/ - - - - -bool KviApp::playFile(const char * filename,KviStr &error,KviWindow * w) -{ - g_pMediaManager->lock(); - KviMediaType * m = g_pMediaManager->findMediaType(filename); - if(m) - { - KviStr szCommandline = m->szCommandline; - KviStr szDescription = m->szDescription; - g_pMediaManager->unlock(); - if(szCommandline.hasData()) - { - KviKvsVariantList l; - l.append(new KviKvsVariant(QString(filename))); - - if(!KviKvsScript::run(szCommandline.ptr(),w ? w : g_pActiveWindow,&l)) - { - error.sprintf(__tr("The commandline for media type '%s' seems to be broken"),szDescription.ptr()); - return false; - } - } else { - error.sprintf(__tr("Media type of file %s matched to '%s' but no commandline specified"),filename,szDescription.ptr()); - return false; - } - } else { - g_pMediaManager->unlock(); - error.sprintf(__tr("No idea on how to play file %s (no media type match)"),filename); - return false; - } - return true; -} - -void KviApp::heartbeat(kvi_time_t tNow) -{ - if(g_pApp->topmostConnectedConsole()) - { - // FIXME: this has huge precision problems... - KVI_OPTION_UINT(KviOption_uintTotalConnectionTime)++; - } - - // the line below is an approximation of (tNow / 120) == 0 - // we don't need a really great precision here, so 128 is still ok - if(!(tNow & 0x7f)) - KviDoubleBuffer::heartbeat(); -} - -void KviApp::timerEvent(QTimerEvent *e) -{ - if(e->timerId() != m_iHeartbeatTimerId) - { - QObject::timerEvent(e); - return; - } - - // our heartbeat - - kvi_time_t tNow = kvi_unixTime(); - - heartbeat(tNow); -} - -// qvariant.h uses this , and it is included by the qt generated moc file for Qt >= 3.0.0 -#ifdef Bool - #undef Bool -#endif - - -#include "kvi_app.moc" diff --git a/3.4.0/src/kvirc/kernel/kvi_app.h b/3.4.0/src/kvirc/kernel/kvi_app.h deleted file mode 100644 index 62fd63d8ec..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_app.h +++ /dev/null @@ -1,344 +0,0 @@ -#ifndef _KVI_APP_H_ -#define _KVI_APP_H_ - -//============================================================================= -// -// File : kvi_app.h -// Creation date : Sun Jun 18 2000 12:40:00 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" -#include "kvi_qstring.h" -#include "kvi_tal_application.h" -#include "kvi_pointerlist.h" -#include "kvi_time.h" -#include "kvi_pointerhashtable.h" // ? - -#define KVI_RECENT_CHANNELS_SEPARATOR ":" - -#ifdef COMPILE_ON_WINDOWS - // The brain damaged MSVC compiler can't instantiate templates without this - #include "kvi_frame.h" - #include "kvi_window.h" -#else // !COMPILE_ON_WINDOWS - class KviFrame; - class KviWindow; -#endif // !COMPILE_ON_WINDOWS - -#ifndef COMPILE_NO_IPC - class KviIpcSentinel; -#endif // !COMPILE_NO_IPC - -class KviTalPopupMenu; -class QPixmap; -class KviTalListBox; -class QTextCodec; -class QDomElement; - -class KviConsole; -class KviConfig; -class KviRegisteredUser; -class KviIrcConnection; -class KviIrcServerDataBase; - -typedef struct _KviPendingAvatarChange -{ - KviConsole * pConsole; - QString szRemoteUrl; - QString szNick; - QString szUser; - QString szHost; -} KviPendingAvatarChange; - -#ifdef Unsorted - #undef Unsorted -#endif -#ifdef None - #undef None -#endif - -class KVIRC_API KviApp : public KviTalApplication -{ - friend class KviFrame; - friend class KviWindow; - friend class KviSetupWizard; // this resides in a module! - Q_OBJECT -public: - KviApp(int &argc,char ** argv); - ~KviApp(); - -protected: - // directories - QString m_szGlobalKvircDir; - QString m_szLocalKvircDir; - int m_iHeartbeatTimerId; - bool m_bFirstTimeRun; - KviWindow * m_pActiveWindow; - bool m_bUpdateGuiPending; - KviPointerList<KviPendingAvatarChange> * m_pPendingAvatarChanges; - bool m_bSetupDone; - KviPointerHashTable<const char *,QStringList> * m_pRecentChannelsDict; -#ifdef COMPILE_PSEUDO_TRANSPARENCY - bool m_bUpdatePseudoTransparencyPending; -#endif -#ifndef COMPILE_NO_IPC - KviIpcSentinel * m_pIpcSentinel; -#endif -public: - // setup stuff (accessed from kvi_main.cpp: consider private othwerise) - QString m_szConfigFile; // setup - bool m_bCreateConfig; // setup - KviStr m_szExecAfterStartup; - bool m_bShowSplashScreen; -public: - // FIXME: "Plugins" and "ConfigPlugins" should become "Modules" and "ConfigModules" - enum KvircSubdir - { - None, Pics, Config , - Help, HelpEN, HelpNoIntl, - Log, Incoming, Audio, - Scripts, Plugins, ConfigPlugins, - Trash, MsgColors, Charmaps, - Avatars, DefScript, License, - Modules, ConfigScripts, Filters, - Tmp, Locale, Themes, - Classes, SmallIcons, EasyPlugins - }; - -public: - - void getClipboardText(KviStr &buffer); - void setClipboardText(const KviStr &str); - - QString getClipboardText(); - void setClipboardText(const QString &str); - - - void collectGarbage(QObject * garbage); - - void destroyFrame(); - void setup(); // THIS SHOULD BE PRIVATE! (but is accessed from kvi_main.cpp) - -#ifndef COMPILE_NO_IPC - void ipcMessage(char * message); -#endif - - //static QTextCodec * defaultTextCodec(); - //static const char * defaultTextEncoding(); - - static int getGloballyUniqueId(); // returns an unique integer identifier across the application - - bool firstTimeRun(){ return m_bFirstTimeRun; }; - void setupBegin(); - void setupFinish(); - inline void emitRecentUrlsChanged() { emit(recentUrlsChanged()); }; - - // kvi_app.cpp (Saving options) - void saveIrcServerDataBase(); - void saveProxyDataBase(); - void saveRecentEntries(); - void saveAppEvents(); - void saveRawEvents(); - void saveMediaTypes(); - void saveRegisteredUsers(); - void saveSharedFiles(); - void savePopups(); - void saveAliases(); - void saveNickServ(); - void saveTextIcons(); - void saveRegisteredChannels(); - void saveInputHistory(); - void saveAvatarCache(); - void saveToolBars(); - void saveActions(); - void saveScriptAddons(); - void saveIdentities(); - - // kvi_options.cpp : Options saving and loading (kvi.main.conf)) - void loadOptions(); - void saveOptions(); - - void listAvailableOptions(KviWindow *wnd); - bool getOptionString(const char * optName,QString &buffer); - bool setOptionValue(const char * optName,const QString &value); - void optionResetUpdate(int flags); - - void contextSensitiveHelp(); - - // kvi_app_fs.cpp : Filesystem thingies - void getGlobalKvircDirectory(QString &szData,KvircSubdir dir,const QString &appendFile = QString::null); - void getGlobalKvircDirectory(KviStr &szData,KvircSubdir dir,const QString &appendFile = QString::null); - void getLocalKvircDirectory(KviStr &szData,KvircSubdir dir,const QString &appendFile = QString::null,bool bCreateIfNeeded = true); - void getLocalKvircDirectory(QString &szData,KvircSubdir dir,const QString &appendFile = QString::null,bool bCreateIfNeeded = true); - void getTmpFileName(QString &szBuffer,const QString &szEndingFileName = QString::null); - bool trashFile(const char *filename); - void getChannelDumpLogFileName(QString &str); - - static QTextCodec * defaultTextCodec(); - - // if the mediatype can be guessed ,it is looked up in the media type save path - // if found , true is returned - // if not found or the mediatype can't be guessed then false is returned - bool findFileByMediaType(KviStr &szRetPath,const char * filename); - - bool findImageInImageSearchPath(KviStr &szRetPath,const char * filename); - bool findImageInImageSearchPath(QString &szRetPath,const char * filename); - - bool findUserFile(KviStr &szRetPath,const char *filename); - - bool findImage(KviStr &szRetPath,const char *filename); - bool findImage(QString &szRetPath,const char *filename); - bool findImageThemeOnlyCompat(QString &szRetPath,const char *filename); // temporary compat, will be removed soon (do not use) - bool findSmallIcon(QString &szRetPath,const char *filename); - // tries to map the full path filename to one of the KVIrc's mapped directories - // if it doesn't succeed it just returns the complete filename in szRetPath - bool mapImageFile(KviStr &szRetPath,const char * filename); - bool mapImageFile(QString &szRetPath,const char * filename); - - //void getDefaultDccSaveFilePath(KviStr &path,const char *filename); - void completeDirectory(const QString &word,KviPointerList<QString> * matches); - // - // Returns a config path suitable for reading (at least) - // First lookups the user local config directory, - // if no config file is found, it earches in the global one - // returns false if no config file has been found - // If bNoFail is true, the buffer is filled with the file name even - // if no config file has been found: in this case the local config - // directory is used - // - bool getReadOnlyConfigPath(KviStr &buffer,const char *config_name,KvircSubdir sbd = Config,bool bNoFail = false); - bool getReadOnlyConfigPath(QString &buffer,const char *config_name,KvircSubdir sbd = Config,bool bNoFail = false); - - // kvi_app.cpp : Window stuff - KviWindow * findWindow(const char * windowId); - KviWindow * findWindowByCaption(const QString &windowCaption,int iContextId=-1); - KviConsole * findConsole(unsigned int ircContextId); - KviConsole * findConsole(KviStr & server,KviStr & nick); - KviConsole * findConsole(QString & servr,QString & nick); - KviConsole * topmostConnectedConsole(); - KviConsole * activeConsole(); - bool windowExists(KviWindow *wnd); - bool connectionExists(KviIrcConnection *cnn); - unsigned int windowCount(); - - // kvi_app.cpp : Utilities - void resetAvatarForMatchingUsers(KviRegisteredUser * u); - void restartNotifyLists(); - void restartLagMeters(); - void triggerUpdateGui(); -#ifdef COMPILE_PSEUDO_TRANSPARENCY - void triggerUpdatePseudoTransparency(); -#endif - - // kvi_app.cpp : DCC (and CTCP AVATAR & SOUND) related stuff - void setAvatarOnFileReceived(KviConsole * pConsole,const QString &szRemoteUrl,const QString &szNick,const QString &szUser,const QString &szHost); - KviPendingAvatarChange * findPendingAvatarChange(KviConsole * pConsole,const QString &szNick,const QString &szRemoteUrl); - void fileDownloadTerminated(bool bSuccess,const QString &szRemoteUrl,const QString &szLocalFileName,const QString &szNick = QString::null,const QString &szError = QString::null,bool bQuiet = false); - - void setAvatarFromOptions(); - - bool playFile(const char * filename,KviStr &error,KviWindow * w = 0); - - // uMessageLifetime is in seconds! and 0 means "forever" - void notifierMessage(KviWindow * pWnd,int iIconId,const QString &szMsg,unsigned int uMessageLifetime); - - - void addRecentNickname(const char * newNick); - void addRecentNickname(const QString& newNick); - void addRecentChannel(const QString& chan,const QString& net); - QStringList* getRecentChannels(const QString& net); - - void addRecentServer(const QString& server); - void fillRecentServersPopup(KviTalPopupMenu * m); - void fillRecentNicknamesPopup(KviTalPopupMenu * m,KviConsole * pConsole); - void fillRecentChannelsPopup(KviTalPopupMenu * m,KviConsole * pConsole); - - void autoConnectToServers(); - - void checkSuggestRestoreDefaultScript(); - - void loadDefaultScript(); -protected: - void buildRecentChannels(); - void saveRecentChannels(); - // kvi_app.cpp : KviWindow global database - void registerWindow(KviWindow *wnd); - void unregisterWindow(KviWindow *wnd); - void frameDestructorCallback(); - void heartbeat(kvi_time_t tNow); - virtual void timerEvent(QTimerEvent *e); -public slots: - // kvi_app.cpp : Slots - void saveConfiguration(); - void updateGui(); - void kdeRootPixmapDownloadComplete(bool bSuccess); - void kdeRootPixmapChanged(int iDesktop); - void updatePseudoTransparency(); - void restoreDefaultScript(); - void addRecentUrl(const QString& text); -private: - void createSplashScreen(); - void destroySplashScreen(); - - // kvi_app_setup.cpp : Setup stuff - void loadDirectories(); - void findGlobalKvircDirectory(); - bool findLocalKvircDirectory(); - bool checkGlobalKvircDirectory(const QString); - bool checkLocalKvircDirectory(const QString); - bool checkFileAssociations(); - void setupFileAssociations(); - - bool checkUriAssociations(char * proto); - void setupUriAssociations(char * proto); - - void saveKvircDirectory(); - - // kvi_app.cpp : GUI stuff - void updateApplicationFont(); - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - void createGlobalBackgrounds(QPixmap * pix); - void destroyPseudoTransparency(); - #ifdef COMPILE_KDE_SUPPORT - void downloadKdeRootPixmap(); - #endif //COMPILE_KDE_SUPPORT -#endif //COMPILE_PSEUDO_TRANSPARENCY -private: - // kvi_app.cpp : parts of setup() - void loadRecentEntries(); -#ifndef COMPILE_NO_IPC - void createIpcSentinel(); - void destroyIpcSentinel(); -#endif //!COMPILE_NO_IPC - void createFrame(); -signals: - void reloadImages(); - void recentUrlsChanged(); -}; - -#ifndef _KVI_APP_CPP_ - extern KVIRC_API KviApp * g_pApp; - extern KVIRC_API KviIrcServerDataBase * g_pIrcServerDataBase; -#endif - -#endif //_KVI_APP_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_app_fs.cpp b/3.4.0/src/kvirc/kernel/kvi_app_fs.cpp deleted file mode 100644 index 31309ddea1..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_app_fs.cpp +++ /dev/null @@ -1,723 +0,0 @@ -//============================================================================= -// -// File : kvi_app_fs.cpp -// Creation date : Thu Dec 24 1998 04:05:26 by Szymon Stefanek -// -// This file is part of the Kvirc irc client distribution -// Copyright (C) 1998-2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_debug.h" -#include "kvi_app.h" -#include "kvi_locale.h" -#include "kvi_fileutils.h" -#include "kvi_mediatype.h" -#include "kvi_env.h" -#include "kvi_time.h" -#include "kvi_options.h" -#include "kvi_defaults.h" -#include "kvi_iconmanager.h" - -#include <qdir.h> -#include <qfileinfo.h> -#include <qdatetime.h> - -extern KviMediaManager * g_pMediaManager; - -//============ getGlobalKvircDirectory ================// - -void KviApp::getGlobalKvircDirectory(QString &szData,KvircSubdir dir,const QString &appendFile) -{ - szData=m_szGlobalKvircDir; - KviQString::ensureLastCharIs(szData,KVI_PATH_SEPARATOR_CHAR); - - switch(dir) - { - case None : break; - case Pics : szData.append("pics"); break; - case Modules : - case Plugins : szData.append("modules"); break; - case EasyPlugins : szData.append("easyplugins"); break; - case ConfigPlugins : KviQString::appendFormatted(szData,"config%smodules",KVI_PATH_SEPARATOR); break; - case ConfigScripts : KviQString::appendFormatted(szData,"config%sscripts",KVI_PATH_SEPARATOR); break; - case Help : - szData.append("help"); - { - // Localized help - QString tmp(KviLocale::localeName().ptr()); - tmp.prepend(KVI_PATH_SEPARATOR_CHAR); - tmp.prepend(szData); - if(KviFileUtils::directoryExists(tmp))szData = tmp; - else { - tmp = szData; KviQString::appendFormatted(tmp,"%sen",KVI_PATH_SEPARATOR); - if(KviFileUtils::directoryExists(tmp))szData = tmp; - } - } - break; - case HelpEN : KviQString::appendFormatted(szData,"help%sen",KVI_PATH_SEPARATOR); break; - case HelpNoIntl : szData.append("help"); break; - case Log : debug("WARNING Global log directory requested!"); break; - case Incoming : debug("WARNING Global incoming directory requested!"); break; - case Trash : debug("WARNING Global trash directory requested!"); break; - case Config : szData.append("config"); break; - case Audio : szData.append("audio"); break; - case Scripts : szData.append("scripts"); break; - case MsgColors : szData.append("msgcolors"); break; - case Charmaps : szData.append("charmaps"); break; - case Avatars : szData.append("avatars"); break; - case DefScript : szData.append("defscript"); break; - case License : szData.append("license"); break; - case Filters : szData.append("filters"); break; - case Locale : szData.append("locale"); break; - case Tmp : debug("WARNING Global tmp directory requested!"); break; - case Themes : szData.append("themes"); break; - case Classes : szData.append("classes"); break; - case SmallIcons : szData.append("pics"KVI_PATH_SEPARATOR KVI_SMALLICONS_SUBDIRECTORY); break; - } - - if(!appendFile.isEmpty()) - { - KviQString::ensureLastCharIs(szData,KVI_PATH_SEPARATOR_CHAR); - szData.append(appendFile); - } - - KviFileUtils::adjustFilePath(szData); -} - -void KviApp::getLocalKvircDirectory(QString &szData,KvircSubdir dir,const QString & appendFile,bool bCreateIfNeeded) -{ - szData=m_szLocalKvircDir; - KviQString::ensureLastCharIs(szData,KVI_PATH_SEPARATOR_CHAR); - - switch(dir) - { - case None : break; - case Pics : szData.append("pics"); break; - case EasyPlugins : szData.append("easyplugins"); break; - case Config : szData.append("config"); break; - case ConfigPlugins : szData.append("config"KVI_PATH_SEPARATOR"modules"); break; - case ConfigScripts : szData.append("config"KVI_PATH_SEPARATOR"scripts"); break; - case Log : szData.append("log"); break; - case Incoming : - szData = KVI_OPTION_STRING(KviOption_stringIncomingPath); - // we should take special care here - // the user is likely to mess the path behind our back - // try to recover from most common problems - while(KviQString::lastCharIs(szData,KVI_PATH_SEPARATOR_CHAR)) - szData = szData.remove(szData.length()-1,1); - if(szData.isEmpty()) - { - // unset ? - KVI_OPTION_STRING(KviOption_stringIncomingPath) = QDir::homeDirPath(); - if(!KVI_OPTION_STRING(KviOption_stringIncomingPath).endsWith(QString(QChar(KVI_PATH_SEPARATOR_CHAR)))) - KVI_OPTION_STRING(KviOption_stringIncomingPath).append(KVI_PATH_SEPARATOR_CHAR); - KVI_OPTION_STRING(KviOption_stringIncomingPath).append(KVI_DEFAULT_INCOMING_SUBDIRECTORY_NAME); - } - break; - case Help : - szData.append("help"); - { - // Localized help - QString tmp = KviLocale::localeName().ptr(); - tmp.prepend(KVI_PATH_SEPARATOR_CHAR); - tmp.prepend(szData); - if(KviFileUtils::directoryExists(tmp))szData = tmp; - else { - tmp = szData; tmp.append(KVI_PATH_SEPARATOR"en"); - if(KviFileUtils::directoryExists(tmp))szData = tmp; - } - } - break; - case HelpEN : szData.append("help"KVI_PATH_SEPARATOR"en"); break; - case HelpNoIntl : szData.append("help"); break; - case Audio : szData.append("audio"); break; - case Scripts : szData.append("scripts"); break; - case Modules : - case Plugins : szData.append("modules"); break; - case Trash : szData.append("trash"); break; - case MsgColors : szData.append("msgcolors"); break; - case Charmaps : szData.append("charmaps"); break; - case Avatars : szData.append("avatars"); break; - case License : szData.append("license"); break; - case Filters : szData.append("filters"); break; - case Tmp : szData.append("tmp"); break; - case Locale : szData.append("locale"); break; - case Themes : szData.append("themes"); break; - case DefScript : szData.append("defscript"); /* should never happen! */ break; - case Classes : szData.append("classes"); break; - case SmallIcons : szData.append("pics"KVI_PATH_SEPARATOR KVI_SMALLICONS_SUBDIRECTORY); break; - } - if(bCreateIfNeeded)KviFileUtils::makeDir(szData); - - if(!appendFile.isEmpty()) - { - KviQString::ensureLastCharIs(szData,KVI_PATH_SEPARATOR_CHAR); - szData.append(appendFile); - } - - KviFileUtils::adjustFilePath(szData); -} - - -void KviApp::getGlobalKvircDirectory(KviStr &szData,KvircSubdir dir,const QString &appendFile) -{ - QString szBuffer = szData.ptr(); - getGlobalKvircDirectory(szBuffer,dir,appendFile); - szData=szBuffer; - -} - -//=============== getLocalKvircDirectory ================// - -void KviApp::getLocalKvircDirectory(KviStr &szData,KvircSubdir dir,const QString &appendFile,bool bCreateIfNeeded) -{ - QString szBuffer = szData.ptr(); - getLocalKvircDirectory(szBuffer,dir,appendFile,bCreateIfNeeded); - szData=szBuffer; -} - -void KviApp::getTmpFileName(QString &szBuffer,const QString &szEndingFileName) -{ - QString tmp; - getLocalKvircDirectory(tmp,Tmp); - KviQString::ensureLastCharIs(tmp,KVI_PATH_SEPARATOR_CHAR); - - struct timeval tmv; - kvi_gettimeofday(&tmv,0); - - QString szFileName = szEndingFileName.isNull() ? QString("file.tmp") : szEndingFileName; - do { - szBuffer = tmp; - KviQString::appendFormatted(szBuffer,"kvirc_%d_%Q",tmv.tv_usec,&szFileName); - tmv.tv_usec++; - } while(KviFileUtils::fileExists(szBuffer)); -} - -//====================== trashFile ====================// -// -// Moves a file to the local trash directory -// - -bool KviApp::trashFile(const char *filename) -{ - // Exists ? - QFileInfo fi = QFileInfo(QString::fromUtf8(filename)); - if( !fi.exists() ) return false; // nothing to trash - - // Build the filename - KviStr lastPart = filename; - lastPart.cutToLast(KVI_PATH_SEPARATOR_CHAR); // need only the filename - lastPart.append(".bak_"); - QDateTime tm(QDateTime::currentDateTime()); - lastPart.append(tm.toString()); - lastPart.replaceAll(' ',"_"); - // Ok...have lastPart.bak_Dec_11_31_1999 - // Find the thrash directory (make it if necessary) - KviStr trashFile; - getLocalKvircDirectory(trashFile,Trash,lastPart.ptr(),true); - // Check if a such file already exists - fi.setFile(trashFile.ptr()); - while(fi.exists()) - { - trashFile.append(".rnm"); - fi.setFile(trashFile.ptr()); - } - // rename the file - return KviFileUtils::renameFile(filename,trashFile.ptr()); -} - -void KviApp::completeDirectory(const QString &word,KviPointerList<QString> * matches) -{ - QString szDir = word; - QString szFile = word; - KviQString::cutToLast(szFile,KVI_PATH_SEPARATOR_CHAR); - KviQString::cutFromLast(szDir,KVI_PATH_SEPARATOR_CHAR); - KviFileUtils::adjustFilePath(szDir); - KviQString::ensureLastCharIs(szDir,KVI_PATH_SEPARATOR_CHAR); - QDir d(szDir); - - // FIXME: maybe check timestamps ? (old modules) - QStringList sl = d.entryList(QDir::Dirs); - QStringList::Iterator it; - - for(it = sl.begin();it != sl.end();++it) - { - QString * t = new QString(*it); - if(KviQString::equalCS(*t,".") || KviQString::equalCS(*t,"..")) - { - delete t; - } else { -#ifdef COMPILE_ON_WINDOWS - if(KviQString::equalCIN(szFile,*t,szFile.length())) -#else //!COMPILE_ON_WINDOWS - if(KviQString::equalCSN(szFile,*t,szFile.length())) -#endif //COMPILE_ON_WINDOWS - { - t->prepend(szDir); - t->append(KVI_PATH_SEPARATOR_CHAR); - matches->append(t); - } else { - delete t; - } - } - } - - sl = d.entryList(QDir::Files); - - for(it = sl.begin();it != sl.end();++it) - { - QString * t = new QString(*it); -#ifdef COMPILE_ON_WINDOWS - if(KviQString::equalCIN(szFile,*t,szFile.length())) -#else //!COMPILE_ON_WINDOWS - if(KviQString::equalCSN(szFile,*t,szFile.length())) -#endif //COMPILE_ON_WINDOWS - { - t->prepend(szDir); - matches->append(t); - } else { - delete t; - } - } -} - - -//============= getChannelDumpLogFileName ==============// -// -// Returns a valid filename for the channel dump log -// - -void KviApp::getChannelDumpLogFileName(QString &str) -{ - unsigned int logN = 0; - QString fPrefix="kick_"; - do{ - QString fName; - KviQString::sprintf(fName,"%Q%u.log",&fPrefix,logN); - getLocalKvircDirectory(str,Log,fName); - logN++; - if(logN > 9999) - { - // Time to clear logs! :) - fPrefix+="x"; - logN = 0; - } - } while(KviFileUtils::fileExists(str)); - KviFileUtils::adjustFilePath(str); -} - -bool KviApp::findFileByMediaType(KviStr &szRetPath,const char * filename) -{ - g_pMediaManager->lock(); - KviMediaType * m = g_pMediaManager->findMediaType(filename,false); - - if(m) - { - if(m->szSavePath.hasData()) - { - szRetPath = m->szSavePath; - szRetPath.ensureLastCharIs(KVI_PATH_SEPARATOR_CHAR); - szRetPath.append(filename); - if(KviFileUtils::fileExists(szRetPath.ptr())) - { - // check again the media type... check the magic too - KviMediaType * mt = g_pMediaManager->findMediaType(szRetPath.ptr()); - if(mt == m) - { - g_pMediaManager->unlock(); - //if(retMediaType)*retMediaType = mt; - QString szTmp = szRetPath.ptr(); // FIXME - KviFileUtils::adjustFilePath(szTmp); - szRetPath = szTmp; - return true; - } // else mime type not matched...we should not be looking there! - } - } - } - - g_pMediaManager->unlock(); - return false; -} - -//===================== findUserFile =====================// -// -// Looks for an user file in the standard directories -// - -bool KviApp::findUserFile(KviStr &szRetPath,const char *filename) -{ - static KviApp::KvircSubdir localsubdirs[5]={ Avatars , Incoming , Pics , Audio , Log }; - static KviApp::KvircSubdir globalsubdirs[3]={ Avatars , Pics , Audio }; - - // Absolute paths can not be "found"... they are obvious - if(kvi_isAbsolutePath(filename)) - { - szRetPath=filename; - QString szTmp = szRetPath.ptr(); // FIXME - KviFileUtils::adjustFilePath(szTmp); - szRetPath = szTmp; - return KviFileUtils::fileExists(filename); - } - - // FIXME: #warning "Use the user defined path ?" - - // lookup the magic by name match only... - - if(findFileByMediaType(szRetPath,filename))return true; - - int i; - - for(i= 0;i<5; i++) - { - getLocalKvircDirectory(szRetPath,localsubdirs[i],filename); - if(KviFileUtils::fileExists(szRetPath.ptr()))return true; - } - - for(i= 0;i<3; i++) - { - getGlobalKvircDirectory(szRetPath,globalsubdirs[i],filename); - if(KviFileUtils::fileExists(szRetPath.ptr()))return true; - } - - if(findImageInImageSearchPath(szRetPath,filename))return true; - - // Last resort ... - szRetPath = QDir::homeDirPath(); - szRetPath.ensureLastCharIs(KVI_PATH_SEPARATOR_CHAR); - szRetPath.append(filename); - if(KviFileUtils::fileExists(szRetPath.ptr()))return true;; - - szRetPath = filename; - //if(retMediaType)*retMediaType = m; - return false; - -//gotit: - //if(retMediaType)*retMediaType = g_pMediaManager->findMediaType(szRetPath.ptr()); -// return true; -} - -//========================= findImage ===========================// -// -// Find a file inside the default "Image" directories -// This should be thread safe (and in fact IS used by other threads) -// This function should be used only for finding the INTERNAL -// pixmaps... (so we expect them to be in the pics directory or -// Eventually in user's $HOME -// - -// FIXME: #warning "Check WHEN findImage is used and when findUserFile is used...we have a mess here" - -bool KviApp::findImageInImageSearchPath(KviStr &szRetPath,const char * filename) -{ - // first lookup the user defined paths - for(QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistImageSearchPaths).begin(); - it != KVI_OPTION_STRINGLIST(KviOption_stringlistImageSearchPaths).end();++it) - { - szRetPath = *it; - szRetPath.ensureLastCharIs(KVI_PATH_SEPARATOR_CHAR); - szRetPath.append(filename); - //debug("LOOK FOR %s",szRetPath.ptr()); - if(KviFileUtils::fileExists(szRetPath.ptr()))return true; - } - - return false; -} - -bool KviApp::findImageInImageSearchPath(QString &szRetPath,const char * filename) -{ - // first lookup the user defined paths - for(QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistImageSearchPaths).begin(); - it != KVI_OPTION_STRINGLIST(KviOption_stringlistImageSearchPaths).end();++it) - { - szRetPath = *it; - KviQString::ensureLastCharIs(szRetPath,KVI_PATH_SEPARATOR_CHAR); - szRetPath.append(filename); - //debug("LOOK FOR %s",szRetPath.ptr()); - if(KviFileUtils::fileExists(szRetPath))return true; - } - - return false; -} - -static KviApp::KvircSubdir pics_localsubdirs[2]={ KviApp::Pics , KviApp::Avatars }; -static KviApp::KvircSubdir pics_globalsubdirs[2]={ KviApp::Pics , KviApp::Avatars }; - -bool KviApp::mapImageFile(KviStr &szRetPath,const char * filename) -{ - QString buff; - bool ret=mapImageFile(buff,filename); - szRetPath=buff; - return ret; -} - -bool KviApp::mapImageFile(QString &szRetPath,const char * filename) -{ - szRetPath = filename; - // can't map non absolute paths - if(!kvi_isAbsolutePath(filename))return false; - // can't map non existing paths - if(!KviFileUtils::fileExists(filename))return false; - - QFileInfo fi = QFileInfo(QString::fromUtf8(filename)); - - unsigned int size = fi.size(); - - KviStr szBestMatch; - - while(szRetPath.find(KVI_PATH_SEPARATOR) != -1) - { - KviQString::cutToFirst(szRetPath,KVI_PATH_SEPARATOR); - - if(szRetPath.isEmpty())break; - - KviStr szBuffer; - - int i; - - for(i=0;i<2;i++) - { - getLocalKvircDirectory(szBuffer,pics_localsubdirs[i],szRetPath); - if(KviFileUtils::fileExists(szBuffer.ptr())) - { - QFileInfo fi2(QString::fromUtf8(szBuffer.ptr())); - if(size == fi2.size()) - { - // probably the same file - szBestMatch = szRetPath; - } - } - } - - for(i=0;i<2;i++) - { - getGlobalKvircDirectory(szBuffer,pics_globalsubdirs[i],szRetPath); - //debug("CHECK %s",szBuffer.ptr()); - if(KviFileUtils::fileExists(szBuffer.ptr())) - { - QFileInfo fi2(QString::fromUtf8(szBuffer.ptr())); - if(size == fi2.size()) - { - // probably the same file - szBestMatch = szRetPath; - } - } - } - - // Last resort - szBuffer = QDir::homeDirPath(); - szBuffer.ensureLastCharIs(KVI_PATH_SEPARATOR_CHAR); - szBuffer.append(szRetPath); - if(KviFileUtils::fileExists(szBuffer.ptr())) - { - QFileInfo fi2(QString::fromUtf8(szBuffer.ptr())); - if(size == fi2.size()) - { - // prolly the same file - szBestMatch = szRetPath; - } - } - } - - if(szBestMatch.hasData()) - { - szRetPath = szBestMatch; - return true; - } - - - // no way to map it :/ - szRetPath = filename; - return false; -} - - -bool KviApp::findImage(KviStr &szRetPath,const char *filename) -{ - QString buff; - bool ret=findImage(buff,filename); - szRetPath=buff; - return ret; -} - -bool KviApp::findImage(QString &szRetPath,const char *filename) -{ - // Find an user file... - if(kvi_isAbsolutePath(filename)) - { - szRetPath=filename; - return KviFileUtils::fileExists(filename); - } - - // if we have a theme, look it up as first - if(!KVI_OPTION_STRING(KviOption_stringIconThemeSubdir).isEmpty()) - { - QString szTmp = KVI_OPTION_STRING(KviOption_stringIconThemeSubdir); - szTmp.append(KVI_PATH_SEPARATOR_CHAR); - szTmp.append(filename); - - getLocalKvircDirectory(szRetPath,KviApp::Themes,szTmp); - if(KviFileUtils::fileExists(szRetPath))return true; - - getGlobalKvircDirectory(szRetPath,KviApp::Themes,szTmp); - if(KviFileUtils::fileExists(szRetPath))return true; - } - - int i; - - for(i=0;i<2;i++) - { - getLocalKvircDirectory(szRetPath,pics_localsubdirs[i],filename); - if(KviFileUtils::fileExists(szRetPath))return true; - } - - for(i=0;i<2;i++) - { - getGlobalKvircDirectory(szRetPath,pics_globalsubdirs[i],filename); - if(KviFileUtils::fileExists(szRetPath))return true; - } - - if(findImageInImageSearchPath(szRetPath,filename))return true; - - // Last resort - szRetPath = QDir::homeDirPath(); - KviQString::ensureLastCharIs(szRetPath,KVI_PATH_SEPARATOR_CHAR); - szRetPath.append(filename); - if(KviFileUtils::fileExists(szRetPath))return true; - - szRetPath = filename; - - return false; -} - -bool KviApp::findImageThemeOnlyCompat(QString &szRetPath,const char *filename) -{ - // if we have a theme, look it up as first - if(!KVI_OPTION_STRING(KviOption_stringIconThemeSubdir).isEmpty()) - { - QString szTmp = KVI_OPTION_STRING(KviOption_stringIconThemeSubdir); - szTmp.append(KVI_PATH_SEPARATOR_CHAR); - szTmp.append(filename); - - getLocalKvircDirectory(szRetPath,KviApp::Themes,szTmp); - if(KviFileUtils::fileExists(szRetPath))return true; - - getGlobalKvircDirectory(szRetPath,KviApp::Themes,szTmp); - if(KviFileUtils::fileExists(szRetPath))return true; - } - - getLocalKvircDirectory(szRetPath,KviApp::Pics,filename); - if(KviFileUtils::fileExists(szRetPath))return true; - - - if(findImageInImageSearchPath(szRetPath,filename))return true; - - szRetPath = filename; - - return false; -} - -bool KviApp::findSmallIcon(QString &szRetPath,const char *filename) -{ - // this is a bit optimized for the small builtin icons - // looks up less places. - - //if(kvi_isAbsolutePath(filename)) - //{ - // BUG!.. we should never - //szRetPath=filename; - //return KviFileUtils::fileExists(filename); - //} - - // if we have a theme, look it up as first - if(!KVI_OPTION_STRING(KviOption_stringIconThemeSubdir).isEmpty()) - { - QString szTmp = KVI_OPTION_STRING(KviOption_stringIconThemeSubdir); - szTmp.append(KVI_PATH_SEPARATOR_CHAR); - szTmp.append(KVI_SMALLICONS_SUBDIRECTORY); - szTmp.append(KVI_PATH_SEPARATOR_CHAR); - szTmp.append(filename); - - getLocalKvircDirectory(szRetPath,KviApp::Themes,szTmp); - if(KviFileUtils::fileExists(szRetPath))return true; - - getGlobalKvircDirectory(szRetPath,KviApp::Themes,szTmp); - if(KviFileUtils::fileExists(szRetPath))return true; - } - - int i; - - // unlikely - getLocalKvircDirectory(szRetPath,KviApp::SmallIcons,filename); - if(KviFileUtils::fileExists(szRetPath))return true; - - getLocalKvircDirectory(szRetPath,KviApp::Pics,filename); - if(KviFileUtils::fileExists(szRetPath))return true; - - // likely - getGlobalKvircDirectory(szRetPath,KviApp::SmallIcons,filename); - if(KviFileUtils::fileExists(szRetPath))return true; - - if(findImageInImageSearchPath(szRetPath,filename))return true; - - // Last resort... bleah :/ - szRetPath = QDir::homeDirPath(); - KviQString::ensureLastCharIs(szRetPath,KVI_PATH_SEPARATOR_CHAR); - szRetPath.append(filename); - if(KviFileUtils::fileExists(szRetPath))return true; - - szRetPath = filename; - - return false; -} - - -//================== getReadOnlyConfigPath ====================// -// -// We want to READ a config file...find it -// - -bool KviApp::getReadOnlyConfigPath(KviStr &buffer,const char *config_name,KvircSubdir sbd,bool bNoFail) -{ - // DEPRECATED - QString tmp; - bool bRet = getReadOnlyConfigPath(tmp,config_name,sbd,bNoFail); - buffer = tmp; - return bRet; -} - -bool KviApp::getReadOnlyConfigPath(QString &buffer,const char *config_name,KvircSubdir sbd,bool bNoFail) -{ - // Take a look in the local directory.... - getLocalKvircDirectory(buffer,sbd,config_name); - //debug("%s %s %i |%s| %i",__FILE__,__FUNCTION__,__LINE__,buffer.ptr(),KviFileUtils::fileExists(buffer.ptr())); - if(!KviFileUtils::fileExists(buffer)) - { - // No saved config yet... check for defaults - QString tmp; - getGlobalKvircDirectory(tmp,sbd,config_name); - if(!KviFileUtils::fileExists(tmp)) - { - // No defaults...no such config file at all. - if(bNoFail)getLocalKvircDirectory(buffer,sbd,config_name); - return false; - } else buffer = tmp; // get the defaults this time - } // else file exists... - return true; -} diff --git a/3.4.0/src/kvirc/kernel/kvi_app_setup.cpp b/3.4.0/src/kvirc/kernel/kvi_app_setup.cpp deleted file mode 100644 index 2e4a755ca7..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_app_setup.cpp +++ /dev/null @@ -1,864 +0,0 @@ -//============================================================================= -// -// File : kvi_app_setup.cpp -// Creation date : Fri Apr 2 1999 02:38:05 by Szymon Stefanek -// -// This file is part of the Kvirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -//#define _KVI_DEBUG_CHECK_RANGE_ -//#include "kvi_debug.h" - -#include <qtextcodec.h> - -#include "kvi_settings.h" -#include "kvi_defaults.h" - -#include "kvi_window.h" -#include "kvi_frame.h" - -#include "kvi_app.h" - -#include "kvi_fileutils.h" -#include "kvi_locale.h" -#include "kvi_msgbox.h" -#include "kvi_library.h" -#include "kvi_sourcesdate.h" -#include "kvi_iconmanager.h" -#include "kvi_config.h" - -#ifndef COMPILE_ON_WINDOWS - - #include <stdlib.h> // for getenv() - #include <unistd.h> // for symlink() <-- unused ? - - #ifdef COMPILE_KDE_SUPPORT - #include <kconfig.h> - #include <kstddirs.h> - #endif - -#else - - #include <shlwapi.h> - #include <windows.h> // at least for GetModuleFileName and *PrivateProfileString - -#endif //COMPILE_ON_WINDOWS - -#include <qfile.h> -#include <qtextstream.h> -#include <qdir.h> - - - - -// -// Things launched at startup: -// - Attempt to find the global Kvirc directory -// - Attempt to find the local Kvirc directory -// and if it is not found , ask the user to choose one -// - -bool KviApp::checkGlobalKvircDirectory(const QString dir) -{ - //First check if the help subdir exists - QString szDir2 = dir; - szDir2+=KVI_PATH_SEPARATOR"modules"; - if(!KviFileUtils::directoryExists(szDir2))return false; - //Then check if the pics subdir exists - QString szDir = dir; - szDir+=KVI_PATH_SEPARATOR"pics"; - if(!KviFileUtils::directoryExists(szDir))return false; - //Now make sure that it is the dir that we're looking for. - //Check for an image file that we need. - szDir.append(KVI_PATH_SEPARATOR); - szDir.append(KVI_ACTIVITYMETER_IMAGE_NAME); - return KviFileUtils::isReadable(szDir); -} - -bool KviApp::checkLocalKvircDirectory(const QString szDir) -{ - //First check if the dir exists - if(!KviFileUtils::directoryExists(szDir))return false; - if(!QFileInfo(szDir).isWritable()) return false; - - QString szBuff; - getLocalKvircDirectory(szBuff,Config); - if(!KviFileUtils::directoryExists(szBuff)) return false; - - return true; -} - -bool KviApp::checkFileAssociations() -{ -#ifdef COMPILE_ON_WINDOWS -#define QUERY_BUFFER 2048 - char* buffer; - DWORD len = QUERY_BUFFER; - DWORD err; - buffer = (char*)malloc(len*sizeof(char)); - HKEY hKey; - - if(RegOpenKeyEx(HKEY_CLASSES_ROOT,".kvs",0,KEY_READ,&hKey) != ERROR_SUCCESS ) - return false; - - if( (err=RegQueryValueEx( hKey,0,0,0,(LPBYTE)buffer,&len)) != ERROR_SUCCESS) - { - free(buffer); - return false; - } else { - if(!kvi_strEqualCIN("KVIrcScript",buffer,11)){ - free(buffer); - return false; - } - } - - len = QUERY_BUFFER; - if(RegOpenKeyEx(HKEY_CLASSES_ROOT,"KVIrcScript",0,KEY_READ,&hKey) != ERROR_SUCCESS ) - return false; - - if( (err=RegQueryValueEx( hKey,0,0,0,(LPBYTE)buffer,&len)) != ERROR_SUCCESS) - { - free(buffer); - return false; - } else { - if(!kvi_strEqualCI(__tr2qs("KVIrc KVS Script").local8Bit().data(),buffer)){ - free(buffer); - return false; - } - } - - len = QUERY_BUFFER; - if(RegOpenKeyEx(HKEY_CLASSES_ROOT,"KVIrcScript\\DefaultIcon",0,KEY_READ,&hKey) != ERROR_SUCCESS ) - return false; - - if( RegQueryValueEx( hKey,0,0,0,(LPBYTE)buffer,&len) != ERROR_SUCCESS) - { - free(buffer); - return false; - } else { - QString szIcon = applicationFilePath()+",1"; - szIcon.replace('/',"\\"); - if(!kvi_strEqualCI(szIcon.local8Bit().data(),buffer)){ - free(buffer); - return false; - } - } - - len = QUERY_BUFFER; - if(RegOpenKeyEx(HKEY_CLASSES_ROOT,"KVIrcScript\\Shell\\Parse",0,KEY_READ,&hKey) != ERROR_SUCCESS ) - return false; - - if( RegQueryValueEx( hKey,0,0,0,(LPBYTE)buffer,&len) != ERROR_SUCCESS) - { - free(buffer); - return false; - } else { - if(!kvi_strEqualCI(__tr2qs("Run KVS Script").local8Bit().data(),buffer)){ - free(buffer); - return false; - } - } - - len = QUERY_BUFFER; - if(RegOpenKeyEx(HKEY_CLASSES_ROOT,"KVIrcScript\\Shell\\Parse\\command",0,KEY_READ,&hKey) != ERROR_SUCCESS ) - return false; - - if( RegQueryValueEx( hKey,0,0,0,(LPBYTE)buffer,&len) != ERROR_SUCCESS) - { - free(buffer); - return false; - } else { - QString szCmd = applicationFilePath()+" \"%1\""; - szCmd.replace('/',"\\"); - if(!kvi_strEqualCI(szCmd.local8Bit().data(),buffer)) { - free(buffer); - return false; - } - } - - //Config - - if(RegOpenKeyEx(HKEY_CLASSES_ROOT,".kvc",0,KEY_READ,&hKey) != ERROR_SUCCESS ) - return false; - - if( (err=RegQueryValueEx( hKey,0,0,0,(LPBYTE)buffer,&len)) != ERROR_SUCCESS) - { - free(buffer); - return false; - } else { - if(!kvi_strEqualCIN("KVIrcConfig",buffer,11)){ - free(buffer); - return false; - } - } - - len = QUERY_BUFFER; - if(RegOpenKeyEx(HKEY_CLASSES_ROOT,"KVIrcConfig",0,KEY_READ,&hKey) != ERROR_SUCCESS ) - return false; - - //Addon - if(RegOpenKeyEx(HKEY_CLASSES_ROOT,".kva",0,KEY_READ,&hKey) != ERROR_SUCCESS ) - return false; - - if( (err=RegQueryValueEx( hKey,0,0,0,(LPBYTE)buffer,&len)) != ERROR_SUCCESS) - { - free(buffer); - return false; - } else { - if(!kvi_strEqualCIN("KVIrcAddon",buffer,11)){ - free(buffer); - return false; - } - } - - len = QUERY_BUFFER; - if(RegOpenKeyEx(HKEY_CLASSES_ROOT,"KVIrcAddon",0,KEY_READ,&hKey) != ERROR_SUCCESS ) - return false; - //Theme - if(RegOpenKeyEx(HKEY_CLASSES_ROOT,".kvt",0,KEY_READ,&hKey) != ERROR_SUCCESS ) - return false; - - if( (err=RegQueryValueEx( hKey,0,0,0,(LPBYTE)buffer,&len)) != ERROR_SUCCESS) - { - free(buffer); - return false; - } else { - if(!kvi_strEqualCIN("KVIrcTheme",buffer,11)){ - free(buffer); - return false; - } - } - - len = QUERY_BUFFER; - if(RegOpenKeyEx(HKEY_CLASSES_ROOT,"KVIrcTheme",0,KEY_READ,&hKey) != ERROR_SUCCESS ) - return false; - - free(buffer); -#endif - return true; - -} - - -bool KviApp::checkUriAssociations(char * proto) -{ -#ifdef COMPILE_ON_WINDOWS -#define QUERY_BUFFER 2048 - char* buffer; - DWORD len = QUERY_BUFFER; - DWORD err; - buffer = (char*)malloc(len*sizeof(char)); - HKEY hKey; - - KviStr storedKey = proto; - - KviStr key=storedKey; - - len = QUERY_BUFFER; - if(RegOpenKeyEx(HKEY_CLASSES_ROOT,key,0,KEY_READ,&hKey) != ERROR_SUCCESS ) - return false; - - if( (err=RegQueryValueEx( hKey,0,0,0,(LPBYTE)buffer,&len)) != ERROR_SUCCESS) - { - free(buffer); - return false; - } else { - if(!kvi_strEqualCI(__tr2qs("URL:IRC Protocol").local8Bit().data(),buffer)){ - free(buffer); - return false; - } - } - - len = QUERY_BUFFER; - if( (err=RegQueryValueEx( hKey,"URL Protocol",0,0,(LPBYTE)buffer,&len)) != ERROR_SUCCESS) - { - free(buffer); - return false; - } - - key = storedKey+"\\DefaultIcon"; - len = QUERY_BUFFER; - if(RegOpenKeyEx(HKEY_CLASSES_ROOT,key,0,KEY_READ,&hKey) != ERROR_SUCCESS ) - return false; - - if( RegQueryValueEx( hKey,0,0,0,(LPBYTE)buffer,&len) != ERROR_SUCCESS) - { - free(buffer); - return false; - } else { - QString szIcon = applicationFilePath()+",0"; - szIcon.replace('/',"\\"); - if(!kvi_strEqualCI(szIcon.local8Bit().data(),buffer)){ - free(buffer); - return false; - } - } - - len = QUERY_BUFFER; - key = storedKey+"\\Shell\\open"; - if(RegOpenKeyEx(HKEY_CLASSES_ROOT,key,0,KEY_READ,&hKey) != ERROR_SUCCESS ) - return false; - - if( RegQueryValueEx( hKey,0,0,0,(LPBYTE)buffer,&len) != ERROR_SUCCESS) - { - free(buffer); - return false; - } else { - if(!kvi_strEqualCI(__tr2qs("Open with KVIrc").local8Bit().data(),buffer)){ - free(buffer); - return false; - } - } - - len = QUERY_BUFFER; - key = storedKey+"\\Shell\\open\\command"; - if(RegOpenKeyEx(HKEY_CLASSES_ROOT,key,0,KEY_READ,&hKey) != ERROR_SUCCESS ) - return false; - - if( RegQueryValueEx( hKey,0,0,0,(LPBYTE)buffer,&len) != ERROR_SUCCESS) - { - free(buffer); - return false; - } else { - QString szCmd = applicationFilePath()+" \"%1\""; - szCmd.replace('/',"\\"); - if(!kvi_strEqualCI(szCmd.local8Bit().data(),buffer)) { - free(buffer); - return false; - } - } - - free(buffer); -#endif - return true; - -} - - -void KviApp::setupUriAssociations(char * proto) -{ -#ifdef COMPILE_ON_WINDOWS - HKEY hKey; - DWORD err; - - KviStr storedKey = proto; - - KviStr key=storedKey; - - KviQCString tmp; - QString appPath = applicationFilePath(); - appPath.replace('/',"\\"); - - SHDeleteKey(HKEY_CLASSES_ROOT,key); - - err=RegCreateKeyEx(HKEY_CLASSES_ROOT,key,0,0,0,KEY_WRITE,0,&hKey,0); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)"URL:IRC Protocol",16); - RegSetValueEx( hKey,"URL Protocol",0,REG_SZ,(LPBYTE)"",0); - - key=storedKey+"\\DefaultIcon"; - RegCreateKeyEx(HKEY_CLASSES_ROOT,key,0,0,0,KEY_WRITE,0,&hKey,0); - tmp=QString(appPath+",0").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - - key=storedKey+"\\Shell\\open"; - RegCreateKeyEx(HKEY_CLASSES_ROOT,key,0,0,0,KEY_WRITE,0,&hKey,0); - tmp=__tr2qs("Open with KVIrc").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - - key=storedKey+"\\Shell\\open\\command"; - RegCreateKeyEx(HKEY_CLASSES_ROOT,key,0,0,0,KEY_WRITE,0,&hKey,0); - tmp=QString(appPath+" \"%1\"").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - -#endif -} - -void KviApp::setupFileAssociations() -{ -#ifdef COMPILE_ON_WINDOWS - HKEY hKey; - DWORD err; - - KviQCString tmp; - QString appPath = applicationFilePath(); - appPath.replace('/',"\\"); - - SHDeleteKey(HKEY_CLASSES_ROOT,".kvs"); - - err=RegCreateKeyEx(HKEY_CLASSES_ROOT,".kvs",0,0,0,KEY_WRITE,0,&hKey,0); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)"KVIrcScript",11); - - - SHDeleteKey(HKEY_CLASSES_ROOT,"KVIrcScript"); - RegCreateKeyEx(HKEY_CLASSES_ROOT,"KVIrcScript",0,0,0,KEY_WRITE,0,&hKey,0); - tmp = __tr2qs("KVIrc KVS Script").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - - RegCreateKeyEx(HKEY_CLASSES_ROOT,"KVIrcScript\\DefaultIcon",0,0,0,KEY_WRITE,0,&hKey,0); - tmp=QString(appPath+",1").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - - RegCreateKeyEx(HKEY_CLASSES_ROOT,"KVIrcScript\\Shell\\Parse",0,0,0,KEY_WRITE,0,&hKey,0); - tmp=__tr2qs("Run KVS Script").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - - RegCreateKeyEx(HKEY_CLASSES_ROOT,"KVIrcScript\\Shell\\Parse\\command",0,0,0,KEY_WRITE,0,&hKey,0); - tmp=QString(appPath+" \"%1\"").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - - //Configs - SHDeleteKey(HKEY_CLASSES_ROOT,".kvc"); - - err=RegCreateKeyEx(HKEY_CLASSES_ROOT,".kvc",0,0,0,KEY_WRITE,0,&hKey,0); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)"KVIrcConfig",11); - - - SHDeleteKey(HKEY_CLASSES_ROOT,"KVIrcConfig"); - RegCreateKeyEx(HKEY_CLASSES_ROOT,"KVIrcConfig",0,0,0,KEY_WRITE,0,&hKey,0); - tmp = __tr2qs("KVIrc Configuration File").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - - RegCreateKeyEx(HKEY_CLASSES_ROOT,"KVIrcConfig\\DefaultIcon",0,0,0,KEY_WRITE,0,&hKey,0); - tmp=QString(appPath+",2").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - - // Themes - - SHDeleteKey(HKEY_CLASSES_ROOT,".kvt"); - - err=RegCreateKeyEx(HKEY_CLASSES_ROOT,".kvt",0,0,0,KEY_WRITE,0,&hKey,0); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)"KVIrcTheme",11); - - - SHDeleteKey(HKEY_CLASSES_ROOT,"KVIrcTheme"); - RegCreateKeyEx(HKEY_CLASSES_ROOT,"KVIrcTheme",0,0,0,KEY_WRITE,0,&hKey,0); - tmp = __tr2qs("KVIrc Theme Package").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - - RegCreateKeyEx(HKEY_CLASSES_ROOT,"KVIrcTheme\\DefaultIcon",0,0,0,KEY_WRITE,0,&hKey,0); - tmp=QString(appPath+",3").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - - RegCreateKeyEx(HKEY_CLASSES_ROOT,"KVIrcTheme\\Shell\\Install",0,0,0,KEY_WRITE,0,&hKey,0); - tmp=__tr2qs("Install Theme Package").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - - RegCreateKeyEx(HKEY_CLASSES_ROOT,"KVIrcTheme\\Shell\\Install\\command",0,0,0,KEY_WRITE,0,&hKey,0); - tmp=QString(appPath+" \"%1\"").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - - //Addons - - SHDeleteKey(HKEY_CLASSES_ROOT,".kva"); - - err=RegCreateKeyEx(HKEY_CLASSES_ROOT,".kva",0,0,0,KEY_WRITE,0,&hKey,0); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)"KVIrcAddon",11); - - - SHDeleteKey(HKEY_CLASSES_ROOT,"KVIrcAddon"); - RegCreateKeyEx(HKEY_CLASSES_ROOT,"KVIrcAddon",0,0,0,KEY_WRITE,0,&hKey,0); - tmp = __tr2qs("KVIrc Addon Package").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - - RegCreateKeyEx(HKEY_CLASSES_ROOT,"KVIrcAddon\\DefaultIcon",0,0,0,KEY_WRITE,0,&hKey,0); - tmp=QString(appPath+",4").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - - RegCreateKeyEx(HKEY_CLASSES_ROOT,"KVIrcAddon\\Shell\\Install",0,0,0,KEY_WRITE,0,&hKey,0); - tmp=__tr2qs("Install Package").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - - RegCreateKeyEx(HKEY_CLASSES_ROOT,"KVIrcAddon\\Shell\\Install\\command",0,0,0,KEY_WRITE,0,&hKey,0); - tmp=QString(appPath+" \"%1\"").local8Bit(); - RegSetValueEx( hKey,0,0,REG_SZ,(LPBYTE)tmp.data(),tmp.length()); - -#endif -} - -//#ifdef BRAIN_DAMAGED_AUTHOR_PARANOIA -//#define I_DO_NOT_WANT_TO_HEAR_IT_ANYMORE_THAT_KVIRC_CAN_NOT_FIND_THE_BASE_PIXMAPS - -// search paths for Unix-like platforms -#ifndef COMPILE_ON_WINDOWS - const char * usualKvircGlobalPrePath[]= - { - "/usr/local", "/opt/kde", "/usr", - "/usr/local/lib", "/opt/kde3", "/usr/lib", - "/usr/local/kde", "/opt", "/usr/etc", - "/usr/local/kde3", "/usr/lib/X11R6", "/usr/X11R6", - "/usr/local/X11R6", "/lib/X11", "/usr/kde", - "/usr/local/X11", "/etc", "/usr/kde3", - "/usr/local/etc", "/lib", "/usr/X11", - "/etc/X11", "/home", "/home/kvirc", - 0 - }; - - const char * usualKvircGlobalDir[]= - { - "/share/kvirc/", "/share/apps/kvirc/", - "/apps/kvirc/", "/kvirc/", - "/kvirc/share/apps/kvirc/", "/kvirc/share/kvirc/", //<------ ???!!!??? - "/kvirc/share/", 0 - }; - -#endif //!COMPILE_ON_WINDOWS - -//#endif //BRAIN_DAMAGED_AUTHOR_PARANOIA - -void KviApp::findGlobalKvircDirectory() -{ - // Look for the installation directory - // with the image and help files inside -#ifdef GLOBAL_KVIRC_DIR - m_szGlobalKvircDir = GLOBAL_KVIRC_DIR; - KviFileUtils::adjustFilePath(m_szGlobalKvircDir); - if(checkGlobalKvircDirectory(m_szGlobalKvircDir))return; -#endif //GLOBAL_KVIRC_DIR - -#ifdef COMPILE_ON_WINDOWS - - m_szGlobalKvircDir = applicationDirPath(); - KviFileUtils::adjustFilePath(m_szGlobalKvircDir); - if(checkGlobalKvircDirectory(m_szGlobalKvircDir))return; - - KviMessageBox::warning("Unable to find the shared Kvirc directory.\n"\ - "The usual path for this directory is c:\\kvirc\\" KVI_VERSION_BRANCH "\\.\n"\ - "I have tried %Q, but it seemed to fail\n" \ - "Trying to run anyway...\n",&m_szGlobalKvircDir); -#else // !COMPILE_ON_WINDOWS - - // Since I had many problems with it - // because of strange distributions or KDEDIRS - // I do it in that way... - #ifdef COMPILE_KDE_SUPPORT - // KDE compilation ... - // The things usually go installed into $KDEDIR/share/apps/kvirc/$KVI_VERSION_BRANCH - // Look in the main KDE directory - KStandardDirs * d = dirs(); - if(d) - { - m_szGlobalKvircDir = locate("appdata",""); - if(checkGlobalKvircDirectory(m_szGlobalKvircDir))return; - #ifdef HAVE_GETENV - //KDEDIR sanity check... - m_szGlobalKvircDir = getenv("KDEDIR"); - m_szGlobalKvircDir+="/share/apps/kvirc/" KVI_VERSION_BRANCH; - if(checkGlobalKvircDirectory(m_szGlobalKvircDir))return; - #endif - } - // FAILED ? Check the usual way... - #endif //COMPILE_WITH_KDE - - // Non KDE compilation , or not found under $KDEDIR/share/apps/kvirc/$KVI_VERSION_BRANCH - - // Check for MacOS X Bundle compilation - #ifdef Q_OS_MACX - m_szGlobalKvircDir = applicationDirPath(); - m_szGlobalKvircDir+= "/../Resources/kvirc/"; - m_szGlobalKvircDir+= KVI_VERSION_BRANCH; - if(checkGlobalKvircDirectory(m_szGlobalKvircDir))return; - #endif //Q_OS_MACX - - // Check usual directories... - for(int j=0;usualKvircGlobalPrePath[j] != 0;j++){ - for(int i=0;usualKvircGlobalDir[i] != 0;i++){ - m_szGlobalKvircDir = usualKvircGlobalPrePath[j]; - m_szGlobalKvircDir+= usualKvircGlobalDir[i]; - m_szGlobalKvircDir+= KVI_VERSION_BRANCH; - if(checkGlobalKvircDirectory(m_szGlobalKvircDir))return; - } - } - - //Last resource , try $HOME and $HOME/.kde - for(int k=0;usualKvircGlobalDir[k] != 0;k++){ - m_szGlobalKvircDir = QDir::homeDirPath(); - m_szGlobalKvircDir+= usualKvircGlobalDir[k]; - m_szGlobalKvircDir+= KVI_VERSION_BRANCH; - if(checkGlobalKvircDirectory(m_szGlobalKvircDir))return; - } - - #ifdef COMPILE_KDE_SUPPORT - for(int k=0;usualKvircGlobalDir[k] != 0;k++){ - m_szGlobalKvircDir = QDir::homeDirPath(); - m_szGlobalKvircDir+= "/.kde"; - m_szGlobalKvircDir+= usualKvircGlobalDir[k]; - m_szGlobalKvircDir+= KVI_VERSION_BRANCH; - if(checkGlobalKvircDirectory(m_szGlobalKvircDir))return; - } - #endif //COMPILE_KDE_SUPPORT - - m_szGlobalKvircDir=""; - - // DO NOT TRANSLATE THIS - // THE TRANSLATION DIRECTORY WAS NOT FOUND YET - // AND THE LOCALE IS NOT INITIALIZED AT ALL - - #ifdef COMPILE_KDE_SUPPORT - KviMessageBox::warning("Unable to find the shared Kvirc directory.\n"\ - "The usual path for this directory is $KDEDIR/share/apps/kvirc.\n"\ - "Are you sure that 'make install' worked correctly ?\n"\ - "Please make sure that you have the read permission to that directory\n"\ - "and you have set KDEDIR correctly. You may also try to rerun 'make install'.\n"\ - "A detailed explaination of the Kvirc directory system is in the INSTALL document\n"\ - "shipped with the kvirc source dirstribution.\n"\ - "Trying to run anyway..."); - #elif defined(Q_OS_MACX) - KviMessageBox::warning("Unable to find the shared Kvirc directory.\n"\ - "The usual path for this directory is ./Contents/Resources/kvirc within your application bundle.\n"\ - "Something went wrong during the bundle creation.\n"\ - "Please read the documentation and make sure to set proper paths for --prefix, -bindir, -libdir and --datadir during the configure run.\n"\ - "Trying to run anyway...\n"); - #else //!defined(COMPILE_KDE_SUPPORT) && !defined(Q_OS_MACX) - KviMessageBox::warning("Unable to find the shared Kvirc directory.\n"\ - "The usual path for this directory is /usr/local/share/kvirc.\n"\ - "Are you sure that 'make install' worked correctly ?\n"\ - "Please make sure that you have the read permission to that directory.\n"\ - "You may also need to rerun 'make install'.\n"\ - "A detailed explaination of the Kvirc directory system is in the INSTALL document\n"\ - "shipped with the kvirc source dirstribution.\n"\ - "Trying to run anyway...\n"); - #endif //!Q_OS_MACX -#endif //!COMPILE_ON_WINDOWS -} - - -bool KviApp::findLocalKvircDirectory() -{ - // Here we check if we already did the setup - // and we have the kvirc local directory saved somewhere -#ifdef COMPILE_KDE_SUPPORT - if(m_szConfigFile.isEmpty()) - { // don't do that if user supplied a config file :) - KConfig * cfg = config(); - if(cfg) - { - if(cfg->getConfigState() == KConfig::ReadWrite) - { - cfg->setGroup("Main"); - m_szLocalKvircDir = cfg->readEntry("LocalKvircDirectory",""); - - unsigned int uSourcesDate = cfg->readUnsignedNumEntry("SourcesDate",0); - if(uSourcesDate < KVI_SOURCES_DATE_NUMERIC_FORCE_SETUP) - return false; // we force a setup anyway - - // If we have it , ok...done - if(checkLocalKvircDirectory(m_szLocalKvircDir))return true; - } - } - } -#endif //COMPILE_KDE_SUPPORT - -#ifdef COMPILE_ON_WINDOWS - if(KviFileUtils::fileExists(g_pApp->applicationDirPath()+KVI_PATH_SEPARATOR_CHAR+"portable")) { - m_szLocalKvircDir=g_pApp->applicationDirPath()+KVI_PATH_SEPARATOR_CHAR+"Settings"; - if(checkLocalKvircDirectory(m_szLocalKvircDir)) return true; - } -#endif - //Check if we have a special .kvirc.rc in $HOME - QString szF = QDir::homeDirPath(); - - if(!m_szConfigFile.isEmpty()) - { - QString szConfig = m_szConfigFile; - if(QDir::isRelativePath(szConfig)) - { - szF+=KVI_PATH_SEPARATOR; - szF+=szConfig; - } else { - szF=szConfig; - } - } else { - szF+=KVI_PATH_SEPARATOR; - szF+=KVI_HOME_CONFIG_FILE_NAME; - } - //If the file exists , read the first non empty line. - //FIXME: LOCALE BROKEN!!! - KviConfig cfgx(szF,KviConfig::Read); - - cfgx.setGroup("Main"); - m_szLocalKvircDir = cfgx.readEntry("LocalKvircDirectory",""); - - unsigned int uSourcesDate = cfgx.readUIntEntry("SourcesDate",0); - if(uSourcesDate < KVI_SOURCES_DATE_NUMERIC_FORCE_SETUP) - return false; // we force a setup anyway - - // If we have it , ok...done - if(checkLocalKvircDirectory(m_szLocalKvircDir))return true; - return false; -} - -void KviApp::loadDirectories() -{ - // First find the global (readable) one... - findGlobalKvircDirectory(); - // Init locale - QString szLocalePath = m_szGlobalKvircDir; - szLocalePath.append(KVI_PATH_SEPARATOR); - szLocalePath.append("locale"); - szLocalePath.append(KVI_PATH_SEPARATOR); - - KviLocale::init(this,szLocalePath); - - //__debug_1arg("Global Kvirc directory is %s",m_szGlobalKvircDir.ptr()); - // Now look for the local (writable) one - m_bFirstTimeRun = !findLocalKvircDirectory(); - - if(m_bFirstTimeRun)setupBegin(); - if(!checkFileAssociations()) setupFileAssociations(); - if(!checkUriAssociations("irc")) setupUriAssociations("irc"); - if(!checkUriAssociations("ircs")) setupUriAssociations("ircs"); - if(!checkUriAssociations("irc6")) setupUriAssociations("irc6"); - if(!checkUriAssociations("ircs6")) setupUriAssociations("ircs6"); -} - -static kvi_library_t g_hSetupLibrary = 0; - - -void KviApp::setupBegin() -{ - //We must do the setup...ask the user.. - QString szSetupLib; - getGlobalKvircDirectory(szSetupLib,KviApp::Modules); - KviQString::ensureLastCharIs(szSetupLib,KVI_PATH_SEPARATOR_CHAR); -#ifdef COMPILE_ON_WINDOWS - szSetupLib.append("kvisetup.dll"); -#else - szSetupLib.append("libkvisetup.so"); -#endif - g_hSetupLibrary = kvi_library_open(szSetupLib.local8Bit().data()); - if(!g_hSetupLibrary) - { - KviMessageBox::warning(__tr2qs("Ops...it looks like I can't load modules on this sytem.\n" \ - "I have been looking for the %s library but I haven't been able to load it\n" \ - "due to the following error: \"%s\"\nAborting."),szSetupLib.utf8().data(),kvi_library_error()); -#ifdef COMPILE_ON_WINDOWS - ExitProcess(-1); -#else - ::exit(-1); -#endif - } - - bool (*sfunc)() = (bool(*)())kvi_library_symbol(g_hSetupLibrary,"setup_begin"); - if(!sfunc) - { - KviMessageBox::warning(__tr2qs("Ops...it looks like you have a broken distribution.\n" \ - "The setup module does not export the \"setup_begin\" function.\n" \ - "Aborting!")); -#ifdef COMPILE_ON_WINDOWS - ExitProcess(-1); -#else - ::exit(-1); -#endif - } - - bool bRet = sfunc(); - - if(!bRet) - { - KviMessageBox::warning(__tr2qs("Setup aborted")); -#ifdef COMPILE_ON_WINDOWS - ExitProcess(-1); -#else //!COMPILE_ON_WINDOWS - ::exit(-1); -#endif //!COMPILE_ON_WINDOWS - } - - // Now save it - //Let it be done by setup function -// saveKvircDirectory(); -} - - -void KviApp::setupFinish() -{ - if(!g_hSetupLibrary) - { - debug("Oops... lost the setup library ?"); - return; - } - - void (*sfunc)() = (void(*)())kvi_library_symbol(g_hSetupLibrary,"setup_finish"); - if(!sfunc) - { - KviMessageBox::warning(__tr2qs("Ops...it looks like you have a broken distribution.\n" \ - "The setup module does not export the \"setup_finish\" function.\n" \ - "Trying to continue anyway...")); - } - - sfunc(); - - kvi_library_close(g_hSetupLibrary); - g_hSetupLibrary = 0; -} - - -void KviApp::saveKvircDirectory() -{ -/* -#ifdef COMPILE_ON_WINDOWS - KviStr szKey(KviStr::Format,"LocalKvircDirectory%s",KVI_VERSION_BRANCH); - WritePrivateProfileString("kvirc",szKey.ptr(),m_szLocalKvircDir.ptr(),KVI_HOME_CONFIG_FILE_NAME); -#else //!COMPILE_ON_WINDOWS -*/ - // Here we save the local directory path -#ifdef COMPILE_KDE_SUPPORT - // In KDE we use the application config file - if(m_szConfigFile.isEmpty()) - { // not if user supplied a config file - KConfig * cfg = config(); - if(cfg) - { - if(cfg->getConfigState() == KConfig::ReadWrite) - { - cfg->setGroup("Main"); - cfg->writeEntry("LocalKvircDirectory",m_szLocalKvircDir); - cfg->writeEntry("SourcesDate",KVI_SOURCES_DATE_NUMERIC); - cfg->sync(); - return; - } - } - } -#endif //COMPILE_KDE_SUPPORT - // In NON-KDE we use $HOME/.kvirc.rc or $HOME/kvirc.ini - - QString szF = QDir::homeDirPath(); - if(!m_szConfigFile.isEmpty()) - {//Must be changed from QString::fromLocal8Bit to QTextCodec::codecForLocale() - QString szConfig = m_szConfigFile; - if(QDir::isRelativePath(szConfig)) - { - szF+=KVI_PATH_SEPARATOR; - szF+=szConfig; - } else { - szF=szConfig; - } - } else { - szF+=KVI_PATH_SEPARATOR; - szF+=KVI_HOME_CONFIG_FILE_NAME; - } - //FIXME: LOCALE BROKEN!!! - - KviConfig cfgx(szF,KviConfig::Write); - - cfgx.setGroup("Main"); - cfgx.writeEntry("LocalKvircDirectory",m_szLocalKvircDir); - cfgx.writeEntry("SourcesDate",KVI_SOURCES_DATE_NUMERIC); -} diff --git a/3.4.0/src/kvirc/kernel/kvi_asynchronousconnectiondata.cpp b/3.4.0/src/kvirc/kernel/kvi_asynchronousconnectiondata.cpp deleted file mode 100644 index d332f0d777..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_asynchronousconnectiondata.cpp +++ /dev/null @@ -1,39 +0,0 @@ -//============================================================================= -// -// File : kvi_asynchronousconnectiondata.cpp -// Created on Sun 04 Jul 2004 16:22:25 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_asynchronousconnectiondata.h" - -KviAsynchronousConnectionData::KviAsynchronousConnectionData() -: KviHeapObject() -{ - m_pReconnectInfo=0; - bUseLastServerInContext = false; -} - -KviAsynchronousConnectionData::~KviAsynchronousConnectionData() -{ -} - diff --git a/3.4.0/src/kvirc/kernel/kvi_asynchronousconnectiondata.h b/3.4.0/src/kvirc/kernel/kvi_asynchronousconnectiondata.h deleted file mode 100644 index b4790d920a..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_asynchronousconnectiondata.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef _KVI_ASYNCHRONOUSCONNECTIONDATA_H_ -#define _KVI_ASYNCHRONOUSCONNECTIONDATA_H_ -//============================================================================= -// -// File : kvi_asynchronousconnectiondata.h -// Created on Sun 04 Jul 2004 16:22:25 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_heapobject.h" -#include "kvi_ircserver.h" - -class KviAsynchronousConnectionData : public KviHeapObject -{ -public: - KviAsynchronousConnectionData(); - ~KviAsynchronousConnectionData(); -public: - QString szServer; - bool bUseLastServerInContext; // this is checked ONLY if szServer is empty - kvi_u32_t uPort; - bool bPortIsOk; - bool bUseIpV6; - bool bUseSSL; - QString szBindAddress; // ip address (or interface name) to bind the connection to - QString szCommandToExecAfterConnect; - QString szLinkFilter; - QString szPass; - QString szNick; - QString szInitUMode; - KviIrcServerReconnectInfo * m_pReconnectInfo; -}; - -#endif //!_KVI_ASYNCHRONOUSCONNECTIONDATA_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_coreactionnames.h b/3.4.0/src/kvirc/kernel/kvi_coreactionnames.h deleted file mode 100644 index 50539a46c0..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_coreactionnames.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef _KVI_COREACTIONNAMES_H_ -#define _KVI_COREACTIONNAMES_H_ -//============================================================================= -// -// File : kvi_coreactionnames.h -// Created on Mon 22 Nov 2004 02:30:47 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 KVI_COREACTION_NAME_PREFIX "kvirc." - -#define KVI_COREACTION_SERVEROPTIONS (KVI_COREACTION_NAME_PREFIX "serveroptions") -#define KVI_COREACTION_IDENTITYOPTIONS (KVI_COREACTION_NAME_PREFIX "identityoptions") -#define KVI_COREACTION_SOCKETSPY (KVI_COREACTION_NAME_PREFIX "socketspy") -#define KVI_COREACTION_NETWORKLINKS (KVI_COREACTION_NAME_PREFIX "networklinks") -#define KVI_COREACTION_CHANNELLIST (KVI_COREACTION_NAME_PREFIX "channellist") -#define KVI_COREACTION_GENERALOPTIONS (KVI_COREACTION_NAME_PREFIX "generaloptions") -#define KVI_COREACTION_TOOLBAREDITOR (KVI_COREACTION_NAME_PREFIX "toolbareditor") -#define KVI_COREACTION_JOINCHANNELS (KVI_COREACTION_NAME_PREFIX "joinchannels") -#define KVI_COREACTION_ACTIONEDITOR (KVI_COREACTION_NAME_PREFIX "actioneditor") -#define KVI_COREACTION_ALIASEDITOR (KVI_COREACTION_NAME_PREFIX "aliaseditor") -#define KVI_COREACTION_EVENTEDITOR (KVI_COREACTION_NAME_PREFIX "eventeditor") -#define KVI_COREACTION_POPUPEDITOR (KVI_COREACTION_NAME_PREFIX "popupeditor") -#define KVI_COREACTION_RAWEDITOR (KVI_COREACTION_NAME_PREFIX "raweditor") -#define KVI_COREACTION_CODETESTER (KVI_COREACTION_NAME_PREFIX "codetester") -#define KVI_COREACTION_EXECUTEKVS (KVI_COREACTION_NAME_PREFIX "executekvs") -#define KVI_COREACTION_CASCADEWINDOWS (KVI_COREACTION_NAME_PREFIX "cascadewindows") -#define KVI_COREACTION_TILEWINDOWS (KVI_COREACTION_NAME_PREFIX "tilewindows") -#define KVI_COREACTION_MINIMIZEALLWINDOWS (KVI_COREACTION_NAME_PREFIX "minimizeallwindows") -#define KVI_COREACTION_NEWIRCCONTEXT (KVI_COREACTION_NAME_PREFIX "newirccontext") -#define KVI_COREACTION_QUITKVIRC (KVI_COREACTION_NAME_PREFIX "quitkvirc") -#define KVI_COREACTION_IRCCONTEXTDISPLAY (KVI_COREACTION_NAME_PREFIX "irccontextdisplay") -#define KVI_COREACTION_SEPARATOR (KVI_COREACTION_NAME_PREFIX "separator") -#define KVI_COREACTION_CONNECT (KVI_COREACTION_NAME_PREFIX "connect") -#define KVI_COREACTION_CHANNELMENU (KVI_COREACTION_NAME_PREFIX "channelmenu") -#define KVI_COREACTION_NICKNAMEMENU (KVI_COREACTION_NAME_PREFIX "nicknamemenu") -#define KVI_COREACTION_SERVERMENU (KVI_COREACTION_NAME_PREFIX "servermenu") -#define KVI_COREACTION_USERMODEMENU (KVI_COREACTION_NAME_PREFIX "usermodemenu") -#define KVI_COREACTION_AWAYBACK (KVI_COREACTION_NAME_PREFIX "awayback") -#define KVI_COREACTION_IRCTOOLS (KVI_COREACTION_NAME_PREFIX "irctools") -#define KVI_COREACTION_IRCACTIONS (KVI_COREACTION_NAME_PREFIX "ircactions") -#define KVI_COREACTION_HELPINDEX (KVI_COREACTION_NAME_PREFIX "helpindex") -#define KVI_COREACTION_KVIRCMAILINGLIST (KVI_COREACTION_NAME_PREFIX "kvircmailinglist") -#define KVI_COREACTION_KVIRCHOMEPAGE (KVI_COREACTION_NAME_PREFIX "kvirchomepage") -#define KVI_COREACTION_KVIRCRUHOMEPAGE (KVI_COREACTION_NAME_PREFIX "kvircruhomepage") -#define KVI_COREACTION_EDITREGUSERS (KVI_COREACTION_NAME_PREFIX "editregusers") -#define KVI_COREACTION_MANAGEADDONS (KVI_COREACTION_NAME_PREFIX "manageaddons") -#define KVI_COREACTION_THEMEOPTIONS (KVI_COREACTION_NAME_PREFIX "themeoptions") -#define KVI_COREACTION_MANAGETHEMES (KVI_COREACTION_NAME_PREFIX "managethemes") -#define KVI_COREACTION_SCREENSHOT (KVI_COREACTION_NAME_PREFIX "screenshot") - -#endif //!_KVI_COREACTIONNAMES_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_coreactions.cpp b/3.4.0/src/kvirc/kernel/kvi_coreactions.cpp deleted file mode 100644 index 131e21163e..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_coreactions.cpp +++ /dev/null @@ -1,1204 +0,0 @@ -//============================================================================= -// -// File : kvi_coreactions.cpp -// Created on Mon 22 Nov 2004 02:30:47 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_coreactions.h" -#include "kvi_frame.h" -#include "kvi_locale.h" -#include "kvi_irccontext.h" -#include "kvi_iconmanager.h" -#include "kvi_app.h" -#include "kvi_customtoolbar.h" -#include "kvi_actiondrawer.h" -#include "kvi_actionmanager.h" -#include "kvi_kvs_action.h" -#include "kvi_mdimanager.h" -#include "kvi_irctoolbar.h" -#include "kvi_locale.h" -#include "kvi_ircurl.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_coreactionnames.h" -#include "kvi_ircconnectionserverinfo.h" -#include "kvi_styled_controls.h" - -#include "kvi_kvs_script.h" - -#include "kvi_tal_popupmenu.h" -#include <qobject.h> - - -// Ctrl+Alt+A : KviGoAwayAction -// Ctrl+Alt+C : Connect/Disconnect -// Ctrl+Alt+S : Servers dialog -// Ctrl+Alt+I : Identity dialog -// Ctrl+Alt+O : General options -// Ctrl+Alt+T : Theme options -// Ctrl+Alt+J : Join Channels -// Ctrl+Alt+X : Execute script -// Ctrl+Alt+N : New irc context -// Ctrl+Alt+1 : Action editor -// Ctrl+Alt+2 : Alias editor -// Ctrl+Alt+3 : Event editor -// Ctrl+Alt+4 : Popup editor -// Ctrl+Alt+5 : Raw event editor -// Ctrl+Alt+6 : Customize toolbars -// Ctrl+Alt+H : Show help index -// Ctrl+Alt+R : Edit regusers -// Ctrl+Alt+M : Manage Script Addons -// Ctrl+Alt+L : Manage Themes - -void register_core_actions(KviActionManager * m) -{ - m->registerAction(new KviConnectAction(m)); // this as parent will destroy it on exit! - m->registerAction(new KviSeparatorAction(m)); - m->registerAction(new KviIrcContextDisplayAction(m)); - m->registerAction(new KviJoinChannelAction(m)); - m->registerAction(new KviChangeNickAction(m)); - m->registerAction(new KviConnectToServerAction(m)); - m->registerAction(new KviChangeUserModeAction(m)); - m->registerAction(new KviGoAwayAction(m)); - m->registerAction(new KviIrcToolsAction(m)); - m->registerAction(new KviIrcOperationsAction(m)); - - KviAction * a; - -#define SCRIPT_ACTION(__name,__code,__visible,__description,__category,__icon,__smallicon,__flags,__accel) \ - a = new KviKvsAction(m, \ - QString(__name), \ - QString(__code), \ - QString(__visible), \ - QString(__description), \ - __category, \ - QString(__icon), \ - __smallicon, \ - __flags, \ - __accel); \ - m->registerAction(a) - -#define SLOT_ACTION(__name,__object,__slot,__visible,__description,__category,__icon,__smallicon,__flags,__accel) \ - a = new KviAction(m, \ - QString(__name), \ - QString(__visible), \ - QString(__description), \ - __category, \ - QString(__icon), \ - __smallicon, \ - __flags, \ - __accel); \ - QObject::connect(a,SIGNAL(activated()),__object,__slot); \ - m->registerAction(a) - - SCRIPT_ACTION( - KVI_COREACTION_SERVEROPTIONS, - "options.edit KviServerOptionsWidget", - __tr2qs("Configure Servers..."), - __tr2qs("Allows you to configure the servers and eventually to connect to them"), - KviActionManager::categorySettings(), - "kvi_bigicon_servers.png", - KVI_SMALLICON_SERVER, - 0, - "Ctrl+Alt+S"); - - SCRIPT_ACTION( - KVI_COREACTION_MANAGEADDONS, - "addon.dialog", - __tr2qs("Manage Addons..."), - __tr2qs("Allows you to manage the script-based addons"), - KviActionManager::categorySettings(), - "kvi_bigicon_addons.png", - KVI_SMALLICON_ADDONS, - 0, - "Ctrl+Alt+M"); - - SCRIPT_ACTION( - KVI_COREACTION_EDITREGUSERS, - "reguser.edit -t", - __tr2qs("Configure Registered Users..."), - __tr2qs("Shows a dialog that allows editing the registered user entries"), - KviActionManager::categorySettings(), - "kvi_bigicon_regusers.png", - KVI_SMALLICON_REGUSERS, - 0, - "Ctrl+Alt+R"); - - SCRIPT_ACTION( - KVI_COREACTION_IDENTITYOPTIONS, - "options.edit KviIdentityOptionsWidget", - __tr2qs("Configure Identity..."), - __tr2qs("Allows you to configure nickname, username, avatar etc..."), - KviActionManager::categorySettings(), - "kvi_bigicon_identity.png", - KVI_SMALLICON_WHO, - 0, - "Ctrl+Alt+I"); - - SCRIPT_ACTION( - KVI_COREACTION_SOCKETSPY, - "socketspy.open", - __tr2qs("Show SocketSpy..."), - __tr2qs("Shows a window that allows monitoring the socket traffic"), - KviActionManager::categoryScripting(), - "kvi_bigicon_socketspy.png", - KVI_SMALLICON_SPY, - KviAction::NeedsContext, - QString::null); - - SCRIPT_ACTION( - KVI_COREACTION_NETWORKLINKS, - "links.open", - __tr2qs("Get Network Links"), - __tr2qs("Shows a window that allows viewing the network links"), - KviActionManager::categoryIrc(), - "kvi_bigicon_networklinks.png", - KVI_SMALLICON_LINKS, - KviAction::NeedsContext, - QString::null); - - SCRIPT_ACTION( - KVI_COREACTION_CHANNELLIST, - "list.open", - __tr2qs("Get Channel List"), - __tr2qs("Shows a window that allows listing the network channels"), - KviActionManager::categoryIrc(), - "kvi_bigicon_channellist.png", - KVI_SMALLICON_LIST, - KviAction::NeedsContext, - QString::null); - - SCRIPT_ACTION( - KVI_COREACTION_GENERALOPTIONS, - "options.dialog", - __tr2qs("Configure KVIrc..."), - __tr2qs("Shows the general options dialog"), - KviActionManager::categorySettings(), - "kvi_bigicon_settings.png", - KVI_SMALLICON_OPTIONS, - 0, - "Ctrl+Alt+O"); - - SCRIPT_ACTION( - KVI_COREACTION_THEMEOPTIONS, - "options.dialog theme", - __tr2qs("Configure Theme..."), - __tr2qs("Shows the theme options dialog"), - KviActionManager::categorySettings(), - "kvi_bigicon_themeoptions.png", - KVI_SMALLICON_THEMEOPTIONS, - 0, - "Ctrl+Alt+T"); - - SCRIPT_ACTION( - KVI_COREACTION_MANAGETHEMES, - "theme.dialog", - __tr2qs("Manage Themes..."), - __tr2qs("Allows you to manage the themes"), - KviActionManager::categorySettings(), - "kvi_bigicon_theme.png", - KVI_SMALLICON_THEME, - 0, - "Ctrl+Alt+L"); - - SCRIPT_ACTION( - KVI_COREACTION_TOOLBAREDITOR, - "toolbareditor.open", - __tr2qs("Customize Toolbars..."), - __tr2qs("Shows a window that allows editing script toolbars"), - KviActionManager::categorySettings(), - "kvi_bigicon_toolbareditor.png", - KVI_SMALLICON_TOOLBAR, - 0, - "Ctrl+Alt+6"); - - - SCRIPT_ACTION( - KVI_COREACTION_JOINCHANNELS, - "channelsjoin.open", - __tr2qs("Join Channels..."), - __tr2qs("Shows a dialog that allows you joing channels"), - KviActionManager::categoryIrc(), - "kvi_bigicon_channels.png", - KVI_SMALLICON_CHANNEL, - KviKvsAction::NeedsConnection | KviKvsAction::NeedsContext, - "Ctrl+Alt+J"); - - - SCRIPT_ACTION( - KVI_COREACTION_ACTIONEDITOR, - "actioneditor.open", - __tr2qs("Edit Actions..."), - __tr2qs("Shows a window that allows editing actions"), - KviActionManager::categoryScripting(), - "kvi_bigicon_actioneditor.png", - KVI_SMALLICON_SCRIPTACTION, - 0, - "Ctrl+Alt+1"); - - SCRIPT_ACTION( - KVI_COREACTION_ALIASEDITOR, - "aliaseditor.open", - __tr2qs("Edit Aliases..."), - __tr2qs("Shows a window that allows editing aliases"), - KviActionManager::categoryScripting(), - "kvi_bigicon_aliaseditor.png", - KVI_SMALLICON_ALIAS, - 0, - "Ctrl+Alt+2"); - - SCRIPT_ACTION( - KVI_COREACTION_EVENTEDITOR, - "eventeditor.open", - __tr2qs("Edit Events..."), - __tr2qs("Shows a window that allows editing script events"), - KviActionManager::categoryScripting(), - "kvi_bigicon_eventeditor.png", - KVI_SMALLICON_EVENT, - 0, - "Ctrl+Alt+3"); - - SCRIPT_ACTION( - KVI_COREACTION_POPUPEDITOR, - "popupeditor.open", - __tr2qs("Edit Popups..."), - __tr2qs("Shows a window that allows editing popup menus"), - KviActionManager::categoryScripting(), - "kvi_bigicon_popupeditor.png", - KVI_SMALLICON_POPUP, - 0, - "Ctrl+Alt+4"); - - SCRIPT_ACTION( - KVI_COREACTION_RAWEDITOR, - "raweditor.open", - __tr2qs("Edit Raw Events..."), - __tr2qs("Shows a window that allows editing raw scripting events"), - KviActionManager::categoryScripting(), - "kvi_bigicon_raweditor.png", - KVI_SMALLICON_RAWEVENT, - 0, - "Ctrl+Alt+5"); - - SCRIPT_ACTION( - KVI_COREACTION_CODETESTER, - "codetester.open", - __tr2qs("New Script Tester"), - __tr2qs("Creates an embedded editor for long scripts"), - KviActionManager::categoryScripting(), - "kvi_bigicon_codetester.png", - KVI_SMALLICON_BOMB, - 0, - QString::null); - - SCRIPT_ACTION( - KVI_COREACTION_EXECUTEKVS, - "dialog.file(open,$tr(\"Select a Script File\")){ if(!$str.isEmpty($0))parse $0; }", - __tr2qs("Execute Script..."), - __tr2qs("Allows executing a KVS script from file"), - KviActionManager::categoryScripting(), - "kvi_bigicon_folder.png", - KVI_SMALLICON_FOLDER, - 0, - "Ctrl+Alt+X"); - - SCRIPT_ACTION( - KVI_COREACTION_HELPINDEX, - "help", - __tr2qs("Help Index"), - __tr2qs("Shows the documentation index"), - KviActionManager::categoryGeneric(), - "kvi_bigicon_help.png", - KVI_SMALLICON_HELP, - 0, - "Ctrl+Alt+H"); - - SCRIPT_ACTION( - KVI_COREACTION_KVIRCMAILINGLIST, - "openurl http://www.kvirc.net/?id=mailinglist", - __tr2qs("Subscribe to the Mailing List"), - __tr2qs("Allows subscribing to the KVIrc mailing list"), - KviActionManager::categoryGeneric(), - "kvi_bigicon_mailinglist.png", - KVI_SMALLICON_MESSAGE, - 0, - QString::null); - - SCRIPT_ACTION( - KVI_COREACTION_KVIRCHOMEPAGE, - "openurl http://www.kvirc.net", - __tr2qs("KVIrc WWW"), - __tr2qs("Opens the KVIrc homepage"), - KviActionManager::categoryGeneric(), - "kvi_bigicon_kvircwww.png", - KVI_SMALLICON_KVIRC, - 0, - QString::null); - - SCRIPT_ACTION( - KVI_COREACTION_KVIRCRUHOMEPAGE, - "openurl http://www.kvirc.ru", - __tr2qs("KVIrc Russian WWW"), - __tr2qs("Opens the KVIrc homepage in russian"), - KviActionManager::categoryGeneric(), - "kvi_bigicon_kvircwww.png", - KVI_SMALLICON_KVIRC, - 0, - QString::null); - - SCRIPT_ACTION( - KVI_COREACTION_SCREENSHOT, - "theme.screenshot", - __tr2qs("Acquire Screenshot"), - __tr2qs("Acquires a Screenshot of the KVIrc main window"), - KviActionManager::categoryGeneric(), - "kvi_bigicon_screenshot.png", - KVI_SMALLICON_SCREENSHOT, - 0, - QString::null); - - - SLOT_ACTION( - KVI_COREACTION_CASCADEWINDOWS, - g_pFrame->mdiManager(), - SLOT(cascadeMaximized()), - __tr2qs("Cascade windows"), - __tr2qs("Arranges the MDI windows in a maximized-cascade fashion"), - KviActionManager::categoryGUI(), - "kvi_bigicon_cascadewindows.png", - KVI_SMALLICON_CASCADEWINDOWS, - 0, - QString::null); - - SLOT_ACTION( - KVI_COREACTION_TILEWINDOWS, - g_pFrame->mdiManager(), - SLOT(tile()), - __tr2qs("Tile windows"), - __tr2qs("Tiles the MDI windows with the currently selected tile method"), - KviActionManager::categoryGUI(), - "kvi_bigicon_tilewindows.png", - KVI_SMALLICON_TILEWINDOWS, - 0, - QString::null); - - SLOT_ACTION( - KVI_COREACTION_MINIMIZEALLWINDOWS, - g_pFrame->mdiManager(), - SLOT(minimizeAll()), - __tr2qs("Minimize all windows"), - __tr2qs("Minimized all the currently visible MDI windows"), - KviActionManager::categoryGUI(), - "kvi_bigicon_minimizeallwindows.png", - KVI_SMALLICON_MINIMIZE, - 0, - QString::null); - - SLOT_ACTION( - KVI_COREACTION_NEWIRCCONTEXT, - g_pFrame, - SLOT(newConsole()), - __tr2qs("New IRC Context"), - __tr2qs("Creates a new IRC context console"), - KviActionManager::categoryIrc(), - "kvi_bigicon_newirccontext.png", - KVI_SMALLICON_CONSOLE, - 0, - "Ctrl+Alt+N"); - - SLOT_ACTION( - KVI_COREACTION_QUITKVIRC, - g_pApp, - SLOT(quit()), - __tr2qs("Quit KVIrc"), - __tr2qs("Quits KVIrc closing all the current connections"), - KviActionManager::categoryGeneric(), - "kvi_bigicon_quit.png", - KVI_SMALLICON_QUITAPP, - 0, - QString::null); -} - - - - -KviIrcContextDisplayAction::KviIrcContextDisplayAction(QObject * pParent) -: KviAction(pParent, - QString(KVI_COREACTION_IRCCONTEXTDISPLAY), - __tr2qs("IRC Context Display"), - __tr2qs("Shows a small display with IRC context informations"), - KviActionManager::categoryIrc(), - "kvi_bigicon_irccontextdisplay.png", - KVI_SMALLICON_NONE, - NeedsContext | NeedsConnection) -{ -} - -void KviIrcContextDisplayAction::setup() -{ - KviAction::setup(); - connect(g_pFrame,SIGNAL(activeConnectionServerInfoChanged()),this,SLOT(activeContextStateChanged())); - connect(g_pFrame,SIGNAL(activeConnectionNickNameChanged()),this,SLOT(activeContextStateChanged())); - connect(g_pFrame,SIGNAL(activeConnectionUserModeChanged()),this,SLOT(activeContextStateChanged())); - connect(g_pFrame,SIGNAL(activeConnectionAwayStateChanged()),this,SLOT(activeContextStateChanged())); - connect(g_pFrame,SIGNAL(activeConnectionLagChanged()),this,SLOT(activeContextStateChanged())); -} - -bool KviIrcContextDisplayAction::addToPopupMenu(KviTalPopupMenu *p) -{ - // QT4SUX: Widgets can be no longer added to popup menus.. what about labels ? -#ifndef COMPILE_USE_QT4 - if(!setupDone())setup(); - KviIrcContextDisplay * w = new KviIrcContextDisplay(p,"kvirc.irccontextdisplay"); - registerWidget(w); - p->insertItem(w); -#endif - return true; -} - -QWidget * KviIrcContextDisplayAction::addToCustomToolBar(KviCustomToolBar *t) -{ - if(!setupDone())setup(); - KviIrcContextDisplay * w = new KviIrcContextDisplay(t,"kvirc.irccontextdisplay"); -#ifdef COMPILE_USE_QT4 - t->addWidget(w); -#endif - registerWidget(w); - return w; -} - -void KviIrcContextDisplayAction::activeContextChanged() -{ - if(m_pWidgetList) - { - for(QWidget * w = m_pWidgetList->first();w;w = m_pWidgetList->next()) - w->update(); - } -} - -void KviIrcContextDisplayAction::activeContextStateChanged() -{ - if(m_pWidgetList) - { - for(QWidget * w = m_pWidgetList->first();w;w = m_pWidgetList->next()) - w->update(); - } -} - -void KviIrcContextDisplayAction::setEnabled(bool) -{ - // does nothing here : always enabled! -} - - - - -KviSeparatorAction::KviSeparatorAction(QObject * pParent) -: KviAction(pParent, - QString(KVI_COREACTION_SEPARATOR), - __tr2qs("Separator"), - __tr2qs("Acts as a separator for other items: performs no action"), - KviActionManager::categoryGeneric(), - KVI_BIGICON_SEPARATOR, - KVI_SMALLICON_NONE, - 0) -{ -} - - -bool KviSeparatorAction::addToPopupMenu(KviTalPopupMenu *p) -{ - if(!setupDone())setup(); - p->insertSeparator(); - return true; -} - -QWidget * KviSeparatorAction::addToCustomToolBar(KviCustomToolBar *t) -{ - if(!setupDone())setup(); - QWidget * w = new KviCustomToolBarSeparator(t,"kvirc.separator"); - registerWidget(w); -#ifdef COMPILE_USE_QT4 - t->addWidget(w); -#endif - return w; -} - - - - - -KviConnectAction::KviConnectAction(QObject * pParent) -: KviAction(pParent, - QString(KVI_COREACTION_CONNECT), - __tr2qs("Connect/Disconnect"), - __tr2qs("Allows you to connect to a server or to terminate the current connection"), - KviActionManager::categoryIrc(), - KVI_BIGICON_CONNECTED, - KVI_SMALLICON_NONE, // no small icon for now - NeedsContext | NeedsConnection, - QString("Ctrl+Alt+C")) -{ -} - - -void KviConnectAction::reloadImages() -{ - activeContextStateChanged(); -} - -void KviConnectAction::activeContextChanged() -{ - activeContextStateChanged(); -} - -void KviConnectAction::activeContextStateChanged() -{ - - KviPointerList<QWidget> * bl = widgetList(); - if(!bl)return; - - QPixmap * p; - QString txt; - KviIrcContext * c = g_pFrame->activeContext(); - if(c) - { - switch(c->state()) - { - case KviIrcContext::Idle: - p = g_pIconManager->getBigIcon(KVI_BIGICON_DISCONNECTED); - txt = m_szConnectString; - break; - case KviIrcContext::Connecting: - case KviIrcContext::LoggingIn: - p = g_pIconManager->getBigIcon(KVI_BIGICON_CONNECTING); - txt = m_szAbortConnectionString; - break; - case KviIrcContext::Connected: - p = g_pIconManager->getBigIcon(KVI_BIGICON_CONNECTED); - txt = m_szDisconnectString; - break; - default: - p = 0; - break; - } - } else { - p = 0; - } - - if(p) - { - for(QToolButton * b = (QToolButton *)bl->first();b;b =(QToolButton *)bl->next()) - { - if(!b->isEnabled())b->setEnabled(true); - b->setPixmap(*p); - b->setTextLabel(txt); - } - } else { - for(QToolButton * b = (QToolButton *)bl->first();b;b = (QToolButton *)bl->next()) - { - if(b->isEnabled())b->setEnabled(false); - } - } -} - -void KviConnectAction::setup() -{ - KviAction::setup(); - m_szConnectString = __tr2qs("Connect"); - m_szAbortConnectionString = __tr2qs("Abort Connection"); - m_szDisconnectString = __tr2qs("Disconnect"); -} - -void KviConnectAction::activate() -{ - KviIrcContext * c = g_pFrame->activeContext(); - if(c)c->connectOrDisconnect(); -} - -bool KviConnectAction::addToPopupMenu(KviTalPopupMenu *p) -{ - if(!setupDone())setup(); - KviIrcContext * c = g_pFrame->activeContext(); - int id; - - - QString t; - if(c) - { - switch(c->state()) - { - case KviIrcContext::Idle: - t = m_szConnectString; - if(!m_szKeySequence.isEmpty())t += '\t' + m_szKeySequence; - p->insertItem(t,this,SLOT(activate())); - break; - case KviIrcContext::Connecting: - case KviIrcContext::LoggingIn: - t = m_szAbortConnectionString; - if(!m_szKeySequence.isEmpty())t += '\t' + m_szKeySequence; - p->insertItem(t,this,SLOT(activate())); - break; - case KviIrcContext::Connected: - t = m_szDisconnectString; - if(!m_szKeySequence.isEmpty())t += '\t' + m_szKeySequence; - p->insertItem(t,this,SLOT(activate())); - break; - default: - t = m_szConnectString; - if(!m_szKeySequence.isEmpty())t += '\t' + m_szKeySequence; - id = p->insertItem(t,this,SLOT(activate())); - p->setItemEnabled(id,false); - break; - } - } else { - t = m_szConnectString; - if(!m_szKeySequence.isEmpty())t += '\t' + m_szKeySequence; - id = p->insertItem(t,this,SLOT(activate())); - p->setItemEnabled(id,false); - } - return true; -} - -QWidget * KviConnectAction::addToCustomToolBar(KviCustomToolBar *t) -{ - if(!setupDone())setup(); - QToolButton * b = new KviStyledToolButton( - *(g_pIconManager->getBigIcon(KVI_BIGICON_DISCONNECTED)), - m_szConnectString, - m_szConnectString, - this,SLOT(activate()),t,name()); - registerWidget(b); -#ifdef COMPILE_USE_QT4 - t->addWidget(b); -#endif - activeContextStateChanged(); - return b; -} - - - - - - - -KviSubmenuAction::KviSubmenuAction(QObject * pParent, - const QString &szName, - const QString &szScriptCode, - const QString &szVisibleName, - const QString &szDescription, - KviActionCategory * pCategory, - const QString &szBigIcon, - int iSmallIconId, - unsigned int uFlags) - : KviKvsAction(pParent, - szName, - szScriptCode, - szVisibleName, - szDescription, - pCategory, - szBigIcon, - iSmallIconId, - uFlags) -{ - m_pPopup = 0; -} - -KviSubmenuAction::~KviSubmenuAction() -{ - if(m_pPopup)delete m_pPopup; -} - -void KviSubmenuAction::setup() -{ - KviKvsAction::setup(); - if(!m_pPopup) - { - m_pPopup = new KviTalPopupMenu(); - connect(m_pPopup,SIGNAL(aboutToShow()),this,SLOT(popupAboutToShow())); - connect(m_pPopup,SIGNAL(activated(int)),this,SLOT(popupActivated(int))); - } -} - -void KviSubmenuAction::popupAboutToShow() -{ -} - -void KviSubmenuAction::popupActivated(int) -{ -} - -bool KviSubmenuAction::addToPopupMenu(KviTalPopupMenu *p) -{ - if(!setupDone())setup(); - int id = p->insertItem(*(smallIcon()),visibleName(),m_pPopup); - if(!isEnabled())p->setItemEnabled(id,false); - return true; -} - -QWidget * KviSubmenuAction::addToCustomToolBar(KviCustomToolBar *t) -{ - if(!setupDone())setup(); - KviStyledToolButton * b = new KviStyledToolButton( - *(bigIcon()), - visibleName(), - visibleName(), - this,SLOT(activate()),t,name()); - b->setPopup(m_pPopup); - -#ifdef COMPILE_USE_QT4 - b->setPopupMode( scriptCode().isEmpty() ? QToolButton::InstantPopup : QToolButton::MenuButtonPopup); - t->addWidget(b); -#else - b->setShowSubmenuIndicator(true); - b->setPopupDelay(1); -#endif - registerWidget(b); - if(!isEnabled())b->setEnabled(false); - return b; -} - - - - - - -KviJoinChannelAction::KviJoinChannelAction(QObject * pParent) -: KviSubmenuAction(pParent, - QString(KVI_COREACTION_CHANNELMENU), - QString("channelsjoin.open"), - __tr2qs("Join Channel"), - __tr2qs("Shows a popup menu that allows quickly selecting a channel to join"), - KviActionManager::categoryIrc(), - "kvi_bigicon_channelspopup.png", - KVI_SMALLICON_CHANNEL, - NeedsConnection | NeedsContext) -{ -} - -void KviJoinChannelAction::popupAboutToShow() -{ - KviConsole * c = g_pActiveWindow->console(); - if(!c)return; - - g_pApp->fillRecentChannelsPopup(m_pPopup,c); - - m_pPopup->insertSeparator(); - m_pPopup->insertItem(*(smallIcon()),__tr2qs("Other...")); -} - -void KviJoinChannelAction::popupActivated(int id) -{ - KviConsole * c = g_pActiveWindow->console(); - if(!c)return; - - QString text = m_pPopup->text(id); - if(!text.isEmpty()) - { - QString szText; - if(__tr2qs("Other...") == text)szText = "channelsjoin.open"; - else { - szText = text; - szText.prepend("join "); - } - KviKvsScript::run(szText,c); - } -} - - - -KviChangeNickAction::KviChangeNickAction(QObject * pParent) -: KviSubmenuAction(pParent, - QString(KVI_COREACTION_NICKNAMEMENU), - QString("dialog.textinput(\"Change Nickname\",\"Please enter the new nickname\",\"Cancel\",\"default=OK\"){ if($0 == 1)nick $1; }"), - __tr2qs("Change Nickname"), - __tr2qs("Shows a popup menu that allows quickly changing the nickname"), - KviActionManager::categoryIrc(), - "kvi_bigicon_nickpopup.png", - KVI_SMALLICON_NICK, - NeedsConnection | NeedsContext) -{ -} - -void KviChangeNickAction::popupAboutToShow() -{ - KviConsole * c = g_pActiveWindow->console(); - if(!c)return; - - g_pApp->fillRecentNicknamesPopup(m_pPopup,c); - - m_pPopup->insertSeparator(); - m_pPopup->insertItem(*(smallIcon()),__tr2qs("Other...")); -} - -void KviChangeNickAction::popupActivated(int id) -{ - KviConsole * c = g_pActiveWindow->console(); - if(!c)return; - - QString text = m_pPopup->text(id); - if(!text.isEmpty()) - { - QString szText; - if(__tr2qs("Other...") == text) - { - activate(); - } else { - szText = text; - szText.prepend("nick "); - KviKvsScript::run(szText,c); - } - } -} - - - - - - -KviConnectToServerAction::KviConnectToServerAction(QObject * pParent) -: KviSubmenuAction(pParent, - QString(KVI_COREACTION_SERVERMENU), - QString("options.edit KviServerOptionsWidget"), - __tr2qs("Connect To"), - __tr2qs("Shows a popup menu that allows quickly connecting to a server"), - KviActionManager::categoryIrc(), - "kvi_bigicon_server.png", - KVI_SMALLICON_SERVER, - NeedsContext) -{ -} - -void KviConnectToServerAction::popupAboutToShow() -{ - g_pApp->fillRecentServersPopup(m_pPopup); - m_pPopup->insertSeparator(); - m_pPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SERVER)),__tr2qs("Other...")); -} - -void KviConnectToServerAction::popupActivated(int id) -{ - KviConsole * c = g_pActiveWindow->console(); - if(!c)return; - - QString text = m_pPopup->text(id); - if(!text.isEmpty()) - { - if(__tr2qs("Other...") == text) - { - activate(); - } else { - KviStr szCommand; - KviStr szText = text; - if(KviIrcUrl::parse(szText.ptr(),szCommand,KVI_IRCURL_CONTEXT_THIS)) - { - KviKvsScript::run(szCommand.ptr(),c); - } - } - } -} - - - - - -KviChangeUserModeAction::KviChangeUserModeAction(QObject * pParent) -: KviSubmenuAction(pParent, - QString(KVI_COREACTION_USERMODEMENU), - QString(""), - __tr2qs("User Mode"), - __tr2qs("Shows a popup menu that allows quickly changing user modes"), - KviActionManager::categoryIrc(), - "kvi_bigicon_usermode.png", - KVI_SMALLICON_MODE, - NeedsContext | NeedsConnection) -{ -} - -void KviChangeUserModeAction::popupAboutToShow() -{ - KviConsole * c = g_pActiveWindow->console(); - if(!c)return; - - m_pPopup->clear(); - int id; - QString szModes = g_pActiveWindow->console()->connection()->serverInfo()->supportedUserModes(); - - id = m_pPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_WALLOPS)),__tr2qs("Wallops (+w)")); - m_pPopup->setItemChecked(id,c->connection()->userInfo()->hasUserMode('w')); - id = m_pPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SERVERNOTICE)),__tr2qs("Server Notices (+s)")); - m_pPopup->setItemChecked(id,c->connection()->userInfo()->hasUserMode('s')); - id = m_pPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_INVISIBLE)),__tr2qs("Invisible (+i)")); - m_pPopup->setItemChecked(id,c->connection()->userInfo()->hasUserMode('i')); - - szModes.replace("w",""); - szModes.replace("s",""); - szModes.replace("i",""); - while(!szModes.isEmpty()) - { - QChar ccc = szModes[0]; - szModes.remove(0,1); - id = m_pPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MODE)),QString("+%1 Mode").arg(ccc)); - m_pPopup->setItemChecked(id,c->connection()->userInfo()->hasUserMode(ccc.latin1())); - } -} - -void KviChangeUserModeAction::popupActivated(int id) -{ - KviConsole * c = g_pActiveWindow->console(); - if(!c)return; - - QString text = m_pPopup->text(id); - if(!c->isConnected())return; - if(!text.isEmpty()) - { - int idx = text.find('+'); - if(idx != -1) - { - idx++; - if(idx < text.length()) - { - QChar m = text[idx]; - QString command = "mode "; - command.append(c->connection()->userInfo()->nickName()); - command.append(c->connection()->userInfo()->hasUserMode(m) ? " -" : " +"); - command.append(m); - KviKvsScript::run(command,c); - } - } - } -} - - -KviGoAwayAction::KviGoAwayAction(QObject * pParent) -: KviKvsAction(pParent, - QString(KVI_COREACTION_AWAYBACK), - QString("if($away())back; else away;"), - __tr2qs("Away/Back"), - __tr2qs("Allows entering and leaving away state"), - KviActionManager::categoryIrc(), - "kvi_bigicon_nokeyboard.png", - KVI_SMALLICON_NOTAWAY, - KviKvsAction::NeedsContext | KviKvsAction::NeedsConnection, - "Ctrl+Alt+A") -{ -} - -void KviGoAwayAction::reloadImages() -{ - activeContextStateChanged(); -} - -void KviGoAwayAction::activeContextChanged() -{ - activeContextStateChanged(); -} - -void KviGoAwayAction::activeContextStateChanged() -{ - KviPointerList<QWidget> * bl = widgetList(); - if(!bl)return; - - QPixmap * p; - QString txt; - KviIrcContext * c = g_pFrame->activeContext(); - if(c) - { - if(c->state() == KviIrcContext::Connected) - { - if(c->connection()->userInfo()->isAway()) - { - p = g_pIconManager->getBigIcon("kvi_bigicon_keyboard.png"); - txt = m_szBackString; - } else { - p = g_pIconManager->getBigIcon("kvi_bigicon_nokeyboard.png"); - txt = m_szAwayString; - } - } else { - p = 0; - } - } else { - p = 0; - } - - if(p) - { - for(QToolButton * b = (QToolButton *)bl->first();b;b =(QToolButton *)bl->next()) - { - if(!b->isEnabled())b->setEnabled(true); - b->setPixmap(*p); - b->setTextLabel(txt); - } - m_uInternalFlags |= KVI_ACTION_FLAG_ENABLED; - } else { - for(QToolButton * b = (QToolButton *)bl->first();b;b = (QToolButton *)bl->next()) - { - if(b->isEnabled())b->setEnabled(false); - } - m_uInternalFlags &= ~KVI_ACTION_FLAG_ENABLED; - } -} - -void KviGoAwayAction::setup() -{ - KviKvsAction::setup(); - m_szAwayString = __tr2qs("Enter Away Mode"); - m_szBackString = __tr2qs("Leave Away Mode"); - connect(g_pFrame,SIGNAL(activeConnectionAwayStateChanged()),this,SLOT(activeContextStateChanged())); -} - -bool KviGoAwayAction::addToPopupMenu(KviTalPopupMenu *p) -{ - if(!setupDone())setup(); - KviIrcContext * c = g_pFrame->activeContext(); - int id; - QString t; - if(c) - { - if(c->state() == KviIrcContext::Connected) - { - if(c->connection()->userInfo()->isAway()) - { - t = m_szBackString; - if(!m_szKeySequence.isEmpty())t += '\t' + m_szKeySequence; - p->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_AWAY)),t,this,SLOT(activate())); - } else { - t = m_szAwayString; - if(!m_szKeySequence.isEmpty())t += '\t' + m_szKeySequence; - p->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NOTAWAY)),t,this,SLOT(activate())); - } - } else { - t = m_szAwayString; - if(!m_szKeySequence.isEmpty())t += '\t' + m_szKeySequence; - id = p->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NOTAWAY)),t,this,SLOT(activate())); - p->setItemEnabled(id,false); - } - } else { - t = m_szAwayString; - if(!m_szKeySequence.isEmpty())t += '\t' + m_szKeySequence; - id = p->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NOTAWAY)),t,this,SLOT(activate())); - p->setItemEnabled(id,false); - } - return true; -} - -QWidget * KviGoAwayAction::addToCustomToolBar(KviCustomToolBar *t) -{ - if(!setupDone())setup(); - QToolButton * b = new KviStyledToolButton( - *(g_pIconManager->getBigIcon("kvi_bigicon_nokeyboard.png")), - m_szAwayString, - m_szAwayString, - this,SLOT(activate()),t,name()); - registerWidget(b); -#ifdef COMPILE_USE_QT4 - t->addWidget(b); -#endif - activeContextStateChanged(); - return b; -} - - - - - - - - - - - -KviIrcToolsAction::KviIrcToolsAction(QObject * pParent) -: KviSubmenuAction(pParent, - QString(KVI_COREACTION_IRCTOOLS), - QString(""), - __tr2qs("Irc Tools"), - __tr2qs("Shows a popup menu with some IRC Tools"), - KviActionManager::categoryIrc(), - "kvi_bigicon_tools.png", - KVI_SMALLICON_NONE, - NeedsConnection | NeedsContext) -{ -} - -void KviIrcToolsAction::popupAboutToShow() -{ - m_pPopup->clear(); - KviAction * a; - a = KviActionManager::instance()->getAction(KVI_COREACTION_SOCKETSPY); - if(a)a->addToPopupMenu(m_pPopup); - a = KviActionManager::instance()->getAction(KVI_COREACTION_SEPARATOR); - if(a)a->addToPopupMenu(m_pPopup); - a = KviActionManager::instance()->getAction(KVI_COREACTION_CHANNELLIST); - if(a)a->addToPopupMenu(m_pPopup); - a = KviActionManager::instance()->getAction(KVI_COREACTION_NETWORKLINKS); - if(a)a->addToPopupMenu(m_pPopup); -} - -void KviIrcToolsAction::popupActivated(int id) -{ -} - - - - - - -KviIrcOperationsAction::KviIrcOperationsAction(QObject * pParent) -: KviSubmenuAction(pParent, - QString(KVI_COREACTION_IRCACTIONS), - QString(""), - __tr2qs("Irc Actions"), - __tr2qs("Shows a popup menu with some IRC Actions"), - KviActionManager::categoryIrc(), - "kvi_bigicon_actions.png", - KVI_SMALLICON_NONE, - NeedsConnection | NeedsContext) -{ -} - -void KviIrcOperationsAction::popupAboutToShow() -{ - m_pPopup->clear(); - KviAction * a; - a = KviActionManager::instance()->getAction(KVI_COREACTION_AWAYBACK); - if(a)a->addToPopupMenu(m_pPopup); - a = KviActionManager::instance()->getAction(KVI_COREACTION_USERMODEMENU); - if(a)a->addToPopupMenu(m_pPopup); - a = KviActionManager::instance()->getAction(KVI_COREACTION_SEPARATOR); - if(a)a->addToPopupMenu(m_pPopup); - a = KviActionManager::instance()->getAction(KVI_COREACTION_CHANNELMENU); - if(a)a->addToPopupMenu(m_pPopup); - a = KviActionManager::instance()->getAction(KVI_COREACTION_NICKNAMEMENU); - if(a)a->addToPopupMenu(m_pPopup); - a = KviActionManager::instance()->getAction(KVI_COREACTION_SEPARATOR); - if(a)a->addToPopupMenu(m_pPopup); - a = KviActionManager::instance()->getAction(KVI_COREACTION_SERVERMENU); - if(a)a->addToPopupMenu(m_pPopup); -} - -void KviIrcOperationsAction::popupActivated(int id) -{ -} - - diff --git a/3.4.0/src/kvirc/kernel/kvi_coreactions.h b/3.4.0/src/kvirc/kernel/kvi_coreactions.h deleted file mode 100644 index e92de96014..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_coreactions.h +++ /dev/null @@ -1,188 +0,0 @@ -#ifndef _KVI_COREACTIONS_H_ -#define _KVI_COREACTIONS_H_ -//============================================================================= -// -// File : kvi_coreactions.h -// Created on Mon 22 Nov 2004 02:30:47 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_action.h" -#include "kvi_kvs_action.h" -#include "kvi_pointerlist.h" - -#include <qtoolbutton.h> - -class KviConnectAction : public KviAction -{ - Q_OBJECT -public: - KviConnectAction(QObject * pParent); -protected: - QString m_szConnectString; - QString m_szAbortConnectionString; - QString m_szDisconnectString; -public: - virtual bool addToPopupMenu(KviTalPopupMenu *p); - virtual QWidget * addToCustomToolBar(KviCustomToolBar *t); -protected: - virtual void setup(); - virtual void reloadImages(); - virtual void activate(); - virtual void activeContextChanged(); - virtual void activeContextStateChanged(); -}; - -class KviSeparatorAction : public KviAction -{ - Q_OBJECT -public: - KviSeparatorAction(QObject * pParent); -public: - virtual bool addToPopupMenu(KviTalPopupMenu *p); - virtual QWidget * addToCustomToolBar(KviCustomToolBar *t); -}; - -class KviTalPopupMenu; - -class KviSubmenuAction : public KviKvsAction -{ - Q_OBJECT -public: - KviSubmenuAction(QObject * pParent, - const QString &szName, - const QString &szScriptCode, - const QString &szVisibleName, - const QString &szDescription, - KviActionCategory * pCategory = 0, - const QString &szBigIcon = QString::null, - int iSmallIconId = 0, - unsigned int uFlags = 0); - ~KviSubmenuAction(); -protected: - KviTalPopupMenu * m_pPopup; -protected: - virtual void setup(); -public: - virtual bool addToPopupMenu(KviTalPopupMenu *p); - virtual QWidget * addToCustomToolBar(KviCustomToolBar *t); -protected slots: - virtual void popupAboutToShow(); - virtual void popupActivated(int id); -}; - -class KviJoinChannelAction : public KviSubmenuAction -{ - Q_OBJECT -public: - KviJoinChannelAction(QObject * pParent); -protected slots: - virtual void popupAboutToShow(); - virtual void popupActivated(int); -}; - -class KviChangeNickAction : public KviSubmenuAction -{ - Q_OBJECT -public: - KviChangeNickAction(QObject * pParent); -protected slots: - void popupAboutToShow(); - void popupActivated(int); -}; - -class KviConnectToServerAction : public KviSubmenuAction -{ - Q_OBJECT -public: - KviConnectToServerAction(QObject * pParent); -protected slots: - void popupAboutToShow(); - void popupActivated(int); -}; - -class KviChangeUserModeAction : public KviSubmenuAction -{ - Q_OBJECT -public: - KviChangeUserModeAction(QObject * pParent); -protected slots: - void popupAboutToShow(); - void popupActivated(int); -}; - -class KviIrcToolsAction : public KviSubmenuAction -{ - Q_OBJECT -public: - KviIrcToolsAction(QObject * pParent); -protected slots: - void popupAboutToShow(); - void popupActivated(int); -}; - - -class KviIrcOperationsAction : public KviSubmenuAction -{ - Q_OBJECT -public: - KviIrcOperationsAction(QObject * pParent); -protected slots: - void popupAboutToShow(); - void popupActivated(int); -}; - -#include "kvi_irctoolbar.h" - -class KviIrcContextDisplayAction : public KviAction -{ - Q_OBJECT -public: - KviIrcContextDisplayAction(QObject * pParent); -public: - virtual bool addToPopupMenu(KviTalPopupMenu *p); - virtual QWidget * addToCustomToolBar(KviCustomToolBar *t); - virtual void activeContextStateChanged(); - virtual void activeContextChanged(); - virtual void setEnabled(bool); - virtual void setup(); -}; - - -class KviGoAwayAction : public KviKvsAction -{ - Q_OBJECT -public: - KviGoAwayAction(QObject * pParent); -protected: - QString m_szAwayString; - QString m_szBackString; -public: - virtual bool addToPopupMenu(KviTalPopupMenu *p); - virtual QWidget * addToCustomToolBar(KviCustomToolBar *t); -protected: - virtual void setup(); - virtual void reloadImages(); - virtual void activeContextChanged(); - virtual void activeContextStateChanged(); -}; - -#endif //!_KVI_COREACTIONS_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_customtoolbardescriptor.cpp b/3.4.0/src/kvirc/kernel/kvi_customtoolbardescriptor.cpp deleted file mode 100644 index ab46789401..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_customtoolbardescriptor.cpp +++ /dev/null @@ -1,278 +0,0 @@ -//============================================================================= -// -// File : kvi_customtoolbardescriptor.cpp -// Created on Sun 05 Dec 2004 18:20:58 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_customtoolbardescriptor.h" -#include "kvi_customtoolbar.h" -#include "kvi_config.h" -#include "kvi_action.h" -#include "kvi_actionmanager.h" -#include "kvi_app.h" -#include "kvi_locale.h" -#include "kvi_kvs_script.h" -#include "kvi_window.h" - -KviCustomToolBarDescriptor::KviCustomToolBarDescriptor(const QString &szId,const QString &szLabelCode) -{ - m_iInternalId = g_pApp->getGloballyUniqueId(); - m_szId = szId; - m_pActions = new KviPointerList<QString>; - m_pActions->setAutoDelete(true); - m_pToolBar = 0; - m_bVisibleAtStartup = false; - createLabelScript(szLabelCode); -} - -KviCustomToolBarDescriptor::~KviCustomToolBarDescriptor() -{ - if(m_pToolBar)delete m_pToolBar; // first kill the toolbar (so eventually leave it sync the actions) - delete m_pActions; // THEN kill the actions - delete m_pLabelScript; -} - -void KviCustomToolBarDescriptor::createLabelScript(const QString &szLabelCode) -{ - QString szTmp = "toolbar::"; - szTmp += m_szId; - szTmp += "::label"; - m_pLabelScript = new KviKvsScript(szTmp,szLabelCode,KviKvsScript::Parameter); -} - -const QString & KviCustomToolBarDescriptor::label() -{ - if(!m_pLabelScript->run(g_pActiveWindow,0,m_szParsedLabel))m_szParsedLabel = m_pLabelScript->code(); - return m_szParsedLabel; -} - -const QString & KviCustomToolBarDescriptor::labelCode() -{ - return m_pLabelScript->code(); -} - -bool KviCustomToolBarDescriptor::addAction(const QString &szAction) -{ - KviAction *a = KviActionManager::instance()->getAction(szAction); - if(a) - { - m_pActions->append(new QString(szAction)); - if(m_pToolBar)a->addToCustomToolBar(m_pToolBar); - return true; - } - return false; -} - -bool KviCustomToolBarDescriptor::removeAction(unsigned int iAction) -{ - if(iAction >= m_pActions->count())return false; - if(!m_pActions->remove(iAction))return false; - if(m_pToolBar) - { - // need to refill it :/ - m_pToolBar->clear(); - fillToolBar(); - } - return true; -} - -bool KviCustomToolBarDescriptor::removeAction(const QString &szAction) -{ - for(QString *s = m_pActions->first();s;s = m_pActions->next()) - { - if(*s == szAction) - { - m_pActions->removeRef(s); - if(m_pToolBar) - { - // need to refill it :/ - m_pToolBar->clear(); - fillToolBar(); - } - return true; - } - } - return false; -} - -void KviCustomToolBarDescriptor::updateToolBar() -{ - if(!m_pToolBar)return; - m_pToolBar->clear(); - fillToolBar(); -} - - -void KviCustomToolBarDescriptor::fillToolBar() -{ - if(m_pActions->count() == 0) - { - // force layout of the toolbar - QApplication::postEvent(m_pToolBar,new QEvent(QEvent::LayoutHint)); - } else { - KviPointerList<QString> dying; - dying.setAutoDelete(false); - for(QString *p = m_pActions->first();p;p = m_pActions->next()) - { - KviAction *a = KviActionManager::instance()->getAction(*p); - if(a)a->addToCustomToolBar(m_pToolBar); - else dying.append(p); - } - for(QString *d = dying.first();d;d = dying.next()) - m_pActions->removeRef(d); - } -} - -KviCustomToolBar * KviCustomToolBarDescriptor::createToolBar() -{ - if(!m_pToolBar) - { - m_pToolBar = new KviCustomToolBar(this,label(),QT_DOCK_TOP,false,id().utf8().data()); - fillToolBar(); - } - return m_pToolBar; -} - -void KviCustomToolBarDescriptor::registerToolBar(KviCustomToolBar * t) -{ - m_pToolBar = t; -} - -void KviCustomToolBarDescriptor::unregisterToolBar(KviCustomToolBar * t) -{ - m_pToolBar = 0; -} - -void KviCustomToolBarDescriptor::rename(const QString &szNewLabelCode) -{ - delete m_pLabelScript; - createLabelScript(szNewLabelCode); - if(m_pToolBar)m_pToolBar->setLabel(label()); -} - -void KviCustomToolBarDescriptor::clear() -{ - m_pActions->clear(); - if(m_pToolBar) - { - delete m_pToolBar; - m_pToolBar = 0; - } -} - -#ifdef SCRIPTTOOLBARDESCRIPTOR_COMPAT -// THIS IS A COMPATIBILITY ENTRY ADDED AT 3.0.2 TIME THAT SHOULD BE DROPPED IN A COUPLE OF VERSION BUMPS! -#include "kvi_kvs_useraction.h" -#include "kvi_string.h" - -bool KviCustomToolBarDescriptor::loadScripttoolbarCompat(const char * szPrefix,KviConfig * cfg) -{ - m_pActions->clear(); - KviStr tmp; - tmp.sprintf("%s_Name",szPrefix); - m_szId = cfg->readQStringEntry(tmp.ptr(),""); - tmp.sprintf("%s_Label",szPrefix); - QString szLabelCode = cfg->readQStringEntry(tmp.ptr(),""); - if(szLabelCode.isEmpty())szLabelCode = "$tr(Unnamed)"; - delete m_pLabelScript; - createLabelScript(szLabelCode); - - tmp.sprintf("%s_Visible",szPrefix); - m_bVisibleAtStartup = (cfg->readIntEntry(tmp.ptr(),0) > 0); - tmp.sprintf("%s_Count",szPrefix); - unsigned int cnt = cfg->readUIntEntry(tmp.ptr(),0); - for(unsigned int i=0;i<cnt;i++) - { - tmp.sprintf("%s_%d",szPrefix,i); - KviStr tmp2; - tmp2.sprintf("%s_Type",tmp.ptr()); - tmp2 = cfg->readEntry(tmp2.ptr(),"separator"); - if(kvi_strEqualCI(tmp2.ptr(),"button")) - { - tmp2.sprintf("%s_Name",tmp.ptr()); - QString szName = cfg->readQStringEntry(tmp2.ptr(),""); - tmp2.sprintf("%s_Code",tmp.ptr()); - QString szCode = cfg->readQStringEntry(tmp2.ptr(),""); - tmp2.sprintf("%s_Icon",tmp.ptr()); - QString szIcon = cfg->readQStringEntry(tmp2.ptr(),""); - tmp2.sprintf("%s_Text",tmp.ptr()); - QString szText = cfg->readQStringEntry(tmp2.ptr(),""); - //tmp2.sprintf("%s_Enabled",tmp.ptr()); - //bool bEnabled = cfg->readBoolEntry(tmp2.ptr(),true); - - if(KviAction * old = KviActionManager::instance()->getAction(szName)) - { - if(!old->isKviUserActionNeverOverrideThis()) - szName = KviActionManager::instance()->nameForAutomaticAction(szName); - } - KviKvsUserAction * a = new KviKvsUserAction(KviActionManager::instance(), - szName,szCode,szText, - __tr2qs("Backward compatibility action for toolbar.define"), - "generic",szIcon,szIcon,0); - KviActionManager::instance()->registerAction(a); - m_pActions->append(new QString(szName)); - } else { - m_pActions->append(new QString("separator")); - } - } - return true; -} -#endif - -bool KviCustomToolBarDescriptor::load(KviConfig * cfg) -{ - m_pActions->clear(); - m_szId = cfg->group(); - QString szLabelCode = cfg->readQStringEntry("Label"); - if(szLabelCode.isEmpty())szLabelCode = "$tr(Unnamed)"; - delete m_pLabelScript; - createLabelScript(szLabelCode); - m_szIconId = cfg->readQStringEntry("IconId",""); - unsigned int n = cfg->readUIntEntry("Count",0); - QString tmp; - for(unsigned int i=0;i<n;i++) - { - tmp.setNum(i); - QString * p = new QString(cfg->readQStringEntry(tmp)); - if(p->isEmpty())delete p; - else m_pActions->append(p); - } - return true; -} - -void KviCustomToolBarDescriptor::save(KviConfig * cfg) -{ - cfg->setGroup(m_szId); - cfg->writeEntry("Label",m_pLabelScript->code()); - cfg->writeEntry("Count",m_pActions->count()); - if(!m_szIconId.isEmpty())cfg->writeEntry("IconId",m_szIconId); - int i = 0; - QString tmp; - for(QString * p = m_pActions->first();p;p = m_pActions->next()) - { - tmp.setNum(i); - cfg->writeEntry(tmp,*p); - i++; - } -} - diff --git a/3.4.0/src/kvirc/kernel/kvi_customtoolbardescriptor.h b/3.4.0/src/kvirc/kernel/kvi_customtoolbardescriptor.h deleted file mode 100644 index 2c39df119b..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_customtoolbardescriptor.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef _KVI_CUSTOMTOOLBARDESCRIPTOR_H_ -#define _KVI_CUSTOMTOOLBARDESCRIPTOR_H_ -//============================================================================= -// -// File : kvi_customtoolbardescriptor.h -// Created on Sun 05 Dec 2004 18:20:58 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_pointerlist.h" - -class KviCustomToolBar; -class KviConfig; -class KviKvsScript; - - -// THIS IS A COMPATIBILITY ENTRY ADDED AT 3.0.2 TIME THAT SHOULD BE DROPPED IN A COUPLE OF VERSION BUMPS! -#define SCRIPTTOOLBARDESCRIPTOR_COMPAT 1 - -class KVIRC_API KviCustomToolBarDescriptor -{ - friend class KviCustomToolBar; - friend class KviCustomToolBarManager; -protected: - KviCustomToolBarDescriptor(const QString &szId,const QString &szLabelCode); -public: - ~KviCustomToolBarDescriptor(); -protected: - QString m_szId; - QString m_szIconId; - QString m_szParsedLabel; - KviPointerList<QString> * m_pActions; - KviCustomToolBar * m_pToolBar; - int m_iInternalId; - bool m_bVisibleAtStartup; - KviKvsScript * m_pLabelScript; -public: - const QString & iconId(){ return m_szIconId; }; - const QString & label(); - const QString & labelCode(); - const QString & id(){ return m_szId; }; - int internalId(){ return m_iInternalId; }; // useful only for KviFrame - KviCustomToolBar * toolBar(){ return m_pToolBar; }; - KviCustomToolBar * createToolBar(); - void setIconId(const QString &szIconId){ m_szIconId = szIconId; }; - bool addAction(const QString &szAction); - bool removeAction(const QString &szAction); - bool removeAction(unsigned int iAction); - void clear(); - void rename(const QString &szNewName); - KviPointerList<QString> * actions(){ return m_pActions; }; - void updateToolBar(); -protected: - void createLabelScript(const QString &szNewLabelCode); - void fillToolBar(); - bool load(KviConfig * cfg); -#ifdef SCRIPTTOOLBARDESCRIPTOR_COMPAT -// THIS IS A COMPATIBILITY ENTRY ADDED AT 3.0.2 TIME THAT SHOULD BE DROPPED IN A COUPLE OF VERSION BUMPS! - bool loadScripttoolbarCompat(const char * prefix,KviConfig * cfg); -#endif - void save(KviConfig * cfg); - void registerToolBar(KviCustomToolBar * t); - void unregisterToolBar(KviCustomToolBar * t); -}; - - -#endif //!_KVI_CUSTOMTOOLBARDESCRIPTOR_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_customtoolbarmanager.cpp b/3.4.0/src/kvirc/kernel/kvi_customtoolbarmanager.cpp deleted file mode 100644 index 034c086eaf..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_customtoolbarmanager.cpp +++ /dev/null @@ -1,239 +0,0 @@ -//============================================================================= -// -// File : kvi_customtoolbarmanager.cpp -// Created on Sun 05 Dec 2004 18:20:18 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_customtoolbarmanager.h" -#include "kvi_customtoolbardescriptor.h" -#include "kvi_config.h" -#include "kvi_locale.h" - -KviCustomToolBarManager * KviCustomToolBarManager::m_pInstance = 0; - -KviCustomToolBarManager::KviCustomToolBarManager() -{ - m_pDescriptors = new KviPointerHashTable<QString,KviCustomToolBarDescriptor>(17,false); - m_pDescriptors->setAutoDelete(true); -} - -KviCustomToolBarManager::~KviCustomToolBarManager() -{ - delete m_pDescriptors; -} - -KviCustomToolBar * KviCustomToolBarManager::firstExistingToolBar() -{ - KviPointerHashTableIterator<QString,KviCustomToolBarDescriptor> it(*m_pDescriptors); - while(KviCustomToolBarDescriptor * d = it.current()) - { - if(d->toolBar())return d->toolBar(); - ++it; - } - return 0; -} - -void KviCustomToolBarManager::init() -{ - if(!m_pInstance)m_pInstance = new KviCustomToolBarManager(); -} - -void KviCustomToolBarManager::done() -{ - if(m_pInstance) - { - delete m_pInstance; - m_pInstance = 0; - } -} - -QString KviCustomToolBarManager::idForNewToolBar(const QString &szTemplate) -{ - QString s; - QString szTT = szTemplate.lower(); - szTT.remove(" "); - szTT.remove("$tr"); - szTT.remove("("); - szTT.remove(")"); - szTT.remove("\""); - int idx = 0; - for(;;) - { - s = szTT; - if(idx > 0) - { - QString tmp; - tmp.setNum(idx); - s += tmp; - } - if(!m_pDescriptors->find(s))return s; - idx++; - } - return s; -} - -KviCustomToolBarDescriptor * KviCustomToolBarManager::findDescriptorByInternalId(int id) -{ - KviPointerHashTableIterator<QString,KviCustomToolBarDescriptor> it(*m_pDescriptors); - while(KviCustomToolBarDescriptor * d = it.current()) - { - if(d->internalId() == id)return d; - ++it; - } - return 0; -} - -bool KviCustomToolBarManager::renameDescriptor(const QString &szId,const QString &szNewId,const QString &szNewLabelCode) -{ - KviCustomToolBarDescriptor * d = m_pDescriptors->find(szId); - if(!d)return false; - d->rename(szNewLabelCode); - if(szId == szNewId)return true; // already done - m_pDescriptors->setAutoDelete(false); - m_pDescriptors->remove(szId); - m_pDescriptors->replace(szNewId,d); - m_pDescriptors->setAutoDelete(true); - return true; -} - -bool KviCustomToolBarManager::destroyDescriptor(const QString &szId) -{ - KviCustomToolBarDescriptor * d = m_pDescriptors->find(szId); - if(!d)return false; - m_pDescriptors->remove(szId); // will delete it too! - return true; -} - -void KviCustomToolBarManager::clear() -{ - m_pDescriptors->clear(); // bye! -} - -KviCustomToolBarDescriptor * KviCustomToolBarManager::create(const QString &szId,const QString &szLabelCode) -{ - KviCustomToolBarDescriptor * d = m_pDescriptors->find(szId); - if(d)return d; - d = new KviCustomToolBarDescriptor(szId,szLabelCode); - m_pDescriptors->replace(szId,d); - return d; -} - -void KviCustomToolBarManager::storeVisibilityState() -{ - KviPointerHashTableIterator<QString,KviCustomToolBarDescriptor> it(*m_pDescriptors); - while(KviCustomToolBarDescriptor * d = it.current()) - { - d->m_bVisibleAtStartup = d->toolBar() != 0; - ++it; - } - -} - -int KviCustomToolBarManager::visibleToolBarCount() -{ - int cnt = 0; - KviPointerHashTableIterator<QString,KviCustomToolBarDescriptor> it(*m_pDescriptors); - while(KviCustomToolBarDescriptor * d = it.current()) - { - if(d->toolBar() != 0)cnt++; - ++it; - } - return cnt; -} - -void KviCustomToolBarManager::createToolBarsVisibleAtStartup() -{ - KviPointerHashTableIterator<QString,KviCustomToolBarDescriptor> it(*m_pDescriptors); - while(KviCustomToolBarDescriptor * d = it.current()) - { - if(d->m_bVisibleAtStartup && (!d->toolBar())) - d->createToolBar(); - ++it; - } -} - -void KviCustomToolBarManager::updateVisibleToolBars() -{ - KviPointerHashTableIterator<QString,KviCustomToolBarDescriptor> it(*m_pDescriptors); - while(KviCustomToolBarDescriptor * d = it.current()) - { - if(d->toolBar())d->updateToolBar(); - ++it; - } -} - -void KviCustomToolBarManager::load(const QString &szFileName) -{ - KviConfig cfg(szFileName,KviConfig::Read); - - KviConfigIterator it(*(cfg.dict())); - while(it.current()) - { - cfg.setGroup(it.currentKey()); - KviCustomToolBarDescriptor * d = new KviCustomToolBarDescriptor(it.currentKey(),QString::null); - d->m_bVisibleAtStartup = (cfg.readIntEntry("Visible",0) > 0); - if(!d->load(&cfg))delete d; - else m_pDescriptors->replace(it.currentKey(),d); - ++it; - } -} - -void KviCustomToolBarManager::save(const QString &szFileName) -{ - KviConfig cfg(szFileName,KviConfig::Write); - KviPointerHashTableIterator<QString,KviCustomToolBarDescriptor> it(*m_pDescriptors); - while(KviCustomToolBarDescriptor * d = it.current()) - { - cfg.setGroup(d->id()); - cfg.writeEntry("Visible",d->m_bVisibleAtStartup ? 1 : 0); - d->save(&cfg); - ++it; - } -} - - -// THIS IS A COMPATIBILITY ENTRY ADDED AT 3.0.2 TIME THAT SHOULD BE DROPPED IN A COUPLE OF VERSION BUMPS! -#ifdef SCRIPTTOOLBAR_COMPAT - -#include <qdir.h> -void KviCustomToolBarManager::loadScripttoolbarsCompat(const QString &szFileName) -{ - KviConfig cfg(szFileName,KviConfig::Read); - - unsigned int cnt = cfg.readUIntEntry("Count",0); - KviStr tmp; - - for(unsigned int i=0;i<cnt;i++) - { - tmp.sprintf("%d",i); - KviCustomToolBarDescriptor * d = new KviCustomToolBarDescriptor(QString::null,QString::null); - if(!d->loadScripttoolbarCompat(tmp.ptr(),&cfg))delete d; - else m_pDescriptors->replace(d->id(),d); - } - - // get rid of the file now... - QString szNewFileName = szFileName + ".old"; - QDir d; - d.rename(szFileName,szNewFileName); -} -#endif diff --git a/3.4.0/src/kvirc/kernel/kvi_customtoolbarmanager.h b/3.4.0/src/kvirc/kernel/kvi_customtoolbarmanager.h deleted file mode 100644 index 1ae47ab536..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_customtoolbarmanager.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef _KVI_CUSTOMTOOLBARMANAGER_H_ -#define _KVI_CUSTOMTOOLBARMANAGER_H_ -//============================================================================= -// -// File : kvi_customtoolbarmanager.h -// Created on Sun 05 Dec 2004 18:20:18 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_pointerhashtable.h" - -#ifdef COMPILE_ON_WINDOWS - #include "kvi_customtoolbardescriptor.h" -#else - class KviCustomToolBarDescriptor; -#endif - -class KviCustomToolBar; - -// THIS IS A COMPATIBILITY ENTRY ADDED AT 3.0.2 TIME THAT SHOULD BE DROPPED IN A COUPLE OF VERSION BUMPS! -#define SCRIPTTOOLBAR_COMPAT 1 - -class KVIRC_API KviCustomToolBarManager -{ -protected: - KviCustomToolBarManager(); - ~KviCustomToolBarManager(); -protected: - static KviCustomToolBarManager * m_pInstance; - KviPointerHashTable<QString,KviCustomToolBarDescriptor> * m_pDescriptors; -public: - static KviCustomToolBarManager * instance(){ return m_pInstance; }; - static void init(); - static void done(); - void clear(); - int descriptorCount(){ return m_pDescriptors->count(); }; - int visibleToolBarCount(); - QString idForNewToolBar(const QString &szTemplate); - KviPointerHashTable<QString,KviCustomToolBarDescriptor> * descriptors(){ return m_pDescriptors; }; - KviCustomToolBar * firstExistingToolBar(); - KviCustomToolBarDescriptor * create(const QString &szId,const QString &szLabelCode); - KviCustomToolBarDescriptor * find(const QString &szId){ return m_pDescriptors->find(szId); }; - KviCustomToolBarDescriptor * findDescriptorByInternalId(int id); - void updateVisibleToolBars(); - void createToolBarsVisibleAtStartup(); - void storeVisibilityState(); - bool renameDescriptor(const QString &szId,const QString &szNewId,const QString &szNewLabelCode); - bool destroyDescriptor(const QString &szId); - void load(const QString &szFileName); - // THIS IS A COMPATIBILITY ENTRY ADDED AT 3.0.2 TIME THAT SHOULD BE DROPPED IN A COUPLE OF VERSION BUMPS! -#ifdef SCRIPTTOOLBAR_COMPAT - void loadScripttoolbarsCompat(const QString &szFileName); -#endif - void save(const QString &szFileName); -}; - - -#endif //!_KVI_CUSTOMTOOLBARMANAGER_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_filetransfer.cpp b/3.4.0/src/kvirc/kernel/kvi_filetransfer.cpp deleted file mode 100644 index 53f89edc89..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_filetransfer.cpp +++ /dev/null @@ -1,190 +0,0 @@ -//============================================================================= -// -// File : kvi_filetransfer.cpp -// Creation date : Mon Apr 21 22:14:31 2003 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_filetransfer.h" -#include "kvi_moduleextension.h" -#include "kvi_window.h" - -#include "kvi_app.h" - -#include "kvi_tal_listview.h" -#include "kvi_tal_popupmenu.h" - -static KviFileTransferManager * g_pFileTransferManager = 0; - - -KviFileTransferManager::KviFileTransferManager() -: QObject() -{ - m_pTransferList = 0; - m_pTransferWindow = 0; -} - -KviFileTransferManager::~KviFileTransferManager() -{ - killAllTransfers(); -} - -KviFileTransferManager * KviFileTransferManager::instance() -{ - if(!g_pFileTransferManager)g_pFileTransferManager = new KviFileTransferManager(); - return g_pFileTransferManager; -} - -void KviFileTransferManager::cleanup() -{ - if(!g_pFileTransferManager)return; - delete g_pFileTransferManager; - g_pFileTransferManager = 0; -} - -void KviFileTransferManager::killAllTransfers() -{ - while(m_pTransferList) - { - KviFileTransfer * t = m_pTransferList->first(); - t->die(); - } -} - -void KviFileTransferManager::killTerminatedTransfers() -{ - if(!m_pTransferList)return; - - KviPointerList<KviFileTransfer> l; - l.setAutoDelete(false); - - for(KviFileTransfer * f = m_pTransferList->first();f;f = m_pTransferList->next()) - { - if(f->terminated())l.append(f); - } - - for(KviFileTransfer * d = l.first();d;d = l.next()) - d->die(); -} - -void KviFileTransferManager::invokeTransferWindow(KviWindow * pWnd,bool bCreateMinimized,bool bNoRaise) -{ - if(!m_pTransferWindow) - { - KviPointerHashTable<QString,QVariant> d(7,false); - d.setAutoDelete(true); - d.replace("bCreateMinimized",new QVariant(bCreateMinimized,0)); - d.replace("bNoRaise",new QVariant(bNoRaise,0)); - - KviModuleExtensionManager::instance()->allocateExtension( - "tool", - KVI_FILE_TRANSFER_WINDOW_EXTENSION_NAME, - pWnd,&d,0, - "filetransferwindow"); - } -} - -void KviFileTransferManager::registerTransfer(KviFileTransfer * t) -{ - if(!m_pTransferList) - { - m_pTransferList = new KviPointerList<KviFileTransfer>; - m_pTransferList->setAutoDelete(false); - } - - m_pTransferList->append(t); - - emit transferRegistered(t); -} - -void KviFileTransferManager::unregisterTransfer(KviFileTransfer * t) -{ - if(!m_pTransferList) - { - debug("Ops: unregistering transfer with no transfer list!"); - return; - } - - emit transferUnregistering(t); - - m_pTransferList->removeRef(t); - if(m_pTransferList->isEmpty()) - { - delete m_pTransferList; - m_pTransferList = 0; - } -} - - - -KviFileTransfer::KviFileTransfer() -: QObject() -{ - m_pDisplayItem = 0; - m_iId = g_pApp->getGloballyUniqueId(); - manager()->registerTransfer(this); -} - -KviFileTransfer::~KviFileTransfer() -{ - manager()->unregisterTransfer(this); -} - -KviWindow * KviFileTransfer::outputWindow() -{ - KviWindow * o = transferWindow(); - if(o)return o; - return g_pActiveWindow; -} - -void KviFileTransfer::invokeTransferWindow(KviWindow * pWnd,bool bCreateMinimized,bool bNoRaise) -{ - manager()->invokeTransferWindow(pWnd,bCreateMinimized,bNoRaise); -} - -QString KviFileTransfer::localFileName() -{ - return QString::null; -} - -QString KviFileTransfer::retryCommand() -{ - return QString::null; -} - -bool KviFileTransfer::terminated() -{ - return !active(); -} - -QString KviFileTransfer::tipText() -{ - return QString::null; -} - -int KviFileTransfer::displayHeight(int iLineSpacing) -{ - return iLineSpacing * 2; -} - -void KviFileTransfer::displayUpdate() -{ - if(m_pDisplayItem)m_pDisplayItem->repaint(); -} diff --git a/3.4.0/src/kvirc/kernel/kvi_filetransfer.h b/3.4.0/src/kvirc/kernel/kvi_filetransfer.h deleted file mode 100644 index 135a8c5a4e..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_filetransfer.h +++ /dev/null @@ -1,116 +0,0 @@ -#ifndef _KVI_FILETRANSFER_H_ -#define _KVI_FILETRANSFER_H_ - -//============================================================================= -// -// File : kvi_filetransfer.h -// Creation date : Mon Apr 21 22:14:31 2003 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qobject.h> - -#include "kvi_pointerlist.h" -#include "kvi_tal_listview.h" - -class KviFileTransfer; -class KviWindow; -class KviTalPopupMenu; -class QPainter; - -// This is for the external extension -#define KVI_FILE_TRANSFER_WINDOW_EXTENSION_NAME "File transfer extension" - - -class KVIRC_API KviFileTransferManager : public QObject -{ - friend class KviApp; - friend class KviFileTransfer; - friend class KviFileTransferWindow; - Q_OBJECT -public: - KviFileTransferManager(); - ~KviFileTransferManager(); -protected: - KviPointerList<KviFileTransfer> * m_pTransferList; - KviWindow * m_pTransferWindow; -protected: - static void cleanup(); - void registerTransfer(KviFileTransfer * t); - void unregisterTransfer(KviFileTransfer * t); - void setTransferWindow(KviWindow * wnd){ m_pTransferWindow = wnd; }; -public: - // might be zero! - KviWindow * transferWindow(){ return m_pTransferWindow; }; - static KviFileTransferManager * instance(); - KviPointerList<KviFileTransfer> * transferList(){ return m_pTransferList; }; - void invokeTransferWindow(KviWindow * pWnd = 0,bool bCreateMinimized = false,bool bNoRaise = false); - void killAllTransfers(); - void killTerminatedTransfers(); -signals: - void transferRegistered(KviFileTransfer *t); - void transferUnregistering(KviFileTransfer *t); -}; - -#define COLUMN_TRANSFERTYPE 0 -#define COLUMN_FILEINFO 1 -#define COLUMN_PROGRESS 2 - - -class KVIRC_API KviFileTransfer : public QObject -{ - Q_OBJECT -public: - KviFileTransfer(); - ~KviFileTransfer(); -protected: - int m_iId; - KviTalListViewItem * m_pDisplayItem; -public: - // This is called by KviFileTransferItem at any time - void setDisplayItem(KviTalListViewItem * i){ m_pDisplayItem = i; }; - int id(){ return m_iId; }; - // this is just a convenience function : it's equivalent to !active() - bool terminated(); - // This may be used to invoke the transfer window - void invokeTransferWindow(KviWindow * pWnd = 0,bool bCreateMinimized = false,bool bNoRaise = false); - KviFileTransferManager * manager(){ return KviFileTransferManager::instance(); }; - // this returns the pointer to the transfer window : may be 0! - KviWindow * transferWindow(){ return manager()->transferWindow(); }; - // this returns transferWindow() if not 0 , otherwise the application's active window - KviWindow * outputWindow(); - - // this may be called by the transfers to update the display when the state changes - void displayUpdate(); - - // this must be implemented by the transfer - virtual bool active() = 0; - virtual void displayPaint(QPainter * p,int column,int width,int height) = 0; - virtual QString tipText(); - virtual QString localFileName(); - virtual QString retryCommand(); - virtual int displayHeight(int iLineSpacing); - virtual void fillContextPopup(KviTalPopupMenu * m,int column) = 0; - virtual void die() = 0; -}; - -#endif //! _KVI_FILETRANSFER_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_iconmanager.cpp b/3.4.0/src/kvirc/kernel/kvi_iconmanager.cpp deleted file mode 100644 index 2c0aa55e9a..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_iconmanager.cpp +++ /dev/null @@ -1,924 +0,0 @@ -//================================================================================ -// -// File : kvi_iconmanager.cpp -// Creation date : Sat Jun 24 2000 14:50:11 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#define _KVI_ICONMANAGER_CPP_ - -#include "kvi_iconmanager.h" - -#include "kvi_imagelib.h" -#include "kvi_app.h" -#include "kvi_settings.h" -#include "kvi_defaults.h" -#include "kvi_locale.h" -#include "kvi_fileutils.h" -#include "kvi_options.h" - -#include <qlayout.h> -#include <qlabel.h> - -#ifndef COMPILE_USE_QT4 - // In Qt.4 we need to use QMimeData ? - #include <qdragobject.h> -#endif -#include <qcursor.h> - -#ifdef COMPILE_USE_QT4 - #include <qevent.h> -#endif - -// kvi_app.cpp -extern QPixmap * g_pUserChanStatePixmap; -extern QPixmap * g_pActivityMeterPixmap; - -KviIconManager * g_pIconManager = 0; - -static const char * g_szIconNames[KVI_NUM_SMALL_ICONS]= -{ - "none", // 0 - "close", // 1 - "maximize", // 2 - "minimize", // 3 - "restore", // 4 - "default", // 5 - "dock", // 6 - "undock", // 7 - "quitapp", // 8 - "console", // 9 - "floppy", // 10 - "parsererror", // 11 - "parserwarning", // 12 - "server", // 13 - "world", // 14 - "proxy", // 15 - "kvirc", // 16 - "cut", // 17 - "copy", // 18 - "paste", // 19 - "options", // 20 - "socketmessage", // 21 - "socketwarning", // 22 - "socketerror", // 23 - "systemerror", // 24 - "raw", // 25 - "systemwarning", // 26 - "systemmessage", // 27 - "unhandled", // 28 - "serverinfo", // 29 - "motd", // 30 - "channel", // 31 - "hidedoubleview", // 32 - "showdoubleview", // 33 - "op", // 34 - "voice", // 35 - "serverping", // 36 - "showlistview", // 37 - "hidelistview", // 38 - "join", // 39 - "part", // 40 - "unrecognized", // 41 - "topic", // 42 - "accept", // 43 - "discard", // 44 - "ownprivmsg", // 45 - "chanprivmsg", // 46 - "query", // 48 - "queryprivmsg", // 49 - "help", // 49 - "mdihelp", // 50 - "ctcpreply", // 51 - "ctcprequestreplied", // 52 - "ctcprequestignored", // 53 - "ctcprequestflood", // 54 - "ctcprequestunknown", // 55 - "action", // 56 - "avatar", // 57 - "quit", // 58 - "split", // 59 - "quitsplit", // 60 - "nick", // 61 - "deop", // 62 - "devoice", // 63 - "mode", // 64 - "key", // 65 - "limit", // 66 - "ban", // 67 - "unban", // 68 - "banexcept", // 69 - "banunexcept", // 70 - "inviteexcept", // 71 - "inviteunexcept", // 72 - "chanmode", // 73 - "chanmodehide", // 74 - "who", // 75 - "editor", // 76 - "dccrequest", // 77 - "dccmsg", // 78 - "dccerror", // 79 - "iconmanager", // 80 - "scriptcenter", // 81 - "bomb", // 82 - "event", // 83 - "eventnohandlers", // 84 - "handler", // 85 - "handlerdisabled", // 86 - "nicknameproblem", // 87 - "whoisuser", // 88 - "whoischannels", // 89 - "whoisidle", // 90 - "whoisserver", // 91 - "whoisother", // 92 - "time", // 93 - "notifyonline", // 94 - "notifyoffline", // 95 - "locked", // 96 - "unlocked", // 97 - "lockedoff", // 98 - "unlockedoff", // 99 - "ownprivmsgcrypted", // 100 - "chanprivmsgcrypted", // 101 - "queryprivmsgcrypted", // 102 - "dccchatmsg", // 103 - "dccchatmsgcrypted", // 104 - "irc", // 105 - "folder", // 106 - "home", // 107 - "bookmarks", // 108 - "spy", // 109 - "kick", // 110 - "linux", // 111 - "links", // 112 - "regusers", // 113 - "dockwidget", // 114 - "cascadewindows", // 115 - "maxvertical", // 116 - "maxhorizontal", // 117 - "tilewindows", // 118 - "log", // 119 - "spam", // 120 - "file", // 121 - "icq", // 122 - "icqyellow", // 123 - "icqred", // 124 - "icqblue", // 125 - "icqlightgreen", // 126 - "icqlightyellow", // 127 - "message", // 128 - "messagesent", // 129 - "bluesquare", // 130 - "violetsquare", // 131 - "yellowsquare", // 132 - "greensquare", // 133 - "blacksquare", // 134 - "redsquare", // 135 - "cyansquare", // 136 - "dkgreensquare", // 137 - "terminal", // 138 - "wallops", // 139 - "invisible", // 140 - "servernotice", // 141 - "gnutella", // 142 - "search", // 143 - "files", // 144 - "transfer", // 145 - "package", // 146 - "retry", // 147 - "idea", // 148 - "colors", // 149 - "gui", // 150 - "ircview", // 151 - "alias", // 152 - "channelnotice",// 153 - "channelnoticecrypted", // 154 - "querynotice", // 155 - "querynoticecrypted", // 156 - "servnotice", // 157 - "popup", // 158 - "prologue", // 159 - "epilogue", // 160 - "sharedfiles", // 161 - "ctcpreplyunknown", // 162 - "canvas", // 163 - "nickserv", // 164 - "chanserv", // 165 - "dccvoice", // 166 - "play", // 167 - "record", // 168 - "autotilewindows", // 169 - "away", // 170 - "ident", // 171 - "homepage", // 172 - "list", // 173 - "halfop", // 174 - "halfdeop", // 175 - "invite", // 176 - "multimedia", // 177 - "look", // 178 - "input", // 179 - "messages", // 180 - "querytrace", // 181 - "nochannel", // 182 - "broadcastprivmsg", // 183 - "broadcastnotice", // 184 - "url", // 185 - "rawevent", // 186 - "raweventnohandlers", // 187 - "mekick", // 188 - "meop", // 189 - "mevoice", // 190 - "medeop", // 191 - "medevoice", // 192 - "mehalfop", // 193 - "medehalfop", // 194 - "meban", // 195 - "meunban", // 196 - "mebanexcept", // 197 - "mebanunexcept", // 198 - "meinviteexcept", // 199 - "meinviteunexcept", // 200 - "classictaskbar", // 201 - "treetaskbar", // 202 - "ignore", // 203 - "userlist",// 204 - "stats", // 205 - "popupmenu", // 206 - "xy", // 207 - "irc0", // 208 - "irc1", // 209 - "irc2", // 210 - "irc3", // 211 - "irc4", // 212 - "irc5", // 213 - "heart", // 214 - "heartbroken", // 215 - "rose", // 215 - "biggrin", // 217 - "biggringlasses", // 218 - "biggrineyes", // 219 - "textexclamative", // 220 - "textpoints", // 221 - "kiss", // 222 - "surprised1", // 223 - "ugly", // 224 - "angry", // 225 - "surprised2", // 226 - "smile", // 227 - "tongue", // 228 - "ssl", // 229 - "cry", // 230 - "eye", // 231 - "deadchannel", // 232 - "deadquery", // 233 - "sound", // 234 - "toolbar", // 235 - "textencoding",// 236 - "newitem", // 237 - "newitembywizard", // 238 - "deleteitem", // 239 - "edititem", // 240 - "filetransfer", // 241 - "chanadmin", // 242 - "chanunadmin", // 243 - "mechanadmin", // 244 - "mechanunadmin", // 245 - "userop", // 246 - "deuserop", // 247 - "meuserop", // 248 - "medeuserop", // 249 - "applet", // 250 - "caption", // 251 - "transparent", // 252 - "alert", // 253 - "userwindow", // 254 - "statusbar", // 255 - "notaway", // 256 - "plus", // 257 - "minus", // 258 - "binarytext", // 259 - "chanowner", // 260 - "chanunowner", // 261 - "mechanowner", // 262 - "mechanunowner", // 263 - "afraid", // 264 - "tongue2", // 265 - "sayicon", // 266 - "saycolors", // 267 - "finger", // 268 - "scriptaction", // 269 - "tearsmile", // 270 - "shy", // 271 - "servererror", // 272 - "cafe", // 273 - "addons", // 274 - "chanowneraway", // 275 - "opaway", // 276 - "voiceaway", // 277 - "chanadminaway", // 278 - "useropaway", // 279 - "halfopaway", // 280 - "aliashighlighted", // 281 - "demoralized", // 282 - "slurp", // 283 - "namespace", // 284 - "saysmile", // 285 - "saykvs", // 286 - "themeoptions", // 287 - "bug", // 288 - "refresh", //289 - "theme", // 290 - "screenshot" // 291 -}; - -KviIconWidget::KviIconWidget() -#ifdef COMPILE_USE_QT4 -: QWidget(0,"global_icon_widget" /*,WType_TopLevel | WStyle_Customize | WStyle_Title | WStyle_StaysOnTop | WStyle_DialogBorder | WStyle_SysMenu | WStyle_Minimize*/) -#else -: QWidget(0,"global_icon_widget",WType_TopLevel | WStyle_Customize | WStyle_Title | WStyle_StaysOnTop | WStyle_DialogBorder | WStyle_SysMenu | WStyle_Minimize) -#endif -{ - init(); -} - -KviIconWidget::KviIconWidget(QWidget * par) -: QWidget(par,"global_icon_widget") -{ - init(); -} - -void KviIconWidget::init() -{ - setCaption(__tr2qs("Icon Table")); - setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ICONMANAGER))); - - int rows = KVI_NUM_SMALL_ICONS / 10; - if((rows * 10) < KVI_NUM_SMALL_ICONS)rows++; - QGridLayout * g = new QGridLayout(this,rows + 1,11,0,2); - int i; - for(i = 0;i < 10;i++) - { - KviStr tmp(KviStr::Format,"%d",i); - QLabel * l = new QLabel(tmp.ptr(),this); - g->addWidget(l,0,i + 1); - } - for(i = 0;i < rows;i++) - { - KviStr tmp(KviStr::Format,"%d",i * 10); - QLabel * l = new QLabel(tmp.ptr(),this); - g->addWidget(l,i + 1,0); - } - for(i = 0;i < KVI_NUM_SMALL_ICONS;i++) - { - KviStr tmp(KviStr::Format,"%d",i); - QLabel * l = new QLabel(this,tmp.ptr()); - l->setPixmap(*(g_pIconManager->getSmallIcon(i))); - g->addWidget(l,(i / 10) + 1,(i % 10) + 1); - l->installEventFilter(this); - l->setAcceptDrops(true); - } -} - -KviIconWidget::~KviIconWidget() -{ -} - -void KviIconWidget::closeEvent(QCloseEvent * e) -{ - e->ignore(); - emit closed(); -} - -bool KviIconWidget::eventFilter(QObject * o,QEvent *e) -{ - if(e->type() == QEvent::MouseButtonPress) - { - if(o->inherits("QLabel")) - { - KviStr szName = ((QLabel *)o)->name(); - bool bOk; - int iVal = szName.toInt(&bOk); - if(bOk)emit selected(iVal); - - if(parentWidget() && isVisible() && parentWidget()->inherits("KviTalPopupMenu")) - { - parentWidget()->close(); - return true; - } else { - if(const QPixmap * pix = ((QLabel *)o)->pixmap()) - { -// FIXME: In Qt 4.x this stuff needs to be ported to a different api.. which one ? -#ifndef COMPILE_USE_QT4 - QDragObject * drobj = new QTextDrag(o->name(),this); - drobj->setPixmap(*pix,((QLabel *)o)->mapFromGlobal(QCursor::pos())); - drobj->dragCopy(); -#endif - return true; - } - } - } - } else if(e->type() == QEvent::DragEnter) - { - ((QDragEnterEvent *)e)->accept(true); - return true; - } - return QWidget::eventFilter(o,e); -} - - - -KviCachedPixmap::KviCachedPixmap(QPixmap * ptr,const QString &szPath) -{ - m_szPath = szPath; - m_tLastAccess = kvi_unixTime(); - m_pPixmap = ptr; - m_uSize = m_pPixmap->width() * m_pPixmap->height() * (m_pPixmap->depth() / 8); -} - -KviCachedPixmap::~KviCachedPixmap() -{ - delete m_pPixmap; -} - -void KviCachedPixmap::updateLastAccessTime() -{ - m_tLastAccess = kvi_unixTime(); -} - - - - -KviIconManager::KviIconManager() -{ - int i=0; - for(i=0;i<KVI_NUM_SMALL_ICONS;i++)m_smallIcons[i] = 0; - - //loadSmallIcons(); - - m_pCachedImages = new KviPointerHashTable<QString,KviCachedPixmap>(21,true); - m_pCachedImages->setAutoDelete(true); - - m_uCacheTotalSize = 0; - m_uCacheMaxSize = 1024 * 1024; // 1 MB - - m_pIconWidget = 0; - - KviStr buffer; - - // Load the userchanstate image - g_pApp->findImage(buffer,KVI_USERCHANSTATE_IMAGE_NAME); - g_pUserChanStatePixmap = new QPixmap(buffer.ptr()); - - g_pApp->findImage(buffer,KVI_ACTIVITYMETER_IMAGE_NAME); - g_pActivityMeterPixmap = new QPixmap(buffer.ptr()); - - m_pIconNames = 0; - - // TEMP - - /* - for(i=0;i<KVI_NUM_SMALL_ICONS;i++) - { - QPixmap * tmp = getSmallIcon(i); - QString nnn = "/home/pragma/kvismallicons/kcs_"; - nnn += g_szIconNames[i]; - nnn += ".png"; - if(tmp->isNull()) - { - debug("OPS, %s is NULL",nnn.latin1()); - } - if(!tmp->save(nnn,"PNG",90)) - { - debug("FAILED TO SAVE %s",nnn.latin1()); - } - } - */ -} - -KviIconManager::~KviIconManager() -{ - delete g_pUserChanStatePixmap; - delete g_pActivityMeterPixmap; - - if(m_pIconWidget)delete m_pIconWidget; - int i; - - for(i=0;i<KVI_NUM_SMALL_ICONS;i++) - { - if(m_smallIcons[i])delete m_smallIcons[i]; - } - delete m_pCachedImages; - if(m_pIconNames)delete m_pIconNames; -} - -const char * KviIconManager::getSmallIconName(int idx) -{ - return g_szIconNames[idx]; -} - -int KviIconManager::getSmallIconIdFromName(const QString &szName) -{ - if(!m_pIconNames) - { - m_pIconNames = new KviPointerHashTable<QString,int>(257,false); - m_pIconNames->setAutoDelete(true); - - for(int i=0;i<KVI_NUM_SMALL_ICONS;i++) - { - int * pInt = new int; - *pInt = i; - m_pIconNames->replace(QString(g_szIconNames[i]),pInt); - } - } - int * pInt = m_pIconNames->find(szName); - if(!pInt)return 0; - return *pInt; -} - - -void KviIconManager::showIconWidget() -{ - if(!m_pIconWidget) - { - m_pIconWidget = new KviIconWidget(); - connect(m_pIconWidget,SIGNAL(closed()),this,SLOT(iconWidgetClosed())); - } - m_pIconWidget->show(); - m_pIconWidget->raise(); - m_pIconWidget->setFocus(); -} - -void KviIconManager::iconWidgetClosed() -{ - delete m_pIconWidget; - m_pIconWidget = 0; -} - -/* - @doc: image_id - @title: - The image identifier - @keyterms: - image identifier, using builtin images, how kvirc locates image files - @type: - language - @short: - Semantics of the <image_id> parameter - @body: - Some KVIrc commands and functions accept - the <image_id> as a parameter. - The <image_id> indicates an image to be displayed - by some gui element. Since KVIrc has a set of - builtin icons, we want the user to be able to use it :).[br] - The <image_id> can be either a signed integer number - or a filename.[br] - If it is a signed integer it is interpreted as - index of the internal KVIrc image to use: - positive integers (starting at 0) indicate - small (16x16) icons (the ones used in the view widget).[br] - If <image_id> is anything else than a signed integer, - it is interpreted as a filename. - The filename can be an absolute file path or a relative one. - In this last case KVIrc will look for the file in a predefined set - of directories: First in the local "pics" directory (usually - in ~/kvirc-version/pics/), then in the local "incoming" directory, - then in the global "pics" directory , then in the user home (~) - and in the current directory.[br] -*/ - -KviCachedPixmap * KviIconManager::getPixmapWithCache(const QString &szName) -{ - if(szName.isEmpty())return 0; - - KviCachedPixmap * p = m_pCachedImages->find(szName); - - if(p) - { - p->updateLastAccessTime(); - return p; - } - - QPixmap * pix = 0; - - QString szRetPath; - - if(g_pApp->findImage(szRetPath,szName)) - { - pix = new QPixmap(szRetPath); - if(pix->isNull()) - { - delete pix; // it is not an valid image!!! (really bad situation...) - pix = 0; - return 0; - } - } else { - return 0; - } - - p = new KviCachedPixmap(pix,QString(szRetPath)); - addToCache(szName,p); - - return p; -} - -KviCachedPixmap * KviIconManager::getPixmapWithCacheScaleOnLoad(const QString &szName,int iMaxWidth,int iMaxHeight) -{ - if(szName.isEmpty())return 0; - - KviCachedPixmap * p = m_pCachedImages->find(szName); - - if(p) - { - p->updateLastAccessTime(); - return p; - } - - QPixmap * pix = 0; - - QString szRetPath; - - if(g_pApp->findImage(szRetPath,szName)) - { - pix = new QPixmap(szRetPath); - if(pix->isNull()) - { - delete pix; // it is not an valid image!!! (really bad situation...) - pix = 0; - return 0; - } - if((pix->width() > iMaxWidth) || (pix->height() > iMaxHeight)) - { - // scale to fit - int scaleW = iMaxWidth; - int scaleH; - scaleH = (pix->height() * iMaxWidth) / pix->width(); - if(scaleH > iMaxHeight) - { - scaleH = iMaxHeight; - scaleW = (scaleH * pix->width()) / pix->height(); - } - - QImage img = pix->convertToImage(); - pix->convertFromImage(img.smoothScale(scaleW,scaleH)); - } - } else { - return 0; - } - - p = new KviCachedPixmap(pix,QString(szRetPath)); - addToCache(szName,p); - - return p; -} - - -void KviIconManager::addToCache(const QString &szName,KviCachedPixmap * p) -{ - if((m_uCacheTotalSize + p->size()) >= m_uCacheMaxSize)cacheCleanup(); - - m_pCachedImages->insert(szName,p); - m_uCacheTotalSize += p->size(); -} - -QPixmap * KviIconManager::getImage(const char * id,bool bCanBeNumber,QString* pRetPath) -{ - if(!id)return 0; - if(bCanBeNumber) - { - bool bOk; - QString tmp = id; - int idx = tmp.toInt(&bOk); - if(bOk) - { - // was a number : this is not a filename - if(idx >= 0)return getSmallIcon(idx % KVI_NUM_SMALL_ICONS); - } - } - - KviCachedPixmap * p = getPixmapWithCache(id); - if(!p)return 0; - if(pRetPath)*pRetPath = p->path(); - return p->pixmap(); -} - - - -QPixmap * KviIconManager::getBigIcon(const QString &szName) -{ - QPixmap * p = getPixmap(szName); - if(p)return p; - - bool bOk; - int idx = szName.toInt(&bOk); - if(bOk && (idx >= 0)) - { - // was a number : this is not a filename - // it was a small icon: scale it and cache it - QString tmpName = szName; - tmpName += ".scaled16to32"; - p = getPixmap(tmpName); - if(p)return p; - p = getSmallIcon(idx % KVI_NUM_SMALL_ICONS); - if(p) - { - QImage tmpi = p->convertToImage(); - QImage tmp2 = tmpi.smoothScale(32,32); - KviCachedPixmap * cp = new KviCachedPixmap(new QPixmap(tmp2),QString::null); - addToCache(tmpName,cp); - return cp->pixmap(); - } - } - - p = getPixmap("kvi_bigicon_unknown.png"); - if(p)return p; - KviCachedPixmap * cp = new KviCachedPixmap(new QPixmap(32,32),QString::null); - addToCache(szName,cp); - return cp->pixmap(); -} - -void KviIconManager::urlToCachedFileName(KviStr &szFName) -{ - szFName.replaceAll(':',"_"); - szFName.replaceAll(';',"_"); - szFName.replaceAll('/',"_"); - szFName.replaceAll('\\',"_"); - szFName.replaceAll("\"","_"); - szFName.replaceAll("\'","_"); - szFName.replaceAll("(","_"); - szFName.replaceAll(")","_"); - szFName.replaceAll("?","_"); - szFName.replaceAll("___","."); -} - -void KviIconManager::urlToCachedFileName(QString &szFName) -{ - szFName.replace(":","_"); - szFName.replace(";","_"); - szFName.replace("/","_"); - szFName.replace("\\","_"); - szFName.replace("\"","_"); - szFName.replace("\'","_"); - szFName.replace("(","_"); - szFName.replace(")","_"); - szFName.replace("?","_"); - szFName.replace("___","."); -} - -KviAvatar * KviIconManager::getAvatar(const QString &szLocalPath,const QString &szName) -{ - QString szP,szN; - - if(szLocalPath.isEmpty()) - { - if(szName.isEmpty())return 0; - if(KviQString::equalCIN("http://",szName,7)) - { - szN = szName; - szP = szName; - urlToCachedFileName(szP); - } else { - szN = KviFileUtils::extractFileName(szName); - szP = szName; - } - } else if(szName.isEmpty()) - { - if(szLocalPath.isEmpty())return 0; - szP = szLocalPath; - szN = KviFileUtils::extractFileName(szLocalPath); - } else { - szP = szLocalPath; - szN = szName; - } - - // avatars bigger than 1024x768 just sux: they can't be seen on tooltips anyway - KviCachedPixmap * p = KVI_OPTION_BOOL(KviOption_boolScaleAvatarsOnLoad) ? getPixmapWithCacheScaleOnLoad(szP, - KVI_OPTION_UINT(KviOption_uintScaleAvatarsOnLoadWidth) - ,KVI_OPTION_UINT(KviOption_uintScaleAvatarsOnLoadHeight)) : getPixmapWithCache(szP); - if(!p)return 0; - - return new KviAvatar(p->path(),szN,new QPixmap(*(p->pixmap()))); -} - -void KviIconManager::clearCache() -{ - m_pCachedImages->clear(); -} - -void KviIconManager::reloadImages() -{ - clearCache(); - for(int i=0;i<KVI_NUM_SMALL_ICONS;i++) - { - if(m_smallIcons[i])delete m_smallIcons[i]; - m_smallIcons[i] = 0; - } -} - - -QPixmap * KviIconManager::loadSmallIcon(int idx) -{ - if(idx >= KVI_NUM_SMALL_ICONS)return 0; - if(idx < 0)return 0; - - - // COMPATIBILITY ENTRY: To be removed in some time. - // This part loads the old smallicon library format kvi_smallicon_*.png - // to preserve backward compatibility with old themes. - // We lookup such files ONLY in the themes directories. - - QString szFileName = KVI_SMALLICONS_IMAGELIB_PREFIX; - - int fileidx = idx / 16; - - if(fileidx >= 10)KviQString::appendFormatted(szFileName,"%d.png",fileidx); - else KviQString::appendFormatted(szFileName,"0%d.png",fileidx); - - QString buffer; - if(g_pApp->findImageThemeOnlyCompat(buffer,szFileName)) - { - KviImageLibrary l1(buffer,16,16); - - int offset = fileidx * 16; - - for(int i=0;i<16;i++) - { - int io = i + offset; - if(io >= KVI_NUM_SMALL_ICONS)break; - if(m_smallIcons[io])delete m_smallIcons[io]; - m_smallIcons[io] = new QPixmap(l1.getImage(i)); - } - - return m_smallIcons[idx]; - } - - // otherwise we use the NEW method: separate small icons in the "coresmall" subdirectory. - QString szPath; - KviQString::sprintf(szPath,KVI_SMALLICONS_PREFIX "%s.png",g_szIconNames[idx]); - - g_pApp->findSmallIcon(buffer,szPath); - m_smallIcons[idx] = new QPixmap(buffer); - - //if(m_smallIcon[idx]->isNull()) - //{ - // // load an "unknown" image ?.. but should never happen - //} - return m_smallIcons[idx]; -} - -void KviIconManager::cacheCleanup() -{ - QStringList l; - - KviPointerHashTableIterator<QString,KviCachedPixmap> it(*m_pCachedImages); - - -//#warning "IMPLEMENT CLEANUP" -/* - while(it.current()) - { - kvi_time_t curTime = kvi_unixTime(); - - if((((unsigned int)it.current()->timestamp) - ((unsigned int)curTime)) > 120) - { - // unused since 2 minutes - // time to cleanup it... - l.append(new KviStr(it.currentKey())); - } - ++it; - } - - for(QStringList::Iterator it = l.begin();it != l.end();++it) - { - m_pCachedImages->remove(*it); - } -*/ -/* - for(KviStr * p =l.first();p;p = l.next()) - { - m_pCachedImages->remove(p->ptr()); - } - if(m_pCachedImages->isEmpty())m_pCleanupTimer->stop(); -*/ -} - -#include "kvi_iconmanager.moc" diff --git a/3.4.0/src/kvirc/kernel/kvi_iconmanager.h b/3.4.0/src/kvirc/kernel/kvi_iconmanager.h deleted file mode 100644 index e502443976..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_iconmanager.h +++ /dev/null @@ -1,501 +0,0 @@ -#ifndef _KVI_ICONMANAGER_H_ -#define _KVI_ICONMANAGER_H_ - -//============================================================================= -// -// File : kvi_iconmanager.h -// Creation date : Sat Jun 24 2000 14:49:24 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" -#include "kvi_avatar.h" -#include "kvi_time.h" - -#include <qpixmap.h> -#include <qobject.h> -#include <qwidget.h> -#include "kvi_pointerhashtable.h" - - - -#define KVI_SMALLICON_NONE 0 -#define KVI_SMALLICON_CLOSE 1 -#define KVI_SMALLICON_MAXIMIZE 2 -#define KVI_SMALLICON_MINIMIZE 3 -#define KVI_SMALLICON_RESTORE 4 -#define KVI_SMALLICON_DEFAULTICON 5 -#define KVI_SMALLICON_DOCK 6 -#define KVI_SMALLICON_UNDOCK 7 -#define KVI_SMALLICON_QUITAPP 8 -#define KVI_SMALLICON_CONSOLE 9 -#define KVI_SMALLICON_FLOPPY 10 -#define KVI_SMALLICON_PARSERERROR 11 -#define KVI_SMALLICON_PARSERWARNING 12 -#define KVI_SMALLICON_SERVER 13 -#define KVI_SMALLICON_WORLD 14 -#define KVI_SMALLICON_PROXY 15 -#define KVI_SMALLICON_KVIRC 16 -#define KVI_SMALLICON_CUT 17 -#define KVI_SMALLICON_COPY 18 -#define KVI_SMALLICON_PASTE 19 -#define KVI_SMALLICON_OPTIONS 20 -#define KVI_SMALLICON_SOCKETMESSAGE 21 -#define KVI_SMALLICON_SOCKETWARNING 22 -#define KVI_SMALLICON_SOCKETERROR 23 -#define KVI_SMALLICON_SYSTEMERROR 24 -#define KVI_SMALLICON_RAW 25 -#define KVI_SMALLICON_SYSTEMWARNING 26 -#define KVI_SMALLICON_SYSTEMMESSAGE 27 -#define KVI_SMALLICON_UNHANDLED 28 -#define KVI_SMALLICON_SERVERINFO 29 -#define KVI_SMALLICON_MOTD 30 -#define KVI_SMALLICON_CHANNEL 31 -#define KVI_SMALLICON_HIDEDOUBLEVIEW 32 -#define KVI_SMALLICON_SHOWDOUBLEVIEW 33 -#define KVI_SMALLICON_OP 34 -#define KVI_SMALLICON_VOICE 35 -#define KVI_SMALLICON_SERVERPING 36 -#define KVI_SMALLICON_SHOWLISTVIEW 37 -#define KVI_SMALLICON_HIDELISTVIEW 38 -#define KVI_SMALLICON_JOIN 39 -#define KVI_SMALLICON_PART 40 -#define KVI_SMALLICON_UNRECOGNIZED 41 -#define KVI_SMALLICON_TOPIC 42 -#define KVI_SMALLICON_ACCEPT 43 -#define KVI_SMALLICON_DISCARD 44 -#define KVI_SMALLICON_OWNPRIVMSG 45 -#define KVI_SMALLICON_CHANPRIVMSG 46 -#define KVI_SMALLICON_QUERY 47 -#define KVI_SMALLICON_QUERYPRIVMSG 48 -#define KVI_SMALLICON_HELP 49 -#define KVI_SMALLICON_MDIHELP 50 -#define KVI_SMALLICON_CTCPREPLY 51 -#define KVI_SMALLICON_CTCPREQUESTREPLIED 52 -#define KVI_SMALLICON_CTCPREQUESTIGNORED 53 -#define KVI_SMALLICON_CTCPREQUESTFLOOD 54 -#define KVI_SMALLICON_CTCPREQUESTUNKNOWN 55 -#define KVI_SMALLICON_ACTION 56 -#define KVI_SMALLICON_AVATAR 57 -#define KVI_SMALLICON_QUIT 58 -#define KVI_SMALLICON_SPLIT 59 -#define KVI_SMALLICON_QUITSPLIT 60 -#define KVI_SMALLICON_NICK 61 -#define KVI_SMALLICON_DEOP 62 -#define KVI_SMALLICON_DEVOICE 63 -#define KVI_SMALLICON_MODE 64 -#define KVI_SMALLICON_KEY 65 -#define KVI_SMALLICON_LIMIT 66 -#define KVI_SMALLICON_BAN 67 -#define KVI_SMALLICON_UNBAN 68 -#define KVI_SMALLICON_BANEXCEPT 69 -#define KVI_SMALLICON_BANUNEXCEPT 70 -#define KVI_SMALLICON_INVITEEXCEPT 71 -#define KVI_SMALLICON_INVITEUNEXCEPT 72 -#define KVI_SMALLICON_CHANMODE 73 -#define KVI_SMALLICON_CHANMODEHIDE 74 -#define KVI_SMALLICON_WHO 75 -#define KVI_SMALLICON_EDITOR 76 -#define KVI_SMALLICON_DCCREQUEST 77 -#define KVI_SMALLICON_DCCMSG 78 -#define KVI_SMALLICON_DCCERROR 79 -#define KVI_SMALLICON_ICONMANAGER 80 -#define KVI_SMALLICON_SCRIPTCENTER 81 -#define KVI_SMALLICON_BOMB 82 -#define KVI_SMALLICON_EVENT 83 -#define KVI_SMALLICON_EVENTNOHANDLERS 84 -#define KVI_SMALLICON_HANDLER 85 -#define KVI_SMALLICON_HANDLERDISABLED 86 -#define KVI_SMALLICON_NICKNAMEPROBLEM 87 -#define KVI_SMALLICON_WHOISUSER 88 -#define KVI_SMALLICON_WHOISCHANNELS 89 -#define KVI_SMALLICON_WHOISIDLE 90 -#define KVI_SMALLICON_WHOISSERVER 91 -#define KVI_SMALLICON_WHOISOTHER 92 -#define KVI_SMALLICON_TIME 93 -#define KVI_SMALLICON_NOTIFYONLINE 94 -#define KVI_SMALLICON_NOTIFYOFFLINE 95 -#define KVI_SMALLICON_LOCKED 96 -#define KVI_SMALLICON_UNLOCKED 97 -#define KVI_SMALLICON_LOCKEDOFF 98 -#define KVI_SMALLICON_UNLOCKEDOFF 99 -#define KVI_SMALLICON_OWNPRIVMSGCRYPTED 100 -#define KVI_SMALLICON_CHANPRIVMSGCRYPTED 101 -#define KVI_SMALLICON_QUERYPRIVMSGCRYPTED 102 -#define KVI_SMALLICON_DCCCHATMSG 103 -#define KVI_SMALLICON_DCCCHATMSGCRYPTED 104 -#define KVI_SMALLICON_IRC 105 -#define KVI_SMALLICON_FOLDER 106 -#define KVI_SMALLICON_HOME 107 -#define KVI_SMALLICON_BOOKMARKS 108 -#define KVI_SMALLICON_SPY 109 -#define KVI_SMALLICON_KICK 110 -#define KVI_SMALLICON_LINUX 111 -#define KVI_SMALLICON_LINKS 112 -#define KVI_SMALLICON_REGUSERS 113 -#define KVI_SMALLICON_DOCKWIDGET 114 -#define KVI_SMALLICON_CASCADEWINDOWS 115 -#define KVI_SMALLICON_MAXVERTICAL 116 -#define KVI_SMALLICON_MAXHORIZONTAL 117 -#define KVI_SMALLICON_TILEWINDOWS 118 -#define KVI_SMALLICON_LOG 119 -#define KVI_SMALLICON_SPAM 120 -#define KVI_SMALLICON_FILE 121 -#define KVI_SMALLICON_ICQ 122 -#define KVI_SMALLICON_ICQYELLOW 123 -#define KVI_SMALLICON_ICQRED 124 -#define KVI_SMALLICON_ICQBLUE 125 -#define KVI_SMALLICON_ICQLIGHTGREEN 126 -#define KVI_SMALLICON_ICQLIGHTYELLOW 127 -#define KVI_SMALLICON_MESSAGE 128 -#define KVI_SMALLICON_MESSAGESENT 129 -#define KVI_SMALLICON_BLUESQUARE 130 -#define KVI_SMALLICON_VIOLETSQUARE 131 -#define KVI_SMALLICON_YELLOWSQUARE 132 -#define KVI_SMALLICON_GREENSQUARE 133 -#define KVI_SMALLICON_BLACKSQUARE 134 -#define KVI_SMALLICON_REDSQUARE 135 -#define KVI_SMALLICON_CYANSQUARE 136 -#define KVI_SMALLICON_DKGREENSQUARE 137 -#define KVI_SMALLICON_TERMINAL 138 -#define KVI_SMALLICON_WALLOPS 139 -#define KVI_SMALLICON_INVISIBLE 140 -#define KVI_SMALLICON_SERVERNOTICE 141 -#define KVI_SMALLICON_GNUTELLA 142 -#define KVI_SMALLICON_SEARCH 143 -#define KVI_SMALLICON_FILES 144 -#define KVI_SMALLICON_TRANSFER 145 -#define KVI_SMALLICON_PACKAGE 146 -#define KVI_SMALLICON_RETRY 147 -#define KVI_SMALLICON_IDEA 148 -#define KVI_SMALLICON_COLORS 149 -#define KVI_SMALLICON_GUI 150 -#define KVI_SMALLICON_IRCVIEW 151 -#define KVI_SMALLICON_ALIAS 152 -#define KVI_SMALLICON_CHANNELNOTICE 153 -#define KVI_SMALLICON_CHANNELNOTICECRYPTED 154 -#define KVI_SMALLICON_QUERYNOTICE 155 -#define KVI_SMALLICON_QUERYNOTICECRYPTED 156 -// FIXME: rename the icon 157: it was colliding with 141 -#define KVI_SMALLICON_SERVNOTICE 157 -#define KVI_SMALLICON_POPUP 158 -#define KVI_SMALLICON_PROLOGUE 159 -#define KVI_SMALLICON_EPILOGUE 160 -#define KVI_SMALLICON_SHAREDFILES 161 -#define KVI_SMALLICON_CTCPREPLYUNKNOWN 162 -#define KVI_SMALLICON_CANVAS 163 -#define KVI_SMALLICON_NICKSERV 164 -#define KVI_SMALLICON_CHANSERV 165 -#define KVI_SMALLICON_DCCVOICE 166 -#define KVI_SMALLICON_PLAY 167 -#define KVI_SMALLICON_RECORD 168 -#define KVI_SMALLICON_AUTOTILEWINDOWS 169 -#define KVI_SMALLICON_AWAY 170 -#define KVI_SMALLICON_IDENT 171 -#define KVI_SMALLICON_HOMEPAGE 172 -#define KVI_SMALLICON_LIST 173 -#define KVI_SMALLICON_HALFOP 174 -#define KVI_SMALLICON_HALFDEOP 175 -#define KVI_SMALLICON_INVITE 176 -#define KVI_SMALLICON_MULTIMEDIA 177 -#define KVI_SMALLICON_LOOK 178 -#define KVI_SMALLICON_INPUT 179 -#define KVI_SMALLICON_MESSAGES 180 -#define KVI_SMALLICON_QUERYTRACE 181 -#define KVI_SMALLICON_NOCHANNEL 182 -#define KVI_SMALLICON_BROADCASTPRIVMSG 183 -#define KVI_SMALLICON_BROADCASTNOTICE 184 -#define KVI_SMALLICON_URL 185 -#define KVI_SMALLICON_RAWEVENT 186 -#define KVI_SMALLICON_RAWEVENTNOHANDLERS 187 -#define KVI_SMALLICON_MEKICK 188 -#define KVI_SMALLICON_MEOP 189 -#define KVI_SMALLICON_MEVOICE 190 -#define KVI_SMALLICON_MEDEOP 191 -#define KVI_SMALLICON_MEDEVOICE 192 -#define KVI_SMALLICON_MEHALFOP 193 -#define KVI_SMALLICON_MEDEHALFOP 194 -#define KVI_SMALLICON_MEBAN 195 -#define KVI_SMALLICON_MEUNBAN 196 -#define KVI_SMALLICON_MEBANEXCEPT 197 -#define KVI_SMALLICON_MEBANUNEXCEPT 198 -#define KVI_SMALLICON_MEINVITEEXCEPT 199 -#define KVI_SMALLICON_MEINVITEUNEXCEPT 200 -#define KVI_SMALLICON_CLASSICTASKBAR 201 -#define KVI_SMALLICON_TREETASKBAR 202 -#define KVI_SMALLICON_IGNORE 203 -#define KVI_SMALLICON_USERLIST 204 -#define KVI_SMALLICON_STATS 205 -#define KVI_SMALLICON_POPUPMENU 206 -#define KVI_SMALLICON_XY 207 -#define KVI_SMALLICON_IRC0 208 -#define KVI_SMALLICON_IRC1 209 -#define KVI_SMALLICON_IRC2 210 -#define KVI_SMALLICON_IRC3 211 -#define KVI_SMALLICON_IRC4 212 -#define KVI_SMALLICON_IRC5 213 -#define KVI_SMALLICON_HEART 214 -#define KVI_SMALLICON_HEARTBROKEN 215 -#define KVI_SMALLICON_ROSE 216 -#define KVI_SMALLICON_BIGGRIN 217 -#define KVI_SMALLICON_BIGGRINGLASSES 218 -#define KVI_SMALLICON_BIGGRINEYES 219 -#define KVI_SMALLICON_TEXTEXCLAMATIVE 220 -#define KVI_SMALLICON_TEXTPOINTS 221 -#define KVI_SMALLICON_KISS 222 -#define KVI_SMALLICON_SURPRISED1 223 -#define KVI_SMALLICON_UGLY 224 -#define KVI_SMALLICON_ANGRY 225 -#define KVI_SMALLICON_SURPRISED2 226 -#define KVI_SMALLICON_SMILE 227 -#define KVI_SMALLICON_TONGUE 228 -#define KVI_SMALLICON_SSL 229 -#define KVI_SMALLICON_CRY 230 -#define KVI_SMALLICON_EYE 231 -#define KVI_SMALLICON_DEADCHANNEL 232 -#define KVI_SMALLICON_DEADQUERY 233 -#define KVI_SMALLICON_SOUND 234 -#define KVI_SMALLICON_TOOLBAR 235 -#define KVI_SMALLICON_TEXTENCODING 236 -#define KVI_SMALLICON_NEWITEM 237 -#define KVI_SMALLICON_NEWITEMBYWIZARD 238 -#define KVI_SMALLICON_DELETEITEM 239 -#define KVI_SMALLICON_EDITITEM 240 -#define KVI_SMALLICON_FILETRANSFER 241 -#define KVI_SMALLICON_CHANADMIN 242 -#define KVI_SMALLICON_CHANUNADMIN 243 -#define KVI_SMALLICON_MECHANADMIN 244 -#define KVI_SMALLICON_MECHANUNADMIN 245 -#define KVI_SMALLICON_USEROP 246 -#define KVI_SMALLICON_DEUSEROP 247 -#define KVI_SMALLICON_MEUSEROP 248 -#define KVI_SMALLICON_MEDEUSEROP 249 -#define KVI_SMALLICON_APPLET 250 -#define KVI_SMALLICON_CAPTION 251 -#define KVI_SMALLICON_TRANSPARENT 252 -#define KVI_SMALLICON_ALERT 253 -#define KVI_SMALLICON_USERWINDOW 254 -#define KVI_SMALLICON_STATUSBAR 255 -#define KVI_SMALLICON_NOTAWAY 256 -#define KVI_SMALLICON_PLUS 257 -#define KVI_SMALLICON_MINUS 258 -#define KVI_SMALLICON_BINARYTEXT 259 -#define KVI_SMALLICON_CHANOWNER 260 -#define KVI_SMALLICON_CHANUNOWNER 261 -#define KVI_SMALLICON_MECHANOWNER 262 -#define KVI_SMALLICON_MECHANUNOWNER 263 -#define KVI_SMALLICON_AFRAID 264 -#define KVI_SMALLICON_TONGUE2 265 -#define KVI_SMALLICON_SAYICON 266 -#define KVI_SMALLICON_SAYCOLORS 267 -#define KVI_SMALLICON_FINGER 268 -#define KVI_SMALLICON_SCRIPTACTION 269 -#define KVI_SMALLICON_TEARSMILE 270 -#define KVI_SMALLICON_SHY 271 -#define KVI_SMALLICON_SERVERERROR 272 -#define KVI_SMALLICON_CAFE 273 -#define KVI_SMALLICON_ADDONS 274 -#define KVI_SMALLICON_CHANOWNERAWAY 275 -#define KVI_SMALLICON_OPAWAY 276 -#define KVI_SMALLICON_VOICEAWAY 277 -#define KVI_SMALLICON_CHANADMINAWAY 278 -#define KVI_SMALLICON_USEROPAWAY 279 -#define KVI_SMALLICON_HALFOPAWAY 280 -#define KVI_SMALLICON_ALIASHIGHLIGHTED 281 -#define KVI_SMALLICON_DEMORALIZED 282 -#define KVI_SMALLICON_SLURP 283 -#define KVI_SMALLICON_NAMESPACE 284 -#define KVI_SMALLICON_SAYSMILE 285 -#define KVI_SMALLICON_SAYKVS 286 -#define KVI_SMALLICON_THEMEOPTIONS 287 -#define KVI_SMALLICON_BUG 288 -#define KVI_SMALLICON_REFRESH 289 -#define KVI_SMALLICON_THEME 290 -#define KVI_SMALLICON_SCREENSHOT 291 - -#define KVI_NUM_SMALL_ICONS 292 - - -#define KVI_BIGICON_DISCONNECTED "kvi_bigicon_disconnected.png" -#define KVI_BIGICON_CONNECTING "kvi_bigicon_connecting.png" -#define KVI_BIGICON_CONNECTED "kvi_bigicon_connected.png" -#define KVI_BIGICON_TOOLS "kvi_bigicon_tools.png" -#define KVI_BIGICON_ACTIONS "kvi_bigicon_actions.png" -#define KVI_BIGICON_FOLDER "kvi_bigicon_folder.png" -#define KVI_BIGICON_UNKNOWN "kvi_bigicon_unknown.png" -#define KVI_BIGICON_SEPARATOR "kvi_bigicon_separator.png" -#define KVI_BIGICON_KVS "kvi_bigicon_kvs.png" -#define KVI_BIGICON_THEME "kvi_bigicon_theme.png" -#define KVI_BIGICON_ADDONS "kvi_bigicon_addons.png" - -#define KVI_BIGICON_HELPINDEX "kvi_bigicon_helpindex.png" -#define KVI_BIGICON_HELPBACK "kvi_bigicon_helpback.png" -#define KVI_BIGICON_HELPFORWARD "kvi_bigicon_helpforward.png" -#define KVI_BIGICON_HELPCLOSE "kvi_bigicon_helpclose.png" -#define KVI_BIGICON_HELPSEARCH "kvi_bigicon_helpsearch.png" - -#define KVI_BIGICON_OPEN "kvi_bigicon_open.png" -#define KVI_BIGICON_SAVE "kvi_bigicon_save.png" -#define KVI_BIGICON_REMOVE "kvi_bigicon_remove.png" -#define KVI_BIGICON_WWW "kvi_bigicon_www.png" -#define KVI_BIGICON_PACK "kvi_bigicon_pack.png" -#define KVI_BIGICON_SCREENSHOT "kvi_bigicon_screenshot.png" -#define KVI_BIGICON_REGUSERS "kvi_bigicon_regusers.png" - -#define KVI_SMALLICONS_SUBDIRECTORY "coresmall" -#define KVI_SMALLICONS_PREFIX "kcs_" - -// FIXME: this should be removed -#define KVI_SMALLICONS_IMAGELIB_PREFIX "kvi_smallicon_" - -#define KVI_USERCHANSTATE_IMAGE_NAME "kvi_userchanstate.png" -#define KVI_ACTIVITYMETER_IMAGE_NAME "kvi_activitymeter.png" - -#define KVI_REFRESH_IMAGE_NAME "kvi_icon_refresh.png" - -class KviIconManager; - -class KVIRC_API KviCachedPixmap -{ -public: - // the pixmap MUST be allocated with new QPixmap() - // this calss takes the ownership - KviCachedPixmap(QPixmap * ptr,const QString &szPath); - ~KviCachedPixmap(); -private: - QString m_szPath; - kvi_time_t m_tLastAccess; - QPixmap * m_pPixmap; - unsigned int m_uSize; -public: - QPixmap * pixmap(){ return m_pPixmap; }; - const QString & path(){ return m_szPath; }; - unsigned int size(){ return m_uSize; }; - kvi_time_t lastAccessTime(){ return m_tLastAccess; }; - void updateLastAccessTime(); -}; - -class KVIRC_API KviIconWidget : public QWidget -{ - Q_OBJECT -public: - KviIconWidget(); - KviIconWidget(QWidget * par); - ~KviIconWidget(); -protected: - void init(); - virtual void closeEvent(QCloseEvent *e); - virtual bool eventFilter(QObject * o,QEvent *e); -signals: - void closed(); - void selected(int iIcon); -}; - - - -// -// This class manages the images used by KVIrc. -// -// We handle three types of images: builtin small icons, builtin big icons and generic images. -// -// The builtin small icons are in the pics/coresmall directory (this is to optimize the directory size -// since it's a linear search...), are 16x16 in size and are indexed by numbers in a way that their -// access is really fast. The icons used here are used mostly in KviIrcView (but not exclusively). -// -// The generic images are just "any" image that the underlying Qt engine -// is able to load. They are loaded by (relative) path and -// cached by name. -// -// The builtin big icons are (actually) just generic images -// that are eventually scaled to 32x32 if needed. One can request -// a builtin small icon indexed by number to be scaled -// to the size of 32x32 as a big icon too. -// - -class KVIRC_API KviIconManager : public QObject -{ - Q_OBJECT -public: - KviIconManager(); - ~KviIconManager(); -private: - QPixmap * m_smallIcons[KVI_NUM_SMALL_ICONS]; - KviIconWidget * m_pIconWidget; - - KviPointerHashTable<QString,KviCachedPixmap> * m_pCachedImages; - KviPointerHashTable<QString,int> * m_pIconNames; - unsigned int m_uCacheTotalSize; - unsigned int m_uCacheMaxSize; -public: - // WARNING: Don't store this pointer! - // id == filename | number that indicates an internal pixmap - // 0 stands for "any" - QPixmap * getImage(const char * id,bool bCanBeNumber = true,QString* pRetPath = 0); - - // The returned pointer is owned by the icon manager - // and can be deleted at any time : so don't store it - KviCachedPixmap * getPixmapWithCache(const QString &szName); - - // The returned pointer is owned by the icon manager - // and can be deleted at any time : so don't store it - KviCachedPixmap * getPixmapWithCacheScaleOnLoad(const QString &szName,int iMaxWidth,int iMaxHeight); - - // The returned pointer is owned by the icon manager - // and can be deleted at any time : so don't store it - QPixmap * getPixmap(const QString &szName) - { KviCachedPixmap * p = getPixmapWithCache(szName); return p ? p->pixmap() : 0; }; - - // this one never fails... if the image can't be found - // a default 32x32 image is returned - QPixmap * getBigIcon(const QString &szName); - - // this one never fails... if the icon isn't there - // then a default 16x16 image is returned - QPixmap * getSmallIcon(int idx){ return idx < KVI_NUM_SMALL_ICONS ? (m_smallIcons[idx] ? m_smallIcons[idx] : loadSmallIcon(idx) ) : 0; }; - - const char * getSmallIconName(int idx); - int getSmallIconIdFromName(const QString &szName); - - // if szLocalPath is empty then szName can be the identification - // string for the avatar - // if szName is empty then it is found from szLocalPath - KviAvatar * getAvatar(const QString &szLocalPath,const QString &szName); - - void urlToCachedFileName(KviStr &szFName); - void urlToCachedFileName(QString &szFName); - - void clearCache(); - void reloadImages(); - - void cacheCleanup(); -protected: - void addToCache(const QString &szName,KviCachedPixmap * p); - //void loadSmallIcons(); - QPixmap * loadSmallIcon(int idx); -public slots: - void showIconWidget(); -protected slots: - void iconWidgetClosed(); -}; - -extern KVIRC_API KviIconManager * g_pIconManager; - -#endif //_KVI_ICONMANAGER_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_internalcmd.cpp b/3.4.0/src/kvirc/kernel/kvi_internalcmd.cpp deleted file mode 100644 index 7e23b570db..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_internalcmd.cpp +++ /dev/null @@ -1,81 +0,0 @@ -// -// File : kvi_internalcmd.cpp -// Creation date : Sun Aug 13 2000 19:22:45 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#define _KVI_INTERNALCMD_CPP_ - -#include "kvi_internalcmd.h" - -// FIXME: #warning "LOCALIZE THIS!" - -static char * internalCommandTable[KVI_NUM_INTERNAL_COMMANDS]= -{ - "echo INTERNAL COMMAND ERROR: INDEX OUT OF RANGE", - "help.open -n -m index.html", - "help.open -n index.html", - "about.kvirc", - "if($option(boolShowGeneralOptionsDialogAsToplevel))options.dialog -t; else options.dialog", - "codetester.open", - "socketspy.open", - "links.open", - "if($option(boolShowRegisteredUsersDialogAsToplevel))reguser.edit -t; else reguser.edit", - "dockwidget.show", - "dockwidget.hide", - "toolbareditor.open", - "aliaseditor.open", - "term.open -m", - "eventeditor.open", - "dirbrowser.open -m", - "dirbrowser.open", - "ident.start", - "ident.stop", - "tip.open" , - "openurl http://www.kvirc.net", - "list.open", - "if($option(boolShowChannelsJoinDialogAsToplevel))channelsjoin.open -t;else channelsjoin.open", - "if($option(boolShowServersConnectDialogAsToplevel))options.edit -t KviServerOptionsWidget;else options.edit KviServerOptionsWidget", - "url.list", - "openurl http://www.kvirc.net/?id=themes", - "openurl http://www.kvirc.net/?id=mailinglist", - "openurl https://svn.kvirc.de/kvirc/newticket", - "raweditor.open", - "popupeditor.open", - "dialog.file(open,\"Select a Script File\"){ if(!$str.isEmpty($0))parse $0; }", - "actioneditor.open", - "quit", - "openurl http://www.kvirc.ru", - "openurl irc://freenode/kvirc", - "openurl irc://ircnet/kvirc", - "openurl irc://azzurra/kvirc.net", - "openurl http://kvirc-fr.info", - "openurl irc://freenode/kvirc-fr", - "openurl irc://irc.europnet.org/kvirc" -}; - - -char * kvi_getInternalCommandBuffer(int idx) -{ - if(idx > 0 && idx < KVI_NUM_INTERNAL_COMMANDS) - { - return internalCommandTable[idx]; - } - return internalCommandTable[0]; -} diff --git a/3.4.0/src/kvirc/kernel/kvi_internalcmd.h b/3.4.0/src/kvirc/kernel/kvi_internalcmd.h deleted file mode 100644 index f0d5ce95ef..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_internalcmd.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef _KVI_INTERNALCMD_H_ -#define _KVI_INTERNALCMD_H_ -// -// File : kvi_internalcmd.h -// Creation date : Sun Aug 13 2000 19:21:12 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#define KVI_INTERNALCOMMAND_ECHO_INTERNALERROR 0 -#define KVI_INTERNALCOMMAND_HELP_NEWMDIWINDOW 1 -#define KVI_INTERNALCOMMAND_HELP_NEWSTATICWINDOW 2 -#define KVI_INTERNALCOMMAND_ABOUT_ABOUTKVIRC 3 -#define KVI_INTERNALCOMMAND_OPTIONS_DIALOG 4 -#define KVI_INTERNALCOMMAND_CODETESTER_OPEN 5 -#define KVI_INTERNALCOMMAND_SOCKETSPY_OPEN 6 -#define KVI_INTERNALCOMMAND_LINKS_OPEN 7 -#define KVI_INTERNALCOMMAND_REGUSER_EDIT 8 -#define KVI_INTERNALCOMMAND_DOCKWIDGET_SHOW 9 -#define KVI_INTERNALCOMMAND_DOCKWIDGET_HIDE 10 -#define KVI_INTERNALCOMMAND_TOOLBAREDITOR_OPEN 11 -#define KVI_INTERNALCOMMAND_ALIASEDITOR_OPEN 12 -#define KVI_INTERNALCOMMAND_TERM_OPEN 13 -#define KVI_INTERNALCOMMAND_EVENTEDITOR_OPEN 14 -#define KVI_INTERNALCOMMAND_BROWSER_OPEN_MDI 15 -#define KVI_INTERNALCOMMAND_BROWSER_OPEN 16 -#define KVI_INTERNALCOMMAND_IDENT_START 17 -#define KVI_INTERNALCOMMAND_IDENT_STOP 18 -#define KVI_INTERNALCOMMAND_TIP_OPEN 19 -#define KVI_INTERNALCOMMAND_KVIRC_HOMEPAGE 20 -#define KVI_INTERNALCOMMAND_LIST_OPEN 21 -#define KVI_INTERNALCOMMAND_CHANNELSJOIN_OPEN 22 -#define KVI_INTERNALCOMMAND_SERVERSJOIN_OPEN 23 -#define KVI_INTERNALCOMMAND_URL_OPEN 24 -#define KVI_INTERNALCOMMAND_OPENURL_KVIRC_THEMES 25 -#define KVI_INTERNALCOMMAND_OPENURL_KVIRC_MAILINGLIST 26 -#define KVI_INTERNALCOMMAND_OPENURL_KVIRC_BUGTRACK 27 -#define KVI_INTERNALCOMMAND_RAWEDITOR_OPEN 28 -#define KVI_INTERNALCOMMAND_POPUPEDITOR_OPEN 29 -#define KVI_INTERNALCOMMAND_EXECUTE_SCRIPT_FROM_DISK 30 -#define KVI_INTERNALCOMMAND_ACTIONEDITOR_OPEN 31 -#define KVI_INTERNALCOMMAND_QUIT 32 -#define KVI_INTERNALCOMMAND_KVIRC_HOMEPAGE_RU 33 -#define KVI_INTERNALCOMMAND_OPENURL_KVIRC_ON_FREENODE 34 -#define KVI_INTERNALCOMMAND_OPENURL_KVIRC_ON_IRCNET 35 -#define KVI_INTERNALCOMMAND_OPENURL_KVIRC_IT_ON_AZZURRA 36 -#define KVI_INTERNALCOMMAND_KVIRC_HOMEPAGE_FR 37 -#define KVI_INTERNALCOMMAND_OPENURL_KVIRC_FR_ON_FREENODE 38 -#define KVI_INTERNALCOMMAND_OPENURL_KVIRC_FR_ON_EUROPNET 39 - -#define KVI_NUM_INTERNAL_COMMANDS 40 - -extern KVIRC_API char * kvi_getInternalCommandBuffer(int idx); - -#endif //_KVI_INTERNALCMD_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_ipc.cpp b/3.4.0/src/kvirc/kernel/kvi_ipc.cpp deleted file mode 100644 index 84c94c5d51..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ipc.cpp +++ /dev/null @@ -1,269 +0,0 @@ -//============================================================================= -// -// File : kvi_ipc.hcpp -// Creation date : Tue Apr 10 2001 15:04:45 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - - -#include "kvi_ipc.h" - - -#ifndef COMPILE_NO_IPC - - #include "kvi_memmove.h" - #include "kvi_app.h" - #include "kvi_qstring.h" - -#ifdef COMPILE_ON_WINDOWS - - static HWND kvi_win_findIpcSentinel() - { - HWND hWnd = ::FindWindow("QWidget","[Non-Commercial] - kvirc_ipc_sentinel"); - if(hWnd)return hWnd; - hWnd = ::FindWindow("QWidget","[Freeware] - kvirc_ipc_sentinel"); - if(hWnd)return hWnd; - hWnd = ::FindWindow("QWidget","kvirc_ipc_sentinel"); - return hWnd; - } - -#else //!COMPILE_ON_WINDOWS - - #ifndef COMPILE_NO_X - #include <X11/Xatom.h> - - #include <unistd.h> // for getuid - #include <sys/types.h> // for getuid - - #ifdef COMPILE_USE_QT4 - #include <qx11info_x11.h> - #define kvi_ipc_get_xdisplay QX11Info::display - #define kvi_ipc_get_xrootwin QX11Info::appRootWindow - #else - #define kvi_ipc_get_xdisplay qt_xdisplay - #define kvi_ipc_get_xrootwin qt_xrootwin - #endif - - static Atom kvi_atom_ipc_sentinel_window; - static Atom kvi_atom_ipc_remote_command; - static Atom kvi_atom_ipc_remote_message; - static KviStr kvi_sentinel_id; - static bool g_bIpcAtomsLoaded = false; - - static void kvi_ipcLoadAtoms() - { - if(g_bIpcAtomsLoaded)return; - g_bIpcAtomsLoaded = true; - kvi_sentinel_id.sprintf("tonno e mistero - %d",getuid()); - kvi_atom_ipc_sentinel_window = XInternAtom(kvi_ipc_get_xdisplay(),"XA_KVI_IPC_SENTINEL_WINDOW",False); - kvi_atom_ipc_remote_command = XInternAtom(kvi_ipc_get_xdisplay(),"XA_KVI_IPC_REMOTE_COMMAND",False); - kvi_atom_ipc_remote_message = XInternAtom(kvi_ipc_get_xdisplay(),"XA_KVI_IPC_REMOTE_MESSAGE",False); - } - - static void kvi_ipcSetRemoteCommand(Window w,const char * command) - { - XChangeProperty(kvi_ipc_get_xdisplay(),w,kvi_atom_ipc_remote_command, - XA_STRING,8,PropModeReplace,(const unsigned char *)command,kvi_strLen(command) + 1); - } - - static Window kvi_x11_findIpcSentinel(Window win) - { - Atom type; - int format; - unsigned long nItems,after; - unsigned char * data = 0; - if(XGetWindowProperty(kvi_ipc_get_xdisplay(),win,kvi_atom_ipc_sentinel_window,0,32,FALSE,XA_STRING, - &type,&format,&nItems,&after,&data) == Success) - { - if((type == XA_STRING) && (format == 8)) - { - if((nItems == ((unsigned long)(kvi_sentinel_id.len()))) && data) - { - if(kvi_strEqualCSN((const char *)data,kvi_sentinel_id.ptr(),kvi_sentinel_id.len())) - { - XFree((char *)data); - return win; - } - } - } - } - - Window root,parent; - Window * children; - unsigned int nChildren; - - if(!XQueryTree(kvi_ipc_get_xdisplay(),win,&root,&parent,&children,&nChildren)) - { - if(children)XFree((char *)children); - return 0; - } - - Window found = 0; - - for(int i=nChildren-1;(!found) && (i >= 0);i--) - found = kvi_x11_findIpcSentinel(children[i]); - - if(children)XFree((char *)children); - - return found; - } - #endif //!COMPILE_NO_X - -#endif //!COMPILE_ON_WINDOWS - - - #define KVI_WINDOWS_IPC_MESSAGE 0x2FACE5 - - bool kvi_sendIpcMessage(const char * message) - { -#ifdef COMPILE_ON_WINDOWS - HWND hSentinel = kvi_win_findIpcSentinel(); - if(hSentinel != NULL) - { - COPYDATASTRUCT cpd; - cpd.cbData = strlen(message)+1; - cpd.dwData = KVI_WINDOWS_IPC_MESSAGE; - cpd.lpData = (void *)message; - DWORD dwResult; - debug(message); - ::SendMessageTimeout(hSentinel,WM_COPYDATA,(WPARAM)NULL,(LPARAM)&cpd,SMTO_BLOCK,1000,&dwResult); - return true; - } -#else //!COMPILE_ON_WINDOWS - #ifndef COMPILE_NO_X - - kvi_ipcLoadAtoms(); - - Window sentinel = kvi_x11_findIpcSentinel(kvi_ipc_get_xrootwin()); - if(sentinel != 0) - { -// XChangeProperty(kvi_ipc_get_xdisplay(),sentinel,kvi_atom_ipc_remote_command,XA_STRING,8, -// PropModeReplace,(const unsigned char *)message,kvi_strLen(message)); - kvi_ipcSetRemoteCommand(sentinel,message); - - XEvent e; - kvi_memset(&e,0,sizeof(XEvent)); - e.type = ClientMessage; - e.xclient.display = kvi_ipc_get_xdisplay(); - e.xclient.window = sentinel; - e.xclient.message_type = kvi_atom_ipc_remote_message; - e.xclient.format = 8; - - XSendEvent(kvi_ipc_get_xdisplay(),sentinel,False,0,&e); - - return true; - } - #endif //!COMPILE_NO_X -#endif //!COMPILE_ON_WINDOWS - return false; - } - - - ////////////////////////////////////////////////////////////////////// - // class KviIpcSentinel - // - // hidden sentinel of ipc messages - // - ////////////////////////////////////////////////////////////////////// - - KviIpcSentinel::KviIpcSentinel() - : QWidget(0,"kvirc_ipc_sentinel") - { -#ifdef COMPILE_ON_WINDOWS - setCaption("kvirc_ipc_sentinel"); -#else //!COMPILE_ON_WINDOWS - #ifndef COMPILE_NO_X - kvi_ipcLoadAtoms(); - - XChangeProperty(kvi_ipc_get_xdisplay(),winId(),kvi_atom_ipc_sentinel_window,XA_STRING,8, - PropModeReplace,(const unsigned char *)kvi_sentinel_id.ptr(),kvi_sentinel_id.len()); - - kvi_ipcSetRemoteCommand(winId(),""); - #endif //!COMPILE_NO_X -#endif //!COMPILE_ON_WINDOWS - - move(-50,-50); - resize(1,1); - hide(); - - } - - KviIpcSentinel::~KviIpcSentinel() - { - } - -#ifdef COMPILE_ON_WINDOWS - - bool KviIpcSentinel::winEvent(MSG * msg) - { - if(msg->message == WM_COPYDATA) - { - COPYDATASTRUCT * cpd = (COPYDATASTRUCT *)msg->lParam; - if(cpd) - { - if(cpd->dwData == KVI_WINDOWS_IPC_MESSAGE) - { - debug((char *)(cpd->lpData)); - if(g_pApp)g_pApp->ipcMessage((char *)(cpd->lpData)); - return true; - } - } - } - return false; - } - -#else //!COMPILE_ON_WINDOWS - #ifndef COMPILE_NO_X - bool KviIpcSentinel::x11Event(XEvent *e) - { - if(e->type == ClientMessage) - { - if((e->xclient.message_type = kvi_atom_ipc_remote_message) && (e->xclient.format == 8)) - { - Atom type; - int format; - unsigned long nItems,after; - unsigned char * data = 0; - KviStr szData; - if(XGetWindowProperty(kvi_ipc_get_xdisplay(),winId(),kvi_atom_ipc_remote_command,0,1024,FALSE,XA_STRING, - &type,&format,&nItems,&after,&data) == Success) - { - if((type == XA_STRING) && (format == 8) && (nItems > 0) && data) - { - szData = (char *)data; - XFree((char *)data); - } - } - kvi_ipcSetRemoteCommand(winId(),""); - - if(g_pApp)g_pApp->ipcMessage(szData.ptr()); - return true; - } - } - return false; - } - #endif //!COMPILE_NO_X -#endif //!COMPILE_ON_WINDOWS - - #include "kvi_ipc.moc" - -#endif diff --git a/3.4.0/src/kvirc/kernel/kvi_ipc.h b/3.4.0/src/kvirc/kernel/kvi_ipc.h deleted file mode 100644 index 83775f1019..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ipc.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef _KVI_IPC_H_ -#define _KVI_IPC_H_ -//============================================================================= -// -// File : kvi_ipc.h -// Creation date : Tue Apr 10 2001 15:04:45 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - - -#ifndef COMPILE_NO_IPC - - #include "kvi_string.h" - - #include <qwidget.h> - -#ifdef COMPILE_ON_WINDOWS - #include <winsock2.h> - #include <windows.h> -#else //!COMPILE_ON_WINDOWS - #ifndef COMPILE_NO_X - #ifdef COMPILE_USE_QT4 - // We need this to be included BEFORE X11/Xlib.h - // because of preprocessor constant collisions... - #include <qcoreevent.h> - #endif - #include "kvi_xlib.h" // for XEvent - #endif //!COMPILE_NO_X -#endif //!COMPILE_ON_WINDOWS - - ////////////////////////////////////////////////////////////////////// - // class KviIpcSentinel - // - ////////////////////////////////////////////////////////////////////// - - class KVIRC_API KviIpcSentinel : public QWidget - { - Q_OBJECT - public: - KviIpcSentinel(); - ~KviIpcSentinel(); - protected: // protected members -#ifdef COMPILE_ON_WINDOWS - virtual bool winEvent(MSG * msg); -#else //!COMPILE_ON_WINDOWS - #ifndef COMPILE_NO_X - virtual bool x11Event(XEvent *e); - #endif //!COMPILE_NO_X -#endif //!COMPILE_ON_WINDOWS - }; - -#endif //!COMPILE_NO_IPC - - - -#endif //_KVI_IPC_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnection.cpp b/3.4.0/src/kvirc/kernel/kvi_ircconnection.cpp deleted file mode 100644 index ded8088be6..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnection.cpp +++ /dev/null @@ -1,1354 +0,0 @@ -//============================================================================= -// -// File : kvi_ircconnection.cpp -// Created on Mon 03 May 2004 01:45:42 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_ircconnection.h" -#include "kvi_ircconnectiontarget.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_ircconnectionserverinfo.h" -#include "kvi_ircconnectionstatedata.h" -#include "kvi_ircconnectionantictcpflooddata.h" -#include "kvi_ircconnectionnetsplitdetectordata.h" -#include "kvi_ircconnectionasyncwhoisdata.h" -#include "kvi_ircconnectionstatistics.h" -#include "kvi_irclink.h" -#include "kvi_ircsocket.h" -#include "kvi_locale.h" -#include "kvi_ircserverdb.h" -#include "kvi_proxydb.h" -#include "kvi_error.h" -#include "kvi_out.h" -#include "kvi_options.h" -#include "kvi_console.h" -#include "kvi_netutils.h" -#include "kvi_internalcmd.h" -#include "kvi_frame.h" -#include "kvi_mexlinkfilter.h" -#include "kvi_garbage.h" -#include "kvi_malloc.h" -#include "kvi_memmove.h" -#include "kvi_debug.h" -#include "kvi_channel.h" -#include "kvi_query.h" -#include "kvi_app.h" -#include "kvi_databuffer.h" -#include "kvi_notifylist.h" -#include "kvi_dns.h" -#include "kvi_defaults.h" -#include "kvi_sparser.h" -#include "kvi_ircdatastreammonitor.h" -#include "kvi_databuffer.h" -#include "kvi_lagmeter.h" -#include "kvi_kvs_eventtriggers.h" -#include "kvi_kvs_script.h" -#include "kvi_mirccntrl.h" -#include "kvi_useridentity.h" - -#include <qtimer.h> -#include <qtextcodec.h> - -extern KVIRC_API KviIrcServerDataBase * g_pIrcServerDataBase; -extern KVIRC_API KviProxyDataBase * g_pProxyDataBase; -extern KVIRC_API KviGarbageCollector * g_pGarbageCollector; - -KviIrcConnection::KviIrcConnection(KviIrcContext * pContext,KviIrcConnectionTarget * pTarget,KviUserIdentity * pIdentity) -: QObject() -{ - m_bIdentdAttached = false; - m_pContext = pContext; - m_pConsole = pContext->console(); - m_pFrame = m_pConsole->frame(); - m_pTarget = pTarget; - m_pUserIdentity = pIdentity; - m_pChannelList = new KviPointerList<KviChannel>; - m_pChannelList->setAutoDelete(false); - m_pQueryList = new KviPointerList<KviQuery>; - m_pQueryList->setAutoDelete(false); - m_pLink = new KviIrcLink(this); - m_pUserDataBase = new KviIrcUserDataBase(); - m_pUserInfo = new KviIrcConnectionUserInfo(); - m_pServerInfo = new KviIrcConnectionServerInfo(); - m_pStateData = new KviIrcConnectionStateData(); - m_pAntiCtcpFloodData = new KviIrcConnectionAntiCtcpFloodData(); - m_pNetsplitDetectorData = new KviIrcConnectionNetsplitDetectorData(); - m_pAsyncWhoisData = new KviIrcConnectionAsyncWhoisData(); - m_pStatistics = new KviIrcConnectionStatistics(); - m_pNotifyListTimer = 0; - m_pNotifyListManager = 0; - m_pLocalhostDns = 0; - m_pLagMeter = 0; - m_eState = Idle; - setupTextCodec(); -} - -KviIrcConnection::~KviIrcConnection() -{ - if(m_bIdentdAttached) g_pFrame->executeInternalCommand(KVI_INTERNALCOMMAND_IDENT_STOP); - m_bIdentdAttached = false; - if(m_pLocalhostDns) - { - QObject::disconnect(m_pLocalhostDns,SIGNAL(lookupDone(KviDns *)),0,0); - if(m_pLocalhostDns->isRunning()) - { - g_pGarbageCollector->collect(m_pLocalhostDns); - } else { - delete m_pLocalhostDns; - } - } - - - if(m_pNotifyListTimer) - { - delete m_pNotifyListTimer; - m_pNotifyListTimer = 0; - } - if(m_pNotifyListManager) - { - delete m_pNotifyListManager; // destroy this before the userDb - m_pNotifyListManager = 0; - } - if(m_pLagMeter) - { - delete m_pLagMeter; - m_pLagMeter = 0; - } - delete m_pLink; // <-- this MAY trigger a linkTerminated() or something like this! - delete m_pChannelList; - delete m_pQueryList; - delete m_pTarget; - delete m_pUserDataBase; - delete m_pUserInfo; - delete m_pServerInfo; - delete m_pStateData; - delete m_pAntiCtcpFloodData; - delete m_pNetsplitDetectorData; - delete m_pAsyncWhoisData; - delete m_pStatistics; - delete m_pUserIdentity; -} - -void KviIrcConnection::setEncoding(const QString &szEncoding) -{ - QTextCodec * c = KviLocale::codecForName(szEncoding.latin1()); - if(c == m_pTextCodec)return; - if(!c) - { - m_pConsole->output(KVI_OUT_SYSTEMERROR,__tr2qs("Failed to set the encoding to %Q: mapping not available."),&szEncoding); - return; - } - QString tmp = c->name(); - for(KviChannel * ch = m_pChannelList->first();ch;ch = m_pChannelList->next()) - { - if((ch->textCodec() != c) && (ch->textCodec() != ch->defaultTextCodec())) // actually not using the default! - { - ch->forceTextCodec(c); - if(_OUTPUT_VERBOSE)ch->output(KVI_OUT_VERBOSE,__tr2qs("Changed text encoding to %Q"),&tmp); - } - } - for(KviQuery * q = m_pQueryList->first();q;q = m_pQueryList->next()) - { - if((q->textCodec() != c) && (q->textCodec() != q->defaultTextCodec())) // actually not using the default! - { - q->forceTextCodec(c); - if(_OUTPUT_VERBOSE)q->output(KVI_OUT_VERBOSE,__tr2qs("Changed text encoding to %Q"),&tmp); - } - } - m_pTextCodec = c; - m_pConsole->setTextEncoding(szEncoding); -} - -void KviIrcConnection::setupTextCodec() -{ - // grab the codec: first look it up in the server data - m_pTextCodec = 0; - if(!m_pTarget->server()->encoding().isEmpty()) - { - m_pTextCodec = KviLocale::codecForName(m_pTarget->server()->encoding().latin1()); - if(!m_pTextCodec)debug("KviIrcConnection: can't find QTextCodec for encoding %s",m_pTarget->server()->encoding().utf8().data()); - } - if(!m_pTextCodec) - { - // try the network - if(!m_pTarget->network()->encoding().isEmpty()) - { - m_pTextCodec = KviLocale::codecForName(m_pTarget->network()->encoding().latin1()); - if(!m_pTextCodec)debug("KviIrcConnection: can't find QTextCodec for encoding %s",m_pTarget->network()->encoding().utf8().data()); - } - } - if(!m_pTextCodec) - { - m_pTextCodec = KviApp::defaultTextCodec(); - } - m_pConsole->setTextEncoding(QString(m_pTextCodec->name())); -} - -KviQCString KviIrcConnection::encodeText(const QString &szText) -{ - if(!m_pTextCodec)return szText.utf8(); - return m_pTextCodec->fromUnicode(szText); -} - -QString KviIrcConnection::decodeText(const char * szText) -{ - if(!m_pTextCodec)return QString(szText); - return m_pTextCodec->toUnicode(szText); -} - -void KviIrcConnection::serverInfoReceived(const QString &szServerName,const QString &szUserModes,const QString &szChanModes) -{ - serverInfo()->setName(szServerName); - serverInfo()->setSupportedUserModes(szUserModes); - serverInfo()->setSupportedChannelModes(szChanModes); - m_pConsole->updateCaption(); // for server name - m_pFrame->childConnectionServerInfoChange(this); -} - -const QString & KviIrcConnection::currentServerName() -{ - return serverInfo()->name(); -} - -const QString & KviIrcConnection::currentNickName() -{ - return userInfo()->nickName(); -} - -const QString & KviIrcConnection::currentUserName() -{ - return userInfo()->userName(); -} - -KviIrcServer * KviIrcConnection::server() -{ - return m_pTarget->server(); -} - -KviProxy * KviIrcConnection::proxy() -{ - return m_pTarget->proxy(); -} - -const QString & KviIrcConnection::networkName() -{ - return m_pTarget->networkName(); -} - -KviIrcSocket * KviIrcConnection::socket() -{ - return m_pLink->socket(); -} - -void KviIrcConnection::abort() -{ - // this WILL trigger linkAttemptFailed() or linkTerminated() - m_pLink->abort(); -} - -void KviIrcConnection::start() -{ - m_eState = Connecting; - if(KVI_OPTION_BOOL(KviOption_boolUseIdentService) && KVI_OPTION_BOOL(KviOption_boolUseIdentServiceOnlyOnConnect)) - { - g_pFrame->executeInternalCommand(KVI_INTERNALCOMMAND_IDENT_START); - m_bIdentdAttached=true; - } - m_pLink->start(); -} - -void KviIrcConnection::linkEstabilished() -{ - m_eState = Connected; - - // setup reasonable defaults before notifying anyone - m_pStatistics->setConnectionStartTime(kvi_unixTime()); - m_pStatistics->setLastMessageTime(kvi_unixTime()); - m_pServerInfo->setName(target()->server()->m_szHostname); - - if(KviPointerList<KviIrcDataStreamMonitor> * l = context()->monitorList()) - { - for(KviIrcDataStreamMonitor *m =l->first();m;m =l->next()) - m->connectionInitiated(); - } - - context()->connectionEstabilished(); - - // Ok...we're loggin in now - resolveLocalHost(); - loginToIrcServer(); -} - -void KviIrcConnection::linkTerminated() -{ - if(m_bIdentdAttached) - { - g_pFrame->executeInternalCommand(KVI_INTERNALCOMMAND_IDENT_STOP); - m_bIdentdAttached=false; - } - m_eState = Idle; - - if(m_pNotifyListManager) - { - delete m_pNotifyListManager; - m_pNotifyListManager = 0; - } - - if(m_pLagMeter) - { - delete m_pLagMeter; - m_pLagMeter = 0; - } - - if(KviPointerList<KviIrcDataStreamMonitor> * l = context()->monitorList()) - { - for(KviIrcDataStreamMonitor *m =l->first();m;m =l->next()) - m->connectionTerminated(); - } - - // Prepare data for an eventual reconnect - context()->connectionTerminated(); -} - -void KviIrcConnection::linkAttemptFailed(int iError) -{ - if(m_bIdentdAttached) - { - g_pFrame->executeInternalCommand(KVI_INTERNALCOMMAND_IDENT_STOP); - m_bIdentdAttached=false; - } - m_eState = Idle; - context()->connectionFailed(iError); -} - -KviChannel * KviIrcConnection::findChannel(const QString &name) -{ - for(KviChannel * c = m_pChannelList->first();c;c = m_pChannelList->next()) - { - if(KviQString::equalCI(name,c->windowName()))return c; - } - return 0; -} - -int KviIrcConnection::getCommonChannels(const QString &nick,QString &szChansBuffer,bool bAddEscapeSequences) -{ - int count = 0; - for(KviChannel * c = m_pChannelList->first();c;c = m_pChannelList->next()) - { - if(c->isOn(nick)) - { - if(!szChansBuffer.isEmpty())szChansBuffer.append(", "); - char uFlag = c->getUserFlag(nick); - if(uFlag) - { - KviQString::appendFormatted(szChansBuffer,bAddEscapeSequences ? "%c\r!c\r%Q\r" : "%c%Q",uFlag,&(c->windowName())); - } else { - if(bAddEscapeSequences)KviQString::appendFormatted(szChansBuffer,"\r!c\r%Q\r",&(c->windowName())); - else szChansBuffer.append(c->windowName()); - } - count++; - } - } - return count; -} - -void KviIrcConnection::unhighlightAllChannels() -{ - for(KviChannel * c = m_pChannelList->first();c;c = m_pChannelList->next()) - c->unhighlight(); -} - -void KviIrcConnection::unhighlightAllQueries() -{ - for(KviQuery * c = m_pQueryList->first();c;c = m_pQueryList->next()) - c->unhighlight(); -} - -void KviIrcConnection::partAllChannels() -{ - for(KviChannel * c = m_pChannelList->first();c;c = m_pChannelList->next()) - { - c->close(); - } -} - -void KviIrcConnection::closeAllChannels() -{ - while(m_pChannelList->first()) - { - m_pFrame->closeWindow(m_pChannelList->first()); - } -} - -void KviIrcConnection::closeAllQueries() -{ - while(m_pQueryList->first()) - { - m_pFrame->closeWindow(m_pQueryList->first()); - } -} - -KviChannel * KviIrcConnection::createChannel(const QString &szName) -{ - KviChannel * c = m_pContext->findDeadChannel(szName); - if(c) - { - c->setAliveChan(); - if(!KVI_OPTION_BOOL(KviOption_boolCreateMinimizedChannels)) - { - c->raise(); - c->setFocus(); - } - } else { - c = new KviChannel(m_pFrame,m_pConsole,szName); - m_pFrame->addWindow(c,!KVI_OPTION_BOOL(KviOption_boolCreateMinimizedChannels)); - if(KVI_OPTION_BOOL(KviOption_boolCreateMinimizedChannels)) c->minimize(); - } - return c; -} - -KviQuery * KviIrcConnection::createQuery(const QString &szNick) -{ - KviQuery * q = m_pContext->findDeadQuery(szNick); - if(!q) - { - q = findQuery(szNick); - if(q)return q; // hm ? - } - if(q) - { - q->setAliveQuery(); - if(!KVI_OPTION_BOOL(KviOption_boolCreateMinimizedQuery)) - { - q->raise(); - q->setFocus(); - } - } else { - q = new KviQuery(m_pFrame,m_pConsole,szNick); - m_pFrame->addWindow(q,!KVI_OPTION_BOOL(KviOption_boolCreateMinimizedQuery)); - if(KVI_OPTION_BOOL(KviOption_boolCreateMinimizedQuery))q->minimize(); - } - return q; -} - -KviQuery * KviIrcConnection::findQuery(const QString &name) -{ - for(KviQuery * c = m_pQueryList->first();c;c = m_pQueryList->next()) - { - if(KviQString::equalCI(name,c->windowName()))return c; - } - return 0; -} - -void KviIrcConnection::registerChannel(KviChannel * c) -{ - m_pChannelList->append(c); - if(KVI_OPTION_BOOL(KviOption_boolLogChannelHistory)) - g_pApp->addRecentChannel(c->windowName(),m_pTarget->networkName()); - emit(channelRegistered(c)); - emit(chanListChanged()); -} - -void KviIrcConnection::unregisterChannel(KviChannel * c) -{ - m_pChannelList->removeRef(c); - emit(channelUnregistered(c)); - emit(chanListChanged()); -} - -void KviIrcConnection::registerQuery(KviQuery * c) -{ - m_pQueryList->append(c); -} - - -void KviIrcConnection::unregisterQuery(KviQuery * c) -{ - if(m_pQueryList->removeRef(c))return; -} - -void KviIrcConnection::keepChannelsOpenAfterDisconnect() -{ - while(KviChannel * c = m_pChannelList->first()) - { - c->outputNoFmt(KVI_OUT_SOCKETERROR,__tr2qs("Connection to server lost")); - c->setDeadChan(); - } -} - -void KviIrcConnection::keepQueriesOpenAfterDisconnect() -{ - while(KviQuery * q = m_pQueryList->first()) - { - q->outputNoFmt(KVI_OUT_SOCKETERROR,__tr2qs("Connection to server lost")); - q->setDeadQuery(); - } -} - -void KviIrcConnection::resurrectDeadQueries() -{ - while(KviQuery * q = m_pContext->firstDeadQuery()) - { - q->outputNoFmt(KVI_OUT_SOCKETMESSAGE,__tr2qs("Connection to server established")); - q->setAliveQuery(); - } -} - - -//=== Message send stuff ====================================================// -// Max buffer that can be sent to an IRC server is 512 bytes -// including CRLF. (ircd simply 'cuts' messages to 512 bytes -// and discards the remainig part) -// Note that 510 bytes of data is a reasonably long message :) -// -// 01234567890123456789012345678901234567890123456789 -// 01234567890123456789012345678901234567890123456789 -// 01234567890123456789012345678901234567890123456789 -// 01234567890123456789012345678901234567890123456789 -// 01234567890123456789012345678901234567890123456789 -// 01234567890123456789012345678901234567890123456789 -// 01234567890123456789012345678901234567890123456789 -// 01234567890123456789012345678901234567890123456789 -// 01234567890123456789012345678901234567890123456789 -// 01234567890123456789012345678901234567890123456789 -// 0123456789\r\n -// -// We keep a list of data to send , and flush it as soon as we can. -// - -bool KviIrcConnection::sendFmtData(const char *fmt,...) -{ - KviDataBuffer * pData = new KviDataBuffer(512); - kvi_va_list(list); - kvi_va_start(list,fmt); - bool bTruncated; - //sprintf the buffer up to 512 chars (adds a CRLF too) - int iLen = kvi_irc_vsnprintf((char *)(pData->data()),fmt,list,&bTruncated); - kvi_va_end(list); - //adjust the buffer size - if(iLen < 512)pData->resize(iLen); - if(bTruncated) - { - if(!_OUTPUT_MUTE) - m_pConsole->outputNoFmt(KVI_OUT_SOCKETWARNING,__tr2qs("[LINK WARNING]: Socket message truncated to 512 bytes.")); - } - - // notify the monitors - if(KviPointerList<KviIrcDataStreamMonitor> * l = context()->monitorList()) - { - for(KviIrcDataStreamMonitor *m = l->first();m;m = l->next()) - m->outgoingMessage((const char *)(pData->data()),iLen - 2); - } - - return m_pLink->sendPacket(pData); -} - -bool KviIrcConnection::sendData(const char *buffer,int buflen) -{ - if(buflen < 0)buflen = (int)strlen(buffer); - if(buflen > 510) - { - buflen = 510; - if(!_OUTPUT_MUTE) - m_pConsole->outputNoFmt(KVI_OUT_SOCKETWARNING,__tr2qs("[LINK WARNING]: Socket message truncated to 512 bytes.")); - } - KviDataBuffer * pData = new KviDataBuffer(buflen + 2); - kvi_memmove(pData->data(),buffer,buflen); - *(pData->data()+buflen)='\r'; - *(pData->data()+buflen+1)='\n'; - - // notify the monitors - if(KviPointerList<KviIrcDataStreamMonitor> * l = context()->monitorList()) - { - for(KviIrcDataStreamMonitor *m = l->first();m;m = l->next()) - m->outgoingMessage((const char *)(pData->data()),buflen); - } - - return m_pLink->sendPacket(pData); -} - -//============================================================================================== -// notify list management -//============================================================================================== - -void KviIrcConnection::delayedStartNotifyList() -{ - // start the notify list in 15 seconds - // We have this delay to wait an eventual RPL_PROTOCTL from the server - // telling us that the WATCH notify list method is supported - __range_invalid(m_pNotifyListTimer); - - if(m_pNotifyListTimer)delete m_pNotifyListTimer; - m_pNotifyListTimer = new QTimer(); - connect(m_pNotifyListTimer,SIGNAL(timeout()),this,SLOT(restartNotifyList())); - m_pNotifyListTimer->start(15000,true); - - // This delay is large enough to fire after the MOTD has been sent, - // even on the weirdest network. - // If there is no MOTD, this timer will fire after 15 secs, - // If there is a MOTD , restartNotifyList() will be triggered by RPL_ENDOFMOTD and - // will kill the timer before it has fired. -} - -void KviIrcConnection::endOfMotdReceived() -{ - // if the timer is still there running then just - if(m_pNotifyListTimer)restartNotifyList(); -} - -void KviIrcConnection::restartNotifyList() -{ - if(m_pNotifyListTimer) - { - delete m_pNotifyListTimer; - m_pNotifyListTimer = 0; - } - - // clear it - if(m_pNotifyListManager) - { - m_pNotifyListManager->stop(); // may need to remove watch entries - delete m_pNotifyListManager; - m_pNotifyListManager = 0; - } - - if(!KVI_OPTION_BOOL(KviOption_boolUseNotifyList))return; - - if(serverInfo()->supportsWatchList() && KVI_OPTION_BOOL(KviOption_boolUseWatchListIfAvailable)) - { - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("The server seems to support the WATCH notify list method, will try to use it")); - m_pNotifyListManager = new KviWatchNotifyListManager(this); - } else { - if(KVI_OPTION_BOOL(KviOption_boolUseIntelligentNotifyListManager)) - { - m_pNotifyListManager = new KviIsOnNotifyListManager(this); - } else { - m_pNotifyListManager = new KviStupidNotifyListManager(this); - } - } - m_pNotifyListManager->start(); -} - -void KviIrcConnection::restartLagMeter() -{ - if(m_pLagMeter) - { - delete m_pLagMeter; - m_pLagMeter = 0; - } - if(!KVI_OPTION_BOOL(KviOption_boolUseLagMeterEngine))return; - m_pLagMeter = new KviLagMeter(this); -} - -void KviIrcConnection::resolveLocalHost() -{ - QString szIp; - - if(!socket()->getLocalHostIp(szIp,server()->isIpV6())) - { - bool bGotIp = false; - if(!KVI_OPTION_STRING(KviOption_stringLocalHostIp).isEmpty()) - { -#ifdef COMPILE_IPV6_SUPPORT - if(server()->isIpV6()) - { - if(KviNetUtils::isValidStringIp_V6(KVI_OPTION_STRING(KviOption_stringLocalHostIp)))bGotIp = true; - } else { -#endif - if(KviNetUtils::isValidStringIp(KVI_OPTION_STRING(KviOption_stringLocalHostIp)))bGotIp = true; -#ifdef COMPILE_IPV6_SUPPORT - } -#endif - } - if(bGotIp) - { - m_pUserInfo->setLocalHostIp(KVI_OPTION_STRING(KviOption_stringLocalHostIp)); - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMWARNING,__tr2qs("Can't resolve local host address, using user supplied one (%Q)"), - &(m_pUserInfo->localHostIp())); - - } else { - // FIXME : Maybe check for IPv6 here too ? - m_pUserInfo->setLocalHostIp("127.0.0.1"); - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMWARNING,__tr2qs("Can't resolve local host address, using default 127.0.0.1"), - &(m_pUserInfo->localHostIp())); - } - } else { - m_pUserInfo->setLocalHostIp(szIp); - if(!_OUTPUT_QUIET) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Local host address is %Q"), - &(m_pUserInfo->localHostIp())); - } - - // For now this is the only we know - m_pUserInfo->setHostName(m_pUserInfo->localHostIp()); - m_pUserInfo->setHostIp(m_pUserInfo->localHostIp()); -} - -void KviIrcConnection::changeAwayState(bool bAway) -{ - if(bAway)m_pUserInfo->setAway(); - else m_pUserInfo->setBack(); - - m_pConsole->updateCaption(); - m_pFrame->childConnectionAwayStateChange(this); - - emit awayStateChanged(); -} - -void KviIrcConnection::userInfoReceived(const QString &szUserName,const QString &szHostName) -{ - userInfo()->setUserName(szUserName); - QString szUnmaskedHost = m_pUserInfo->unmaskedHostName(); - // Update the user entry - KviIrcUserEntry * e = userDataBase()->find(userInfo()->nickName()); - if(e) // should be there! (we have the permanent entry in the notify list view) - { - e->setUser(szUserName); - if(!szHostName.isEmpty())e->setHost(szHostName); - } // else buuug - - if(szHostName.isEmpty())return; // nothing to do anyway - - if(KviQString::equalCS(m_pUserInfo->hostName(),szHostName))return; // again nothing to do - - static bool warned_once = false; - - if(!warned_once) - { - if(!(m_pUserInfo->hostName().isEmpty() || KviQString::equalCS(m_pUserInfo->hostName(),m_pUserInfo->localHostIp()))) - { - // ok, something weird is probably going on - // is is non-empty and it is NOT the IP address we have set - // at connection startup... - // ...the server (or more likely the bouncer) must have changed his mind... - if(!_OUTPUT_MUTE) - { - m_pConsole->output(KVI_OUT_SYSTEMWARNING,__tr2qs("The server seems to have changed the idea about the local hostname")); - m_pConsole->output(KVI_OUT_SYSTEMWARNING,__tr2qs("You're probably using a broken bouncer or maybe something weird is happening on the IRC server")); - } - warned_once = true; - } - } - - // set it - m_pUserInfo->setHostName(szHostName); - - bool bChangeIp = true; - - // if we don't have any routable IP yet, then it is worth to lookup the new hostname - -#ifdef COMPILE_IPV6_SUPPORT - if((KviNetUtils::isValidStringIp(m_pUserInfo->hostIp()) && - KviNetUtils::isRoutableIpString(m_pUserInfo->hostIp())) || - KviNetUtils::isValidStringIp_V6(m_pUserInfo->hostIp())) -#else - if((KviNetUtils::isValidStringIp(m_pUserInfo->hostIp()) && - KviNetUtils::isRoutableIpString(m_pUserInfo->hostIp()))) -#endif - { - if(KVI_OPTION_BOOL(KviOption_boolDccGuessIpFromServerWhenLocalIsUnroutable) && - KVI_OPTION_BOOL(KviOption_boolDccBrokenBouncerHack)) - { - if(!_OUTPUT_MUTE) - m_pConsole->outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Here goes your \"broken bouncer hack\": The server has changed the hostname but I'll ignore the IP address change")); - bChangeIp = false; - } - } - - if(bChangeIp) - { - // lookup the new hostname then... -#ifdef COMPILE_IPV6_SUPPORT - if(KviNetUtils::isValidStringIp(szHostName) || KviNetUtils::isValidStringIp_V6(szHostName)) -#else - if(KviNetUtils::isValidStringIp(szHostName)) -#endif - { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("The local IP address as seen by the IRC server is %Q"),&szHostName); - m_pUserInfo->setHostIp(szHostName); - } else -#ifdef COMPILE_IPV6_SUPPORT - if(KviNetUtils::isValidStringIp(szUnmaskedHost) || KviNetUtils::isValidStringIp_V6(szUnmaskedHost)) -#else - if(KviNetUtils::isValidStringIp(szUnmaskedHost)) -#endif - { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("The local IP address as seen by the IRC server is %Q"),&szUnmaskedHost); - m_pUserInfo->setHostIp(szUnmaskedHost); - - } else { - // look it up too - if(m_pLocalhostDns)delete m_pLocalhostDns; // it could be only another local host lookup - m_pLocalhostDns = new KviDns(); - connect(m_pLocalhostDns,SIGNAL(lookupDone(KviDns *)),this,SLOT(hostNameLookupTerminated(KviDns *))); - - if(!m_pLocalhostDns->lookup(szHostName,KviDns::Any)) - { - if(!_OUTPUT_MUTE) - { - // don't change the string to aid the translators - QString szTmp = __tr2qs("Can't start the DNS slave thread"); - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Unable to resolve the local hostname as seen by the IRC server: %Q"),&szTmp); - } - delete m_pLocalhostDns; - m_pLocalhostDns = 0; - } else { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Looking up the local hostname as seen by the IRC server (%Q)"),&szHostName); - } - } - } -} - -void KviIrcConnection::hostNameLookupTerminated(KviDns *pDns) -{ - // - // This is called when our hostname lookup terminates - // - if(!m_pLocalhostDns) - { - debug("Something weird is happening: pDns != 0 but m_pLocalhostDns == 0 :/"); - return; - } - - if(m_pLocalhostDns->state() != KviDns::Success) - { - QString szErr = KviError::getDescription(m_pLocalhostDns->error()); - if(!m_pUserInfo->hostIp().isEmpty()) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Unable to resolve the local hostname as seen by the IRC server: %Q, using previously resolved %Q"), - &szErr,&(m_pUserInfo->hostIp())); - else - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Unable to resolve the local hostname as seen by the IRC server: %Q"), - &szErr); - } else { - QString szIpAddr = m_pLocalhostDns->firstIpAddress(); - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Local hostname as seen by the IRC server resolved to %Q"),&szIpAddr); - m_pUserInfo->setHostIp(m_pLocalhostDns->firstIpAddress()); - } - - delete m_pLocalhostDns; - m_pLocalhostDns = 0; -} - -void KviIrcConnection::loginToIrcServer() -{ - KviIrcServer * pServer = target()->server(); - KviIrcNetwork * pNet = target()->network(); - - // Username - pServer->m_szUser.stripWhiteSpace(); - if(!pServer->m_szUser.isEmpty()) - { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Using server specific username (%Q)"),&(pServer->m_szUser)); - } else { - if(!pNet->userName().isEmpty()) - { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Using network specific username (%Q)"),&(pNet->userName())); - pServer->m_szUser = pNet->userName(); - } else { - pServer->m_szUser = KVI_OPTION_STRING(KviOption_stringUsername); - } - } - - pServer->m_szUser.stripWhiteSpace(); - if(pServer->m_szUser.isEmpty())pServer->m_szUser = KVI_DEFAULT_USERNAME; - - // For now this is the only we know - m_pUserInfo->setUserName(pServer->m_szUser); - m_pServerInfo->setName(pServer->m_szHostname); - - // Nick stuff - pServer->m_szNick.stripWhiteSpace(); - if(pServer->m_pReconnectInfo) - { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Using reconnect specific nickname (%Q)"),&(pServer->m_pReconnectInfo->m_szNick)); - m_pUserInfo->setNickName(pServer->m_pReconnectInfo->m_szNick); - m_pStateData->setLoginNickIndex(0); - }else if(!pServer->m_szNick.isEmpty()) - { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Using server specific nickname (%Q)"),&(pServer->m_szNick)); - m_pUserInfo->setNickName(pServer->m_szNick); - m_pStateData->setLoginNickIndex(0); - } else { - if(!pNet->nickName().isEmpty()) - { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Using network specific nickname (%Q)"),&(pNet->nickName())); - m_pUserInfo->setNickName(pNet->nickName()); - m_pStateData->setLoginNickIndex(0); - } else { - KVI_OPTION_STRING(KviOption_stringNickname1).stripWhiteSpace(); - if(KVI_OPTION_STRING(KviOption_stringNickname1).isEmpty()) - KVI_OPTION_STRING(KviOption_stringNickname1) = KVI_DEFAULT_NICKNAME1; - m_pUserInfo->setNickName(KVI_OPTION_STRING(KviOption_stringNickname1)); - m_pStateData->setLoginNickIndex(1); - } - } - - // Real name - pServer->m_szRealName.stripWhiteSpace(); - if(!pServer->m_szRealName.isEmpty()) - { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Using server specific real name (%Q)"), - &(pServer->m_szRealName)); - m_pUserInfo->setRealName(pServer->m_szRealName); - } else { - if(!pNet->realName().isEmpty()) - { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Using network specific real name (%Q)"), - &(pNet->realName())); - m_pUserInfo->setRealName(pNet->realName()); - } else { - m_pUserInfo->setRealName(KVI_OPTION_STRING(KviOption_stringRealname)); - } - } - - // FIXME: The server's encoding! - setupTextCodec(); - KviQCString szNick = encodeText(m_pUserInfo->nickName()); // never empty - KviQCString szUser = encodeText(m_pUserInfo->userName()); // never empty - KviQCString szReal = encodeText(m_pUserInfo->realName()); // may be empty - - if(!szReal.data())szReal = ""; - - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Logging in as %Q!%Q :%Q"), - &(m_pUserInfo->nickName()),&(m_pUserInfo->userName()),&(m_pUserInfo->realName())); - - - // spity, 27.03.2005: follow the RFC2812 suggested order for connection registration - // first the PASS, then NICK and then USER - - // The pass ? - pServer->m_szPass.stripWhiteSpace(); - if(!pServer->m_szPass.isEmpty()) - { - KviStr szHidden; - int pLen = pServer->m_szPass.length(); - for(int i=0;i<pLen;i++)szHidden.append('*'); - - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Sending %s as password"),szHidden.ptr()); - - // The colon should allow user to use passwords with whitespaces. - // Non-whitespace passwords are unaffected. - if(!sendFmtData("PASS :%s",encodeText(pServer->m_szPass).data())) - { - // disconnected in the meantime - return; - } - } - - - if(!sendFmtData("NICK %s",szNick.data())) - { - // disconnected :( - return; - } - - QString szGenderTag; - if(KVI_OPTION_BOOL(KviOption_boolPrependGenderInfoToRealname) && !KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender).isEmpty()) - { - szGenderTag.append(KVI_TEXT_COLOR); - if(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender).startsWith("m",false)) - { - szGenderTag.append("1"); - } else if(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender).startsWith("f",false)) - { - szGenderTag.append("2"); - } - szGenderTag.append(KVI_TEXT_RESET); - szReal.prepend(KviQString::toUtf8(szGenderTag)); - } - - if(!sendFmtData("USER %s 0 %s :%s",szUser.data(), - KviQString::toUtf8(pServer->m_szHostname).data(),szReal.data())) - { - // disconnected in the meantime! - return; - } - - // permanent info in the user database - m_pConsole->notifyListView()->join(m_pUserInfo->nickName(),"*","*"); - - // set own avatar if we have it - KviIrcUserEntry * e = userDataBase()->find(userInfo()->nickName()); - if(e) // should be there! - { - if(!e->avatar()) - { - KviAvatar * av = m_pConsole->defaultAvatarFromOptions(); - if(av) - { - e->setAvatar(av); - m_pConsole->notifyListView()->avatarChanged(userInfo()->nickName()); - } - } - } // else buuug - - if(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender).startsWith("m",false)){ - e->setGender(KviIrcUserEntry::Male); - } else if(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender).startsWith("f",false)){ - e->setGender(KviIrcUserEntry::Female); - } - - // on connect stuff ? - - QString tmp = pNet->onConnectCommand(); - tmp.stripWhiteSpace(); - if(!tmp.isEmpty()) - { - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Executing scheduled network specific \"on connect\" commands")); - KviKvsScript::run(tmp,m_pConsole); - } - - tmp = pServer->onConnectCommand(); - tmp.stripWhiteSpace(); - if(!tmp.isEmpty()) - { - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Executing scheduled server specific \"on connect\" commands")); - KviKvsScript::run(tmp,m_pConsole); - } - - tmp = m_pUserIdentity->onConnectCommand(); - tmp.stripWhiteSpace(); - if(!tmp.isEmpty()) - { - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Executing scheduled identity specific \"on connect\" commands")); - KviKvsScript::run(tmp,m_pConsole); - } - - // and wait for the server to agree... -} - -void KviIrcConnection::nickChange(const QString &szNewNick) -{ - // FIXME: should the new nickname be decoded in some way ? - m_pConsole->notifyListView()->nickChange(m_pUserInfo->nickName(),szNewNick); - m_pUserInfo->setNickName(szNewNick); - m_pConsole->output(KVI_OUT_NICK,__tr2qs("You have changed your nickname to %Q"),&szNewNick); - m_pConsole->updateCaption(); - m_pFrame->childConnectionNickNameChange(this); - emit nickNameChanged(); - g_pApp->addRecentNickname(szNewNick); -} - -bool KviIrcConnection::changeUserMode(char mode,bool bSet) -{ - __range_valid(m_pConnectionInfo); - if(bSet) - { - if(m_pUserInfo->hasUserMode(mode))return false; - m_pUserInfo->addUserMode(mode); - } else { - if(!m_pUserInfo->hasUserMode(mode))return false; - m_pUserInfo->removeUserMode(mode); - } - m_pConsole->updateCaption(); - m_pFrame->childConnectionUserModeChange(this); - emit userModeChanged(); - return true; -} - -void KviIrcConnection::loginComplete(const QString &szNickName) -{ - if(context()->state() == KviIrcContext::Connected)return; - - context()->loginComplete(); - - if(m_bIdentdAttached) - { - g_pFrame->executeInternalCommand(KVI_INTERNALCOMMAND_IDENT_STOP); - m_bIdentdAttached=false; - } - - if(szNickName != m_pUserInfo->nickName()) - { - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("The server refused the suggested nickname (%s) and named you %s instead"), - m_pUserInfo->nickName().utf8().data(),szNickName.utf8().data()); - m_pConsole->notifyListView()->nickChange(m_pUserInfo->nickName(),szNickName); - m_pUserInfo->setNickName(szNickName); - } - - g_pApp->addRecentNickname(szNickName); - - bool bHaltOutput = false; - bHaltOutput = KVS_TRIGGER_EVENT_0_HALTED(KviEvent_OnIrc,m_pConsole); - - if(!bHaltOutput) - m_pConsole->outputNoFmt(KVI_OUT_IRC,__tr2qs("Login operations complete, happy ircing!")); - - resurrectDeadQueries(); - - // on connect stuff ? - QString tmp = target()->network()->onLoginCommand(); - tmp.stripWhiteSpace(); - if(!tmp.isEmpty()) - { - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Executing scheduled network specific \"on login\" commands")); - KviKvsScript::run(tmp,m_pConsole); - } - - tmp = target()->server()->onLoginCommand(); - tmp.stripWhiteSpace(); - if(!tmp.isEmpty()) - { - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Executing scheduled server specific \"on login\" commands")); - KviKvsScript::run(tmp,m_pConsole); - } - - tmp = m_pUserIdentity->onLoginCommand(); - tmp.stripWhiteSpace(); - if(!tmp.isEmpty()) - { - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Executing scheduled identity specific \"on login\" commands")); - KviKvsScript::run(tmp,m_pConsole); - } - - // Set the configured umode - KviStr modeStr = server()->initUMode(); - - if(modeStr.isEmpty())modeStr = KVI_OPTION_STRING(KviOption_stringDefaultUserMode); - - if(!modeStr.isEmpty()) - { - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Setting configured user mode")); - sendFmtData("MODE %s +%s",encodeText(QString(m_pUserInfo->nickName())).data(),modeStr.ptr()); - } - - delayedStartNotifyList(); - restartLagMeter(); - - if(KVI_OPTION_BOOL(KviOption_boolShowChannelsJoinOnIrc)) - m_pFrame->executeInternalCommand(KVI_INTERNALCOMMAND_CHANNELSJOIN_OPEN); - - - // join saved channels - QString szChannels,szProtectedChannels,szPasswords,szCurPass,szCurChan; - - if(!(m_pStateData->commandToExecAfterConnect().isEmpty())) - { - KviStr tmp = m_pStateData->commandToExecAfterConnect(); - KviKvsScript::run(tmp.ptr(),m_pConsole); - } - - if(target()->server()->m_pReconnectInfo) - { - if(!target()->server()->m_pReconnectInfo->m_szJoinChannels.isEmpty()) - sendFmtData("JOIN %s",encodeText(target()->server()->m_pReconnectInfo->m_szJoinChannels).data()); - - KviQuery * query; - - for(QStringList::Iterator it = target()->server()->m_pReconnectInfo->m_szOpenQueryes.begin(); - it != target()->server()->m_pReconnectInfo->m_szOpenQueryes.end();it++) - { - QString szNick = *it; - query = findQuery(szNick); - if(!query) { - query = createQuery(szNick); - QString user; - QString host; - KviIrcUserDataBase * db = userDataBase(); - if(db) - { - KviIrcUserEntry * e = db->find(szNick); - if(e) - { - user = e->user(); - host = e->host(); - } - } - query->setTarget(szNick,user,host); - } - query->autoRaise(); - query->setFocus(); - } - delete target()->server()->m_pReconnectInfo; - target()->server()->m_pReconnectInfo=0; - }else { - if(target()->network()->autoJoinChannelList()) - { - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Auto-joining network specific channels")); - - QStringList * l = target()->network()->autoJoinChannelList(); - if(l->count()!=0) - { - for ( QStringList::Iterator it = l->begin(); it != l->end(); ++it ) { - - szCurPass=(*it).section(':',1); - if(szCurPass.isEmpty()) - { - if(!szChannels.isEmpty()) - szChannels.append(","); - szCurChan = (*it).section(':',0,0); - if(!(szCurChan[0]=='#' || szCurChan[0]=='&' || szCurChan[0]=='!')) - szCurChan.prepend('#'); - szChannels.append(szCurChan); - } else { - if(!szProtectedChannels.isEmpty()) - szProtectedChannels.append(","); - szCurChan = (*it).section(':',0,0); - if(!(szCurChan[0]=='#' || szCurChan[0]=='&' || szCurChan[0]=='!')) - szCurChan.prepend('#'); - szProtectedChannels.append(szCurChan); - if(!szPasswords.isEmpty()) - szPasswords.append(","); - szPasswords.append(szCurPass); - } - } - } - } - - if(server()->autoJoinChannelList()) - { - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_VERBOSE,__tr2qs("Auto-joining server specific channels")); - - QStringList * l = server()->autoJoinChannelList(); - if(l->count()!=0) - { - for ( QStringList::Iterator it = l->begin(); it != l->end(); ++it ) { - szCurPass=(*it).section(':',1); - if(szCurPass.isEmpty()) - { - if(!szChannels.isEmpty()) - szChannels.append(","); - szCurChan = (*it).section(':',0,0); - if(!(szCurChan[0]=='#' || szCurChan[0]=='&' || szCurChan[0]=='!')) - szCurChan.prepend(':'); - szChannels.append(szCurChan); - } else { - if(!szProtectedChannels.isEmpty()) - szProtectedChannels.append(","); - szCurChan = (*it).section(':',0,0); - if(!(szCurChan[0]=='#' || szCurChan[0]=='&' || szCurChan[0]=='!')) - szCurChan.prepend('#'); - szProtectedChannels.append(szCurChan); - if(!szPasswords.isEmpty()) - szPasswords.append(","); - szPasswords.append(szCurPass); - } - } - } - } - - QString szCommand; - if( (!szChannels.isEmpty()) || (!szProtectedChannels.isEmpty()) ) - { - szCommand.append(szProtectedChannels); - if(!szProtectedChannels.isEmpty() && !szChannels.isEmpty()) - szCommand.append(','); - szCommand.append(szChannels); - szCommand.append(" "); - szCommand.append(szPasswords); - - sendFmtData("JOIN %s",encodeText(szCommand).data()); - } - } - // minimize after connect - if(KVI_OPTION_BOOL(KviOption_boolMinimizeConsoleAfterConnect)) - m_pConsole->minimize(); -} - -void KviIrcConnection::incomingMessage(const char * message) -{ - // A message has arrived from the current server - // First of all , notify the monitors - if(KviPointerList<KviIrcDataStreamMonitor> * l = context()->monitorList()) - { - for(KviIrcDataStreamMonitor *m = l->first();m;m = l->next()) - { - m->incomingMessage(message); - } - } - // set the last message time - m_pStatistics->setLastMessageTime(kvi_unixTime()); - // and pass it to the server parser for processing - g_pServerParser->parseMessage(message,this); -} - -void KviIrcConnection::heartbeat(kvi_time_t tNow) -{ - if(m_eState == Connected) - { - if(!KVI_OPTION_BOOL(KviOption_boolDisableAwayListUpdates)) - { - // update the channel WHO lists (fixes users away state) - // first of all, we send our request not more often than every 50 secs - if((tNow - stateData()->lastSentChannelWhoRequest()) > 50) - { - // we also make sure that the last sent request is older than - // the last received reply - if(stateData()->lastSentChannelWhoRequest() <= stateData()->lastReceivedChannelWhoReply()) - { - // find the channel that has the older list now - kvi_time_t tOldest = tNow; - KviChannel * pOldest = 0; - for(KviChannel * pChan = m_pChannelList->first();pChan;pChan = m_pChannelList->next()) - { - if(pChan->lastReceivedWhoReply() < tOldest) - { - pOldest = pChan; - tOldest = pChan->lastReceivedWhoReply(); - } - } - // if the oldest chan who list is older than 150 secs, update it - if((tNow - tOldest) > 150) - { - // ok, sent the request for this channel - stateData()->setLastSentChannelWhoRequest(tNow); - QString szChanName = encodeText(pOldest->name()); - if(_OUTPUT_PARANOIC) - console()->output(KVI_OUT_VERBOSE,__tr2qs("Updating away state for channel %Q"),&szChanName); - if(lagMeter()) - { - KviStr tmp(KviStr::Format,"WHO %s",pOldest->name()); - lagMeter()->lagCheckRegister(tmp.ptr(),70); - } - pOldest->setSentSyncWhoRequest(); - if(!sendFmtData("WHO %s",encodeText(QString(pOldest->name())).data()))return; - } - } - } - } - } -} diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnection.h b/3.4.0/src/kvirc/kernel/kvi_ircconnection.h deleted file mode 100644 index 4227c971b6..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnection.h +++ /dev/null @@ -1,282 +0,0 @@ -#ifndef _KVI_IRCCONNECTION_H_ -#define _KVI_IRCCONNECTION_H_ -//============================================================================= -// -// File : kvi_ircconnection.h -// Created on Mon 03 May 2004 01:45:42 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_qcstring.h" -#include "kvi_pointerlist.h" -#include "kvi_time.h" -#include <qobject.h> - -class KviConsole; -class KviIrcNetworkData; -class KviIrcServer; -class KviProxy; -class KviIrcSocket; -class KviIrcLink; -class KviDataBuffer; -class KviIrcContext; -class KviFrame; -class KviChannel; -class KviQuery; -class KviIrcConnectionTarget; -class KviIrcUserDataBase; -class KviIrcConnectionUserInfo; -class KviIrcConnectionServerInfo; -class KviIrcConnectionStateData; -class KviIrcConnectionAntiCtcpFloodData; -class KviIrcConnectionNetsplitDetectorData; -class KviIrcConnectionAsyncWhoisData; -class KviIrcConnectionStatistics; -class KviLagMeter; -class KviNotifyListManager; -class KviDns; -class KviUserIdentity; - -class QTimer; -class QTextCodec; - - -class KVIRC_API KviIrcConnection : public QObject -{ - friend class KviConsole; - friend class KviIrcContext; - friend class KviIrcLink; - friend class KviServerParser; - Q_OBJECT -public: - // only KviConsole can create this - // pContext must NOT be null - // pTarget must NOT be null and must be allocated with new! this class takes the ownership - KviIrcConnection(KviIrcContext * pContext,KviIrcConnectionTarget * pTarget,KviUserIdentity * pIdentity); - ~KviIrcConnection(); -public: - enum State { Idle, Connecting, Connected }; -private: - KviFrame * m_pFrame; // shallow, never null - KviConsole * m_pConsole; // shallow, never null - KviIrcContext * m_pContext; // shallow, never null - - State m_eState; - bool m_bIdentdAttached; - - KviIrcConnectionTarget * m_pTarget; // owned, never null - - KviIrcLink * m_pLink; // owned, never null - - // The initial informations about the user we'll send out to the server - // Note that the ACTUAL user informations are in m_pUserInfo instead - KviUserIdentity * m_pUserIdentity; // owned, never null - - // The ACTUAL user informations - KviIrcConnectionUserInfo * m_pUserInfo; // owned, never null - // The ACTUAL server informations - KviIrcConnectionServerInfo * m_pServerInfo; // owned, never null - - KviIrcConnectionStateData * m_pStateData; // owned, never null - - KviPointerList<KviChannel> * m_pChannelList; // owned, never null, elements shallow - KviPointerList<KviQuery> * m_pQueryList; // owned, never null, elements shallow - - KviIrcUserDataBase * m_pUserDataBase; // owned, never null - - KviNotifyListManager * m_pNotifyListManager; // owned, see restartNotifyList() - QTimer * m_pNotifyListTimer; // delayed startup timer for the notify lists - - KviLagMeter * m_pLagMeter; // owned, may be null (when not running) - - KviIrcConnectionAntiCtcpFloodData * m_pAntiCtcpFloodData; // owned, never null - KviIrcConnectionNetsplitDetectorData * m_pNetsplitDetectorData; // owned, never null - KviIrcConnectionAsyncWhoisData * m_pAsyncWhoisData; // owned, never null - - KviIrcConnectionStatistics * m_pStatistics; // owned, never null - - KviDns * m_pLocalhostDns; // FIXME: this should go to an aux structure - - QTextCodec * m_pTextCodec; // connection codec: never null -public: - // returns a pointer to the owning console - // the pointer is NEVER null - KviConsole * console(){ return m_pConsole; }; - // never null - KviFrame * frame(){ return m_pFrame; }; - // never null - KviIrcContext * context(){ return m_pContext; }; - // forwarder from KviIrcConnectionTarget, never null - KVI_DEPRECATED KviIrcServer * server(); - // forwarder from KviIrcConnectionTarget, may be null - KVI_DEPRECATED KviProxy * proxy(); - // never null! - KviIrcConnectionTarget * target(){ return m_pTarget; }; - // never null! - KviIrcLink * link(){ return m_pLink; }; - // this should not be used... - KviIrcSocket * socket() KVI_DEPRECATED; - // the current state - State state(){ return m_eState; }; - // forwarder from KviIrcConnectionTarget, always non-empty string - const QString & networkName(); - // never null! - KviIrcUserDataBase * userDataBase(){ return m_pUserDataBase; }; - // never null. Use #include "kvi_ircconnectionuserinfo.h" - KviIrcConnectionUserInfo * userInfo(){ return m_pUserInfo; }; - // never null. Use #include "kvi_ircconnectionserverinfo.h" - KviIrcConnectionServerInfo * serverInfo(){ return m_pServerInfo; }; - // never null. Use #include "kvi_ircconnectionstatedata.h" - KviIrcConnectionStateData * stateData(){ return m_pStateData; }; - // never null. Use #include "kvi_ircconnectionantictcpflooddata.h" - KviIrcConnectionAntiCtcpFloodData * antiCtcpFloodData(){ return m_pAntiCtcpFloodData; }; - // never null. Use #include "kvi_ircconnectionnetsplitdetectordata.h" - KviIrcConnectionNetsplitDetectorData * netsplitDetectorData(){ return m_pNetsplitDetectorData; }; - // never null. Use #include "kvi_ircconnectionasyncwhoisdata.h" - KviIrcConnectionAsyncWhoisData * asyncWhoisData(){ return m_pAsyncWhoisData; }; - // never null. Use #include "kvi_ircconnectionstatistics.h" - KviIrcConnectionStatistics * statistics(){ return m_pStatistics; }; - // may be null - KviNotifyListManager * notifyListManager(){ return m_pNotifyListManager; }; - // may be null (when not running) - KviLagMeter * lagMeter(){ return m_pLagMeter; }; - // should be never null.. but if really everything goes wrong, it might be... - QTextCodec * textCodec(){ return m_pTextCodec; }; -public: - // helper (really common access to userInfo()->nickName()) - const QString & currentNickName(); - // helper (really common access to userInfo()->userName()) - const QString & currentUserName(); - // helper (really common access to serverInfo()->name()) - const QString & currentServerName(); - - // world interface: the following three functions use m_pLink->sendPacket() - bool sendData(const char *buffer,int buflen = -1); - bool sendFmtData(const char *fmt,...); - // - // channel management - // - // ----> KviChannelManager ? - KviChannel * findChannel(const QString &name); - KviPointerList<KviChannel> * channelList(){ return m_pChannelList; }; - int getCommonChannels(const QString &nick,QString &szChansBuffer,bool bAddEscapeSequences = true); - KviChannel * createChannel(const QString &name); - void registerChannel(KviChannel *c); - void unregisterChannel(KviChannel *c); - void keepChannelsOpenAfterDisconnect(); - void closeAllChannels(); - void setEncoding(const QString &szEncoding); -public slots: - void partAllChannels(); - void unhighlightAllChannels(); - void unhighlightAllQueries(); - void restartNotifyList(); - void closeAllQueries(); -public: - // - // query management - // - // ----> KviQueryManager ? - KviQuery * findQuery(const QString &nick); - KviPointerList<KviQuery> * queryList(){ return m_pQueryList; }; - KviQuery * createQuery(const QString &nick); - void registerQuery(KviQuery *q); - void unregisterQuery(KviQuery *q); - void keepQueriesOpenAfterDisconnect(); - void resurrectDeadQueries(); - void restartLagMeter(); -protected: - // - // notify list management - // - void delayedStartNotifyList(); - // - // login operations - // - void resolveLocalHost(); - void loginToIrcServer(); -protected: - // - // KviServerParser interface - // - // called to start the notify lists when RPL_ENDOFMOTD is received - void endOfMotdReceived(); - // called when RPL_SERVINFO (004) is received - void serverInfoReceived(const QString &szServerName,const QString &szUserModes,const QString &szChanModes); - // called to update the away state - void changeAwayState(bool bAway); - // called on each JOIN (but meaningful almost only on the first one) (FIXME: call it also on other messages ?) - void userInfoReceived(const QString &szUserName,const QString &szHostName); - // called when NICK is received - void nickChange(const QString &szNewNick); - // called when MODE is received for each mode character - bool changeUserMode(char mode,bool bSet); - // called on the first numerics received from server - void loginComplete(const QString &szNickName); -private slots: - void hostNameLookupTerminated(KviDns * pDns); -protected: - // - // KviIrcContext interface - // - // this starts an asynchronous connection attempt - // you must return control to the qt core for the connection - // operations to be initiated - void start(); - // kills any running connection or attempt - void abort(); - // called once in a while (every 5 secs at the moment) - void heartbeat(kvi_time_t tNow); -protected: - // - // KviIrcLink interface (down) - // - // this signals that the connection attempt has failed - void linkAttemptFailed(int iError); - // called by KviIrcLink when the socket state changes to Connected - void linkEstabilished(); - // called by KviIrcLink when the socket state changes to Ready - void linkTerminated(); -public: - // this is called by KviIrcLink OR KviMexLinkFilter when a message is arriving from the server - // needs to be public because subclasses of KviMexLinkFilter may call it. - void incomingMessage(const char * message); -signals: - void awayStateChanged(); - void userModeChanged(); - void nickNameChanged(); - void channelRegistered(KviChannel*); - void channelUnregistered(KviChannel*); - void chanListChanged(); -public: - QString decodeText(const char * szText); - KviQCString encodeText(const QString &szText); -private: - void setupTextCodec(); -}; - - -// TODO: KviIdentity - - -#endif //!_KVI_IRCCONNECTION_H_ - diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectionantictcpflooddata.cpp b/3.4.0/src/kvirc/kernel/kvi_ircconnectionantictcpflooddata.cpp deleted file mode 100644 index 70ef7bd565..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectionantictcpflooddata.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//============================================================================= -// -// File : kvi_ircconnectionantictcpflooddata.cpp -// Created on Sat 26 Jun 2004 18:09:42 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_ircconnectionantictcpflooddata.h" - -KviIrcConnectionAntiCtcpFloodData::KviIrcConnectionAntiCtcpFloodData() -{ - m_tLastCtcp = 0; - m_uCtcpCount = 0; -} - -KviIrcConnectionAntiCtcpFloodData::~KviIrcConnectionAntiCtcpFloodData() -{ -} - diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectionantictcpflooddata.h b/3.4.0/src/kvirc/kernel/kvi_ircconnectionantictcpflooddata.h deleted file mode 100644 index 1fa17d4ac8..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectionantictcpflooddata.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef _KVI_IRCCONNECTIONANTICTCPFLOODDATA_H_ -#define _KVI_IRCCONNECTIONANTICTCPFLOODDATA_H_ -//============================================================================= -// -// File : kvi_ircconnectionantictcpflooddata.h -// Created on Sat 26 Jun 2004 18:09:42 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_time.h" - -class KVIRC_API KviIrcConnectionAntiCtcpFloodData -{ -public: - KviIrcConnectionAntiCtcpFloodData(); - ~KviIrcConnectionAntiCtcpFloodData(); -protected: - // ctcp antiflood mechanism - kvi_time_t m_tLastCtcp; // the time we have received the last "may flood" ctcp request - unsigned int m_uCtcpCount; // the ctcp counter for the antiflooder -public: - kvi_time_t lastCtcpTime(){ return m_tLastCtcp; }; - unsigned int ctcpCount(){ return m_uCtcpCount; }; - void setLastCtcpTime(kvi_time_t tLastCtcp){ m_tLastCtcp = tLastCtcp; }; - void increaseCtcpCount(){ m_uCtcpCount++; }; - void setCtcpCount(unsigned int uCtcpCount){ m_uCtcpCount = uCtcpCount; }; -}; - - -#endif //!_KVI_IRCCONNECTIONANTICTCPFLOODDATA_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectionasyncwhoisdata.cpp b/3.4.0/src/kvirc/kernel/kvi_ircconnectionasyncwhoisdata.cpp deleted file mode 100644 index c8dbef0021..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectionasyncwhoisdata.cpp +++ /dev/null @@ -1,81 +0,0 @@ -//============================================================================= -// -// File : kvi_ircconnectionasyncwhoisdata.cpp -// Created on Sat 26 Jun 2004 19:40:20 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_ircconnectionasyncwhoisdata.h" -#include "kvi_kvs_script.h" - -KviAsyncWhoisInfo::KviAsyncWhoisInfo() -{ - pCallback = 0; - pMagic = 0; -} - -KviAsyncWhoisInfo::~KviAsyncWhoisInfo() -{ - if(pCallback)delete pCallback; - if(pMagic)delete pMagic; -} - -KviIrcConnectionAsyncWhoisData::KviIrcConnectionAsyncWhoisData() -{ - m_pWhoisInfoList = 0; -} - -KviIrcConnectionAsyncWhoisData::~KviIrcConnectionAsyncWhoisData() -{ - if(m_pWhoisInfoList)delete m_pWhoisInfoList; -} - -void KviIrcConnectionAsyncWhoisData::add(KviAsyncWhoisInfo * i) -{ - if(!m_pWhoisInfoList) - { - m_pWhoisInfoList = new KviPointerList<KviAsyncWhoisInfo>; - m_pWhoisInfoList->setAutoDelete(true); - } - m_pWhoisInfoList->append(i); -} - -KviAsyncWhoisInfo * KviIrcConnectionAsyncWhoisData::lookup(const QString &nick) -{ - if(!m_pWhoisInfoList)return 0; - for(KviAsyncWhoisInfo * i = m_pWhoisInfoList->first();i;i = m_pWhoisInfoList->next()) - { - if(KviQString::equalCI(nick,i->szNick))return i; - } - return 0; -} - -void KviIrcConnectionAsyncWhoisData::remove(KviAsyncWhoisInfo * i) -{ - if(!m_pWhoisInfoList)return; - m_pWhoisInfoList->removeRef(i); - if(m_pWhoisInfoList->isEmpty()) - { - delete m_pWhoisInfoList; - m_pWhoisInfoList = 0; - } -} diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectionasyncwhoisdata.h b/3.4.0/src/kvirc/kernel/kvi_ircconnectionasyncwhoisdata.h deleted file mode 100644 index 84a3899812..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectionasyncwhoisdata.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef _KVI_IRCCONNECTIONASYNCWHOISDATA_H_ -#define _KVI_IRCCONNECTIONASYNCWHOISDATA_H_ -//============================================================================= -// -// File : kvi_ircconnectionasyncwhoisdata.h -// Created on Sat 26 Jun 2004 19:40:20 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_pointerlist.h" - -class KviWindow; -class KviKvsScript; -class KviKvsVariant; - -class KVIRC_API KviAsyncWhoisInfo -{ -public: - QString szNick; - QString szUser; - QString szHost; - QString szReal; - QString szServer; - QString szIdle; - QString szSignon; - QString szChannels; - QString szSpecial; - KviKvsScript * pCallback; - KviKvsVariant * pMagic; - QString szCode; // <-- kill this when KVS is hardwired! - QString szMagic; // <-- kill this when KVS is hardwired! - KviWindow * pWindow; -public: - KviAsyncWhoisInfo(); - ~KviAsyncWhoisInfo(); -}; - - - -class KVIRC_API KviIrcConnectionAsyncWhoisData -{ -public: - KviIrcConnectionAsyncWhoisData(); - ~KviIrcConnectionAsyncWhoisData(); -protected: - KviPointerList<KviAsyncWhoisInfo> * m_pWhoisInfoList; // awhois pending stuff -public: - void add(KviAsyncWhoisInfo * i); - KviAsyncWhoisInfo * lookup(const QString &nick); - void remove(KviAsyncWhoisInfo * i); -}; - -#endif //!_KVI_IRCCONNECTIONASYNCWHOISDATA_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectionnetsplitdetectordata.cpp b/3.4.0/src/kvirc/kernel/kvi_ircconnectionnetsplitdetectordata.cpp deleted file mode 100644 index b3b1278cec..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectionnetsplitdetectordata.cpp +++ /dev/null @@ -1,37 +0,0 @@ -//============================================================================= -// -// File : kvi_ircconnectionnetsplitdetectordata.cpp -// Created on Sat 26 Jun 2004 18:20:58 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_ircconnectionnetsplitdetectordata.h" - -KviIrcConnectionNetsplitDetectorData::KviIrcConnectionNetsplitDetectorData() -{ - m_tLastNetsplitOnQuit = 0; -} - -KviIrcConnectionNetsplitDetectorData::~KviIrcConnectionNetsplitDetectorData() -{ -} - diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectionnetsplitdetectordata.h b/3.4.0/src/kvirc/kernel/kvi_ircconnectionnetsplitdetectordata.h deleted file mode 100644 index cdff1da0f6..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectionnetsplitdetectordata.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef _KVI_IRCCONNECTIONNETSPLITDETECTORDATA_H_ -#define _KVI_IRCCONNECTIONNETSPLITDETECTORDATA_H_ -//============================================================================= -// -// File : kvi_ircconnectionnetsplitdetectordata.h -// Created on Sat 26 Jun 2004 18:20:58 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_time.h" - -class KVIRC_API KviIrcConnectionNetsplitDetectorData -{ -public: - KviIrcConnectionNetsplitDetectorData(); - ~KviIrcConnectionNetsplitDetectorData(); -protected: - QString m_szLastNetsplitOnQuitReason; - kvi_time_t m_tLastNetsplitOnQuit; -public: - const QString & lastNetsplitOnQuitReason(){ return m_szLastNetsplitOnQuitReason; }; - void setLastNetsplitOnQuitReason(const QString &szReason){ m_szLastNetsplitOnQuitReason = szReason; }; - kvi_time_t lastNetsplitOnQuitTime(){ return m_tLastNetsplitOnQuit; }; - void setLastNetsplitOnQuitTime(kvi_time_t t){ m_tLastNetsplitOnQuit = t; }; -}; - -#endif //!_KVI_IRCCONNECTIONNETSPLITDETECTORDATA_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectionserverinfo.cpp b/3.4.0/src/kvirc/kernel/kvi_ircconnectionserverinfo.cpp deleted file mode 100644 index a69f86b567..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectionserverinfo.cpp +++ /dev/null @@ -1,285 +0,0 @@ -//============================================================================= -// -// File : kvi_ircconnectionserverinfo.cpp -// Created on Tue 22 Jun 2004 03:57:32 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_ircconnectionserverinfo.h" -#include "kvi_locale.h" -#include "kvi_malloc.h" -#include "kvi_ircuserdb.h" - -KviIrcConnectionServerInfo::KviIrcConnectionServerInfo() -{ - // default assumptions - m_szSupportedChannelTypes = "#&!+"; - m_szSupportedModePrefixes = "@+"; - m_szSupportedModeFlags = "ov"; - m_pModePrefixTable = 0; - buildModePrefixTable(); - m_bSupportsModesIe = true; - m_bSupportsWatchList = false; - m_bSupportsCodePages = false; - m_iMaxTopicLen=-1; - m_szListModes=""; - m_szPlainModes=""; - m_iMaxModeChanges=3; - m_pServInfo = new KviBasicIrcServerInfo(); -} - -KviIrcConnectionServerInfo::~KviIrcConnectionServerInfo() -{ - if(m_pServInfo) delete m_pServInfo; - if(m_pModePrefixTable) kvi_free(m_pModePrefixTable); -} - -void KviIrcConnectionServerInfo::setSupportedChannelModes(const QString &szSupportedChannelModes) -{ - int pos=-1; - - pos=szSupportedChannelModes.find(','); - if(pos>=0) m_szListModes=szSupportedChannelModes.left(pos); - - pos=szSupportedChannelModes.findRev(','); - if(pos>=0) m_szPlainModes=szSupportedChannelModes.right(szSupportedChannelModes.length()+pos-1); - - m_szSupportedChannelModes = szSupportedChannelModes; - m_bSupportsModesIe = (szSupportedChannelModes.contains('e') && szSupportedChannelModes.contains('I')); - - QChar* aux=(QChar*)szSupportedChannelModes.ucs2(); - while(aux->unicode()) - { - if(!m_szSupportedChannelModes.contains(*aux)) - m_szSupportedChannelModes.append(*aux); - aux++; - } -} - -void KviIrcConnectionServerInfo::setSupportedModePrefixes(const QString &szSupportedModePrefixes,const QString &szSupportedModeFlags) -{ - m_szSupportedModeFlags = szSupportedModeFlags; - m_szSupportedModePrefixes = szSupportedModePrefixes; - buildModePrefixTable(); -} - -void KviIrcConnectionServerInfo::buildModePrefixTable() -{ - if(m_pModePrefixTable) kvi_free(m_pModePrefixTable); - const QChar * cPrefix = KviQString::nullTerminatedArray(m_szSupportedModePrefixes); - const QChar * cFlag = KviQString::nullTerminatedArray(m_szSupportedModeFlags); - if(!cPrefix || !cFlag)return; // eh ? - - m_uPrefixes=QMIN(m_szSupportedModePrefixes.length(),m_szSupportedModePrefixes.length()); - m_pModePrefixTable=(kvi_u32_t*)kvi_malloc(sizeof(kvi_u32_t)*3*m_uPrefixes); - - unsigned short uPrefix,uFlag; - - // Pragma: FIXME: The whole mode handling needs rethinking! - // Alexey: FIXED: rethinked:) - // Pragma: LOL :DDDD - int i=0; - while( (uPrefix = cPrefix->unicode()) && (uFlag = cFlag->unicode()) && i<m_uPrefixes*3) - { - m_pModePrefixTable[i]=uPrefix; - m_pModePrefixTable[i+1]=uFlag; - switch(uFlag) - { - case 'o': m_pModePrefixTable[i+2] = KVI_USERFLAG_OP; - break; - case 'v': m_pModePrefixTable[i+2] = KVI_USERFLAG_VOICE; - break; - case 'h': m_pModePrefixTable[i+2] = KVI_USERFLAG_HALFOP; - break; - case 'a': m_pModePrefixTable[i+2] = KVI_USERFLAG_CHANADMIN; - break; - case 'u': m_pModePrefixTable[i+2] = KVI_USERFLAG_USEROP; - break; - case 'q': m_pModePrefixTable[i+2] = KVI_USERFLAG_CHANOWNER; - break; - default: - m_pModePrefixTable[i+2]=0; - break; - } - i+=3; - cPrefix++; - cFlag++; - } -} - -bool KviIrcConnectionServerInfo::isSupportedModePrefix(QChar c) -{ - if(!m_pModePrefixTable) return false; - for(int i=0;i<m_uPrefixes;i++) - { - if(m_pModePrefixTable[i*3]==c.unicode()) return true; - } - return false; -} - -bool KviIrcConnectionServerInfo::isSupportedModeFlag(QChar c) -{ - if(!m_pModePrefixTable) return false; - for(int i=0;i<m_uPrefixes;i++) - { - if(m_pModePrefixTable[(i*3)+1]==c.unicode()) return true; - } - return false; -} - -QChar KviIrcConnectionServerInfo::modePrefixChar(kvi_u32_t flag) -{ - if(!m_pModePrefixTable) return QChar(0); - for(int i=0;i<m_uPrefixes;i++) - { - if(m_pModePrefixTable[i*3+2] & flag) return QChar(m_pModePrefixTable[i*3]); - } - return QChar(0); -} - -QChar KviIrcConnectionServerInfo::modeFlagChar(kvi_u32_t flag) -{ - if(!m_pModePrefixTable) return QChar(0); - for(int i=0;i<m_uPrefixes;i++) - { - if(m_pModePrefixTable[i*3+2] & flag ) return QChar(m_pModePrefixTable[i*3+1]); - } - return QChar(0); -} - -kvi_u32_t KviIrcConnectionServerInfo::modeFlagFromPrefixChar(QChar c) -{ - if(!m_pModePrefixTable) return 0; - for(int i=0;i<m_uPrefixes;i++) - { - if(m_pModePrefixTable[i*3]==c.unicode()) return m_pModePrefixTable[i*3+2]; - } - return 0; -} - -kvi_u32_t KviIrcConnectionServerInfo::modeFlagFromModeChar(QChar c) -{ - if(!m_pModePrefixTable) return 0; - for(int i=0;i<m_uPrefixes;i++) - { - if(m_pModePrefixTable[i*3+1]==c.unicode()) return m_pModePrefixTable[i*3+2]; - } - return 0; -} - -void KviIrcConnectionServerInfo::setServerVersion(const QString & version) -{ - if(m_pServInfo) delete m_pServInfo; - if(version.contains("unreal",false)) - m_pServInfo = new KviUnrealIrcServerInfo(version); - else if(version.contains("bahamut",false)) - m_pServInfo = new KviBahamutIrcServerInfo(version); - else if(version.contains("hyperion",false)) - m_pServInfo = new KviHyperionIrcServerInfo(version); - else - m_pServInfo = new KviBasicIrcServerInfo(version); -} - - -KviBasicIrcServerInfo::KviBasicIrcServerInfo(const QString & version) -{ - m_szServerVersion = version; -} - -KviBasicIrcServerInfo::~KviBasicIrcServerInfo() -{ -} - -const QString & KviBasicIrcServerInfo::getChannelModeDescription(QChar mode) -{ - QString tmp=getCustomChannelModeDescription(mode); - if(tmp.isNull()) return getBasicChannelModeDescription(mode); - return KviQString::empty; -} - -const QString & KviBasicIrcServerInfo::getUserModeDescription(QChar mode) -{ - QString tmp=getCustomUserModeDescription(mode); - if(tmp.isNull()) return getBasicUserModeDescription(mode); - return KviQString::empty; -} - -const QString & KviBasicIrcServerInfo::getBasicChannelModeDescription(QChar mode) -{ - switch(mode.unicode()) - { - case 'o': return __tr2qs("Channel operators"); break; - case 'v': return __tr2qs("Voiced users"); break; - case 'h': return __tr2qs("Half-operators");break; - case 'b': return __tr2qs("Ban masks"); break; - case 'c': return __tr2qs("Color free (no ANSI colors)"); break; - case 'e': return __tr2qs("Ban exception masks"); break; - case 'I': return __tr2qs("Invite exception masks or forbid /INVITE"); break; - case 's': return __tr2qs("Secret"); break; - case 'p': return __tr2qs("Private"); break; - case 't': return __tr2qs("Topic change restricted"); break; - case 'i': return __tr2qs("Invite only"); break; - case 'n': return __tr2qs("No external messages"); break; - case 'a': return __tr2qs("Anonymous or protected user"); break; - case 'q': return __tr2qs("Quiet or channel owner"); break; - case 'l': return __tr2qs("Limited number of users"); break; - case 'k': return __tr2qs("Key"); break; - case 'm': return __tr2qs("Moderated"); break; - case 'r': return __tr2qs("Registered"); break; - case 'G': return __tr2qs("Censor swear words"); break; - case 'M': return __tr2qs("Impossible to speak and change nick if not authenticated with NickServ"); break; - case 'N': return __tr2qs("Impossible to change nick if not authenticated with NickServ"); break; - case 'R': return __tr2qs("Only registered nicks can join"); break; - case 'Q': return __tr2qs("No kicks able (unless U-Line)"); break; - case 'O': return __tr2qs("IRC-Op only channel"); break; - case 'A': return __tr2qs("Server/Network/Tech Admin only channel"); break; - case 'K': return __tr2qs("Forbid /KNOCK"); break; - case 'S': return __tr2qs("Strip colors"); break; - case 'L': return __tr2qs("Redirect on channel full"); break; - case 'C': return __tr2qs("Forbid channel CTCPs"); break; - case 'u': return __tr2qs("User-operators OR Auditorium: /NAMES and /WHO show only ops"); break; - case '7': return __tr2qs("Only 7-bit letters in nicknames allowed"); break; - case 'x': return __tr2qs("Impossible to use both 7-bit and 8-bit letters in nicknames"); break; - } - return KviQString::empty; -} - -const QString & KviBasicIrcServerInfo::getBasicUserModeDescription(QChar mode) -{ - switch(mode.unicode()) - { - case 'o': return __tr2qs("o: IRC operator (OPER)"); break; - case 'O': return __tr2qs("O: Local IRC operator (LOCOP)"); break; - case 'i': return __tr2qs("i: Invisible"); break; - case 'w': return __tr2qs("w: Recipient for WALLOPS messages"); break; - case 'r': return __tr2qs("r: User with restricted connection (or recipient for messages about rejected bots)"); break; - case 's': return __tr2qs("s: Recipient for server notices"); break; - case 'z': return __tr2qs("z: Recipient for oper wallop messages"); break; - case 'c': return __tr2qs("c: Recipient for cconn messages"); break; - case 'k': return __tr2qs("k: Recipient for server kill messages"); break; - case 'f': return __tr2qs("f: Recipient for full server notices"); break; - case 'y': return __tr2qs("y: Spy :)"); break; - case 'd': return __tr2qs("d: Obscure 'DEBUG' flag"); break; - case 'n': return __tr2qs("n: Recipient for nick changes"); break; - } - return KviQString::empty; -} diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectionserverinfo.h b/3.4.0/src/kvirc/kernel/kvi_ircconnectionserverinfo.h deleted file mode 100644 index 60722e875e..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectionserverinfo.h +++ /dev/null @@ -1,141 +0,0 @@ -#ifndef _KVI_IRCCONNECTIONSERVERINFO_H_ -#define _KVI_IRCCONNECTIONSERVERINFO_H_ -//============================================================================= -// -// File : kvi_ircconnectionserverinfo.h -// Created on Tue 22 Jun 2004 03:57:32 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_inttypes.h" - -class KVIRC_API KviBasicIrcServerInfo -{ -protected: - QString m_szServerVersion; -public: - KviBasicIrcServerInfo(const QString & version = KviQString::empty); - ~KviBasicIrcServerInfo(); -protected: - virtual const QString & getCustomChannelModeDescription(QChar mode) { return KviQString::empty; }; - virtual const QString & getCustomUserModeDescription(QChar mode) { return KviQString::empty; }; -private: - const QString & getBasicChannelModeDescription(QChar mode); - const QString & getBasicUserModeDescription(QChar mode); -public: - const QString & getChannelModeDescription(QChar mode); - const QString & getUserModeDescription(QChar mode); - virtual char getRegisterModeChar() { return 0; }; -}; - -class KVIRC_API KviUnrealIrcServerInfo : public KviBasicIrcServerInfo -{ -public: - KviUnrealIrcServerInfo(const QString & version = KviQString::empty) - :KviBasicIrcServerInfo(version) {;}; - virtual char getRegisterModeChar() { return 'r'; }; -}; - -class KVIRC_API KviBahamutIrcServerInfo : public KviBasicIrcServerInfo -{ -public: - KviBahamutIrcServerInfo(const QString & version = KviQString::empty) - :KviBasicIrcServerInfo(version) {;}; - virtual char getRegisterModeChar() { return 'r'; }; -}; - -class KVIRC_API KviHyperionIrcServerInfo : public KviBasicIrcServerInfo -{ -public: - KviHyperionIrcServerInfo(const QString & version = KviQString::empty) - :KviBasicIrcServerInfo(version) {;}; - virtual char getRegisterModeChar() { return 'e'; }; -}; - -class KVIRC_API KviIrcConnectionServerInfo -{ - friend class KviConsole; // for now - friend class KviServerParser; - friend class KviIrcConnection; -protected: - KviIrcConnectionServerInfo(); - ~KviIrcConnectionServerInfo(); -private: - KviBasicIrcServerInfo * m_pServInfo; - QString m_szName; // the most actual server name (may be the one we specify or the one that the server wants to be known as) - QString m_szSupportedUserModes; // the supported user modes - QString m_szSupportedChannelModes; // the supported channel modes - QString m_szSupportedModePrefixes; // the actually used mode prefixes @+ - kvi_u32_t * m_pModePrefixTable; // the mode prefixes above in a table - unsigned int m_uPrefixes; - QString m_szSupportedModeFlags; // the actually used mode flags ov - QString m_szSupportedChannelTypes; // the supported channel types - bool m_bSupportsModesIe; // supports the channel modes I and e ? - bool m_bSupportsWatchList; // supports the watch list ? - bool m_bSupportsCodePages; // supports the /CODEPAGE command ? - int m_iMaxTopicLen; - int m_iMaxModeChanges; - QString m_szListModes; - QString m_szPlainModes; -public: - char registerModeChar() { return m_pServInfo ? m_pServInfo->getRegisterModeChar() : 0; }; - const QString & name(){ return m_szName; }; - const QString & supportedUserModes(){ return m_szSupportedUserModes; }; - const QString & supportedChannelModes(){ return m_szSupportedChannelModes; }; - const QString & supportedChannelTypes(){ return m_szSupportedChannelTypes; }; - const QString & supportedModePrefixes(){ return m_szSupportedModePrefixes; }; - const QString & supportedModeFlags(){ return m_szSupportedModeFlags; }; - const QString & supportedListModes(){ return m_szListModes; }; - const QString & supportedPlainModes(){ return m_szPlainModes; }; - bool supportsModesIe(){ return m_bSupportsModesIe; }; - bool supportsWatchList(){ return m_bSupportsWatchList; }; - bool supportsCodePages(){ return m_bSupportsCodePages; }; - - int maxTopicLen() { return m_iMaxTopicLen; }; - int maxModeChanges() { return m_iMaxModeChanges; }; - - void setServerVersion(const QString & version); - - const QString & getChannelModeDescription(QChar mode) { return m_pServInfo->getChannelModeDescription(mode); }; - const QString & getUserModeDescription(QChar mode) { return m_pServInfo->getUserModeDescription(mode); }; - - bool isSupportedModePrefix(QChar c); - bool isSupportedModeFlag(QChar c); - QChar modePrefixChar(kvi_u32_t flag); - QChar modeFlagChar(kvi_u32_t flag); - kvi_u32_t modeFlagFromPrefixChar(QChar c); - kvi_u32_t modeFlagFromModeChar(QChar c); -protected: - void setName(const QString &szName){ m_szName = szName; }; - void setSupportedUserModes(const QString &szSupportedUserModes){ m_szSupportedUserModes = szSupportedUserModes; }; - void setSupportedChannelModes(const QString &szSupportedChannelModes); - void setSupportedModePrefixes(const QString &szSupportedModePrefixes,const QString &szSupportedModeFlags); - void setSupportedChannelTypes(const QString &szSupportedChannelTypes){ m_szSupportedChannelTypes = szSupportedChannelTypes; }; - void setSupportsWatchList(bool bSupportsWatchList){ m_bSupportsWatchList = bSupportsWatchList; }; - void setSupportsCodePages(bool bSupportsCodePages){ m_bSupportsCodePages = bSupportsCodePages; }; - void setMaxTopicLen( int iTopLen ) { m_iMaxTopicLen=iTopLen; }; - void setMaxModeChanges(int iModes ) { m_iMaxModeChanges=iModes; }; -private: - void buildModePrefixTable(); -}; - -#endif //!_KVI_IRCCONNECTIONSERVERINFO_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectionstatedata.cpp b/3.4.0/src/kvirc/kernel/kvi_ircconnectionstatedata.cpp deleted file mode 100644 index f06111a43f..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectionstatedata.cpp +++ /dev/null @@ -1,42 +0,0 @@ -//============================================================================= -// -// File : kvi_ircconnectionstatedata.cpp -// Created on Sat 26 Jun 2004 09:31:52 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_ircconnectionstatedata.h" - -KviIrcConnectionStateData::KviIrcConnectionStateData() -{ - m_bSentQuit = false; - m_uLoginNickIndex = 0; - m_bSimulateUnexpectedDisconnect = false; - m_tLastReceivedChannelWhoReply = kvi_unixTime(); - m_tLastSentChannelWhoRequest = m_tLastReceivedChannelWhoReply; - m_tLastReceivedWhoisReply = 0; -} - -KviIrcConnectionStateData::~KviIrcConnectionStateData() -{ -} - diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectionstatedata.h b/3.4.0/src/kvirc/kernel/kvi_ircconnectionstatedata.h deleted file mode 100644 index 12da18bd40..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectionstatedata.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef _KVI_IRCCONNECTIONSTATEDATA_H_ -#define _KVI_IRCCONNECTIONSTATEDATA_H_ -//============================================================================= -// -// File : kvi_ircconnectionstatedata.h -// Created on Sat 26 Jun 2004 09:31:52 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_time.h" -#include "kvi_qstring.h" - -// -// This class is used as container for miscelaneous connection state variables -// that do not have a class for their own. -// If you need to add some "minor" variable to the connection state then -// this is the right place for it. -// - -class KVIRC_API KviIrcConnectionStateData -{ - friend class KviIrcConnection; - friend class KviServerParser; - friend class KviUserParser; -public: - KviIrcConnectionStateData(); - ~KviIrcConnectionStateData(); -protected: - bool m_bSentQuit; // have we sent the quit message for this connection ? - unsigned int m_uLoginNickIndex; // the index of the identity nicknames used until now (see KviIrcConnection::loginToIrcServer()) - QString m_szCommandToExecAfterConnect; // yes.. this is a special command to execute after connection - bool m_bSimulateUnexpectedDisconnect; // this is set to true if we have to simulate an unexpected disconnect even if we have sent a normal quit message - kvi_time_t m_tLastReceivedChannelWhoReply; // the time that we have received our last channel who reply - kvi_time_t m_tLastSentChannelWhoRequest; // the time that we have sent our last channel who request - kvi_time_t m_tLastReceivedWhoisReply; // the time that we have received the last whois reply, reset to 0 when we receive an /END OF WHOIS -public: - bool sentQuit(){ return m_bSentQuit; }; - void setSentQuit(){ m_bSentQuit = true; }; - - kvi_time_t lastReceivedChannelWhoReply(){ return m_tLastReceivedChannelWhoReply; }; - void setLastReceivedChannelWhoReply(kvi_time_t tTime){ m_tLastReceivedChannelWhoReply = tTime; }; - - kvi_time_t lastSentChannelWhoRequest(){ return m_tLastSentChannelWhoRequest; }; - void setLastSentChannelWhoRequest(kvi_time_t tTime){ m_tLastSentChannelWhoRequest = tTime; }; - - kvi_time_t lastReceivedWhoisReply(){ return m_tLastReceivedWhoisReply; }; - void setLastReceivedWhoisReply(kvi_time_t tTime){ m_tLastReceivedWhoisReply = tTime; }; - - bool simulateUnexpectedDisconnect(){ return m_bSimulateUnexpectedDisconnect; }; - void setSimulateUnexpectedDisconnect(){ m_bSimulateUnexpectedDisconnect = true; }; - - unsigned int loginNickIndex(){ return m_uLoginNickIndex; }; - void setLoginNickIndex(unsigned int uNickIdx){ m_uLoginNickIndex = uNickIdx; }; - - const QString & commandToExecAfterConnect(){ return m_szCommandToExecAfterConnect; }; - void setCommandToExecAfterConnect(const QString &szCmd){ m_szCommandToExecAfterConnect = szCmd; }; -}; - -#endif //!_KVI_IRCCONNECTIONSTATEDATA_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectionstatistics.cpp b/3.4.0/src/kvirc/kernel/kvi_ircconnectionstatistics.cpp deleted file mode 100644 index f0243597eb..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectionstatistics.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//============================================================================= -// -// File : kvi_ircconnectionstatistics.cpp -// Created on Sun 27 Jun 2004 21:13:48 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_ircconnectionstatistics.h" - -KviIrcConnectionStatistics::KviIrcConnectionStatistics() -{ - m_tConnectionStart = 0; - m_tLastMessage = 0; -} - -KviIrcConnectionStatistics::~KviIrcConnectionStatistics() -{ -} - diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectionstatistics.h b/3.4.0/src/kvirc/kernel/kvi_ircconnectionstatistics.h deleted file mode 100644 index 406a8538d1..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectionstatistics.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _KVI_IRCCONNECTIONSTATISTICS_H_ -#define _KVI_IRCCONNECTIONSTATISTICS_H_ -//============================================================================= -// -// File : kvi_ircconnectionstatistics.h -// Created on Sun 27 Jun 2004 21:13:48 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_time.h" - - -class KVIRC_API KviIrcConnectionStatistics -{ - friend class KviConsole; // to be removed - friend class KviIrcConnection; -public: - KviIrcConnectionStatistics(); - ~KviIrcConnectionStatistics(); -protected: - kvi_time_t m_tConnectionStart; // (valid only when Connected or LoggingIn) - kvi_time_t m_tLastMessage; // last message received from server -public: - kvi_time_t connectionStartTime(){ return m_tConnectionStart; }; - kvi_time_t lastMessageTime(){ return m_tLastMessage; }; -protected: - void setLastMessageTime(kvi_time_t t){ m_tLastMessage = t; }; - void setConnectionStartTime(kvi_time_t t){ m_tConnectionStart = t; }; -}; - -#endif //!_KVI_IRCCONNECTIONSTATISTICS_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectiontarget.cpp b/3.4.0/src/kvirc/kernel/kvi_ircconnectiontarget.cpp deleted file mode 100644 index ad956c9e8f..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectiontarget.cpp +++ /dev/null @@ -1,66 +0,0 @@ -//============================================================================= -// -// File : kvi_ircconnectiontarget.cpp -// Created on Tue 08 Jun 2004 14:11:59 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_ircconnectiontarget.h" -#include "kvi_ircserver.h" -#include "kvi_proxydb.h" - -KviIrcConnectionTarget::KviIrcConnectionTarget(const KviIrcNetwork * pNetwork, - const KviIrcServer * pServer, - const KviProxy * pProxy, - const QString &szBindAddress) -{ - m_pNetwork = new KviIrcNetwork(*pNetwork); - m_pServer = new KviIrcServer(*pServer); - m_pProxy = pProxy ? new KviProxy(*pProxy) : 0; - m_szBindAddress = szBindAddress; -} - -KviIrcConnectionTarget::~KviIrcConnectionTarget() -{ - delete m_pNetwork; - delete m_pServer; - if(m_pProxy)delete m_pProxy; -} - -const QString & KviIrcConnectionTarget::networkName() -{ - return m_pNetwork->name(); -} - -void KviIrcConnectionTarget::setNetworkName(const QString &szNetName) -{ - m_pNetwork->setName(szNetName); -} - - -void KviIrcConnectionTarget::clearProxy() -{ - if(!m_pProxy)return; - delete m_pProxy; - m_pProxy = 0; -} - diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectiontarget.h b/3.4.0/src/kvirc/kernel/kvi_ircconnectiontarget.h deleted file mode 100644 index ae1a9a59a1..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectiontarget.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef _KVI_IRCCONNECTIONTARGET_H_ -#define _KVI_IRCCONNECTIONTARGET_H_ -//============================================================================= -// -// File : kvi_ircconnectiontarget.h -// Created on Tue 08 Jun 2004 14:11:59 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_heapobject.h" - -class KviIrcNetwork; -class KviIrcServer; -class KviProxy; - -class KVIRC_API KviIrcConnectionTarget : public KviHeapObject -{ - friend class KviIrcConnectionTargetResolver; -public: - // pServer is a shallow pointer: this class makes a copy of it internally, must NOT be null - // pProxy may be null if a proxy is not desired. this class makes a copy of it internally - KviIrcConnectionTarget(const KviIrcNetwork * pNetwork, - const KviIrcServer * pServer, - const KviProxy * pProxy = 0, - const QString &szBindAddress = QString::null); - ~KviIrcConnectionTarget(); -private: - KviIrcNetwork * m_pNetwork; // owned, never null - KviIrcServer * m_pServer; // owned, never null - KviProxy * m_pProxy; // owned, may be null - QString m_szBindAddress; // forced bind address -public: - KviIrcServer * server(){ return m_pServer; }; - KviIrcNetwork * network(){ return m_pNetwork; }; - KviProxy * proxy(){ return m_pProxy; }; - const QString & bindAddress(){ return m_szBindAddress; }; - bool hasBindAddress(){ return (!m_szBindAddress.isEmpty()); }; - const QString & networkName(); - // this allows to force the network name: it should be used only by KviConsole - // but it's KviServerParser (kvi_sp_numeric.cpp) that first - // gets the new network name... thus we make it public - // to remove one level of indirection. - void setNetworkName(const QString &szNetName); -protected: - // this is for KviIrcConnectionTargetResolver only - void clearProxy(); - void setBindAddress(const QString &szBindAddress){ m_szBindAddress = szBindAddress; }; -}; - -#endif //!_KVI_IRCCONNECTIONTARGET_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectiontargetresolver.cpp b/3.4.0/src/kvirc/kernel/kvi_ircconnectiontargetresolver.cpp deleted file mode 100644 index e33def0788..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectiontargetresolver.cpp +++ /dev/null @@ -1,555 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File : kvi_ircconnectiontargetresolver.cpp -// Creation date : Fri May 11 23:24:18 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_ircconnectiontargetresolver.h" -#include "kvi_dns.h" -#include "kvi_locale.h" -#include "kvi_ircserverdb.h" -#include "kvi_proxydb.h" -#include "kvi_error.h" -#include "kvi_out.h" -#include "kvi_options.h" -#include "kvi_ircsocket.h" -#include "kvi_console.h" -#include "kvi_netutils.h" -#include "kvi_internalcmd.h" -#include "kvi_frame.h" -#include "kvi_mexlinkfilter.h" -#include "kvi_garbage.h" -#include "kvi_malloc.h" -#include "kvi_memmove.h" -#include "kvi_debug.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectiontarget.h" -#include "kvi_ircsocket.h" -#include "kvi_error.h" - -#define __KVI_DEBUG__ -#include "kvi_debug.h" - -#include <qtimer.h> - -extern KVIRC_API KviIrcServerDataBase * g_pIrcServerDataBase; -extern KVIRC_API KviProxyDataBase * g_pProxyDataBase; -extern KVIRC_API KviGarbageCollector * g_pGarbageCollector; - - - -KviIrcConnectionTargetResolver::KviIrcConnectionTargetResolver(KviIrcConnection * pConnection) -: QObject() -{ - m_pConnection = pConnection; - m_pTarget = 0; - m_pConsole = m_pConnection->console(); - - m_pStartTimer = 0; - m_pProxyDns = 0; - m_pServerDns = 0; - - m_eState = Idle; - m_eStatus = Success; - - m_iLastError = KviError_success; -} - -KviIrcConnectionTargetResolver::~KviIrcConnectionTargetResolver() -{ - cleanup(); -} - -void KviIrcConnectionTargetResolver::cleanup() -{ - if(m_pProxyDns) - { - if(m_pProxyDns->isRunning()) - { - // deleting a running dns may block - // thus garbage-collect it and delete later - g_pGarbageCollector->collect(m_pProxyDns); - } else { - // can't block : just delete it - delete m_pProxyDns; - } - m_pProxyDns = 0; - } - if(m_pServerDns) - { - if(m_pServerDns->isRunning()) - { - // deleting a running dns may block - // thus garbage-collect it and delete later - g_pGarbageCollector->collect(m_pServerDns); - } else { - // can't block : just delete it - delete m_pServerDns; - } - m_pServerDns = 0; - } - if(m_pStartTimer) - { - delete m_pStartTimer; - m_pStartTimer = 0; - } -} - -void KviIrcConnectionTargetResolver::start(KviIrcConnectionTarget * t) -{ - __ASSERT(m_eState == Idle); - - m_eState = Running; - - if(m_pStartTimer) // this should never happen I guess - { - delete m_pStartTimer; - m_pStartTimer = 0; - } - m_pStartTimer = new QTimer(this); - connect(m_pStartTimer,SIGNAL(timeout()),this,SLOT(asyncStartResolve())); - - m_pTarget = t; - - m_pStartTimer->start(0); -} - -void KviIrcConnectionTargetResolver::abort() -{ - cleanup(); // do a cleanup to kill the timers and dns slaves - - if(m_eState == Terminated)return; - - m_pConsole->outputNoFmt(KVI_OUT_SYSTEMERROR,__tr2qs("Hostname resolution aborted")); - terminate(Error,KviError_operationAborted); -} - -void KviIrcConnectionTargetResolver::asyncStartResolve() -{ - if(m_pStartTimer) - { - delete m_pStartTimer; - m_pStartTimer = 0; - } - - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE, - __tr2qs("Attempting %Q to %Q (%Q) on port %u"), - m_pTarget->server()->useSSL() ? &(__tr2qs("secure connection")) : &(__tr2qs("connection")), - &(m_pTarget->server()->m_szHostname), - &(m_pTarget->networkName()), - m_pTarget->server()->m_uPort); - - if(m_pTarget->proxy()) - { - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE, - __tr2qs("Attempting to 'bounce' on proxy %s on port %u (protocol %s)"), - m_pTarget->proxy()->m_szHostname.ptr(), - m_pTarget->proxy()->m_uPort, - m_pTarget->proxy()->protocolName()); - - lookupProxyHostname(); - } else { - lookupServerHostname(); - } -} - -void KviIrcConnectionTargetResolver::lookupProxyHostname() -{ - bool bValidIp; -#ifdef COMPILE_IPV6_SUPPORT - if(m_pTarget->proxy()->isIpV6()) - { - bValidIp = kvi_isValidStringIp_V6(m_pTarget->proxy()->m_szIp.ptr()); - } else { -#endif - bValidIp = kvi_isValidStringIp(m_pTarget->proxy()->m_szIp.ptr()); -#ifdef COMPILE_IPV6_SUPPORT - } -#endif - - if(bValidIp) - { - if(!_OUTPUT_QUIET) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE, - __tr2qs("Using cached proxy IP address (%s)"), - m_pTarget->proxy()->m_szIp.ptr()); - if(m_pTarget->proxy()->protocol() != KviProxy::Http - && m_pTarget->proxy()->protocol() != KviProxy::Socks5) - lookupServerHostname(); - else terminate(Success,KviError_success); - } else { -#ifdef COMPILE_IPV6_SUPPORT - if(m_pTarget->proxy()->isIpV6()) - { - bValidIp = kvi_isValidStringIp_V6(m_pTarget->proxy()->m_szHostname.ptr()); - } else { -#endif - bValidIp = kvi_isValidStringIp(m_pTarget->proxy()->m_szHostname.ptr()); -#ifdef COMPILE_IPV6_SUPPORT - } -#endif - if(bValidIp) - { - m_pTarget->proxy()->m_szIp=m_pTarget->proxy()->m_szHostname; - if(m_pTarget->proxy()->protocol() != KviProxy::Http && - m_pTarget->proxy()->protocol() != KviProxy::Socks5) - { - lookupServerHostname(); - } else { - terminate(Success,KviError_success); - } - } else { - - if(m_pProxyDns) - { - debug("Something weird is happening, m_pProxyDns is non-zero in lookupProxyHostname()"); - delete m_pProxyDns; - m_pProxyDns = 0; - } - - m_pProxyDns = new KviDns(); - connect(m_pProxyDns,SIGNAL(lookupDone(KviDns *)),this,SLOT(proxyLookupTerminated(KviDns *))); - - if(!m_pProxyDns->lookup(m_pTarget->proxy()->m_szHostname.ptr(), - m_pTarget->proxy()->isIpV6() ? KviDns::IpV6 : KviDns::IpV4)) - { - m_pConsole->outputNoFmt(KVI_OUT_SYSTEMWARNING, - __tr2qs("Unable to look up the IRC proxy hostname: Can't start the DNS slave")); - m_pConsole->outputNoFmt(KVI_OUT_SYSTEMWARNING, - __tr2qs("Resuming direct server connection")); - // FIXME: #warning "Option for resuming direct connection or not ?" - delete m_pProxyDns; - m_pProxyDns = 0; - m_pTarget->clearProxy(); - lookupServerHostname(); - } else { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE, - __tr2qs("Looking up the proxy hostname (%s)..."), - m_pTarget->proxy()->m_szHostname.ptr()); - } - } - } -} - -void KviIrcConnectionTargetResolver::proxyLookupTerminated(KviDns *) -{ - if(m_pProxyDns->state() != KviDns::Success) - { - QString szErr = KviError::getDescription(m_pProxyDns->error()); - m_pConsole->output(KVI_OUT_SYSTEMERROR, - __tr2qs("Can't find the proxy IP address: %Q"), - &szErr); - // FIXME: #warning "Option to resume the direct connection if proxy failed ?" - m_pConsole->output(KVI_OUT_SYSTEMERROR, - __tr2qs("Resuming direct server connection")); - m_pTarget->clearProxy(); - } else { - QString szFirstIpAddress = m_pProxyDns->firstIpAddress(); - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE, - __tr2qs("Proxy hostname resolved to %Q"),&szFirstIpAddress); - - m_pTarget->proxy()->m_szIp = m_pProxyDns->firstIpAddress(); - g_pProxyDataBase->updateProxyIp(m_pTarget->proxy()->m_szIp.ptr(),szFirstIpAddress); - - if(m_pProxyDns->hostnameCount() > 1) - { - QString szFirstHostname = m_pProxyDns->firstHostname(); - - for(QString * addr = m_pProxyDns->hostnameList()->next();addr;addr = m_pProxyDns->hostnameList()->next()) - { - if(!_OUTPUT_QUIET) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE, - __tr2qs("Proxy %Q has a nickname: %Q"),&szFirstHostname,addr); - } - } - } - - delete m_pProxyDns; - m_pProxyDns = 0; - if(m_pTarget->proxy()) - { - if(m_pTarget->proxy()->protocol() == KviProxy::Http - || m_pTarget->proxy()->protocol() == KviProxy::Socks5) - { - terminate(Success,KviError_success); - return; - } - } - lookupServerHostname(); -} - -void KviIrcConnectionTargetResolver::lookupServerHostname() -{ - bool bValidIp; - -#ifdef COMPILE_IPV6_SUPPORT - if(m_pTarget->server()->isIpV6()) - { - bValidIp = KviNetUtils::isValidStringIp_V6(m_pTarget->server()->m_szIp); - } else { -#endif - bValidIp = KviNetUtils::isValidStringIp(m_pTarget->server()->m_szIp); -#ifdef COMPILE_IPV6_SUPPORT - } -#endif - - if(bValidIp && m_pTarget->server()->cacheIp()) - { - if(!_OUTPUT_QUIET) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE, - __tr2qs("Using cached server IP address (%s)"), - m_pTarget->server()->m_szIp.utf8().data()); - haveServerIp(); - } else { -#ifdef COMPILE_IPV6_SUPPORT - if(m_pTarget->server()->isIpV6()) - { - bValidIp = KviNetUtils::isValidStringIp_V6(m_pTarget->server()->m_szHostname); - } else { -#endif - bValidIp = KviNetUtils::isValidStringIp(m_pTarget->server()->m_szHostname); -#ifdef COMPILE_IPV6_SUPPORT - } -#endif - if(bValidIp) - { - m_pTarget->server()->m_szIp=m_pTarget->server()->m_szHostname; - haveServerIp(); - } else { - if(m_pServerDns) - { - debug("Something weird is happening, m_pServerDns is non-zero in lookupServerHostname()"); - delete m_pServerDns; - m_pServerDns = 0; - } - m_pServerDns = new KviDns(); - connect(m_pServerDns,SIGNAL(lookupDone(KviDns *)),this, - SLOT(serverLookupTerminated(KviDns *))); - if(!m_pServerDns->lookup(m_pTarget->server()->m_szHostname, - m_pTarget->server()->isIpV6() ? KviDns::IpV6 : KviDns::IpV4)) - { - m_pConsole->outputNoFmt(KVI_OUT_SYSTEMERROR, - __tr2qs("Unable to look up the server hostname: Can't start the DNS slave")); - terminate(Error,KviError_internalError); - } else { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE, - __tr2qs("Looking up the server hostname (%s)..."), - m_pTarget->server()->m_szHostname.utf8().data()); - } - } - } -} - - -void KviIrcConnectionTargetResolver::serverLookupTerminated(KviDns *) -{ - if(m_pServerDns->state() != KviDns::Success) - { - QString szErr = KviError::getDescription(m_pServerDns->error()); - m_pConsole->output(KVI_OUT_SYSTEMERROR, - __tr2qs("Can't find the server IP address: %Q"), - &szErr); - -#ifdef COMPILE_IPV6_SUPPORT - if(!(m_pTarget->server()->isIpV6())) - { - m_pConsole->output(KVI_OUT_SYSTEMERROR, - __tr2qs("If this server is an IPv6 one, try /server -i %Q"), - &(m_pTarget->server()->m_szHostname)); - } -#endif - terminate(Error,m_pServerDns->error()); - return; - } - QString szFirstIpAddress = m_pServerDns->firstIpAddress(); - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE, - __tr2qs("Server hostname resolved to %Q"), - &szFirstIpAddress); - g_pIrcServerDataBase->updateServerIp(m_pTarget->server(),szFirstIpAddress); - - QString szFirstHostname = m_pServerDns->firstHostname(); - - if(!KviQString::equalCI(m_pTarget->server()->m_szHostname,m_pServerDns->firstHostname())) - { - if(!_OUTPUT_QUIET) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE, - __tr2qs("Real hostname for %Q is %Q"), - &(m_pTarget->server()->m_szHostname), - &szFirstHostname); - m_pTarget->server()->m_szHostname = szFirstHostname; - } - - m_pTarget->server()->m_szIp = m_pServerDns->firstIpAddress(); - - if(m_pServerDns->hostnameCount() > 1) - { - for(QString * addr = m_pServerDns->hostnameList()->next();addr;addr = m_pServerDns->hostnameList()->next()) - { - if(!_OUTPUT_QUIET) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE, - __tr2qs("Server %Q has a nickname: %Q"), - &szFirstHostname,addr); - } - } - - delete m_pServerDns; - m_pServerDns = 0; - haveServerIp(); -} - -bool KviIrcConnectionTargetResolver::validateLocalAddress(const QString &szAddress,QString &szBuffer) -{ - // szAddress may be an ip address or an interface name -#ifdef COMPILE_IPV6_SUPPORT - if(m_pTarget->server()->isIpV6()) - { - if(KviNetUtils::isValidStringIp_V6(szAddress)) - { - szBuffer = szAddress; - return true; - } - } else { -#endif - if(KviNetUtils::isValidStringIp(szAddress)) - { - szBuffer = szAddress; - return true; - } -#ifdef COMPILE_IPV6_SUPPORT - } -#endif - - // is it an interface name ? - return KviNetUtils::getInterfaceAddress(szAddress,szBuffer); -} - - -void KviIrcConnectionTargetResolver::haveServerIp() -{ - if(KVI_OPTION_BOOL(KviOption_boolUseIdentService) && !KVI_OPTION_BOOL(KviOption_boolUseIdentServiceOnlyOnConnect)) - m_pConsole->frame()->executeInternalCommand(KVI_INTERNALCOMMAND_IDENT_START); - - QString bindAddress; - - if(m_pTarget->hasBindAddress()) - { - if(!validateLocalAddress(m_pTarget->bindAddress(),bindAddress)) - { - QString szBindAddress = m_pTarget->bindAddress(); - if((szBindAddress.find('.') != -1) || - (szBindAddress.find(':') != -1)) - { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("The specified bind address (%Q) is not valid"), - &szBindAddress); - } else { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("The specified bind address (%Q) is not valid (the interface it refers to might be down)"), - &(szBindAddress)); - } - } - } else { - // the options specify a bind address ? -#ifdef COMPILE_IPV6_SUPPORT - if(m_pTarget->server()->isIpV6()) - { - if(KVI_OPTION_BOOL(KviOption_boolBindIrcIpV6ConnectionsToSpecifiedAddress)) - { - if(!KVI_OPTION_STRING(KviOption_stringIpV6ConnectionBindAddress).isEmpty()) - { - if(!validateLocalAddress(KVI_OPTION_STRING(KviOption_stringIpV6ConnectionBindAddress),bindAddress)) - { - // if it is not an interface name , kill it for now and let the user correct the address - if(KVI_OPTION_STRING(KviOption_stringIpV6ConnectionBindAddress).find(':') != -1) - { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("The system-wide IPv6 bind address (%s) is not valid"), - KVI_OPTION_STRING(KviOption_stringIpV6ConnectionBindAddress).utf8().data()); - KVI_OPTION_BOOL(KviOption_boolBindIrcIpV6ConnectionsToSpecifiedAddress) = false; - } else { - // this is an interface address: might be down - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("The system-wide IPv6 bind address (%s) is not valid (the interface it refers to might be down)"), - KVI_OPTION_STRING(KviOption_stringIpV6ConnectionBindAddress).utf8().data()); - } - } - } else { - // empty address....kill it - KVI_OPTION_BOOL(KviOption_boolBindIrcIpV6ConnectionsToSpecifiedAddress) = false; - } - } - } else { -#endif - if(KVI_OPTION_BOOL(KviOption_boolBindIrcIpV4ConnectionsToSpecifiedAddress)) - { - if(!KVI_OPTION_STRING(KviOption_stringIpV4ConnectionBindAddress).isEmpty()) - { - if(!validateLocalAddress(KVI_OPTION_STRING(KviOption_stringIpV4ConnectionBindAddress),bindAddress)) - { - // if it is not an interface name , kill it for now and let the user correct the address - if(KVI_OPTION_STRING(KviOption_stringIpV4ConnectionBindAddress).find(':') != -1) - { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("The system-wide IPv4 bind address (%s) is not valid"), - KVI_OPTION_STRING(KviOption_stringIpV4ConnectionBindAddress).utf8().data()); - KVI_OPTION_BOOL(KviOption_boolBindIrcIpV4ConnectionsToSpecifiedAddress) = false; - } else { - // this is an interface address: might be down - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("The system-wide IPv4 bind address (%s) is not valid (the interface it refers to might be down)"), - KVI_OPTION_STRING(KviOption_stringIpV4ConnectionBindAddress).utf8().data()); - } - } - } else { - // empty address....kill it - KVI_OPTION_BOOL(KviOption_boolBindIrcIpV4ConnectionsToSpecifiedAddress) = false; - } - } -#ifdef COMPILE_IPV6_SUPPORT - } -#endif - } - - m_pTarget->setBindAddress(bindAddress); - terminate(Success,KviError_success); -} - -void KviIrcConnectionTargetResolver::terminate(Status s,int iLastError) -{ - __ASSERT(m_eState != Terminated); - cleanup(); // do a cleanup anyway - m_eState = Terminated; - m_eStatus = s; - m_iLastError = iLastError; - emit terminated(); -} diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectiontargetresolver.h b/3.4.0/src/kvirc/kernel/kvi_ircconnectiontargetresolver.h deleted file mode 100644 index c2646919a7..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectiontargetresolver.h +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef _KVI_IRCCONNECTIONTARGETRESOLVER_H_ -#define _KVI_IRCCONNECTIONTARGETRESOLVER_H_ -//============================================================================= -// -// File : kvi_ircconnectiontargetresolver.h -// Created on Fri 11 May 2004 23:17:42 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include <qobject.h> - -class KviConsole; -class KviDns; -class KviIrcConnection; -class KviIrcConnectionTarget; - -class QTimer; - -class KVIRC_API KviIrcConnectionTargetResolver : public QObject -{ - friend class KviIrcLink; // upper protocol in the stack - Q_OBJECT -protected: - KviIrcConnectionTargetResolver(KviIrcConnection * pConnection); - ~KviIrcConnectionTargetResolver(); -public: - enum Status { Success, Error }; - enum State { Idle, Running, Terminated }; -private: - KviIrcConnection * m_pConnection; // shallow, never null - KviIrcConnectionTarget * m_pTarget; // shallow, never null - KviConsole * m_pConsole; // shallow, never null - Status m_eStatus; - State m_eState; - - // Auxiliary stuff - QTimer * m_pStartTimer; // timer used to start the connection - KviDns * m_pProxyDns; // the dns object for the proxy hostnames - KviDns * m_pServerDns; // the dns object for the server hostnames - - char * m_pReadBuffer; - unsigned int m_uReadBufferLen; - unsigned int m_uReadPackets; - - int m_iLastError; -public: - void start(KviIrcConnectionTarget * t); - // valid only after the terminated() signal - Status status(){ return m_eStatus; }; - int lastError(){ return m_iLastError; }; - // causes the resolver to terminate with iLastError == KviError_operationAborted - // the terminated() signal is emitted. - void abort(); -protected slots: - void asyncStartResolve(); - void serverLookupTerminated(KviDns *); - void proxyLookupTerminated(KviDns *); -private: - void cleanup(); - void lookupProxyHostname(); - void lookupServerHostname(); - void haveServerIp(); - bool validateLocalAddress(const QString &szAddress,QString &szBuffer); - void terminate(Status s,int iLastError); -signals: - void terminated(); -}; - -#endif //!_KVI_IRCCONNECTIONTARGETRESOLVER_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectionuserinfo.cpp b/3.4.0/src/kvirc/kernel/kvi_ircconnectionuserinfo.cpp deleted file mode 100644 index 733c237a47..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectionuserinfo.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//============================================================================= -// -// File : kvi_ircconnectionuserinfo.cpp -// Created on Sun 20 Jun 2004 01:45:42 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_ircconnectionuserinfo.h" - -KviIrcConnectionUserInfo::KviIrcConnectionUserInfo() -{ - m_bAway = false; -} - -bool KviIrcConnectionUserInfo::hasUserMode(const QChar &m) -{ - return m_szUserMode.contains(m) > 0; -} - -bool KviIrcConnectionUserInfo::addUserMode(const QChar &m) -{ - if(hasUserMode(m))return false; - m_szUserMode.append(m); - return true; -} - -bool KviIrcConnectionUserInfo::removeUserMode(const QChar &m) -{ - int idx = m_szUserMode.find(m,0); - if(idx == -1)return false; - m_szUserMode.replace(m,QString("")); - return true; -} - -void KviIrcConnectionUserInfo::setAway() -{ - m_szNickBeforeAway = m_szNickName; - m_tAway = kvi_unixTime(); - m_bAway = true; -} - -void KviIrcConnectionUserInfo::setBack() -{ - m_szNickBeforeAway = ""; - m_bAway = false; -} diff --git a/3.4.0/src/kvirc/kernel/kvi_ircconnectionuserinfo.h b/3.4.0/src/kvirc/kernel/kvi_ircconnectionuserinfo.h deleted file mode 100644 index ab80795534..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircconnectionuserinfo.h +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef _KVI_IRCCONNECTIONUSERINFO_H_ -#define _KVI_IRCCONNECTIONUSERINFO_H_ -//============================================================================= -// -// File : kvi_ircconnectionuserinfo.h -// Created on Sun 20 Jun 2004 01:45:42 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_time.h" - -class KVIRC_API KviIrcConnectionUserInfo -{ - friend class KviIrcConnection; - friend class KviServerParser; - friend class KviConsole; -protected: - KviIrcConnectionUserInfo(); - ~KviIrcConnectionUserInfo(){}; -private: - QString m_szRealName; // the actual real name sent from the server - QString m_szNickName; // the actual nick name acknowledged by the server - QString m_szUserMode; // the actual user mode - QString m_szUserName; // user name with ident char - QString m_szLocalHostIp; // the local host ip as found by resolveLocalHost() at connection startup - QString m_szHostName; // the local host name that the server reports - QString m_szHostIp; // the host name above resolved, if possible - QString m_szAwayReason; - bool m_bAway; // is the user away ? - kvi_time_t m_tAway; // time at that the user went away - QString m_szNickBeforeAway; // the nickname that the user had just before going away - // From bugtrack: - // On many IRC networks the host is masked or hashed, and if one also is connected through a LAN, - // it is basically impossible to initiate DCC transfers, as 192.168.0.13 or similar will be sent as IP. - // But IRC servers usually (at least in my experience) send the unmasked host in the 001 raw event - // with something like ":Welcome to the Internet Relay Chat network, nick!ident@host". I think - // it'd be a good idea to just grab the IP from that event and use it for DCC transfers by default. - QString m_szUnmaskedHostName; -public: - const QString & realName(){ return m_szRealName; }; - const QString & nickName(){ return m_szNickName; }; - const QString & userMode(){ return m_szUserMode; }; - const QString & userName(){ return m_szUserName; }; - const QString & localHostIp(){ return m_szLocalHostIp; }; - const QString & hostName(){ return m_szHostName; }; - const QString & unmaskedHostName(){ return m_szUnmaskedHostName; }; - const QString & hostIp(){ return m_szHostIp; }; - const QString & awayReason() { return m_szAwayReason; }; - bool hasUserMode(const QChar & m); - bool isAway(){ return m_bAway; }; - time_t awayTime(){ return m_tAway; }; - const QString & nickNameBeforeAway(){ return m_szNickBeforeAway; }; -protected: - void setRealName(const QString &szRealName){ m_szRealName = szRealName; }; - void setNickName(const QString &szNickName){ m_szNickName = szNickName; }; - void setUserMode(const QString &szUserMode){ m_szUserMode = szUserMode; }; - void setUserName(const QString &szUserName){ m_szUserName = szUserName; }; - void setHostName(const QString &szHostName){ m_szHostName = szHostName; }; - void setUnmaskedHostName(const QString &szHostName){ m_szUnmaskedHostName = szHostName; }; - void setHostIp(const QString &szHostIp){ m_szHostIp = szHostIp; }; - void setLocalHostIp(const QString &szLocalHostIp){ m_szLocalHostIp = szLocalHostIp; }; - bool addUserMode(const QChar &m); // returns false if the mode was already there - bool removeUserMode(const QChar &m); // returns fales if the mode was not there - void setAwayReason(const QString& szReazon) { m_szAwayReason=szReazon; }; - void setAway(); - void setBack(); -}; - -#endif //!_KVI_IRCCONNECTIONUSERINFO_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_irccontext.cpp b/3.4.0/src/kvirc/kernel/kvi_irccontext.cpp deleted file mode 100644 index 107c93080b..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_irccontext.cpp +++ /dev/null @@ -1,906 +0,0 @@ -//============================================================================= -// -// File : kvi_irccontext.cpp -// Created on Sun 09 May 2004 20:37:46 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_irccontext.h" -#include "kvi_console.h" -#include "kvi_channel.h" -#include "kvi_query.h" -#include "kvi_frame.h" -#include "kvi_debug.h" -#include "kvi_sparser.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectiontarget.h" -#include "kvi_asynchronousconnectiondata.h" -#include "kvi_ircconnectionstatedata.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_irctoolbar.h" -#include "kvi_out.h" -#include "kvi_ircserverdb.h" -#include "kvi_proxydb.h" -#include "kvi_options.h" -#include "kvi_locale.h" -#include "kvi_ircdatastreammonitor.h" -#include "kvi_error.h" -#include "kvi_thread.h" // for KviThread::msleep() -#include "kvi_app.h" -#include "kvi_kvs_eventtriggers.h" -#include "kvi_kvs_script.h" -#include "kvi_netutils.h" -#include "kvi_ircurl.h" -#include "kvi_qcstring.h" -#include "kvi_useridentity.h" - -#define __KVI_DEBUG__ -#include "kvi_debug.h" - -#include <qtimer.h> - -// the irc context identifiers start from 1 -static unsigned int g_uNextIrcContextId = 1; - -extern KVIRC_API KviIrcServerDataBase * g_pIrcServerDataBase; -extern KVIRC_API KviProxyDataBase * g_pProxyDataBase; - - -KviIrcContext::KviIrcContext(KviConsole * pConsole) -: QObject(0) -{ - m_uId = g_uNextIrcContextId; - g_uNextIrcContextId++; - - m_pConsole = pConsole; - - m_pConnection = 0; - - m_pFrame = m_pConsole->frame(); - - m_pDeadChannels = 0; - m_pDeadQueries = 0; - m_pContextWindows = 0; - - m_pLinksWindow = 0; - m_pListWindow = 0; - - m_eState = Idle; - - m_pAsynchronousConnectionData = 0; - m_pSavedAsynchronousConnectionData = 0; - m_uConnectAttemptCount = 0; - m_pMonitorList = 0; - m_pReconnectTimer = 0; - - m_uConnectAttemptCount = 1; - - m_iHeartbeatTimerId = startTimer(5000); -} - -KviIrcContext::~KviIrcContext() -{ - killTimer(m_iHeartbeatTimerId); - - while(m_pMonitorList) - { - KviIrcDataStreamMonitor * m = m_pMonitorList->first(); - if(m)m->die(); - else { - delete m_pMonitorList; - m_pMonitorList = 0; - } - } - - if(m_pReconnectTimer)delete m_pReconnectTimer; - - if(m_pLinksWindow)m_pLinksWindow->die(); - if(m_pListWindow)m_pListWindow->die(); - - closeAllDeadChannels(); - closeAllDeadQueries(); - closeAllContextWindows(); - - destroyConnection(); - if(m_pAsynchronousConnectionData)delete m_pAsynchronousConnectionData; - if(m_pSavedAsynchronousConnectionData)delete m_pSavedAsynchronousConnectionData; -} - -void KviIrcContext::unhighlightAllWindows() -{ - m_pFrame->unhighlightWindowsOfContext(this); -} - -void KviIrcContext::registerDataStreamMonitor(KviIrcDataStreamMonitor * m) -{ - if(!m_pMonitorList) - { - m_pMonitorList = new KviPointerList<KviIrcDataStreamMonitor>; - m_pMonitorList->setAutoDelete(false); - } - m_pMonitorList->append(m); -} - -void KviIrcContext::unregisterDataStreamMonitor(KviIrcDataStreamMonitor *m) -{ - if(!m_pMonitorList)return; - m_pMonitorList->removeRef(m); - if(m_pMonitorList->isEmpty()) - { - delete m_pMonitorList; - m_pMonitorList = 0; - } -} - - -void KviIrcContext::closeAllDeadChannels() -{ - while(m_pDeadChannels) - { - KviChannel * c = m_pDeadChannels->first(); - if(c)m_pFrame->closeWindow(c); - else { - // ops.... - delete m_pDeadChannels; - m_pDeadChannels = 0; - } - } -} - -void KviIrcContext::closeAllDeadQueries() -{ - while(m_pDeadQueries) - { - KviQuery * q = m_pDeadQueries->first(); - if(q)m_pFrame->closeWindow(q); - else { - // ops.... - delete m_pDeadQueries; - m_pDeadQueries = 0; - } - } -} - -void KviIrcContext::closeAllContextWindows() -{ - while(m_pContextWindows) - { - KviWindow * w = m_pContextWindows->first(); - if(w)m_pFrame->closeWindow(w); - else { - // ops... - delete m_pContextWindows; - m_pContextWindows = 0; - } - } -} - -KviChannel * KviIrcContext::findDeadChannel(const QString &name) -{ - if(!m_pDeadChannels)return 0; - for(KviChannel * c = m_pDeadChannels->first();c;c = m_pDeadChannels->next()) - { - __range_valid(c->isDeadChan()); - if(KviQString::equalCI(name,c->windowName()))return c; - } - return 0; -} - -KviQuery * KviIrcContext::findDeadQuery(const QString &name) -{ - if(!m_pDeadQueries)return 0; - for(KviQuery * c = m_pDeadQueries->first();c;c = m_pDeadQueries->next()) - { - __range_valid(c->isDeadQuery()); - if(KviQString::equalCI(name,c->windowName()))return c; - } - return 0; -} - -KviQuery * KviIrcContext::firstDeadQuery() -{ - if(!m_pDeadQueries)return 0; - return m_pDeadQueries->first(); -} - -void KviIrcContext::registerContextWindow(KviWindow * pWnd) -{ - if(!m_pContextWindows) - { - m_pContextWindows = new KviPointerList<KviWindow>; - m_pContextWindows->setAutoDelete(false); - } - m_pContextWindows->append(pWnd); -} - -void KviIrcContext::registerDeadChannel(KviChannel * c) -{ - if(!m_pDeadChannels) - { - m_pDeadChannels = new KviPointerList<KviChannel>; - m_pDeadChannels->setAutoDelete(false); - } - m_pDeadChannels->append(c); -} - -void KviIrcContext::registerDeadQuery(KviQuery * q) -{ - if(!m_pDeadQueries) - { - m_pDeadQueries = new KviPointerList<KviQuery>; - m_pDeadQueries->setAutoDelete(false); - } - m_pDeadQueries->append(q); -} - -bool KviIrcContext::unregisterDeadChannel(KviChannel * c) -{ - // was a dead channel ? - if(!m_pDeadChannels)return false; - if(!m_pDeadChannels->removeRef(c)) - { - return false; - } - if(m_pDeadChannels->isEmpty()) - { - delete m_pDeadChannels; - m_pDeadChannels = 0; - } - return true; -} - -bool KviIrcContext::unregisterContextWindow(KviWindow * pWnd) -{ - if(!m_pContextWindows)return false; - if(!m_pContextWindows->removeRef(pWnd)) - { - return false; - } - if(m_pContextWindows->isEmpty()) - { - delete m_pContextWindows; - m_pContextWindows = 0; - } - return true; -} - -bool KviIrcContext::unregisterDeadQuery(KviQuery * q) -{ - if(!m_pDeadQueries)return false; - if(!m_pDeadQueries->removeRef(q)) - { - return false; - } - if(m_pDeadQueries->isEmpty()) - { - delete m_pDeadQueries; - m_pDeadQueries = 0; - } - return true; -} - -void KviIrcContext::createLinksWindow() -{ - if(m_pLinksWindow)return; - KviKvsScript::run("links.open",m_pConsole); -} - -void KviIrcContext::createListWindow() -{ - if(m_pListWindow)return; - KviKvsScript::run("list.open",m_pConsole); -} - -void KviIrcContext::destroyConnection() -{ - if(!m_pConnection)return; - m_pConnection->closeAllChannels(); - m_pConnection->closeAllQueries(); - - if(m_pLinksWindow)m_pLinksWindow->control(EXTERNAL_SERVER_DATA_PARSER_CONTROL_RESET); - if(m_pListWindow)m_pListWindow->control(EXTERNAL_SERVER_DATA_PARSER_CONTROL_RESET); - - m_pConsole->connectionDetached(); - - // make sure that m_pConnection is already 0 in any - // event triggered by KviIrcConnection destructor - KviIrcConnection * pTmp = m_pConnection; - m_pConnection = 0; - delete pTmp; -} - -void KviIrcContext::setState(State eState) -{ - if(m_eState == eState)return; - m_eState = eState; - - m_pFrame->childContextStateChange(this); - - emit stateChanged(); - - if(eState == KviIrcContext::Idle)destroyConnection(); - - m_pConsole->updateCaption(); -} - -void KviIrcContext::setAsynchronousConnectionData(KviAsynchronousConnectionData * d) -{ - if(m_pAsynchronousConnectionData)delete m_pAsynchronousConnectionData; - m_pAsynchronousConnectionData = d; -} - -void KviIrcContext::destroyAsynchronousConnectionData() -{ - if(!m_pAsynchronousConnectionData)return; - delete m_pAsynchronousConnectionData; - m_pAsynchronousConnectionData = 0; -} - -void KviIrcContext::loginComplete() -{ - setState(Connected); -} - -void KviIrcContext::connectButtonClicked() -{ - if(!connection()) - { - if(m_pReconnectTimer) - { - // reconnection was in progress... - delete m_pReconnectTimer; - m_pReconnectTimer = 0; - destroyAsynchronousConnectionData(); - - m_pConsole->outputNoFmt(KVI_OUT_SYSTEMERROR, - __tr2qs("Reconnect attempt aborted")); - - return; - } - - // No connections in progress - m_uConnectAttemptCount = 1; - connectToCurrentServer(); - } else { - // Sth is going on - terminateConnectionRequest(false); - } -} - -void KviIrcContext::connectToCurrentServer() -{ - if(m_pReconnectTimer) - { - delete m_pReconnectTimer; - m_pReconnectTimer = 0; - } - - m_pConsole->outputNoFmt(KVI_OUT_SYSTEMMESSAGE," "); // spacer - - if(!m_pAsynchronousConnectionData) - { - // No connection target specified. - // If we have a saved target, reuse it - - if(m_pSavedAsynchronousConnectionData) - { - m_pAsynchronousConnectionData = m_pSavedAsynchronousConnectionData; - m_pSavedAsynchronousConnectionData = 0; - } - } - - if(m_pAsynchronousConnectionData) - { - // we have a specified connection target (either from outside or saved) - if(m_pAsynchronousConnectionData->szServer.isEmpty()) - { - // an empty server might mean "reuse the last server in context" - if(m_pAsynchronousConnectionData->bUseLastServerInContext) - { - if(m_pSavedAsynchronousConnectionData) - { - // reuse the saved connection data - // the server for sure - m_pAsynchronousConnectionData->szServer = m_pSavedAsynchronousConnectionData->szServer; - m_pAsynchronousConnectionData->uPort = m_pSavedAsynchronousConnectionData->uPort; - m_pAsynchronousConnectionData->bPortIsOk = true; - m_pAsynchronousConnectionData->bUseIpV6 = m_pSavedAsynchronousConnectionData->bUseIpV6; - m_pAsynchronousConnectionData->bUseSSL = m_pSavedAsynchronousConnectionData->bUseSSL; - m_pAsynchronousConnectionData->m_pReconnectInfo = m_pSavedAsynchronousConnectionData->m_pReconnectInfo; - // and the other info, only if not overridden by the user - if(m_pAsynchronousConnectionData->szBindAddress.isEmpty()) - m_pAsynchronousConnectionData->szBindAddress = m_pSavedAsynchronousConnectionData->szBindAddress; - if(m_pAsynchronousConnectionData->szCommandToExecAfterConnect.isEmpty()) - m_pAsynchronousConnectionData->szCommandToExecAfterConnect = m_pSavedAsynchronousConnectionData->szCommandToExecAfterConnect; - if(m_pAsynchronousConnectionData->szLinkFilter.isEmpty()) - m_pAsynchronousConnectionData->szLinkFilter = m_pSavedAsynchronousConnectionData->szLinkFilter; - if(m_pAsynchronousConnectionData->szPass.isEmpty()) - m_pAsynchronousConnectionData->szPass = m_pSavedAsynchronousConnectionData->szPass; - if(m_pAsynchronousConnectionData->szNick.isEmpty()) - m_pAsynchronousConnectionData->szNick = m_pSavedAsynchronousConnectionData->szNick; - if(m_pAsynchronousConnectionData->szInitUMode.isEmpty()) - m_pAsynchronousConnectionData->szInitUMode = m_pSavedAsynchronousConnectionData->szInitUMode; - } else - m_pConsole->outputNoFmt(KVI_OUT_SYSTEMWARNING,__tr2qs("This is the first connection in this IRC context: using the global server setting")); - } // else it just means "do connect" to the globally selected irc server in the options dialog - } - - if(!(m_pAsynchronousConnectionData->szServer.isEmpty())) - { - // ok , have a server to look for in the db - // FIXME: this is a bit ugly... could it be managed in some completly different and nicer way ? - KviIrcServerDefinition d; - d.szServer = m_pAsynchronousConnectionData->szServer; - d.bPortIsValid = m_pAsynchronousConnectionData->bPortIsOk; - d.uPort = m_pAsynchronousConnectionData->uPort; - d.bIpV6 = m_pAsynchronousConnectionData->bUseIpV6; - d.bSSL = m_pAsynchronousConnectionData->bUseSSL; - d.szLinkFilter = m_pAsynchronousConnectionData->szLinkFilter; - d.szPass = m_pAsynchronousConnectionData->szPass; - d.szNick = m_pAsynchronousConnectionData->szNick; - d.szInitUMode = m_pAsynchronousConnectionData->szInitUMode; - QString szError; - if(!g_pIrcServerDataBase->makeCurrentServer(&d,szError)) - { - m_pConsole->outputNoFmt(KVI_OUT_SYSTEMERROR,szError); - destroyAsynchronousConnectionData(); - return; - } - } // else we just connect to the globally selected irc server in the options dialog - } - - KviIrcServerDataBaseRecord * rec = g_pIrcServerDataBase->currentRecord(); - - KviIrcNetwork * net; - KviIrcServer * srv; - - net = rec ? rec->network() : 0; - srv = net ? rec->currentServer() : 0; - - KviProxy * prx = 0; - - if(!srv) - { - m_pConsole->outputNoFmt(KVI_OUT_SYSTEMERROR,__tr2qs("No servers available. Check the options dialog or use the /SERVER command")); - destroyAsynchronousConnectionData(); - return; - } - - if(!net) - { - // BUG - m_pConsole->outputNoFmt(KVI_OUT_SYSTEMERROR,__tr2qs("Ooops.. you've hit a bug in the servers database... I have found a server but not a network...")); - destroyAsynchronousConnectionData(); - return; - } - - - prx = srv->proxyServer(g_pProxyDataBase); - - if(!prx && (srv->proxy()!=-1) && KVI_OPTION_BOOL(KviOption_boolUseProxyHost)) - { - prx = g_pProxyDataBase->currentProxy(); - if(!prx) - { - m_pConsole->outputNoFmt(KVI_OUT_SYSTEMWARNING,__tr2qs("No proxy hosts available, resuming direct connection")); - } - } - - KviStr szBindAddress; - - if(m_pAsynchronousConnectionData) - { - szBindAddress = m_pAsynchronousConnectionData->szBindAddress; - srv->m_pReconnectInfo=m_pAsynchronousConnectionData->m_pReconnectInfo; - } - - // Find out the identity we'll be using in this connection - // First check the server for one - - const KviUserIdentity * pIdentity = 0; - - QString szUserIdentityId = srv->userIdentityId(); - if(!szUserIdentityId.isEmpty()) - pIdentity = KviUserIdentityManager::instance()->findIdentity(szUserIdentityId); - - // If not found, look in the network instead - if(!pIdentity) - szUserIdentityId = net->userIdentityId(); - - if(!szUserIdentityId.isEmpty()) - pIdentity = KviUserIdentityManager::instance()->findIdentity(szUserIdentityId); - - // If not found, get the default identity (this is GRANTED to be never null, eventually filled up with defaults) - pIdentity = KviUserIdentityManager::instance()->defaultIdentity(); - - - if(m_pConnection)delete m_pConnection; - m_pConnection = new KviIrcConnection( - this, - new KviIrcConnectionTarget( - net, - srv, - prx, - szBindAddress.ptr() - ), - new KviUserIdentity(*pIdentity) - ); - - setState(Connecting); - - - if(m_pAsynchronousConnectionData) - { - m_pConnection->stateData()->setCommandToExecAfterConnect(m_pAsynchronousConnectionData->szCommandToExecAfterConnect); - destroyAsynchronousConnectionData(); - } - - m_pConsole->connectionAttached(); - - // save stuff for later - - // FIXME: this management of "next" connection should be reviewed a bit anyway - if(m_pSavedAsynchronousConnectionData)delete m_pSavedAsynchronousConnectionData; - m_pSavedAsynchronousConnectionData = new KviAsynchronousConnectionData(); - m_pSavedAsynchronousConnectionData->szServer = srv->m_szHostname; - m_pSavedAsynchronousConnectionData->uPort = srv->port(); - m_pSavedAsynchronousConnectionData->bPortIsOk = true; - m_pSavedAsynchronousConnectionData->bUseIpV6 = srv->isIpV6(); - m_pSavedAsynchronousConnectionData->bUseSSL = srv->useSSL(); - m_pSavedAsynchronousConnectionData->szPass = srv->password(); - m_pSavedAsynchronousConnectionData->szInitUMode = srv->m_szInitUMode; - m_pSavedAsynchronousConnectionData->m_pReconnectInfo=srv->m_pReconnectInfo; - - // this never fails! - m_pConnection->start(); -} - -void KviIrcContext::connectionFailed(int iError) -{ - if(!m_pConnection)return; // this may happen in the destructor! - - m_pConsole->output(KVI_OUT_SYSTEMERROR, - __tr2qs("Connection attempt failed [%s]"), - m_pConnection->target()->server()->m_szHostname.utf8().data()); - - // if the connection has been aborted by the user then just go idle - if(iError == KviError_operationAborted) - goto enter_idle_state; - - // FIXME: this should stop on critical errors ! - if(KVI_OPTION_BOOL(KviOption_boolAutoReconnectOnUnexpectedDisconnect)) - { - if((!KVI_OPTION_UINT(KviOption_uintMaxAutoReconnectAttempts) || - (m_uConnectAttemptCount < KVI_OPTION_UINT(KviOption_uintMaxAutoReconnectAttempts)))) - { - m_uConnectAttemptCount++; - //FIXME: Multiply the delay by (m_uConnectAttemptCount / 2) so later connects are less frequent. - if(!_OUTPUT_MUTE) - { - QString tmp; - KviQString::sprintf(tmp,__tr2qs("Will attempt to reconnect in %d seconds"),KVI_OPTION_UINT(KviOption_uintAutoReconnectDelay)); - QString num; - - if(!KVI_OPTION_UINT(KviOption_uintMaxAutoReconnectAttempts)) - KviQString::sprintf(num,__tr2qs("%d"),m_uConnectAttemptCount); - else - KviQString::sprintf(num,__tr2qs("%d of %d"), - m_uConnectAttemptCount,KVI_OPTION_UINT(KviOption_uintMaxAutoReconnectAttempts)); - tmp += " [" + num + "]"; - m_pConsole->outputNoFmt(KVI_OUT_SYSTEMMESSAGE,tmp); - } - - KviIrcServer oldServer(*(connection()->server())); - QString oldNickname = connection()->userInfo()->isAway() ? connection()->userInfo()->nickNameBeforeAway() : connection()->userInfo()->nickName(); - - KviAsynchronousConnectionData * d = new KviAsynchronousConnectionData(); - d->szServer = oldServer.m_szHostname; - d->uPort = oldServer.port(); - d->bPortIsOk = true; - d->bUseIpV6 = oldServer.isIpV6(); - d->bUseSSL = oldServer.useSSL(); - d->szPass = oldServer.password(); - d->szNick = oldNickname; - d->szInitUMode = oldServer.m_szInitUMode; - d->szCommandToExecAfterConnect = ""; - setAsynchronousConnectionData(d); - beginAsynchronousConnect(1000 * KVI_OPTION_UINT(KviOption_uintAutoReconnectDelay)); - - setState(Idle); // destroy the actual connection - - return; - } else { - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_SYSTEMERROR,__tr2qs("Maximum number of reconnect attempts reached (%d): giving up"),KVI_OPTION_UINT(KviOption_uintMaxAutoReconnectAttempts)); - } - } - - // reset the attempt count - m_uConnectAttemptCount = 1; - - if(connection()->server()->cacheIp()) - { - if((((int)iError) == KviError_connectionTimedOut) || - (((int)iError) == KviError_connectionRefused) || - (((int)iError) == KviError_networkUnreachable) || - (((int)iError) == KviError_hostUnreachable)) - { - m_pConsole->output(KVI_OUT_SYSTEMWARNING,__tr2qs("The connection attempt failed while using a cached IP address for the current server")); - m_pConsole->output(KVI_OUT_SYSTEMWARNING,__tr2qs("The problem *might* be caused by an updated DNS entry")); - m_pConsole->output(KVI_OUT_SYSTEMWARNING,__tr2qs("Try reconnecting with caching disabled")); - } - } - -enter_idle_state: - setState(Idle); -} - -void KviIrcContext::connectionEstabilished() -{ - // - // The connection has been estabilished, the - // KviIrcConnection will attempt to login now - // - m_uConnectAttemptCount = 1; - - bool bStopOutput = false; - - setState(LoggingIn); // this must be set in order for $server and other functions to return the correct values - - bStopOutput = KVS_TRIGGER_EVENT_0_HALTED(KviEvent_OnIrcConnectionEstabilished,m_pConsole); - - if(!bStopOutput) - { - m_pConsole->output(KVI_OUT_CONNECTION,__tr2qs("%Q established [%s (%s:%u)]"), - connection()->socket()->usingSSL() ? &(__tr2qs("Secure connection")) : &(__tr2qs("Connection")), - connection()->server()->m_szHostname.utf8().data(), - connection()->server()->m_szIp.utf8().data(), - connection()->server()->m_uPort); - } - - // Add to recent server list (build the url of type irc[6]://<server>:<port> - QString url; - KviIrcUrl::join(url,connection()->server()); - g_pApp->addRecentServer(url); - - // save the last server this console used - //if(m_pLastIrcServer)delete m_pLastIrcServer; - //m_pLastIrcServer = new KviIrcServer(*(connection()->server())); -} - -void KviIrcContext::connectionTerminated() -{ - if(!m_pConnection)return; // this may happen in the destructor! - - KviIrcServer oldServer(*(connection()->server())); - if(oldServer.m_pReconnectInfo) delete oldServer.m_pReconnectInfo; - KviIrcServerReconnectInfo* pInfo = new KviIrcServerReconnectInfo(); - pInfo->m_szNick = connection()->userInfo()->isAway() ? connection()->userInfo()->nickNameBeforeAway() : connection()->userInfo()->nickName(); - pInfo->m_bIsAway=connection()->userInfo()->isAway(); - pInfo->m_szAwayReason=connection()->userInfo()->awayReason(); - - // we consider it unexpected when we haven't sent a QUIT message and we're connected - // or alternatively when a simulation of such a termination is requested (this is used to keep the queries open etc..) - bool bUnexpectedDisconnect = (!(connection()->stateData()->sentQuit())) && (m_eState == KviIrcContext::Connected) || - connection()->stateData()->simulateUnexpectedDisconnect(); - - QString szChannels,szProtectedChannels,szPasswords,szCurPass,szCurChan; - - if(bUnexpectedDisconnect) - { - if(KVI_OPTION_BOOL(KviOption_boolAutoReconnectOnUnexpectedDisconnect)) - { - if(KVI_OPTION_BOOL(KviOption_boolRejoinChannelsAfterReconnect)) - { - // FIXME: THIS SHOULD BE A KviIrcConnection FUNCTION - int idx = 0; - KviChannel * c; - QString szChannels,szProtectedChannels,szPasswords,szCurPass,szCurChan; - // first only chans without key, in groups of 4 - for(c = connection()->channelList()->first();c;c = connection()->channelList()->next()) - { - szCurPass=c->channelKey(); - szCurChan = c->windowName(); - if(szCurPass.isEmpty()) - { - if(!szChannels.isEmpty()) - szChannels.append(","); - szChannels.append(szCurChan); - } else { - if(!szProtectedChannels.isEmpty()) - szProtectedChannels.append(","); - szProtectedChannels.append(szCurChan); - if(!szPasswords.isEmpty()) - szPasswords.append(","); - szPasswords.append(szCurPass); - } - } - if( (!szChannels.isEmpty()) || (!szProtectedChannels.isEmpty()) ) - { - pInfo->m_szJoinChannels.append(szProtectedChannels); - if(!szProtectedChannels.isEmpty() && !szChannels.isEmpty()) - pInfo->m_szJoinChannels.append(','); - pInfo->m_szJoinChannels.append(szChannels); - pInfo->m_szJoinChannels.append(" "); - pInfo->m_szJoinChannels.append(szPasswords); - } - } - - - if(KVI_OPTION_BOOL(KviOption_boolReopenQueriesAfterReconnect)) - { - for(KviQuery * q = connection()->queryList()->first();q;q = connection()->queryList()->next()) - { - pInfo->m_szOpenQueryes.append(q->target()); - } - } - } - - if(KVI_OPTION_BOOL(KviOption_boolKeepChannelsOpenOnUnexpectedDisconnect) || KVI_OPTION_BOOL(KviOption_boolKeepChannelsOpenOnDisconnect)) - connection()->keepChannelsOpenAfterDisconnect(); - - if(KVI_OPTION_BOOL(KviOption_boolKeepQueriesOpenOnUnexpectedDisconnect) || KVI_OPTION_BOOL(KviOption_boolKeepQueriesOpenOnDisconnect)) - connection()->keepQueriesOpenAfterDisconnect(); - } else { - if(KVI_OPTION_BOOL(KviOption_boolKeepChannelsOpenOnDisconnect)) - connection()->keepChannelsOpenAfterDisconnect(); - - if(KVI_OPTION_BOOL(KviOption_boolKeepQueriesOpenOnDisconnect)) - connection()->keepQueriesOpenAfterDisconnect(); - } - - setState(Idle); - - bool bStopOutput = false; - - bStopOutput = KVS_TRIGGER_EVENT_0_HALTED(KviEvent_OnIrcConnectionTerminated,m_pConsole); - - if(!bStopOutput) - { - m_pConsole->output(KVI_OUT_CONNECTION,__tr2qs("Connection terminated [%s (%s:%u)]"), - oldServer.hostName().utf8().data(), - oldServer.ip().utf8().data(), - oldServer.port()); - } - - // do reconnect - - if(bUnexpectedDisconnect && KVI_OPTION_BOOL(KviOption_boolAutoReconnectOnUnexpectedDisconnect)) - { - //m_uConnectAttemptCount = 1; - if(!_OUTPUT_MUTE) - m_pConsole->output(KVI_OUT_CONNECTION,__tr2qs("The connection terminated unexpectedly. Trying to reconnect...")); - KviAsynchronousConnectionData * d = new KviAsynchronousConnectionData(); - d->szServer = oldServer.m_szHostname; - d->uPort = oldServer.port(); - d->bPortIsOk = true; - d->bUseIpV6 = oldServer.isIpV6(); - d->bUseSSL = oldServer.useSSL(); - d->szPass = oldServer.password(); - d->szInitUMode = oldServer.m_szInitUMode; - d->m_pReconnectInfo = pInfo; - setAsynchronousConnectionData(d); - - beginAsynchronousConnect(1000 * KVI_OPTION_UINT(KviOption_uintAutoReconnectDelay)); - } -} - -void KviIrcContext::beginAsynchronousConnect(unsigned int uDelayInMSecs) -{ - if(m_pReconnectTimer)delete m_pReconnectTimer; - m_pReconnectTimer = new QTimer(this); - connect(m_pReconnectTimer,SIGNAL(timeout()),this,SLOT(asynchronousConnect())); - m_pReconnectTimer->start(uDelayInMSecs); -} - - -void KviIrcContext::asynchronousConnect() -{ - if(m_pReconnectTimer) - { - delete m_pReconnectTimer; - m_pReconnectTimer = 0; - } - - if(state() != Idle) // need a brutal disconnect here - terminateConnectionRequest(true,"Changing server..."); - - connectToCurrentServer(); -} - - -void KviIrcContext::terminateConnectionRequest(bool bForce,const QString &szQuitMsg,bool bSimulateUnexpectedDisconnect) -{ - if(!connection())return; // hm ? - - if(bSimulateUnexpectedDisconnect)connection()->stateData()->setSimulateUnexpectedDisconnect(); - - switch(m_eState) - { - case Connected: - { - // was connected : send a quit and abort the connection - bool bWasSentQuit = true; - if(!connection()->stateData()->sentQuit()) - { - KVS_TRIGGER_EVENT_0(KviEvent_OnDisconnectRequest,m_pConsole); - QString szQuit = szQuitMsg; - if(szQuit.isEmpty())szQuit = KVI_OPTION_STRING(KviOption_stringQuitMessage); - szQuit.replace(";","\\;"); - szQuit.replace("\n"," "); - QString buffer; - KviKvsVariant ret; - if(KviKvsScript::evaluate(szQuit,console(),0,&ret)) - ret.asString(buffer); - else - buffer = szQuit; - KviQCString dat = console()->encodeText(buffer); - bWasSentQuit = false; - connection()->stateData()->setSentQuit(); - connection()->sendFmtData("QUIT :%s",dat.data() ? dat.data() : ""); // here theoretically we COULD get disconnected - } // else it was already sent anyway - - if(KVI_OPTION_BOOL(KviOption_boolForceBrutalQuit) || bWasSentQuit || bForce) - { - if(!bWasSentQuit) - { - // idle for some milliseconds in order to allow the quit message to reach - // the remote end without breaking the connection - KviThread::msleep(100); - } - // and brutally abort the connection (if it still exists!!!) - if(connection())connection()->abort(); - } else { - if(!bWasSentQuit) - m_pConsole->outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Sent QUIT, waiting for the server to close the connection...")); - // else it was already sent anyway - } - } - break; - case Connecting: - case LoggingIn: - // was waiting for connection or login, just abort it: it will trigger an error anyway - connection()->abort(); - break; - default: - // should never end here! - __ASSERT(false); - break; - } -} - -void KviIrcContext::timerEvent(QTimerEvent *e) -{ - if(e->timerId() != m_iHeartbeatTimerId) - { - QObject::timerEvent(e); - return; - } - - // our heartbeat - - kvi_time_t tNow = kvi_unixTime(); - - if(m_pConnection) - m_pConnection->heartbeat(tNow); -} - diff --git a/3.4.0/src/kvirc/kernel/kvi_irccontext.h b/3.4.0/src/kvirc/kernel/kvi_irccontext.h deleted file mode 100644 index ab3baba12e..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_irccontext.h +++ /dev/null @@ -1,188 +0,0 @@ -#ifndef _KVI_IRCCONTEXT_H_ -#define _KVI_IRCCONTEXT_H_ -//============================================================================= -// -// File : kvi_irccontext.h -// Created on Sun 09 May 2004 20:37:46 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_pointerlist.h" -#include <qobject.h> - -class KviChannel; -class KviQuery; -class KviQuery; -class KviFrame; -class KviIrcConnection; -class KviExternalServerDataParser; -class KviAsynchronousConnectionData; -class KviIrcDataStreamMonitor; -class KviWindow; -class QTimer; -class KviConsole; -class KviIrcNetwork; -class KviIrcServer; -/* - KviIrcContext is the structure that groups the objects and resources - usable for a single irc connection: a console, a set of channels and queries, - and a KviIrcConnection object. - - The objects grouped here are mostly permanent across connections. - - Each irc context has its own unique numeric identifier. The identifiers start - from 1 so 0 is an invalid irc context id (this is useful in the scripting engine). - - The irc context is created in the KviConsole constructor and destroyed - in the KviConsole destructor. No other class can allocate KviIrcContext objects. -*/ - -class KVIRC_API KviIrcContext : public QObject -{ - friend class KviConsole; - friend class KviChannel; - friend class KviQuery; - friend class KviIrcConnection; - friend class KviIrcContextToolBar; - Q_OBJECT -protected: - KviIrcContext(KviConsole * pConsole); // only KviConsole can create this -public: - ~KviIrcContext(); -public: - enum State - { - Idle, // connection() == 0 - Connecting, // connection() != 0 - LoggingIn, // connection() != 0 - Connected // connection() != 0 - }; -protected: - KviConsole * m_pConsole; // shallow, never null - KviIrcConnection * m_pConnection; - - unsigned int m_uId; // this irc context id - - State m_eState; // this context state - - // helper pointers - KviFrame * m_pFrame; // the owning frame, shallow, never null - - // permanent links and list window - KviExternalServerDataParser * m_pLinksWindow; - KviExternalServerDataParser * m_pListWindow; - - KviAsynchronousConnectionData * m_pAsynchronousConnectionData; // owned, may be null - KviAsynchronousConnectionData * m_pSavedAsynchronousConnectionData; // owned, may be null, this is used to reconnect to the last server in this context - - unsigned int m_uConnectAttemptCount; - QTimer * m_pReconnectTimer; - - KviPointerList<KviIrcDataStreamMonitor> * m_pMonitorList; // owned, may be null - - // dead channels and queries - KviPointerList<KviChannel> * m_pDeadChannels; - KviPointerList<KviQuery> * m_pDeadQueries; - // other context bound windows - KviPointerList<KviWindow> * m_pContextWindows; - - int m_iHeartbeatTimerId; -public: - unsigned int id(){ return m_uId; }; - // never null and always the same! - KviConsole * console(){ return m_pConsole; }; - // never null and always the same - KviFrame * frame(){ return m_pFrame; }; - // may be null and may change! - KviIrcConnection * connection(){ return m_pConnection; }; - // state - State state(){ return m_eState; }; - bool isConnected(){ return m_eState == Connected; }; - bool isLoggingIn(){ return m_eState == LoggingIn; }; - // dead channels and queries - void closeAllDeadChannels(); - void closeAllDeadQueries(); - bool unregisterDeadChannel(KviChannel * c); - bool unregisterDeadQuery(KviQuery * q); - void registerDeadChannel(KviChannel * c); - void registerDeadQuery(KviQuery * q); - KviChannel * findDeadChannel(const QString &name); - KviQuery * findDeadQuery(const QString &nick); - KviQuery * firstDeadQuery(); - // other windows bound to the context - void closeAllContextWindows(); - void registerContextWindow(KviWindow * pWnd); - bool unregisterContextWindow(KviWindow * pWnd); - - KviPointerList<KviIrcDataStreamMonitor> * monitorList(){ return m_pMonitorList; }; - - // links window - void createLinksWindow(); - void setLinksWindowPointer(KviExternalServerDataParser * l){ m_pLinksWindow = l; }; - KviExternalServerDataParser * linksWindow(){ return m_pLinksWindow; }; - - // list window - void createListWindow(); - void setListWindowPointer(KviExternalServerDataParser * l){ m_pListWindow = l; }; - KviExternalServerDataParser * listWindow(){ return m_pListWindow; }; - - void setAsynchronousConnectionData(KviAsynchronousConnectionData * d); - KviAsynchronousConnectionData * asynchronousConnectionData(){ return m_pAsynchronousConnectionData; }; - void destroyAsynchronousConnectionData(); - // used by KviConsole (for now) and KviUserParser - void connectToCurrentServer(); - - void beginAsynchronousConnect(unsigned int uDelayInMSecs); - - void registerDataStreamMonitor(KviIrcDataStreamMonitor * m); - void unregisterDataStreamMonitor(KviIrcDataStreamMonitor *m); - - void terminateConnectionRequest(bool bForce,const QString &szQuitMessage = QString::null,bool bSimulateUnexpectedDisconnect = false); - -protected: - // called by KviIrcContextToolBar: this will DIE in favor of connectOrDisconnect() - void connectButtonClicked(); - // used by KviConsole (for now) - void destroyConnection(); - // for KviConsole (for now) . later will be used only internally - void setState(State eState); - // called by KviIrcConnection - void loginComplete(); - // our heartbeat timer event - virtual void timerEvent(QTimerEvent *e); -public: - void connectOrDisconnect(){ connectButtonClicked(); }; -protected: - // - // KviIrcConnection interface - // - void connectionFailed(int iError); - void connectionEstabilished(); - void connectionTerminated(); -signals: - void stateChanged(); -protected slots: - void asynchronousConnect(); - void unhighlightAllWindows(); -}; - - -#endif //!_KVI_IRCCONTEXT_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_ircdatastreammonitor.cpp b/3.4.0/src/kvirc/kernel/kvi_ircdatastreammonitor.cpp deleted file mode 100644 index 50c4c14e66..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircdatastreammonitor.cpp +++ /dev/null @@ -1,41 +0,0 @@ -//============================================================================= -// -// File : kvi_ircdatastreammonitor.cpp -// Created on Sun 04 Jul 2004 21:27:22 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_ircdatastreammonitor.h" -#include "kvi_irccontext.h" - -KviIrcDataStreamMonitor::KviIrcDataStreamMonitor(KviIrcContext * pContext) -: KviHeapObject() -{ - m_pMyContext = pContext; - m_pMyContext->registerDataStreamMonitor(this); -} - -KviIrcDataStreamMonitor::~KviIrcDataStreamMonitor() -{ - m_pMyContext->unregisterDataStreamMonitor(this); -} - diff --git a/3.4.0/src/kvirc/kernel/kvi_ircdatastreammonitor.h b/3.4.0/src/kvirc/kernel/kvi_ircdatastreammonitor.h deleted file mode 100644 index fa152b79cf..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircdatastreammonitor.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _KVI_IRCDATASTREAMMONITOR_H_ -#define _KVI_IRCDATASTREAMMONITOR_H_ -//============================================================================= -// -// File : kvi_ircdatastreammonitor.h -// Created on Sun 04 Jul 2004 21:27:22 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_heapobject.h" - -class KviIrcContext; - -class KVIRC_API KviIrcDataStreamMonitor : public KviHeapObject -{ -public: - KviIrcDataStreamMonitor(KviIrcContext * pContext); - virtual ~KviIrcDataStreamMonitor(); -protected: - KviIrcContext * m_pMyContext; -public: - // message is null terminated - virtual void incomingMessage(const char * message){}; - // message is NOT null terminated! For proxy connections it might spit out binary data! - virtual void outgoingMessage(const char * message,int len){}; - virtual void connectionInitiated(){}; - virtual void connectionTerminated(){}; - virtual void die(){ delete this; }; -}; - - -#endif //!_KVI_IRCDATASTREAMMONITOR_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_irclink.cpp b/3.4.0/src/kvirc/kernel/kvi_irclink.cpp deleted file mode 100644 index 03c361d393..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_irclink.cpp +++ /dev/null @@ -1,406 +0,0 @@ -//============================================================================= -// -// File : kvi_irclink.cpp -// Created on Mon 03 May 2004 01:45:42 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_irclink.h" -#include "kvi_dns.h" -#include "kvi_locale.h" -#include "kvi_ircserverdb.h" -#include "kvi_proxydb.h" -#include "kvi_error.h" -#include "kvi_out.h" -#include "kvi_options.h" -#include "kvi_ircsocket.h" -#include "kvi_console.h" -#include "kvi_netutils.h" -#include "kvi_internalcmd.h" -#include "kvi_frame.h" -#include "kvi_mexlinkfilter.h" -#include "kvi_garbage.h" -#include "kvi_malloc.h" -#include "kvi_memmove.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectiontarget.h" -#include "kvi_ircconnectiontargetresolver.h" -#include "kvi_ircsocket.h" -#include "kvi_databuffer.h" - -#define __KVI_DEBUG__ -#include "kvi_debug.h" - -#include <qtimer.h> - -extern KVIRC_API KviIrcServerDataBase * g_pIrcServerDataBase; -extern KVIRC_API KviProxyDataBase * g_pProxyDataBase; -extern KVIRC_API KviGarbageCollector * g_pGarbageCollector; - - - -KviIrcLink::KviIrcLink(KviIrcConnection * pConnection) -: QObject() -{ - m_pConnection = pConnection; - m_pTarget = pConnection->target(); - m_pConsole = m_pConnection->console(); - m_pSocket = 0; - - m_pLinkFilter = 0; - - m_pResolver = 0; - - m_pReadBuffer = 0; // incoming data buffer - m_uReadBufferLen = 0; // incoming data buffer length - m_uReadPackets = 0; // total packets read per session - - m_eState = Idle; -} - -KviIrcLink::~KviIrcLink() -{ - if(m_pResolver)delete m_pResolver; - destroySocket(); - if(m_pReadBuffer)kvi_free(m_pReadBuffer); -} - - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// KviIrcSocket management -// - -void KviIrcLink::linkFilterDestroyed() -{ - // ops.. the link filter has been destroyed without permission :D - // this should NEVER happen (?) - - m_pLinkFilter = 0; - m_pConsole->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("Ops... for some reason the link filter object has been destroyed")); - -} - -void KviIrcLink::destroySocket() -{ - if(m_pLinkFilter) - { - QObject::disconnect(m_pLinkFilter,0,this,0); - // the module extension server links must be destroyed in the module that provided it - m_pLinkFilter->die(); - m_pLinkFilter = 0; - } - - if(m_pSocket) - { - delete m_pSocket; - m_pSocket = 0; - } -} - -void KviIrcLink::createSocket(const QString &szLinkFilterName) -{ - destroySocket(); // make sure we do not leak memory - - m_pSocket = new KviIrcSocket(this); - - if(szLinkFilterName.isEmpty())return; - - if(KviQString::equalCI(szLinkFilterName,"irc"))return; - - m_pLinkFilter = (KviMexLinkFilter *)g_pModuleExtensionManager->allocateExtension("linkfilter", - szLinkFilterName.utf8().data(),m_pConsole,0,this,szLinkFilterName.utf8().data()); - - if(m_pLinkFilter) - { - connect(m_pLinkFilter,SIGNAL(destroyed()),this,SLOT(linkFilterDestroyed())); - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE, - __tr2qs("Using filtered IRC protocol: Link filter is \"%Q\""),&szLinkFilterName); - return; - } - - m_pConsole->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("Failed to set up the link filter \"%Q\", will try with plain IRC"),&szLinkFilterName); -} - -////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// Connection related operations -// - -void KviIrcLink::abort() -{ - if(m_pSocket) - { - m_pSocket->abort(); - return; - } - if(m_pResolver) - { - m_pResolver->abort(); - return; - } -} - -void KviIrcLink::start() -{ - m_eState = Connecting; - if(m_pResolver)delete m_pResolver; // this should never happen - m_pResolver = new KviIrcConnectionTargetResolver(m_pConnection); - connect(m_pResolver,SIGNAL(terminated()),this,SLOT(resolverTerminated())); - m_pResolver->start(m_pTarget); -} - -void KviIrcLink::resolverTerminated() -{ - if(!m_pResolver) - { - debug("Oops... resoverTerminated() triggered without a resolver ?"); - return; - } - - if(m_pResolver->status() != KviIrcConnectionTargetResolver::Success) - { - m_eState = Idle; - m_pConnection->linkAttemptFailed(m_pResolver->lastError()); - return; - } - - // resolver terminated succesfully - delete m_pResolver; - m_pResolver = 0; - - createSocket(m_pTarget->server()->linkFilter()); - - int iErr = m_pSocket->startConnection(m_pTarget->server(),m_pTarget->proxy(), - m_pTarget->bindAddress().isEmpty() ? 0 : m_pTarget->bindAddress().utf8().data()); - - if(iErr != KviError_success) - { - QString strDescription(KviError::getDescription(iErr)); - m_pConsole->output(KVI_OUT_SYSTEMERROR, - __tr2qs("Failed to start the connection: %Q"), - &strDescription); -// &(KviError::getDescription(iErr))); - - m_eState = Idle; - m_pConnection->linkAttemptFailed(iErr); - } -} - - -///////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// Incoming data processing -// - -void KviIrcLink::processData(char * buffer,int len) -{ - if(m_pLinkFilter) - { - m_pLinkFilter->processData(buffer,len); - return; - } - - register char *p=buffer; - char *beginOfCurData = buffer; - int bufLen = 0; - char *messageBuffer = (char *)kvi_malloc(1); - - while(*p) - { - if((*p == '\r' )||(*p == '\n')) - { - //found a CR or LF... - //prepare a message buffer - bufLen = p - beginOfCurData; - //check for previous unterminated data - if(m_uReadBufferLen > 0) - { - __range_valid(m_pReadBuffer); - messageBuffer = (char *)kvi_realloc(messageBuffer,bufLen + m_uReadBufferLen + 1); - kvi_memmove(messageBuffer,m_pReadBuffer,m_uReadBufferLen); - kvi_memmove((void *)(messageBuffer + m_uReadBufferLen),beginOfCurData,bufLen); - *(messageBuffer + bufLen + m_uReadBufferLen) = '\0'; - m_uReadBufferLen = 0; - kvi_free(m_pReadBuffer); - m_pReadBuffer = 0; - } else { - __range_invalid(m_pReadBuffer); - messageBuffer = (char *)kvi_realloc(messageBuffer,bufLen + 1); - kvi_memmove(messageBuffer,beginOfCurData,bufLen); - *(messageBuffer + bufLen) = '\0'; - } - m_uReadPackets++; - - // FIXME: actually it can happen that the socket gets disconnected - // in a incomingMessage() call. - // The problem might be that some other parts of kvirc assume - // that the irc context still exists after a failed write to the socket - // (some parts don't even check the return value!) - // If the problem presents itself again then the solution is: - // disable queue flushing for the "incomingMessage" call - // and just call queue_insertMessage() - // then after the call terminates flush the queue (eventually detecting - // the disconnect and thus destroying the irc context). - // For now we try to rely on the remaining parts to handle correctly - // such conditions. Let's see... - if(strlen(messageBuffer)>0) - m_pConnection->incomingMessage(messageBuffer); - - if(m_pSocket->state() != KviIrcSocket::Connected) - { - // Disconnected in KviConsole::incomingMessage() call. - // This may happen for several reasons (local event loop - // with the user hitting the disconnect button, a scripting - // handler event that disconnects explicitly) - // - // We handle it by simply returning control to readData() which - // will return immediately (and safely) control to Qt - kvi_free(messageBuffer); - return; - } - - while(*p && ((*p=='\r')||(*p=='\n')) )p++; - beginOfCurData = p; - - } else p++; - } - - //now *p == '\0' - //beginOfCurData points to '\0' if we have - //no more stuff to parse , or points to something - //different than '\r' or '\n'... - if(*beginOfCurData) - { - //Have remaining data...in the local buffer - bufLen = p - beginOfCurData; - if(m_uReadBufferLen > 0) - { - //and there was more stuff saved... (really slow connection) - __range_valid(m_pReadBuffer); - m_pReadBuffer =(char *)kvi_realloc(m_pReadBuffer,m_uReadBufferLen + bufLen); - kvi_memmove((void *)(m_pReadBuffer+m_uReadBufferLen),beginOfCurData,bufLen); - m_uReadBufferLen += bufLen; - } else { - // - __range_invalid(m_pReadBuffer); - m_uReadBufferLen = bufLen; - m_pReadBuffer =(char *)kvi_malloc(m_uReadBufferLen); - kvi_memmove(m_pReadBuffer,beginOfCurData,m_uReadBufferLen); - } - //The m_pReadBuffer contains at max 1 irc message... - //that can not be longer than 510 bytes (the message is not CRLF terminated) - // FIXME: Is this limit *really* valid on all servers ? - if(m_uReadBufferLen > 510)debug("WARNING : Receiving an invalid irc message from server."); - } - kvi_free(messageBuffer); -} - -///////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// Outgoing data processing -// - -bool KviIrcLink::sendPacket(KviDataBuffer * pData) -{ - if(!m_pSocket) - { - delete pData; - pData = 0; - return false; - } - - // if we have a filter, let it do its job - if(m_pLinkFilter) - return m_pLinkFilter->sendPacket(pData); - - return m_pSocket->sendPacket(pData); -} - -void KviIrcLink::socketStateChange() -{ - switch(m_pSocket->state()) - { - case KviIrcSocket::Connected: - m_eState = Connected; - m_pConnection->linkEstabilished(); - break; - case KviIrcSocket::Idle: - { - State old = m_eState; - m_eState = Idle; - switch(old) - { - case Connecting: - m_pConnection->linkAttemptFailed(m_pSocket->lastError()); - break; - case Connected: - m_pConnection->linkTerminated(); - break; - default: // currently can be only Idle - debug("Ooops... got a KviIrcSocket::Idle state change when KviIrcLink::m_eState was Idle"); - break; - } - } - break; - case KviIrcSocket::Connecting: - m_pConsole->output(KVI_OUT_CONNECTION,__tr2qs("Contacting %Q %s (%s) on port %u"), - connection()->proxy() ? &(__tr2qs("proxy host")) : &(__tr2qs("IRC server")), - connection()->proxy() ? connection()->proxy()->m_szHostname.ptr() : connection()->server()->m_szHostname.utf8().data(), - connection()->proxy() ? connection()->proxy()->m_szIp.ptr() : connection()->server()->m_szIp.utf8().data(), - connection()->proxy() ? connection()->proxy()->m_uPort : connection()->server()->m_uPort); - break; - case KviIrcSocket::SSLHandshake: - m_pConsole->output(KVI_OUT_CONNECTION,__tr2qs("Low-level transport connection established [%s (%s:%u)]"), - connection()->proxy() ? connection()->proxy()->m_szHostname.ptr() : connection()->server()->m_szHostname.utf8().data(), - connection()->proxy() ? connection()->proxy()->m_szIp.ptr() : connection()->server()->m_szIp.utf8().data(), - connection()->proxy() ? connection()->proxy()->m_uPort : connection()->server()->m_uPort); - m_pConsole->outputNoFmt(KVI_OUT_CONNECTION,__tr2qs("Starting Secure Socket Layer handshake")); - break; - case KviIrcSocket::ProxyLogin: - m_pConsole->output(KVI_OUT_CONNECTION,__tr2qs("%Q established [%s (%s:%u)]"), - connection()->socket()->usingSSL() ? &(__tr2qs("Secure proxy connection")) : &(__tr2qs("Proxy connection")), - connection()->proxy()->m_szHostname.ptr(), - connection()->proxy()->m_szIp.ptr(), - connection()->proxy()->m_uPort); - m_pConsole->outputNoFmt(KVI_OUT_CONNECTION,__tr2qs("Negotiating relay information")); - break; - case KviIrcSocket::ProxyFinalV4: - m_pConsole->outputNoFmt(KVI_OUT_CONNECTION,__tr2qs("Sent connection request, waiting for acknowledgement")); - break; - case KviIrcSocket::ProxyFinalV5: - m_pConsole->outputNoFmt(KVI_OUT_CONNECTION,__tr2qs("Sent target host data, waiting for acknowledgement")); - break; - case KviIrcSocket::ProxySelectAuthMethodV5: - m_pConsole->outputNoFmt(KVI_OUT_CONNECTION,__tr2qs("Sent auth method request, waiting for acknowledgement")); - break; - case KviIrcSocket::ProxyUserPassV5: - m_pConsole->outputNoFmt(KVI_OUT_CONNECTION,__tr2qs("Sent username and password, waiting for acknowledgement")); - break; - case KviIrcSocket::ProxyFinalHttp: - m_pConsole->outputNoFmt(KVI_OUT_CONNECTION,__tr2qs("Sent connection request, waiting for \"HTTP 200\" acknowledgement")); - break; - } -} - diff --git a/3.4.0/src/kvirc/kernel/kvi_irclink.h b/3.4.0/src/kvirc/kernel/kvi_irclink.h deleted file mode 100644 index 9d15958471..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_irclink.h +++ /dev/null @@ -1,122 +0,0 @@ -#ifndef _KVI_IRCLINK_H_ -#define _KVI_IRCLINK_H_ -//============================================================================= -// -// File : kvi_irclink.h -// Created on Mon 03 May 2004 01:45:42 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include <qobject.h> - -class KviConsole; -class KviIrcServer; -class KviProxy; -class KviIrcSocket; -class KviDns; -class KviIrcConnection; -class KviIrcConnectionTarget; -class KviIrcConnectionTargetResolver; -class KviDataBuffer; -class KviMexLinkFilter; - - -class KVIRC_API KviIrcLink : public QObject -{ - friend class KviIrcConnection; // upper protocol in the stack - friend class KviIrcSocket; // lower protocol in the stack - Q_OBJECT -public: - enum State { Idle, Connecting, Connected }; -protected: - // only KviConsole can create this - // pConsole must NOT be null - // pServer is a shallow pointer: Connection makes a copy of it internally, must NOT be null - // pProxy may be null if a proxy is not desicred. Connection makes a copy of it internally - KviIrcLink(KviIrcConnection * pConnection); - ~KviIrcLink(); -private: - KviIrcConnection * m_pConnection; // shallow, never null - KviIrcConnectionTarget * m_pTarget; // shallow, never null - KviConsole * m_pConsole; // shallow, never null - KviIrcSocket * m_pSocket; // owned, may be null! - KviMexLinkFilter * m_pLinkFilter; // owned, may be null! - - State m_eState; - - char * m_pReadBuffer; - unsigned int m_uReadBufferLen; - unsigned int m_uReadPackets; - - KviIrcConnectionTargetResolver * m_pResolver; // owned -public: - // da socket(): may be null! - KviIrcSocket * socket(){ return m_pSocket; }; - // da connection: never null - KviIrcConnection * connection(){ return m_pConnection; }; - // da console: never null - KviConsole * console(){ return m_pConsole; }; - State state(){ return m_eState; }; -protected: - // - // interface for KviIrcConnection (up) - // - - // This is used by KviIrcConnection::send*() - // This should be used to intercept the outgoing packets - // when implementing a new protocol - virtual bool sendPacket(KviDataBuffer * pData); - // this aborts any connection or attempt - void abort(); -protected: - // - // local overridables (called internally) - // - - // This is the function used to start a connection attempt. - // It starts the server or proxy DNS lookup - // The function MUST be asynchronous: it must return succesfully - // and report any error by using m_pConnection->linkAttemptFailed() - void start(); -protected: - // - // interface for KviIrcSocket (down) - // - - // This is called by KviIrcSocket to process a packet - // of raw data from the server. The buffer is iLength+1 - // bytes long and contains a null terminator - void processData(char * buffer,int iLength); - // this is called at each state change - void socketStateChange(); -protected slots: - void linkFilterDestroyed(); -private: - void destroySocket(); - void createSocket(const QString &szLinkFilterName); -signals: - void connectionFailed(); // the connection attempt has failed -private slots: - void resolverTerminated(); -}; - -#endif //!_KVI_IRCLINK_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_ircsocket.cpp b/3.4.0/src/kvirc/kernel/kvi_ircsocket.cpp deleted file mode 100644 index df449e91bc..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircsocket.cpp +++ /dev/null @@ -1,1910 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File : kvi_ircsocket.cpp -// Creation date : Tue Jul 30 19:25:18 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_ircsocket.h" -#include "kvi_ircserver.h" -#include "kvi_proxydb.h" -#include "kvi_netutils.h" -#include "kvi_settings.h" -#include "kvi_error.h" -#include "kvi_locale.h" -#include "kvi_malloc.h" -#include "kvi_debug.h" -#include "kvi_string.h" -#include "kvi_options.h" -#include "kvi_memmove.h" -#include "kvi_socket.h" -#include "kvi_console.h" -#include "kvi_out.h" -#include "kvi_irclink.h" -#include "kvi_ircconnection.h" -#include "kvi_databuffer.h" - -#ifdef COMPILE_SSL_SUPPORT - #include "kvi_sslmaster.h" -#endif - -#include <qtimer.h> -#include <qsocketnotifier.h> - -#ifndef COMPILE_ON_WINDOWS - #include <unistd.h> //for gettimeofday() -#endif -//#include <fcntl.h> -//#include <errno.h> - -// FIXME: #warning "Lag-o-meter" - -unsigned int g_uNextIrcLinkId = 1; - - - -KviIrcSocket::KviIrcSocket(KviIrcLink * pLink) -: QObject() -{ - m_uId = g_uNextIrcLinkId; - g_uNextIrcLinkId++; - - m_pLink = pLink; - m_pConsole = m_pLink->console(); - - m_state = Idle; // current socket state - - m_pRsn = 0; // read socket notifier - m_pWsn = 0; // write socket notifier - m_sock = KVI_INVALID_SOCKET; // socket - - m_pIrcServer = 0; // current server data - m_pProxy = 0; // current proxy data - - m_pTimeoutTimer = 0; // timeout for connect() - - m_uReadBytes = 0; // total read bytes per session - m_uSentBytes = 0; // total sent bytes per session - m_uSentPackets = 0; // total packets sent per session - - m_pSendQueueHead = 0; // data queue - m_pSendQueueTail = 0; // - - m_iLastError = KviError_success; - -#ifdef COMPILE_SSL_SUPPORT - m_pSSL = 0; -#endif - - m_tAntiFloodLastMessageTime.tv_sec = 0; - m_tAntiFloodLastMessageTime.tv_usec = 0; - - if(KVI_OPTION_UINT(KviOption_uintSocketQueueFlushTimeout) < 100) - KVI_OPTION_UINT(KviOption_uintSocketQueueFlushTimeout) = 100; // this is our minimum , we don't want to lag the app - - m_bInProcessData = false; - - m_pFlushTimer = new QTimer(); // queue flush timer - connect(m_pFlushTimer,SIGNAL(timeout()),this,SLOT(flushSendQueue())); -} - -KviIrcSocket::~KviIrcSocket() -{ - reset(); - delete m_pFlushTimer; -} - - -void KviIrcSocket::reset() -{ -#ifdef COMPILE_SSL_SUPPORT - if(m_pSSL) - { - KviSSLMaster::freeSSL(m_pSSL); - m_pSSL = 0; - } -#endif - if(m_pIrcServer) - { - delete m_pIrcServer; - m_pIrcServer = 0; - } - if(m_pProxy) - { - delete m_pProxy; - m_pProxy = 0; - } - if(m_pRsn) - { - delete m_pRsn; - m_pRsn = 0; - } - if(m_pWsn) - { - delete m_pWsn; - m_pWsn = 0; - } - if(kvi_socket_isValid(m_sock)) - { - kvi_socket_destroy(m_sock); - m_sock = KVI_INVALID_SOCKET; - } - if(m_pTimeoutTimer) - { - m_pTimeoutTimer->stop(); - delete m_pTimeoutTimer; - m_pTimeoutTimer = 0; - } - - m_bInProcessData = false; - - m_uReadBytes = 0; - m_uSentBytes = 0; - m_uSentPackets = 0; - m_tAntiFloodLastMessageTime.tv_sec = 0; - m_tAntiFloodLastMessageTime.tv_usec = 0; - - m_bInProcessData = false; - - if(m_pFlushTimer->isActive())m_pFlushTimer->stop(); - queue_removeAllMessages(); - - setState(Idle); -} - -void KviIrcSocket::outputSSLMessage(const QString &szMsg) -{ - m_pConsole->output(KVI_OUT_SSL,__tr2qs("[SSL]: %Q"),&szMsg); -} - -void KviIrcSocket::outputSSLError(const QString &szMsg) -{ - m_pConsole->output(KVI_OUT_SSL,__tr2qs("[SSL ERROR]: %Q"),&szMsg); -} - -void KviIrcSocket::outputProxyMessage(const QString &szMsg) -{ - QStringList list=QStringList::split("\n",szMsg); - for(QStringList::Iterator it = list.begin(); it != list.end(); ++it) - { - QString szTemporary = (*it).stripWhiteSpace(); - m_pConsole->output(KVI_OUT_SOCKETMESSAGE,__tr2qs("[PROXY]: %Q"),&(szTemporary)); - } -} - -void KviIrcSocket::outputProxyError(const QString &szMsg) -{ - QStringList list=QStringList::split("\n",szMsg); - for(QStringList::Iterator it = list.begin(); it != list.end(); ++it) - { - QString szTemporary = (*it).stripWhiteSpace(); - m_pConsole->output(KVI_OUT_SOCKETERROR,__tr2qs("[PROXY ERROR]: %Q"),&(szTemporary)); - } - -} - -void KviIrcSocket::outputSocketMessage(const QString &szMsg) -{ - m_pConsole->output(KVI_OUT_SOCKETMESSAGE,__tr2qs("[SOCKET]: %Q"),&szMsg); -} - -void KviIrcSocket::outputSocketError(const QString &szMsg) -{ - m_pConsole->output(KVI_OUT_SOCKETERROR,__tr2qs("[SOCKET ERROR]: %Q"),&szMsg); -} - - -void KviIrcSocket::outputSocketWarning(const QString &szMsg) -{ - m_pConsole->output(KVI_OUT_SOCKETWARNING,__tr2qs("[SOCKET WARNING]: %Q"),&szMsg); -} - -void KviIrcSocket::setState(SocketState st) -{ - if(st != m_state) - { - m_state = st; - m_pLink->socketStateChange(); - } -} - -void KviIrcSocket::raiseError(int iError) -{ - m_iLastError = iError; - //m_pConsole->socketError(iError); - if( (m_iLastError==KviError_remoteEndClosedConnection) && ( m_state == ProxyHttpError) ) - outputSocketMessage(KviError::getDescription(iError)); - else - outputSocketError(KviError::getDescription(iError)); -} - -int KviIrcSocket::startConnection(KviIrcServer *srv,KviProxy * prx,const char * bindAddress) -{ - // Attempts to estabilish an IRC connection - // to the server specified by *srv. - // Uses the proxy *prx if not 0 - if(m_state != Idle)return KviError_anotherConnectionInProgress; - - // Coherent state, thnx. - reset(); - - if(srv->useSSL()) - { -#ifndef COMPILE_SSL_SUPPORT - return KviError_noSSLSupport; -#endif //!COMPILE_SSL_SUPPORT - } - - // Copy the server - m_pIrcServer = new KviIrcServer(*srv); - - bool bTargetIpV6 = false; - bool bNeedServerIp = !prx; - if(prx) bNeedServerIp = ( - prx->protocol() != KviProxy::Http && prx->protocol() != KviProxy::Socks5 - ); - - // We're going to check the addresses now - - // check the proxy stuff... - if(prx) - { - // Yeah...here comes the proxy - m_pProxy = new KviProxy(*prx); - // check the proxy IP address - if(m_pProxy->isIpV6()) - { - // IpV6 proxy :) (STILL QUITE UNTESTED ?) -#ifdef COMPILE_IPV6_SUPPORT - bTargetIpV6 = true; - if(!kvi_isValidStringIp_V6(m_pProxy->ip()))return KviError_invalidProxyAddress; - // SOCKSV4 does not support IPV6 addresses - if(m_pProxy->protocol() == KviProxy::Socks4)return KviError_socksV4LacksIpV6Support; -#else - return KviError_noIpV6Support; -#endif - } else { - // IpV4 proxy - if(!kvi_isValidStringIp(m_pProxy->ip()))return KviError_invalidProxyAddress; - } - } - - if(bNeedServerIp) - { - // check the irc host ip -#ifdef COMPILE_IPV6_SUPPORT - if(m_pIrcServer->isIpV6()) - { - // We have an IpV6 server host (Interesting if proxy is IpV4) - if( !KviNetUtils::isValidStringIp_V6(m_pIrcServer->ip()) )return KviError_invalidIpAddress; - if(!m_pProxy)bTargetIpV6 = true; // otherwise the proxy rules - } else { -#endif - // We have an IpV4 server host - if(!KviNetUtils::isValidStringIp(m_pIrcServer->ip())) return KviError_invalidIpAddress; -#ifdef COMPILE_IPV6_SUPPORT - } -#endif - } - - KviSockaddr sa(prx ? m_pProxy->ip() : m_pIrcServer->ip().utf8().data(),prx ? m_pProxy->port() : m_pIrcServer->port(),bTargetIpV6); - - if(!sa.socketAddress())return KviError_invalidIpAddress; - - // create the socket -#ifdef COMPILE_IPV6_SUPPORT - m_sock = kvi_socket_create(bTargetIpV6 ? KVI_SOCKET_PF_INET6 : KVI_SOCKET_PF_INET,KVI_SOCKET_TYPE_STREAM,KVI_SOCKET_PROTO_TCP); -#else - m_sock = kvi_socket_create(KVI_SOCKET_PF_INET,KVI_SOCKET_TYPE_STREAM,KVI_SOCKET_PROTO_TCP); -#endif - - if(m_sock < 0)return KviError_socketCreationFailed; - - if(bindAddress) - { - // we have to bind the socket to a local address - KviSockaddr localSa(bindAddress,0,bTargetIpV6); - bool bBindOk = localSa.socketAddress(); - - if(bBindOk) - { - bBindOk = kvi_socket_bind(m_sock,localSa.socketAddress(),((int)(localSa.addressLength()))); - } - - QString tmp; - if(bBindOk) - { - if(_OUTPUT_VERBOSE) - KviQString::sprintf(tmp,__tr2qs("Binding to local address %s"),bindAddress); - outputSocketMessage(tmp); - } else { - if(_OUTPUT_VERBOSE) - KviQString::sprintf(tmp,__tr2qs("Binding to local address %s failed: the kernel will choose the correct interface"),bindAddress); - outputSocketWarning(tmp); - } - } - - // make it non blocking - if(!kvi_socket_setNonBlocking(m_sock)) - { - reset(); - return KviError_asyncSocketFailed; - } - - if(!kvi_socket_connect(m_sock,sa.socketAddress(),((int)(sa.addressLength())))) - { - // ops... - int err = kvi_socket_error(); - - if(!kvi_socket_recoverableConnectError(err)) - { - // Ops... - int sockError=err; - if(sockError==0) - { - // Zero error ?...let's look closer - int iSize=sizeof(int); - if(!kvi_socket_getsockopt(m_sock,SOL_SOCKET,SO_ERROR,(void *)&sockError,&iSize))sockError=0; - } - // die :( - reset(); - // And declare problems :) - if(sockError)return KviError::translateSystemError(sockError); - else return KviError_unknownError; //Error 0 ? - } - } - - // and setup the WRITE notifier... - m_pWsn = new QSocketNotifier((int)m_sock,QSocketNotifier::Write); - QObject::connect(m_pWsn,SIGNAL(activated(int)),this,SLOT(writeNotifierFired(int))); - m_pWsn->setEnabled(true); - - // set the timer - if(KVI_OPTION_UINT(KviOption_uintIrcSocketTimeout) < 5)KVI_OPTION_UINT(KviOption_uintIrcSocketTimeout) = 5; - m_pTimeoutTimer = new QTimer(); - QObject::connect(m_pTimeoutTimer,SIGNAL(timeout()),this,SLOT(connectionTimedOut())); - m_pTimeoutTimer->start(KVI_OPTION_UINT(KviOption_uintIrcSocketTimeout) * 1000,true); - - // and wait for connect - setState(Connecting); - - return KviError_success; -} - -void KviIrcSocket::connectionTimedOut() -{ - // the m_pTimeoutTimer fired :( - raiseError(KviError_connectionTimedOut); - reset(); -} - -void KviIrcSocket::writeNotifierFired(int) -{ - // kill the timeout timer - if(m_pTimeoutTimer) - { - delete m_pTimeoutTimer; - m_pTimeoutTimer = 0; - } - - // Check for errors... - int sockError; - int iSize=sizeof(int); - if(!kvi_socket_getsockopt(m_sock,SOL_SOCKET,SO_ERROR,(void *)&sockError,&iSize))sockError = -1; - //sockError = 0; - if(sockError != 0) - { - //failed - if(sockError > 0)sockError = KviError::translateSystemError(sockError); - else sockError = KviError_unknownError; //Error 0 ? - raiseError(sockError); - reset(); - return; - } - - // kill the write notifier - delete m_pWsn; - m_pWsn = 0; - - //Succesfully connected... - connectionEstabilished(); -} - -void KviIrcSocket::connectionEstabilished() -{ - // the connection with a remote end has been estabilished - // if it is a proxy we need to perform the login operations - // otherwise we're connected to the irc server - if(m_sock == KVI_INVALID_SOCKET)return; // ops...disconnected in setState() ???? - - if(m_pProxy)connectedToProxy(); - else connectedToIrcServer(); -} - -void KviIrcSocket::connectedToProxy() -{ - if(!m_pProxy)debug("WARNING: connectedToProxy() without a m_pProxy!"); - - // FIXME: Do we want to support SSL proxies ? - // it would be just a matter of SSL handshaking - // with the proxy - - setState(ProxyLogin); - - if(m_pRsn) - { - delete m_pRsn; - m_pRsn = 0; - } - - m_pRsn = new QSocketNotifier((int)m_sock,QSocketNotifier::Read); - - QObject::connect(m_pRsn,SIGNAL(activated(int)),this,SLOT(readProxyData(int))); - - switch(m_pProxy->protocol()) - { - case KviProxy::Http: - proxyLoginHttp(); - break; - case KviProxy::Socks5: - proxyLoginV5(); - break; - default: - proxyLoginV4(); - break; - } -} - -void KviIrcSocket::readHttpProxyErrorData(int) -{ - char buffer[256]; - int readLength; - - readLength = kvi_socket_recv(m_sock,buffer,255); - if(readLength <= 0) - { - handleInvalidSocketRead(readLength); - return; - } - - outputProxyMessage(m_pConsole->decodeText(buffer)); -} - -void KviIrcSocket::connectedToIrcServer() -{ -#ifdef COMPILE_SSL_SUPPORT - if(m_pIrcServer->useSSL()) - { - m_pSSL = KviSSLMaster::allocSSL(m_pConsole,m_sock,KviSSL::Client); - if(!m_pSSL) - { - raiseSSLError(); - raiseError(KviError_SSLError); - reset(); - return; - } - setState(SSLHandshake); - doSSLHandshake(0); - return; - } -#endif - linkUp(); -} - - -void KviIrcSocket::readProxyData(int) -{ - char buffer[256]; - - int readLength; -/* - // THIS IS WORKING CODE THAT SUPPORTS SSL PROXIES! -#ifdef COMPILE_SSL_SUPPORT - if(m_pSSL) - { - readLength = m_pSSL->read(buffer,256); - if(readLength <= 0) - { - // ssl error....? - switch(m_pSSL->getProtocolError(readLength)) - { - case KviSSL::ZeroReturn: - readLength = 0; - break; - case KviSSL::WantRead: - case KviSSL::WantWrite: - // hmmm... - return; - break; - case KviSSL::SyscallError: - { - int iE = m_pSSL->getLastError(true); - if(iE != 0) - { - raiseSSLError(); - raiseError(KviError_SSLError); - reset(); - return; - } - } - break; - case KviSSL::SSLError: - raiseSSLError(); - raiseError(KviError_SSLError); - reset(); - return; - break; - default: - raiseError(KviError_SSLError); - reset(); - return; - break; - - } - handleInvalidSocketRead(readLength); - return; - } - } else { -#endif -*/ - readLength = kvi_socket_recv(m_sock,buffer,255); - if(readLength <= 0) - { - handleInvalidSocketRead(readLength); - return; - } -/* -#ifdef COMPILE_SSL_SUPPORT - } -#endif -*/ - // we need at least two bytes... - if(readLength < 2) - { - // a single byte of reply means: - // - connection through a 1 bps modem - // - a totally blocked network - // - remote host is not a SOCKS/HTTP server - // Anyway....it is always a meaningless reply - // better to try again later :) - raiseError(KviError_unrecognizedProxyReply); - reset(); - return; - } - // handle the reply - switch(m_state) - { - case ProxyFinalV4: - //V4 final reply - proxyHandleV4FinalReply((unsigned char)buffer[1]); - break; - case ProxySelectAuthMethodV5: - //V5 method selection reply - proxyHandleV5MethodReply((unsigned char)buffer[1]); - break; - case ProxyUserPassV5: - //V5 user and pass reply - proxyHandleV5AuthReply((unsigned char)buffer[1]); - break; - case ProxyFinalV5: - //V5 final reply - proxyHandleV5FinalReply((unsigned char)buffer[1]); - break; - case ProxyFinalHttp: - //Http final reply - buffer[readLength] = '\0'; - proxyHandleHttpFinalReply(buffer,readLength); - break; - default: - // what ? - raiseError(KviError_unrecognizedProxyReply); - reset(); - break; - } -} - - - -void KviIrcSocket::proxyLoginHttp() -{ - // Well..this is just plain and easy: connect to the proxy machine - // and say "CONNECT <irc.server>:<port> HTTP/<version>\n\n" - // if it requires auth than say Proxy-Authorization: Basic user:passwd - // Then expect a server reply header (2 newlines) - // HTTP 200 = Success - // HTTP Anything else = Failure - - if(_OUTPUT_VERBOSE) - outputProxyMessage(__tr2qs("Using HTTP protocol.")); - - setState(ProxyFinalHttp); - KviStr tmp(KviStr::Format,"CONNECT %s:%u HTTP/1.0\r\n",m_pIrcServer->hostName().utf8().data(),(unsigned int)(m_pIrcServer->port())); - if(m_pProxy->hasUser()) - { - KviStr auth(KviStr::Format,"%s:%s",m_pProxy->user(),m_pProxy->pass()); - KviStr encoded; - encoded.bufferToBase64(auth.ptr(),auth.len()); - tmp.append(KviStr::Format,"Proxy-Authorization: Basic %s\r\n\r\n",encoded.ptr()); - } else { - tmp.append("\r\n"); - } -// debug(tmp.ptr()); - sendRawData(tmp.ptr(),tmp.len()); -} - -void KviIrcSocket::proxyLoginV4() -{ - // SOCKSV4 protocol - // - // 1) CONNECT - // - // The client connects to the SOCKS server and sends a CONNECT request when - // it wants to establish a connection to an application server. The client - // includes in the request packet the IP address and the port number of the - // destination host, and userid, in the following format. - // - // +----+----+----+----+----+----+----+----+----+----+....+----+ - // | VN | CD | DSTPORT | DSTIP | USERID |NULL| - // +----+----+----+----+----+----+----+----+----+----+....+----+ - // # of bytes: 1 1 2 4 variable 1 - // - // VN is the SOCKS protocol version number and should be 4. CD is the - // SOCKS command code and should be 1 for CONNECT request. NULL is a byte - // of all zero bits. - // - // The SOCKS server checks to see whether such a request should be granted - // based on any combination of source IP address, destination IP address, - // destination port number, the userid, and information it may obtain by - // consulting IDENT, cf. RFC 1413. If the request is granted, the SOCKS - // server makes a connection to the specified port of the destination host. - // A reply packet is sent to the client when this connection is established, - // or when the request is rejected or the operation fails. - // - if(_OUTPUT_VERBOSE) - outputProxyMessage(__tr2qs("Using SOCKSV4 protocol.")); - - m_pProxy->normalizeUserAndPass(); - // the protocol does not specify the "userid" format... - // so build an userid from the pass and/or username... - - KviStr szUserAndPass=m_pProxy->user(); - if(m_pProxy->hasPass()){ - if(szUserAndPass.hasData())szUserAndPass.append(' '); - szUserAndPass.append(m_pProxy->pass()); - } - int iLen = szUserAndPass.len()+9; - // build the request packet - char *bufToSend = new char[iLen]; - bufToSend[0]=(unsigned char)4; //Version 4 - bufToSend[1]=(unsigned char)1; //Connect - Q_UINT16 port=(Q_UINT16)htons(m_pIrcServer->port()); - kvi_memmove((void *)(bufToSend+2),(void *)&port,2); - - struct in_addr ircInAddr; - - if(!kvi_stringIpToBinaryIp(m_pIrcServer->ip(),&ircInAddr)) - debug("SOCKET INTERNAL ERROR IN IPV4 (SOCKS4) ADDR CONVERSION"); - - Q_UINT32 host=(Q_UINT32)ircInAddr.s_addr; - kvi_memmove((void *)(bufToSend+4),(void *)&host,4); - kvi_memmove((void *)(bufToSend+8),(void *)(szUserAndPass.ptr()),szUserAndPass.len()); - // send it into hyperspace... - setState(ProxyFinalV4); - sendRawData(bufToSend,iLen); - delete[] bufToSend; - // and wait for reply... -} - -void KviIrcSocket::proxyLoginV5() -{ - // SOCKSV5 protocol. - // - // When a TCP-based client wishes to establish a connection to an object - // that is reachable only via a firewall (such determination is left up - // to the implementation), it must open a TCP connection to the - // appropriate SOCKS port on the SOCKS server system. The SOCKS service - // is conventionally located on TCP port 1080. If the connection - // request succeeds, the client enters a negotiation for the - // authentication method to be used, authenticates with the chosen - // method, then sends a relay request. The SOCKS server evaluates the - // request, and either establishes the appropriate connection or denies - // it. - // - // The client connects to the server, and sends a version - // identifier/method selection message: - // - // +----+----------+----------+ - // |VER | NMETHODS | METHODS | - // +----+----------+----------+ - // | 1 | 1 | 1 to 255 | - // +----+----------+----------+ - // - // The VER field is set to X'05' for this version of the protocol. The - // NMETHODS field contains the number of method identifier octets that - // appear in the METHODS field. - // The values currently defined for METHOD are: - // - // o X'00' NO AUTHENTICATION REQUIRED - // o X'01' GSSAPI - // o X'02' USERNAME/PASSWORD - // o X'03' CHAP - // o X'04' to X'7F' IANA ASSIGNED - // o X'80' to X'FE' RESERVED FOR PRIVATE METHODS - // o X'FF' NO ACCEPTABLE METHODS - // - - if(_OUTPUT_VERBOSE) - outputProxyMessage(__tr2qs("Using SOCKSv5 protocol.")); - - m_pProxy->normalizeUserAndPass(); - // the protocol does not specify the "userid" format... - // so build an userid from the pass and/or username... - - char bufToSend[4]; - bufToSend[0]=(unsigned char)5; //use version 5 - int sendLen = 3; - if(!(m_pProxy->hasUser() || m_pProxy->hasPass())) - { - // no auth needed. - bufToSend[1]=(unsigned char)1; //select one method - bufToSend[2]=(unsigned char)0; //select method 0 : no auth - if(_OUTPUT_VERBOSE) - outputProxyMessage(__tr2qs("We can accept auth method 0 (no auth)")); - } else { - // we can provide a password and username if needed... - bufToSend[1]=(unsigned char)2; //select from two methods - bufToSend[2]=(unsigned char)0; //method 0 or - bufToSend[3]=(unsigned char)2; //method 2 username/pass auth - sendLen = 4; - if(_OUTPUT_VERBOSE) - outputProxyMessage(__tr2qs("We can accept auth method 0 (no auth) or 2 (user/pass)")); - } - // notify the user before sending...since we may get disconnected - setState(ProxySelectAuthMethodV5); - sendRawData(bufToSend,sendLen); - // and wait for response -} - -void KviIrcSocket::proxyAuthUserPassV5() -{ - // Once the SOCKS V5 server has started, and the client has selected the - // Username/Password Authentication protocol, the Username/Password - // subnegotiation begins. This begins with the client producing a - // Username/Password request: - // - // +----+------+----------+------+----------+ - // |VER | ULEN | UNAME | PLEN | PASSWD | - // +----+------+----------+------+----------+ - // | 1 | 1 | 1 to 255 | 1 | 1 to 255 | - // +----+------+----------+------+----------+ - // - // The VER field contains the current version of the subnegotiation, - // which is X'01'. The ULEN field contains the length of the UNAME field - // that follows. The UNAME field contains the username as known to the - // source operating system. The PLEN field contains the length of the - // PASSWD field that follows. The PASSWD field contains the password - // association with the given UNAME. - // - unsigned int lPass=(unsigned int)m_pProxy->passLen(); - if(lPass>255)lPass=255; - unsigned int lUser=(unsigned int)m_pProxy->userLen(); - if(lUser>255)lUser=255; - int iLen=lPass+lUser+3; - char *bufToSend=new char[iLen]; - bufToSend[0]=(unsigned char)1; //version x'01' - bufToSend[1]=(unsigned char)lUser; //length of the username - kvi_memmove((void *)(bufToSend+2),(void *)m_pProxy->user(),lUser); //username - bufToSend[2+lUser]=(unsigned char)lPass; //length of the password - kvi_memmove((void *)(bufToSend+3+lUser),(void *)m_pProxy->pass(),lPass); - // spit out the buffer and wait - setState(ProxyUserPassV5); - sendRawData(bufToSend,iLen); - delete[] bufToSend; - // and wait for response... -} - -void KviIrcSocket::proxySendTargetDataV5() -{ - // Once the method-dependent subnegotiation has completed, the client - // sends the request details. If the negotiated method includes - // encapsulation for purposes of integrity checking and/or - // confidentiality, these requests MUST be encapsulated in the method- - // dependent encapsulation. - // - // The SOCKS request is formed as follows: - // - // +----+-----+------+------+----------+----------+ - // |VER | CMD | FLAG | ATYP | DST.ADDR | DST.PORT | - // +----+-----+------+------+----------+----------+ - // | 1 | 1 | 1 | 1 | Variable | 2 | - // +----+-----+------+------+----------+----------+ - // - // Where: - // - // o VER protocol version: X'05' - // o CMD - // o CONNECT X'01' - // o BIND X'02' - // o UDP ASSOCIATE X'03' - // o X'04' to X'7F' IANA ASSIGNED - // o X'80' to X'FF' RESERVED FOR PRIVATE METHODS - // o FLAG command dependent flag (defaults to X'00') - // o ATYP address type of following address - // o IP V4 address: X'01' - // o DOMAINNAME: X'03' - // o IP V6 address: X'04' - // o DST.ADDR desired destination address - // o DST.PORT desired destination port in network octet - // order - // - // The SOCKS server will typically evaluate the request based on - // source and destination addresses, and return one or more reply - // messages, as appropriate for the request type. - // - // In an address field (DST.ADDR, BND.ADDR), the ATYP field specifies - // the type of address contained within the field: - // - // o X'01' - // - // The address is a version-4 IP address, with a length of 4 octets. - // - // o X'03' - // - // The address field contains a fully-qualified domain name. The first - // octet of the address field contains the number of octets of name that - // follow, there is no terminating NUL octet. - // - // o X'04' - // - // The address is a version-6 IP address, with a length of 16 octets. - bool bRemoteDns=!( - - ( - KviNetUtils::isValidStringIp(m_pIrcServer->ip()) - #ifdef COMPILE_IPV6_SUPPORT - || KviNetUtils::isValidStringIp_V6(m_pIrcServer->ip()) - #endif - ) - - && m_pIrcServer->cacheIp() - ); - int bufLen = bRemoteDns ? 4 + 1 + m_pIrcServer->hostName().utf8().length() + 2 - : (m_pIrcServer->isIpV6() ? 22 : 10); - char * bufToSend = (char *)kvi_malloc(sizeof(char) * bufLen); - bufToSend[0]=(unsigned char)5; //Proto 5 - bufToSend[1]=(unsigned char)1; //CONNECT - bufToSend[2]=(unsigned char)0; //RSV - - if(bRemoteDns) - { - bRemoteDns=true; - bufToSend[3]=3; - bufToSend[4]=m_pIrcServer->hostName().utf8().length(); - } else { - bufToSend[3]=(unsigned char)m_pIrcServer->isIpV6() ? 4 : 1; // IPV6 : IPV4 - } - - if(bRemoteDns) - { - kvi_memmove((void *)(bufToSend + 5), - (void *)(m_pIrcServer->hostName().utf8().data()), - m_pIrcServer->hostName().utf8().length()); - Q_UINT16 port = (Q_UINT16)htons(m_pIrcServer->port()); - kvi_memmove((void *)(bufToSend + 4 + 1 + m_pIrcServer->hostName().utf8().length()),(void *)&port,2); - } else if(m_pIrcServer->isIpV6()) { -#ifdef COMPILE_IPV6_SUPPORT - struct in6_addr ircInAddr; - - if(!kvi_stringIpToBinaryIp_V6(m_pIrcServer->ip(),&ircInAddr))debug("SOCKET INTERNAL ERROR IN IPV6 ADDR CONVERSION"); - kvi_memmove((void *)(bufToSend + 4),(void *)(&ircInAddr),4); - Q_UINT16 port = (Q_UINT16)htons(m_pIrcServer->port()); - kvi_memmove((void *)(bufToSend + 20),(void *)&port,2); -#endif - } else { - struct in_addr ircInAddr; - - if(!kvi_stringIpToBinaryIp(m_pIrcServer->ip(),&ircInAddr))debug("SOCKET INTERNAL ERROR IN IPV4 ADDR CONVERSION"); - Q_UINT32 host = (Q_UINT32)ircInAddr.s_addr; - kvi_memmove((void *)(bufToSend + 4),(void *)&host,4); - Q_UINT16 port = (Q_UINT16)htons(m_pIrcServer->port()); - kvi_memmove((void *)(bufToSend + 8),(void *)&port,2); - } - - // send it into hyperspace... - setState(ProxyFinalV5); - sendRawData(bufToSend,bufLen); - kvi_free(bufToSend); - // and wait for reply... -} - - -void KviIrcSocket::proxyHandleV5AuthReply(unsigned char reply) -{ - // The server verifies the supplied UNAME and PASSWD, and sends the - // following response: - // - // +----+--------+ - // |VER | STATUS | - // +----+--------+ - // | 1 | 1 | - // +----+--------+ - // - // A STATUS field of X'00' indicates success. If the server returns a - // `failure' (STATUS value other than X'00') status, it MUST close the - // connection. - // - if(reply == 0) - { - if(_OUTPUT_VERBOSE) - outputProxyMessage(__tr2qs("Proxy response: auth OK: access granted")); - proxySendTargetDataV5(); - return; - } - raiseError(KviError_proxyAuthFailed); - reset(); -} - -void KviIrcSocket::proxyHandleV5MethodReply(unsigned char reply) -{ - // The server selects from one of the methods given in METHODS, and - // sends a METHOD selection message: - // - // +----+--------+ - // |VER | METHOD | - // +----+--------+ - // | 1 | 1 | - // +----+--------+ - // - // If the selected METHOD is X'FF', none of the methods listed by the - // client are acceptable, and the client MUST close the connection. - // - // The values currently defined for METHOD are: - // - // o X'00' NO AUTHENTICATION REQUIRED - // o X'01' GSSAPI - // o X'02' USERNAME/PASSWORD - // o X'03' CHAP - // o X'04' to X'7F' IANA ASSIGNED - // o X'80' to X'FE' RESERVED FOR PRIVATE METHODS - // o X'FF' NO ACCEPTABLE METHODS - // - if(reply == 0) - { - if(_OUTPUT_VERBOSE) - outputProxyMessage(__tr2qs("Proxy response: Auth method OK: using method 0 (no auth)")); - proxySendTargetDataV5(); - return; - } - if(reply == 2) - { - if(_OUTPUT_VERBOSE) - outputProxyMessage(__tr2qs("Proxy response: Auth method OK: using method 2 (user/pass)")); - proxyAuthUserPassV5(); - return; - } - //Request rejected - if(reply == 0xFF) - { - raiseError(KviError_proxyNoAcceptableAuthMethod); - reset(); - } else { - // unrecognized... - raiseError(KviError_unrecognizedProxyReply); - reset(); - } -} - -void KviIrcSocket::proxyHandleV5FinalReply(unsigned char reply) -{ - // - // The SOCKS request information is sent by the client as soon as it has - // established a connection to the SOCKS server, and completed the - // authentication negotiations. The server evaluates the request, and - // returns a reply formed as follows: - // - // +----+-----+------+------+----------+----------+ - // |VER | REP | FLAG | ATYP | BND.ADDR | BND.PORT | - // +----+-----+------+------+----------+----------+ - // | 1 | 1 | 1 | 1 | Variable | 2 | - // +----+-----+------+------+----------+----------+ - // - // Where: - // o VER protocol version: X'05' - // o REP Reply field: - // o X'00' succeeded - // o X'01' general SOCKS server failure - // o X'02' connection not allowed by ruleset - // o X'03' Network unreachable - // o X'04' Host unreachable - // o X'05' Connection refused - // o X'06' TTL expired - // o X'07' Command not supported - // o X'08' Address type not supported - // o X'09' Invalid address - // o X'0A' to X'FF' unassigned - // o FLAG command dependent flag - // o ATYP address type of following address - // o IP V4 address: X'01' - // o DOMAINNAME: X'03' - // o IP V6 address: X'04' - // o BND.ADDR server bound address - // o BND.PORT server bound port in network octet order - // - if(reply==0) - { - // Request granted - if(_OUTPUT_VERBOSE) - outputProxyMessage(__tr2qs("Proxy response: target data OK: request granted")); - connectedToIrcServer(); - } else { - //Request rejected - int err; - switch(reply) - { - case 1: err = KviError_proxyReply01GeneralSOCKSFailure; break; - case 2: err = KviError_proxyReply02ConnectionNotAllowed; break; - case 3: err = KviError_proxyReply03NetworkUnreachable; break; - case 4: err = KviError_proxyReply04HostUnreachable; break; - case 5: err = KviError_proxyReply05ConnectionRefused; break; - case 6: err = KviError_proxyReply06TTLExpired; break; - case 7: err = KviError_proxyReply07CommandNotSupported; break; - case 8: err = KviError_proxyReply08AddressTypeNotSupported; break; - case 9: err = KviError_proxyReply09InvalidAddress; break; - default: err = KviError_unrecognizedProxyReply; break; - } - raiseError(err); - reset(); - } -} - -void KviIrcSocket::proxyHandleV4FinalReply(unsigned char reply) -{ - // If the request is granted, the SOCKS - // server makes a connection to the specified port of the destination host. - // A reply packet is sent to the client when this connection is established, - // or when the request is rejected or the operation fails. - // - // - // +----+----+----+----+----+----+----+----+ - // | VN | CD | DSTPORT | DSTIP | - // +----+----+----+----+----+----+----+----+ - // # of bytes: 1 1 2 4 - // - // VN is the version of the reply code and should be 0. CD is the result - // code with one of the following values: - // - // 90: request granted - // 91: request rejected or failed - // 92: request rejected becasue SOCKS server cannot connect to - // identd on the client - // 93: request rejected because the client program and identd - // report different user-ids - // - // The remaining fields are ignored. - // - // The SOCKS server closes its connection immediately after notifying - // the client of a failed or rejected request. For a successful request, - // the SOCKS server gets ready to relay traffic on both directions. This - // enables the client to do I/O on its connection as if it were directly - // connected to the application server. - if(reply==90) - { - // Request granted - if(_OUTPUT_VERBOSE) - outputProxyMessage(__tr2qs("Proxy response: target data OK: request granted")); - connectedToIrcServer(); - } else { - //Request rejected - int err; - switch(reply) - { - case 91: err = KviError_proxyReply91RequestFailed; break; - case 92: err = KviError_proxyReply92IdentFailed; break; - case 93: err = KviError_proxyReply93IdentNotMatching; break; - default: err = KviError_unrecognizedProxyReply; break; - } - raiseError(err); - reset(); - } - // Just looked out of the window... - // Hmmmm...strange light outside... - // Looked at the clock...6:34 ! - // I think I'll go sleep.... :) -} - -void KviIrcSocket::proxyHandleHttpFinalReply(const char * buffer,int bufLen) -{ - // Escape character is '^]'. - // CONNECT warszawa.irc.pl:6667 HTTP/1.0 - // - // HTTP/1.0 200 Connection established - - KviStr tmp = buffer; - // FIXME: #warning "We could even show the proxy output here...!" - tmp.cutFromFirst('\n'); - tmp.stripWhiteSpace(); - - if(kvi_strEqualCIN(tmp.ptr(),"HTTP",4)) - { - int idx = tmp.findFirstIdx(" 200 "); - if(idx != -1) - { - if(idx == tmp.findFirstIdx(' ')) - { - QString msg = __tr2qs("Proxy response: "); - msg += tmp.ptr(); - if(_OUTPUT_VERBOSE) - outputProxyMessage(msg); - connectedToIrcServer(); - return; - } - } - - } - - outputProxyError(__tr2qs("Proxy said something about: \n")); - outputProxyMessage(m_pConsole->decodeText(buffer)); - - //Read HTTP error page and show it - - if(m_pWsn) - { - delete m_pWsn; - m_pWsn = 0; - } - - if(m_pRsn) - { - delete m_pRsn; - m_pRsn = 0; - } - - m_pRsn = new QSocketNotifier((int)m_sock,QSocketNotifier::Read); - QObject::connect(m_pRsn,SIGNAL(activated(int)),this,SLOT(readHttpProxyErrorData(int))); - m_pRsn->setEnabled(true); - - setState(ProxyHttpError); - -// raiseError(KviError_proxyHttpFailure); -// reset(); -} - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// SSL HANDSHAKE -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - -#ifdef COMPILE_SSL_SUPPORT - -void KviIrcSocket::printSSLPeerCertificate() -{ - KviSSLCertificate * c = m_pSSL->getPeerCertificate(); - if(c) - { - //m_pConsole->socketEvent(SSLCertificate,(void *)c); - if(_OUTPUT_VERBOSE) - KviSSLMaster::printSSLCertificate(m_pConsole,__tr("Server X509 certificate"),c); - delete c; - } else { - if(_OUTPUT_VERBOSE) - outputSSLMessage(__tr2qs("The server didn't provide a certificate")); - } -} - -void KviIrcSocket::printSSLCipherInfo() -{ - KviSSLCipherInfo * ci = m_pSSL->getCurrentCipherInfo(); - if(ci) - { - //m_pConsole->socketEvent(SSLCipherInfo,(void *)ci); - KviSSLMaster::printSSLCipherInfo(m_pConsole,__tr2qs("Current transmission cipher"),ci); - delete ci; - } else { - if(_OUTPUT_VERBOSE) - outputSSLMessage(__tr2qs("Unable to determine the current cipher")); - } -} - -void KviIrcSocket::raiseSSLError() -{ - KviStr buffer; - while(m_pSSL->getLastErrorString(buffer)) - { - outputSSLError(buffer.ptr()); - } -} - -#endif - - -void KviIrcSocket::doSSLHandshake(int) -{ -#ifdef COMPILE_SSL_SUPPORT - __range_valid(m_pSSL); - - if(m_pRsn) - { - delete m_pRsn; - m_pRsn = 0; - } - if(m_pWsn) - { - delete m_pWsn; - m_pWsn = 0; - } - - if(!m_pSSL) - { - debug("Ops... I've lost the SSL class ?"); - reset(); - return; // ops ? - } - - switch(m_pSSL->connect()) - { - case KviSSL::Success: - // done! - printSSLCipherInfo(); - printSSLPeerCertificate(); - linkUp(); - break; - case KviSSL::WantRead: - m_pRsn = new QSocketNotifier((int)m_sock,QSocketNotifier::Read); - QObject::connect(m_pRsn,SIGNAL(activated(int)),this,SLOT(doSSLHandshake(int))); - m_pRsn->setEnabled(true); - break; - case KviSSL::WantWrite: - m_pWsn = new QSocketNotifier((int)m_sock,QSocketNotifier::Write); - QObject::connect(m_pWsn,SIGNAL(activated(int)),this,SLOT(doSSLHandshake(int))); - m_pWsn->setEnabled(true); - break; - case KviSSL::RemoteEndClosedConnection: - raiseError(KviError_remoteEndClosedConnection); - reset(); - break; - case KviSSL::SSLError: - raiseSSLError(); - raiseError(KviError_SSLError); - reset(); - break; - case KviSSL::SyscallError: - { - // syscall problem - int err = kvi_socket_error(); - if(!kvi_socket_recoverableError(err)) - { - // Declare problems :) - raiseError((err ? KviError::translateSystemError(err) : KviError_unknownError)); - } else { - // can recover ? (EAGAIN , EINTR ?) - m_pWsn = new QSocketNotifier((int)m_sock,QSocketNotifier::Write); - QObject::connect(m_pWsn,SIGNAL(activated(int)),this,SLOT(doSSLHandshake(int))); - m_pWsn->setEnabled(true); - return; - } - reset(); - } - break; - default: - raiseError(KviError_SSLError); - reset(); - break; - } - -#else //!COMPILE_SSL_SUPPORT - debug("Ops.. ssl handshake without ssl support!...aborting!"); - exit(-1); -#endif //!COMPILE_SSL_SUPPORT -} - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// LINK UP -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void KviIrcSocket::linkUp() -{ - setState(Connected); - - // the last check - if(m_sock == KVI_INVALID_SOCKET)return; // ops...disconnected in setState() ???? - - // ok.. it seems that we're really up and running now! - if(m_pWsn) - { - delete m_pWsn; - m_pWsn = 0; - } - - if(m_pRsn) - { - delete m_pRsn; - m_pRsn = 0; - } - - m_pRsn = new QSocketNotifier((int)m_sock,QSocketNotifier::Read); - QObject::connect(m_pRsn,SIGNAL(activated(int)),this,SLOT(readData(int))); - m_pRsn->setEnabled(true); - - // yahoo! -} - -void KviIrcSocket::readData(int) -{ - //read data - char buffer[1025]; - int readLength; -#ifdef COMPILE_SSL_SUPPORT - if(m_pSSL) - { - readLength = m_pSSL->read(buffer,1024); - if(readLength <= 0) - { - // ssl error....? - switch(m_pSSL->getProtocolError(readLength)) - { - case KviSSL::ZeroReturn: - readLength = 0; - break; - case KviSSL::WantRead: - case KviSSL::WantWrite: - // hmmm... - return; - break; - case KviSSL::SyscallError: - { - int iE = m_pSSL->getLastError(true); - if(iE != 0) - { - raiseSSLError(); - raiseError(KviError_SSLError); - reset(); - return; - } - } - break; - case KviSSL::SSLError: - raiseSSLError(); - raiseError(KviError_SSLError); - reset(); - return; - break; - default: - raiseError(KviError_SSLError); - reset(); - return; - break; - - } - handleInvalidSocketRead(readLength); - return; - } - } else { -#endif - readLength = kvi_socket_recv(m_sock,buffer,1024); - if(readLength <= 0) - { - handleInvalidSocketRead(readLength); - return; - } -#ifdef COMPILE_SSL_SUPPORT - } -#endif - - - //terminate our buffer - (*(buffer+readLength))='\0'; - - m_uReadBytes += readLength; - - // Shut up the socket notifier - // in case that we enter in a local loop somewhere - // while processing data... - m_pRsn->setEnabled(false); - // shut also the flushing of the message queue - // in this way we prevent disconnect detection - // during the processing of a message effectively - // making it always an asynchronous event. - m_bInProcessData = true; - - m_pLink->processData(buffer,readLength); - // after this line there should be nothing that relies - // on the "connected" state of this socket. - // It may happen that it has been reset() in the middle of the processData() call - // and (unverified) it might have been even deleted. - - // re-enable the socket notifier... (if it's still there) - if(m_pRsn)m_pRsn->setEnabled(true); - // and the message queue flushing - m_bInProcessData = false; - // and flush the queue too! - if(m_pSendQueueHead)flushSendQueue(); -} - -/* -void KviIrcSocket::processData(char * buffer,int) -{ - register char *p=buffer; - char *beginOfCurData = buffer; - int bufLen = 0; - char *messageBuffer = (char *)kvi_malloc(1); - - // Shut up the socket notifier - // in case that we enter in a local loop somewhere - // while processing data... - m_pRsn->setEnabled(false); - // shut also the flushing of the message queue - // in this way we prevent disconnect detection - // during the processing of a message effectively - // making it always an asynchronous event. - m_bInProcessData = true; - - while(*p) - { - if((*p == '\r' )||(*p == '\n')) - { - //found a CR or LF... - //prepare a message buffer - bufLen = p - beginOfCurData; - //check for previous unterminated data - if(m_uReadBufferLen > 0){ - __range_valid(m_pReadBuffer); - messageBuffer = (char *)kvi_realloc(messageBuffer,bufLen + m_uReadBufferLen + 1); - kvi_memmove(messageBuffer,m_pReadBuffer,m_uReadBufferLen); - kvi_memmove((void *)(messageBuffer + m_uReadBufferLen),beginOfCurData,bufLen); - *(messageBuffer + bufLen + m_uReadBufferLen) = '\0'; - m_uReadBufferLen = 0; - kvi_free(m_pReadBuffer); - m_pReadBuffer = 0; - } else { - __range_invalid(m_pReadBuffer); - messageBuffer = (char *)kvi_realloc(messageBuffer,bufLen + 1); - kvi_memmove(messageBuffer,beginOfCurData,bufLen); - *(messageBuffer + bufLen) = '\0'; - } - m_uReadPackets++; - - // FIXME: actually it can happen that the socket gets disconnected - // in a incomingMessage() call. - // The problem might be that some other parts of kvirc assume - // that the irc context still exists after a failed write to the socket - // (some parts don't even check the return value!) - // If the problem presents itself again then the solution is: - // disable queue flushing for the "incomingMessage" call - // and just call queue_insertMessage() - // then after the call terminates flush the queue (eventually detecting - // the disconnect and thus destroying the irc context). - // For now we try to rely on the remaining parts to handle correctly - // such conditions. Let's see... - - m_pConsole->incomingMessage(messageBuffer); - - if(m_state != Connected) - { - // Disconnected in KviConsole::incomingMessage() call. - // This may happen for several reasons (local event loop - // with the user hitting the disconnect button, a scripting - // handler event that disconnects explicitly) - // - // We handle it by simply returning control to readData() which - // will return immediately (and safely) control to Qt - kvi_free(messageBuffer); - m_bInProcessData = false; - return; - } - - while(*p && ((*p=='\r')||(*p=='\n')) )p++; - beginOfCurData = p; - - } else p++; - } - - //now *p == '\0' - //beginOfCurData points to '\0' if we have - //no more stuff to parse , or points to something - //different than '\r' or '\n'... - if(*beginOfCurData) - { - //Have remaining data...in the local buffer - bufLen = p - beginOfCurData; - if(m_uReadBufferLen > 0){ - //and there was more stuff saved... (really slow connection) - __range_valid(m_pReadBuffer); - m_pReadBuffer =(char *)kvi_realloc(m_pReadBuffer,m_uReadBufferLen + bufLen); - kvi_memmove((void *)(m_pReadBuffer+m_uReadBufferLen),beginOfCurData,bufLen); - m_uReadBufferLen += bufLen; - } else { - // - __range_invalid(m_pReadBuffer); - m_uReadBufferLen = bufLen; - m_pReadBuffer =(char *)kvi_malloc(m_uReadBufferLen); - kvi_memmove(m_pReadBuffer,beginOfCurData,m_uReadBufferLen); - } - //The m_pReadBuffer contains at max 1 irc message... - //that can not be longer than 510 bytes (the message is not CRLF terminated) - // FIXME: Is this limit *really* valid on all servers ? - if(m_uReadBufferLen > 510)debug("WARNING : Receiving an invalid irc message from server."); - } - kvi_free(messageBuffer); - - // re-enable the socket notifier... - m_pRsn->setEnabled(true); - // and the message queue flushing - m_bInProcessData = false; - // and flush the queue too! - if(m_pSendQueueHead)flushSendQueue(); -} -*/ - -void KviIrcSocket::abort() -{ - // flush the send queue if possible (and if not yet disconnected in fact) - if(m_state == Connected)flushSendQueue(); - if(m_state != Idle) - raiseError(KviError_operationAborted); - // and reset - reset(); -} - -//=== handleInvalidSocketRead ===============================================// -// -// Checks if the socket error is a transient error -// If it is not a transient error it resets the socket -// and fires the appropriate event. -// Otherwise it does nothing. -// -void KviIrcSocket::handleInvalidSocketRead(int readedLength) -{ - __range_valid(readedLength <= 0); - if(readedLength==0) - { - raiseError(KviError_remoteEndClosedConnection); - reset(); - } else { - //check for transmission errors - int err = kvi_socket_error(); -#ifdef COMPILE_ON_WINDOWS - if((err != EAGAIN) && (err != EINTR) && (err != WSAEWOULDBLOCK)) -#else - if((err != EAGAIN) && (err != EINTR)) -#endif - { - if(err > 0)raiseError((KviError::translateSystemError(err))); - else raiseError(KviError_remoteEndClosedConnection); - reset(); - } //else transient error...wait again... - } -} -//=== data queue functions ==================================================// -// -// queue_insertMessage : appends a KviIrcSocketMsgEntry to the tail of -// the message queue. The next_ptr for this message is set to 0. -// queue_removeMessage : removes a message from the head of the queue. -// - -void KviIrcSocket::queue_insertMessage(KviIrcSocketMsgEntry *msg_ptr) -{ - __range_valid(msg_ptr); - __range_valid(msg_ptr->data_ptr); - __range_valid(msg_ptr->data_len); - msg_ptr->next_ptr = 0; - if(m_pSendQueueHead) - { - m_pSendQueueTail->next_ptr = msg_ptr; - m_pSendQueueTail = msg_ptr; - } else { - m_pSendQueueHead = msg_ptr; - m_pSendQueueTail = msg_ptr; - } -} - -void KviIrcSocket::free_msgEntry(KviIrcSocketMsgEntry * e) -{ - if(e->pData)delete e->pData; - e->pData = 0; - kvi_free(e); -} - -bool KviIrcSocket::queue_removeMessage() -{ - __range_valid(m_pSendQueueTail); - __range_valid(m_pSendQueueHead); - if(m_pSendQueueHead->pData)delete m_pSendQueueHead->pData; - KviIrcSocketMsgEntry *aux_ptr = m_pSendQueueHead; - m_pSendQueueHead = aux_ptr->next_ptr; - kvi_free((void *)aux_ptr); - if(m_pSendQueueHead == 0) - { - m_pSendQueueTail = 0; - return false; - } else return true; -} - -void KviIrcSocket::queue_removeAllMessages() -{ - if(m_pSendQueueHead)while(queue_removeMessage()); -} - -//=== flushSendQueue ========================================================// -// -// Attempts to send as much as possible to the server -// If fails (happens only on really lagged servers) -// calls itself with a QTimer shot after KVI_OPTION_UINT(KviOption_uintSocketQueueFlushTimeout) ms -// to retry again... -// -void KviIrcSocket::flushSendQueue() -{ - // If we're called from the flush timer , stop it - if(m_pFlushTimer->isActive())m_pFlushTimer->stop(); - - // Ok...have something to send... - __range_valid(m_state != Idle); - - struct timeval curTime; - - while(m_pSendQueueHead) - { - if(KVI_OPTION_BOOL(KviOption_boolLimitOutgoingTraffic)) - { - kvi_gettimeofday(&curTime,0); - - int timeDiff = curTime.tv_usec - m_tAntiFloodLastMessageTime.tv_usec; - timeDiff += (curTime.tv_sec - m_tAntiFloodLastMessageTime.tv_sec) * 1000000; - - - if(((unsigned int)timeDiff) < KVI_OPTION_UINT(KviOption_uintOutgoingTrafficLimitUSeconds)) - { - // need to wait for a while.... - m_pFlushTimer->start(((KVI_OPTION_UINT(KviOption_uintOutgoingTrafficLimitUSeconds) - timeDiff) / 1000) + 1); - return; - } // else can send - } - // Write one data buffer... - int result; -#ifdef COMPILE_SSL_SUPPORT - if(m_pSSL) - { - result = m_pSSL->write((char *)(m_pSendQueueHead->pData->data()),m_pSendQueueHead->pData->size()); - } else { -#endif - result = kvi_socket_send(m_sock,(char *)(m_pSendQueueHead->pData->data()),m_pSendQueueHead->pData->size()); -#ifdef COMPILE_SSL_SUPPORT - } -#endif - if(result == (int)m_pSendQueueHead->pData->size()) - { - // Succesfull send...remove this data buffer - m_uSentPackets++; - m_uSentBytes += result; - //if(m_pConsole->hasMonitors())outgoingMessageNotifyMonitors((char *)(m_pSendQueueHead->pData->data()),result); - queue_removeMessage(); - if(KVI_OPTION_BOOL(KviOption_boolLimitOutgoingTraffic)) - { - m_tAntiFloodLastMessageTime.tv_sec = curTime.tv_sec; - m_tAntiFloodLastMessageTime.tv_usec = curTime.tv_usec; - } - // And try next buffer... - continue; - } else { - // Something wrong ? -#ifdef COMPILE_SSL_SUPPORT - if(result <= 0) - { - if(m_pSSL) - { - // ops...might be an SSL error - switch(m_pSSL->getProtocolError(result)) - { - case KviSSL::WantWrite: - case KviSSL::WantRead: - // Async continue... - m_pFlushTimer->start(KVI_OPTION_UINT(KviOption_uintSocketQueueFlushTimeout)); - return; - break; - case KviSSL::SyscallError: - if(result == 0) - { - raiseSSLError(); - raiseError(KviError_remoteEndClosedConnection); - reset(); - return; - } else { - int iSSLErr = m_pSSL->getLastError(true); - if(iSSLErr != 0) - { - raiseSSLError(); - raiseError(KviError_SSLError); - reset(); - return; - } else { - goto handle_system_error; - } - } - break; - case KviSSL::SSLError: - raiseSSLError(); - raiseError(KviError_SSLError); - reset(); - return; - break; - default: - raiseError(KviError_SSLError); - reset(); - return; - break; - } - } - } else { -#else //!COMPILE_SSL_SUPPORT - if(result >= 0) - { - if(result > 0) - { -#endif //!COMPILE_SSL_SUPPORT - - // Partial send...need to finish it later - m_pSendQueueHead->pData->remove(result); - - m_uSentBytes += result; - if(_OUTPUT_VERBOSE) - outputSocketWarning(__tr2qs("Partial socket write: packet broken into smaller pieces.")); -#ifndef COMPILE_SSL_SUPPORT - } -#endif //!COMPILE_SSL_SUPPORT - // Async continue... - m_pFlushTimer->start(KVI_OPTION_UINT(KviOption_uintSocketQueueFlushTimeout)); - return; - } - -handle_system_error: - // Oops...error ? - int err = kvi_socket_error(); -#ifdef COMPILE_ON_WINDOWS - if((err == EAGAIN) || (err == EINTR) || (err == WSAEWOULDBLOCK)) -#else - if((err == EAGAIN)||(err == EINTR)) -#endif - { - // Transient error...partial send as before... - if(_OUTPUT_VERBOSE) - outputSocketWarning(__tr2qs("Partial socket write: packet broken into smaller pieces.")); - // Async continue... - m_pFlushTimer->start(KVI_OPTION_UINT(KviOption_uintSocketQueueFlushTimeout)); - return; - } else { - // Disconnected... :( - raiseError((KviError::translateSystemError(err))); - reset(); - return; - } - } - } - //flushed completely ... -} - -bool KviIrcSocket::getLocalHostIp(QString &szIp,bool bIpV6) -{ - if(m_state != Connected)return false; - - if(bIpV6) - { -#ifdef COMPILE_IPV6_SUPPORT - struct sockaddr_in6 name; - int len = sizeof(name); - if(!kvi_socket_getsockname(m_sock, (struct sockaddr *)&name,&len))return false; - //I assume that getsockname returns data in Network byte order... - //The man page misses to specify that... - if(!kvi_binaryIpToStringIp_V6(name.sin6_addr,szIp))return false; - return true; -#else - return false; // no support -#endif - } - struct sockaddr_in name; - int len = sizeof(name); - if(!kvi_socket_getsockname(m_sock, (struct sockaddr *)&name,&len))return false; - //I assume that getsockname returns data in Network byte order... - //The man page misses to specify that... - if(!kvi_binaryIpToStringIp(name.sin_addr,szIp))return false; - return true; -} - - - - - - -/* -bool KviIrcSocket::sendFmtData(const char *fmt,...) -{ - if(m_state != Connected)return false; - //new buffer - KviIrcSocketMsgEntry *ptr = (KviIrcSocketMsgEntry *)kvi_malloc(sizeof(KviIrcSocketMsgEntry)); - ptr->pData = new KviDataBuffer(512); - kvi_va_list(list); - kvi_va_start(list,fmt); - bool bTruncated; - //sprintf the buffer up to 512 chars (adds a CRLF too) - int iLen = kvi_irc_vsnprintf((char *)(ptr->pData->data()),fmt,list,&bTruncated); - kvi_va_end(list); - //adjust the buffer size - if(iLen < 512)ptr->pData->resize(iLen); - if(bTruncated) - { - if(_OUTPUT_VERBOSE) - outputSocketWarning(__tr2qs("Socket message truncated to 512 bytes.")); - } - - queue_insertMessage(ptr); - if(!m_bInProcessData)flushSendQueue(); - return (m_state != Idle); -} -*/ -/* -bool KviIrcSocket::sendData(const char *buffer,int buflen) -{ - if(m_state != Connected)return false; - //new buffer - KviIrcSocketMsgEntry *ptr = (KviIrcSocketMsgEntry *)kvi_malloc(sizeof(KviIrcSocketMsgEntry)); - if(buflen < 0)buflen = strlen(buffer); - if(buflen > 510) - { - buflen = 510; - if(_OUTPUT_VERBOSE) - outputSocketWarning(__tr2qs("Socket message truncated to 512 bytes.")); - } - ptr->pData = new KviDataBuffer(buflen + 2); - kvi_memmove(ptr->pData->data(),buffer,buflen); - *(ptr->pData->data()+buflen)='\r'; - *(ptr->pData->data()+buflen+1)='\n'; - - queue_insertMessage(ptr); - if(!m_bInProcessData)flushSendQueue(); - return (m_state != Idle); -} -*/ - -bool KviIrcSocket::sendRawData(const char *buffer,int buflen) -{ - if((m_state == Idle) || (m_state == Connecting))return false; - //new buffer - KviIrcSocketMsgEntry *ptr = (KviIrcSocketMsgEntry *)kvi_malloc(sizeof(KviIrcSocketMsgEntry)); - ptr->pData = new KviDataBuffer(buflen); - kvi_memmove(ptr->pData->data(),buffer,buflen); - queue_insertMessage(ptr); - if(!m_bInProcessData)flushSendQueue(); - return (m_state != Idle); -} - -bool KviIrcSocket::sendPacket(KviDataBuffer * pData) -{ - if(m_state != Connected) - { - delete pData; - pData = 0; - return false; - } - KviIrcSocketMsgEntry *ptr = (KviIrcSocketMsgEntry *)kvi_malloc(sizeof(KviIrcSocketMsgEntry)); - ptr->pData = pData; - queue_insertMessage(ptr); - if(!m_bInProcessData)flushSendQueue(); - return (m_state != Idle); -} diff --git a/3.4.0/src/kvirc/kernel/kvi_ircsocket.h b/3.4.0/src/kvirc/kernel/kvi_ircsocket.h deleted file mode 100644 index 0b45cfedb1..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircsocket.h +++ /dev/null @@ -1,174 +0,0 @@ -#ifndef _KVI_IRCSOCKET_H_ -#define _KVI_IRCSOCKET_H_ -//========================================================================================== -// -// File : kvi_ircsocket.h -// Creation date : Tue Jul 30 19:25:17 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" -#include "kvi_sockettype.h" -#include "kvi_time.h" -#include "kvi_pointerlist.h" - -#include <qobject.h> - -class KviIrcServer; -class KviProxy; -class KviIrcConnection; -class KviIrcConnectionTarget; -class KviIrcLink; -class KviSSL; -class KviConsole; -class KviDataBuffer; - -class QTimer; -class QSocketNotifier; - -// -// This class is the lowest level of the KVIrc networking stack -// it sends and receives raw data packets from the underlying system -// socket. -// It should output only verbose "progress" messages. -// - -typedef struct _KviIrcSocketMsgEntry -{ - KviDataBuffer * pData; - struct _KviIrcSocketMsgEntry * next_ptr; -} KviIrcSocketMsgEntry; - - -class KVIRC_API KviIrcSocket : public QObject -{ - Q_OBJECT -public: - KviIrcSocket(KviIrcLink * pLink); - ~KviIrcSocket(); -public: - enum SocketState { - Idle , - Connecting , - ProxyLogin , - ProxyHttpError, - Connected , - ProxyFinalV4 , - ProxyFinalV5 , - ProxySelectAuthMethodV5 , - ProxyUserPassV5 , - ProxyFinalHttp , - SSLHandshake - }; -protected: - unsigned int m_uId; - KviIrcLink * m_pLink; - KviConsole * m_pConsole; - kvi_socket_t m_sock; - SocketState m_state; - QSocketNotifier * m_pWsn; - QSocketNotifier * m_pRsn; - KviIrcServer * m_pIrcServer; - KviProxy * m_pProxy; - QTimer * m_pTimeoutTimer; - unsigned int m_uReadBytes; - unsigned int m_uSentBytes; - int m_iLastError; - unsigned int m_uSentPackets; - KviIrcSocketMsgEntry * m_pSendQueueHead; - KviIrcSocketMsgEntry * m_pSendQueueTail; - QTimer * m_pFlushTimer; - struct timeval m_tAntiFloodLastMessageTime; - bool m_bInProcessData; -#ifdef COMPILE_SSL_SUPPORT - KviSSL * m_pSSL; -#endif -public: - int lastError(){ return m_iLastError; }; - unsigned int id(){ return m_uId; }; - KviConsole * console(){ return m_pConsole; }; - KviIrcLink * link(){ return m_pLink; }; -#ifdef COMPILE_SSL_SUPPORT - bool usingSSL(){ return m_pSSL; }; -#else - bool usingSSL(){ return false; }; -#endif - unsigned int readBytes(){ return m_uReadBytes; }; - unsigned int sentBytes(){ return m_uSentBytes; }; - //unsigned int readPackets(){ return m_uReadPackets; }; - unsigned int sentPackets(){ return m_uSentPackets; }; - SocketState state(){ return m_state; }; - bool isConnected(){ return m_state == Connected; }; - int startConnection(KviIrcServer * srv,KviProxy * prx = 0,const char * bindAddress = 0); - - //bool sendData(const char *buffer,int buflen = -1) KVI_DEPRECATED; - //bool sendFmtData(const char *fmt,...) KVI_DEPRECATED; - bool sendPacket(KviDataBuffer * pData); - void abort(); - bool getLocalHostIp(QString &szIp,bool bIpV6); -protected slots: - void connectionTimedOut(); - void writeNotifierFired(int); - void readData(int); - void readProxyData(int); - void readHttpProxyErrorData(int); - void flushSendQueue(); - void doSSLHandshake(int); -protected: -#ifdef COMPILE_SSL_SUPPORT - void raiseSSLError(); - void printSSLPeerCertificate(); - void printSSLCipherInfo(); -#endif - bool sendRawData(const char *buffer,int buflen); - void raiseError(int iError); - void connectionEstabilished(); - void connectedToProxy(); - void connectedToIrcServer(); - void proxyLoginHttp(); - void proxyLoginV4(); - void proxyLoginV5(); - void proxyAuthUserPassV5(); - void proxySendTargetDataV5(); - void proxyHandleV5AuthReply(unsigned char reply); - void proxyHandleV5MethodReply(unsigned char reply); - void proxyHandleV5FinalReply(unsigned char reply); - void proxyHandleV4FinalReply(unsigned char reply); - void proxyHandleHttpFinalReply(const char * buffer,int bufLen); - void linkUp(); - void handleInvalidSocketRead(int readedLength); - virtual void reset(); - void free_msgEntry(KviIrcSocketMsgEntry * e); - bool queue_removeMessage(); - void queue_removeAllMessages(); - virtual void queue_insertMessage(KviIrcSocketMsgEntry *msg_ptr); - virtual void setState(SocketState st); -private: - void outputSSLMessage(const QString &szMsg); - void outputSSLError(const QString &szMsg); - void outputProxyMessage(const QString &szMsg); - void outputProxyError(const QString &szMsg); - void outputSocketMessage(const QString &szMsg); - void outputSocketWarning(const QString &szMsg); - void outputSocketError(const QString &szMsg); -}; - -#endif //_KVI_IRCSOCKET_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_ircurl.cpp b/3.4.0/src/kvirc/kernel/kvi_ircurl.cpp deleted file mode 100644 index 4b7c74bbc2..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircurl.cpp +++ /dev/null @@ -1,363 +0,0 @@ -// -// File : kvi_ircurl.cpp -// Creation date : Sun Mar 04 2001 14:20:12 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_string.h" -#include "kvi_inttypes.h" -#include "kvi_qstring.h" -#include "kvi_ircserver.h" -#include "kvi_kvs_script.h" -#include "kvi_msgbox.h" -#include "kvi_channel.h" -#include "kvi_app.h" -#include "kvi_locale.h" -#include "kvi_ircconnectiontarget.h" -#include "kvi_ircconnection.h" -#include "kvi_irccontext.h" -#include "kvi_console.h" -#include "kvi_frame.h" - -#define _KVI_IRCURL_CPP_ -#include "kvi_ircurl.h" - - -bool KviIrcUrl::parse(const char * url,KviStr &cmdBuffer,int contextSpec) -{ - // irc[6]://<server>[:<port>][/<channel>[?<pass>]] - KviStr szUrl = url; - //szUrl.replaceAll("$","\\$"); - //szUrl.replaceAll(";","\\;"); - bool bIpV6 = false; - bool bSSL = false; - KviStr szServer; - kvi_u32_t uPort = 0; - bool bGotPort = false; - if(kvi_strEqualCIN(szUrl.ptr(),"irc://",6)) - { - szUrl.cutLeft(6); - } else if(kvi_strEqualCIN(szUrl.ptr(),"irc6://",7)) - { - bIpV6 = true; - szUrl.cutLeft(7); - } else if(kvi_strEqualCIN(szUrl.ptr(),"ircs://",7)) - { - bSSL = true; - szUrl.cutLeft(7); - } else if(kvi_strEqualCIN(szUrl.ptr(),"ircs6://",8)) - { - bIpV6 = true; - bSSL = true; - szUrl.cutLeft(8); - } else return false; - - KviStr szServerAndPort; - - int idx = szUrl.findFirstIdx('/'); - if(idx != -1) - { - szServerAndPort = szUrl.left(idx); - szUrl.cutLeft(idx + 1); - } else { - szServerAndPort = szUrl; - szUrl = ""; - } - - if(szServerAndPort.isEmpty())return false; - - idx = szServerAndPort.findFirstIdx(':'); - - if(idx != -1) - { - szServer = szServerAndPort.left(idx); - szServerAndPort.cutLeft(idx + 1); - bool bOk; - uPort = szServerAndPort.toUInt(&bOk); - if(!bOk)uPort = 6667; - bGotPort = true; - } else { - szServer = szServerAndPort; - } - - cmdBuffer = "server "; - switch(contextSpec) - { - case KVI_IRCURL_CONTEXT_FIRSTFREE: - cmdBuffer.append("-u "); - break; - case KVI_IRCURL_CONTEXT_NEW: - cmdBuffer.append("-n "); - break; - } - if(bIpV6)cmdBuffer.append(" -i "); - if(bSSL)cmdBuffer.append(" -s "); - - if(szUrl.hasData()) - { - KviStr szChannel; - KviStr szPass; - - idx = szUrl.findFirstIdx('?'); - if(idx != -1) - { - szChannel = szUrl.left(idx); - szUrl.cutLeft(idx + 1); - szPass = szUrl; - } else { - szChannel = szUrl; - szPass = ""; - } - - if(!(szChannel.firstCharIs('#') || szChannel.firstCharIs('!') || szChannel.firstCharIs('&'))) - szChannel.prepend('#'); - - if(szPass.isEmpty())cmdBuffer.append(KviStr::Format," -c=\"join %s\" ",szChannel.ptr()); - else cmdBuffer.append(KviStr::Format," -c=\"join %s %s\" ",szChannel.ptr(),szPass.ptr()); - - } - - cmdBuffer.append(szServer); - if(bGotPort)cmdBuffer.append(KviStr::Format," %d",uPort); - - cmdBuffer.append(';'); - - return true; -} - -void KviIrcUrl::split(QString url, KviIrcUrlParts& result) -{ - // irc[s][6]://<server>[:<port>][/<channel>[?<pass>]][[,<channel>[?<pass>]] - - //defaults - result.bSsl=false; - result.bIpV6=false; - result.iPort = 6667; - result.iError=0; - - int iProtoLen = url.find("://"); - if(iProtoLen!=-1) { - if(KviQString::equalCIN(url,"irc",3)) { - // OK, seems to be a valid proto; - url = url.right(url.length()-3); - if(KviQString::equalCIN(url,"s",1)) { - result.bSsl=true; - url = url.right(url.length()-1); - } - if(KviQString::equalCIN(url,"6",1)) { - result.bIpV6=true; - url = url.right(url.length()-1); - } - if(!KviQString::equalCIN(url,"://",3)) { - //irc(???):// proto?? - result.iError |= InvalidProtocol; - } - iProtoLen = url.find("://"); - url = url.right(url.length()-iProtoLen-3); - } else { - result.iError |= InvalidProtocol; - } - } - //Ok, we understand a protocol.. Now we shuld find a server name:) - int iTmp; - iTmp = url.find(':'); - if(iTmp!=-1) { - result.szHost = url.left(iTmp); - url = url.right(url.length()-iTmp-1); - // Accepted, now the time for the port:) - bool bOk; - if( (iTmp = url.find('/')) != -1) { // any channels pending? - result.iPort = url.left(iTmp).toUInt(&bOk); - if(!bOk) { - result.iPort = 6667; - result.iError |= InvalidPort; - } - url = url.right(url.length()-iTmp-1); - } else { - result.iPort = url.toUInt(&bOk); - if(!bOk) { - result.iPort = 6667; - result.iError |= InvalidPort; - } - url = ""; - } - } else if( (iTmp = url.find('/')) != -1) { // have channels?? - result.szHost = url.left(iTmp); - url = url.right(url.length()-iTmp-1); - } else { - result.szHost = url; - url = ""; - } - - //and, finally, channels:D - - result.chanList = QStringList::split(',',url); - -} - -void KviIrcUrl::join(QString &uri, KviIrcServer* server) -{ - if(server) - { - uri="irc"; - - if(server->useSSL()) uri.append("s"); - if(server->isIpV6()) uri.append("6"); - - uri.append("://"); - uri.append(server->hostName()); - if(server->port()!=6667) uri.append(QString(":%1").arg(server->port())); - uri.append("/"); - } -} - -void KviIrcUrl::makeJoinCmd(const QStringList& chans, QString& szJoinCommand) -{ - QString szChannels,szProtectedChannels,szPasswords,szCurPass,szCurChan; - if(chans.count()!=0) - { - - for ( QStringList::ConstIterator it = chans.begin(); it != chans.end(); ++it ) { - - szCurPass=(*it).section('?',1); - if(szCurPass.isEmpty()) - { - if(!szChannels.isEmpty()) - szChannels.append(","); - szCurChan = (*it).section('?',0,0); - if(!(szCurChan[0]=='#' || szCurChan[0]=='&' || szCurChan[0]=='!')) - szCurChan.prepend('#'); - szChannels.append(szCurChan); - } else { - if(!szProtectedChannels.isEmpty()) - szProtectedChannels.append(","); - szCurChan = (*it).section('?',0,0); - if(!(szCurChan[0]=='#' || szCurChan[0]=='&' || szCurChan[0]=='!')) - szCurChan.prepend('#'); - szProtectedChannels.append(szCurChan); - if(!szPasswords.isEmpty()) - szPasswords.append(","); - szPasswords.append(szCurPass); - } - } - szJoinCommand = "JOIN "; - szJoinCommand.append(szProtectedChannels); - if(!szProtectedChannels.isEmpty() && !szChannels.isEmpty()) - szJoinCommand.append(','); - szJoinCommand.append(szChannels); - szJoinCommand.append(" "); - szJoinCommand.append(szPasswords); - } -} - -int KviIrcUrl::run(const QString& text,int contextSpec,KviConsole* pConsole) -{ - KviIrcUrlParts parts; - KviIrcUrl::split(text,parts); - QString cmdBuffer; - - if( (contextSpec & CurrentContext) && !pConsole) { - contextSpec = FirstFreeContext; - } - - if( (contextSpec & TryCurrentContext) && !pConsole) { - contextSpec = FirstFreeContext; - } - - if(contextSpec & FirstFreeContext) { - if(pConsole) { - if(pConsole->connectionInProgress()) - { - pConsole = g_pFrame->firstNotConnectedConsole(); - if(!pConsole) { - pConsole = g_pFrame->createNewConsole(); - } - } - } else { - pConsole = g_pFrame->firstNotConnectedConsole(); - if(!pConsole) { - pConsole = g_pFrame->createNewConsole(); - } - } - } - - if(!(parts.iError & KviIrcUrl::InvalidProtocol)) { - g_pApp->addRecentUrl(text); - - QString szJoinCommand; - makeJoinCmd(parts.chanList,szJoinCommand); - QString szCommand("server "); - if(parts.bSsl) szCommand.append("-s "); - if(parts.bIpV6) szCommand.append("-i "); - if(!szJoinCommand.isEmpty()){ - szCommand.append("-c=\""); - szCommand.append(szJoinCommand); - szCommand.append("\" "); - } - szCommand.append(QString("%1 %2 ").arg(parts.szHost).arg(parts.iPort)); - - if(pConsole->connection()) { - KviIrcServer* server = pConsole->connection()->target()->server(); - if( - ( server->hostName() != parts.szHost ) || - ( server->port() != parts.iPort ) || - ( server->useSSL() != parts.bSsl ) || - ( server->isIpV6() != parts.bIpV6) ) - { // New server, try to reconnect - KviKvsScript::run(szCommand,(contextSpec & TryCurrentContext) ? g_pFrame->createNewConsole() : pConsole); - return parts.iError; - } else { - // the same server, but probably new chanlist - QString tmp; - QString toPart; - for(KviChannel * c = pConsole->connection()->channelList()->first();c;c = pConsole->connection()->channelList()->next()) - { - tmp=c->name(); - if(c->hasChannelKey()) { - tmp.append("?"); - tmp.append(c->channelKey()); - } - if(!parts.chanList.remove(tmp)) - { - toPart.append(c->name()); - toPart.append(","); - } - } - if(!(contextSpec & DoNotPartChans)) - { - makeJoinCmd(parts.chanList,szJoinCommand); - if(!toPart.isEmpty()) - { - toPart.prepend("part "); - KviKvsScript::run(toPart,pConsole); - } - } - if(!szJoinCommand.isEmpty()) - { - pConsole->connection()->sendData(pConsole->connection()->encodeText(szJoinCommand).data()); - } - return parts.iError; - } - } - // New server - KviKvsScript::run(szCommand,pConsole); - } - //!invalid proto - return parts.iError; -} diff --git a/3.4.0/src/kvirc/kernel/kvi_ircurl.h b/3.4.0/src/kvirc/kernel/kvi_ircurl.h deleted file mode 100644 index b0c568607a..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_ircurl.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef _KVI_IRCURL_H_ -#define _KVI_IRCURL_H_ - -// -// File : kvi_ircurl.h -// Creation date : Sun Mar 04 2001 14:22:55 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" -#include "kvi_inttypes.h" - -class KviIrcServer; -class KviConsole; - -#include <qstringlist.h> - -// Create /server -u <server> commands (first free context) -#define KVI_IRCURL_CONTEXT_FIRSTFREE 0 -// Create /server -n <server> commands (new irc context) -#define KVI_IRCURL_CONTEXT_NEW 1 -// Create /server <server> commands (this irc context) -#define KVI_IRCURL_CONTEXT_THIS 2 - -typedef struct _KviIrcUrlParts { - QString szHost; - kvi_u32_t iPort; - bool bIpV6; - bool bSsl; - QStringList chanList; - int iError; - } KviIrcUrlParts; - -namespace KviIrcUrl -{ - - enum KviIrcUrlParserError { - InvalidProtocol = 1, - InvalidPort = 2, - NeedNewContext = 4 - }; - - enum KviIrcUrlContextSpec { - FirstFreeContext = 1, - NewContext = 2, - CurrentContext = 4, - TryCurrentContext = 8, - - DoNotPartChans = 16 - }; - - extern KVIRC_API bool parse(const char * url,KviStr &cmdBuffer,int contextSpec = KVI_IRCURL_CONTEXT_FIRSTFREE); - - extern KVIRC_API int run(const QString& url,int contextSpec = FirstFreeContext,KviConsole* pConsole = 0); - - extern KVIRC_API void split(QString url, KviIrcUrlParts& parts); - extern KVIRC_API void join(QString &url, KviIrcServer* server); - extern KVIRC_API void makeJoinCmd(const QStringList& chans, QString& szJoinCommand); -} - -#endif // _KVI_IRCURL_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_lagmeter.cpp b/3.4.0/src/kvirc/kernel/kvi_lagmeter.cpp deleted file mode 100644 index a621cfceb7..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_lagmeter.cpp +++ /dev/null @@ -1,266 +0,0 @@ -//============================================================================= -// -// File : kvi_lagmeter.cpp -// Creation date : Fri Oct 18 13:31:36 CEST 2002 by Juanjo �varez -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_lagmeter.h" -#include "kvi_options.h" -#include "kvi_kvs_eventtriggers.h" -#include "kvi_parameterlist.h" -#include "kvi_ircconnection.h" -#include "kvi_irccontext.h" -#include "kvi_frame.h" -#include "kvi_console.h" -#include "kvi_time.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_ircconnectionserverinfo.h" -#include "kvi_out.h" -#include "kvi_locale.h" - -KviLagMeter::KviLagMeter(KviIrcConnection * c) -: QObject() -{ - m_pConnection = c; - m_pCheckList = new KviPointerList<KviLagCheck>; - m_pCheckList->setAutoDelete(true); - m_uLag = 0; - m_uLastEmittedLag = 0; - m_uLastReliability = 0; - m_tLastCompleted = 0; - m_tLastOwnCheck = 0; - m_tFirstOwnCheck = 0; - m_bOnAlarm = false; - m_pDeletionSignal = 0; - - // FIXME: We could use the KviIrcConnection::heartbeat() here! - if(KVI_OPTION_UINT(KviOption_uintLagMeterHeartbeat) < 2000) - KVI_OPTION_UINT(KviOption_uintLagMeterHeartbeat) = 2000; // kinda absurd - - if(KVI_OPTION_UINT(KviOption_uintLagMeterHeartbeat) > 10000) - KVI_OPTION_UINT(KviOption_uintLagMeterHeartbeat) = 10000; // kinda absurd - - startTimer(KVI_OPTION_UINT(KviOption_uintLagMeterHeartbeat)); // 5 seconds by default -} - -KviLagMeter::~KviLagMeter() -{ - if(m_pDeletionSignal)*m_pDeletionSignal = true; -#ifndef COMPILE_USE_QT4 - killTimers(); -#endif - delete m_pCheckList; -} - -unsigned int KviLagMeter::secondsSinceLastCompleted() -{ - struct timeval tv; - kvi_gettimeofday(&tv,0); - return tv.tv_sec - m_tLastCompleted; -} - -void KviLagMeter::timerEvent(QTimerEvent *) -{ - if(m_pConnection->state() != KviIrcConnection::Connected)return; // do nothing atm - - // If the lag has changed emit our signals - if((m_uLag / 10) != (m_uLastEmittedLag / 10)) - { - m_uLastEmittedLag = m_uLag; - g_pFrame->childConnectionLagChange(m_pConnection); - - KviStr szLag(KviStr::Format,"%u",m_uLag); - - bool bDeletionSignal = false; - m_pDeletionSignal = &bDeletionSignal; - - if((!m_bOnAlarm) && (m_uLag > KVI_OPTION_UINT(KviOption_uintLagAlarmTime))) - { - KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnLagAlarmTimeUp, - m_pConnection->console(),m_pConnection->serverInfo()->name(),QString(szLag.ptr())); - if(bDeletionSignal)return; // killed , probably by a quit -f -u - m_bOnAlarm = true; - } else if(m_bOnAlarm) - { - KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnLagAlarmTimeDown, - m_pConnection->console(),m_pConnection->serverInfo()->name(),QString(szLag.ptr())); - if(bDeletionSignal)return; // killed , probably by a quit -f -u - m_bOnAlarm = false; - } - - KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnLagCheck, - m_pConnection->console(),m_pConnection->serverInfo()->name(),QString(szLag.ptr())); - if(bDeletionSignal)return; // killed , probably by a quit -f -u - - m_pDeletionSignal = 0; - } - - // get current time - struct timeval tv; - kvi_gettimeofday(&tv,0); - unsigned int uDiff = tv.tv_sec - m_tLastCompleted; - unsigned int uHeartbeat = KVI_OPTION_UINT(KviOption_uintLagMeterHeartbeat) / 1000; - if(uHeartbeat < 2)uHeartbeat = 2; - // we keep the last lag value for an amount of time - // depending on its reliability. - // Since reliability ranges from 10 to 100 we keep the lags - // for (hrtbt * 4) + (reliability / 2) seconds (which means from 25 to 70 seconds by default) - if(uDiff <= ((uHeartbeat * 4) + (m_uLastReliability / 2)))return; // nothing to do, the actual value is accurate - - // the last completed check has been completed a lot of time ago - // do we have some checks on the queue ? - if(m_pCheckList->count() > 0) - { - // if the first registered check is not too outdated - // we wait a little more for it to return - KviLagCheck * c = m_pCheckList->first(); - if(c) - { - if((tv.tv_sec - c->lSecs) <= 10)return; - } - // the first check was registered more than 10 secs before - if(m_tLastOwnCheck > 0) - { - // hm.. we have already sent our own (reliable) check after the last completed - // make the lag grow (we're pretty sure it's growing) - uDiff = (tv.tv_sec - m_tFirstOwnCheck) * 1000; - if(m_uLag < uDiff)m_uLag = uDiff; // the lag grows for sure - uDiff = tv.tv_sec - m_tLastOwnCheck; - if(uDiff < (uHeartbeat * 4))return; // wait a bit...send own checks only every 20 secs (by default) at this point - } - } - // or we have no checks in the queue at all - // or it's really time to do something... - if(m_tFirstOwnCheck == 0) - { - if(_OUTPUT_PARANOIC) - m_pConnection->console()->output(KVI_OUT_VERBOSE,__tr2qs("Sending out PING based lag probe")); - - // this is the first our own lag check since the last succesfull one: use the ping - lagCheckRegister("@ping@",70); // the ping may be fooled easily - m_pConnection->sendFmtData("PING %s %s", - m_pConnection->encodeText( m_pConnection->userInfo()->nickName() ).data(), - m_pConnection->encodeText( m_pConnection->serverInfo()->name() ).data() ); - m_tFirstOwnCheck = tv.tv_sec; - } else { - if(_OUTPUT_PARANOIC) - m_pConnection->console()->output(KVI_OUT_VERBOSE,__tr2qs("Sending out CTCP based lag probe")); - - // we have already sent a ping but we got no reply - // try with another method... even if this will reset our idle time - KviStr tmp(KviStr::Format,"%d%d-yeah-:)",tv.tv_sec,tv.tv_usec); - lagCheckRegister(tmp.ptr(),100); // almost impossible to fool - m_pConnection->sendFmtData("NOTICE %s :%cLAGCHECK %s%c", - m_pConnection->encodeText( m_pConnection->userInfo()->nickName() ).data(), - 0x01, - tmp.ptr(), - 0x01); - } - m_tLastOwnCheck = tv.tv_sec; -} - -void KviLagMeter::lagCheckRegister(const char * key,unsigned int uReliability) -{ - if(uReliability < 10)return; // what the heck of a lag check is this ? - // store the lagcheck structure and just return - - if(_OUTPUT_PARANOIC) - m_pConnection->console()->output(KVI_OUT_VERBOSE,__tr2qs("Registered lag check with reliability %u (%s)"),uReliability,key); - - KviLagCheck * c = new KviLagCheck; - c->szKey = key; - struct timeval tv; - kvi_gettimeofday(&tv,0); - c->lSecs = tv.tv_sec; - c->lUSecs = tv.tv_usec; - c->uReliability = uReliability <= 100 ? uReliability : 100; - m_pCheckList->append(c); - while(m_pCheckList->count() > 30) - { - // we're fried :/ - // either our ping mechanism is not working - // or the server is stoned... - m_pCheckList->removeFirst(); - } -} - -bool KviLagMeter::lagCheckComplete(const char * key) -{ - // find this lag check - KviLagCheck * c; - for(c = m_pCheckList->first();c;c = m_pCheckList->next()) - { - if(kvi_strEqualCS(c->szKey.ptr(),key))break; - } - if(!c)return false; // not found - // kill any earlier lag checks (IRC is a sequential proto) - while(m_pCheckList->first() != c)m_pCheckList->removeFirst(); - - if(_OUTPUT_PARANOIC) - m_pConnection->console()->output(KVI_OUT_VERBOSE,__tr2qs("Lag check completed (%s)"),key); - - struct timeval tv; - kvi_gettimeofday(&tv,0); - - unsigned int uLag = ((tv.tv_sec - c->lSecs) * 1000); - if(tv.tv_usec < c->lUSecs)uLag -= ((c->lUSecs - tv.tv_usec) / 1000); - else uLag += ((tv.tv_usec - c->lUSecs) / 1000); - - // now check the reliability - - if(m_uLastReliability > c->uReliability) - { - // the actual data is more reliable than the new one :/ - // change the real lag only by a certain amount - // c->uRel : 100 = uLag : m_uLag - m_uLag = ((uLag * c->uReliability) + (m_uLag * m_uLastReliability)) / (c->uReliability + m_uLastReliability); - } else { - // the actual data is less reliable than the new one - m_uLag = uLag; - } - - m_tLastCompleted = tv.tv_sec; // now - m_tLastOwnCheck = 0; - m_tFirstOwnCheck = 0; - m_uLastReliability = c->uReliability; - - m_pCheckList->removeFirst(); - - return true; -} - -void KviLagMeter::lagCheckAbort(const char * key) -{ - KviPointerList<KviLagCheck> l; - l.setAutoDelete(false); - KviLagCheck * c; - - if(_OUTPUT_PARANOIC) - m_pConnection->console()->output(KVI_OUT_VERBOSE,__tr2qs("Lag check aborted (%s)"),key); - - for(c = m_pCheckList->first();c;c = m_pCheckList->next()) - if(kvi_strEqualCS(c->szKey.ptr(),key))l.append(c); - for(c = l.first();c;c = l.next())m_pCheckList->removeRef(c); -} - -#include "kvi_lagmeter.moc" diff --git a/3.4.0/src/kvirc/kernel/kvi_lagmeter.h b/3.4.0/src/kvirc/kernel/kvi_lagmeter.h deleted file mode 100644 index 77adc533bc..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_lagmeter.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef _KVI_LAGMETER_H_ -#define _KVI_LAGMETER_H_ -//============================================================================= -// -// File : kvi_lagmeter.h -// Creation date : Fri Oct 18 13:30:26 CEST 2002 by Juanjo Álvarez -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" -#include "kvi_pointerlist.h" - -#include <qobject.h> - -class KviIrcConnection; - -class KviLagCheck -{ -public: - KviStr szKey; - long lSecs; // since epoch - long lUSecs; - unsigned int uReliability; // [0-100] -}; - -class KVIRC_API KviLagMeter : public QObject -{ - Q_OBJECT - friend class KviIrcConnection; -protected: - KviLagMeter(KviIrcConnection * c); - ~KviLagMeter(); -protected: - KviIrcConnection * m_pConnection; - unsigned int m_uLag; // last computed lag - unsigned int m_uLastEmittedLag; // last emitted lag - long m_tLastCompleted; // time when the last lag was completed (gettimeofday!) - unsigned int m_uLastReliability; // how much reliable was the last completed check ? - KviPointerList<KviLagCheck> * m_pCheckList; - long m_tFirstOwnCheck; // time when the first ping after a completed check was sent - long m_tLastOwnCheck; // time when the last ping was sent - bool m_bOnAlarm; - bool * m_pDeletionSignal; // we use this to signal our own delete -public: - // lag checks should be done only against the user's server - // please make SURE that the key is unique! - void lagCheckRegister(const char * key,unsigned int uReliability = 50); - bool lagCheckComplete(const char * key); - void lagCheckAbort(const char * key); - unsigned int lag(){ return m_uLag; }; - unsigned int secondsSinceLastCompleted(); -protected: - virtual void timerEvent(QTimerEvent * e); -}; - -#endif // _KVI_LAGMETER_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_main.cpp b/3.4.0/src/kvirc/kernel/kvi_main.cpp deleted file mode 100644 index f480d16286..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_main.cpp +++ /dev/null @@ -1,412 +0,0 @@ -//============================================================================= -// -// File : kvi_main.cpp -// Creation date : Sun Jun 18 2000 12:38:45 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_app.h" -#include "kvi_string.h" -#include "kvi_settings.h" -#include "kvi_ircurl.h" -#include "kvi_defaults.h" -#include "kvi_sourcesdate.h" -#include "kvi_msgbox.h" - -#ifndef COMPILE_NO_IPC - extern bool kvi_sendIpcMessage(const char * message); // kvi_ipc.cpp -#endif - -#include <qglobal.h> //for debug() - -#include <qmessagebox.h> - -#define KVI_ARGS_RETCODE_OK 0 -#define KVI_ARGS_RETCODE_ERROR 1 -#define KVI_ARGS_RETCODE_STOP 2 - -typedef struct _ParseArgs -{ - int argc; - char ** argv; - char * configFile; - bool createFile; - bool bForceNewSession; - bool bShowPopup; - bool bShowSplashScreen; - bool bExecuteCommandAndClose; - KviStr szExecCommand; - KviStr szExecRemoteCommand; -} ParseArgs; - -int parseArgs(ParseArgs * a) -{ - KviStr szServer; - KviStr szPort; - int idx; - - if(a->argc < 2)return KVI_ARGS_RETCODE_OK; - - for(idx = 1;idx < a->argc;idx++) - { - QString szMessage; - char * p = a->argv[idx]; - - if((kvi_strLen(p) > 3) && (*p == '-') && (*(p+1) == '-'))p++; - - if(kvi_strEqualCI("-v",p) || kvi_strEqualCI("-version",p)) - { - KviQString::appendFormatted(szMessage,"KVIrc %s '%s'\n",KVI_VERSION,KVI_RELEASE_NAME); - KviQString::appendFormatted(szMessage,"Sources date: %s\n",KVI_SOURCES_DATE); - KviQString::appendFormatted(szMessage,"Build date: %s\n",KVI_BUILD_DATE); - KviQString::appendFormatted(szMessage,"Home page: http://www.kvirc.net/\n"); - -#ifdef COMPILE_ON_WINDOWS - MessageBox(0,szMessage.local8Bit().data(),"KVIrc",0); -#else - debug(szMessage); -#endif - - return KVI_ARGS_RETCODE_STOP; - } - - if(kvi_strEqualCI("-h",p) || kvi_strEqualCI("-help",p)) - { - KviQString::appendFormatted(szMessage,"Usage:\n"); - KviQString::appendFormatted(szMessage," %s [options] [server [port]] [ircurl [ircurl [...]]]\n",a->argv[0]); - KviQString::appendFormatted(szMessage," \n"); - KviQString::appendFormatted(szMessage,"Available options:\n"); - KviQString::appendFormatted(szMessage," -h, --help : Print this help and exit\n"); - KviQString::appendFormatted(szMessage," -v, --version: Print version information and exit\n"); - KviQString::appendFormatted(szMessage," -c <file> : Use <file> as config file instead of ~/%s\n",KVI_HOME_CONFIG_FILE_NAME); - KviQString::appendFormatted(szMessage," (defaults to $HOME/%s if <file> does not exist)\n",KVI_HOME_CONFIG_FILE_NAME); - KviQString::appendFormatted(szMessage," -n <file> : Use <file> as config file instead of $HOME/%s\n",KVI_HOME_CONFIG_FILE_NAME); - KviQString::appendFormatted(szMessage," (create <file> if it does not exist)\n"); -#ifdef COMPILE_NO_IPC - KviQString::appendFormatted(szMessage," -f : Accepted but ignored (for compatibility)\n"); -#else - KviQString::appendFormatted(szMessage," -f : Force a new KVIrc session, even if there is already\n"); - KviQString::appendFormatted(szMessage," a running one.\n"); -#endif - KviQString::appendFormatted(szMessage," -e <commands>: If a KVIrc session is already running, execute\n"); - KviQString::appendFormatted(szMessage," the <commands> in that session, otherwise start up\n"); - KviQString::appendFormatted(szMessage," normally and execute <commands>\n"); - KviQString::appendFormatted(szMessage," <commands> must be a single shell token.\n"); - KviQString::appendFormatted(szMessage," You can eventually use this switch more than once\n"); - KviQString::appendFormatted(szMessage," -x <commands>: If a KVIrc session is already running, execute\n"); - KviQString::appendFormatted(szMessage," the <commands> in that session, otherwise exit from application without doing anything/\n"); - KviQString::appendFormatted(szMessage," <commands> must be a single shell token.\n"); - KviQString::appendFormatted(szMessage," You can eventually use this switch more than once\n"); - KviQString::appendFormatted(szMessage," -r <commands>: If a KVIrc session is already running, execute the <commands>\n"); - KviQString::appendFormatted(szMessage," in that session, otherwise start up normally (do not execute).\n"); - KviQString::appendFormatted(szMessage," <commands> must be a single shell token.\n"); - KviQString::appendFormatted(szMessage," You can eventually use this switch more than once\n"); - KviQString::appendFormatted(szMessage," -m : If a KVIrc session is already running, show an informational\n"); - KviQString::appendFormatted(szMessage," popup dialog instead of writing to the console"); - KviQString::appendFormatted(szMessage," --nosplash : Do not show the splash screen at startup\n"); - KviQString::appendFormatted(szMessage," [server] : Connect to this server after startup\n"); - KviQString::appendFormatted(szMessage," [port] : Use this port for connection\n"); - KviQString::appendFormatted(szMessage," [ircurl] : URL in the following form:\n"); - KviQString::appendFormatted(szMessage," irc[6]://<server>[:<port>][/<channel>[?<pass>]]\n"); - -#ifdef COMPILE_ON_WINDOWS - MessageBox(0,szMessage.local8Bit().data(),"KVIrc",0); -#else - debug(szMessage); -#endif - return KVI_ARGS_RETCODE_STOP; - } - - if(kvi_strEqualCI("-c",p)) - { - idx++; - if(idx >= a->argc) - { - debug("Option -c requires a config file name"); - return KVI_ARGS_RETCODE_ERROR; - } - p = a->argv[idx]; - a->configFile = p; - debug("Using file %s as config",p); - continue; - } - - if(kvi_strEqualCI("-e",p)) - { - idx++; - if(idx >= a->argc) - { - debug("Option -e requires a command"); - return KVI_ARGS_RETCODE_ERROR; - } - p = a->argv[idx]; - if(a->szExecCommand.hasData())a->szExecCommand.append("\n"); - a->szExecCommand.append(p); - continue; - } - - if(kvi_strEqualCI("-x",p)) - { - idx++; - if(idx >= a->argc) - { - debug("Option -x requires a command"); - return KVI_ARGS_RETCODE_ERROR; - } - p = a->argv[idx]; - if(a->szExecCommand.hasData())a->szExecCommand.append("\n"); - a->szExecCommand.append(p); - a->bExecuteCommandAndClose=true; - continue; - } - - if(kvi_strEqualCI("-r",p)) - { - idx++; - if(idx >= a->argc) - { - debug("Option -r requires a command"); - return KVI_ARGS_RETCODE_ERROR; - } - p = a->argv[idx]; - if(a->szExecRemoteCommand.hasData())a->szExecRemoteCommand.append("\n"); - a->szExecRemoteCommand.append(p); - continue; - } - - if(kvi_strEqualCI("-m",p)) - { - a->bShowPopup = true; - continue; - } - - if(kvi_strEqualCI("-n",p)) - { - idx++; - if(idx >= a->argc) - { - debug("Option -n requires a config file name"); - return KVI_ARGS_RETCODE_ERROR; - } - p = a->argv[idx]; - a->configFile = p; - a->createFile=true; - debug("Using file %s as config",p); - continue; - } - - if(kvi_strEqualCI("-nosplash",p)) - { - a->bShowSplashScreen = false; - continue; - } - - if(kvi_strEqualCI("-f",p)) - { - a->bForceNewSession = true; - continue; - } - - if(kvi_strEqualCI("-session",p)||kvi_strEqualCI("-display",p)) - { - // Qt apps are supposed to handle the params to these switches, but we'll skip arg for now - idx++; - continue; - } - - if(*p != '-') - { - // no dash - if(kvi_strEqualCIN(p,"irc://",6) || kvi_strEqualCIN(p,"irc6://",7) || kvi_strEqualCIN(p,"ircs://",7) || kvi_strEqualCIN(p,"ircs6://",8)) - { - KviStr tmp = QString::fromLocal8Bit(p); - if(a->szExecCommand.hasData())a->szExecCommand.append('\n'); - a->szExecCommand.append("openurl "); - tmp.replaceAll("$",""); // the urls can't contain $ signs - tmp.replaceAll(";",""); // the urls can't contain ; signs - a->szExecCommand.append(tmp); - } else { - QString tmp = QString::fromLocal8Bit(p); - bool bOk; - tmp.toUInt(&bOk); - if(bOk)szPort = tmp; - else { - QString ri = tmp.right(4); - if(KviQString::equalCI(ri,".kvs")) - { - if(a->szExecCommand.hasData())a->szExecCommand.append('\n'); - a->szExecCommand.append("parse \""); - tmp.replace('$',"\\$"); - tmp.replace('\\',"\\\\"); - a->szExecCommand.append(tmp); - a->szExecCommand.append('"'); - } else if(KviQString::equalCI(ri,".kvt")) - { - if(a->szExecCommand.hasData())a->szExecCommand.append('\n'); - a->szExecCommand.append("theme.install \""); - tmp.replace('$',"\\$"); - tmp.replace('\\',"\\\\"); - a->szExecCommand.append(tmp); - a->szExecCommand.append('"'); - } else - szServer = tmp; // assume a plain server name - } - } - } - } - - if(szServer.hasData()) - { - if(a->szExecCommand.hasData())a->szExecCommand.append('\n'); - a->szExecCommand.append("server -u "); - a->szExecCommand.append(szServer); - if(szPort.hasData()) - { - a->szExecCommand.append(' '); - a->szExecCommand.append(szPort); - } - } - - return KVI_ARGS_RETCODE_OK; -} - -#if defined(Q_OS_MACX) && (__GNUC__ == 3 && __GNUC_MINOR__ == 3) -// Repair broken colour definitions due to "lazy" static object initialization -void repair_colors(void) -{ - if(Qt::white.red() == 0) - { - Qt::color0 = (qRgb(255,255,255 ),0); - Qt::color1 = (qRgb(0,0,0),1); - Qt::black.setRgb(0,0,0); - Qt::white.setRgb(255,255,255); - Qt::darkGray.setRgb(128,128,128); - Qt::gray.setRgb(160,160,164); - Qt::lightGray.setRgb(192,192,192); - Qt::red.setRgb(255,0,0); - Qt::green.setRgb(0,255,0); - Qt::blue.setRgb(0,0,255); - Qt::cyan.setRgb(0,255,255); - Qt::magenta.setRgb(255,0,255); - Qt::yellow.setRgb(255,255,0); - Qt::darkRed.setRgb(128,0,0); - Qt::darkGreen.setRgb(0,128,0); - Qt::darkBlue.setRgb(0,0,128); - Qt::darkCyan.setRgb(0,128,128); - Qt::darkMagenta.setRgb(128,0,128); - Qt::darkYellow.setRgb(128,128,0); - } -} -#endif //Q_OS_MACX - -int main(int argc,char ** argv) -{ - -#if defined(Q_OS_MACX) && (__GNUC__ == 3 && __GNUC_MINOR__ == 3) - repair_colors(); -#endif //Q_OS_MACX - - ParseArgs a; - a.argc = argc; - a.argv = argv; - a.configFile = 0; - a.createFile = false; - a.bForceNewSession = false; - a.bShowPopup = false, - a.bShowSplashScreen = true; - a.bExecuteCommandAndClose = false; - - int retCode = parseArgs(&a); - - if(retCode != KVI_ARGS_RETCODE_OK)return ((retCode == KVI_ARGS_RETCODE_ERROR) ? (-1) : 0); - - // Need to have the X socket open before IPC startup - KviApp * theApp = new KviApp(argc,argv); - - KviStr szRemoteCommand = a.szExecCommand; - if(a.szExecRemoteCommand.hasData()) - { - if(szRemoteCommand.hasData())szRemoteCommand.append('\n'); - szRemoteCommand.append(a.szExecRemoteCommand); - } - - /* - FIXME: There is a race condition in the IPC mechanism. - If one starts two instances of kvirc one immediately after another - then both instances may run through kvi_sendIpcMessage - without finding the sentinel window and thus both may decide - to start. - A weak file locking mechanism should be used too... - -#ifdef COMPILE_ON_WINDOWS - QString szLock = convertSeparators(cleanDirPath(QDir::homeDirPath() + "/.kvirc.lock")); -#else - QString szLock = convertSeparators(cleanDirPath(QDir::homeDirPath() + "/.kvirc.lock")); -#endif - - QFileInfo inf(szLock); - bool bLocked = false; - if(inf.exists()) - { - iLocked = inf.lastModified().secsTo(QDateTime::currentDateTime()); - } - */ - -#ifndef COMPILE_NO_IPC - if(!a.bForceNewSession) - { - // here we could use CreateMutex on win and semget() on linux - // in order to get a shared semaphore to ensure instance unicity. - - if(kvi_sendIpcMessage(szRemoteCommand.ptr())) - { - if(szRemoteCommand.isEmpty()) - { - KviStr tmp(KviStr::Format,"Another KVIrc session is already running on this display and with this user id.\nUse %s -f if you want to force a new session.",argv[0]); - if(a.bShowPopup) - QMessageBox::information(0,"Session - KVIrc",tmp.ptr(),QMessageBox::Ok); - else - debug(tmp.ptr()); - } - delete theApp; - return 0; - } else if(a.bExecuteCommandAndClose) { - delete theApp; - return 0; - } - } -#endif - - theApp->m_bCreateConfig = a.createFile; - theApp->m_szConfigFile = a.configFile; - theApp->m_szExecAfterStartup = a.szExecCommand; - theApp->m_bShowSplashScreen = a.bShowSplashScreen; - theApp->setup(); - - // YEAH! - int retVal = theApp->exec(); - // :) - - delete theApp; - theApp = 0; - return retVal; -} diff --git a/3.4.0/src/kvirc/kernel/kvi_notifylist.cpp b/3.4.0/src/kvirc/kernel/kvi_notifylist.cpp deleted file mode 100644 index c18a039736..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_notifylist.cpp +++ /dev/null @@ -1,1277 +0,0 @@ -//============================================================================= -// -// File : kvi_notifylist.cpp -// Creation date : Fri Oct 27 2000 23:41:01 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - - -#include "kvi_debug.h" -#include "kvi_notifylist.h" -#include "kvi_console.h" -#include "kvi_ircsocket.h" -#include "kvi_regusersdb.h" -#include "kvi_userlistview.h" -#include "kvi_channel.h" -#include "kvi_options.h" -#include "kvi_window.h" -#include "kvi_locale.h" -#include "kvi_out.h" -#include "kvi_sparser.h" -#include "kvi_ircmask.h" -#include "kvi_numeric.h" -#include "kvi_parameterlist.h" -#include "kvi_ircconnection.h" -#include "kvi_app.h" -#include "kvi_qstring.h" -#include "kvi_lagmeter.h" -#include "kvi_kvs_eventtriggers.h" -#include "kvi_qcstring.h" - -#include <qstringlist.h> - -// FIXME: #warning "Finish this doc!" - -/* - @doc: notify_list - @title: - Notify lists - @short: - Tracking users on IRC - @keyterms: - notify property, watch property, notify lists - @body: - The notify list is a means of keeping track of users on IRC.[br] - Once connected to an IRC server, you can tell KVIrc to check - periodically if your friends are online.[br] - This is basically achieved by setting a property in the [doc:registered_users]registered users database[/doc] - entry.[br] - The property is called "notify", and you have to set it to the nickname - that you want to look for.[br] - So for example, assume to register a frend of yours like Szymon:[br] - [example] - [cmd:reguser.add]reguser.add[/cmd] Szymon - [cmd:reguser.addmask]reguser.addmask[/cmd] Szymon Pragma!*@*.it - [/example] - And then want it in the notify list; nothing easier, just set - hist "notify" property to the nickname that you want him to be "looked for":[br] - [example] - [cmd:reguser.setproperty]reguser.setproperty[/cmd] Szymon notify Pragma - [/example] - In this way, once in a while, KVIrc will send to the server an ISON message - with the nickname Pragma. If Szymon is online, you will be notified with a message:[br] - "Pragma [someuser@somehost.it] is on IRC".[br] - If Szymon uses often "[Pragma]" as his secondary nickname , you can do the following:[br] - [example] - [cmd:reguser.addmask]reguser.addmask[/cmd] Szymon [Pragma]*@*.it - [cmd:reguser.setproperty]reguser.setproperty[/cmd] Szymon notify "Pragma [Pragma]" - [/example] - KVIrc will then look for both nicknames getting online.[br] - KVIrc supports three notify lists management methods:[br] - The "stupid ISON method", the "intelligent ISON method" and the "WATCH method".[br] - The "stupid ISON method" will assume that Szymon is online if any user with nickname - Pragma (or [Pragma] in the second example) gets online; this means that also Pragma!someuser@somehost.com will be - assumed to be "Szymon" and will be shown in the notify list.[br] - This might be a false assumption (since somehod.com does not even match *.it), - but it is the best result that the "stupid ISON method" can achieve.[br] - The "intelligent ISON method" will also check the Pragma's username and hostname - and match it in the registered masks; so in the example above, you will be notified if - any user that matches Pragma!*@*.it gets online; (but you will NOT be notified if - (for example) Pragma!someuser@somehost.com gets online).[br] - So what's the point in including a stupid method? :) Well...the intelligent - method "eats" some of your IRC bandwidth; it has to send USERHOST messages - for every group of 5 users in the notify list. If you have a lot of users - in the notify list, it might become slow and eventually cause a - client to server flood.[br] - So finally, the intelligent method is the default. If you have "flood" problems, - or if you think that the notify list is quite slow , try the "stupid" method: - it is not that bad after all.[br] - The third notify list management method is the "WATCH method".[br] - It uses a totally different (and better) approach to the notify lists management, - and can be used only on the networks that support the WATCH notify method (DALnet, WebNet, etc.).[br] - KVIrc will attempt to guess if the server you're currently using supports the WATCH command - and eventually use this last method.[br] - The WATCH method uses the "notify" property to get the nicknames that have to be - sent to the server in the /WATCH commands. -*/ - -// Basic NotifyListManager: this does completely nothing - -KviNotifyListManager::KviNotifyListManager(KviIrcConnection * pConnection) -: QObject(0,"notify_list_manager") -{ - m_pConnection = pConnection; - m_pConsole = pConnection->console(); -} - -KviNotifyListManager::~KviNotifyListManager() -{ -} - -void KviNotifyListManager::start() -{ -} - -void KviNotifyListManager::stop() -{ -} - -bool KviNotifyListManager::handleUserhost(KviIrcMessage *) -{ - return false; -} - -bool KviNotifyListManager::handleIsOn(KviIrcMessage *) -{ - return false; -} - -bool KviNotifyListManager::handleWatchReply(KviIrcMessage *) -{ - return false; -} - -void KviNotifyListManager::notifyOnLine(const QString &nick,const QString &user,const QString &host,const QString &szReason,bool bJoin) -{ - if(bJoin) - m_pConsole->notifyListView()->join(nick,user,host); - - KviWindow * out = KVI_OPTION_BOOL(KviOption_boolNotifyListChangesToActiveWindow) ? m_pConsole->activeWindow() : m_pConsole; - if(KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnNotifyOnLine,out,nick))return; - - QString szWho; - QString szMsg; - - if(!(user.isEmpty() || host.isEmpty())) - KviQString::sprintf(szWho,"\r!n\r%Q\r [%Q@\r!h\r%Q\r]",&nick,&user,&host); - else - KviQString::sprintf(szWho,"\r!n\r%Q\r",&nick); - - KviPointerHashTable<QString,KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict(); - KviPointerHashTableIterator<QString,KviRegisteredUser> it(*d); - QString szNotify; - - while(KviRegisteredUser * u = it.current()) - { - if(QStringList::split(",",u->getProperty("notify")).findIndex(nick)!=-1) - { - QString szComment=u->getProperty("comment"); - if(!szComment.isEmpty()) - KviQString::sprintf(szMsg,"%Q (%Q), Group \"%Q\" is on IRC as (%Q)",&(u->name()),&szComment,&(u->group()),&szWho); - else - KviQString::sprintf(szMsg,"%Q, Group \"%Q\" is on IRC as (%Q)",&(u->name()),&(u->group()),&szWho); - break; - } - ++it; - } - QString szFmt = __tr2qs("%Q is on IRC"); - - if(szMsg.isEmpty()) - KviQString::sprintf(szMsg,szFmt,&szWho); - - if((!szReason.isEmpty()) && (_OUTPUT_VERBOSE)) - { - szMsg += "("; - szMsg += szReason; - szMsg += ")"; - } - - out->outputNoFmt(KVI_OUT_NOTIFYONLINE,szMsg); - - if(!(out->hasAttention())) - { - if(KVI_OPTION_BOOL(KviOption_boolFlashWindowOnNotifyOnLine)) - out->demandAttention(); - if(KVI_OPTION_BOOL(KviOption_boolPopupNotifierOnNotifyOnLine)) - { - szWho = "<b>"; - szWho += nick; - szWho += "</b>"; - KviQString::sprintf(szMsg,szFmt,&szWho); - g_pApp->notifierMessage(0,KVI_OPTION_MSGTYPE(KVI_OUT_NOTIFYONLINE).pixId(),szMsg,15); - } - } -} - -void KviNotifyListManager::notifyOffLine(const QString &nick,const QString &user,const QString &host,const QString &szReason) -{ - KviWindow * out = KVI_OPTION_BOOL(KviOption_boolNotifyListChangesToActiveWindow) ? m_pConsole->activeWindow() : m_pConsole; - if(!KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnNotifyOffLine,out,nick)) - { - QString szWho; - - if(!(user.isEmpty() || host.isEmpty())) - KviQString::sprintf(szWho,"\r!n\r%Q\r [%Q@\r!h\r%Q\r]",&nick,&user,&host); - else - KviQString::sprintf(szWho,"\r!n\r%Q\r",&nick); - - QString szMsg; - - KviPointerHashTable<QString,KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict(); - KviPointerHashTableIterator<QString,KviRegisteredUser> it(*d); - QString szNotify; - - while(KviRegisteredUser * u = it.current()) - { - if(QStringList::split(",",u->getProperty("notify")).findIndex(nick)!=-1) - { - QString szComment=u->getProperty("comment"); - if(!szComment.isEmpty()) - KviQString::sprintf(szMsg,"%Q (%Q), Group \"%Q\" has left IRC as (%Q)",&(u->name()),&szComment,&(u->group()),&szWho); - else - KviQString::sprintf(szMsg,"%Q, Group \"%Q\" has left IRC as (%Q)",&(u->name()),&(u->group()),&szWho); - break; - } - ++it; - } - - if(szMsg.isEmpty()) - KviQString::sprintf(szMsg,__tr2qs("%Q has left IRC"),&szWho); - - if((!szReason.isEmpty()) && (_OUTPUT_VERBOSE)) - { - szMsg += "("; - szMsg += szReason; - szMsg += ")"; - } - - out->outputNoFmt(KVI_OUT_NOTIFYOFFLINE,szMsg); - } - - m_pConsole->notifyListView()->part(nick); -} - - - -// -// INTELLIGENT NOTIFY LIST MANAGER: NOTIFY PROCESS: -// -// start() stop() -// | ^ -// buildRegUserDict() | -// | | -// m_pRegUserDict->isEmpty() ? -- YES ---------->+ -// | | -// NO | -// | | -// newNotifySession()<------- TIMER ---------------- delayedNotifySession() --------------------------------+ -// | (can be stopped here) | ^ | -// | | ^ | -// buildNotifyList() | | YES -// | | | | -// m_pNotifyList->isEmpty() ? - YES ->+ | | -// | | | -// NO | | -// | | | -// newIsOnSession()<------------- TIMER -------------------- delayedIsOnSession() -- NO - m_pNotifyList->isEmpty() ? -// | (can be stopped here) | | -// | | | -// buildIsOnList() | | -// | | | -// m_pIsOnList->isEmpty() ? -- YES ---------->+ | -// | | -// NO | -// | | -// sendIsOn() - - - - - - - - - - - -> handleIsOn() | -// | | -// (build m_pOnlineList) | -// | | -// m_pOnlineList->isEmpty() ? - YES ----------------------->+ -// | | -// NO YES -// | | -// delayedUserhostSession()<--------------- NO - m_pOnlineList->isEmpty() ? -// | ^ -// TIMER (can be stopped here) | -// | | -// newUserhostSession() | -// | | -// buildUserhostList() | -// | | -// m_pUserhostList->isEmpty() ? - YES --->+ -// | ^^^ | -// | (unexpected!)||| | -// NO | -// | | -// sendUserhost() - - - - - - - - > handleUserhost() -// - - -KviIsOnNotifyListManager::KviIsOnNotifyListManager(KviIrcConnection * pConnection) -: KviNotifyListManager(pConnection) -{ - m_pRegUserDict = new KviPointerHashTable<QString,QString>(17,false); // case insensitive , copy keys - m_pRegUserDict->setAutoDelete(true); - m_pNotifyList = new KviPointerList<QString>; - m_pNotifyList->setAutoDelete(true); - m_pIsOnList = new KviPointerList<QString>; - m_pIsOnList->setAutoDelete(true); - m_pOnlineList = new KviPointerList<QString>; - m_pOnlineList->setAutoDelete(true); - m_pUserhostList = new KviPointerList<QString>; - m_pUserhostList->setAutoDelete(true); - m_pDelayedNotifyTimer = new QTimer(); - connect(m_pDelayedNotifyTimer,SIGNAL(timeout()),this,SLOT(newNotifySession())); - m_pDelayedIsOnTimer = new QTimer(); - connect(m_pDelayedIsOnTimer,SIGNAL(timeout()),this,SLOT(newIsOnSession())); - m_pDelayedUserhostTimer = new QTimer(); - connect(m_pDelayedUserhostTimer,SIGNAL(timeout()),this,SLOT(newUserhostSession())); - m_bRunning = false; -} - - -KviIsOnNotifyListManager::~KviIsOnNotifyListManager() -{ - if(m_bRunning)stop(); - delete m_pDelayedNotifyTimer; - delete m_pDelayedIsOnTimer; - delete m_pDelayedUserhostTimer; - delete m_pRegUserDict; - delete m_pOnlineList; - delete m_pNotifyList; - delete m_pIsOnList; - delete m_pUserhostList; -} - -void KviIsOnNotifyListManager::start() -{ - if(m_bRunning)stop(); - m_bRunning = true; - m_pConsole->notifyListView()->partAllButOne(m_pConnection->currentNickName()); - - m_bExpectingIsOn = false; - m_bExpectingUserhost = false; - - buildRegUserDict(); - if(m_pRegUserDict->isEmpty()) - { - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: No users to check for, quitting")); - stop(); - return; - } - newNotifySession(); -} - -void KviIsOnNotifyListManager::buildRegUserDict() -{ - m_pRegUserDict->clear(); - - const KviPointerHashTable<QString,KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict(); - KviPointerHashTableIterator<QString,KviRegisteredUser> it(*d); - while(KviRegisteredUser * u = it.current()) - { - QString notify; - if(u->getProperty("notify",notify)) - { - notify.stripWhiteSpace(); - while(!notify.isEmpty()) - { - int idx = notify.find(' '); - if(idx > 0) - { - QString single = notify.left(idx); - m_pRegUserDict->replace(single,new QString(u->name())); - notify.remove(0,idx+1); - } else { - m_pRegUserDict->replace(notify,new QString(u->name())); - notify = ""; - } - } - } - ++it; - } -} - -void KviIsOnNotifyListManager::delayedNotifySession() -{ - unsigned int iTimeout = KVI_OPTION_UINT(KviOption_uintNotifyListCheckTimeInSecs); - if(iTimeout < 15) - { - // life first of all. - // don't allow the user to suicide - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("Notify list: Timeout (%d sec) is too short, resetting to something more reasonable (15 sec)"), - iTimeout); - iTimeout = 15; - KVI_OPTION_UINT(KviOption_uintNotifyListCheckTimeInSecs) = 15; - } - m_pDelayedNotifyTimer->start(iTimeout * 1000,true); -} - -void KviIsOnNotifyListManager::newNotifySession() -{ - buildNotifyList(); - if(m_pNotifyList->isEmpty()) - { - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: Notify list empty, quitting")); - stop(); - return; - } - newIsOnSession(); -} - -void KviIsOnNotifyListManager::buildNotifyList() -{ - m_pNotifyList->clear(); - KviPointerHashTableIterator<QString,QString> it(*m_pRegUserDict); - while(it.current()) - { - m_pNotifyList->append(new QString(it.currentKey())); - ++it; - } -} - -void KviIsOnNotifyListManager::delayedIsOnSession() -{ - unsigned int iTimeout = KVI_OPTION_UINT(KviOption_uintNotifyListIsOnDelayTimeInSecs); - if(iTimeout < 5) - { - // life first of all. - // don't allow the user to suicide - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("Notify list: ISON delay (%d sec) is too short, resetting to something more reasonable (5 sec)"), - iTimeout); - iTimeout = 5; - KVI_OPTION_UINT(KviOption_uintNotifyListIsOnDelayTimeInSecs) = 5; - } - m_pDelayedIsOnTimer->start(iTimeout * 1000,true); -} - -void KviIsOnNotifyListManager::newIsOnSession() -{ - buildIsOnList(); - if(m_pIsOnList->isEmpty())delayedNotifySession(); - else sendIsOn(); -} - -void KviIsOnNotifyListManager::buildIsOnList() -{ - m_pIsOnList->clear(); - m_szIsOnString = ""; - m_pNotifyList->setAutoDelete(false); - while(QString * s = m_pNotifyList->first()) - { - if(((m_szIsOnString.length() + s->length()) + 1) < 504) - { - if(!m_szIsOnString.isEmpty())m_szIsOnString.append(' '); - m_szIsOnString.append(*s); - m_pIsOnList->append(s); - m_pNotifyList->removeFirst(); - } else break; - } - m_pNotifyList->setAutoDelete(true); -} - -void KviIsOnNotifyListManager::sendIsOn() -{ - if(_OUTPUT_PARANOIC) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: Checking for: %Q"),&m_szIsOnString); - KviQCString szDec = m_pConnection->encodeText(m_szIsOnString); - m_pConnection->sendFmtData("ISON %s",szDec.data()); - if(m_pConnection->lagMeter()) - m_pConnection->lagMeter()->lagCheckRegister("@notify_ison",40); // not that reliable - m_szIsOnString = ""; - m_bExpectingIsOn = true; - // FIXME: #warning "And if can't send ?" -} - - -bool KviIsOnNotifyListManager::handleIsOn(KviIrcMessage *msg) -{ - if(!m_bExpectingIsOn)return false; - - // Check if it is our ISON - // all the nicks must be on the IsOnList - - KviPointerList<QString> tmplist; - tmplist.setAutoDelete(false); - - KviStr nk; - const char * aux = msg->trailing(); - - while(*aux) - { - nk = ""; - aux = kvi_extractToken(nk,aux,' '); - if(nk.hasData()) - { - bool bGotIt = false; - QString dnk = m_pConnection->decodeText(nk.ptr()); - for(QString * s = m_pIsOnList->first();s && (!bGotIt);s = m_pIsOnList->next()) - { - if(KviQString::equalCI(*s,dnk)) - { - tmplist.append(s); - bGotIt = true; - } - } - if(!bGotIt) - { - // ops...not my userhost! - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: Hey! You've used ISON behind my back? (I might be confused now...)")); - return false; - } - } - } - - // Ok...looks to be my ison (still not sure at 100% , but can't do better) - if(m_pConnection->lagMeter()) - m_pConnection->lagMeter()->lagCheckComplete("@notify_ison"); - - m_bExpectingIsOn = false; - - m_pOnlineList->clear(); - - m_pIsOnList->setAutoDelete(false); - - // Ok...we have an IsOn reply here - // The nicks in the IsOnList that are also in the reply are online , and go to the OnlineList - // the remaining in the IsOnList are offline - - QString * s; - - for(s = tmplist.first();s;s = tmplist.next()) - { - m_pIsOnList->removeRef(s); - m_pOnlineList->append(s); - } - - m_pIsOnList->setAutoDelete(true); - // Ok...all the users that are online , are on the OnlineList - // the remaining users are in the m_pIsOnList , and are no longer online - - // first the easy step: remove the users that have just left irc or have never been online - // we're clearling the m_pIsOnList - while((s = m_pIsOnList->first())) - { - if(m_pConsole->notifyListView()->findEntry(*s)) - { - // has just left IRC... make him part - notifyOffLine(*s); - } // else has never been here - - m_pIsOnList->removeFirst(); // autodelete is true - } - - // ok... complex step now: the remaining users in the userhost list are online - // if they have been online before, just remove them from the list - // otherwise they must be matched for masks - // and eventually inserted in the notify view later - - KviIrcUserDataBase * db = console()->connection()->userDataBase(); - - KviPointerList<QString> l; - l.setAutoDelete(false); - - for(s = m_pOnlineList->first();s;s = m_pOnlineList->next()) - { - if(KviUserListEntry * ent = m_pConsole->notifyListView()->findEntry(*s)) - { - // the user was online from a previous notify session - // might the mask have been changed ? (heh...this is tricky, maybe too much even) - if(KVI_OPTION_BOOL(KviOption_boolNotifyListSendUserhostForOnlineUsers)) - { - // user wants to be sure about online users.... - // check if he is on some channels - if(ent->globalData()->nRefs() > 1) - { - // mmmh...we have more than one ref , so the user is at least in one query or channel - // look him up on channels , if we find his entry , we can be sure that he is - // still the right user - KviPointerList<KviChannel> * chlist = m_pConsole->connection()->channelList(); - for(KviChannel * ch = chlist->first();ch;ch = chlist->next()) - { - if(KviUserListEntry * le = ch->findEntry(*s)) - { - l.append(s); // ok...found on a channel...we don't need an userhost to match him - KviIrcMask mk(*s,le->globalData()->user(),le->globalData()->host()); - if(!doMatchUser(*s,mk))return true; // critical problems = have to restart!!! - break; - } - } - } // else Only one ref...we need an userhost to be sure (don't remove from the list) - } else { - // user wants no userhost for online users...we "hope" that everything will go ok. - l.append(s); - } - //l.append(s); // we will remove him from the list - } else { - // the user was not online! - // check if we have a cached mask - if(db) - { - if(KviIrcUserEntry * ue = db->find(*s)) - { - // already in the db... do we have a mask ? - if(ue->hasUser() && ue->hasHost()) - { - // yup! we have a complete mask to match on - KviIrcMask mk(*s,ue->user(),ue->host()); - // lookup the user's name in the m_pRegUserDict - if(!doMatchUser(*s,mk))return true; // critical problems = have to restart!!! - l.append(s); // remove anyway - } - } - } - } - } - - for(s = l.first();s;s = l.next()) - { - m_pOnlineList->removeRef(s); // autodelete is true - } - - if(m_pOnlineList->isEmpty()) - { - if(m_pNotifyList->isEmpty())delayedNotifySession(); - else delayedIsOnSession(); - } else delayedUserhostSession(); - - return true; -} - -// FIXME: #warning "Nickname escapes (links) in the notifylist messages!" - -bool KviIsOnNotifyListManager::doMatchUser(const QString ¬ifyString,const KviIrcMask & mask) -{ - QString * nam = m_pRegUserDict->find(notifyString); - if(nam) - { - // ok...find the user - if(KviRegisteredUser * u = g_pRegisteredUserDataBase->findUserByName(*nam)) - { - // ok ... match the user - if(u->matchesFixed(mask)) - { - // new user online - if(!(m_pConsole->notifyListView()->findEntry(mask.nick()))) - { - notifyOnLine(mask.nick(),mask.user(),mask.host()); - } // else already online , and matching...all ok - } else { - // not matched.... has he been online before ? - if(m_pConsole->notifyListView()->findEntry(mask.nick())) - { - // has been online just a sec ago , but now the mask does not match - // either reguserdb has changed , or the user went offline and another one got his nick - // in the meantime... (ugly situation anyway) - notifyOffLine(mask.nick(),mask.user(),mask.host(),__tr2qs("registration mask changed, or nickname is being used by someone else")); - } else { - // has never been online - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: \r!n\r%Q\r appears to be online, but the mask [%Q@\r!h\r%Q\r] does not match (registration mask does not match, or nickname is being used by someone else)"),&(mask.nick()),&(mask.user()),&(mask.host())); - } - } - } else { - // ops... unexpected inconsistency .... reguser db modified ? - m_pConsole->output(KVI_OUT_SYSTEMWARNING,__tr2qs("Notify list: Unexpected inconsistency, registered user DB modified? (restarting)")); - stop(); - start(); - return false; // critical ... exit from the call stack - } - } else { - // ops...unexpected inconsistency - m_pConsole->output(KVI_OUT_SYSTEMWARNING,__tr2qs("Notify list: Unexpected inconsistency, expected \r!n\r%Q\r in the registered user DB"),¬ifyString); - } - return true; -} - -void KviIsOnNotifyListManager::delayedUserhostSession() -{ - unsigned int iTimeout = KVI_OPTION_UINT(KviOption_uintNotifyListUserhostDelayTimeInSecs); - if(iTimeout < 5) - { - // life first of all. - // don't allow the user to suicide - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("Notify list: USERHOST delay (%d sec) is too short, resetting to something more reasonable (5 sec)"), - iTimeout); - iTimeout = 5; - KVI_OPTION_UINT(KviOption_uintNotifyListUserhostDelayTimeInSecs) = 5; - } - m_pDelayedUserhostTimer->start(iTimeout * 1000,true); -} - -void KviIsOnNotifyListManager::newUserhostSession() -{ - buildUserhostList(); - if(m_pUserhostList->isEmpty()) - { - // this is unexpected! - m_pConsole->output(KVI_OUT_SYSTEMWARNING,__tr2qs("Notify list: Unexpected inconsistency, userhost list is empty!")); - if(m_pOnlineList->isEmpty()) - { - if(m_pNotifyList->isEmpty())delayedNotifySession(); - else delayedIsOnSession(); - } else delayedUserhostSession(); - return; - } - sendUserhost(); -} - -#define MAX_USERHOST_ENTRIES 5 - -void KviIsOnNotifyListManager::buildUserhostList() -{ - m_szUserhostString = ""; - m_pUserhostList->clear(); - - m_pOnlineList->setAutoDelete(false); - int i = 0; - QString * s; - while((s = m_pOnlineList->first()) && (i < MAX_USERHOST_ENTRIES)) - { - if(!m_szUserhostString.isEmpty())m_szUserhostString.append(' '); - m_szUserhostString.append(*s); - m_pUserhostList->append(s); - m_pOnlineList->removeFirst(); - i++; - } - m_pOnlineList->setAutoDelete(true); -} - -void KviIsOnNotifyListManager::sendUserhost() -{ - if(_OUTPUT_PARANOIC) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: Checking userhost for: %Q"),&m_szUserhostString); - KviQCString ccc = m_pConnection->encodeText(m_szUserhostString); - m_pConnection->sendFmtData("USERHOST %s",ccc.data()); - if(m_pConnection->lagMeter()) - m_pConnection->lagMeter()->lagCheckRegister("@notify_userhost",50); - m_szUserhostString = ""; - m_bExpectingUserhost = true; -// FIXME: #warning "And if can't send ?" -} - -bool KviIsOnNotifyListManager::handleUserhost(KviIrcMessage *msg) -{ - if(!m_bExpectingUserhost)return false; - // first check for consistency: all the replies must be on the USERHOST list - KviPointerList<KviIrcMask> tmplist; - tmplist.setAutoDelete(true); - - KviStr nk; - const char * aux = msg->trailing(); - - while(*aux) - { - nk = ""; - aux = kvi_extractToken(nk,aux,' '); - if(nk.hasData()) - { - // split it in a mask - KviStr nick; - KviStr user; - KviStr host; - - int idx = nk.findFirstIdx('='); - if(idx != -1) - { - nick = nk.left(idx); - if(nick.lastCharIs('*'))nick.cutRight(1); - nk.cutLeft(idx + 1); - if(nk.firstCharIs('+') || nk.firstCharIs('-'))nk.cutLeft(1); - - idx = nk.findFirstIdx('@'); - if(idx != -1) - { - user = nk.left(idx); - nk.cutLeft(idx + 1); - host = nk; - } else { - user = "*"; - host = nk; - } - - bool bGotIt = false; - QString szNick = m_pConnection->decodeText(nick.ptr()); - QString szUser = m_pConnection->decodeText(user.ptr()); - QString szHost = m_pConnection->decodeText(host.ptr()); - - for(QString * s = m_pUserhostList->first();s && (!bGotIt);s = m_pUserhostList->next()) - { - if(KviQString::equalCI(*s,szNick)) - { - KviIrcMask * mk = new KviIrcMask(szNick,szUser,szHost); - tmplist.append(mk); - bGotIt = true; - m_pUserhostList->removeRef(s); - } - } - - if(!bGotIt) - { - // ops...not my userhost! - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_SYSTEMWARNING,__tr2qs("Notify list: Hey! You've used USERHOST behind my back? (I might be confused now...)")); - return false; - } - } else { - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_SYSTEMWARNING,__tr2qs("Notify list: Broken USERHOST reply from the server? (%s)"),nk.ptr()); - } - } - } - - // Ok...looks to be my usershot (still not sure at 100% , but can't do better) - - if(m_pConnection->lagMeter()) - m_pConnection->lagMeter()->lagCheckComplete("@notify_userhost"); - - - m_bExpectingUserhost = false; - - for(KviIrcMask * mk = tmplist.first();mk;mk = tmplist.next()) - { - if(!doMatchUser(mk->nick(),*mk))return true; // have to restart!!! - } - - if(!(m_pUserhostList->isEmpty())) - { - // ops...someone is no longer online ? - while(QString * s = m_pUserhostList->first()) - { - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: \r!n\r%Q\r appears to have gone offline before USERHOST reply was received, will recheck in the next loop"),s); - m_pUserhostList->removeFirst(); - } - - } - - if(m_pOnlineList->isEmpty()) - { - if(m_pNotifyList->isEmpty())delayedNotifySession(); - else delayedIsOnSession(); - } else delayedUserhostSession(); - - return true; -} - -void KviIsOnNotifyListManager::stop() -{ - if(!m_bRunning)return; - - if(m_pConnection->lagMeter()) - m_pConnection->lagMeter()->lagCheckAbort("@notify_userhost"); - if(m_pConnection->lagMeter()) - m_pConnection->lagMeter()->lagCheckAbort("@notify_ison"); - - m_pDelayedNotifyTimer->stop(); - m_pDelayedIsOnTimer->stop(); - m_pDelayedUserhostTimer->stop(); - m_pConsole->notifyListView()->partAllButOne(m_pConnection->currentNickName()); - m_pRegUserDict->clear(); - m_pNotifyList->clear(); - m_pIsOnList->clear(); - m_pOnlineList->clear(); - m_pUserhostList->clear(); - m_szIsOnString = ""; - m_szUserhostString = ""; - m_bRunning = false; -} - - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// -// Stupid notify list manager -// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -KviStupidNotifyListManager::KviStupidNotifyListManager(KviIrcConnection * pConnection) -: KviNotifyListManager(pConnection) -{ - m_pNickList = new KviPointerList<QString>; - m_pNickList->setAutoDelete(true); - m_iRestartTimer = 0; -} - -KviStupidNotifyListManager::~KviStupidNotifyListManager() -{ - if(m_iRestartTimer) - { - killTimer(m_iRestartTimer); - m_iRestartTimer = 0; - } - delete m_pNickList; -} - -void KviStupidNotifyListManager::start() -{ - if(m_iRestartTimer) - { - killTimer(m_iRestartTimer); - m_iRestartTimer = 0; - } - if(_OUTPUT_VERBOSE) - m_pConsole->outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Starting notify list")); - buildNickList(); - if(m_pNickList->isEmpty()) - { - if(_OUTPUT_VERBOSE) - m_pConsole->outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("No users in the notify list")); - return; // Ok...no nicknames in the list - } - m_iNextNickToCheck = 0; - m_pConsole->notifyListView()->partAllButOne(m_pConnection->currentNickName()); - sendIsOn(); -} - -void KviStupidNotifyListManager::sendIsOn() -{ - m_szLastIsOnMsg = ""; - QString * nick = m_pNickList->at(m_iNextNickToCheck); - __range_valid(nick); - - int i = 0; - while(nick && ((nick->length() + 5 + m_szLastIsOnMsg.length()) < 510)) - { - KviQString::appendFormatted(m_szLastIsOnMsg," %Q",nick); - nick = m_pNickList->next(); - i++; - } - if(_OUTPUT_PARANOIC) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: Checking for:%Q"),&m_szLastIsOnMsg); - KviQCString dat = m_pConnection->encodeText(m_szLastIsOnMsg); - m_pConnection->sendFmtData("ISON%s",dat.data()); - - if(m_pConnection->lagMeter()) - m_pConnection->lagMeter()->lagCheckRegister("@notify_naive",20); - - m_iNextNickToCheck += i; -} - -bool KviStupidNotifyListManager::handleIsOn(KviIrcMessage * msg) -{ - if(m_pConnection->lagMeter()) - m_pConnection->lagMeter()->lagCheckComplete("@notify_naive"); - - KviStr nk; - const char * aux = msg->trailing(); - while(*aux) - { - nk = ""; - aux = kvi_extractToken(nk,aux,' '); - if(nk.hasData()) - { - QString nkd = m_pConnection->decodeText(nk.ptr()); - QString nksp = " " + nkd; - m_szLastIsOnMsg.replace(nksp,"",false); - if(!(m_pConsole->notifyListView()->findEntry(nkd))) - { - // not yet notified - notifyOnLine(nkd); - } - } - } - // ok...check the users that have left irc now... - QStringList sl = QStringList::split(' ',m_szLastIsOnMsg); - - for(QStringList::Iterator it = sl.begin();it != sl.end();++it) - { - if(m_pConsole->notifyListView()->findEntry(*it)) - { - // has just left irc - notifyOffLine(*it); - } // else has never been here... - } - - if(((unsigned int)m_iNextNickToCheck) >= m_pNickList->count()) - { - // have to restart - unsigned int iTimeout = KVI_OPTION_UINT(KviOption_uintNotifyListCheckTimeInSecs); - if(iTimeout < 5) - { - // life first of all. - // don't allow the user to suicide - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("Notify list: Timeout (%d sec) is too short, resetting to something more reasonable (5 sec)"), - iTimeout); - iTimeout = 5; - KVI_OPTION_UINT(KviOption_uintNotifyListCheckTimeInSecs) = 5; - } - m_iRestartTimer = startTimer(iTimeout * 1000); - } else sendIsOn(); - return true; -} - -void KviStupidNotifyListManager::timerEvent(QTimerEvent *e) -{ - if(e->timerId() == m_iRestartTimer) - { - killTimer(m_iRestartTimer); - m_iRestartTimer = 0; - m_iNextNickToCheck = 0; - sendIsOn(); - return; - } - QObject::timerEvent(e); -} - -void KviStupidNotifyListManager::stop() -{ - if(m_pConnection->lagMeter()) - m_pConnection->lagMeter()->lagCheckAbort("@notify_naive"); - - if(m_iRestartTimer) - { - killTimer(m_iRestartTimer); - m_iRestartTimer = 0; - } - m_pConsole->notifyListView()->partAllButOne(m_pConnection->currentNickName()); - - // The ISON Method needs no stopping -} - -void KviStupidNotifyListManager::buildNickList() -{ - const KviPointerHashTable<QString,KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict(); - KviPointerHashTableIterator<QString,KviRegisteredUser> it(*d); - m_pNickList->clear(); - while(it.current()) - { - QString notify; - if(it.current()->getProperty("notify",notify)) - { - m_pNickList->append(new QString(notify)); - } - ++it; - } -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// -// Watch notify list manager -// -/////////////////////////////////////////////////////////////////////////////////////////////////// - -KviWatchNotifyListManager::KviWatchNotifyListManager(KviIrcConnection * pConnection) -: KviNotifyListManager(pConnection) -{ - m_pRegUserDict = new KviPointerHashTable<QString,QString>(17,false); - m_pRegUserDict->setAutoDelete(true); -} - -KviWatchNotifyListManager::~KviWatchNotifyListManager() -{ - delete m_pRegUserDict; -} - -void KviWatchNotifyListManager::buildRegUserDict() -{ - m_pRegUserDict->clear(); - - const KviPointerHashTable<QString,KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict(); - KviPointerHashTableIterator<QString,KviRegisteredUser> it(*d); - while(KviRegisteredUser * u = it.current()) - { - QString notify; - if(u->getProperty("notify",notify)) - { - notify.stripWhiteSpace(); - QStringList sl = QStringList::split(' ',notify); - for(QStringList::Iterator it = sl.begin();it != sl.end();++it) - { - m_pRegUserDict->replace(*it,new QString(u->name())); - } - } - ++it; - } -} - -void KviWatchNotifyListManager::start() -{ - m_pConsole->notifyListView()->partAllButOne(m_pConnection->currentNickName()); - - buildRegUserDict(); - - QString watchStr; - - KviPointerHashTableIterator<QString,QString> it(*m_pRegUserDict); - while(it.current()) - { - QString nk = it.currentKey(); - if(nk.find('*') == -1) - { - if((watchStr.length() + nk.length() + 2) > 501) - { - KviQCString dat = m_pConnection->encodeText(watchStr); - m_pConnection->sendFmtData("WATCH%s",dat.data()); - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: Adding watch entries for%Q"),&watchStr); - watchStr = ""; - } - KviQString::appendFormatted(watchStr," +%Q",&nk); - } - ++it; - } - - if(!watchStr.isEmpty()) - { - KviQCString dat = m_pConnection->encodeText(watchStr); - m_pConnection->sendFmtData("WATCH%s",dat.data()); - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: Adding watch entries for%Q"),&watchStr); - } -} -void KviWatchNotifyListManager::stop() -{ - m_pConsole->notifyListView()->partAllButOne(m_pConnection->currentNickName()); - m_pConnection->sendFmtData("WATCH clear"); - m_pRegUserDict->clear(); -} - -bool KviWatchNotifyListManager::doMatchUser(KviIrcMessage * msg,const QString ¬ifyString,const KviIrcMask & mask) -{ - QString * nam = m_pRegUserDict->find(notifyString); - - if(nam) - { - // ok...find the user - if(KviRegisteredUser * u = g_pRegisteredUserDataBase->findUserByName(*nam)) - { - // ok ... match the user - if(u->matchesFixed(mask)) - { - // new user online - if(!(m_pConsole->notifyListView()->findEntry(mask.nick()))) - { - notifyOnLine(mask.nick(),mask.user(),mask.host(),"watch"); - } else { - // else already online , and matching...all ok - if(msg->numeric() == RPL_NOWON) - { - // This is a reply to a /watch +something (should not happen, unless the user is messing) or to /watch l (user requested) - notifyOnLine(mask.nick(),mask.user(),mask.host(), - __tr2qs("watch entry listing requested by user"),false); - } else { - // This is a RPL_LOGON....we're desynched ? - notifyOnLine(mask.nick(),mask.user(),mask.host(), - __tr2qs("possible watch list desync"),false); - } - } - } else { - // not matched.... has he been online before ? - if(m_pConsole->notifyListView()->findEntry(mask.nick())) - { - // has been online just a sec ago , but now the mask does not match - // prolly the reguserdb has been changed - notifyOffLine(mask.nick(),mask.user(),mask.host(), - __tr2qs("registration mask changed or desync with the watch service")); - } else { - // has never been online - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE, - __tr("Notify list: \r!n\r%Q\r appears to be online, but the mask [%Q@\r!h\r%Q\r] does not match (watch: registration mask does not match, or nickname is being used by someone else)"), - &(mask.nick()),&(mask.user()),&(mask.host())); - } - } - } else { - // ops... unexpected inconsistency .... reguser db modified ? - m_pConsole->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("Notify list: Unexpected inconsistency, registered user DB modified? (watch: restarting)")); - stop(); - start(); - return false; // critical ... exit from the call stack - } - } else { - // not in our dictionary - // prolly someone used /WATCH behind our back... bad boy! - if(!(m_pConsole->notifyListView()->findEntry(mask.nick()))) - { - notifyOnLine(mask.nick(),mask.user(),mask.host(),__tr2qs("watch entry added by user")); - } - } - return true; -} - -// FIXME: #warning "DEDICATED WATCH LIST VERBOSITY FLAG ? (To allow the user to use /WATCH l and manual /WATCH)" - -bool KviWatchNotifyListManager::handleWatchReply(KviIrcMessage *msg) -{ - // 600: RPL_LOGON - // :prefix 600 <target> <nick> <user> <host> <logintime> :logged online - // 601: RPL_LOGON - // :prefix 601 <target> <nick> <user> <host> <logintime> :logged offline - // 604: PRL_NOWON - // :prefix 604 <target> <nick> <user> <host> <logintime> :is online - // 605: PRL_NOWOFF - // :prefix 605 <target> <nick> <user> <host> 0 :is offline - -// FIXME: #warning "Use the logintime in some way ?" - - const char * nk = msg->safeParam(1); - const char * us = msg->safeParam(2); - const char * ho = msg->safeParam(3); - QString dnk = m_pConnection->decodeText(nk); - QString dus = m_pConnection->decodeText(us); - QString dho = m_pConnection->decodeText(ho); - - if((msg->numeric() == RPL_LOGON) || (msg->numeric() == RPL_NOWON)) - { - KviIrcMask m(dnk,dus,dho); - doMatchUser(msg,dnk,m); - return true; - - } else if(msg->numeric() == RPL_WATCHOFF) - { - if(m_pConsole->notifyListView()->findEntry(dnk)) - { - notifyOffLine(dnk,dus,dho,__tr2qs("removed from watch list")); - } else { - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: Stopped watching for \r!n\r%Q\r"),&dnk); - } - if(m_pRegUserDict->find(dnk))m_pRegUserDict->remove(dnk); // kill that - - return true; - - } else if((msg->numeric() == RPL_LOGOFF) || (msg->numeric() == RPL_NOWOFF)) - { - if(m_pConsole->notifyListView()->findEntry(dnk)) - { - notifyOffLine(dnk,dus,dho,__tr2qs("watch")); - } else { - if(msg->numeric() == RPL_NOWOFF) - { - // This is a reply to a /watch +something - if(_OUTPUT_VERBOSE) - m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: \r!n\r%Q\r is offline (watch)"),&dnk); - } else { - // This is a RPL_LOGOFF for an user that has not matched the reg-mask - notifyOffLine(dnk,dus,dho,__tr2qs("unmatched watch list entry")); - } - } - return true; - } - - return false; -} - - -#include "kvi_notifylist.moc" diff --git a/3.4.0/src/kvirc/kernel/kvi_notifylist.h b/3.4.0/src/kvirc/kernel/kvi_notifylist.h deleted file mode 100644 index e3ffffd104..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_notifylist.h +++ /dev/null @@ -1,161 +0,0 @@ -#ifndef _KVI_NOTIFYLIST_H_ -#define _KVI_NOTIFYLIST_H_ - -//============================================================================= -// -// File : kvi_notifylist.h -// Creation date : Fri Oct 27 2000 23:39:09 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qobject.h> -#include "kvi_pointerlist.h" -#include "kvi_pointerhashtable.h" -#include <qtimer.h> - -#include "kvi_qstring.h" - -class KviConsole; -class KviIrcMessage; -class KviIrcMask; -class KviIrcConnection; - -class KVIRC_API KviNotifyListManager : public QObject -{ - friend class KviConsole; - friend class KviConnectionInfo; - friend class KviServerParser; - friend class KviIrcConnection; - Q_OBJECT -protected: - KviNotifyListManager(KviIrcConnection * pConnection); - ~KviNotifyListManager(); -protected: - KviConsole * m_pConsole; - KviIrcConnection * m_pConnection; -protected: - virtual void start(); - virtual void stop(); - virtual bool handleUserhost(KviIrcMessage * msg); - virtual bool handleIsOn(KviIrcMessage * msg); - virtual bool handleWatchReply(KviIrcMessage *msg); - void notifyOnLine(const QString &nick,const QString &user = QString::null,const QString &host = QString::null,const QString &szReason = QString::null,bool bJoin=true); - void notifyOffLine(const QString &nick,const QString &user = QString::null,const QString &host = QString::null,const QString &szReason = QString::null); -public: - KviConsole * console(){ return m_pConsole; }; -}; - -class KVIRC_API KviIsOnNotifyListManager : public KviNotifyListManager -{ - friend class KviConsole; - friend class KviServerParser; - friend class KviIrcConnection; - Q_OBJECT -protected: - KviIsOnNotifyListManager(KviIrcConnection * pConnection); - ~KviIsOnNotifyListManager(); -private: - KviPointerHashTable<QString,QString> * m_pRegUserDict; // dict notifystring->reguser name - KviPointerList<QString> * m_pNotifyList; // list of notifystring (total) - KviPointerList<QString> * m_pIsOnList; // list of notifystring (one session) - QString m_szIsOnString; // m_pIsOnList in form of a string - KviPointerList<QString> * m_pOnlineList; // - KviPointerList<QString> * m_pUserhostList; - QString m_szUserhostString; - bool m_bExpectingIsOn; - bool m_bExpectingUserhost; - QTimer * m_pDelayedIsOnTimer; - QTimer * m_pDelayedNotifyTimer; - QTimer * m_pDelayedUserhostTimer; - bool m_bRunning; -protected: - virtual void start(); - virtual void stop(); - virtual bool handleUserhost(KviIrcMessage *msg); - virtual bool handleIsOn(KviIrcMessage *msg); -private: - void delayedNotifySession(); - void delayedIsOnSession(); - void delayedUserhostSession(); -private slots: - void newNotifySession(); - void newIsOnSession(); - void newUserhostSession(); - - void buildRegUserDict(); - void buildIsOnList(); - void buildUserhostList(); - void buildNotifyList(); - void sendIsOn(); - void sendUserhost(); - bool doMatchUser(const QString ¬ifyString,const KviIrcMask & mask); - -}; - - -class KVIRC_API KviStupidNotifyListManager : public KviNotifyListManager -{ - friend class KviConsole; - friend class KviServerParser; - friend class KviIrcConnection; - Q_OBJECT -protected: - KviStupidNotifyListManager(KviIrcConnection * pConnection); - ~KviStupidNotifyListManager(); -protected: - KviPointerList<QString> * m_pNickList; - QString m_szLastIsOnMsg; - int m_iNextNickToCheck; - int m_iRestartTimer; -protected: - virtual void start(); - virtual void stop(); - virtual bool handleIsOn(KviIrcMessage *msg); -protected: - virtual void timerEvent(QTimerEvent *e); -private: - void buildNickList(); - void sendIsOn(); -}; - -class KVIRC_API KviWatchNotifyListManager : public KviNotifyListManager -{ - friend class KviConsole; - friend class KviServerParser; - friend class KviIrcConnection; - Q_OBJECT -public: - KviWatchNotifyListManager(KviIrcConnection * pConnection); - ~KviWatchNotifyListManager(); -protected: - KviPointerHashTable<QString,QString> * m_pRegUserDict; // dict notifystring->reguser name -protected: - void buildRegUserDict(); - virtual void start(); - virtual void stop(); - virtual bool handleWatchReply(KviIrcMessage *msg); - bool doMatchUser(KviIrcMessage *msg,const QString ¬ifyString,const KviIrcMask & mask); - -}; - -#endif //_KVI_NOTIFYLIST_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_options.cpp b/3.4.0/src/kvirc/kernel/kvi_options.cpp deleted file mode 100644 index a40c056078..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_options.cpp +++ /dev/null @@ -1,1381 +0,0 @@ -//============================================================================= -// -// File : kvi_options.cpp -// Creation date : Tue Jun 20 2000 11:42:00 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#define _KVI_OPTIONS_CPP_ - -#include "kvi_options.h" -#include "kvi_defaults.h" -#include "kvi_config.h" -#include "kvi_app.h" -#include "kvi_iconmanager.h" -#include "kvi_mirccntrl.h" -#include "kvi_locale.h" -#include "kvi_confignames.h" -#include "kvi_window.h" -#include "kvi_out.h" -#include "kvi_stringconversion.h" -#include "kvi_settings.h" -#include "kvi_splash.h" -#include "kvi_frame.h" -#include "kvi_internalcmd.h" -#include "kvi_theme.h" -#include <qmessagebox.h> -#include <qregexp.h> -//#include "kvi_textencoding.h" - -//xml parser -#include <qdom.h> -//!xml parser - -#include <zlib.h> -#include <qtextcodec.h> - -#include "kvi_fileutils.h" - -#include <qdir.h> -#include <qstringlist.h> - -// kvi_app.cpp -extern KVIRC_API int g_iIdentDaemonRunningUsers; - - -#define RECT_OPTION(_txt,_val,_flags) KviRectOption(KVI_RECT_OPTIONS_PREFIX _txt, _val , _flags) - -KviRectOption g_rectOptionsTable[KVI_NUM_RECT_OPTIONS]= -{ - RECT_OPTION("FrameGeometry",QRect(0,0,10,10),KviOption_sectFlagGeometry), - RECT_OPTION("GeneralOptionsDialogGeometry",QRect(50,50,600,450),KviOption_sectFlagGeometry), - RECT_OPTION("RegisteredUsersDialogGeometry",QRect(50,50,600,450),KviOption_sectFlagGeometry) -}; - -#define BOOL_OPTION(_txt,_val,_flags) KviBoolOption(KVI_BOOL_OPTIONS_PREFIX _txt,_val,_flags) - -KviBoolOption g_boolOptionsTable[KVI_NUM_BOOL_OPTIONS]= -{ - BOOL_OPTION("WindowsRememberProperties",true,KviOption_sectFlagWindows), - BOOL_OPTION("IrcViewShowImages",false,KviOption_sectFlagIrcView | KviOption_resetUpdateGui | KviOption_groupTheme), - BOOL_OPTION("IrcViewTimestamp",true,KviOption_sectFlagIrcView), - BOOL_OPTION("IrcViewUrlHighlighting",true,KviOption_sectFlagIrcView | KviOption_groupTheme), - BOOL_OPTION("IrcViewWrapMargin",true,KviOption_sectFlagIrcView | KviOption_resetUpdateGui | KviOption_groupTheme), - BOOL_OPTION("InputHistoryCursorAtEnd",true,KviOption_sectFlagInput), - - BOOL_OPTION("AvoidParserWarnings",false,KviOption_sectFlagUserParser), - BOOL_OPTION("UseProxyHost",false,KviOption_sectFlagConnection), - BOOL_OPTION("ShowGeneralOptionsDialogAsToplevel",true,KviOption_sectFlagFrame), - BOOL_OPTION("ForceBrutalQuit",false,KviOption_sectFlagIrcSocket), - BOOL_OPTION("ShowPingPong",true,KviOption_sectFlagConnection), - BOOL_OPTION("PopupNotifierOnNewQueryMessages",true,KviOption_sectFlagFrame), - BOOL_OPTION("ShowExtendedServerInfo",false,KviOption_sectFlagConnection), - BOOL_OPTION("EchoNumericTopic",true,KviOption_sectFlagConnection), - BOOL_OPTION("ShowOwnParts",true,KviOption_sectFlagConnection), - BOOL_OPTION("UseAntiSpamOnPrivmsg",false,KviOption_sectFlagAntiSpam), - BOOL_OPTION("UseExtendedPrivmsgView",false,KviOption_sectFlagIrcView | KviOption_groupTheme), - BOOL_OPTION("ShowUserAndHostInPrivmsgView",false,KviOption_sectFlagIrcView | KviOption_groupTheme), - BOOL_OPTION("UseWordHighlighting",true,KviOption_sectFlagIrcView), /* _ALL_ newbie users, with who i was taling asks me where can they switch on */ - BOOL_OPTION("UseBigIcons",false,KviOption_sectFlagFrame), /* Almost all users asks me "How to decrease icon size?" */ - BOOL_OPTION("CleanupUnusedModules",true,KviOption_sectFlagModules), - BOOL_OPTION("IgnoreCtcpPing",false,KviOption_sectFlagCtcp), - BOOL_OPTION("IgnoreCtcpVersion",false,KviOption_sectFlagCtcp), - BOOL_OPTION("UseCtcpFloodProtection",true,KviOption_sectFlagCtcp), - BOOL_OPTION("DisableBrokenEventHandlers",true,KviOption_sectFlagUserParser), - BOOL_OPTION("IgnoreCtcpClientinfo",false,KviOption_sectFlagCtcp), - BOOL_OPTION("IgnoreCtcpUserinfo",false,KviOption_sectFlagCtcp), - BOOL_OPTION("IgnoreCtcpFinger",false,KviOption_sectFlagCtcp), - BOOL_OPTION("IgnoreCtcpSource",false,KviOption_sectFlagCtcp), - BOOL_OPTION("IgnoreCtcpTime",false,KviOption_sectFlagCtcp), - BOOL_OPTION("RequestMissingAvatars",true,KviOption_sectFlagAvatar), - BOOL_OPTION("ShowCompactModeChanges",true,KviOption_sectFlagConnection), - BOOL_OPTION("IgnoreCtcpDcc",false,KviOption_sectFlagDcc), - BOOL_OPTION("AutoAcceptDccChat",false,KviOption_sectFlagDcc), - BOOL_OPTION("AutoAcceptDccSend",false,KviOption_sectFlagDcc), - BOOL_OPTION("SendZeroAckInDccRecv",false,KviOption_sectFlagDcc), - BOOL_OPTION("UseFastDccSend",true,KviOption_sectFlagDcc), - BOOL_OPTION("ObtainGlobalBackgroundFromKde",false,KviOption_sectFlagGui | KviOption_resetUpdatePseudoTransparency | KviOption_groupTheme), - BOOL_OPTION("UseTaskBarIrcContextIndicator",false,KviOption_sectFlagTaskBar | KviOption_resetUpdateGui), - BOOL_OPTION("UseGlobalApplicationFont",false,KviOption_sectFlagGui | KviOption_resetUpdateAppFont | KviOption_groupTheme), - BOOL_OPTION("AlwaysQuitKVIrcClosingLastConsole",false,KviOption_sectFlagFrame), - BOOL_OPTION("AlwaysDisconnectClosingConnectedConsole",false,KviOption_sectFlagFrame), - BOOL_OPTION("FlashWindowOnHighlightedMessages",true,KviOption_sectFlagFrame), - BOOL_OPTION("PopupNotifierOnHighlightedMessages",true,KviOption_sectFlagFrame), - BOOL_OPTION("FlashWindowOnNotifyOnLine",true,KviOption_sectFlagConnection), - BOOL_OPTION("IrcViewTimestampUTC",false,KviOption_sectFlagIrcView), - BOOL_OPTION("UseGlobalPseudoTransparency",false,KviOption_sectFlagGui | KviOption_resetUpdatePseudoTransparency | KviOption_groupTheme), - BOOL_OPTION("UseNotifyList",false,KviOption_sectFlagConnection | KviOption_resetRestartNotifyList), - BOOL_OPTION("NotifyListChangesToActiveWindow",true,KviOption_sectFlagConnection), - BOOL_OPTION("AutoResumeDccSendWhenAutoAccepted",true,KviOption_sectFlagDcc), - BOOL_OPTION("LimitOutgoingTraffic",false,KviOption_sectFlagIrcSocket), - BOOL_OPTION("SendUnknownCommandsAsRaw",true,KviOption_sectFlagUserParser), - BOOL_OPTION("UserListViewDrawGrid",true,KviOption_sectFlagUserListView | KviOption_resetUpdateGui | KviOption_groupTheme), - BOOL_OPTION("ShowChannelSyncTime",true,KviOption_sectFlagConnection), - BOOL_OPTION("RejoinChannelOnKick",true,KviOption_sectFlagConnection), - BOOL_OPTION("KeepChannelOpenOnKick",true,KviOption_sectFlagConnection), - BOOL_OPTION("AutoCloseDccSendOnSuccess",false,KviOption_sectFlagDcc), - BOOL_OPTION("NotifyDccSendSuccessInConsole",false,KviOption_sectFlagDcc), - BOOL_OPTION("CreateMinimizedDccSend",false,KviOption_sectFlagDcc), - BOOL_OPTION("CreateMinimizedDccChat",false,KviOption_sectFlagDcc), - BOOL_OPTION("AutoAcceptIncomingAvatars",false,KviOption_sectFlagDcc), - BOOL_OPTION("UseNickCompletionPostfixForFirstWordOnly",true,KviOption_sectFlagInput), - BOOL_OPTION("UseTaskBarIcons",true,KviOption_sectFlagTaskBar | KviOption_resetUpdateGui), - BOOL_OPTION("CreateMinimizedDccSendWhenAutoAccepted",true,KviOption_sectFlagDcc), - BOOL_OPTION("CreateMinimizedDccChatWhenAutoAccepted",true,KviOption_sectFlagDcc), - BOOL_OPTION("DccGuessIpFromServerWhenLocalIsUnroutable",true,KviOption_sectFlagDcc), - BOOL_OPTION("ShowRegisteredUsersDialogAsToplevel",true,KviOption_sectFlagFrame), - BOOL_OPTION("AutoLogQueries",true,KviOption_sectFlagLogging),/* this options enabled by default in mIRC,XChat and irssi. People are confused while they want to see logs, but see empty dir*/ - BOOL_OPTION("AutoLogChannels",true,KviOption_sectFlagLogging), - BOOL_OPTION("AutoLogDccChat",false,KviOption_sectFlagLogging), - BOOL_OPTION("AutoLogConsole",false,KviOption_sectFlagLogging), - - BOOL_OPTION("SilentAntiSpam",false,KviOption_sectFlagAntiSpam), - BOOL_OPTION("UseIncomingDccMediaTypeSavePath",true,KviOption_sectFlagDcc), - BOOL_OPTION("NotifyListSendUserhostForOnlineUsers",true,KviOption_sectFlagConnection), - BOOL_OPTION("UseIntelligentNotifyListManager",true,KviOption_sectFlagConnection | KviOption_resetRestartNotifyList), - BOOL_OPTION("UseWatchListIfAvailable",true,KviOption_sectFlagConnection), - BOOL_OPTION("UseTreeWindowListTaskBar",true,KviOption_sectFlagTaskBar | KviOption_resetUpdateTaskBar | KviOption_groupTheme), - BOOL_OPTION("BindIrcIpV4ConnectionsToSpecifiedAddress",false,KviOption_sectFlagConnection), - BOOL_OPTION("BindIrcIpV6ConnectionsToSpecifiedAddress",false,KviOption_sectFlagConnection), - BOOL_OPTION("UseAntiSpamOnNotice",false,KviOption_sectFlagAntiSpam), - BOOL_OPTION("SetLastAvatarAsDefaultForRegisteredUsers",true,KviOption_sectFlagAvatar), - BOOL_OPTION("CantAcceptIncomingDccConnections",false,KviOption_sectFlagDcc), - BOOL_OPTION("IgnoreCtcpAvatar",false,KviOption_sectFlagCtcp), - BOOL_OPTION("CtcpRepliesToActiveWindow",true,KviOption_sectFlagCtcp), - BOOL_OPTION("AutoAcceptDccCanvas",false,KviOption_sectFlagDcc), - BOOL_OPTION("NotifyDccSendSuccessInNotifier",true,KviOption_sectFlagDcc), - BOOL_OPTION("KillBrokenTimers",true,KviOption_sectFlagUserParser), - BOOL_OPTION("DccVoiceVolumeSliderControlsPCM", true, KviOption_sectFlagDcc), - BOOL_OPTION("DccVoiceForceHalfDuplex", false, KviOption_sectFlagDcc), - BOOL_OPTION("AutoAcceptDccVoice", false, KviOption_sectFlagDcc), - BOOL_OPTION("CreateMinimizedDccVoice", false, KviOption_sectFlagDcc), - BOOL_OPTION("CreateMinimizedDccVoiceWhenAutoAccepted",true,KviOption_sectFlagDcc), -#ifdef COMPILE_ON_WINDOWS - BOOL_OPTION("UseIdentService",true,KviOption_sectFlagConnection | KviOption_resetRestartIdentd), -#else - BOOL_OPTION("UseIdentService",false,KviOption_sectFlagConnection | KviOption_resetRestartIdentd), -#endif - BOOL_OPTION("ShowTipAtStartup",false,KviOption_sectFlagFrame), - BOOL_OPTION("IdentdEnableIpV6",false,KviOption_sectFlagConnection | KviOption_resetRestartIdentd), -#ifdef COMPILE_ON_WINDOWS - BOOL_OPTION("IdentdIpV6ContainsIpV4",false,KviOption_sectFlagConnection | KviOption_resetRestartIdentd), -#else - BOOL_OPTION("IdentdIpV6ContainsIpV4",true,KviOption_sectFlagConnection | KviOption_resetRestartIdentd), -#endif - BOOL_OPTION("ScaleAvatars",true,KviOption_sectFlagAvatar | KviOption_resetUpdateGui | KviOption_groupTheme), - BOOL_OPTION("ColorNicks",false,KviOption_sectFlagIrcView | KviOption_groupTheme), - BOOL_OPTION("BoldedNicks",true,KviOption_sectFlagIrcView | KviOption_groupTheme), - BOOL_OPTION("DccListenOnSpecifiedInterfaceByDefault",false,KviOption_sectFlagDcc), - BOOL_OPTION("ChangeNickAway", false, KviOption_sectFlagConnection), - BOOL_OPTION("AutoGeneratedAwayNick",false,KviOption_sectFlagConnection), /* only ircnet uses 9-symbol nicks */ - BOOL_OPTION("ExitAwayOnInput",false,KviOption_sectFlagConnection), - BOOL_OPTION("AlwaysHighlightNick",true,KviOption_sectFlagIrcView), - BOOL_OPTION("ShowChannelsJoinOnIrc",true,KviOption_sectFlagFrame), - BOOL_OPTION("ShowChannelsJoinDialogAsToplevel",true,KviOption_sectFlagFrame), - BOOL_OPTION("UserDefinedPortRange",false,KviOption_sectFlagDcc), - BOOL_OPTION("CreateQueryOnPrivmsg",true,KviOption_sectFlagConnection), - BOOL_OPTION("CreateQueryOnNotice",false,KviOption_sectFlagConnection), - BOOL_OPTION("CreateMinimizedQuery",false,KviOption_sectFlagConnection), - BOOL_OPTION("AutoJoinOnInvite",false,KviOption_sectFlagConnection), - BOOL_OPTION("ShowServersConnectDialogOnStart",true, KviOption_sectFlagFrame), - BOOL_OPTION("ShowServersConnectDialogAsToplevel",true,KviOption_sectFlagFrame), - BOOL_OPTION("AcceptBrokenFileNameDccResumeRequests",true,KviOption_sectFlagFrame), - BOOL_OPTION("AutoReconnectOnUnexpectedDisconnect",true,KviOption_sectFlagFrame), - BOOL_OPTION("RejoinChannelsAfterReconnect",true,KviOption_sectFlagFrame), - BOOL_OPTION("ReopenQueriesAfterReconnect",true,KviOption_sectFlagFrame), - BOOL_OPTION("EnableQueryTracing",true,KviOption_sectFlagConnection), - BOOL_OPTION("OperatorMessagesToActiveWindow",false,KviOption_sectFlagConnection), - BOOL_OPTION("InviteToActiveWindow",true,KviOption_sectFlagConnection), - BOOL_OPTION("ShowChannelUserFlagInPrivmsgView",true,KviOption_sectFlagConnection), - BOOL_OPTION("DccSendFakeAddressByDefault",false,KviOption_sectFlagDcc), - BOOL_OPTION("UseTaskBarActivityMeter",false,KviOption_sectFlagTaskBar | KviOption_resetUpdateGui | KviOption_groupTheme), - BOOL_OPTION("CloseServerWidgetAfterConnect",false,KviOption_sectFlagFrame), - BOOL_OPTION("ShowIdentityDialogAsToplevel",true,KviOption_sectFlagFrame), - BOOL_OPTION("ShowUserChannelIcons",true,KviOption_sectFlagUserListView | KviOption_resetUpdateGui | KviOption_groupTheme), - BOOL_OPTION("ShowUserChannelState",false,KviOption_sectFlagUserListView | KviOption_resetUpdateGui | KviOption_groupTheme), - BOOL_OPTION("EnableIgnoreOnPrivMsg",true,KviOption_sectFlagConnection), - BOOL_OPTION("VerboseIgnore",true,KviOption_sectFlagConnection), - BOOL_OPTION("EnableIgnoreOnNotice",true,KviOption_sectFlagConnection), - BOOL_OPTION("NotifyFailedDccHandshakes",true,KviOption_sectFlagDcc), - BOOL_OPTION("AutoTileWindows",false,KviOption_sectFlagMdi), - BOOL_OPTION("DrawEmoticons",false,KviOption_sectFlagIrcView | KviOption_groupTheme), - BOOL_OPTION("IgnoreCtcpPage",false,KviOption_sectFlagCtcp), - BOOL_OPTION("ShowDialogOnCtcpPage",true,KviOption_sectFlagCtcp), - BOOL_OPTION("BashLikeNickCompletion",false,KviOption_sectFlagInput), - BOOL_OPTION("UseSSLCertificate",false,KviOption_sectFlagConnection), - BOOL_OPTION("UseSSLPrivateKey",false,KviOption_sectFlagConnection), - BOOL_OPTION("WarnAboutPastingMultipleLines",true,KviOption_sectFlagFrame), - BOOL_OPTION("KeepChannelsOpenOnUnexpectedDisconnect",false,KviOption_sectFlagFrame), - BOOL_OPTION("KeepQueriesOpenOnUnexpectedDisconnect",false,KviOption_sectFlagFrame), - BOOL_OPTION("UseLagMeterEngine",true,KviOption_sectFlagConnection | KviOption_resetRestartLagMeter), - BOOL_OPTION("ShowLagOnContextDisplay",true,KviOption_sectFlagFrame), - BOOL_OPTION("DisableBanListRequestOnJoin",false,KviOption_sectFlagConnection), - BOOL_OPTION("DisableBanExceptionListRequestOnJoin",true,KviOption_sectFlagConnection), - BOOL_OPTION("DisableInviteListRequestOnJoin",true,KviOption_sectFlagConnection), - BOOL_OPTION("DisableWhoRequestOnJoin",false,KviOption_sectFlagConnection), - BOOL_OPTION("ShowDockExtension",true,KviOption_sectFlagFrame), - BOOL_OPTION("GotAdressForDccByDnsMyNick",false,KviOption_sectFlagFrame), - BOOL_OPTION("MinimizeConsoleAfterConnect",false,KviOption_sectFlagFrame), - BOOL_OPTION("HighlightOnlyNormalMsg",false,KviOption_sectFlagFrame), - BOOL_OPTION("HighlightOnlyNormalMsgQueryToo",false,KviOption_sectFlagFrame), - BOOL_OPTION("HighlightOnlyNormalMsgNickinChanToo",false,KviOption_sectFlagFrame), - BOOL_OPTION("HighlightOnlyAtCustomHighlightLevel",false,KviOption_sectFlagFrame), - BOOL_OPTION("MdiManagerInSdiMode",true,KviOption_sectFlagFrame), - BOOL_OPTION("DccBrokenBouncerHack",false,KviOption_sectFlagDcc), - BOOL_OPTION("ExternalMessagesToActiveWindow",true,KviOption_sectFlagConnection), - BOOL_OPTION("IgnoreChannelAvatarRequestsWhenNoAvatarSet",true,KviOption_sectFlagAvatar), - BOOL_OPTION("FlashQueryWindowOnNewMessages",true,KviOption_sectFlagFrame), - BOOL_OPTION("ConfirmCloseWhenThereAreConnections",true,KviOption_sectFlagFrame), - BOOL_OPTION("UpdateKdeBackgroundOnChange",false,KviOption_sectFlagFrame), - BOOL_OPTION("CtcpRequestsToActiveWindow",false,KviOption_sectFlagConnection), - BOOL_OPTION("ServerRepliesToActiveWindow",true,KviOption_sectFlagConnection), - BOOL_OPTION("ServerNoticesToActiveWindow",false,KviOption_sectFlagConnection), - BOOL_OPTION("ServicesNoticesToActiveWindow",false,KviOption_sectFlagConnection), - BOOL_OPTION("SortTaskBarItemsByName",true,KviOption_sectFlagConnection), - BOOL_OPTION("ShowTaskBarToolTips",true,KviOption_sectFlagConnection), - BOOL_OPTION("ShowUserListViewToolTips",true,KviOption_sectFlagConnection), - BOOL_OPTION("WhoisRepliesToActiveWindow",true,KviOption_sectFlagConnection), - BOOL_OPTION("PopupNotifierOnNotifyOnLine",true,KviOption_sectFlagConnection), - BOOL_OPTION("ForciblyDisableNotifier",false,KviOption_sectFlagConnection), - BOOL_OPTION("DccSendForceIdleStep",false,KviOption_sectFlagDcc), - BOOL_OPTION("StatusBarVisible",true,KviOption_sectFlagFrame), - BOOL_OPTION("TrackLastReadTextViewLine",true,KviOption_sectFlagFrame), - BOOL_OPTION("KeepChannelOpenOnPart",false,KviOption_sectFlagFrame), - BOOL_OPTION("StripMircColorsInUserMessages",false,KviOption_sectFlagFrame | KviOption_groupTheme), - BOOL_OPTION("DoNotSuggestRestoreDefaultScript",false,KviOption_sectFlagFrame), - BOOL_OPTION("LimitDccSendSpeed",false,KviOption_sectFlagDcc), - BOOL_OPTION("LimitDccRecvSpeed",false,KviOption_sectFlagDcc), - BOOL_OPTION("IgnoreModuleVersions",false,KviOption_sectFlagFrame), - BOOL_OPTION("DisableInputHistory",false,KviOption_sectFlagInput | KviOption_resetUpdateGui), - BOOL_OPTION("UseSpecialColorForTimestamp",true,KviOption_sectFlagIrcView | KviOption_resetUpdateGui | KviOption_groupTheme), - BOOL_OPTION("DisableAwayListUpdates",false,KviOption_sectFlagFrame), - BOOL_OPTION("DisableAvatars",false,KviOption_sectFlagIrcView | KviOption_resetUpdateGui | KviOption_groupTheme), - BOOL_OPTION("DisableUserListLabel",false,KviOption_sectFlagIrcView | KviOption_resetUpdateGui | KviOption_groupTheme), - BOOL_OPTION("DisablePopupIcons",false,KviOption_sectFlagIrcView | KviOption_resetUpdateGui | KviOption_groupTheme), - BOOL_OPTION("ScriptErrorsToDebugWindow",false,KviOption_sectFlagFrame), - BOOL_OPTION("ShowMinimizedDebugWindow",true,KviOption_sectFlagFrame), - BOOL_OPTION("ShowExtendedInfoInQueryLabel",true,KviOption_resetUpdateGui), - BOOL_OPTION("UseUserListColorsAsNickColors",true,KviOption_sectFlagIrcView | KviOption_groupTheme), - BOOL_OPTION("GzipLogs",false,KviOption_sectFlagLogging), - BOOL_OPTION("MinimizeInTray",false,KviOption_resetUpdateGui), - BOOL_OPTION("DisableNotifierFlashing",false,KviOption_sectFlagFrame), - BOOL_OPTION("CommandlineInUserFriendlyModeByDefault",false,KviOption_sectFlagFrame), // this confuses existing users and is not mentioned in the docs where there are commandline examples : we need it to be off by default for now - BOOL_OPTION("EnableVisualEffects",true,KviOption_resetUpdateGui), - BOOL_OPTION("DCCFileTransferReplaceOutgoingSpacesWithUnderscores",true,KviOption_sectFlagDcc), - BOOL_OPTION("DoNotStretchAvatars",true,KviOption_sectFlagIrcView | KviOption_resetUpdateGui ), - BOOL_OPTION("UseDifferentColorForOwnNick",false,KviOption_sectFlagIrcView | KviOption_resetUpdateGui | KviOption_groupTheme), - BOOL_OPTION("CloseInTray",false,KviOption_sectFlagFrame | KviOption_resetUpdateGui), - BOOL_OPTION("StartupMinimized",false,KviOption_sectFlagFrame), - BOOL_OPTION("SortReceivedByDccFilesByNicks",false,KviOption_sectFlagDcc), - BOOL_OPTION("LogChannelHistory",true,KviOption_sectFlagConnection), - BOOL_OPTION("ClassicTaskBarSetMaximumButtonWidth",true,KviOption_groupTheme | KviOption_sectFlagGeometry | KviOption_resetUpdateGui), - BOOL_OPTION("KeepChannelsOpenOnDisconnect",false,KviOption_sectFlagFrame), - BOOL_OPTION("KeepQueriesOpenOnDisconnect",false,KviOption_sectFlagFrame), - BOOL_OPTION("HideWindowToolButtons",true,KviOption_sectFlagFrame), - BOOL_OPTION("HideInputToolButtons",true,KviOption_sectFlagFrame), - BOOL_OPTION("StripControlCodesInLogs",false,KviOption_sectFlagLogging), - BOOL_OPTION("EnableTrayIconFlashing",true,KviOption_sectFlagFrame), - BOOL_OPTION("UseFlatClassicTaskbarButtons",false,KviOption_sectFlagTaskBar | KviOption_resetUpdateGui | KviOption_groupTheme), - BOOL_OPTION("ShowTreeTaskbarHeader",false,KviOption_sectFlagTaskBar | KviOption_resetUpdateGui | KviOption_groupTheme), - BOOL_OPTION("UseLevelBasedTrayNotification",false,KviOption_sectFlagFrame), - BOOL_OPTION("MuteAllSounds",false,KviOption_sectFlagFrame), - BOOL_OPTION("CreateMinimizedChannels",false,KviOption_sectFlagFrame), - BOOL_OPTION("ShowNetworkNameForConsoleTaskBarEntry",true,KviOption_sectFlagFrame | KviOption_resetUpdateGui), - BOOL_OPTION("DrawGenderIcons",true,KviOption_sectFlagFrame | KviOption_resetUpdateGui | KviOption_groupTheme), - BOOL_OPTION("PrependGenderInfoToRealname",true,KviOption_sectFlagConnection), - BOOL_OPTION("UseIdentServiceOnlyOnConnect",true,KviOption_sectFlagConnection | KviOption_resetRestartIdentd), - BOOL_OPTION("UseSystemUrlHandlers",true,KviOption_sectFlagUrl), - BOOL_OPTION("ScaleAvatarsOnLoad",true,KviOption_sectFlagAvatar), - BOOL_OPTION("DisableNotifierFadein",false,KviOption_sectFlagFrame), - BOOL_OPTION("UseAntiAliasing",true,KviOption_sectFlagGui | KviOption_resetUpdateGui), -}; - -#define STRING_OPTION(_txt,_val,_flags) KviStringOption(KVI_STRING_OPTIONS_PREFIX _txt,_val,_flags) - -// FIXME: #warning "Remove the unused string options here!" - -#ifdef COMPILE_ON_WINDOWS - #define RUN_THE_BROWSER "run \"cmd.exe /c start \\\"\\\" \\\"$0\\\"\"" -#else - #ifdef COMPILE_KDE_SUPPORT - #define RUN_THE_BROWSER "run kfmclient openURL $0" - #else - #ifdef Q_OS_MACX - #define RUN_THE_BROWSER "run open $0" - #else - #define RUN_THE_BROWSER "run kvi_run_netscape $0" - #endif - #endif -#endif - -KviStringOption g_stringOptionsTable[KVI_NUM_STRING_OPTIONS]= -{ - STRING_OPTION("UNUSED:FrameCaption","",KviOption_sectFlagFrame), - STRING_OPTION("Nickname1",KVI_DEFAULT_NICKNAME1,KviOption_sectFlagUser), - STRING_OPTION("Nickname2",KVI_DEFAULT_NICKNAME2,KviOption_sectFlagUser), - STRING_OPTION("Nickname3",KVI_DEFAULT_NICKNAME3,KviOption_sectFlagUser), - STRING_OPTION("Nickname4",KVI_DEFAULT_NICKNAME4,KviOption_sectFlagUser), - STRING_OPTION("Username",KVI_DEFAULT_USERNAME,KviOption_sectFlagUser), - STRING_OPTION("Realname",KVI_DEFAULT_REALNAME,KviOption_sectFlagUser), - STRING_OPTION("LocalHostIp","127.0.0.1",KviOption_sectFlagIrcSocket), - STRING_OPTION("PartMessage",KVI_DEFAULT_PART_MESSAGE,KviOption_sectFlagConnection), - STRING_OPTION("QuitMessage",KVI_DEFAULT_QUIT_MESSAGE,KviOption_sectFlagConnection), - STRING_OPTION("UrlHttpCommand",RUN_THE_BROWSER,KviOption_sectFlagUrl), - STRING_OPTION("ExtendedPrivmsgPrefix","[",KviOption_sectFlagIrcView | KviOption_groupTheme), - STRING_OPTION("ExtendedPrivmsgPostfix","] ",KviOption_sectFlagIrcView | KviOption_groupTheme), - STRING_OPTION("CtcpVersionPostfix","",KviOption_sectFlagCtcp), - STRING_OPTION("CtcpUserInfoOther",KVI_DEFAULT_CTCP_USERINFO_REPLY,KviOption_sectFlagUser), - STRING_OPTION("CtcpSourcePostfix","",KviOption_sectFlagCtcp), - STRING_OPTION("UrlFtpCommand",RUN_THE_BROWSER,KviOption_sectFlagUrl), - STRING_OPTION("UrlHttpsCommand",RUN_THE_BROWSER,KviOption_sectFlagUrl), - STRING_OPTION("UrlMailtoCommand",RUN_THE_BROWSER,KviOption_sectFlagUrl), - STRING_OPTION("PreferredMediaPlayer","auto",KviOption_sectFlagFrame), - STRING_OPTION("UrlFileCommand","play $0",KviOption_sectFlagUrl), - STRING_OPTION("NickCompletionPostfix",": ",KviOption_sectFlagInput), - STRING_OPTION("UrlUnknownCommand",RUN_THE_BROWSER,KviOption_sectFlagUrl), - STRING_OPTION("IpV4ConnectionBindAddress","",KviOption_sectFlagConnection), - STRING_OPTION("IpV6ConnectionBindAddress","",KviOption_sectFlagConnection), - STRING_OPTION("DccVoiceSoundDevice", "/dev/dsp",KviOption_sectFlagDcc), - STRING_OPTION("DccVoiceMixerDevice", "/dev/mixer",KviOption_sectFlagDcc), - STRING_OPTION("AwayMessage",KVI_DEFAULT_AWAY_MESSAGE,KviOption_sectFlagConnection), - STRING_OPTION("IdentdUser","kvirc",KviOption_sectFlagConnection | KviOption_resetRestartIdentd), - STRING_OPTION("DccListenDefaultInterface","ppp0",KviOption_sectFlagDcc), - STRING_OPTION("CustomAwayNick", KVI_DEFAULT_AWAY_NICK,KviOption_sectFlagConnection), - STRING_OPTION("DefaultDccFakeAddress","",KviOption_sectFlagDcc), - STRING_OPTION("CtcpPageReply",KVI_DEFAULT_CTCP_PAGE_REPLY,KviOption_sectFlagCtcp), - STRING_OPTION("SSLCertificatePath","",KviOption_sectFlagConnection | KviOption_encodePath), - STRING_OPTION("SSLCertificatePass","",KviOption_sectFlagConnection), - STRING_OPTION("SSLPrivateKeyPath","",KviOption_sectFlagConnection | KviOption_encodePath), - STRING_OPTION("SSLPrivateKeyPass","",KviOption_sectFlagConnection), - STRING_OPTION("SoundSystem","unknown",KviOption_sectFlagFrame), - STRING_OPTION("DefaultUserMode", "", KviOption_sectFlagUser), - STRING_OPTION("LastImageDialogPath","",KviOption_sectFlagUser | KviOption_encodePath), - STRING_OPTION("IconThemeSubdir","",KviOption_sectFlagUser | KviOption_groupTheme | KviOption_resetReloadImages | KviOption_encodePath), - STRING_OPTION("IncomingPath","",KviOption_sectFlagUser | KviOption_encodePath), - STRING_OPTION("MyAvatar","",KviOption_sectFlagUser), - STRING_OPTION("DefaultTextEncoding","",KviOption_sectFlagFrame), - STRING_OPTION("WinampTextEncoding","",KviOption_sectFlagFrame), - STRING_OPTION("Mp3TagsEncoding","",KviOption_sectFlagFrame), - STRING_OPTION("CtcpUserInfoAge","",KviOption_sectFlagUser), - STRING_OPTION("CtcpUserInfoGender","",KviOption_sectFlagUser), - STRING_OPTION("CtcpUserInfoLocation","",KviOption_sectFlagUser), - STRING_OPTION("CtcpUserInfoLanguages","",KviOption_sectFlagUser), - STRING_OPTION("WordSplitters",",\"';:|.%^~!\\$#()",KviOption_sectFlagIrcView), - STRING_OPTION("OnNewQueryOpenedSound","",KviOption_sectFlagFrame), - STRING_OPTION("OnHighlightedMessageSound","",KviOption_sectFlagFrame), - STRING_OPTION("OnMeKickedSound","",KviOption_sectFlagFrame), - STRING_OPTION("OnQueryMessageSound","",KviOption_sectFlagFrame), - STRING_OPTION("IrcViewTimestampFormat","[hh:mm:ss]",KviOption_sectFlagIrcView), - STRING_OPTION("PreferredTorrentClient","auto",KviOption_sectFlagFrame) -}; - -#define STRINGLIST_OPTION(_txt,_flags) \ - KviStringListOption(KVI_STRINGLIST_OPTIONS_PREFIX _txt,QStringList(),_flags) - -#define STRINGLIST_OPTION_WITHDEFAULT(_txt,_flags,_def) \ - KviStringListOption(KVI_STRINGLIST_OPTIONS_PREFIX _txt,QStringList(_def),_flags) - - -KviStringListOption g_stringlistOptionsTable[KVI_NUM_STRINGLIST_OPTIONS]= -{ - STRINGLIST_OPTION("HighlightWords",KviOption_sectFlagIrcView), - STRINGLIST_OPTION("SpamWords",KviOption_sectFlagAntiSpam), - STRINGLIST_OPTION_WITHDEFAULT("RecentChannels",KviOption_sectFlagRecent,"#kvirc"), - STRINGLIST_OPTION("RecentServers",KviOption_sectFlagRecent), - STRINGLIST_OPTION("RecentNicknames",KviOption_sectFlagRecent), - STRINGLIST_OPTION("ModuleExtensionToolbars",KviOption_sectFlagFrame), - STRINGLIST_OPTION("ImageSearchPaths",KviOption_sectFlagFrame | KviOption_encodePath), - STRINGLIST_OPTION("RecentIrcUrls",KviOption_sectFlagRecent) -}; - -#define MIRC_COLOR_OPTION(_num,_red,_green,_blue) \ - KviColorOption(KVI_MIRCCOLOR_OPTIONS_PREFIX _num,QColor(_red,_green,_blue), \ - KviOption_sectFlagMircColor | KviOption_resetUpdateGui | KviOption_groupTheme) - -KviColorOption g_mirccolorOptionsTable[KVI_NUM_MIRCCOLOR_OPTIONS]= -{ - MIRC_COLOR_OPTION("0",255,255,255), - MIRC_COLOR_OPTION("1",0,0,0), - MIRC_COLOR_OPTION("2",0,0,140), - MIRC_COLOR_OPTION("3",0,100,0), - MIRC_COLOR_OPTION("4",230,0,0), - MIRC_COLOR_OPTION("5",150,0,0), - MIRC_COLOR_OPTION("6",80,0,80), - MIRC_COLOR_OPTION("7",255,90,0), - MIRC_COLOR_OPTION("8",255,255,0), - MIRC_COLOR_OPTION("9",0,255,0), - MIRC_COLOR_OPTION("10",0,150,180), - MIRC_COLOR_OPTION("11",170,170,255), - MIRC_COLOR_OPTION("12",15,15,255), - MIRC_COLOR_OPTION("13",200,0,200), - MIRC_COLOR_OPTION("14",80,80,80), - MIRC_COLOR_OPTION("15",170,170,170) -}; - -#define COLOR_OPTION(_name,_red,_green,_blue,_flags) \ - KviColorOption(KVI_COLOR_OPTIONS_PREFIX _name, \ - QColor(_red,_green,_blue), \ - _flags | KviOption_resetUpdateGui | KviOption_groupTheme) - -KviColorOption g_colorOptionsTable[KVI_NUM_COLOR_OPTIONS]= -{ - COLOR_OPTION("MdiBackground",0,0,0,KviOption_sectFlagMdi), - COLOR_OPTION("TaskBarNormalText",0,0,0,KviOption_sectFlagTaskBar), - COLOR_OPTION("TaskBarMinimizedText",60,60,60,KviOption_sectFlagTaskBar), - COLOR_OPTION("TaskBarHighlight1Text",0,16,144,KviOption_sectFlagTaskBar), - COLOR_OPTION("TaskBarHighlight2Text",32,0,255,KviOption_sectFlagTaskBar), - COLOR_OPTION("TaskBarProgressBar",180,180,180,KviOption_sectFlagTaskBar), - COLOR_OPTION("MdiCaptionActive",113,125,190,KviOption_sectFlagMdi), - COLOR_OPTION("MdiCaptionInactive",180,180,180,KviOption_sectFlagMdi), - COLOR_OPTION("CaptionTextActive",255,255,255,KviOption_sectFlagWindows), - COLOR_OPTION("CaptionTextActive2",255,30,30,KviOption_sectFlagWindows), - COLOR_OPTION("CaptionTextInactive",0,0,0,KviOption_sectFlagWindows), - COLOR_OPTION("CaptionTextInactive2",30,30,30,KviOption_sectFlagWindows), - COLOR_OPTION("IrcViewBackground",255,255,255,KviOption_sectFlagIrcView), - COLOR_OPTION("InputBackgroundColor",255,255,255,KviOption_sectFlagInput), - COLOR_OPTION("InputSelectionBackground",0,0,0,KviOption_sectFlagInput), - COLOR_OPTION("InputSelectionForeground",255,255,255,KviOption_sectFlagInput), - COLOR_OPTION("InputCursor",0,0,0,KviOption_sectFlagInput), - COLOR_OPTION("InputControl",200,100,0,KviOption_sectFlagInput), - COLOR_OPTION("InputForeground",0,0,0,KviOption_sectFlagInput), - COLOR_OPTION("UserListViewBackground",255,255,255,KviOption_sectFlagUserListView), - COLOR_OPTION("UserListViewOpForeground",200,0,0,KviOption_sectFlagUserListView), - COLOR_OPTION("UserListViewVoiceForeground",0,0,200,KviOption_sectFlagUserListView), - COLOR_OPTION("UserListViewNormalForeground",0,0,0,KviOption_sectFlagUserListView), - COLOR_OPTION("UserListViewSelectionBackground",0,0,0,KviOption_sectFlagUserListView), - COLOR_OPTION("UserListViewSelectionForeground",255,255,255,KviOption_sectFlagUserListView), - COLOR_OPTION("LabelBackground",255,255,255,KviOption_sectFlagLabel), - COLOR_OPTION("LabelForeground",0,0,0,KviOption_sectFlagLabel), - COLOR_OPTION("GlobalTransparencyFade",255,255,255,KviOption_sectFlagGui | KviOption_resetUpdatePseudoTransparency), - COLOR_OPTION("IrcToolBarAppletBackground",255,255,255,KviOption_sectFlagIrcToolBar), - COLOR_OPTION("IrcToolBarAppletForegroundLowContrast",180,180,180,KviOption_sectFlagIrcToolBar), - COLOR_OPTION("IrcToolBarAppletForegroundMidContrast",110,110,110,KviOption_sectFlagIrcToolBar), - COLOR_OPTION("IrcToolBarAppletForegroundHighContrastInactive1",40,40,40,KviOption_sectFlagIrcToolBar), - COLOR_OPTION("IrcToolBarAppletForegroundHighContrastInactive2",40,40,40,KviOption_sectFlagIrcToolBar), - COLOR_OPTION("IrcToolBarAppletForegroundHighContrastActive1",0,0,0,KviOption_sectFlagIrcToolBar), - COLOR_OPTION("IrcToolBarAppletForegroundHighContrastActive2",0,60,0,KviOption_sectFlagIrcToolBar), - COLOR_OPTION("TreeTaskBarBackground",255,255,255,KviOption_sectFlagTaskBar), - COLOR_OPTION("TreeTaskBarActiveBackground",200,200,200,KviOption_sectFlagTaskBar), - COLOR_OPTION("TreeTaskBarForeground",0,0,0,KviOption_sectFlagTaskBar), - COLOR_OPTION("TreeTaskBarActiveForeground",0,0,0,KviOption_sectFlagTaskBar), - COLOR_OPTION("TreeTaskBarHighlight1Foreground",0,16,144,KviOption_sectFlagTaskBar), - COLOR_OPTION("TreeTaskBarHighlight2Foreground",32,0,255,KviOption_sectFlagTaskBar), - COLOR_OPTION("TreeTaskBarProgress",150,150,150,KviOption_sectFlagTaskBar), - COLOR_OPTION("UserListViewHalfOpForeground",119,0,178,KviOption_sectFlagUserListView), - COLOR_OPTION("TaskBarHighlight3Text",128,20,255,KviOption_sectFlagTaskBar), - COLOR_OPTION("TaskBarHighlight4Text",220,0,255,KviOption_sectFlagTaskBar), - COLOR_OPTION("TaskBarHighlight5Text",255,0,0,KviOption_sectFlagTaskBar), - COLOR_OPTION("TreeTaskBarHighlight3Foreground",128,0,255,KviOption_sectFlagTaskBar), - COLOR_OPTION("TreeTaskBarHighlight4Foreground",220,0,255,KviOption_sectFlagTaskBar), - COLOR_OPTION("TreeTaskBarHighlight5Foreground",255,0,0,KviOption_sectFlagTaskBar), - COLOR_OPTION("UserListViewChanAdminForeground",83,54,5,KviOption_sectFlagUserListView), - COLOR_OPTION("UserListViewUserOpForeground",0,127,178,KviOption_sectFlagUserListView), - COLOR_OPTION("UserListViewGrid",110,110,110,KviOption_sectFlagUserListView), - COLOR_OPTION("UserListViewChanOwnerForeground",81,87,111,KviOption_sectFlagUserListView), - COLOR_OPTION("IrcViewMarkLine",40,40,40,KviOption_sectFlagIrcView), - COLOR_OPTION("UserListViewAwayForeground",143,143,143,KviOption_sectFlagUserListView), - COLOR_OPTION("UserListViewOwnForeground",255,255,0,KviOption_sectFlagUserListView) -}; - - -#define IC_COLOR_OPTION(_num,_red,_green,_blue) \ - KviColorOption( \ - KVI_ICCOLOR_OPTIONS_PREFIX _num, \ - QColor(_red,_green,_blue), \ - KviOption_sectFlagTaskBar | KviOption_resetUpdateGui | KviOption_groupTheme) - -KviColorOption g_iccolorOptionsTable[KVI_NUM_ICCOLOR_OPTIONS]= -{ - IC_COLOR_OPTION("0",250,250,0), - IC_COLOR_OPTION("1",0,0,0), - IC_COLOR_OPTION("2",0,0,200), - IC_COLOR_OPTION("3",200,0,0), - IC_COLOR_OPTION("4",255,255,255), - IC_COLOR_OPTION("5",0,150,190), - IC_COLOR_OPTION("6",0,130,0), - IC_COLOR_OPTION("7",150,0,170) -}; - -#define PIXMAP_OPTION(_name,_flags) \ - KviPixmapOption( \ - KVI_PIXMAP_OPTIONS_PREFIX _name , \ - KviPixmap(), \ - _flags | KviOption_resetUpdateGui) - -KviPixmapOption g_pixmapOptionsTable[KVI_NUM_PIXMAP_OPTIONS]= -{ - PIXMAP_OPTION("MdiBackground",KviOption_sectFlagMdi | KviOption_groupTheme), - PIXMAP_OPTION("IrcViewBackground",KviOption_sectFlagIrcView | KviOption_groupTheme), - PIXMAP_OPTION("InputBackground",KviOption_sectFlagInput | KviOption_groupTheme), - PIXMAP_OPTION("UserListViewBackground",KviOption_sectFlagUserListView | KviOption_groupTheme), - PIXMAP_OPTION("LabelBackground",KviOption_sectFlagLabel | KviOption_groupTheme), - PIXMAP_OPTION("MyAvatar",KviOption_sectFlagUser), - PIXMAP_OPTION("IrcToolBarAppletBackground",KviOption_sectFlagIrcToolBar | KviOption_groupTheme), - PIXMAP_OPTION("TreeTaskBarBackground",KviOption_sectFlagTaskBar | KviOption_groupTheme), - PIXMAP_OPTION("GlobalTransparencyBackground",KviOption_sectFlagGui | KviOption_resetUpdatePseudoTransparency | KviOption_groupTheme) -}; - -//#define INT_OPTION(_name,_value,_flags) -// { -// KVI_INT_OPTIONS_PREFIX _name , -// _value , -// _flags -// } -// -//KviIntOption g_intOptionsTable[KVI_NUM_INT_OPTIONS]= -//{ -// INT_OPTION("IrcViewMaxBufferSize",KVI_IRCVIEW_MAX_LINES,KviOption_sectFlagIrcView), -// INT_OPTION("IrcViewTollTipTimeoutInMsec",1800,KviOption_sectFlagIrcView), -// INT_OPTION("IrcViewToolTipHideTimeoutInMsec",10000,KviOption_sectFlagIrcView) -//}; - -#define UINT_OPTION(_name,_value,_flags) \ - KviUIntOption( \ - KVI_UINT_OPTIONS_PREFIX _name , \ - _value , \ - _flags \ - ) - -KviUIntOption g_uintOptionsTable[KVI_NUM_UINT_OPTIONS]= -{ - UINT_OPTION("IrcSocketTimeout",60,KviOption_sectFlagIrcSocket), - UINT_OPTION("ModuleCleanupTimerInterval",90,KviOption_sectFlagModules), - UINT_OPTION("ModuleCleanupTimeout",180,KviOption_sectFlagModules), - UINT_OPTION("MaxCtcpRequests",5,KviOption_sectFlagCtcp), - UINT_OPTION("CtcpFloodCheckInterval",10,KviOption_sectFlagCtcp), - UINT_OPTION("TotalConnectionTime",0,0), - UINT_OPTION("DccSocketTimeout",360,KviOption_sectFlagDcc), - UINT_OPTION("DccSendIdleStepInMSec",30,KviOption_sectFlagDcc), - UINT_OPTION("DccSendPacketSize",4096,KviOption_sectFlagDcc), - UINT_OPTION("GlobalTransparencyParentFadeFactor",10,KviOption_sectFlagGui | KviOption_resetUpdatePseudoTransparency | KviOption_groupTheme), - UINT_OPTION("GlobalTransparencyChildFadeFactor",50,KviOption_sectFlagGui | KviOption_resetUpdatePseudoTransparency | KviOption_groupTheme), - UINT_OPTION("NotifyListCheckTimeInSecs",180,KviOption_sectFlagConnection), - UINT_OPTION("SocketQueueFlushTimeout",500,KviOption_sectFlagIrcSocket), - UINT_OPTION("OutgoingTrafficLimitUSeconds",2000000,KviOption_sectFlagIrcSocket), - UINT_OPTION("NotifyListIsOnDelayTimeInSecs",6,KviOption_sectFlagConnection), - UINT_OPTION("NotifyListUserhostDelayTimeInSecs",6,KviOption_sectFlagConnection), - UINT_OPTION("TreeTaskBarMinimumWidth",24,KviOption_sectFlagTaskBar | KviOption_resetUpdateTaskBar), - UINT_OPTION("AvatarOfferTimeoutInSecs",60,KviOption_sectFlagAvatar), - UINT_OPTION("IrcViewMaxBufferSize",1024,KviOption_sectFlagIrcView), - UINT_OPTION("IrcViewToolTipTimeoutInMsec",1200,KviOption_sectFlagIrcView), - UINT_OPTION("IrcViewToolTipHideTimeoutInMsec",12000,KviOption_sectFlagIrcView), - UINT_OPTION("DccVoicePreBufferSize",32000,KviOption_sectFlagDcc), - UINT_OPTION("IdentdPort",113,KviOption_sectFlagConnection | KviOption_resetRestartIdentd), - UINT_OPTION("AvatarScaleWidth",80,KviOption_sectFlagAvatar | KviOption_resetUpdateGui), - UINT_OPTION("AvatarScaleHeight",80,KviOption_sectFlagAvatar | KviOption_resetUpdateGui), - UINT_OPTION("DccMinPort",30000,KviOption_sectFlagDcc), - UINT_OPTION("DccMaxPort",31000,KviOption_sectFlagDcc), - UINT_OPTION("SoundOfferTimeoutInSecs",60,KviOption_sectFlagConnection), - UINT_OPTION("MaximumRequestedAvatarSize",256000,KviOption_sectFlagAvatar), - UINT_OPTION("TreeTaskBarMaximumWidth",200,KviOption_sectFlagTaskBar | KviOption_resetUpdateTaskBar), - UINT_OPTION("PasteDelay",2000,KviOption_sectFlagInput), - UINT_OPTION("MaxDccSendTransfers",10,KviOption_sectFlagDcc), - UINT_OPTION("MaxDccSlots",64,KviOption_sectFlagDcc), - UINT_OPTION("TileMethod",5,KviOption_sectFlagMdi), - UINT_OPTION("LagMeterHeartbeat",5000,KviOption_sectFlagConnection | KviOption_resetRestartLagMeter), - UINT_OPTION("LagAlarmTime",120000,KviOption_sectFlagConnection), - UINT_OPTION("UNUSED",0,KviOption_sectFlagFrame), - UINT_OPTION("TaskBarButtonMinWidth",100,KviOption_sectFlagTaskBar), - UINT_OPTION("OutputVerbosityLevel",KVI_VERBOSITY_LEVEL_NORMAL,KviOption_sectFlagFrame), - UINT_OPTION("IrcContextAppletWidth",160,KviOption_sectFlagFrame), - UINT_OPTION("MinHighlightLevel",0,KviOption_uintMinHighlightLevel), - UINT_OPTION("UserListViewGridType",3,KviOption_sectFlagUserListView | KviOption_resetUpdateGui | KviOption_groupTheme), - UINT_OPTION("TaskBarMaximumRows",2,KviOption_sectFlagFrame), - UINT_OPTION("MaxAutoReconnectAttempts",15,KviOption_sectFlagFrame), - UINT_OPTION("AutoReconnectDelay",10,KviOption_sectFlagFrame), - UINT_OPTION("MaxDccSendSpeed",0,KviOption_sectFlagFrame), - UINT_OPTION("MaxDccRecvSpeed",0,KviOption_sectFlagFrame), - UINT_OPTION("TimeStampForeground",KVI_DARKGRAY,KviOption_sectFlagIrcView | KviOption_resetUpdateGui | KviOption_groupTheme), - UINT_OPTION("TimeStampBackground",KVI_TRANSPARENT,KviOption_sectFlagIrcView | KviOption_resetUpdateGui | KviOption_groupTheme), - UINT_OPTION("UserExperienceLevel",1,KviOption_sectFlagUser), - UINT_OPTION("ClassicTaskBarMaximumButtonWidth",100,KviOption_sectFlagGeometry | KviOption_resetUpdateGui | KviOption_groupTheme), - UINT_OPTION("DefaultBanType",7,KviOption_sectFlagIrcSocket), - UINT_OPTION("IrcViewPixmapAlign",0,KviOption_sectFlagIrcView | KviOption_groupTheme), - UINT_OPTION("UserListPixmapAlign",0,KviOption_sectFlagFrame | KviOption_groupTheme), - UINT_OPTION("ToolBarAppletPixmapAlign",0,KviOption_sectFlagFrame | KviOption_groupTheme), - UINT_OPTION("TreeTaskBarPixmapAlign",0,KviOption_sectFlagFrame | KviOption_groupTheme), - UINT_OPTION("InputPixmapAlign",0,KviOption_sectFlagFrame | KviOption_groupTheme), - UINT_OPTION("AutoFlushLogs",30,KviOption_sectFlagFrame ), - UINT_OPTION("MinTrayLowLevelMessage",1,KviOption_sectFlagFrame ), - UINT_OPTION("MinTrayHighLevelMessage",4,KviOption_sectFlagFrame ), - UINT_OPTION("IdentdOutputMode",KviIdentdOutputMode::Quiet,KviOption_sectFlagConnection ), - UINT_OPTION("ScaleAvatarsOnLoadHeight",600,KviOption_sectFlagAvatar ), - UINT_OPTION("ScaleAvatarsOnLoadWidth",800,KviOption_sectFlagAvatar ), - UINT_OPTION("NotifierActiveTransparency",90,KviOption_sectFlagFrame ), - UINT_OPTION("NotifierInactiveTransparency",40,KviOption_sectFlagFrame ) -}; - -#define FONT_OPTION(_name,_face,_size,_flags) \ - KviFontOption( \ - KVI_FONT_OPTIONS_PREFIX _name , \ - QFont(_face,_size) , \ - _flags | KviOption_groupTheme \ - ) - -KviFontOption g_fontOptionsTable[KVI_NUM_FONT_OPTIONS]= -{ -#ifdef COMPILE_ON_WINDOWS - FONT_OPTION("IrcView","Arial",9,KviOption_sectFlagIrcView | KviOption_resetUpdateGui), - FONT_OPTION("Input","Arial",12,KviOption_sectFlagInput | KviOption_resetUpdateGui), - FONT_OPTION("UserListView","Arial",9,KviOption_sectFlagUserListView | KviOption_resetUpdateGui), - FONT_OPTION("Label","Arial",9,KviOption_sectFlagLabel | KviOption_resetUpdateGui), - FONT_OPTION("Application","Arial",9,KviOption_sectFlagGui | KviOption_resetUpdateAppFont), - FONT_OPTION("IrcToolBarApplet","Arial",9,KviOption_sectFlagIrcToolBar | KviOption_resetUpdateGui), - FONT_OPTION("Taskbar","Arial",9,KviOption_sectFlagTaskBar | KviOption_resetUpdateTaskBar) -#else - #if QT_VERSION >= 300 - FONT_OPTION("IrcView","Monospace",10,KviOption_sectFlagIrcView | KviOption_resetUpdateGui), - FONT_OPTION("Input","Sans Serif",12,KviOption_sectFlagInput | KviOption_resetUpdateGui), - FONT_OPTION("UserListView","Sans Serif",10,KviOption_sectFlagUserListView | KviOption_resetUpdateGui), - FONT_OPTION("Label","Sans Serif",10,KviOption_sectFlagLabel | KviOption_resetUpdateGui), - FONT_OPTION("Application","Sans Serif",10,KviOption_sectFlagGui | KviOption_resetUpdateAppFont), - FONT_OPTION("IrcToolBarApplet","Sans Serif",10,KviOption_sectFlagIrcToolBar | KviOption_resetUpdateGui), - FONT_OPTION("Taskbar","Sans Serif",10,KviOption_sectFlagTaskBar | KviOption_resetUpdateTaskBar) - #else - FONT_OPTION("IrcView","Monospace",12,KviOption_sectFlagIrcView | KviOption_resetUpdateGui), - FONT_OPTION("Input","Sans Serif",16,KviOption_sectFlagInput | KviOption_resetUpdateGui), - FONT_OPTION("UserListView","Sans Serif",12,KviOption_sectFlagUserListView | KviOption_resetUpdateGui), - FONT_OPTION("Label","Sans Serif",12,KviOption_sectFlagLabel | KviOption_resetUpdateGui), - FONT_OPTION("Application","Sans Serif",12,KviOption_sectFlagGui | KviOption_resetUpdateAppFont), - FONT_OPTION("IrcToolBarApplet","Sans Serif",10,KviOption_sectFlagIrcToolBar | KviOption_resetUpdateGui), - FONT_OPTION("Taskbar","Sans Serif",10,KviOption_sectFlagTaskBar | KviOption_resetUpdateTaskBar) - #endif -#endif -}; - -#define MSGTYPE_OPTION(_name,_text,_icon,_levl) \ - KviMsgTypeOption( \ - KVI_MSGTYPE_OPTIONS_PREFIX _name , \ - KviMsgType(_text,_icon,KVI_BLACK,KVI_TRANSPARENT,true,_levl), \ - KviOption_sectFlagMsgType | KviOption_groupTheme \ - ) - -#define MSGTYPE_OPTION_SPEC(_name,_text,_icon,_fore,_back,_levl) \ - KviMsgTypeOption( \ - KVI_MSGTYPE_OPTIONS_PREFIX _name , \ - KviMsgType(_text,_icon,_fore,_back,true,_levl), \ - KviOption_sectFlagMsgType | KviOption_groupTheme \ - ) - - - -// FIXME: #warning "FIX THE ICONS HERE!!!" - -KviMsgTypeOption g_msgtypeOptionsTable[KVI_NUM_MSGTYPE_OPTIONS]= -{ - MSGTYPE_OPTION("Echo",__tr_no_lookup("Normal text"),KVI_SMALLICON_NONE,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION_SPEC("Selection",__tr_no_lookup("Selection"),KVI_SMALLICON_NONE,KVI_WHITE,KVI_BLACK,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION_SPEC("Highlight",__tr_no_lookup("Highlighted text"),KVI_SMALLICON_ALERT,KVI_WHITE,KVI_BLACK,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION_SPEC("Url",__tr_no_lookup("URL foreground"),KVI_SMALLICON_NONE,KVI_BLUE,KVI_TRANSPARENT,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION_SPEC("Link",__tr_no_lookup("Link overlay foreground"),KVI_SMALLICON_NONE,KVI_BLUE,KVI_TRANSPARENT,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION_SPEC("ParserError",__tr_no_lookup("Parser error"),KVI_SMALLICON_PARSERERROR,KVI_RED,KVI_TRANSPARENT,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION_SPEC("ParserWarning",__tr_no_lookup("Parser warning"),KVI_SMALLICON_PARSERWARNING,KVI_RED,KVI_TRANSPARENT,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("HostLookup",__tr_no_lookup("Host lookup result"),KVI_SMALLICON_SERVER,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("SocketMessage",__tr_no_lookup("Socket message"),KVI_SMALLICON_SOCKETMESSAGE,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("SocketWarning",__tr_no_lookup("Socket warning"),KVI_SMALLICON_SOCKETWARNING,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION_SPEC("SocketError",__tr_no_lookup("Socket error"),KVI_SMALLICON_SOCKETERROR,KVI_RED,KVI_TRANSPARENT,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION_SPEC("SystemError",__tr_no_lookup("System error"),KVI_SMALLICON_SYSTEMERROR,KVI_RED,KVI_TRANSPARENT,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("Raw",__tr_no_lookup("Raw data to server"),KVI_SMALLICON_RAW,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("Connection",__tr_no_lookup("Connection status"),KVI_SMALLICON_WORLD,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("SystemWarning",__tr_no_lookup("System warning"),KVI_SMALLICON_SYSTEMWARNING,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("SystemMessage",__tr_no_lookup("System message"),KVI_SMALLICON_SYSTEMMESSAGE,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("UnhandledReply",__tr_no_lookup("Unhandled server reply"),KVI_SMALLICON_UNHANDLED,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("ServerInfo",__tr_no_lookup("Server information"),KVI_SMALLICON_SERVERINFO,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("Motd",__tr_no_lookup("Server Message of the Day"),KVI_SMALLICON_MOTD,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("ServerPing",__tr_no_lookup("Server ping"),KVI_SMALLICON_SERVERPING,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("Join",__tr_no_lookup("Join message"),KVI_SMALLICON_JOIN,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("Part",__tr_no_lookup("Part message"),KVI_SMALLICON_PART,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("Unrecognized",__tr_no_lookup("Unrecognized/broken message"),KVI_SMALLICON_UNRECOGNIZED,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("Topic",__tr_no_lookup("Topic message"),KVI_SMALLICON_TOPIC,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("OwnPrivateMessage",__tr_no_lookup("Own private message"),KVI_SMALLICON_OWNPRIVMSG,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("ChannelPrivateMessage",__tr_no_lookup("Channel private message"),KVI_SMALLICON_CHANPRIVMSG,KVI_MSGTYPE_LEVEL_4), - MSGTYPE_OPTION("QueryPrivateMessage",__tr_no_lookup("Query private message"),KVI_SMALLICON_QUERYPRIVMSG,KVI_MSGTYPE_LEVEL_4), - MSGTYPE_OPTION("CtcpReply",__tr_no_lookup("CTCP reply"),KVI_SMALLICON_CTCPREPLY,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("CtcpRequestReplied",__tr_no_lookup("CTCP request replied"),KVI_SMALLICON_CTCPREQUESTREPLIED,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("CtcpRequestIgnored",__tr_no_lookup("CTCP request ignored"),KVI_SMALLICON_CTCPREQUESTIGNORED,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("CtcpRequestFlood",__tr_no_lookup("CTCP request flood warning"),KVI_SMALLICON_CTCPREQUESTFLOOD,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("CtcpRequestUnknown",__tr_no_lookup("CTCP request unknown"),KVI_SMALLICON_CTCPREQUESTUNKNOWN,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("Action",__tr_no_lookup("User action"),KVI_SMALLICON_ACTION,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("AvatarChange",__tr_no_lookup("Avatar change"),KVI_SMALLICON_AVATAR,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("Quit",__tr_no_lookup("Quit message"),KVI_SMALLICON_QUIT,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("Split",__tr_no_lookup("Split message"),KVI_SMALLICON_SPLIT,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("QuitSplit",__tr_no_lookup("Quit on netsplit message"),KVI_SMALLICON_QUITSPLIT,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("Nick",__tr_no_lookup("Nick changes"),KVI_SMALLICON_NICK,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("Op",__tr_no_lookup("+o mode change"),KVI_SMALLICON_OP,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("Deop",__tr_no_lookup("-o mode change"),KVI_SMALLICON_DEOP,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("Voice",__tr_no_lookup("+v mode change"),KVI_SMALLICON_VOICE,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("Devoice",__tr_no_lookup("-v mode change"),KVI_SMALLICON_DEVOICE,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("Mode",__tr_no_lookup("Multiple user mode change"),KVI_SMALLICON_MODE,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("Key",__tr_no_lookup("Channel key change"),KVI_SMALLICON_KEY,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("Limit",__tr_no_lookup("Channel limit change"),KVI_SMALLICON_LIMIT,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("Ban",__tr_no_lookup("+b mode change"),KVI_SMALLICON_BAN,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("Unban",__tr_no_lookup("-b mode change"),KVI_SMALLICON_UNBAN,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("BanExcept",__tr_no_lookup("+e mode change"),KVI_SMALLICON_BANEXCEPT,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("BanUnexcept",__tr_no_lookup("-e mode change"),KVI_SMALLICON_BANUNEXCEPT,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("InviteExcept",__tr_no_lookup("+I mode change"),KVI_SMALLICON_INVITEEXCEPT,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("InviteUnexcept",__tr_no_lookup("-I mode change"),KVI_SMALLICON_INVITEUNEXCEPT,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("ChanMode",__tr_no_lookup("Multiple channel mode change"),KVI_SMALLICON_CHANMODE,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("Who",__tr_no_lookup("Who reply"),KVI_SMALLICON_WHO,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("DccRequest",__tr_no_lookup("DCC request"),KVI_SMALLICON_DCCREQUEST,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("DccMsg",__tr_no_lookup("DCC message"),KVI_SMALLICON_DCCMSG,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("DccError",__tr_no_lookup("DCC error"),KVI_SMALLICON_DCCERROR,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("NicknameProblem",__tr_no_lookup("Nickname problem"),KVI_SMALLICON_NICKNAMEPROBLEM,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("WhoisUser",__tr_no_lookup("Whois user reply"),KVI_SMALLICON_WHOISUSER,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("WhoisChannels",__tr_no_lookup("Whois channels reply"),KVI_SMALLICON_WHOISCHANNELS,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("WhoisIdle",__tr_no_lookup("Whois idle reply"),KVI_SMALLICON_WHOISIDLE,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("WhoisServer",__tr_no_lookup("Whois server reply"),KVI_SMALLICON_WHOISSERVER,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("WhoisOther",__tr_no_lookup("Whois other reply"),KVI_SMALLICON_WHOISOTHER,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("CreationTime",__tr_no_lookup("Channel creation time reply"),KVI_SMALLICON_TIME,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("NotifyOnLine",__tr_no_lookup("Notify list joins"),KVI_SMALLICON_NOTIFYONLINE,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("NotifyOffLine",__tr_no_lookup("Notify list leaves"),KVI_SMALLICON_NOTIFYOFFLINE,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("OwnPrivmsgCrypted",__tr_no_lookup("Own encrypted private message"),KVI_SMALLICON_OWNPRIVMSGCRYPTED,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("ChanPrivmsgCrypted",__tr_no_lookup("Channel encrypted private message"),KVI_SMALLICON_CHANPRIVMSGCRYPTED,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("QueryPrivmsgCrypted",__tr_no_lookup("Query encrypted private message"),KVI_SMALLICON_QUERYPRIVMSGCRYPTED,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("DccChatMsg",__tr_no_lookup("DCC chat message"),KVI_SMALLICON_DCCCHATMSG,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("DccChatMsgCrypted",__tr_no_lookup("Encrypted DCC chat message"),KVI_SMALLICON_DCCCHATMSGCRYPTED,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("Irc",__tr_no_lookup("Login operations completed"),KVI_SMALLICON_IRC,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("Kick",__tr_no_lookup("Kick action"),KVI_SMALLICON_KICK,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("Links",__tr_no_lookup("Links reply"),KVI_SMALLICON_LINKS,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("Spam",__tr_no_lookup("Spam report"),KVI_SMALLICON_SPAM,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("Icq",__tr_no_lookup("ICQ message"),KVI_SMALLICON_ICQ,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("IcqMessage",__tr_no_lookup("ICQ user-message"),KVI_SMALLICON_MESSAGE,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("IcqMessageSent",__tr_no_lookup("Outgoing ICQ user-message"),KVI_SMALLICON_MESSAGESENT,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("ChannelNotice",__tr_no_lookup("Channel notice"),KVI_SMALLICON_CHANNELNOTICE,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("ChannelNoticeCrypted",__tr_no_lookup("Encrypted channel notice"),KVI_SMALLICON_CHANNELNOTICECRYPTED,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("QueryNotice",__tr_no_lookup("Query notice"),KVI_SMALLICON_QUERYNOTICE,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("QueryNoticeCrypted",__tr_no_lookup("Encrypted query notice"),KVI_SMALLICON_QUERYNOTICECRYPTED,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("ServerNotice",__tr_no_lookup("Server notice"),KVI_SMALLICON_SERVERNOTICE,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("HalfOp",__tr_no_lookup("Halfop mode change"),KVI_SMALLICON_HALFOP,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("CtcpReplyUnknown",__tr_no_lookup("Unknown CTCP reply"),KVI_SMALLICON_CTCPREPLYUNKNOWN,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("NickServ",__tr_no_lookup("NickServ message"),KVI_SMALLICON_NICKSERV,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("ChanServ",__tr_no_lookup("ChanServ message"),KVI_SMALLICON_CHANSERV,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("Away",__tr_no_lookup("Away message"),KVI_SMALLICON_AWAY,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("Ident",__tr_no_lookup("Ident message"),KVI_SMALLICON_IDENT,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("List",__tr_no_lookup("Channel list message"),KVI_SMALLICON_LIST,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("HalfDeOp",__tr_no_lookup("Half-deop mode change"),KVI_SMALLICON_HALFDEOP,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("Invite",__tr_no_lookup("Invite message"),KVI_SMALLICON_INVITE,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("Multimedia",__tr_no_lookup("Multimedia message"),KVI_SMALLICON_MULTIMEDIA,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("QueryTrace",__tr_no_lookup("Query trace message"),KVI_SMALLICON_QUERYTRACE,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("Wallops",__tr_no_lookup("Wallops message"),KVI_SMALLICON_WALLOPS,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("JoinError",__tr_no_lookup("Join error message"),KVI_SMALLICON_NOCHANNEL,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("BroadcastPrivmsg",__tr_no_lookup("Broadcast private message"),KVI_SMALLICON_BROADCASTPRIVMSG,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("BroadcastNotice",__tr_no_lookup("Broadcast notice"),KVI_SMALLICON_BROADCASTNOTICE,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("MeKick",__tr_no_lookup("Am kicked"),KVI_SMALLICON_MEKICK,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeOp",__tr_no_lookup("Am op'd"),KVI_SMALLICON_MEOP,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeVoice",__tr_no_lookup("Am voiced"),KVI_SMALLICON_MEVOICE,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeDeOp",__tr_no_lookup("Am deop'd"),KVI_SMALLICON_MEDEOP,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeDeVoice",__tr_no_lookup("Am devoiced"),KVI_SMALLICON_MEDEVOICE,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeHalfOp",__tr_no_lookup("Am halfop'd"),KVI_SMALLICON_MEHALFOP,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeDeHalfOp",__tr_no_lookup("Am de-halfop'd"),KVI_SMALLICON_MEDEHALFOP,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeBan",__tr_no_lookup("Ban matching my mask"),KVI_SMALLICON_MEBAN,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeUnban",__tr_no_lookup("Unban matching my mask"),KVI_SMALLICON_MEUNBAN,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeBanExcept",__tr_no_lookup("Ban exception matching my mask"),KVI_SMALLICON_MEBANEXCEPT,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeBanUnExcept",__tr_no_lookup("Ban unexception matching my mask"),KVI_SMALLICON_MEBANUNEXCEPT,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeInviteExcept",__tr_no_lookup("Invite exception matching my mask"),KVI_SMALLICON_MEINVITEEXCEPT,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeInviteUnexcept",__tr_no_lookup("Invite unexception matching my mask"),KVI_SMALLICON_MEINVITEUNEXCEPT,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("Ignore",__tr_no_lookup("Ignored user message"),KVI_SMALLICON_IGNORE,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("Stats",__tr_no_lookup("Server statistics"),KVI_SMALLICON_STATS,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("SSL",__tr_no_lookup("SSL message"),KVI_SMALLICON_SSL,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("Search",__tr_no_lookup("Search"),KVI_SMALLICON_SEARCH,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("GenericSuccess",__tr_no_lookup("Generic success"),KVI_SMALLICON_CYANSQUARE,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION("GenericStatus",__tr_no_lookup("Generic status"),KVI_SMALLICON_GREENSQUARE,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("GenericVerbose",__tr_no_lookup("Generic verbose message"),KVI_SMALLICON_DKGREENSQUARE,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("GenericWarning",__tr_no_lookup("Generic warning"),KVI_SMALLICON_YELLOWSQUARE,KVI_MSGTYPE_LEVEL_3), - MSGTYPE_OPTION_SPEC("GenericError",__tr_no_lookup("Generic error"),KVI_SMALLICON_REDSQUARE,KVI_RED,KVI_TRANSPARENT,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION_SPEC("GenericCritical",__tr_no_lookup("Generic critical error"),KVI_SMALLICON_BLACKSQUARE,KVI_RED,KVI_TRANSPARENT,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("ChanAdmin",__tr_no_lookup("Chan admin status set"),KVI_SMALLICON_CHANADMIN,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("ChanUnAdmin",__tr_no_lookup("Chan admin status unset"),KVI_SMALLICON_CHANUNADMIN,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeChanAdmin",__tr_no_lookup("Own chan admin status set"),KVI_SMALLICON_MECHANADMIN,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeChanUnAdmin",__tr_no_lookup("Own chan admin status unset"),KVI_SMALLICON_MECHANUNADMIN,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("UserOp",__tr_no_lookup("Userop mode change"),KVI_SMALLICON_USEROP,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("UserDeOp",__tr_no_lookup("User-deop mode change"),KVI_SMALLICON_DEUSEROP,KVI_MSGTYPE_LEVEL_2), - MSGTYPE_OPTION("MeUserOp",__tr_no_lookup("Am userop'd"),KVI_SMALLICON_MEUSEROP,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeDeUserOp",__tr_no_lookup("Am de-userop'd"),KVI_SMALLICON_MEDEUSEROP,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION_SPEC("Verbose",__tr_no_lookup("Verbose/Debug"),KVI_SMALLICON_BINARYTEXT,KVI_DARKGRAY,KVI_TRANSPARENT,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("ChanOwner",__tr_no_lookup("Chan owner status set"),KVI_SMALLICON_CHANOWNER,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("ChanUnOwner",__tr_no_lookup("Chan owner status unset"),KVI_SMALLICON_CHANUNOWNER,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeChanOwner",__tr_no_lookup("Own chan owner status set"),KVI_SMALLICON_MECHANOWNER,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION("MeChanUnOwner",__tr_no_lookup("Own chan owner status unset"),KVI_SMALLICON_MECHANUNOWNER,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION_SPEC("ServerError",__tr_no_lookup("Server error"),KVI_SMALLICON_SERVERERROR,KVI_RED,KVI_TRANSPARENT,KVI_MSGTYPE_LEVEL_5), - MSGTYPE_OPTION_SPEC("Help",__tr_no_lookup("Help"),KVI_SMALLICON_HELP,KVI_DARKGREEN,KVI_TRANSPARENT,KVI_MSGTYPE_LEVEL_1), - MSGTYPE_OPTION("TextEncoding",__tr_no_lookup("Text Encoding Server message"),KVI_SMALLICON_TEXTENCODING,KVI_MSGTYPE_LEVEL_1), - // TODO: add icon and check what level means - // Pragma: the message level is a warning level that is rendered in the taskbar - // messages with higher level are rendered with more visible color (i.e. red) - // messages with very high level might flash the tray and end up in the notifier - // level 1 or 2 for standard torrent messages is ok - MSGTYPE_OPTION("BitTorrent",__tr_no_lookup("BitTorrent message"),KVI_SMALLICON_MULTIMEDIA,KVI_MSGTYPE_LEVEL_2) -}; - -static const char * options_section_table[KVI_NUM_OPTION_SECT_FLAGS] = -{ - "None", "Frame", "Mdi", "Windows", - "TaskBar", "IrcView", "MsgType", "MircColor", - "Input", "UserParser", "Connection", "IrcSocket", - "User", "UserListView","Label", "Modules", - "Ctcp", "Dcc", "Gui", "IrcToolBar", - "Logging", "AntiSpam", "Avatar", "Url", - "Recent", "Geometry" -}; - - -static void config_set_section(int flag,KviConfig * cfg) -{ - int index = flag & KviOption_sectMask; - if((index < KVI_NUM_OPTION_SECT_FLAGS) && (index >= 0)) - { - cfg->setGroup(options_section_table[index]); - } else cfg->setGroup(""); // Default group -} - -void KviApp::loadOptions() -{ - KviStr buffer; - if(getReadOnlyConfigPath(buffer,KVI_CONFIGFILE_MAIN)) - { - KviConfig cfg(buffer.ptr(),KviConfig::Read); - - int prg = 12; - int i; - - #define READ_OPTIONS(_num,_table,_readFnc) \ - for(i=0;i<_num;i++) \ - { \ - config_set_section(_table[i].flags,&cfg); \ - _table[i].option = cfg._readFnc(_table[i].name,_table[i].option); \ - } \ - prg += 3; \ - KVI_SPLASH_SET_PROGRESS(prg) - - READ_OPTIONS(KVI_NUM_RECT_OPTIONS,g_rectOptionsTable,readRectEntry) - READ_OPTIONS(KVI_NUM_BOOL_OPTIONS,g_boolOptionsTable,readBoolEntry) - READ_OPTIONS(KVI_NUM_STRING_OPTIONS,g_stringOptionsTable,readQStringEntry) - READ_OPTIONS(KVI_NUM_COLOR_OPTIONS,g_colorOptionsTable,readColorEntry) - READ_OPTIONS(KVI_NUM_PIXMAP_OPTIONS,g_pixmapOptionsTable,readPixmapEntry) - READ_OPTIONS(KVI_NUM_UINT_OPTIONS,g_uintOptionsTable,readUIntEntry) - READ_OPTIONS(KVI_NUM_FONT_OPTIONS,g_fontOptionsTable,readFontEntry) - READ_OPTIONS(KVI_NUM_MSGTYPE_OPTIONS,g_msgtypeOptionsTable,readMsgTypeEntry) - READ_OPTIONS(KVI_NUM_STRINGLIST_OPTIONS,g_stringlistOptionsTable,readStringListEntry) - READ_OPTIONS(KVI_NUM_MIRCCOLOR_OPTIONS,g_mirccolorOptionsTable,readColorEntry) - READ_OPTIONS(KVI_NUM_ICCOLOR_OPTIONS,g_iccolorOptionsTable,readColorEntry) - - for(i=0;i<KVI_NUM_STRING_OPTIONS;i++) - { - if(g_stringOptionsTable[i].flags & KviOption_encodePath) - KviStringConversion::decodePath(g_stringOptionsTable[i].option); - } - - for(i=0;i<KVI_NUM_STRINGLIST_OPTIONS;i++) - { - if(g_stringlistOptionsTable[i].flags & KviOption_encodePath) - KviStringConversion::decodePath(g_stringlistOptionsTable[i].option); - } - - #undef READ_OPTIONS - } // else already have the defaults -} - -void KviApp::saveOptions() -{ - QString buffer; - - saveRecentChannels(); - - getLocalKvircDirectory(buffer,Config,KVI_CONFIGFILE_MAIN); - KviConfig cfg(buffer,KviConfig::Write); - - int i; - - #define WRITE_OPTIONS(_num,_table) \ - for(i=0;i<_num;i++) \ - { \ - config_set_section(_table[i].flags,&cfg); \ - cfg.writeEntry(_table[i].name,_table[i].option); \ - } - - WRITE_OPTIONS(KVI_NUM_RECT_OPTIONS,g_rectOptionsTable) - WRITE_OPTIONS(KVI_NUM_BOOL_OPTIONS,g_boolOptionsTable) - for(i=0;i<KVI_NUM_STRING_OPTIONS;i++) - { - if(g_stringOptionsTable[i].flags & KviOption_encodePath) - KviStringConversion::encodePath(g_stringOptionsTable[i].option); - } - WRITE_OPTIONS(KVI_NUM_STRING_OPTIONS,g_stringOptionsTable) - for(i=0;i<KVI_NUM_STRING_OPTIONS;i++) - { - if(g_stringOptionsTable[i].flags & KviOption_encodePath) - KviStringConversion::decodePath(g_stringOptionsTable[i].option); - } - WRITE_OPTIONS(KVI_NUM_COLOR_OPTIONS,g_colorOptionsTable) - WRITE_OPTIONS(KVI_NUM_PIXMAP_OPTIONS,g_pixmapOptionsTable) - WRITE_OPTIONS(KVI_NUM_UINT_OPTIONS,g_uintOptionsTable) - WRITE_OPTIONS(KVI_NUM_FONT_OPTIONS,g_fontOptionsTable) - WRITE_OPTIONS(KVI_NUM_MSGTYPE_OPTIONS,g_msgtypeOptionsTable) - for(i=0;i<KVI_NUM_STRINGLIST_OPTIONS;i++) - { - if(g_stringlistOptionsTable[i].flags & KviOption_encodePath) - KviStringConversion::encodePath(g_stringlistOptionsTable[i].option); - } - WRITE_OPTIONS(KVI_NUM_STRINGLIST_OPTIONS,g_stringlistOptionsTable) - for(i=0;i<KVI_NUM_STRINGLIST_OPTIONS;i++) - { - if(g_stringlistOptionsTable[i].flags & KviOption_encodePath) - KviStringConversion::decodePath(g_stringlistOptionsTable[i].option); - } - WRITE_OPTIONS(KVI_NUM_MIRCCOLOR_OPTIONS,g_mirccolorOptionsTable) - WRITE_OPTIONS(KVI_NUM_ICCOLOR_OPTIONS,g_iccolorOptionsTable) - - #undef WRITE_OPTIONS -} - - -#undef WRITE_OPTIONS - -#define WRITE_OPTIONS(_num,_table) \ - for(i=0;i<_num;i++) \ - { \ - if(_table[i].flags & KviOption_groupTheme) \ - cfg.writeEntry(_table[i].name,_table[i].option); \ - } - -namespace KviTheme -{ - // utility functions for the KviTheme namespace (kvi_theme.h) - // that are implemented here for convenience (in saving the options) - bool save(KviThemeInfo &options) - { - QString szD = options.absoluteDirectory(); - - if(szD.isEmpty()) - { - options.setLastError(__tr2qs("Missing absolute directory for the theme information")); - return false; - } - - if(!KviFileUtils::directoryExists(szD)) - { - if(!KviFileUtils::makeDir(szD)) - { - options.setLastError(__tr2qs("Failed to create the theme directory")); - return false; - } - } - - szD.append(KVI_PATH_SEPARATOR_CHAR); - szD.append(KVI_THEMEINFO_FILE_NAME); - - if(!options.save(szD)) - { - return false; - } - - szD = options.absoluteDirectory(); - szD.append(KVI_PATH_SEPARATOR_CHAR); - szD.append(KVI_THEMEDATA_FILE_NAME); - - KviConfig cfg(szD,KviConfig::Write); - - cfg.setGroup(KVI_THEMEDATA_CONFIG_GROUP); - - int i; - - WRITE_OPTIONS(KVI_NUM_RECT_OPTIONS,g_rectOptionsTable) - WRITE_OPTIONS(KVI_NUM_BOOL_OPTIONS,g_boolOptionsTable) - WRITE_OPTIONS(KVI_NUM_STRING_OPTIONS,g_stringOptionsTable) - WRITE_OPTIONS(KVI_NUM_COLOR_OPTIONS,g_colorOptionsTable) - WRITE_OPTIONS(KVI_NUM_UINT_OPTIONS,g_uintOptionsTable) - WRITE_OPTIONS(KVI_NUM_FONT_OPTIONS,g_fontOptionsTable) - WRITE_OPTIONS(KVI_NUM_MSGTYPE_OPTIONS,g_msgtypeOptionsTable) - WRITE_OPTIONS(KVI_NUM_STRINGLIST_OPTIONS,g_stringlistOptionsTable) - WRITE_OPTIONS(KVI_NUM_MIRCCOLOR_OPTIONS,g_mirccolorOptionsTable) - WRITE_OPTIONS(KVI_NUM_ICCOLOR_OPTIONS,g_iccolorOptionsTable) - - #undef WRITE_OPTIONS - - // the pixmap options need special processing - for(i=0;i<KVI_NUM_PIXMAP_OPTIONS;i++) - { - if(g_pixmapOptionsTable[i].flags & KviOption_groupTheme) - { - if(g_pixmapOptionsTable[i].option.pixmap()) - { - QString szPixPath = options.absoluteDirectory(); - szPixPath.append(KVI_PATH_SEPARATOR_CHAR); - QString szPixName = g_pixmapOptionsTable[i].name; - szPixName += ".png"; - szPixPath += szPixName; - - if(g_pixmapOptionsTable[i].option.pixmap()->save(szPixPath,"PNG")) - { - cfg.writeEntry(g_pixmapOptionsTable[i].name,szPixName); - } else { - // we ignore this error for now - debug("failed to save %s",szPixPath.utf8().data()); - cfg.writeEntry(g_pixmapOptionsTable[i].name,""); - } - } else { - cfg.writeEntry(g_pixmapOptionsTable[i].name,""); - } - } - } - - cfg.writeEntry("stringIconThemeSubdir",options.subdirectory()); - - // find all the "kvi_bigicon" images that we can find in the main pics directory - QString szPicsPath; - - g_pApp->getGlobalKvircDirectory(szPicsPath,KviApp::Pics); - QDir d(szPicsPath); - QStringList sl = d.entryList("kvi_bigicon_*.png",QDir::Files); - - for(QStringList::Iterator it=sl.begin();it != sl.end();it++) - { - KviCachedPixmap * p = g_pIconManager->getPixmapWithCache(*it); - if(p) - { - QString szPixPath = options.absoluteDirectory(); - szPixPath.append(KVI_PATH_SEPARATOR_CHAR); - szPixPath += *it; - - if(!KviFileUtils::copyFile(p->path(),szPixPath)) - { - options.setLastError(__tr2qs("Failed to save one of the theme images")); - return false; - } - } - } - - - szD = options.absoluteDirectory(); - szD.append(KVI_PATH_SEPARATOR_CHAR); - szD.append(KVI_SMALLICONS_SUBDIRECTORY); - - if(!KviFileUtils::makeDir(szD)) - { - options.setLastError(__tr2qs("Failed to create the theme subdirectory")); - return false; - } - - // We actually need to *save* the small icons since - // we have a compatibility mode that can load them from - // the old format kvi_smallicon_XY.png multiimage libraries. - - for(int j=0;j<KVI_NUM_SMALL_ICONS;j++) - { - QPixmap * pix = g_pIconManager->getSmallIcon(j); - - QString szPixPath = options.absoluteDirectory(); - szPixPath.append(KVI_PATH_SEPARATOR_CHAR); - szPixPath.append(KVI_SMALLICONS_SUBDIRECTORY); - szPixPath.append(KVI_PATH_SEPARATOR_CHAR); - szPixPath.append("kcs_"); - szPixPath.append(g_pIconManager->getSmallIconName(j)); - szPixPath.append(".png"); - - if(!pix->save(szPixPath,"PNG",90)) - { - options.setLastError(__tr2qs("Failed to save one of the theme images")); - return false; - } - } - - return true; - } - - bool load(const QString &themeDir,KviThemeInfo &buffer) - { - if(!buffer.loadFromDirectory(themeDir)) - return false; // makes sure that themedata exists too - - // reset the current theme subdir - KVI_OPTION_STRING(KviOption_stringIconThemeSubdir) = ""; - - // reset the splash screen pointer - QString szPointerFile; - g_pApp->getLocalKvircDirectory(szPointerFile,KviApp::Themes,"current-splash"); - KviFileUtils::removeFile(szPointerFile); - - QString szD = themeDir; - KviQString::ensureLastCharIs(szD,KVI_PATH_SEPARATOR_CHAR); - szD.append(KVI_THEMEDATA_FILE_NAME); - - KviConfig cfg(szD,KviConfig::Read); - - cfg.setGroup(KVI_THEMEDATA_CONFIG_GROUP); - - int i; - int iResetFlags = 0; - - #undef READ_OPTIONS - - #define READ_OPTIONS(_num,_table,_readFnc) \ - for(i=0;i<_num;i++) \ - { \ - if(_table[i].flags & KviOption_groupTheme) \ - { \ - if(cfg.hasKey(_table[i].name)) \ - { \ - iResetFlags |= (_table[i].flags & KviOption_resetMask); \ - _table[i].option = cfg._readFnc(_table[i].name,_table[i].option); \ - } \ - } \ - } - - #define READ_ALL_OPTIONS(_num,_table,_readFnc) \ - for(i=0;i<_num;i++) \ - { \ - if(cfg.hasKey(_table[i].name)) \ - { \ - iResetFlags |= (_table[i].flags & KviOption_resetMask); \ - _table[i].option = cfg._readFnc(_table[i].name,_table[i].option); \ - } \ - } - - READ_OPTIONS(KVI_NUM_RECT_OPTIONS,g_rectOptionsTable,readRectEntry) - READ_OPTIONS(KVI_NUM_BOOL_OPTIONS,g_boolOptionsTable,readBoolEntry) - READ_OPTIONS(KVI_NUM_STRING_OPTIONS,g_stringOptionsTable,readQStringEntry) - READ_OPTIONS(KVI_NUM_COLOR_OPTIONS,g_colorOptionsTable,readColorEntry) - READ_OPTIONS(KVI_NUM_UINT_OPTIONS,g_uintOptionsTable,readUIntEntry) - READ_OPTIONS(KVI_NUM_FONT_OPTIONS,g_fontOptionsTable,readFontEntry) - READ_ALL_OPTIONS(KVI_NUM_MSGTYPE_OPTIONS,g_msgtypeOptionsTable,readMsgTypeEntry) - READ_OPTIONS(KVI_NUM_STRINGLIST_OPTIONS,g_stringlistOptionsTable,readStringListEntry) - READ_OPTIONS(KVI_NUM_MIRCCOLOR_OPTIONS,g_mirccolorOptionsTable,readColorEntry) - READ_OPTIONS(KVI_NUM_ICCOLOR_OPTIONS,g_iccolorOptionsTable,readColorEntry) - - #undef READ_OPTIONS - #undef READ_ALL_OPTIONS - KVI_OPTION_STRING(KviOption_stringIconThemeSubdir).stripWhiteSpace(); - - - // the pixmap options need special processing - for(i=0;i<KVI_NUM_PIXMAP_OPTIONS;i++) - { - if(g_pixmapOptionsTable[i].flags & KviOption_groupTheme) - { - if(cfg.hasKey(g_pixmapOptionsTable[i].name)) - { - QString szVal = cfg.readQStringEntry(g_pixmapOptionsTable[i].name,""); - szVal.stripWhiteSpace(); - QString szBuffer; - if(!szVal.isEmpty()) - { - g_pApp->findImage(szBuffer,szVal); - } else { - szBuffer = szVal; - } - - KviStringConversion::fromString(szBuffer,g_pixmapOptionsTable[i].option); - - // reset anyway - iResetFlags |= g_pixmapOptionsTable[i].flags & KviOption_resetMask; - } - } - } - - // create the splash screen pointer if this theme has some pixmaps in it - if(!KVI_OPTION_STRING(KviOption_stringIconThemeSubdir).isEmpty()) - KviFileUtils::writeFile(szPointerFile,KVI_OPTION_STRING(KviOption_stringIconThemeSubdir)); - - // force reloading of images anyway - g_pApp->optionResetUpdate(iResetFlags | KviOption_resetReloadImages); - - return true; - } -}; - -void KviApp::listAvailableOptions(KviWindow *wnd) -{ - int i; - - #define LIST_OPTIONS(__txt,__num,__table) \ - wnd->output(KVI_OUT_SYSTEMMESSAGE,"%c%s%c",KVI_TEXT_BOLD,__txt,KVI_TEXT_BOLD); \ - for(i = 0;i < __num;i++)wnd->outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__table[i].name); - - LIST_OPTIONS(__tr("Boolean options (1/0)"),KVI_NUM_BOOL_OPTIONS,g_boolOptionsTable) - LIST_OPTIONS(__tr("Rectangle options (x,y,width,height)"),KVI_NUM_RECT_OPTIONS,g_rectOptionsTable) - LIST_OPTIONS(__tr("String options (string value)"),KVI_NUM_STRING_OPTIONS,g_stringOptionsTable) - LIST_OPTIONS(__tr("Color options (#RRGGBB)"),KVI_NUM_COLOR_OPTIONS,g_colorOptionsTable) - LIST_OPTIONS(__tr("Mirccolor options (#RRGGBB)"),KVI_NUM_MIRCCOLOR_OPTIONS,g_mirccolorOptionsTable) - LIST_OPTIONS(__tr("Irc context color options (#RRGGBB)"),KVI_NUM_ICCOLOR_OPTIONS,g_iccolorOptionsTable) - LIST_OPTIONS(__tr("Pixmap options (image path)"),KVI_NUM_PIXMAP_OPTIONS,g_pixmapOptionsTable) - LIST_OPTIONS(__tr("Unsigned integer options (unsigned integer constant)"),KVI_NUM_UINT_OPTIONS,g_uintOptionsTable) - LIST_OPTIONS(__tr("Font options (family,pointsize,style,charset,weight,flags (biusf))"),KVI_NUM_FONT_OPTIONS,g_fontOptionsTable) - LIST_OPTIONS(__tr("Message color options (image_id,foreground,background,logFlag (0/1))"),KVI_NUM_MSGTYPE_OPTIONS,g_msgtypeOptionsTable) - LIST_OPTIONS(__tr("String list options (comma separated list of strings)"),KVI_NUM_STRINGLIST_OPTIONS,g_stringlistOptionsTable) - - #undef LIST_OPTIONS -} - -//using namespace KviStringConversion; - -bool KviApp::getOptionString(const char * optName,QString &buffer) -{ - - #define GET_OPTION_STRING(__numOpt,__table,__prefix,__prefixLen) \ - if(kvi_strEqualCIN(optName,__prefix,__prefixLen)) \ - { \ - for(int i=0;i < __numOpt;i++) \ - { \ - if(kvi_strEqualCI(optName,__table[i].name)) \ - { \ - KviStringConversion::toString(__table[i].option,buffer); \ - return true; \ - } \ - } \ - return false; \ - } - - // WARNING : stringlist prefix must go BEFORE the string prefix (otherwise it will match) - - GET_OPTION_STRING(KVI_NUM_BOOL_OPTIONS,g_boolOptionsTable,KVI_BOOL_OPTIONS_PREFIX,KVI_BOOL_OPTIONS_PREFIX_LEN) - GET_OPTION_STRING(KVI_NUM_RECT_OPTIONS,g_rectOptionsTable,KVI_BOOL_OPTIONS_PREFIX,KVI_BOOL_OPTIONS_PREFIX_LEN) - GET_OPTION_STRING(KVI_NUM_STRINGLIST_OPTIONS,g_stringlistOptionsTable,KVI_STRINGLIST_OPTIONS_PREFIX,KVI_STRINGLIST_OPTIONS_PREFIX_LEN) - GET_OPTION_STRING(KVI_NUM_STRING_OPTIONS,g_stringOptionsTable,KVI_STRING_OPTIONS_PREFIX,KVI_STRING_OPTIONS_PREFIX_LEN) - GET_OPTION_STRING(KVI_NUM_COLOR_OPTIONS,g_colorOptionsTable,KVI_COLOR_OPTIONS_PREFIX,KVI_COLOR_OPTIONS_PREFIX_LEN) - GET_OPTION_STRING(KVI_NUM_MIRCCOLOR_OPTIONS,g_mirccolorOptionsTable,KVI_MIRCCOLOR_OPTIONS_PREFIX,KVI_MIRCCOLOR_OPTIONS_PREFIX_LEN) - GET_OPTION_STRING(KVI_NUM_ICCOLOR_OPTIONS,g_iccolorOptionsTable,KVI_ICCOLOR_OPTIONS_PREFIX,KVI_ICCOLOR_OPTIONS_PREFIX_LEN) - GET_OPTION_STRING(KVI_NUM_PIXMAP_OPTIONS,g_pixmapOptionsTable,KVI_PIXMAP_OPTIONS_PREFIX,KVI_PIXMAP_OPTIONS_PREFIX_LEN) - GET_OPTION_STRING(KVI_NUM_UINT_OPTIONS,g_uintOptionsTable,KVI_UINT_OPTIONS_PREFIX,KVI_UINT_OPTIONS_PREFIX_LEN) - GET_OPTION_STRING(KVI_NUM_FONT_OPTIONS,g_fontOptionsTable,KVI_FONT_OPTIONS_PREFIX,KVI_FONT_OPTIONS_PREFIX_LEN) - GET_OPTION_STRING(KVI_NUM_MSGTYPE_OPTIONS,g_msgtypeOptionsTable,KVI_MSGTYPE_OPTIONS_PREFIX,KVI_MSGTYPE_OPTIONS_PREFIX_LEN) - return false; - - #undef GET_OPTION_STRING -} - -void KviApp::optionResetUpdate(int flags) -{ - if(flags & KviOption_resetReloadImages) - { - g_pIconManager->reloadImages(); - emit reloadImages(); - } - - if(flags & KviOption_resetUpdateAppFont) - { - updateApplicationFont(); - } - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - if(flags & KviOption_resetUpdatePseudoTransparency) - { - triggerUpdatePseudoTransparency(); - } -#endif - - if(flags & KviOption_resetRestartIdentd) - { - if(g_iIdentDaemonRunningUsers) - g_pFrame->executeInternalCommand(KVI_INTERNALCOMMAND_IDENT_STOP); - - if(KVI_OPTION_BOOL(KviOption_boolUseIdentService) && !KVI_OPTION_BOOL(KviOption_boolUseIdentServiceOnlyOnConnect)) - g_pFrame->executeInternalCommand(KVI_INTERNALCOMMAND_IDENT_START); - } - - if(flags & KviOption_resetUpdateGui) - { - triggerUpdateGui(); - } - - if(flags & KviOption_resetUpdateTaskBar) - { - g_pFrame->recreateTaskBar(); - } - - if(flags & KviOption_resetRestartNotifyList) - { - g_pApp->restartNotifyLists(); - } - - if(flags & KviOption_resetRestartLagMeter) - { - g_pApp->restartLagMeters(); - } - - if(flags & KviOption_resetRecentChannels) - { - g_pApp->buildRecentChannels(); - } -} - -bool KviApp::setOptionValue(const char * optName,const QString &value) -{ - - #define SET_OPTION_VALUE(__numOpt,__table,__prefix,__prefixLen) \ - if(kvi_strEqualCIN(optName,__prefix,__prefixLen)) \ - { \ - for(int i=0;i < __numOpt;i++) \ - { \ - if(kvi_strEqualCI(optName,__table[i].name)) \ - { \ - if(!KviStringConversion::fromString(value,__table[i].option))return false; \ - optionResetUpdate(__table[i].flags); \ - return true; \ - } \ - } \ - return false; \ - } - - SET_OPTION_VALUE(KVI_NUM_BOOL_OPTIONS,g_boolOptionsTable,KVI_BOOL_OPTIONS_PREFIX,KVI_BOOL_OPTIONS_PREFIX_LEN) - SET_OPTION_VALUE(KVI_NUM_RECT_OPTIONS,g_rectOptionsTable,KVI_BOOL_OPTIONS_PREFIX,KVI_BOOL_OPTIONS_PREFIX_LEN) - SET_OPTION_VALUE(KVI_NUM_STRINGLIST_OPTIONS,g_stringlistOptionsTable,KVI_STRINGLIST_OPTIONS_PREFIX,KVI_STRINGLIST_OPTIONS_PREFIX_LEN) - SET_OPTION_VALUE(KVI_NUM_STRING_OPTIONS,g_stringOptionsTable,KVI_STRING_OPTIONS_PREFIX,KVI_STRING_OPTIONS_PREFIX_LEN) - SET_OPTION_VALUE(KVI_NUM_COLOR_OPTIONS,g_colorOptionsTable,KVI_COLOR_OPTIONS_PREFIX,KVI_COLOR_OPTIONS_PREFIX_LEN) - SET_OPTION_VALUE(KVI_NUM_MIRCCOLOR_OPTIONS,g_mirccolorOptionsTable,KVI_MIRCCOLOR_OPTIONS_PREFIX,KVI_MIRCCOLOR_OPTIONS_PREFIX_LEN) - SET_OPTION_VALUE(KVI_NUM_ICCOLOR_OPTIONS,g_iccolorOptionsTable,KVI_ICCOLOR_OPTIONS_PREFIX,KVI_ICCOLOR_OPTIONS_PREFIX_LEN) -// SET_OPTION_VALUE(KVI_NUM_PIXMAP_OPTIONS,g_pixmapOptionsTable,KVI_PIXMAP_OPTIONS_PREFIX,KVI_PIXMAP_OPTIONS_PREFIX_LEN) - SET_OPTION_VALUE(KVI_NUM_UINT_OPTIONS,g_uintOptionsTable,KVI_UINT_OPTIONS_PREFIX,KVI_UINT_OPTIONS_PREFIX_LEN) - SET_OPTION_VALUE(KVI_NUM_FONT_OPTIONS,g_fontOptionsTable,KVI_FONT_OPTIONS_PREFIX,KVI_FONT_OPTIONS_PREFIX_LEN) - SET_OPTION_VALUE(KVI_NUM_MSGTYPE_OPTIONS,g_msgtypeOptionsTable,KVI_MSGTYPE_OPTIONS_PREFIX,KVI_MSGTYPE_OPTIONS_PREFIX_LEN) - - if(kvi_strEqualCI(optName,"stringlistRecentChannels")) - buildRecentChannels(); - // The pixmap options have special treating - if(kvi_strEqualCIN(optName,KVI_PIXMAP_OPTIONS_PREFIX,KVI_PIXMAP_OPTIONS_PREFIX_LEN)) - { - // We lookup the image path (so we allow also relative paths for this option type) - QString szVal = value; - szVal.stripWhiteSpace(); - QString szBuffer; - if(!szVal.isEmpty()) - { - findImage(szBuffer,szVal); - } else { - szBuffer = szVal; - } - - for(int i=0;i < KVI_NUM_PIXMAP_OPTIONS;i++) - { - if(kvi_strEqualCI(optName,g_pixmapOptionsTable[i].name)) - { - if(!KviStringConversion::fromString(szBuffer,g_pixmapOptionsTable[i].option))return false; - optionResetUpdate(g_pixmapOptionsTable[i].flags); - return true; - } - } - return false; - } - - return false; - - #undef SET_OPTION_VALUE -} diff --git a/3.4.0/src/kvirc/kernel/kvi_options.h b/3.4.0/src/kvirc/kernel/kvi_options.h deleted file mode 100644 index 7f278d88db..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_options.h +++ /dev/null @@ -1,737 +0,0 @@ -#ifndef _KVI_OPTIONS_H_ -#define _KVI_OPTIONS_H_ - -//============================================================================= -// -// File : kvi_options.h -// Creation date : Tue Jun 20 2000 12:42:07 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" -#include "kvi_pixmap.h" -#include "kvi_msgtype.h" - -#include <qrect.h> -#include <qpixmap.h> -#include <qcolor.h> -#include <qfont.h> -#include <qstringlist.h> - -// option structures - - -#define DECLARE_OPTION_STRUCT(_cname,_type) \ - class _cname \ - { \ - public: \ - const char * name; \ - _type option; \ - int flags; \ - public: \ - _cname(const char * n,_type o,int f) \ - : name(n) , option(o) , flags(f) {}; \ - ~_cname() {}; \ - }; - -DECLARE_OPTION_STRUCT(KviBoolOption,bool) -DECLARE_OPTION_STRUCT(KviRectOption,QRect) -DECLARE_OPTION_STRUCT(KviStringOption,QString) -DECLARE_OPTION_STRUCT(KviColorOption,QColor) -DECLARE_OPTION_STRUCT(KviFontOption,QFont) -DECLARE_OPTION_STRUCT(KviPixmapOption,KviPixmap) -//DECLARE_OPTION_STRUCT(KviIntOption,int) -DECLARE_OPTION_STRUCT(KviUIntOption,unsigned int) -DECLARE_OPTION_STRUCT(KviMsgTypeOption,KviMsgType) -DECLARE_OPTION_STRUCT(KviStringListOption,QStringList) - -#define KVI_COLOR_EXT_USER_OP 50 -#define KVI_COLOR_EXT_USER_HALFOP 51 -#define KVI_COLOR_EXT_USER_ADMIN 52 -#define KVI_COLOR_EXT_USER_OWNER 53 -#define KVI_COLOR_EXT_USER_VOICE 54 -#define KVI_COLOR_EXT_USER_USEROP 55 -#define KVI_COLOR_EXT_USER_NORMAL 56 -#define KVI_COLOR_CUSTOM 255 -#define KVI_COLOR_OWN 254 - -// option entry indexes - -#define KVI_RECT_OPTIONS_PREFIX "rect" -#define KVI_RECT_OPTIONS_PREFIX_LEN 4 - -#define KviOption_rectFrameGeometry 0 /* internal */ -/* FIXME: this should be in the options module (local config) ? */ -#define KviOption_rectGeneralOptionsDialogGeometry 1 /* internal */ -/* FIXME: this should be in the regusers module (local config) ? */ -#define KviOption_rectRegisteredUsersDialogGeometry 2 /* internal */ - -#define KVI_NUM_RECT_OPTIONS 3 - - - -#define KVI_BOOL_OPTIONS_PREFIX "bool" -#define KVI_BOOL_OPTIONS_PREFIX_LEN 4 - -#define KviOption_boolWindowsRememberProperties 0 /* interface::features::global */ -#define KviOption_boolIrcViewShowImages 1 /* interface::features::components::ircview */ -#define KviOption_boolIrcViewTimestamp 2 /* interface::features::components::ircview */ -#define KviOption_boolIrcViewUrlHighlighting 3 /* interface::features::components::ircview */ -#define KviOption_boolIrcViewWrapMargin 4 /* interface::features::components::ircview */ -#define KviOption_boolInputHistoryCursorAtEnd 5 /* interface::features::components::input */ -#define KviOption_boolAvoidParserWarnings 6 /* ircengine::uparser */ -#define KviOption_boolUseProxyHost 7 /* transport */ -#define KviOption_boolShowGeneralOptionsDialogAsToplevel 8 /* interface::features::global */ -#define KviOption_boolForceBrutalQuit 9 /* irc */ -#define KviOption_boolShowPingPong 10 /* ircoutput */ -#define KviOption_boolPopupNotifierOnNewQueryMessages 11 /* query */ -#define KviOption_boolShowExtendedServerInfo 12 /* ircoutput */ -#define KviOption_boolEchoNumericTopic 13 /* ircoutput */ -#define KviOption_boolShowOwnParts 14 /* ircoutput */ -#define KviOption_boolUseAntiSpamOnPrivmsg 15 /* ircengine::outputcontrol::antispam */ -#define KviOption_boolUseExtendedPrivmsgView 16 /* ircengine::outputcontrol::privmsg */ -#define KviOption_boolShowUserAndHostInPrivmsgView 17 /* ircengine::outputcontrol::privmsg */ -#define KviOption_boolUseWordHighlighting 18 /* ircengine::outputcontrol::highlighting */ -#define KviOption_boolUseBigIcons 19 /* internal */ -#define KviOption_boolCleanupUnusedModules 20 /* uparser ? */ -#define KviOption_boolIgnoreCtcpPing 21 /* ctcp */ -#define KviOption_boolIgnoreCtcpVersion 22 /* ctcp */ -#define KviOption_boolUseCtcpFloodProtection 23 /* ctcp */ -#define KviOption_boolDisableBrokenEventHandlers 24 /* ircengine::uparser */ -#define KviOption_boolIgnoreCtcpClientinfo 25 /* ctcp */ -#define KviOption_boolIgnoreCtcpUserinfo 26 /* ctcp */ -#define KviOption_boolIgnoreCtcpFinger 27 /* ctcp */ -#define KviOption_boolIgnoreCtcpSource 28 /* ctcp */ -#define KviOption_boolIgnoreCtcpTime 29 /* ctcp */ -#define KviOption_boolRequestMissingAvatars 30 /* ctcp::avatar */ -#define KviOption_boolShowCompactModeChanges 31 /* ircoutput */ -#define KviOption_boolIgnoreCtcpDcc 32 /* ctcp */ -#define KviOption_boolAutoAcceptDccChat 33 /* dcc::chat */ -#define KviOption_boolAutoAcceptDccSend 34 /* dcc::send */ -#define KviOption_boolSendZeroAckInDccRecv 35 /* dcc::send */ -#define KviOption_boolUseFastDccSend 36 /* dcc::send */ -#define KviOption_boolObtainGlobalBackgroundFromKde 37 /* interface::look::global */ -#define KviOption_boolUseTaskBarIrcContextIndicator 38 /* interface::features::global */ -#define KviOption_boolUseGlobalApplicationFont 39 /* interface::look::global */ -#define KviOption_boolAlwaysQuitKVIrcClosingLastConsole 40 /* internal */ -#define KviOption_boolAlwaysDisconnectClosingConnectedConsole 41 /* internal */ -#define KviOption_boolFlashWindowOnHighlightedMessages 42 /* highlighting */ -#define KviOption_boolPopupNotifierOnHighlightedMessages 43 /* highlighting */ -#define KviOption_boolFlashWindowOnNotifyOnLine 44 /* notify */ -#define KviOption_boolIrcViewTimestampUTC 45 /* interface::features::components::ircview */ -#define KviOption_boolUseGlobalPseudoTransparency 46 /* interface::look::global */ -#define KviOption_boolUseNotifyList 47 /* ircengine::notifylist */ -#define KviOption_boolNotifyListChangesToActiveWindow 48 /* ircengine::notifylist */ -#define KviOption_boolAutoResumeDccSendWhenAutoAccepted 49 /* dcc::send */ -#define KviOption_boolLimitOutgoingTraffic 50 /* transport */ -#define KviOption_boolSendUnknownCommandsAsRaw 51 /* ircengine::uparser */ -#define KviOption_boolUserListViewDrawGrid 52 /* look & feel::interface look::userlist */ -#define KviOption_boolShowChannelSyncTime 53 /* ircoutput */ -#define KviOption_boolRejoinChannelOnKick 54 /* irc */ -#define KviOption_boolKeepChannelOpenOnKick 55 /* irc */ -#define KviOption_boolAutoCloseDccSendOnSuccess 56 /* dcc::send */ -#define KviOption_boolNotifyDccSendSuccessInConsole 57 /* dcc::send */ -#define KviOption_boolCreateMinimizedDccSend 58 /* dcc::send */ -#define KviOption_boolCreateMinimizedDccChat 59 /* dcc::chat */ -#define KviOption_boolAutoAcceptIncomingAvatars 60 /* irc::ctcp::avatar */ -#define KviOption_boolUseNickCompletionPostfixForFirstWordOnly 61 -#define KviOption_boolUseTaskBarIcons 62 /* interface::features */ -#define KviOption_boolCreateMinimizedDccSendWhenAutoAccepted 63 /* dcc::send */ -#define KviOption_boolCreateMinimizedDccChatWhenAutoAccepted 64 /* dcc::chat */ -#define KviOption_boolDccGuessIpFromServerWhenLocalIsUnroutable 65 /* dcc */ -#define KviOption_boolShowRegisteredUsersDialogAsToplevel 66 /* interface::features::global */ -#define KviOption_boolAutoLogQueries 67 /* ircengine::logging */ -#define KviOption_boolAutoLogChannels 68 /* ircendine::logging */ -#define KviOption_boolAutoLogDccChat 69 /* ircengine::logging */ -#define KviOption_boolAutoLogConsole 70 /* ircengine::logging */ -#define KviOption_boolSilentAntiSpam 71 /* ircengine::antispam */ -#define KviOption_boolUseIncomingDccMediaTypeSavePath 72 /* dcc::send */ -#define KviOption_boolNotifyListSendUserhostForOnlineUsers 73 /* ircengine::notifylist */ -#define KviOption_boolUseIntelligentNotifyListManager 74 /* ircengine::notifylist */ -#define KviOption_boolUseWatchListIfAvailable 75 /* ircengine::notifylist */ -#define KviOption_boolUseTreeWindowListTaskBar 76 /* interface::features::global */ -#define KviOption_boolBindIrcIpV4ConnectionsToSpecifiedAddress 77 /* connection::transport */ -#define KviOption_boolBindIrcIpV6ConnectionsToSpecifiedAddress 78 /* connection::transport */ -#define KviOption_boolUseAntiSpamOnNotice 79 /* ircengine::antispam */ -#define KviOption_boolSetLastAvatarAsDefaultForRegisteredUsers 80 /* irc::ctcp::avatar */ -#define KviOption_boolCantAcceptIncomingDccConnections 81 /* dcc::general */ -#define KviOption_boolIgnoreCtcpAvatar 82 /* irc::ctcp::floodprotection */ -#define KviOption_boolCtcpRepliesToActiveWindow 83 /* ctcp */ -#define KviOption_boolAutoAcceptDccCanvas 84 -#define KviOption_boolNotifyDccSendSuccessInNotifier 85 /* dcc::send */ -#define KviOption_boolKillBrokenTimers 86 /* ircengine::uparser */ -#define KviOption_boolDccVoiceVolumeSliderControlsPCM 87 /* dcc::voice */ -#define KviOption_boolDccVoiceForceHalfDuplex 88 /* dcc::voice */ -#define KviOption_boolAutoAcceptDccVoice 89 /* dcc::voice */ -#define KviOption_boolCreateMinimizedDccVoice 90 /* dcc::voice */ -#define KviOption_boolCreateMinimizedDccVoiceWhenAutoAccepted 91 /* dcc::voice */ -#define KviOption_boolUseIdentService 92 /* connection::ident */ -#define KviOption_boolShowTipAtStartup 93 /* internal */ -#define KviOption_boolIdentdEnableIpV6 94 /* connection::ident */ -#define KviOption_boolIdentdIpV6ContainsIpV4 95 /* connection::ident */ -#define KviOption_boolScaleAvatars 96 /* ctcp::avatar */ -#define KviOption_boolColorNicks 97 /* interface::features::components::ircview */ -#define KviOption_boolBoldedNicks 98 /* interface::features::components::ircview */ -#define KviOption_boolDccListenOnSpecifiedInterfaceByDefault 99 /* dcc */ -#define KviOption_boolChangeNickAway 100 /* ircengine::away */ -#define KviOption_boolAutoGeneratedAwayNick 101 /* ircengine::away */ -#define KviOption_boolExitAwayOnInput 102 /* ircengine::away */ -#define KviOption_boolAlwaysHighlightNick 103 /* ircengine::outputcontrol::highlighting */ -#define KviOption_boolShowChannelsJoinOnIrc 104 /* internal */ -#define KviOption_boolShowChannelsJoinDialogAsToplevel 105 /* FIXME: internal ??? */ -#define KviOption_boolUserDefinedPortRange 106 /* dcc */ -#define KviOption_boolCreateQueryOnPrivmsg 107 /* irc::query */ -#define KviOption_boolCreateQueryOnNotice 108 /* irc::query */ -#define KviOption_boolCreateMinimizedQuery 109 /* irc::query */ -#define KviOption_boolAutoJoinOnInvite 110 /* irc */ -#define KviOption_boolShowServersConnectDialogOnStart 111 /* connection::ircservers */ -#define KviOption_boolShowServersConnectDialogAsToplevel 112 /* FIXME: internal ?? */ -#define KviOption_boolAcceptBrokenFileNameDccResumeRequests 113 /* dcc::send */ -#define KviOption_boolAutoReconnectOnUnexpectedDisconnect 114 /* connection */ -#define KviOption_boolRejoinChannelsAfterReconnect 115 /* connection */ -#define KviOption_boolReopenQueriesAfterReconnect 116 /* connection */ -#define KviOption_boolEnableQueryTracing 117 /* irc::query */ -#define KviOption_boolOperatorMessagesToActiveWindow 118 /* irc::output */ -#define KviOption_boolInvitesToActiveWindow 119 /* irc::output */ -#define KviOption_boolShowChannelUserFlagInPrivmsgView 120 /* ircengine::outputcontrol::privmsg */ -#define KviOption_boolDccSendFakeAddressByDefault 121 /* dcc::general */ -#define KviOption_boolUseTaskBarActivityMeter 122 /* irc::output */ -#define KviOption_boolCloseServerWidgetAfterConnect 123 /* IMPLEMENTATION NEEDED !!! */ -#define KviOption_boolShowIdentityDialogAsToplevel 124 /* ??? */ -#define KviOption_boolShowUserChannelIcons 125 /* look & feel::interface features::userlist */ -#define KviOption_boolShowUserChannelState 126 /* look & feel::interface features::userlist */ -#define KviOption_boolEnableIgnoreOnPrivMsg 127 /* irc::ignore */ -#define KviOption_boolVerboseIgnore 128 /* irc::ignore */ -#define KviOption_boolEnableIgnoreOnNotice 129 /* irc::ignore */ -#define KviOption_boolNotifyFailedDccHandshakes 130 -#define KviOption_boolAutoTileWindows 131 /* internal ? */ -#define KviOption_boolDrawEmoticons 132 /* look::interface::features::output */ -#define KviOption_boolIgnoreCtcpPage 133 /* irc::ctcp::floodprotection */ -#define KviOption_boolShowDialogOnCtcpPage 134 -#define KviOption_boolBashLikeNickCompletion 135 -#define KviOption_boolUseSSLCertificate 136 /* ssl */ -#define KviOption_boolUseSSLPrivateKey 137 /* ssl */ -#define KviOption_boolWarnAboutPastingMultipleLines 138 /* internal */ -#define KviOption_boolKeepChannelsOpenOnUnexpectedDisconnect 139 /* connection */ -#define KviOption_boolKeepQueriesOpenOnUnexpectedDisconnect 140 /* connection */ -#define KviOption_boolUseLagMeterEngine 141 /* irc::lag */ -#define KviOption_boolShowLagOnContextDisplay 142 /* irc::lag */ -#define KviOption_boolDisableBanListRequestOnJoin 143 /* irc::output */ -#define KviOption_boolDisableBanExceptionListRequestOnJoin 144 /* irc::output */ -#define KviOption_boolDisableInviteListRequestOnJoin 145 /* irc::output */ -#define KviOption_boolDisableWhoRequestOnJoin 146 /* irc::output */ -#define KviOption_boolShowDockExtension 147 /* internal ? */ -#define KviOption_boolDccAddressByIrcDns 148 /* irc::general */ -#define KviOption_boolMinimizeConsoleAfterConnect 149 /* irc::connection */ -#define KviOption_boolHighlightOnlyNormalMsg 150 /* irc::output::highlight */ -#define KviOption_boolHighlightOnlyNormalMsgQueryToo 151 /* irc::output::highlight */ -#define KviOption_boolHighlightOnlyNormalMsgHighlightInChanToo 152 /* irc::output::highlight */ -#define KviOption_boolHighlightOnlyAtCostumHighlightLevel 153 /* irc::output::highlight */ -#define KviOption_boolMdiManagerInSdiMode 154 /* internal */ -#define KviOption_boolDccBrokenBouncerHack 155 /* dcc */ -#define KviOption_boolExternalMessagesToActiveWindow 156 /* irc::output */ -#define KviOption_boolIgnoreChannelAvatarRequestsWhenNoAvatarSet 157 /* ctcp */ -#define KviOption_boolFlashQueryWindowOnNewMessages 158 /* query */ -#define KviOption_boolConfirmCloseWhenThereAreConnections 159 /* interface features */ -#define KviOption_boolUpdateKdeBackgroundOnChange 160 /* themes::general */ -#define KviOption_boolCtcpRequestsToActiveWindow 161 /* irc::output */ -#define KviOption_boolServerRepliesToActiveWindow 162 /* irc::output */ -#define KviOption_boolServerNoticesToActiveWindow 163 /* irc::output */ -#define KviOption_boolServicesNoticesToActiveWindow 164 /* irc::output */ -#define KviOption_boolSortTaskBarItemsByName 165 /* interface::features::global */ -#define KviOption_boolShowTaskBarToolTips 166 /* interface::features::global */ -#define KviOption_boolShowUserListViewToolTips 167 /* interface::features::global */ -#define KviOption_boolWhoisRepliesToActiveWindow 168 /* irc::output */ -#define KviOption_boolPopupNotifierOnNotifyOnLine 169 /* notify */ -#define KviOption_boolForciblyDisableNotifier 170 /* notifier */ -#define KviOption_boolDccSendForceIdleStep 171 /* dcc */ -#define KviOption_boolStatusBarVisible 172 /* internal */ -#define KviOption_boolTrackLastReadTextViewLine 173 /* ircview::features */ -#define KviOption_boolKeepChannelOpenOnPart 174 /* irc */ -#define KviOption_boolStripMircColorsInUserMessages 175 /* irc::output */ -#define KviOption_boolDoNotSuggestRestoreDefaultScript 176 /* internal */ -#define KviOption_boolLimitDccSendSpeed 177 /* dcc::file transfers */ -#define KviOption_boolLimitDccRecvSpeed 178 /* dcc::file transfers */ -#define KviOption_boolIgnoreModuleVersions 179 -#define KviOption_boolDisableInputHistory 180 /* interface::input */ -#define KviOption_boolUseSpecialColorForTimestamp 181 /* interface::output */ -#define KviOption_boolDisableAwayListUpdates 182 /* irc::output */ -#define KviOption_boolDisableAvatars 183 /* interface::userlist */ -#define KviOption_boolDisableUserListLabel 184 /* interface::userlist */ -#define KviOption_boolDisablePopupIcons 185 /* themes::general */ -#define KviOption_boolScriptErrorsToDebugWindow 186 /* parser */ -#define KviOption_boolShowMinimizedDebugWindow 187 /* parser */ -#define KviOption_boolShowExtendedInfoInQueryLabel 188 /* irc::query */ -#define KviOption_boolUseUserListColorsAsNickColors 189 /* irc::usermessages */ -#define KviOption_boolGzipLogs 190 /* ircengine::logging */ -#define KviOption_boolMinimizeInTray 191 /* interface */ -#define KviOption_boolDisableNotifierFlashing 192 /* interface::notifier */ -#define KviOption_boolCommandlineInUserFriendlyModeByDefault 193 /* interface::input */ -#define KviOption_boolEnableVisualEffects 194 /* interface */ -#define KviOption_boolDCCFileTransferReplaceOutgoingSpacesWithUnderscores 195 -#define KviOption_boolDoNotStretchAvatars 196 -#define KviOption_boolUseDifferentColorForOwnNick 197 /* interface */ -#define KviOption_boolCloseInTray 198 /* interface */ -#define KviOption_boolStartupMinimized 199 /* interface */ -#define KviOption_boolSortReceivedByDccFilesByNicks 200 /* dcc */ -#define KviOption_boolLogChannelHistory 201 /* irc */ -#define KviOption_boolClassicTaskBarSetMaximumButtonWidth 202 -#define KviOption_boolKeepChannelsOpenOnDisconnect 203 /* connection */ -#define KviOption_boolKeepQueriesOpenOnDisconnect 204 /* connection */ -#define KviOption_boolHideWindowToolButtons 205 /* interface */ -#define KviOption_boolHideInputToolButtons 206 /* interface */ -#define KviOption_boolStripControlCodesInLogs 207 /* log */ -#define KviOption_boolEnableTrayIconFlashing 208 -#define KviOption_boolUseFlatClassicTaskbarButtons 209 -#define KviOption_boolShowTreeTaskbarHeader 210 -#define KviOption_boolUseLevelBasedTrayNotification 211 -#define KviOption_boolMuteAllSounds 212 -#define KviOption_boolCreateMinimizedChannels 213 -#define KviOption_boolShowNetworkNameForConsoleTaskBarEntry 214 -#define KviOption_boolDrawGenderIcons 215 -#define KviOption_boolPrependGenderInfoToRealname 216 -#define KviOption_boolUseIdentServiceOnlyOnConnect 217 /* connection::ident */ -#define KviOption_boolUseSystemUrlHandlers 218 /* Windoze only*/ -#define KviOption_boolScaleAvatarsOnLoad 219 -#define KviOption_boolDisableNotifierFadein 220 /* interface::notifier */ -#define KviOption_boolUseAntiAliasing 221 /* qt4 only! */ - - -#define KVI_NUM_BOOL_OPTIONS 222 - - - -#define KVI_STRING_OPTIONS_PREFIX "string" -#define KVI_STRING_OPTIONS_PREFIX_LEN 6 - -//UNUSED ! #define KviOption_stringFrameCaption 0 /* interfacelookglobal */ -#define KviOption_stringNickname1 1 /* identity */ -#define KviOption_stringNickname2 2 /* identity */ -#define KviOption_stringNickname3 3 /* identity */ -#define KviOption_stringNickname4 4 /* identity */ -#define KviOption_stringUsername 5 /* identity */ -#define KviOption_stringRealname 6 /* identity */ -#define KviOption_stringLocalHostIp 7 /* ?????? This is a fallback one */ -#define KviOption_stringPartMessage 8 /* ircengine::defaultmessages */ -#define KviOption_stringQuitMessage 9 /* ircengine::defaultmessages */ -#define KviOption_stringUrlHttpCommand 10 /* urlhandlers */ -#define KviOption_stringExtendedPrivmsgPrefix 11 /* ircengine::outputcontrol::privmsg */ -#define KviOption_stringExtendedPrivmsgPostfix 12 /* ircengine::outputcontrol::privmsg */ -#define KviOption_stringCtcpVersionPostfix 13 /* ircengine::ctcp::replies */ -#define KviOption_stringCtcpUserInfoOther 14 /* identity */ -#define KviOption_stringCtcpSourcePostfix 15 /* ircengine::ctcp::replies */ -#define KviOption_stringUrlFtpCommand 16 /* urlhandlers */ -#define KviOption_stringUrlHttpsCommand 17 /* urlhandlers */ -#define KviOption_stringUrlMailtoCommand 18 /* urlhandlers */ -#define KviOption_stringPreferredMediaPlayer 19 /* still missing in options ! */ -#define KviOption_stringUrlFileCommand 20 /* urlhandlers */ -#define KviOption_stringNickCompletionPostfix 21 -#define KviOption_stringUrlUnknownCommand 22 /* urlhandlers */ -#define KviOption_stringIpV4ConnectionBindAddress 23 /* connection::transport */ -#define KviOption_stringIpV6ConnectionBindAddress 24 /* connection::transport */ -#define KviOption_stringDccVoiceSoundDevice 25 /* dcc::voice */ -#define KviOption_stringDccVoiceMixerDevice 26 /* dcc::voice */ -#define KviOption_stringAwayMessage 27 /* irc::away */ -#define KviOption_stringIdentdUser 28 /* connection::ident */ -#define KviOption_stringDccListenDefaultInterface 29 /* dcc::general */ -#define KviOption_stringCustomAwayNick 30 /* ircengine::away */ -#define KviOption_stringDefaultDccFakeAddress 31 /* dcc::general */ -#define KviOption_stringCtcpPageReply 32 /* ircengine::ctcp::replies */ -#define KviOption_stringSSLCertificatePath 33 /* ssl */ -#define KviOption_stringSSLCertificatePass 34 /* ssl */ -#define KviOption_stringSSLPrivateKeyPath 35 /* ssl */ -#define KviOption_stringSSLPrivateKeyPass 36 /* ssl */ -#define KviOption_stringSoundSystem 37 /* sound */ -#define KviOption_stringDefaultUserMode 38 -#define KviOption_stringLastImageDialogPath 39 /* internal */ -#define KviOption_stringIconThemeSubdir 40 -#define KviOption_stringIncomingPath 41 /* folders */ -#define KviOption_stringMyAvatar 42 -// empty string means guess from locale -#define KviOption_stringDefaultTextEncoding 43 /* text encoding */ - -#define KviOption_stringWinampTextEncoding 44 -#define KviOption_stringMp3TagsEncoding 45 - -#define KviOption_stringCtcpUserInfoAge 46 /* identity */ -#define KviOption_stringCtcpUserInfoGender 47 /* identity */ -#define KviOption_stringCtcpUserInfoLocation 48 /* identity */ -#define KviOption_stringCtcpUserInfoLanguages 49 /* identity */ -#define KviOption_stringWordSplitters 50 /* highlight */ -#define KviOption_stringOnNewQueryOpenedSound 51 /* sounds */ -#define KviOption_stringOnHighlightedMessageSound 52 /* sounds */ -#define KviOption_stringOnMeKickedSound 53 /* sounds */ -#define KviOption_stringOnQueryMessageSound 54 /* sounds */ -#define KviOption_stringIrcViewTimestampFormat 55 -#define KviOption_stringPreferredTorrentClient 56 /* still missing in options ! */ - -#define KVI_NUM_STRING_OPTIONS 57 - - - -#define KVI_STRINGLIST_OPTIONS_PREFIX "stringlist" -#define KVI_STRINGLIST_OPTIONS_PREFIX_LEN 10 - -#define KviOption_stringlistHighlightWords 0 /* ircengine::outputcontrol::highlighting */ -#define KviOption_stringlistSpamWords 1 /* ircengine::outputcontrol::antispam */ -#define KviOption_stringlistRecentChannels 2 /* internal */ -#define KviOption_stringlistRecentServers 3 /* internal */ -#define KviOption_stringlistRecentNicknames 4 /* internal */ -#define KviOption_stringlistModuleExtensionToolbars 5 /* internal */ -#define KviOption_stringlistImageSearchPaths 6 /* ??? */ -#define KviOption_stringlistRecentIrcUrls 7 /* internal */ - -#define KVI_NUM_STRINGLIST_OPTIONS 8 - - - -#define KVI_COLOR_OPTIONS_PREFIX "color" -#define KVI_COLOR_OPTIONS_PREFIX_LEN 5 - -#define KviOption_colorMdiBackground 0 /* ?? look & feel : gui elements : mdi manager */ -#define KviOption_colorTaskBarNormalText 1 /* look & feel::interface look::taskbar::classic taskbar */ -#define KviOption_colorTaskBarMinimizedText 2 /* look & feel::interface look::taskbar::classic taskbar */ -#define KviOption_colorTaskBarHighlight1Text 3 /* look & feel::interface look::taskbar::classic taskbar */ -#define KviOption_colorTaskBarHighlight2Text 4 /* look & feel::interface look::taskbar::classic taskbar */ -#define KviOption_colorTaskBarProgressBar 5 /* look & feel::interface look::taskbar::classic taskbar */ -#define KviOption_colorMdiCaptionActive 6 /* theme::mdicaptions */ -#define KviOption_colorMdiCaptionInactive 7 /* theme::mdicaptions */ -#define KviOption_colorCaptionTextActive 8 /* theme::mdicaptions */ -#define KviOption_colorCaptionTextActive2 9 /* theme::mdicaptions */ -#define KviOption_colorCaptionTextInactive 10 /* theme::mdicaptions */ -#define KviOption_colorCaptionTextInactive2 11 /* theme::mdicaptions */ -#define KviOption_colorIrcViewBackground 12 /* look & feel::interface look::ircview */ -#define KviOption_colorInputBackground 13 /* look & feel::interface look::input */ -#define KviOption_colorInputSelectionBackground 14 /* look & feel::interface look::input */ -#define KviOption_colorInputSelectionForeground 15 /* look & feel::interface look::input */ -#define KviOption_colorInputCursor 16 /* look & feel::interface look::input */ -#define KviOption_colorInputControl 17 /* look & feel::interface look::input */ -#define KviOption_colorInputForeground 18 /* look & feel::interface look::input */ -#define KviOption_colorUserListViewBackground 19 /* look & feel::interface look::userlist */ -#define KviOption_colorUserListViewOpForeground 20 /* look & feel::interface look::userlist */ -#define KviOption_colorUserListViewVoiceForeground 21 /* look & feel::interface look::userlist */ -#define KviOption_colorUserListViewNormalForeground 22 /* look & feel::interface look::userlist */ -#define KviOption_colorUserListViewSelectionBackground 23 /* look & feel::interface look::userlist */ -#define KviOption_colorUserListViewSelectionForeground 24 /* look & feel::interface look::userlist */ -#define KviOption_colorLabelBackground 25 /* look & feel::interface look::topic label */ -#define KviOption_colorLabelForeground 26 /* look & feel::interface look::topic label */ -#define KviOption_colorGlobalTransparencyFade 27 /* look & feel::interface look */ -#define KviOption_colorIrcToolBarAppletBackground 28 /* theme::tool bar applets */ -#define KviOption_colorIrcToolBarAppletForegroundLowContrast 29 /* theme::tool bar applets */ -#define KviOption_colorIrcToolBarAppletForegroundMidContrast 30 /* theme::tool bar applets */ -#define KviOption_colorIrcToolBarAppletForegroundHighContrastInactive1 31 /* theme::tool bar applets */ -#define KviOption_colorIrcToolBarAppletForegroundHighContrastInactive2 32 /* theme::tool bar applets */ -#define KviOption_colorIrcToolBarAppletForegroundHighContrastActive1 33 /* theme::tool bar applets */ -#define KviOption_colorIrcToolBarAppletForegroundHighContrastActive2 34 /* theme::tool bar applets */ -#define KviOption_colorTreeTaskBarBackground 35 /* look & feel::interface look::taskbar::tree taskbar */ -#define KviOption_colorTreeTaskBarActiveBackground 36 /* look & feel::interface look::taskbar::tree taskbar */ -#define KviOption_colorTreeTaskBarForeground 37 /* look & feel::interface look::taskbar::tree taskbar */ -#define KviOption_colorTreeTaskBarActiveForeground 38 /* look & feel::interface look::taskbar::tree taskbar */ -#define KviOption_colorTreeTaskBarHighlight1Foreground 39 /* look & feel::interface look::taskbar::tree taskbar */ -#define KviOption_colorTreeTaskBarHighlight2Foreground 40 /* look & feel::interface look::taskbar::tree taskbar */ -#define KviOption_colorTreeTaskBarProgress 41 /* look & feel::interface look::taskbar::tree taskbar */ -#define KviOption_colorUserListViewHalfOpForeground 42 /* look & feel::interface look::userlist */ -#define KviOption_colorTaskBarHighlight3Text 43 /* look & feel::interface look::taskbar::classic taskbar */ -#define KviOption_colorTaskBarHighlight4Text 44 /* look & feel::interface look::taskbar::classic taskbar */ -#define KviOption_colorTaskBarHighlight5Text 45 /* look & feel::interface look::taskbar::classic taskbar */ -#define KviOption_colorTreeTaskBarHighlight3Foreground 46 /* look & feel::interface look::taskbar::tree taskbar */ -#define KviOption_colorTreeTaskBarHighlight4Foreground 47 /* look & feel::interface look::taskbar::tree taskbar */ -#define KviOption_colorTreeTaskBarHighlight5Foreground 48 /* look & feel::interface look::taskbar::tree taskbar */ -#define KviOption_colorUserListViewChanAdminForeground 49 /* look & feel::interface look::userlist */ -#define KviOption_colorUserListViewUserOpForeground 50 /* look & feel::interface look::userlist */ -#define KviOption_colorUserListViewGrid 51 /* look & feel::interface look::userlist */ -#define KviOption_colorUserListViewChanOwnerForeground 52 /* look & feel::interface look::userlist */ -#define KviOption_colorIrcViewMarkLine 53 /* look & feel::interface look::ircvew */ -#define KviOption_colorUserListViewAwayForeground 54 /* look & feel::interface look::userlist */ -#define KviOption_colorUserListViewOwnForeground 55 /* look & feel::interface look::userlist */ - -#define KVI_NUM_COLOR_OPTIONS 56 - - - -#define KVI_PIXMAP_OPTIONS_PREFIX "pixmap" -#define KVI_PIXMAP_OPTIONS_PREFIX_LEN 6 - -#define KviOption_pixmapMdiBackground 0 -#define KviOption_pixmapIrcViewBackground 1 /* interface::look::components::ircview */ -#define KviOption_pixmapInputBackground 2 /* interface::look::components::input */ -#define KviOption_pixmapUserListViewBackground 3 /* look & feel::interface look::userlist */ -#define KviOption_pixmapLabelBackground 4 /* look & feel::interface look::topic label */ -#define KviOption_pixmapMyAvatar 5 /* identity */ -#define KviOption_pixmapIrcToolBarAppletBackground 6 /* theme::tool bar applets */ -#define KviOption_pixmapTreeTaskBarBackground 7 /* look & feel::interface look::taskbar::tree taskbar */ -#define KviOption_pixmapGlobalTransparencyBackground 8 /* theme::transparency */ - -#define KVI_NUM_PIXMAP_OPTIONS 9 - - - - -#define KVI_UINT_OPTIONS_PREFIX "uint" -#define KVI_UINT_OPTIONS_PREFIX_LEN 4 - -#define KviOption_uintIrcSocketTimeout 0 /* connection::transport */ -#define KviOption_uintModuleCleanupTimerInterval 1 -#define KviOption_uintModuleCleanupTimeout 2 -#define KviOption_uintMaxCtcpRequests 3 /* ircengine::ctcp */ -#define KviOption_uintCtcpFloodCheckInterval 4 /* ircengine::ctcp */ -#define KviOption_uintTotalConnectionTime 5 -#define KviOption_uintDccSocketTimeout 6 /* dcc::general */ -#define KviOption_uintDccSendIdleStepInMSec 7 /* dcc::send */ -#define KviOption_uintDccSendPacketSize 8 /* dcc::send */ -#define KviOption_uintGlobalTransparencyParentFadeFactor 9 /* interface::look::general */ -#define KviOption_uintGlobalTransparencyChildFadeFactor 10 /* interface::look::general */ -#define KviOption_uintNotifyListCheckTimeInSecs 11 /* notify */ -#define KviOption_uintSocketQueueFlushTimeout 12 /* connection::transport */ -#define KviOption_uintOutgoingTrafficLimitUSeconds 13 /* connection::transport */ -#define KviOption_uintNotifyListIsOnDelayTimeInSecs 14 /* notify */ -#define KviOption_uintNotifyListUserhostDelayTimeInSecs 15 /* notify */ -#define KviOption_uintTreeTaskBarMinimumWidth 16 /* ?? interface::general ?? */ -#define KviOption_uintAvatarOfferTimeoutInSecs 17 /* irc::ctcp::avatar */ -#define KviOption_uintIrcViewMaxBufferSize 18 /* interface::features::components::ircview */ -#define KviOption_uintIrcViewToolTipTimeoutInMsec 19 /* interface::features::components::ircview */ -#define KviOption_uintIrcViewToolTipHideTimeoutInMsec 20 /* interface::features::components::ircview */ -#define KviOption_uintDccVoicePreBufferSize 21 /* dcc::voice */ -#define KviOption_uintIdentdPort 22 /* connection::ident */ -#define KviOption_uintAvatarScaleWidth 23 /* ctcp::avatar */ -#define KviOption_uintAvatarScaleHeight 24 /* ctcp::avatar */ -#define KviOption_uintDccMinPort 25 /* dcc::general */ -#define KviOption_uintDccMaxPort 26 /* dcc::general */ -#define KviOption_uintSoundOfferTimeoutInSecs 27 -#define KviOption_uintMaximumRequestedAvatarSize 28 /* ctcp::avatar */ -// FIXME: THIS IS NO LONGER NEEDED ? -#define KviOption_uintTreeTaskBarMaximumWidth 29 -#define KviOption_uintPasteDelay 30 -// 0 = unlimited! -#define KviOption_uintMaxDccSendTransfers 31 -// 0 = unlimited slots = windows -#define KviOption_uintMaxDccSlots 32 -#define KviOption_uintTileMethod 33 /* internal ? */ -#define KviOption_uintLagMeterHeartbeat 34 -#define KviOption_uintLagAlarmTime 35 -// KVI_TEXT_ENCODING_UNKNOWN = KviLocale::defaultTextEncoding() <-- guessed from locale -//#define KviOption_uintDefaultTextEncoding 36 /* textencoding */ -#define KviOption_uintTaskBarButtonMinWidth 37 /* interface::look::taskbar::classic taskbar */ -// follows the verbosity constants defined below -#define KviOption_uintOutputVerbosityLevel 38 -#define KviOption_uintIrcContextAppletWidth 39 /* internal */ -#define KviOption_uintMinHighlightLevel 40 /* look::interface::features::output */ -#define KviOption_uintUserListViewGridType 41 /* look&feel::ircview */ -#define KviOption_uintTaskBarMaximumRows 42 /* interface::look::taskbar::classic taskbar */ -// 0 = unlimited attempts -#define KviOption_uintMaxAutoReconnectAttempts 43 /* connection */ -#define KviOption_uintAutoReconnectDelay 44 /* connection */ -#define KviOption_uintMaxDccSendSpeed 45 /* dcc::file transfers */ -#define KviOption_uintMaxDccRecvSpeed 46 /* dcc::file transfers */ -#define KviOption_uintTimeStampForeground 47 -#define KviOption_uintTimeStampBackground 48 -#define KviOption_uintUserExperienceLevel 49 -#define KviOption_uintClassicTaskBarMaximumButtonWidth 50 -#define KviOption_uintDefaultBanType 51 -#define KviOption_uintIrcViewPixmapAlign 52 -#define KviOption_uintUserListPixmapAlign 53 -#define KviOption_uintToolBarAppletPixmapAlign 54 -#define KviOption_uintTreeTaskBarPixmapAlign 55 -#define KviOption_uintInputPixmapAlign 56 -#define KviOption_uintAutoFlushLogs 57 -#define KviOption_uintMinTrayLowLevelMessage 58 -#define KviOption_uintMinTrayHighLevelMessage 59 -#define KviOption_uintIdentdOutputMode 60 -#define KviOption_uintScaleAvatarsOnLoadHeight 61 -#define KviOption_uintScaleAvatarsOnLoadWidth 62 -#define KviOption_uintNotifierActiveTransparency 63 -#define KviOption_uintNotifierInactiveTransparency 64 - -#define KVI_NUM_UINT_OPTIONS 65 - -namespace KviIdentdOutputMode { - enum Mode { - Quiet = 0, - ToConsole = 1, - ToActiveWindow = 2 - }; -} - - -#define KVI_FONT_OPTIONS_PREFIX "font" -#define KVI_FONT_OPTIONS_PREFIX_LEN 4 - -#define KviOption_fontIrcView 0 /* interface::look::components::ircview */ -#define KviOption_fontInput 1 /* interface::look::components::input */ -#define KviOption_fontUserListView 2 /* look & feel::interface look::userlist */ -#define KviOption_fontLabel 3 /* look & feel::interface look::topic label */ -#define KviOption_fontApplication 4 /* interface::look::global */ -#define KviOption_fontIrcToolBarApplet 5 /* theme::tool bar applet */ -#define KviOption_fontTaskbar 6 /* interface::look::taskbar::classic taskbar */ - -/* fixme: taskbar font ? */ - -#define KVI_NUM_FONT_OPTIONS 7 - - - - -#define KVI_ICCOLOR_OPTIONS_PREFIX "iccolor" -#define KVI_ICCOLOR_OPTIONS_PREFIX_LEN 7 - -#define KVI_NUM_ICCOLOR_OPTIONS 8 - - -// indices declared in kvi_out.h - -#define KVI_MSGTYPE_OPTIONS_PREFIX "msgtype" -#define KVI_MSGTYPE_OPTIONS_PREFIX_LEN 7 - -#define KVI_NUM_MSGTYPE_OPTIONS 137 - - - -#define KVI_MIRCCOLOR_OPTIONS_PREFIX "mirccolor" -#define KVI_MIRCCOLOR_OPTIONS_PREFIX_LEN 9 - -#define KVI_NUM_MIRCCOLOR_OPTIONS 16 - - -// external declaration of the tables -extern KVIRC_API KviBoolOption g_boolOptionsTable[KVI_NUM_BOOL_OPTIONS]; -extern KVIRC_API KviRectOption g_rectOptionsTable[KVI_NUM_RECT_OPTIONS]; -extern KVIRC_API KviStringOption g_stringOptionsTable[KVI_NUM_STRING_OPTIONS]; -extern KVIRC_API KviColorOption g_colorOptionsTable[KVI_NUM_COLOR_OPTIONS]; -extern KVIRC_API KviPixmapOption g_pixmapOptionsTable[KVI_NUM_PIXMAP_OPTIONS]; -// extern KviIntOption g_intOptionsTable[KVI_NUM_INT_OPTIONS]; -extern KVIRC_API KviUIntOption g_uintOptionsTable[KVI_NUM_UINT_OPTIONS]; -extern KVIRC_API KviFontOption g_fontOptionsTable[KVI_NUM_FONT_OPTIONS]; -extern KVIRC_API KviMsgTypeOption g_msgtypeOptionsTable[KVI_NUM_MSGTYPE_OPTIONS]; -extern KVIRC_API KviColorOption g_mirccolorOptionsTable[KVI_NUM_MIRCCOLOR_OPTIONS]; -extern KVIRC_API KviColorOption g_iccolorOptionsTable[KVI_NUM_ICCOLOR_OPTIONS]; -extern KVIRC_API KviStringListOption g_stringlistOptionsTable[KVI_NUM_STRINGLIST_OPTIONS]; - -// __this is how we access the options from outside -#define KVI_OPTION_BOOL(_idx) g_boolOptionsTable[_idx].option -#define KVI_OPTION_RECT(_idx) g_rectOptionsTable[_idx].option -#define KVI_OPTION_STRING(_idx) g_stringOptionsTable[_idx].option -#define KVI_OPTION_COLOR(_idx) g_colorOptionsTable[_idx].option -#define KVI_OPTION_PIXMAP(_idx) g_pixmapOptionsTable[_idx].option -#define KVI_OPTION_UINT(_idx) g_uintOptionsTable[_idx].option -#define KVI_OPTION_FONT(_idx) g_fontOptionsTable[_idx].option -#define KVI_OPTION_MSGTYPE(_idx) g_msgtypeOptionsTable[_idx].option -#define KVI_OPTION_MIRCCOLOR(_idx) g_mirccolorOptionsTable[_idx].option -#define KVI_OPTION_STRINGLIST(_idx) g_stringlistOptionsTable[_idx].option -#define KVI_OPTION_ICCOLOR(_idx) g_iccolorOptionsTable[_idx].option - - -// Verbosity constants - -#define KVI_VERBOSITY_LEVEL_MUTE 0 -#define KVI_VERBOSITY_LEVEL_QUIET 1 -#define KVI_VERBOSITY_LEVEL_NORMAL 2 -#define KVI_VERBOSITY_LEVEL_VERBOSE 3 -#define KVI_VERBOSITY_LEVEL_PARANOIC 4 - -#define _OUTPUT_PARANOIC (KVI_OPTION_UINT(KviOption_uintOutputVerbosityLevel) >= KVI_VERBOSITY_LEVEL_PARANOIC) -#define _OUTPUT_VERBOSE (KVI_OPTION_UINT(KviOption_uintOutputVerbosityLevel) >= KVI_VERBOSITY_LEVEL_VERBOSE) -#define _OUTPUT_QUIET (KVI_OPTION_UINT(KviOption_uintOutputVerbosityLevel) <= KVI_VERBOSITY_LEVEL_QUIET) -#define _OUTPUT_MUTE (KVI_OPTION_UINT(KviOption_uintOutputVerbosityLevel) <= KVI_VERBOSITY_LEVEL_MUTE) - -#ifdef COMPILE_USE_QT4 - #define START_TABLE_BOLD_ROW "<tr><td style=\"background-color: rgb(0,0,0); font-weight: bold; color: rgb(200,200,255); text-indent: 5px;\"><nobr>" - #define END_TABLE_BOLD_ROW "</nobr></td></tr>" - - #define START_TABLE_NORMAL_ROW "<tr><td>" - - #define SET_ANTI_ALIASING(p) \ - (p).setRenderHint(QPainter::Antialiasing, KVI_OPTION_BOOL(KviOption_boolUseAntiAliasing)); \ - (p).setRenderHint(QPainter::TextAntialiasing, KVI_OPTION_BOOL(KviOption_boolUseAntiAliasing)); -#else - #define START_TABLE_BOLD_ROW "<tr><td bgcolor=\"#303030\">" \ - "<font color=\"#FFFFFF\"><nobr><b>" - #define END_TABLE_BOLD_ROW "</b></nobr></font></td></tr>" - - #define START_TABLE_NORMAL_ROW "<tr><td bgcolor=\"#F0F0F0\">" - - #define SET_ANTI_ALIASING(p) -#endif - - -#if defined(_KVI_OPTIONS_CPP_) || defined(_WANT_OPTION_FLAGS_) - - // flag definitions - - // section of the config file (rightmost 8 bits) - #define KviOption_sectFlagNone 0 - #define KviOption_sectFlagFrame 1 - #define KviOption_sectFlagMdi 2 - #define KviOption_sectFlagTaskBar 3 - #define KviOption_sectFlagWindows 4 - #define KviOption_sectFlagIrcView 5 - #define KviOption_sectFlagMsgType 6 - #define KviOption_sectFlagMircColor 7 - #define KviOption_sectFlagInput 8 - #define KviOption_sectFlagUserParser 9 - #define KviOption_sectFlagConnection 10 - #define KviOption_sectFlagIrcSocket 11 - #define KviOption_sectFlagUser 12 - #define KviOption_sectFlagUserListView 13 - #define KviOption_sectFlagLabel 14 - #define KviOption_sectFlagModules 15 - #define KviOption_sectFlagCtcp 16 - #define KviOption_sectFlagDcc 17 - #define KviOption_sectFlagGui 18 - #define KviOption_sectFlagIrcToolBar 19 - #define KviOption_sectFlagLogging 20 - #define KviOption_sectFlagAntiSpam 21 - #define KviOption_sectFlagAvatar 22 - #define KviOption_sectFlagUrl 23 - #define KviOption_sectFlagRecent 24 - #define KviOption_sectFlagGeometry 25 - - #define KVI_NUM_OPTION_SECT_FLAGS 26 - - #define KviOption_sectMask 255 - - // other logical groupings of options - #define KviOption_groupTheme (1 << 8) - - #define KviOption_groupMask (255 << 8) - - - - // actions to take when an option is set - #define KviOption_resetNone 0 - //#define KviOption_resetUpdateCaption (1 << 16) UNUSED! - #define KviOption_resetUpdateGui (1 << 17) - #define KviOption_resetUpdateTaskBar (1 << 18) - #define KviOption_resetUpdateAppFont (1 << 19) - #define KviOption_resetUpdatePseudoTransparency (1 << 20) - #define KviOption_resetRestartNotifyList (1 << 21) - #define KviOption_resetRestartIdentd (1 << 22) - #define KviOption_resetReloadImages (1 << 23) - #define KviOption_resetRestartLagMeter (1 << 24) - #define KviOption_resetRecentChannels (1 << 25) - - #define KviOption_resetMask (~(KviOption_sectMask | KviOption_groupMask)) - - //for file pathes - #define KviOption_encodePath (1 << 25) - -#endif - -#endif //_KVI_OPTIONS_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_out.h b/3.4.0/src/kvirc/kernel/kvi_out.h deleted file mode 100644 index e48c431006..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_out.h +++ /dev/null @@ -1,169 +0,0 @@ -#ifndef _KVI_OUT_H_ -#define _KVI_OUT_H_ - -// -// File : kvi_out.h -// Creation date : Fri Jun 30 2000 14:13:21 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 KVI_OUT_NONE 0 -#define KVI_OUT_SELECT 1 -#define KVI_OUT_HIGHLIGHT 2 -#define KVI_OUT_URL 3 -#define KVI_OUT_LINK 4 -#define KVI_OUT_PARSERERROR 5 -#define KVI_OUT_PARSERWARNING 6 -#define KVI_OUT_HOSTLOOKUP 7 -#define KVI_OUT_SOCKETMESSAGE 8 -#define KVI_OUT_SOCKETWARNING 9 -#define KVI_OUT_SOCKETERROR 10 -#define KVI_OUT_SYSTEMERROR 11 -#define KVI_OUT_RAW 12 -#define KVI_OUT_CONNECTION 13 -#define KVI_OUT_SYSTEMWARNING 14 -#define KVI_OUT_SYSTEMMESSAGE 15 -#define KVI_OUT_UNHANDLED 16 -#define KVI_OUT_SERVERINFO 17 -#define KVI_OUT_MOTD 18 -#define KVI_OUT_SERVERPING 19 -#define KVI_OUT_JOIN 20 -#define KVI_OUT_PART 21 -#define KVI_OUT_UNRECOGNIZED 22 -#define KVI_OUT_TOPIC 23 -#define KVI_OUT_OWNPRIVMSG 24 -#define KVI_OUT_CHANPRIVMSG 25 -#define KVI_OUT_QUERYPRIVMSG 26 -#define KVI_OUT_CTCPREPLY 27 -#define KVI_OUT_CTCPREQUESTREPLIED 28 -#define KVI_OUT_CTCPREQUESTIGNORED 29 -#define KVI_OUT_CTCPREQUESTFLOOD 30 -#define KVI_OUT_CTCPREQUESTUNKNOWN 31 -#define KVI_OUT_ACTION 32 -#define KVI_OUT_AVATAR 33 -#define KVI_OUT_QUIT 34 -#define KVI_OUT_SPLIT 35 -#define KVI_OUT_QUITSPLIT 36 -#define KVI_OUT_NICK 37 -#define KVI_OUT_OP 38 -#define KVI_OUT_DEOP 39 -#define KVI_OUT_VOICE 40 -#define KVI_OUT_DEVOICE 41 -#define KVI_OUT_MODE 42 -#define KVI_OUT_KEY 43 -#define KVI_OUT_LIMIT 44 -#define KVI_OUT_BAN 45 -#define KVI_OUT_UNBAN 46 -#define KVI_OUT_BANEXCEPT 47 -#define KVI_OUT_BANUNEXCEPT 48 -#define KVI_OUT_INVITEEXCEPT 49 -#define KVI_OUT_INVITEUNEXCEPT 50 -#define KVI_OUT_CHANMODE 51 -#define KVI_OUT_WHO 52 -#define KVI_OUT_DCCREQUEST 53 -#define KVI_OUT_DCCMSG 54 -#define KVI_OUT_DCCERROR 55 -#define KVI_OUT_NICKNAMEPROBLEM 56 -#define KVI_OUT_WHOISUSER 57 -#define KVI_OUT_WHOISCHANNELS 58 -#define KVI_OUT_WHOISIDLE 59 -#define KVI_OUT_WHOISSERVER 60 -#define KVI_OUT_WHOISOTHER 61 -#define KVI_OUT_CREATIONTIME 62 -#define KVI_OUT_NOTIFYONLINE 63 -#define KVI_OUT_NOTIFYOFFLINE 64 -#define KVI_OUT_OWNPRIVMSGCRYPTED 65 -#define KVI_OUT_CHANPRIVMSGCRYPTED 66 -#define KVI_OUT_QUERYPRIVMSGCRYPTED 67 -#define KVI_OUT_DCCCHATMSG 68 -#define KVI_OUT_DCCCHATMSGCRYPTED 69 -#define KVI_OUT_IRC 70 -#define KVI_OUT_KICK 71 -#define KVI_OUT_LINKS 72 -#define KVI_OUT_SPAM 73 -#define KVI_OUT_ICQ 74 -#define KVI_OUT_ICQMESSAGE 75 -#define KVI_OUT_ICQMESSAGESENT 76 -#define KVI_OUT_CHANNELNOTICE 77 -#define KVI_OUT_CHANNELNOTICECRYPTED 78 -#define KVI_OUT_QUERYNOTICE 79 -#define KVI_OUT_QUERYNOTICECRYPTED 80 -#define KVI_OUT_SERVERNOTICE 81 -#define KVI_OUT_HALFOP 82 -#define KVI_OUT_CTCPREPLYUNKNOWN 83 -#define KVI_OUT_NICKSERV 84 -#define KVI_OUT_CHANSERV 85 -#define KVI_OUT_AWAY 86 -#define KVI_OUT_IDENT 87 -#define KVI_OUT_LIST 88 -#define KVI_OUT_HALFDEOP 89 -#define KVI_OUT_INVITE 90 -#define KVI_OUT_MULTIMEDIA 91 -#define KVI_OUT_QUERYTRACE 92 -#define KVI_OUT_WALLOPS 93 -#define KVI_OUT_JOINERROR 94 -#define KVI_OUT_BROADCASTPRIVMSG 95 -#define KVI_OUT_BROADCASTNOTICE 96 -#define KVI_OUT_MEKICK 97 -#define KVI_OUT_MEOP 98 -#define KVI_OUT_MEVOICE 99 -#define KVI_OUT_MEDEOP 100 -#define KVI_OUT_MEDEVOICE 101 -#define KVI_OUT_MEHALFOP 102 -#define KVI_OUT_MEDEHALFOP 103 -#define KVI_OUT_MEBAN 104 -#define KVI_OUT_MEUNBAN 105 -#define KVI_OUT_MEBANEXCEPT 106 -#define KVI_OUT_MEBANUNEXCEPT 107 -#define KVI_OUT_MEINVITEEXCEPT 108 -#define KVI_OUT_MEINVITEUNEXCEPT 109 -#define KVI_OUT_IGNORE 110 -#define KVI_OUT_STATS 111 -#define KVI_OUT_SSL 112 -#define KVI_OUT_SEARCH 113 -#define KVI_OUT_GENERICSUCCESS 114 -#define KVI_OUT_GENERICSTATUS 115 -#define KVI_OUT_GENERICVERBOSE 116 -#define KVI_OUT_GENERICWARNING 117 -#define KVI_OUT_GENERICERROR 118 -#define KVI_OUT_GENERICCRITICAL 119 -#define KVI_OUT_CHANADMIN 120 -#define KVI_OUT_DECHANADMIN 121 -#define KVI_OUT_MECHANADMIN 122 -#define KVI_OUT_MEDECHANADMIN 123 -#define KVI_OUT_USEROP 124 -#define KVI_OUT_USERDEOP 125 -#define KVI_OUT_MEUSEROP 126 -#define KVI_OUT_MEDEUSEROP 127 -#define KVI_OUT_VERBOSE 128 -#define KVI_OUT_MECHANOWNER 129 -#define KVI_OUT_CHANOWNER 130 -#define KVI_OUT_MEDECHANOWNER 131 -#define KVI_OUT_DECHANOWNER 132 -#define KVI_OUT_SERVERERROR 133 -#define KVI_OUT_HELP 134 -#define KVI_OUT_TEXTENCODING 135 -#define KVI_OUT_TORRENT 136 - -//#define KVI_NUM_MSGTYPE_OPTIONS 136 -// UPDATE THE TOTAL COUNT IN kvi_options.h !!!! - - -#endif //_KVI_OPTIONS_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_sslmaster.cpp b/3.4.0/src/kvirc/kernel/kvi_sslmaster.cpp deleted file mode 100644 index 909071c9ed..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_sslmaster.cpp +++ /dev/null @@ -1,168 +0,0 @@ -// -// File : kvi_sslmanager.cpp -// Creation date : Mon Jun 17 2002 20:34:00 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_sslmaster.h" - -#ifdef COMPILE_SSL_SUPPORT - -#include "kvi_window.h" -#include "kvi_options.h" -#include "kvi_out.h" -#include "kvi_mirccntrl.h" -#include "kvi_locale.h" - -namespace KviSSLMaster -{ - -KVIRC_API void printSSLCipherInfo(KviWindow * wnd,const char * description,KviSSLCipherInfo * c) -{ - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: %c%s"),KVI_TEXT_BOLD,description); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Cipher: %c%s"),KVI_TEXT_BOLD,c->name()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Version: %c%s"),KVI_TEXT_BOLD,c->version()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Bits: %c%d (%d used)"),KVI_TEXT_BOLD,c->bits(),c->bitsUsed()); -// wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Description: %c%s"),KVI_TEXT_BOLD,c->description()); -} - -KVIRC_API void printSSLCertificate(KviWindow * wnd,const char * description,KviSSLCertificate * c) -{ - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: %c%s"),KVI_TEXT_BOLD,description); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Version: %c%d"),KVI_TEXT_BOLD,c->version()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Serial number: %c%d"),KVI_TEXT_BOLD,c->serialNumber()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Subject:")); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Common name: %c%s"),KVI_TEXT_BOLD,c->subjectCommonName()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Organization: %c%s"),KVI_TEXT_BOLD,c->subjectOrganization()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Organizational unit: %c%s"),KVI_TEXT_BOLD,c->subjectOrganizationalUnit()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Country: %c%s"),KVI_TEXT_BOLD,c->subjectCountry()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: State or province: %c%s"),KVI_TEXT_BOLD,c->subjectStateOrProvince()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Locality: %c%s"),KVI_TEXT_BOLD,c->subjectLocality()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Issuer:")); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Common name: %c%s"),KVI_TEXT_BOLD,c->issuerCommonName()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Organization: %c%s"),KVI_TEXT_BOLD,c->issuerOrganization()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Organizational unit: %c%s"),KVI_TEXT_BOLD,c->issuerOrganizationalUnit()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Country: %c%s"),KVI_TEXT_BOLD,c->issuerCountry()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: State or province: %c%s"),KVI_TEXT_BOLD,c->issuerStateOrProvince()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Locality: %c%s"),KVI_TEXT_BOLD,c->issuerLocality()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Public key: %c%s (%d bits)"),KVI_TEXT_BOLD,c->publicKeyType(),c->publicKeyBits()); - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Signature type: %c%s"),KVI_TEXT_BOLD,c->signatureType()); - KviStr tmp = c->signatureContents(); - if(tmp.len() > 40) - { - tmp.cutRight(tmp.len() - 40); - tmp.append("..."); - } - wnd->output(KVI_OUT_SSL,__tr2qs("[SSL]: Signature contents: %c%s"),KVI_TEXT_BOLD,tmp.ptr()); - -} - -KVIRC_API void printSSLConnectionInfo(KviWindow * wnd,KviSSL * s) -{ - KviSSLCertificate * sc = s->getPeerCertificate(); - if(sc) - { - QString tmp(__tr2qs("Peer X509 certificate")); - KviSSLMaster::printSSLCertificate(wnd,tmp,sc); - delete sc; - } else wnd->outputNoFmt(KVI_OUT_SSL,__tr2qs("[SSL]: The peer didn't provide a certificate")); - KviSSLCipherInfo * ci = s->getCurrentCipherInfo(); - if(ci) - { - QString tmp(__tr2qs("Current transmission cipher")); - KviSSLMaster::printSSLCipherInfo(wnd,tmp,ci); - delete ci; - } else wnd->outputNoFmt(KVI_OUT_SSL,__tr2qs("[SSL]: Can't find out the current cipher info")); -} - -KVIRC_API KviSSL * allocSSL(KviWindow * wnd,kvi_socket_t sock,KviSSL::Method m,const char * contextString) -{ - KviSSL * s = new KviSSL(); - if(!s->initContext(m)) - { - delete s; - return 0; - } - - if(!contextString)contextString = KviStr::emptyString().ptr(); - - if(KVI_OPTION_BOOL(KviOption_boolUseSSLCertificate)) - { - switch(s->useCertificateFile( - KVI_OPTION_STRING(KviOption_stringSSLCertificatePath).utf8().data(), - KVI_OPTION_STRING(KviOption_stringSSLCertificatePass).utf8().data())) - { - case KviSSL::Success: - if(wnd)wnd->output(KVI_OUT_SSL,__tr2qs("[%s]: [SSL]: Using certificate file %s"),contextString,KVI_OPTION_STRING(KviOption_stringSSLCertificatePath).utf8().data()); - break; - case KviSSL::FileIoError: - if(wnd)wnd->output(KVI_OUT_SSL,__tr2qs("[%s]: [SSL ERROR]: File I/O error while trying to use the certificate file %s"),contextString,KVI_OPTION_STRING(KviOption_stringSSLCertificatePath).utf8().data()); - break; - default: - { - KviStr buffer; - while(s->getLastErrorString(buffer)) - { - if(wnd)wnd->output(KVI_OUT_SSL,__tr2qs("[%s]: [SSL ERROR]: %s"),contextString,buffer.ptr()); - } - } - break; - } - } - if(KVI_OPTION_BOOL(KviOption_boolUseSSLPrivateKey)) - { - switch(s->usePrivateKeyFile( - KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPath).utf8().data(), - KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPass).utf8().data())) - { - case KviSSL::Success: - if(wnd)wnd->output(KVI_OUT_SSL,__tr2qs("[%s]: [SSL]: Using private key file %s"),contextString,KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPath).utf8().data()); - break; - case KviSSL::FileIoError: - if(wnd)wnd->output(KVI_OUT_SSL,__tr2qs("[%s]: [SSL ERROR]: File I/O error while trying to use the private key file %s"),contextString,KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPath).utf8().data()); - break; - default: - { - KviStr buffer; - while(s->getLastErrorString(buffer)) - { - if(wnd)wnd->output(KVI_OUT_SSL,__tr2qs("[%s]: [SSL ERROR]: %s"),contextString,buffer.ptr()); - } - } - break; - } - } - - if(!s->initSocket(sock)) - { - delete s; - return 0; - } - - return s; -} - -KVIRC_API void freeSSL(KviSSL * s) -{ - delete s; -} - -}; -#endif diff --git a/3.4.0/src/kvirc/kernel/kvi_sslmaster.h b/3.4.0/src/kvirc/kernel/kvi_sslmaster.h deleted file mode 100644 index abe0b35f2c..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_sslmaster.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _KVI_SSLMASTER_H_ -#define _KVI_SSLMASTER_H_ -// -// File : kvi_sslmaster.h -// Creation date : Mon Jun 17 2002 20:34:00 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_SSL_SUPPORT - -#include "kvi_ssl.h" -#include "kvi_sockettype.h" - -class KviWindow; - -namespace KviSSLMaster -{ - extern KVIRC_API void printSSLCipherInfo(KviWindow * wnd,const char * description,KviSSLCipherInfo * c); - extern KVIRC_API void printSSLCertificate(KviWindow * wnd,const char * description,KviSSLCertificate * c); - - extern KVIRC_API void printSSLConnectionInfo(KviWindow * wnd,KviSSL * s); - - extern KVIRC_API KviSSL * allocSSL(KviWindow * wnd,kvi_socket_t sock,KviSSL::Method m,const char * contextString = 0); - extern KVIRC_API void freeSSL(KviSSL * s); -} - -#endif - - -#endif //_KVI_SSLMASTER_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_texticonmanager.cpp b/3.4.0/src/kvirc/kernel/kvi_texticonmanager.cpp deleted file mode 100644 index 180c103600..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_texticonmanager.cpp +++ /dev/null @@ -1,254 +0,0 @@ -//============================================================================= -// -// File : kvi_texticonmanager.cpp -// Creation date : Thu 15 May 2002 12:04:12 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#define _KVI_TEXTICONMANAGER_CPP_ - -#include "kvi_iconmanager.h" -#include "kvi_texticonmanager.h" -#include "kvi_string.h" -#include "kvi_pointerlist.h" -#include "kvi_config.h" -#include "kvi_app.h" -#include "kvi_confignames.h" - -#include <qpixmap.h> -#include <qfile.h> - -KVIRC_API KviTextIconManager * g_pTextIconManager = 0; - -KviTextIcon::KviTextIcon(KviTextIcon* icon) -{ - m_iId=icon->id(); - m_szFilename=icon->m_szFilename; -} - -void KviTextIcon::setId(int id) -{ - m_iId=id; - m_szFilename=QString::null; -} - -void KviTextIcon::setFilename(QString filename) -{ - m_iId=-1; - m_szFilename=filename; -} - -QPixmap * KviTextIcon::pixmap() -{ - if(m_iId>=0) - { - return g_pIconManager->getSmallIcon(m_iId); - } else { - // This is actually wrong (at least for the current implementation). - // Users of this class expect the pointer to be permanent while - // g_pIconManager returns temporary pointers. - // KviIrcView will happily crash dereferencing a hollow pointer sooner or later - return g_pIconManager->getPixmap(m_szFilename); - } -} - -KviTextIconManager::KviTextIconManager() -: QObject() -{ - m_pTextIconDict = new KviPointerHashTable<QString,KviTextIcon>(47,false); - m_pTextIconDict->setAutoDelete(true); -} - -KviTextIconManager::~KviTextIconManager() -{ - delete m_pTextIconDict; -} - -void KviTextIconManager::clear() -{ - m_pTextIconDict->clear(); -} - -void KviTextIconManager::insert(const QString &name,int id) -{ - m_pTextIconDict->replace(name,new KviTextIcon(id)); - emit changed(); -} - -void KviTextIconManager::insert(const QString &name,KviTextIcon& icon) -{ - m_pTextIconDict->replace(name,new KviTextIcon(&icon)); - emit changed(); -} - -typedef struct _KviTextIconAssocEntry -{ - const char * name; - int iVal; -} KviTextIconAssocEntry; - -static KviTextIconAssocEntry default_associations[]= -{ - { ":)" , KVI_SMALLICON_SMILE }, - { ":*" , KVI_SMALLICON_KISS }, - { ":D" , KVI_SMALLICON_BIGGRIN }, - { ":(" , KVI_SMALLICON_UGLY }, - { ":/" , KVI_SMALLICON_ANGRY }, - { ":O" , KVI_SMALLICON_SURPRISED2 }, - { ":P" , KVI_SMALLICON_TONGUE }, - { ";)" , KVI_SMALLICON_EYE }, - { ":°)" , KVI_SMALLICON_TEARSMILE }, - { ":°" , KVI_SMALLICON_CRY }, - { ":S" , KVI_SMALLICON_AFRAID }, - { ":|" , KVI_SMALLICON_DEMORALIZED }, - { ":P°" , KVI_SMALLICON_SLURP }, - { 0 , 0 } -}; - -void KviTextIconManager::checkDefaultAssociations() -{ - for(int i=0;default_associations[i].name;i++) - { - if(!m_pTextIconDict->find(default_associations[i].name)) - insert(QString::fromUtf8(default_associations[i].name),default_associations[i].iVal); - } - emit changed(); -} - -// this MUST match the ConfigUpdate entry in the configuration -// file shipped with KVIrc. -#define TEXTICONMANAGER_CURRENT_CONFIG_UPDATE 3 - -void KviTextIconManager::load() -{ - KviStr tmps; - int upd = 0; - if(g_pApp->getReadOnlyConfigPath(tmps,KVI_CONFIGFILE_TEXTICONS)) - { - upd = load(tmps.ptr(),false); - } - - if(upd == TEXTICONMANAGER_CURRENT_CONFIG_UPDATE)return; - - // do a merge of the texticons if we have a new config version - QString tmp; - g_pApp->getGlobalKvircDirectory(tmp,KviApp::Config,KVI_CONFIGFILE_TEXTICONS); - if(QFile::exists(tmp))load(tmp,true); -} - -void KviTextIconManager::save() -{ - QString tmp; - g_pApp->getLocalKvircDirectory(tmp,KviApp::Config,KVI_CONFIGFILE_TEXTICONS); - save(tmp); -} - -// returns the config update -int KviTextIconManager::load(const QString &filename,bool bMerge) -{ - if(!bMerge)m_pTextIconDict->clear(); - KviConfig cfg(filename,KviConfig::Read); - - cfg.setGroup("Manager"); - int upd = cfg.readIntEntry("ConfigUpdate",0); - - KviConfigGroup * dict = cfg.dict()->find("TextIcons"); - if(dict) - { - KviConfigGroupIterator it(*dict); - - KviPointerList<QString> names; - names.setAutoDelete(true); - - while(it.current()) - { - names.append(new QString(it.currentKey())); - ++it; - } - - cfg.setGroup("TextIcons"); - - for(QString * s = names.first();s;s = names.next()) - { - int id = cfg.readIntEntry(*s,-1); - QString szTmp; - QPixmap * pix=0; -// debug("%s %s %i %i",__FILE__,__FUNCTION__,__LINE__,id); - if(id!=-1) - pix = g_pIconManager->getSmallIcon(id); - else { - szTmp=cfg.readEntry(*s); - pix=g_pIconManager->getPixmap(szTmp); - if(!pix) - { - id=KVI_SMALLICON_HELP; - pix = g_pIconManager->getSmallIcon(id); - } - } - if(pix) - { - if(bMerge) - { - if(!m_pTextIconDict->find(*s)) - if(id!=-1) - m_pTextIconDict->replace(*s,new KviTextIcon(id)); - else - m_pTextIconDict->replace(*s,new KviTextIcon(szTmp)); - } else { - if(id!=-1) - m_pTextIconDict->replace(*s,new KviTextIcon(id)); - else - m_pTextIconDict->replace(*s,new KviTextIcon(szTmp)); - } - } - } - } - - checkDefaultAssociations(); - emit changed(); - - return upd; -} - -void KviTextIconManager::save(const QString &filename) -{ - KviConfig cfg(filename,KviConfig::Write); - - cfg.setGroup("Manager"); - cfg.writeEntry("ConfigUpdate",TEXTICONMANAGER_CURRENT_CONFIG_UPDATE); - - - cfg.setGroup("TextIcons"); - - KviPointerHashTableIterator<QString,KviTextIcon> it(*m_pTextIconDict); - while(KviTextIcon * i = it.current()) - { - if(i->id()!=-1) - cfg.writeEntry(it.currentKey(),i->id()); - else - cfg.writeEntry(it.currentKey(),i->filename()); - ++it; - } -} - -#include "kvi_texticonmanager.moc" diff --git a/3.4.0/src/kvirc/kernel/kvi_texticonmanager.h b/3.4.0/src/kvirc/kernel/kvi_texticonmanager.h deleted file mode 100644 index 50d06a8e0d..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_texticonmanager.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef _KVI_TEXTICONMANAGER_H_ -#define _KVI_TEXTICONMANAGER_H_ - -//============================================================================= -// -// File : kvi_texticonmanager.h -// Creation date : Thu 15 May 2002 12:04:12 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qpixmap.h> -#include "kvi_pointerhashtable.h" - - -class KVIRC_API KviTextIcon -{ -protected: - int m_iId; - QString m_szFilename; -public: - KviTextIcon(int id) - : m_iId(id) {}; - KviTextIcon(QString szFile) - : m_iId(-1),m_szFilename(szFile) {}; - KviTextIcon(KviTextIcon* icon); - ~KviTextIcon(){}; -public: - int id(){ return m_iId; }; - void setId(int id); - void setFilename(QString filename); - QString filename(){ return m_szFilename; }; - QPixmap * pixmap(); -}; - -class KVIRC_API KviTextIconManager : public QObject -{ - friend class KviTextIconWindow; - friend class KviTextIconsOptionsWidget; - Q_OBJECT -public: - KviTextIconManager(); - ~KviTextIconManager(); -private: - KviPointerHashTable<QString,KviTextIcon> * m_pTextIconDict; -signals: - void changed(); -public: - KviPointerHashTable<QString,KviTextIcon> * textIconDict(){ return m_pTextIconDict; }; - void checkDefaultAssociations(); - void clear(); - void insert(const QString &name,int id); - void insert(const QString &name,KviTextIcon& icon); - KviTextIcon * lookupTextIcon(const QString &name){ return m_pTextIconDict->find(name); }; - void load(); - void save(); -protected: - void save(const QString &filename); - int load(const QString &filename,bool bMerge = false); -}; - -#ifndef _KVI_TEXTICONMANAGER_CPP_ - extern KVIRC_API KviTextIconManager * g_pTextIconManager; -#endif - - -#endif //_KVI_TEXTICONMANAGER_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_theme.cpp b/3.4.0/src/kvirc/kernel/kvi_theme.cpp deleted file mode 100644 index e15e8a6a23..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_theme.cpp +++ /dev/null @@ -1,299 +0,0 @@ -//============================================================================= -// -// File : kvi_themeinfo.cpp -// Creation date : Mon Jan 08 2007 03:23:00 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_theme.h" -#include "kvi_fileutils.h" -#include "kvi_config.h" -#include "kvi_locale.h" -#include "kvi_miscutils.h" -#include "kvi_sourcesdate.h" - -#include <qimage.h> - -#define KVI_THEME_SMALL_SCREENSHOT_NAME "screenshot_small.png" -#define KVI_THEME_MEDIUM_SCREENSHOT_NAME "screenshot_medium.png" -#define KVI_THEME_LARGE_SCREENSHOT_NAME "screenshot.png" - -#ifdef COMPILE_USE_QT4 - #define QIMAGE_SCALE_MIN Qt::KeepAspectRatio -#else - #define QIMAGE_SCALE_MIN QImage::ScaleMin -#endif - -KviThemeInfo::KviThemeInfo() -: KviHeapObject() -{ -} - -KviThemeInfo::~KviThemeInfo() -{ -} - - - -bool KviThemeInfo::load(const QString &szThemeFileName) -{ - if(!KviFileUtils::fileExists(szThemeFileName)) - { - m_szLastError = __tr2qs("The theme information file does not exist"); - return false; - } - - KviConfig cfg(szThemeFileName,KviConfig::Read); - - cfg.setGroup(KVI_THEMEINFO_CONFIG_GROUP); - - m_szThemeEngineVersion = cfg.readQStringEntry("ThemeEngineVersion","1.0.0"); - if(KviMiscUtils::compareVersions(m_szThemeEngineVersion,KVI_CURRENT_THEME_ENGINE_VERSION) < 0) - { - KviQString::sprintf(m_szLastError,__tr2qs("This KVIrc executable is too old for this theme (minimum theme engine version required is %Q while this theme engine has version %s)"),&m_szThemeEngineVersion,KVI_CURRENT_THEME_ENGINE_VERSION); - return false; // incompatible theme engine (will not work) - } - - // mandatory fields - m_szName = cfg.readQStringEntry("Name",""); - - if(m_szName.isEmpty()) - { - m_szLastError = __tr2qs("Theme information file is not valid"); - return false; - } - - // optional fields - m_szVersion = cfg.readQStringEntry("Version",""); - if(m_szVersion.isEmpty()) - m_szVersion = "?.?.?"; - m_szAuthor = cfg.readQStringEntry("Author",""); - QString szUnknown = __tr2qs("Unknown"); - if(m_szAuthor.isEmpty()) - m_szAuthor = szUnknown; - m_szDescription = cfg.readQStringEntry("Description",""); - m_szDate = cfg.readQStringEntry("Date",""); - if(m_szDate.isEmpty()) - m_szDate = szUnknown; - m_szApplication = cfg.readQStringEntry("Application",""); - if(m_szApplication.isEmpty()) - m_szApplication = szUnknown; - - return true; -} - -bool KviThemeInfo::save(const QString &szThemeFileName) -{ - KviConfig inf(szThemeFileName,KviConfig::Write); - - inf.clear(); - - inf.setGroup(KVI_THEMEINFO_CONFIG_GROUP); - - inf.writeEntry("Name",m_szName); - inf.writeEntry("Version",m_szVersion); - inf.writeEntry("Author",m_szAuthor); - inf.writeEntry("Description",m_szDescription); - inf.writeEntry("Date",m_szDate); - inf.writeEntry("ThemeEngineVersion",KVI_CURRENT_THEME_ENGINE_VERSION); - inf.writeEntry("Application","KVIrc " KVI_VERSION "." KVI_SOURCES_DATE); - - return true; -} - -bool KviThemeInfo::loadFromDirectory(const QString &szThemeDirectory,bool bIgnoreThemeData) -{ - QString szD = szThemeDirectory; - szD.append(KVI_PATH_SEPARATOR_CHAR); - szD.append(KVI_THEMEINFO_FILE_NAME); - - if(!load(szD)) - return false; // loading failed for some reason - - m_szAbsoluteDirectory = szThemeDirectory; - - if(bIgnoreThemeData) - return true; // assume success - - // check if themedata file exists - szD = szThemeDirectory; - szD.append(KVI_PATH_SEPARATOR_CHAR); - szD.append(KVI_THEMEDATA_FILE_NAME); - - return KviFileUtils::fileExists(szD); -} - -QString KviThemeInfo::smallScreenshotPath() -{ - QString ret; - if(!m_szAbsoluteDirectory.isEmpty()) - { - ret = m_szAbsoluteDirectory; - KviQString::ensureLastCharIs(ret,KVI_PATH_SEPARATOR_CHAR); - ret.append(KVI_THEME_SMALL_SCREENSHOT_NAME); - } - return ret; -} - -const QPixmap & KviThemeInfo::smallScreenshot() -{ - if(!m_pixScreenshotSmall.isNull())return m_pixScreenshotSmall; - - if(!m_szAbsoluteDirectory.isEmpty()) - { - QString szFileName = m_szAbsoluteDirectory; - KviQString::ensureLastCharIs(szFileName,KVI_PATH_SEPARATOR_CHAR); - szFileName.append(KVI_THEME_SMALL_SCREENSHOT_NAME); - QPixmap pix(szFileName); - if(!pix.isNull()) - { - m_pixScreenshotSmall = pix; - return m_pixScreenshotSmall; - } - // try to scale it from the large one (and save it by the way) - pix = mediumScreenshot(); - if(pix.isNull())return m_pixScreenshotSmall; - - if(pix.width() > 300 || pix.height() > 225) - { - QImage sbri = pix.convertToImage(); - pix.convertFromImage(sbri.smoothScale(300,225,QIMAGE_SCALE_MIN)); - } - - pix.save(szFileName,"PNG"); - - m_pixScreenshotSmall = pix; - return m_pixScreenshotSmall; - } - - return m_pixScreenshotSmall; -} - -const QPixmap & KviThemeInfo::mediumScreenshot() -{ - if(!m_pixScreenshotMedium.isNull())return m_pixScreenshotMedium; - - if(!m_szAbsoluteDirectory.isEmpty()) - { - QString szFileName = m_szAbsoluteDirectory; - KviQString::ensureLastCharIs(szFileName,KVI_PATH_SEPARATOR_CHAR); - szFileName.append(KVI_THEME_MEDIUM_SCREENSHOT_NAME); - QPixmap pix(szFileName); - if(!pix.isNull()) - { - m_pixScreenshotMedium = pix; - return m_pixScreenshotMedium; - } - // try to scale it from the large one (and save it by the way) - pix = largeScreenshot(); - if(pix.isNull())return m_pixScreenshotMedium; - - if(pix.width() > 600 || pix.height() > 450) - { - QImage sbri = pix.convertToImage(); - pix.convertFromImage(sbri.smoothScale(600,450,QIMAGE_SCALE_MIN)); - } - - pix.save(szFileName,"PNG"); - - m_pixScreenshotMedium = pix; - return m_pixScreenshotMedium; - } - - return m_pixScreenshotMedium; -} - -const QPixmap & KviThemeInfo::largeScreenshot() -{ - if(!m_pixScreenshotLarge.isNull())return m_pixScreenshotLarge; - - if(!m_szAbsoluteDirectory.isEmpty()) - { - QString szFileName = m_szAbsoluteDirectory; - KviQString::ensureLastCharIs(szFileName,KVI_PATH_SEPARATOR_CHAR); - szFileName.append(KVI_THEME_LARGE_SCREENSHOT_NAME); - QPixmap pix(szFileName); - if(pix.isNull())return m_pixScreenshotLarge; - m_pixScreenshotLarge = pix; - } - return m_pixScreenshotLarge; -} - - -namespace KviTheme -{ - bool saveScreenshots(KviThemeInfo &options,const QString &szOriginalScreenshotPath) - { - QImage pix(szOriginalScreenshotPath); - if(pix.isNull()) - { - options.setLastError(__tr2qs("Failed to load the specified screenshot image")); - return false; - } - - QPixmap out; - - QString szScreenshotFileName = options.absoluteDirectory(); - if(szScreenshotFileName.isEmpty()) - { - options.setLastError(__tr2qs("Invalid option")); - return false; - } - - KviQString::ensureLastCharIs(szScreenshotFileName,KVI_PATH_SEPARATOR_CHAR); - szScreenshotFileName.append(KVI_THEME_LARGE_SCREENSHOT_NAME); - if(!pix.save(szScreenshotFileName,"PNG")) - { - options.setLastError(__tr2qs("Failed to save the screenshot image")); - return false; - } - - if(pix.width() > 600 || pix.height() > 450) - out.convertFromImage(pix.smoothScale(600,450,QIMAGE_SCALE_MIN)); - else - out.convertFromImage(pix); - - szScreenshotFileName = options.absoluteDirectory(); - KviQString::ensureLastCharIs(szScreenshotFileName,KVI_PATH_SEPARATOR_CHAR); - szScreenshotFileName.append(KVI_THEME_MEDIUM_SCREENSHOT_NAME); - if(!out.save(szScreenshotFileName,"PNG")) - { - options.setLastError(__tr2qs("Failed to save the screenshot image")); - return false; - } - - if(pix.width() > 300 || pix.height() > 225) - out.convertFromImage(pix.smoothScale(300,225,QIMAGE_SCALE_MIN)); - else - out.convertFromImage(pix); - - szScreenshotFileName = options.absoluteDirectory(); - KviQString::ensureLastCharIs(szScreenshotFileName,KVI_PATH_SEPARATOR_CHAR); - szScreenshotFileName.append(KVI_THEME_SMALL_SCREENSHOT_NAME); - if(!out.save(szScreenshotFileName,"PNG")) - { - options.setLastError(__tr2qs("Failed to save the screenshot image")); - return false; - } - - return true; - } -}; diff --git a/3.4.0/src/kvirc/kernel/kvi_theme.h b/3.4.0/src/kvirc/kernel/kvi_theme.h deleted file mode 100644 index fdf75e2591..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_theme.h +++ /dev/null @@ -1,171 +0,0 @@ -#ifndef _KVI_THEME_H_ -#define _KVI_THEME_H_ - -//============================================================================= -// -// File : kvi_theme.h -// Creation date : Mon Jan 08 2007 03:23:00 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_heapobject.h" - -#include "kvi_fileextensions.h" - -#include <qpixmap.h> - -#define KVI_THEMEINFO_FILE_NAME "themeinfo." KVI_FILEEXTENSION_CONFIG -#define KVI_THEMEDATA_FILE_NAME "themedata." KVI_FILEEXTENSION_CONFIG -#define KVI_THEMEINFO_CONFIG_GROUP "ThemeInfo" -#define KVI_THEMEDATA_CONFIG_GROUP "ThemeData" - -/// -/// The current theme engine version: bump up if you make INCOMPATIBLE -/// changes in the method of saving the theme. -/// -#define KVI_CURRENT_THEME_ENGINE_VERSION "1.0.0" - -/// -/// \class KviThemeInfo -/// -/// \brief A set of informations about a KVIrc theme -/// -/// This object contains a set of informations about -/// a theme that can be read and stored to a standard -/// KVIrc configuration file (which is usually named -/// themeinfo.kvc but this is not strictly necessary). -/// -class KVIRC_API KviThemeInfo : public KviHeapObject -{ -public: - KviThemeInfo(); - ~KviThemeInfo(); -protected: - QString m_szName; //< name of the theme - QString m_szVersion; //< version of the theme - QString m_szSubdirectory; //< subdirectory of $LOCALKVIRCDIR/themes where the theme is saved to (not always used) - QString m_szAbsoluteDirectory; //< absolute directory where the theme should be saved to (or is loaded from) - QString m_szAuthor; //< author of the theme - QString m_szDescription; //< description of the theme - QString m_szDate; //< theme creation date - QString m_szApplication; //< theme creation (KVIrc) version - QString m_szThemeEngineVersion; //< the theme engine version that saved this theme - - QString m_szLastError; //< reported when some function fails - - QPixmap m_pixScreenshotLarge; //< the large screenshot pixmap - QPixmap m_pixScreenshotMedium; //< the medium screenshot pixmap - QPixmap m_pixScreenshotSmall; //< the small screenshot pixmap -public: - /// - /// load data from a specified theme config file - /// - bool load(const QString &szThemeFileName); - /// - /// save the currently defined theme configuration in the specified file - /// - bool save(const QString &szThemeFileName); - - const QString & lastError(){ return m_szLastError; }; - void setLastError(const QString &szLastError){ m_szLastError = szLastError; }; - const QString & name(){ return m_szName; }; - void setName(const QString &szName){ m_szName = szName; }; - const QString & version(){ return m_szVersion; }; - void setVersion(const QString &szVersion){ m_szVersion = szVersion; }; - const QString & subdirectory(){ return m_szSubdirectory; }; - void setSubdirectory(const QString &szSubdirectory){ m_szSubdirectory = szSubdirectory; }; - const QString & absoluteDirectory(){ return m_szAbsoluteDirectory; }; - void setAbsoluteDirectory(const QString &szAbsoluteDirectory){ m_szAbsoluteDirectory = szAbsoluteDirectory; } - const QString & author(){ return m_szAuthor; }; - void setAuthor(const QString &szAuthor){ m_szAuthor = szAuthor; }; - const QString & description(){ return m_szDescription; }; - void setDescription(const QString &szDescription){ m_szDescription = szDescription; }; - const QString & date(){ return m_szDate; }; - void setDate(const QString &szDate){ m_szDate = szDate; }; - const QString & application(){ return m_szApplication; }; - void setApplication(const QString &szApplication){ m_szApplication = szApplication; }; - const QString & themeEngineVersion(){ return m_szThemeEngineVersion; }; - void setThemeEngineVersion(const QString &szThemeEngineVersion){ m_szThemeEngineVersion = szThemeEngineVersion; }; - - /// - /// Attempt to load a themeinfo.kvc file present in the specified directory. - /// This function will fail if the directory contains a valid themeinfo.kvc - /// file but no themedata.kvc file unless bIgnoreThemeData is set to true - /// - bool loadFromDirectory(const QString &szThemeDirectory,bool bIgnoreThemeData = false); - - /// - /// Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png - /// This function will work only if the absoluteDirectory() of the theme - /// has been set, otherwise the returned pixmap will be null. - /// - const QPixmap & smallScreenshot(); - /// - /// Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png - /// This function will work only if the absoluteDirectory() of the theme - /// has been set, otherwise the returned pixmap will be null. - /// - const QPixmap & mediumScreenshot(); - /// - /// Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png - /// This function will work only if the absoluteDirectory() of the theme - /// has been set, otherwise the returned pixmap will be null. - /// - const QPixmap & largeScreenshot(); - /// - /// Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png - /// This function will work only if the absoluteDirectory() of the theme - /// has been set, otherwise the returned pixmap will be null. - /// - QString smallScreenshotPath(); -}; - -namespace KviTheme -{ - /// - /// Attempt to load (apply) a theme in the specified directory - /// Will return true on success and false on failure. - /// On success this function will return the theme informations in the buffer. - /// On failure this function will also set buffer.lastError() to a meaningful value - /// Note that for convenience this function is implemented in kvi_options.cpp - /// - bool KVIRC_API load(const QString &szThemeDir,KviThemeInfo &buffer); - /// - /// Save a theme given the specified options. - /// Will return true on success and false on failure. - /// On failure this function will also set options.lastError() to a meaningful value - /// This function requires both absoluteDirectory() and subdirectory() to be - /// set to the right values. In theory this function could save a theme - /// in a directory different than $KVIRC_LOCAL_DIR/themes/subdirectory - /// but this feature is actually unused. - /// Note that for convenience this function is implemented in kvi_options.cpp - /// - bool KVIRC_API save(KviThemeInfo &options); - /// - /// Save the theme screenshots in the given EXISTING directory and given - /// an existing screenshot on disk (usually in the tmp directory). - /// - bool KVIRC_API saveScreenshots(KviThemeInfo &options,const QString &szOriginalScreenshotPath); -}; - - -#endif //_KVI_THEME_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_useraction.cpp b/3.4.0/src/kvirc/kernel/kvi_useraction.cpp deleted file mode 100644 index fa3c7a0dfc..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_useraction.cpp +++ /dev/null @@ -1,46 +0,0 @@ -//============================================================================= -// -// File : kvi_userlistview.cpp -// Creation date : Tue Mar 18 2003 13:36:12 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_useraction.h" - -static int useraction_table[KVI_NUM_USERACTION_TYPES]= -{ - 25, // ACTION (typically human) - 25, // PRIVMSG - 25, // NOTICE - 20, // TOPIC - 5, // KICK - -5, // NICK - -20, // CHANMODE - -25, // JOIN - -25 // PART (this works only for channels and not for single users on channels) -}; - -int kvi_getUserActionTemperature(unsigned int uIdx) -{ - return useraction_table[uIdx]; -} - diff --git a/3.4.0/src/kvirc/kernel/kvi_useraction.h b/3.4.0/src/kvirc/kernel/kvi_useraction.h deleted file mode 100644 index e85c722974..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_useraction.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef _KVI_USERACTION_H_ -#define _KVI_USERACTION_H_ - -//============================================================================= -// -// File : kvi_userlistview.h -// Creation date : Tue Mar 18 2003 13:36:12 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -// This file defines the user action "temperatures". -// The more "hot" is an action, the more humanity is in it - -#define KVI_USERACTION_ACTION 0 -#define KVI_USERACTION_PRIVMSG 1 -#define KVI_USERACTION_NOTICE 2 -#define KVI_USERACTION_TOPIC 3 -#define KVI_USERACTION_KICK 4 -#define KVI_USERACTION_NICK 5 -#define KVI_USERACTION_CHANMODE 6 -#define KVI_USERACTION_JOIN 7 -#define KVI_USERACTION_PART 8 - -#define KVI_NUM_USERACTION_TYPES 9 - - -extern KVIRC_API int kvi_getUserActionTemperature(unsigned int uIdx); - - -// -// ACTION 30 -// NOTICE 25 -// PRIVMSG 25 -// TOPIC 20 -// KICK 10 -// OP 5 -// VOICE 5 -// DEOP -5 -// DEVOICE -5 -// UNBAN -15 -// BAN -20 -// CHANMODE -25 -// NICK -30 -// JOIN -30 -// - -// These are the temperature levels for a single user on a channel - -// Maximum : can't go above this -#define KVI_MAX_TEMPERATURE 150 -// Hot : human -#define KVI_HOT_TEMPERATURE 100 -// Half hot : signs of humanity -#define KVI_HALF_HOT_TEMPERATURE 40 -// Mid : uncertain -#define KVI_MID_TEMPERATURE 0 -// Half cold : automa ? -#define KVI_HALF_COLD_TEMPERATURE -40 -// Cold : bot -#define KVI_COLD_TEMPERATURE -100 -// Minimum : can't drop below this -#define KVI_MIN_TEMPERATURE -150 - -#endif // _KVI_USERACTION_H_ diff --git a/3.4.0/src/kvirc/kernel/kvi_userinput.cpp b/3.4.0/src/kvirc/kernel/kvi_userinput.cpp deleted file mode 100644 index c50baa2b2a..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_userinput.cpp +++ /dev/null @@ -1,148 +0,0 @@ -//============================================================================= -// -// File : kvi_userinput.cpp -// Created on Sun 25 Sep 2005 05:27:57 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_userinput.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_console.h" -#include "kvi_kvs_script.h" -#include "kvi_locale.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_out.h" -#include "kvi_options.h" -#include "kvi_kvs_eventtriggers.h" - -namespace KviUserInput -{ - bool parse(QString &szData,KviWindow * pWindow,const QString &szContext,bool bUserFriendlyCommandline) - { - const QChar * b = KviQString::nullTerminatedArray(szData); - const QChar * c = b; - if(!c)return true; // empty - - while(c->isSpace())c++; - if(!c->unicode())return true; // empty - - if(c->unicode() == '\\') - { - c++; - if(c->unicode() != '/')c--; - } else { - if(c->unicode() == '/') - { - c++; - if(c->unicode() != '/') - { - szData.remove(0,c-b); - return parseCommand(szData,pWindow,szContext,bUserFriendlyCommandline); - } else { - // C++ comment, probably - c--; - } - } - } - - if(KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnTextInput,pWindow,szData)) - return true; // halted - - if(c != b)szData.remove(0,c-b); - parseNonCommand(szData,pWindow); - return true; - } - - bool parseCommand(const QString &szData,KviWindow * pWindow,const QString &szContext,bool bUserFriendlyCommandline) - { - if(bUserFriendlyCommandline) - { - static QString szUserFriendlyCommandlineContext(__tr2qs("commandline::userfriendly")); - QString szCmd=szData; - // escape any -$;\%( - szCmd.replace("\\","\\\\"); - szCmd.replace("\"","\\\""); - szCmd.replace("$","\\$"); - szCmd.replace("%","\\%"); - szCmd.replace("(","\\("); - szCmd.replace(";","\\;"); - szCmd.replace("-","\\-"); - szCmd.replace("+","\\+"); - KviKvsScript kvs(szContext.isEmpty() ? szUserFriendlyCommandlineContext : szContext,szCmd); - return (kvs.run(pWindow,0,0) != KviKvsScript::Error); - } else { - static QString szCommandlineContext(__tr2qs("commandline::kvs")); - KviKvsScript kvs(szContext.isEmpty() ? szCommandlineContext : szContext,szData); - return (kvs.run(pWindow,0,0/*,KviKvsScript::AssumeLocals*/) != KviKvsScript::Error); - } - } - - void parseNonCommand(QString &szData,KviWindow * pWindow) - { - const QChar * aux = KviQString::nullTerminatedArray(szData); - const QChar * beg = aux; - if(!beg)return; // empty - - while(aux->unicode()) - { - while(aux->unicode() && (aux->unicode() != '\n'))aux++; - QString buf(beg,aux-beg); - if(aux->unicode() == '\n')aux++; - beg = aux; - - if(buf.isEmpty())buf = " "; // avoid "No text to send" (d3vah) - - switch(pWindow->type()) - { - case KVI_WINDOW_TYPE_CONSOLE: - if(pWindow->connection()) - { - KviQCString data = pWindow->connection()->encodeText(buf); - if(((KviConsole *)pWindow)->connection()->sendData(data.data())) - { - pWindow->output(KVI_OUT_RAW,"[RAW]: %Q",&buf); - return; - } - } - pWindow->output(KVI_OUT_PARSERERROR,__tr2qs("You are not connected to a server")); - break; - case KVI_WINDOW_TYPE_CHANNEL: - case KVI_WINDOW_TYPE_QUERY: - if(pWindow->connection()) - { - if(KVI_OPTION_BOOL(KviOption_boolExitAwayOnInput)) - if(pWindow->connection()->userInfo()->isAway()) - parseCommand("back",pWindow->console()); - } - pWindow->ownMessage(buf); - break; - case KVI_WINDOW_TYPE_DCCCHAT: - pWindow->ownMessage(buf); - break; - default: - // FIXME: Should pass the message somewhere ?.. a KviWindow handler ? - break; - } - } - } -}; diff --git a/3.4.0/src/kvirc/kernel/kvi_userinput.h b/3.4.0/src/kvirc/kernel/kvi_userinput.h deleted file mode 100644 index 94faed47cd..0000000000 --- a/3.4.0/src/kvirc/kernel/kvi_userinput.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef _KVI_USERINPUT_H_ -#define _KVI_USERINPUT_H_ -//============================================================================= -// -// File : kvi_userinput.h -// Created on Sun 25 Sep 2005 05:27:57 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_window.h" - -namespace KviUserInput -{ - // WARNING: May destroy szData - // returns false if szData is a command and it fails to run - KVIRC_API bool parse(QString &szData,KviWindow * pWindow,const QString &szContext = KviQString::empty,bool bUserFriendlyCommandline = false); - - KVIRC_API bool parseCommand(const QString &szData,KviWindow * pWindow,const QString &szContext = KviQString::empty,bool bUserFriendlyCommandline = false); - //bool parseCommandWithSingleArgument(const QString &szData,KviWindow * pWindow,const QString &szContext = KviQString::empty); - KVIRC_API void parseNonCommand(QString &szData,KviWindow * pWindow); -}; - - -#endif //!_KVI_USERINPUT_H_ diff --git a/3.4.0/src/kvirc/kvirc.dsp b/3.4.0/src/kvirc/kvirc.dsp deleted file mode 100644 index 816136061b..0000000000 --- a/3.4.0/src/kvirc/kvirc.dsp +++ /dev/null @@ -1,4184 +0,0 @@ -# Microsoft Developer Studio Project File - Name="kvirc" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=kvirc - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "kvirc.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "kvirc.mak" CFG="kvirc - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "kvirc - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "kvirc - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\kvilib\tal" /I "..\kvilib\system" /I "..\kvilib\irc" /I "..\kvilib\file" /I "..\kvilib\ext" /I "..\kvilib\net" /I "..\kvilib\core\wstring" /I "..\kvilib\core" /I "..\kvilib\config" /I "kvs" /I "module" /I "uparser\scripttoolbar" /I "uparser" /I "sparser" /I "kernel" /I "ui" /I "$(QTDIR)\include" /I "C:\ssl" /I "C:\zlib\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x410 /d "NDEBUG" -# ADD RSC /l 0x410 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 libeay32.lib SSLeay32.lib ws2_32.lib KVILIB.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib wsock32.lib winspool.lib winmm.lib $(QTDIR)\lib\qt-mtnc321.lib $(QTDIR)\lib\qtmain.lib C:\zlib\lib\zdll.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"msvcrt.lib" /libpath:"..\kvilib\Release" /libpath:"C:\OpenSSL\lib\VC" -# SUBTRACT LINK32 /pdb:none -# Begin Custom Build -OutDir=.\Release -InputPath=.\Release\kvirc.exe -SOURCE="$(InputPath)" - -"..\..\win32build\bin\kvirc.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(OutDir)\kvirc.exe ..\..\win32build\bin\kvirc.exe - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /vmg /GX /Zi /Od /I "..\kvilib\tal" /I "..\kvilib\system" /I "..\kvilib\irc" /I "..\kvilib\file" /I "..\kvilib\ext" /I "..\kvilib\net" /I "..\kvilib\core\wstring" /I "..\kvilib\core" /I "..\kvilib\config" /I "kvs" /I "module" /I "uparser\scripttoolbar" /I "uparser" /I "sparser" /I "kernel" /I "ui" /I "$(QTDIR)\include" /I "C:\ssl" /I "C:\zlib\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x410 /d "NDEBUG" -# ADD RSC /l 0x410 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 libeay32.lib SSLeay32.lib ws2_32.lib KVILIB.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib wsock32.lib winspool.lib winmm.lib $(QTDIR)\lib\qt-mtnc321.lib $(QTDIR)\lib\qtmain.lib C:\zlib\lib\zdll.lib /nologo /subsystem:windows /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrt.lib" /out:".\Debug\kvirc.exe" /pdbtype:sept /libpath:"..\kvilib\Debug" /libpath:"C:\OpenSSL\lib\VC" -# SUBTRACT LINK32 /pdb:none -# Begin Custom Build -OutDir=.\Debug -InputPath=.\Debug\kvirc.exe -SOURCE="$(InputPath)" - -"..\..\win32build\KviDebug\kvirc.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(OutDir)\kvirc.exe ..\..\win32build\KviDebug\kvirc.exe - -# End Custom Build - -!ENDIF - -# Begin Target - -# Name "kvirc - Win32 Release" -# Name "kvirc - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\kernel\kvi_action.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_actiondrawer.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_actionmanager.cpp -# End Source File -# Begin Source File - -SOURCE=.\sparser\kvi_antispam.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_app.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_app_fs.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_app_setup.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_asynchronousconnectiondata.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_channel.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_colorwin.cpp -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_command.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_console.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_coreactions.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_cryptcontroller.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_ctcppagedialog.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_customtoolbar.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_customtoolbardescriptor.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_customtoolbarmanager.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_debugwindow.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_debugwindow.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_dynamictooltip.cpp -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_exprtree.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_filedialog.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_filetransfer.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_frame.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_historywin.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_iconmanager.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_imagedialog.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_input.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_internalcmd.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ipc.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_ipeditor.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnection.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectionantictcpflooddata.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectionasyncwhoisdata.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectionnetsplitdetectordata.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectionserverinfo.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectionstatedata.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectionstatistics.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectiontarget.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectiontargetresolver.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectionuserinfo.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_irccontext.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircdatastreammonitor.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_irclink.cpp -# End Source File -# Begin Source File - -SOURCE=.\sparser\kvi_ircmessage.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircsocket.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_irctoolbar.cpp -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_ircurl.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_ircview.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_ircviewtools.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_action.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_aliasmanager.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_array.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_arraycast.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_asyncdnsoperation.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_asyncoperation.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_callbackobject.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_corecallbackcommands.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_corefunctions.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_corefunctions_af.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_corefunctions_gl.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_corefunctions_mr.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_corefunctions_sz.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_coresimplecommands.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_coresimplecommands_af.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_coresimplecommands_gl.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_coresimplecommands_mr.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_coresimplecommands_sz.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_dnsmanager.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_event.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_eventhandler.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_eventmanager.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_eventtable.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_hash.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_kernel.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_moduleinterface.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_object.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_object_class.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_object_controller.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_object_functioncall.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_object_functionhandler.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_object_functionhandlerimpl.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_parameterprocessor.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_parser.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_parser_command.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_parser_comment.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_parser_dollar.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_parser_expression.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_parser_lside.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_parser_specialcommands.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_popupmanager.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_popupmenu.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_processmanager.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_report.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_runtimecall.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_runtimecontext.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_rwevaluationresult.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_script.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_scriptaddonmanager.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_switchlist.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_timermanager.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_aliasfunctioncall.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_aliassimplecommand.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_arraycount.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_arrayelement.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_arrayorhashelement.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_arrayreferenceassert.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_base.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_baseobjectfunctioncall.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_callbackcommand.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_command.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_commandevaluation.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_commandwithparameters.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_compositedata.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_constantdata.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_corecallbackcommand.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_corefunctioncall.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_coresimplecommand.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_data.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_datalist.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_expression.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_expressionreturn.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_extendedscopevariable.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_functioncall.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_globalvariable.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_hashcount.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_hashelement.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_hashreferenceassert.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_indirectdata.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_instruction.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_instructionblock.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_localvariable.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_modulecallbackcommand.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_modulefunctioncall.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_modulesimplecommand.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_multipleparameteridentifier.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_objectfield.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_objectfunctioncall.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_operation.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_parameterreturn.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_rebindingswitch.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_scopeoperator.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_simplecommand.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_singleparameteridentifier.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommand.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommandbreak.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommandclass.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommanddefpopup.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommanddo.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommandfor.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommandforeach.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommandif.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommandswitch.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommandunset.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommandwhile.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_switchlist.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_thisobjectfunctioncall.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_variable.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_voidfunctioncall.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_useraction.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_variant.cpp -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_variantlist.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_lagmeter.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_listview.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_main.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_maskeditor.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_mdicaption.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_mdichild.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_mdimanager.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_menubar.cpp -# End Source File -# Begin Source File - -SOURCE=.\module\kvi_mexlinkfilter.cpp -# End Source File -# Begin Source File - -SOURCE=.\module\kvi_mexserverimport.cpp -# End Source File -# Begin Source File - -SOURCE=.\module\kvi_mextoolbar.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_modeeditor.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_modew.cpp -# End Source File -# Begin Source File - -SOURCE=.\module\kvi_module.cpp -# End Source File -# Begin Source File - -SOURCE=.\module\kvi_moduleextension.cpp -# End Source File -# Begin Source File - -SOURCE=.\module\kvi_modulemanager.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_msgbox.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_notifylist.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_options.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_optionswidget.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_query.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_scriptbutton.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_scripteditor.cpp -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_scriptobject.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_selectors.cpp -# End Source File -# Begin Source File - -SOURCE=.\sparser\kvi_sp_ctcp.cpp -# End Source File -# Begin Source File - -SOURCE=.\sparser\kvi_sp_literal.cpp -# End Source File -# Begin Source File - -SOURCE=.\sparser\kvi_sp_numeric.cpp -# End Source File -# Begin Source File - -SOURCE=.\sparser\kvi_sp_tables.cpp -# End Source File -# Begin Source File - -SOURCE=.\sparser\kvi_sparser.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_splash.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_sslmaster.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_statusbar.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_statusbarapplet.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_styled_controls.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_taskbar.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_texticonmanager.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_texticonwin.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_themedlabel.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_toolbar.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_toolwindows_container.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_topicw.cpp -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_up_cmd.cpp -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_up_expr.cpp -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_up_fnc.cpp -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_up_oper.cpp -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_up_skip.cpp -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_uparser.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_useraction.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_userinput.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_userlistview.cpp -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_window.cpp -# End Source File -# Begin Source File - -SOURCE=.\kernel\moc_kvi_action.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\ui\moc_kvi_actiondrawer.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kernel\moc_kvi_actionmanager.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kernel\moc_kvi_coreactions.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\ui\moc_kvi_customtoolbar.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\ui\moc_kvi_debugwindow.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kernel\moc_kvi_filetransfer.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\ui\moc_kvi_imagedialog.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kernel\moc_kvi_ircconnection.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kernel\moc_kvi_ircconnectiontargetresolver.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kernel\moc_kvi_irccontext.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kernel\moc_kvi_irclink.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kernel\moc_kvi_ircsocket.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\ui\moc_kvi_ircviewtools.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kvs\moc_kvi_kvs_action.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kvs\moc_kvi_kvs_asyncdnsoperation.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kvs\moc_kvi_kvs_asyncoperation.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kvs\moc_kvi_kvs_dnsmanager.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kvs\moc_kvi_kvs_object.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kvs\moc_kvi_kvs_popupmenu.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kvs\moc_kvi_kvs_processmanager.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kvs\moc_kvi_kvs_timermanager.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kvs\moc_kvi_kvs_treenode_specialcommandswitch.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kvs\moc_kvi_kvs_treenode_specialcommandunset.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\kvs\moc_kvi_kvs_useraction.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\ui\moc_kvi_listview.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\ui\moc_kvi_mdicaption.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\ui\moc_kvi_mdichild.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\ui\moc_kvi_mdimanager.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\module\moc_kvi_mexlinkfilter.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\module\moc_kvi_mexserverimport.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\module\moc_kvi_mextoolbar.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\module\moc_kvi_modulemanager.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\ui\moc_kvi_statusbar.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\ui\moc_kvi_statusbarapplet.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# Begin Source File - -SOURCE=.\ui\moc_kvi_toolwindows_container.cpp -# ADD CPP /D "__KVIRC__" -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\kernel\kvi_action.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_action.h -InputName=kvi_action - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_action.h -InputName=kvi_action - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_actiondrawer.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_actiondrawer.h -InputName=kvi_actiondrawer - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_actiondrawer.h -InputName=kvi_actiondrawer - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_actionmanager.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_actionmanager.h -InputName=kvi_actionmanager - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_actionmanager.h -InputName=kvi_actionmanager - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\sparser\kvi_antispam.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_app.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_app.h -InputName=kvi_app - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_app.h -InputName=kvi_app - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_asynchronousconnectiondata.h -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_channel.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_channel.h -InputName=kvi_channel - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_channel.h -InputName=kvi_channel - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_colorwin.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_colorwin.h -InputName=kvi_colorwin - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_colorwin.h -InputName=kvi_colorwin - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_command.h -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_console.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_console.h -InputName=kvi_console - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_console.h -InputName=kvi_console - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_coreactionnames.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_coreactions.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_coreactions.h -InputName=kvi_coreactions - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_coreactions.h -InputName=kvi_coreactions - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_cryptcontroller.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_cryptcontroller.h -InputName=kvi_cryptcontroller - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_cryptcontroller.h -InputName=kvi_cryptcontroller - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_ctcppagedialog.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_ctcppagedialog.h -InputName=kvi_ctcppagedialog - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_ctcppagedialog.h -InputName=kvi_ctcppagedialog - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_customtoolbar.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_customtoolbar.h -InputName=kvi_customtoolbar - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_customtoolbar.h -InputName=kvi_customtoolbar - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_customtoolbardescriptor.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_customtoolbarmanager.h -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_debugwindow.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_debugwindow.h -InputName=kvi_debugwindow - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_debugwindow.h -InputName=kvi_debugwindow - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_dynamictooltip.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_dynamictooltip.h -InputName=kvi_dynamictooltip - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_dynamictooltip.h -InputName=kvi_dynamictooltip - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_eventhandler.h -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_exprtree.h -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_filedialog.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_filedialog.h -InputName=kvi_filedialog - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_filedialog.h -InputName=kvi_filedialog - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_filetransfer.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_filetransfer.h -InputName=kvi_filetransfer - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_filetransfer.h -InputName=kvi_filetransfer - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_frame.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_frame.h -InputName=kvi_frame - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_frame.h -InputName=kvi_frame - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_historywin.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_historywin.h -InputName=kvi_historywin - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_historywin.h -InputName=kvi_historywin - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_iconmanager.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_iconmanager.h -InputName=kvi_iconmanager - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_iconmanager.h -InputName=kvi_iconmanager - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_imagedialog.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_imagedialog.h -InputName=kvi_imagedialog - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_imagedialog.h -InputName=kvi_imagedialog - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_input.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_input.h -InputName=kvi_input - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_input.h -InputName=kvi_input - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_internalcmd.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ipc.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_ipc.h -InputName=kvi_ipc - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_ipc.h -InputName=kvi_ipc - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_ipeditor.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_ipeditor.h -InputName=kvi_ipeditor - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_ipeditor.h -InputName=kvi_ipeditor - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnection.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_ircconnection.h -InputName=kvi_ircconnection - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_ircconnection.h -InputName=kvi_ircconnection - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectionantictcpflooddata.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectionasyncwhoisdata.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectionnetsplitdetectordata.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectionserverinfo.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectionstatedata.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectionstatistics.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectiontarget.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectiontargetresolver.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_ircconnectiontargetresolver.h -InputName=kvi_ircconnectiontargetresolver - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_ircconnectiontargetresolver.h -InputName=kvi_ircconnectiontargetresolver - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircconnectionuserinfo.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_irccontext.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_irccontext.h -InputName=kvi_irccontext - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_irccontext.h -InputName=kvi_irccontext - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircdatastreammonitor.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_irclink.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_irclink.h -InputName=kvi_irclink - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_irclink.h -InputName=kvi_irclink - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\sparser\kvi_ircmessage.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ircsocket.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_ircsocket.h -InputName=kvi_ircsocket - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_ircsocket.h -InputName=kvi_ircsocket - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_irctoolbar.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_irctoolbar.h -InputName=kvi_irctoolbar - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_irctoolbar.h -InputName=kvi_irctoolbar - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_ircurl.h -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_ircview.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_ircview.h -InputName=kvi_ircview - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_ircview.h -InputName=kvi_ircview - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_ircviewprivate.h -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_ircviewtools.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_ircviewtools.h -InputName=kvi_ircviewtools - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_ircviewtools.h -InputName=kvi_ircviewtools - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_action.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_action.h -InputName=kvi_kvs_action - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_action.h -InputName=kvi_kvs_action - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_aliasmanager.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_array.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_arraycast.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_asyncdnsoperation.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_asyncdnsoperation.h -InputName=kvi_kvs_asyncdnsoperation - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_asyncdnsoperation.h -InputName=kvi_kvs_asyncdnsoperation - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_asyncoperation.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_asyncoperation.h -InputName=kvi_kvs_asyncoperation - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_asyncoperation.h -InputName=kvi_kvs_asyncoperation - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_callbackobject.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_corecallbackcommands.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_corefunctions.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_coresimplecommands.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_dnsmanager.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_dnsmanager.h -InputName=kvi_kvs_dnsmanager - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_dnsmanager.h -InputName=kvi_kvs_dnsmanager - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_event.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_eventhandler.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_eventmanager.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_eventtable.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_hash.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_kernel.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_moduleinterface.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_object.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_object.h -InputName=kvi_kvs_object - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_object.h -InputName=kvi_kvs_object - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_object_class.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_object_controller.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_object_functioncall.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_object_functionhandler.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_object_functionhandlerimpl.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_parameterprocessor.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_parser.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_parser_macros.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_popupmenu.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_popupmenu.h -InputName=kvi_kvs_popupmenu - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_popupmenu.h -InputName=kvi_kvs_popupmenu - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_processmanager.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_processmanager.h -InputName=kvi_kvs_processmanager - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_processmanager.h -InputName=kvi_kvs_processmanager - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_report.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_runtimecall.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_runtimecontext.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_rwevaluationresult.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_script.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_scriptaddonmanager.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_switchlist.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_timermanager.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_timermanager.h -InputName=kvi_kvs_timermanager - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_timermanager.h -InputName=kvi_kvs_timermanager - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_aliasfunctioncall.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_aliassimplecommand.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_arraycount.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_arrayelement.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_arrayorhashelement.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_arrayreferenceassert.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_base.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_baseobjectfunctioncall.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_callbackcommand.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_command.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_commandevaluation.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_commandwithparameters.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_compositedata.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_constantdata.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_corecallbackcommand.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_corefunctioncall.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_coresimplecommand.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_data.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_datalist.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_expression.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_expressionreturn.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_extendedscopevariable.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_functioncall.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_globalvariable.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_hashcount.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_hashelement.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_hashreferenceassert.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_indirectdata.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_instruction.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_instructionblock.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_localvariable.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_modulecallbackcommand.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_modulefunctioncall.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_modulesimplecommand.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_multipleparameteridentifier.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_objectfield.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_objectfunctioncall.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_operation.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_parameterreturn.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_rebindingswitch.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_scopeoperator.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_simplecommand.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_singleparameteridentifier.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommand.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommandbreak.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommandclass.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommanddefpopup.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommanddo.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommandfor.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommandforeach.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommandif.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommandswitch.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_treenode_specialcommandswitch.h -InputName=kvi_kvs_treenode_specialcommandswitch - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommandunset.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_treenode_specialcommandunset.h -InputName=kvi_kvs_treenode_specialcommandunset - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_specialcommandwhile.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_switchlist.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_thisobjectfunctioncall.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_variable.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_treenode_voidfunctioncall.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_types.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_useraction.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_useraction.h -InputName=kvi_kvs_useraction - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kvs -InputPath=.\kvs\kvi_kvs_useraction.h -InputName=kvi_kvs_useraction - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_variant.h -# End Source File -# Begin Source File - -SOURCE=.\kvs\kvi_kvs_variantlist.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_lagmeter.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_lagmeter.h -InputName=kvi_lagmeter - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_lagmeter.h -InputName=kvi_lagmeter - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_listview.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_listview.h -InputName=kvi_listview - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_listview.h -InputName=kvi_listview - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_maskeditor.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_maskeditor.h -InputName=kvi_maskeditor - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_maskeditor.h -InputName=kvi_maskeditor - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_mdicaption.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_mdicaption.h -InputName=kvi_mdicaption - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_mdicaption.h -InputName=kvi_mdicaption - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_mdichild.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_mdichild.h -InputName=kvi_mdichild - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_mdichild.h -InputName=kvi_mdichild - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_mdimanager.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_mdimanager.h -InputName=kvi_mdimanager - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_mdimanager.h -InputName=kvi_mdimanager - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_menubar.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_menubar.h -InputName=kvi_menubar - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_menubar.h -InputName=kvi_menubar - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\module\kvi_mexlinkfilter.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\module -InputPath=.\module\kvi_mexlinkfilter.h -InputName=kvi_mexlinkfilter - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\module -InputPath=.\module\kvi_mexlinkfilter.h -InputName=kvi_mexlinkfilter - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\module\kvi_mexserverimport.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\module -InputPath=.\module\kvi_mexserverimport.h -InputName=kvi_mexserverimport - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\module -InputPath=.\module\kvi_mexserverimport.h -InputName=kvi_mexserverimport - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\module\kvi_mextoolbar.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\module -InputPath=.\module\kvi_mextoolbar.h -InputName=kvi_mextoolbar - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\module -InputPath=.\module\kvi_mextoolbar.h -InputName=kvi_mextoolbar - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_modeeditor.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_modeeditor.h -InputName=kvi_modeeditor - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_modeeditor.h -InputName=kvi_modeeditor - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_modew.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_modew.h -InputName=kvi_modew - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_modew.h -InputName=kvi_modew - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\module\kvi_module.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\module -InputPath=.\module\kvi_module.h -InputName=kvi_module - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\module\kvi_moduleextension.h -# End Source File -# Begin Source File - -SOURCE=.\module\kvi_modulemanager.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\module -InputPath=.\module\kvi_modulemanager.h -InputName=kvi_modulemanager - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\module -InputPath=.\module\kvi_modulemanager.h -InputName=kvi_modulemanager - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_msgbox.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_notifylist.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_notifylist.h -InputName=kvi_notifylist - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_notifylist.h -InputName=kvi_notifylist - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\sparser\kvi_numeric.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_options.h -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_optionswidget.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_optionswidget.h -InputName=kvi_optionswidget - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_optionswidget.h -InputName=kvi_optionswidget - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_out.h -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_popupmanager.h -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_query.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_query.h -InputName=kvi_query - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_query.h -InputName=kvi_query - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_scriptbutton.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_scriptbutton.h -InputName=kvi_scriptbutton - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_scriptbutton.h -InputName=kvi_scriptbutton - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_scripteditor.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_scripteditor.h -InputName=kvi_scripteditor - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_scripteditor.h -InputName=kvi_scripteditor - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_scriptobject.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\uparser -InputPath=.\uparser\kvi_scriptobject.h -InputName=kvi_scriptobject - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\uparser -InputPath=.\uparser\kvi_scriptobject.h -InputName=kvi_scriptobject - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_selectors.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_selectors.h -InputName=kvi_selectors - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_selectors.h -InputName=kvi_selectors - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\sparser\kvi_sparser.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\sparser -InputPath=.\sparser\kvi_sparser.h -InputName=kvi_sparser - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\sparser -InputPath=.\sparser\kvi_sparser.h -InputName=kvi_sparser - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_splash.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_splash.h -InputName=kvi_splash - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_splash.h -InputName=kvi_splash - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_sslmaster.h -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_statusbar.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_statusbar.h -InputName=kvi_statusbar - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_statusbar.h -InputName=kvi_statusbar - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_statusbarapplet.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_statusbarapplet.h -InputName=kvi_statusbarapplet - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_statusbarapplet.h -InputName=kvi_statusbarapplet - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_styled_controls.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_styled_controls.h -InputName=kvi_styled_controls - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_styled_controls.h -InputName=kvi_styled_controls - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_taskbar.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_taskbar.h -InputName=kvi_taskbar - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_taskbar.h -InputName=kvi_taskbar - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_texticonmanager.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_texticonmanager.h -InputName=kvi_texticonmanager - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\kernel -InputPath=.\kernel\kvi_texticonmanager.h -InputName=kvi_texticonmanager - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_texticonwin.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_texticonwin.h -InputName=kvi_texticonwin - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_texticonwin.h -InputName=kvi_texticonwin - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_themedlabel.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_themedlabel.h -InputName=kvi_themedlabel - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_themedlabel.h -InputName=kvi_themedlabel - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_toolbar.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_toolbar.h -InputName=kvi_toolbar - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_toolbar.h -InputName=kvi_toolbar - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_toolwindows_container.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_toolwindows_container.h -InputName=kvi_toolwindows_container - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_toolwindows_container.h -InputName=kvi_toolwindows_container - -"$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_topicw.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_topicw.h -InputName=kvi_topicw - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_topicw.h -InputName=kvi_topicw - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_uparser.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\uparser -InputPath=.\uparser\kvi_uparser.h -InputName=kvi_uparser - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\uparser -InputPath=.\uparser\kvi_uparser.h -InputName=kvi_uparser - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_useraction.h -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_userinput.h -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_userlistview.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_userlistview.h -InputName=kvi_userlistview - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_userlistview.h -InputName=kvi_userlistview - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_window.h - -!IF "$(CFG)" == "kvirc - Win32 Release" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_window.h -InputName=kvi_window - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kvirc - Win32 Debug" - -# Begin Custom Build -InputDir=.\ui -InputPath=.\ui\kvi_window.h -InputName=kvi_window - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\data\resources\resource.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=..\..\data\resources\icon1.ico -# End Source File -# Begin Source File - -SOURCE=..\..\data\resources\kvirc.rc -# End Source File -# End Group -# Begin Group "Generated" - -# PROP Default_Filter ".moc" -# Begin Source File - -SOURCE=.\kernel\kvi_app.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_channel.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_colorwin.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_console.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_cryptcontroller.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_ctcppagedialog.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_dynamictooltip.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_filedialog.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_frame.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_historywin.moc -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_iconmanager.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_input.moc -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_ipc.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_ipeditor.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_irctoolbar.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_ircview.moc -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_lagmeter.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_maskeditor.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_menubar.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_modeeditor.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_modew.moc -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_notifylist.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_optionswidget.moc -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_popupmenu.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_query.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_scriptbutton.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_scripteditor.moc -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_scriptobject.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_selector.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_selectors.moc -# End Source File -# Begin Source File - -SOURCE=.\sparser\kvi_sparser.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_splash.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_taskbar.moc -# End Source File -# Begin Source File - -SOURCE=.\kernel\kvi_texticonmanager.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_texticonwin.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_themedlabel.moc -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_timermanager.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_toolbar.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_topicw.moc -# End Source File -# Begin Source File - -SOURCE=.\uparser\kvi_uparser.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_userlistview.moc -# End Source File -# Begin Source File - -SOURCE=.\ui\kvi_window.moc -# End Source File -# End Group -# End Target -# End Project diff --git a/3.4.0/src/kvirc/kvirc.dsw b/3.4.0/src/kvirc/kvirc.dsw deleted file mode 100644 index e061bb55f0..0000000000 --- a/3.4.0/src/kvirc/kvirc.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "kvirc"=".\kvirc.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/3.4.0/src/kvirc/kvirc.vcproj b/3.4.0/src/kvirc/kvirc.vcproj deleted file mode 100755 index 48a5006a5c..0000000000 --- a/3.4.0/src/kvirc/kvirc.vcproj +++ /dev/null @@ -1,3275 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="7.10" - Name="kvirc" - ProjectGUID="{92803FDD-DFDB-461D-8AA3-1F201F4EA06C}" - RootNamespace="kvirc" - Keyword="Win32Proj"> - <Platforms> - <Platform - Name="Win32"/> - </Platforms> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin" - IntermediateDirectory="Debug" - ConfigurationType="1" - CharacterSet="2"> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - InlineFunctionExpansion="0" - FavorSizeOrSpeed="1" - AdditionalIncludeDirectories=""$(ProjectDir)\..\kvilib\tal";"$(ProjectDir)\..\kvilib\system";"$(ProjectDir)\..\kvilib\irc";"$(ProjectDir)\..\kvilib\file";"$(ProjectDir)\..\kvilib\ext";"$(ProjectDir)\..\kvilib\net";"$(ProjectDir)\..\kvilib\core\wstring";"$(ProjectDir)\..\kvilib\core";"$(ProjectDir)\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\kvs";"$(ProjectDir)\module";"$(ProjectDir)\uparser\scripttoolbar";"$(ProjectDir)\uparser";"$(ProjectDir)\sparser";"$(ProjectDir)\kernel";"$(ProjectDir)\ui";"$(ZLIBINCDIR)"" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" - MinimalRebuild="TRUE" - BasicRuntimeChecks="3" - RuntimeLibrary="5" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" - DebugInformationFormat="4"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt-mtnc321.lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib zlib.lib msvcrt.lib" - OutputFile="$(SolutionDir)\win32build\bin\kvirc.exe" - LinkIncremental="1" - AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)"" - IgnoreAllDefaultLibraries="TRUE" - GenerateDebugInformation="TRUE" - ProgramDatabaseFile="$(OutDir)/kvirc.pdb" - SubSystem="2" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin" - IntermediateDirectory="Release" - ConfigurationType="1" - CharacterSet="2"> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - GlobalOptimizations="TRUE" - InlineFunctionExpansion="2" - EnableIntrinsicFunctions="FALSE" - FavorSizeOrSpeed="1" - OmitFramePointers="TRUE" - EnableFiberSafeOptimizations="TRUE" - AdditionalIncludeDirectories=""$(ProjectDir)\..\kvilib\tal";"$(ProjectDir)\..\kvilib\system";"$(ProjectDir)\..\kvilib\irc";"$(ProjectDir)\..\kvilib\file";"$(ProjectDir)\..\kvilib\ext";"$(ProjectDir)\..\kvilib\net";"$(ProjectDir)\..\kvilib\core\wstring";"$(ProjectDir)\..\kvilib\core";"$(ProjectDir)\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\kvs";"$(ProjectDir)\module";"$(ProjectDir)\uparser\scripttoolbar";"$(ProjectDir)\uparser";"$(ProjectDir)\sparser";"$(ProjectDir)\kernel";"$(ProjectDir)\ui";"$(ZLIBINCDIR)"" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" - StringPooling="TRUE" - RuntimeLibrary="4" - EnableFunctionLevelLinking="TRUE" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" - DebugInformationFormat="3"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt-mtnc321.lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib zlib.lib msvcrt.lib" - OutputFile="$(SolutionDir)\win32build\bin\kvirc.exe" - LinkIncremental="1" - AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)"" - IgnoreAllDefaultLibraries="TRUE" - GenerateDebugInformation="FALSE" - SubSystem="2" - OptimizeReferences="2" - EnableCOMDATFolding="2" - OptimizeForWindows98="1" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> - <Filter - Name="kvs" - Filter=""> - <File - RelativePath="kvs\kvi_kvs.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_action.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_aliasmanager.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_array.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_arraycast.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_asyncdnsoperation.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_asyncoperation.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_callbackobject.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_corecallbackcommands.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions_af.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions_gl.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions_mr.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions_sz.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands_af.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands_gl.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands_mr.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands_sz.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_dnsmanager.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_event.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventhandler.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventmanager.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventtable.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_hash.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_kernel.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_moduleinterface.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_object.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_class.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_controller.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functioncall.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functionhandler.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functionhandlerimpl.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_parameterprocessor.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_parser.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_parser_command.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_parser_comment.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_parser_dollar.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_parser_expression.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_parser_lside.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_parser_specialcommands.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_popupmanager.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_popupmenu.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_processmanager.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_report.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_runtimecall.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_runtimecontext.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_rwevaluationresult.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_script.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_scriptaddonmanager.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_switchlist.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_timermanager.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_aliasfunctioncall.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_aliassimplecommand.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arraycount.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayelement.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayorhashelement.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayreferenceassert.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_base.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_baseobjectfunctioncall.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_callbackcommand.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_command.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_commandevaluation.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_commandwithparameters.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_compositedata.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_constantdata.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_corecallbackcommand.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_corefunctioncall.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_coresimplecommand.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_data.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_datalist.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_expression.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_expressionreturn.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_extendedscopevariable.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_functioncall.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_globalvariable.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashcount.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashelement.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashreferenceassert.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_indirectdata.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_instruction.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_instructionblock.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_localvariable.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulecallbackcommand.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulefunctioncall.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulesimplecommand.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_multipleparameteridentifier.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_objectfield.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_objectfunctioncall.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_operation.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_parameterreturn.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_rebindingswitch.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_scopeoperator.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_simplecommand.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_singleparameteridentifier.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommand.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandbreak.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommandclass.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommanddefpopup.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommanddo.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandfor.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandforeach.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandif.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandswitch.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommandunset.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandwhile.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_switchlist.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_thisobjectfunctioncall.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_variable.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_voidfunctioncall.cpp"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_useraction.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_variant.cpp"> - </File> - <File - RelativePath="kvs\kvi_kvs_variantlist.cpp"> - </File> - </Filter> - <Filter - Name="moc" - Filter=""> - <File - RelativePath=".\kernel\moc_kvi_action.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_actiondrawer.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_actionmanager.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_coreactions.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_customtoolbar.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_debugwindow.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath="kernel\moc_kvi_filetransfer.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\moc_kvi_imagedialog.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_ircconnection.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_ircconnectiontargetresolver.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_irccontext.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_irclink.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_ircsocket.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_ircviewtools.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_action.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_asyncdnsoperation.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_asyncoperation.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_dnsmanager.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath="kvs\moc_kvi_kvs_object.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_popupmenu.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_processmanager.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_timermanager.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_useraction.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_listview.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\moc_kvi_mdicaption.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\moc_kvi_mdichild.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\moc_kvi_mdimanager.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath="module\moc_kvi_mexlinkfilter.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath="module\moc_kvi_mexserverimport.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath="module\moc_kvi_mextoolbar.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath="module\moc_kvi_modulemanager.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\uparser\moc_kvi_processmanager.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_statusbar.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_statusbarapplet.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_toolwindows_container.cpp"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__"/> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="kernel" - Filter=""> - <File - RelativePath=".\kernel\kvi_action.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_actionmanager.cpp"> - </File> - <File - RelativePath="sparser\kvi_antispam.cpp"> - </File> - <File - RelativePath="kernel\kvi_app.cpp"> - </File> - <File - RelativePath="kernel\kvi_app_fs.cpp"> - </File> - <File - RelativePath="kernel\kvi_app_setup.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_asynchronousconnectiondata.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_coreactions.cpp"> - </File> - <File - RelativePath="ui\kvi_cryptcontroller.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_customtoolbardescriptor.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_customtoolbarmanager.cpp"> - </File> - <File - RelativePath="kernel\kvi_filetransfer.cpp"> - </File> - <File - RelativePath="kernel\kvi_iconmanager.cpp"> - </File> - <File - RelativePath="kernel\kvi_internalcmd.cpp"> - </File> - <File - RelativePath="kernel\kvi_ipc.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnection.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionantictcpflooddata.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionasyncwhoisdata.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionnetsplitdetectordata.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionserverinfo.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionstatedata.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionstatistics.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectiontarget.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectiontargetresolver.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionuserinfo.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_irccontext.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_ircdatastreammonitor.cpp"> - </File> - <File - RelativePath="kernel\kvi_irclink.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_ircsocket.cpp"> - </File> - <File - RelativePath="kernel\kvi_lagmeter.cpp"> - </File> - <File - RelativePath="kernel\kvi_main.cpp"> - </File> - <File - RelativePath="kernel\kvi_notifylist.cpp"> - </File> - <File - RelativePath="kernel\kvi_options.cpp"> - </File> - <File - RelativePath="kernel\kvi_sslmaster.cpp"> - </File> - <File - RelativePath="kernel\kvi_texticonmanager.cpp"> - </File> - <File - RelativePath="kernel\kvi_useraction.cpp"> - </File> - <File - RelativePath=".\kernel\kvi_userinput.cpp"> - </File> - </Filter> - <Filter - Name="ui" - Filter=""> - <File - RelativePath=".\ui\kvi_actiondrawer.cpp"> - </File> - <File - RelativePath="ui\kvi_channel.cpp"> - </File> - <File - RelativePath="ui\kvi_colorwin.cpp"> - </File> - <File - RelativePath="ui\kvi_console.cpp"> - </File> - <File - RelativePath="ui\kvi_ctcppagedialog.cpp"> - </File> - <File - RelativePath=".\ui\kvi_customtoolbar.cpp"> - </File> - <File - RelativePath=".\ui\kvi_debugwindow.cpp"> - </File> - <File - RelativePath="ui\kvi_dynamictooltip.cpp"> - </File> - <File - RelativePath="ui\kvi_filedialog.cpp"> - </File> - <File - RelativePath="ui\kvi_frame.cpp"> - </File> - <File - RelativePath="ui\kvi_historywin.cpp"> - </File> - <File - RelativePath="ui\kvi_imagedialog.cpp"> - </File> - <File - RelativePath="ui\kvi_input.cpp"> - </File> - <File - RelativePath="ui\kvi_ipeditor.cpp"> - </File> - <File - RelativePath="ui\kvi_irctoolbar.cpp"> - </File> - <File - RelativePath="ui\kvi_ircview.cpp"> - </File> - <File - RelativePath=".\ui\kvi_ircviewtools.cpp"> - </File> - <File - RelativePath=".\ui\kvi_listview.cpp"> - </File> - <File - RelativePath="ui\kvi_maskeditor.cpp"> - </File> - <File - RelativePath="ui\kvi_mdicaption.cpp"> - </File> - <File - RelativePath="ui\kvi_mdichild.cpp"> - </File> - <File - RelativePath="ui\kvi_mdimanager.cpp"> - </File> - <File - RelativePath="ui\kvi_menubar.cpp"> - </File> - <File - RelativePath="ui\kvi_modeeditor.cpp"> - </File> - <File - RelativePath=".\ui\kvi_modew.cpp"> - </File> - <File - RelativePath="ui\kvi_msgbox.cpp"> - </File> - <File - RelativePath="ui\kvi_optionswidget.cpp"> - </File> - <File - RelativePath="ui\kvi_query.cpp"> - </File> - <File - RelativePath="ui\kvi_scriptbutton.cpp"> - </File> - <File - RelativePath="ui\kvi_scripteditor.cpp"> - </File> - <File - RelativePath="ui\kvi_selectors.cpp"> - </File> - <File - RelativePath="ui\kvi_splash.cpp"> - </File> - <File - RelativePath=".\ui\kvi_statusbar.cpp"> - </File> - <File - RelativePath=".\ui\kvi_statusbarapplet.cpp"> - </File> - <File - RelativePath=".\ui\kvi_styled_controls.cpp"> - </File> - <File - RelativePath="ui\kvi_taskbar.cpp"> - </File> - <File - RelativePath="ui\kvi_texticonwin.cpp"> - </File> - <File - RelativePath="ui\kvi_themedlabel.cpp"> - </File> - <File - RelativePath="ui\kvi_toolbar.cpp"> - </File> - <File - RelativePath=".\ui\kvi_toolwindows_container.cpp"> - </File> - <File - RelativePath="ui\kvi_topicw.cpp"> - </File> - <File - RelativePath="ui\kvi_userlistview.cpp"> - </File> - <File - RelativePath="ui\kvi_window.cpp"> - </File> - </Filter> - <Filter - Name="uparser" - Filter=""> - <File - RelativePath="uparser\kvi_command.cpp"> - </File> - <File - RelativePath="uparser\kvi_event.cpp"> - </File> - <File - RelativePath="uparser\kvi_exprtree.cpp"> - </File> - <File - RelativePath="uparser\kvi_ircurl.cpp"> - </File> - <File - RelativePath="uparser\kvi_popupmanager.cpp"> - </File> - <File - RelativePath="uparser\kvi_popupmenu.cpp"> - </File> - <File - RelativePath=".\uparser\kvi_processmanager.cpp"> - </File> - <File - RelativePath="uparser\kvi_scriptobject.cpp"> - </File> - <File - RelativePath="uparser\kvi_timermanager.cpp"> - </File> - <File - RelativePath="uparser\kvi_up_cmd.cpp"> - </File> - <File - RelativePath="uparser\kvi_up_expr.cpp"> - </File> - <File - RelativePath="uparser\kvi_up_fnc.cpp"> - </File> - <File - RelativePath="uparser\kvi_up_oper.cpp"> - </File> - <File - RelativePath="uparser\kvi_up_skip.cpp"> - </File> - <File - RelativePath="uparser\kvi_uparser.cpp"> - </File> - </Filter> - <Filter - Name="sparser" - Filter=""> - <File - RelativePath="sparser\kvi_ircmessage.cpp"> - </File> - <File - RelativePath="sparser\kvi_sp_ctcp.cpp"> - </File> - <File - RelativePath="sparser\kvi_sp_literal.cpp"> - </File> - <File - RelativePath="sparser\kvi_sp_numeric.cpp"> - </File> - <File - RelativePath="sparser\kvi_sp_tables.cpp"> - </File> - <File - RelativePath="sparser\kvi_sparser.cpp"> - </File> - </Filter> - <Filter - Name="module" - Filter=""> - <File - RelativePath="module\kvi_mexlinkfilter.cpp"> - </File> - <File - RelativePath="module\kvi_mexserverimport.cpp"> - </File> - <File - RelativePath="module\kvi_mextoolbar.cpp"> - </File> - <File - RelativePath="module\kvi_module.cpp"> - </File> - <File - RelativePath="module\kvi_moduleextension.cpp"> - </File> - <File - RelativePath="module\kvi_modulemanager.cpp"> - </File> - </Filter> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc"> - <Filter - Name="kvs" - Filter=""> - <File - RelativePath="kvs\kvi_kvs.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_action.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="kvs\kvi_kvs_aliasmanager.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_array.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_arraycast.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_asyncdnsoperation.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\kvi_kvs_asyncoperation.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\kvi_kvs_callbackobject.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_corecallbackcommands.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_dnsmanager.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\kvi_kvs_event.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventhandler.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventmanager.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventtable.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventtriggers.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_hash.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_kernel.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_moduleinterface.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_object.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_class.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_controller.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functioncall.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functionhandler.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functionhandlerimpl.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_parameterprocessor.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_parser.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_parser_macros.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_popupmanager.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_popupmenu.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp "/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp "/> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\kvi_kvs_processmanager.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="kvs\kvi_kvs_report.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_runtimecall.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_runtimecontext.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_rwevaluationresult.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_script.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_scriptaddonmanager.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_switchlist.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_timermanager.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_aliasfunctioncall.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_aliassimplecommand.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arraycount.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayelement.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayorhashelement.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayreferenceassert.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_base.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_baseobjectfunctioncall.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_callbackcommand.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_command.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_commandevaluation.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_commandwithparameters.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_compositedata.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_constantdata.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_corecallbackcommand.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_corefunctioncall.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_coresimplecommand.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_data.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_datalist.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_expression.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_expressionreturn.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_extendedscopevariable.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_functioncall.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_globalvariable.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashcount.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashelement.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashreferenceassert.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_indirectdata.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_instruction.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_instructionblock.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_localvariable.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulecallbackcommand.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulefunctioncall.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulesimplecommand.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_multipleparameteridentifier.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_objectfield.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_objectfunctioncall.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_operation.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_parameterreturn.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_rebindingswitch.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_scopeoperator.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_simplecommand.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_singleparameteridentifier.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommand.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandbreak.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommandclass.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommanddefpopup.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommanddo.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandfor.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandforeach.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandif.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandswitch.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommandunset.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandwhile.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_switchlist.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_thisobjectfunctioncall.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_variable.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_voidfunctioncall.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_types.h"> - </File> - <File - RelativePath=".\kvs\kvi_kvs_useraction.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="kvs\kvi_kvs_variant.h"> - </File> - <File - RelativePath="kvs\kvi_kvs_variantlist.h"> - </File> - </Filter> - <Filter - Name="kernel" - Filter=""> - <File - RelativePath=".\kernel\kvi_action.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_actionmanager.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="sparser\kvi_antispam.h"> - </File> - <File - RelativePath="kernel\kvi_app.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_asynchronousconnectiondata.h"> - </File> - <File - RelativePath=".\kernel\kvi_coreactions.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_cryptcontroller.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_customtoolbardescriptor.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="" - Outputs=""/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_customtoolbarmanager.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="" - Outputs=""/> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_filetransfer.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_iconmanager.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_internalcmd.h"> - </File> - <File - RelativePath="kernel\kvi_ipc.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircconnection.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionantictcpflooddata.h"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionasyncwhoisdata.h"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionnetsplitdetectordata.h"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionserverinfo.h"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionstatedata.h"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionstatistics.h"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectiontarget.h"> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectiontargetresolver.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionuserinfo.h"> - </File> - <File - RelativePath=".\kernel\kvi_irccontext.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircdatastreammonitor.h"> - </File> - <File - RelativePath="kernel\kvi_irclink.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircsocket.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_lagmeter.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_notifylist.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_options.h"> - </File> - <File - RelativePath="kernel\kvi_out.h"> - </File> - <File - RelativePath="kernel\kvi_sslmaster.h"> - </File> - <File - RelativePath="kernel\kvi_texticonmanager.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_useraction.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_userinput.h"> - </File> - </Filter> - <Filter - Name="ui" - Filter=""> - <File - RelativePath=".\ui\kvi_actiondrawer.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_channel.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_colorwin.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_console.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_ctcppagedialog.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_customtoolbar.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_debugwindow.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_dynamictooltip.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_filedialog.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_frame.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_historywin.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_imagedialog.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_input.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_ipeditor.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_irctoolbar.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_ircview.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_ircviewprivate.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="" - Outputs=""/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="" - Outputs=""/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_ircviewtools.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_listview.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_maskeditor.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_mdicaption.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_mdichild.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_mdimanager.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_menubar.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_modeeditor.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_modew.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_msgbox.h"> - </File> - <File - RelativePath="ui\kvi_optionswidget.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_query.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_scriptbutton.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_scripteditor.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_selectors.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_splash.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_statusbar.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_statusbarapplet.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_styled_controls.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_taskbar.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_texticonwin.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_themedlabel.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_toolbar.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_toolwindows_container.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)"" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)"" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_topicw.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_userlistview.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_window.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="sparser" - Filter=""> - <File - RelativePath="sparser\kvi_ircmessage.h"> - </File> - <File - RelativePath="sparser\kvi_numeric.h"> - </File> - <File - RelativePath="sparser\kvi_sparser.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="uparser" - Filter=""> - <File - RelativePath="uparser\kvi_command.h"> - </File> - <File - RelativePath="uparser\kvi_event.h"> - </File> - <File - RelativePath="uparser\kvi_eventhandler.h"> - </File> - <File - RelativePath="uparser\kvi_exprtree.h"> - </File> - <File - RelativePath="uparser\kvi_ircurl.h"> - </File> - <File - RelativePath="uparser\kvi_popupmanager.h"> - </File> - <File - RelativePath="uparser\kvi_popupmenu.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath=".\uparser\kvi_processmanager.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="uparser\kvi_scriptobject.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="uparser\kvi_timermanager.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath="uparser\kvi_uparser.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="module" - Filter=""> - <File - RelativePath="module\kvi_mexlinkfilter.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="module\kvi_mexserverimport.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="module\kvi_mextoolbar.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - <File - RelativePath="module\kvi_module.h"> - </File> - <File - RelativePath="module\kvi_moduleextension.h"> - </File> - <File - RelativePath="module\kvi_modulemanager.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\moc_$(InputName).cpp"/> - </FileConfiguration> - </File> - </Filter> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> - <File - RelativePath="..\..\data\resources\kvirc.rc"> - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3.4.0/src/kvirc/kvirc_QT4_vc05.vcproj b/3.4.0/src/kvirc/kvirc_QT4_vc05.vcproj deleted file mode 100644 index ff291f9ca3..0000000000 --- a/3.4.0/src/kvirc/kvirc_QT4_vc05.vcproj +++ /dev/null @@ -1,3986 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8,00" - Name="kvirc" - ProjectGUID="{92803FDD-DFDB-461D-8AA3-1F201F4EA06C}" - RootNamespace="kvirc" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin\" - IntermediateDirectory="Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - InlineFunctionExpansion="0" - FavorSizeOrSpeed="1" - AdditionalIncludeDirectories=""$(ProjectDir)\..\kvilib\tal";"$(ProjectDir)\..\kvilib\system";"$(ProjectDir)\..\kvilib\irc";"$(ProjectDir)\..\kvilib\file";"$(ProjectDir)\..\kvilib\ext";"$(ProjectDir)\..\kvilib\net";"$(ProjectDir)\..\kvilib\core\wstring";"$(ProjectDir)\..\kvilib\core";"$(ProjectDir)\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\kvs";"$(ProjectDir)\module";"$(ProjectDir)\uparser\scripttoolbar";"$(ProjectDir)\uparser";"$(ProjectDir)\sparser";"$(ProjectDir)\kernel";"$(ProjectDir)\ui";"$(ZLIBINCDIR)";"$(QTDIR)\include\Qt3Support";"$(QTDIR)\include\QtCore\";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtNetwork";"$(QTDIR)\include\QtXml";" - PreprocessorDefinitions="QT3_SUPPORT;WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - RuntimeLibrary="2" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="false" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt3support4.lib qtcore4.lib qtgui4.lib qtmain.lib kvilib.lib shlwapi.lib ws2_32.lib advapi32.lib user32.lib shell32.lib" - OutputFile="$(OutDir)\kvirc.exe" - LinkIncremental="2" - AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE\";"$(QTDIR)\lib\";"$(SolutionDir)\win32build\bin\";"$(ZLIBLIBDIR)"" - GenerateManifest="true" - GenerateDebugInformation="true" - ProgramDatabaseFile="$(OutDir)/kvirc.pdb" - SubSystem="2" - TurnOffAssemblyGeneration="false" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest" - VerboseOutput="true" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin" - IntermediateDirectory="Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="1" - InlineFunctionExpansion="0" - FavorSizeOrSpeed="1" - AdditionalIncludeDirectories=""$(ProjectDir)\..\kvilib\tal";"$(ProjectDir)\..\kvilib\system";"$(ProjectDir)\..\kvilib\irc";"$(ProjectDir)\..\kvilib\file";"$(ProjectDir)\..\kvilib\ext";"$(ProjectDir)\..\kvilib\net";"$(ProjectDir)\..\kvilib\core\wstring";"$(ProjectDir)\..\kvilib\core";"$(ProjectDir)\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\kvs";"$(ProjectDir)\module";"$(ProjectDir)\uparser\scripttoolbar";"$(ProjectDir)\uparser";"$(ProjectDir)\sparser";"$(ProjectDir)\kernel";"$(ProjectDir)\ui";"$(ZLIBINCDIR)";"$(QTDIR)\include\Qt3Support";"$(QTDIR)\include\QtCore\";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtNetwork";"$(QTDIR)\include\QtXml";" - PreprocessorDefinitions="QT3_SUPPORT;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE" - RuntimeLibrary="2" - UsePrecompiledHeader="0" - WarningLevel="2" - Detect64BitPortabilityProblems="false" - DebugInformationFormat="0" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt3support4.lib qtcore4.lib qtgui4.lib qtmain.lib kvilib.lib ws2_32.lib shlwapi.lib advapi32.lib user32.lib shell32.lib" - OutputFile="$(OutDir)\kvirc.exe" - LinkIncremental="1" - AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)"" - GenerateManifest="true" - IgnoreAllDefaultLibraries="false" - GenerateDebugInformation="false" - SubSystem="2" - OptimizeReferences="2" - TurnOffAssemblyGeneration="false" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest" - VerboseOutput="true" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm" - > - <Filter - Name="moc" - > - <File - RelativePath=".\kernel\moc_kvi_action.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_actiondrawer.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_actionmanager.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_coreactions.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_customtoolbar.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_debugwindow.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="kernel\moc_kvi_filetransfer.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_htmldialog.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\moc_kvi_imagedialog.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_ircconnection.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_ircconnectiontargetresolver.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_irccontext.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_irclink.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_ircsocket.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_ircviewtools.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_action.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_asyncdnsoperation.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_asyncoperation.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_dnsmanager.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="kvs\moc_kvi_kvs_object.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_popupmenu.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_processmanager.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_timermanager.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_useraction.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_listview.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\moc_kvi_mdicaption.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\moc_kvi_mdichild.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\moc_kvi_mdimanager.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="module\moc_kvi_mexlinkfilter.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="module\moc_kvi_mexserverimport.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="module\moc_kvi_mextoolbar.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="module\moc_kvi_modulemanager.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_statusbar.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_statusbarapplet.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_toolwindows_container.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="kernel" - > - <File - RelativePath=".\kernel\kvi_action.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_actionmanager.cpp" - > - </File> - <File - RelativePath="sparser\kvi_antispam.cpp" - > - </File> - <File - RelativePath="kernel\kvi_app.cpp" - > - </File> - <File - RelativePath="kernel\kvi_app_fs.cpp" - > - </File> - <File - RelativePath="kernel\kvi_app_setup.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_asynchronousconnectiondata.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_coreactions.cpp" - > - </File> - <File - RelativePath="ui\kvi_cryptcontroller.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_customtoolbardescriptor.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_customtoolbarmanager.cpp" - > - </File> - <File - RelativePath="kernel\kvi_filetransfer.cpp" - > - </File> - <File - RelativePath="kernel\kvi_iconmanager.cpp" - > - </File> - <File - RelativePath="kernel\kvi_internalcmd.cpp" - > - </File> - <File - RelativePath="kernel\kvi_ipc.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnection.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionantictcpflooddata.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionasyncwhoisdata.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionnetsplitdetectordata.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionserverinfo.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionstatedata.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionstatistics.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectiontarget.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectiontargetresolver.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionuserinfo.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_irccontext.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircdatastreammonitor.cpp" - > - </File> - <File - RelativePath="kernel\kvi_irclink.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircsocket.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircurl.cpp" - > - </File> - <File - RelativePath="kernel\kvi_lagmeter.cpp" - > - </File> - <File - RelativePath="kernel\kvi_main.cpp" - > - </File> - <File - RelativePath="kernel\kvi_notifylist.cpp" - > - </File> - <File - RelativePath="kernel\kvi_options.cpp" - > - </File> - <File - RelativePath="kernel\kvi_sslmaster.cpp" - > - </File> - <File - RelativePath="kernel\kvi_texticonmanager.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_theme.cpp" - > - </File> - <File - RelativePath="kernel\kvi_useraction.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_userinput.cpp" - > - </File> - </Filter> - <Filter - Name="ui" - > - <File - RelativePath=".\ui\kvi_actiondrawer.cpp" - > - </File> - <File - RelativePath="ui\kvi_channel.cpp" - > - </File> - <File - RelativePath="ui\kvi_colorwin.cpp" - > - </File> - <File - RelativePath="ui\kvi_console.cpp" - > - </File> - <File - RelativePath="ui\kvi_ctcppagedialog.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_customtoolbar.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_debugwindow.cpp" - > - </File> - <File - RelativePath="ui\kvi_dynamictooltip.cpp" - > - </File> - <File - RelativePath="ui\kvi_filedialog.cpp" - > - </File> - <File - RelativePath="ui\kvi_frame.cpp" - > - </File> - <File - RelativePath="ui\kvi_historywin.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_htmldialog.cpp" - > - </File> - <File - RelativePath="ui\kvi_imagedialog.cpp" - > - </File> - <File - RelativePath="ui\kvi_input.cpp" - > - </File> - <File - RelativePath="ui\kvi_ipeditor.cpp" - > - </File> - <File - RelativePath="ui\kvi_irctoolbar.cpp" - > - </File> - <File - RelativePath="ui\kvi_ircview.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_ircviewtools.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_listview.cpp" - > - </File> - <File - RelativePath="ui\kvi_maskeditor.cpp" - > - </File> - <File - RelativePath="ui\kvi_mdicaption.cpp" - > - </File> - <File - RelativePath="ui\kvi_mdichild.cpp" - > - </File> - <File - RelativePath="ui\kvi_mdimanager.cpp" - > - </File> - <File - RelativePath="ui\kvi_menubar.cpp" - > - </File> - <File - RelativePath="ui\kvi_modeeditor.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_modew.cpp" - > - </File> - <File - RelativePath="ui\kvi_msgbox.cpp" - > - </File> - <File - RelativePath="ui\kvi_optionswidget.cpp" - > - </File> - <File - RelativePath="ui\kvi_query.cpp" - > - </File> - <File - RelativePath="ui\kvi_scriptbutton.cpp" - > - </File> - <File - RelativePath="ui\kvi_scripteditor.cpp" - > - </File> - <File - RelativePath="ui\kvi_selectors.cpp" - > - </File> - <File - RelativePath="ui\kvi_splash.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_statusbar.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_statusbarapplet.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_styled_controls.cpp" - > - </File> - <File - RelativePath="ui\kvi_taskbar.cpp" - > - </File> - <File - RelativePath="ui\kvi_texticonwin.cpp" - > - </File> - <File - RelativePath="ui\kvi_themedlabel.cpp" - > - </File> - <File - RelativePath="ui\kvi_toolbar.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_toolwindows_container.cpp" - > - </File> - <File - RelativePath="ui\kvi_topicw.cpp" - > - </File> - <File - RelativePath="ui\kvi_userlistview.cpp" - > - </File> - <File - RelativePath="ui\kvi_window.cpp" - > - </File> - </Filter> - <Filter - Name="sparser" - > - <File - RelativePath="sparser\kvi_ircmessage.cpp" - > - </File> - <File - RelativePath="sparser\kvi_sp_ctcp.cpp" - > - </File> - <File - RelativePath="sparser\kvi_sp_literal.cpp" - > - </File> - <File - RelativePath="sparser\kvi_sp_numeric.cpp" - > - </File> - <File - RelativePath="sparser\kvi_sp_tables.cpp" - > - </File> - <File - RelativePath="sparser\kvi_sparser.cpp" - > - </File> - </Filter> - <Filter - Name="module" - > - <File - RelativePath="module\kvi_mexlinkfilter.cpp" - > - </File> - <File - RelativePath="module\kvi_mexserverimport.cpp" - > - </File> - <File - RelativePath="module\kvi_mextoolbar.cpp" - > - </File> - <File - RelativePath="module\kvi_module.cpp" - > - </File> - <File - RelativePath="module\kvi_moduleextension.cpp" - > - </File> - <File - RelativePath="module\kvi_modulemanager.cpp" - > - </File> - </Filter> - <Filter - Name="kvs" - > - <File - RelativePath="kvs\kvi_kvs.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_action.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_aliasmanager.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_array.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_arraycast.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_asyncdnsoperation.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_asyncoperation.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_callbackobject.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_corecallbackcommands.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions_af.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions_gl.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions_mr.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions_sz.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands_af.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands_gl.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands_mr.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands_sz.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_dnsmanager.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_event.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventhandler.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventmanager.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventtable.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_hash.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_kernel.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_moduleinterface.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_object.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_class.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_controller.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functioncall.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functionhandler.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functionhandlerimpl.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_parameterprocessor.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser_command.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser_comment.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser_dollar.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser_expression.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser_lside.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser_specialcommands.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_popupmanager.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_popupmenu.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_processmanager.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_report.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_runtimecall.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_runtimecontext.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_rwevaluationresult.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_script.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_scriptaddonmanager.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_switchlist.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_timermanager.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_aliasfunctioncall.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_aliassimplecommand.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arraycount.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayelement.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayorhashelement.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayreferenceassert.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_base.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_baseobjectfunctioncall.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_callbackcommand.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_command.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_commandevaluation.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_commandwithparameters.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_compositedata.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_constantdata.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_corecallbackcommand.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_corefunctioncall.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_coresimplecommand.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_data.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_datalist.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_expression.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_expressionreturn.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_extendedscopevariable.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_functioncall.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_globalvariable.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashcount.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashelement.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashreferenceassert.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_indirectdata.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_instruction.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_instructionblock.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_localvariable.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulecallbackcommand.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulefunctioncall.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulesimplecommand.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_multipleparameteridentifier.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_objectfield.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_objectfunctioncall.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_operation.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_parameterreturn.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_rebindingswitch.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_scopeoperator.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_simplecommand.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_singleparameteridentifier.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommand.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandbreak.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommandclass.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommanddefpopup.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommanddo.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandfor.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandforeach.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandif.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandswitch.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommandunset.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandwhile.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_stringcast.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_switchlist.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_thisobjectfunctioncall.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_variable.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_voidfunctioncall.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_useraction.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_variant.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_variantlist.cpp" - > - </File> - </Filter> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc" - > - <File - RelativePath="..\..\data\resources\resource.h" - > - </File> - <Filter - Name="kvs" - > - <File - RelativePath="kvs\kvi_kvs.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_action.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="kvs\kvi_kvs_aliasmanager.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_array.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_arraycast.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_asyncdnsoperation.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\kvi_kvs_asyncoperation.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\kvi_kvs_callbackobject.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_corecallbackcommands.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_dnsmanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\kvi_kvs_event.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventhandler.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventmanager.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventtable.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventtriggers.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_hash.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_kernel.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_moduleinterface.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_object.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_class.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_controller.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functioncall.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functionhandler.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functionhandlerimpl.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_parameterprocessor.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser_macros.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_popupmanager.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_popupmenu.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp " - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp " - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\kvi_kvs_processmanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="kvs\kvi_kvs_report.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_runtimecall.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_runtimecontext.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_rwevaluationresult.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_script.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_scriptaddonmanager.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_switchlist.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_timermanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_aliasfunctioncall.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_aliassimplecommand.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arraycount.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayelement.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayorhashelement.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayreferenceassert.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_base.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_baseobjectfunctioncall.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_callbackcommand.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_command.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_commandevaluation.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_commandwithparameters.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_compositedata.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_constantdata.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_corecallbackcommand.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_corefunctioncall.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_coresimplecommand.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_data.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_datalist.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_expression.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_expressionreturn.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_extendedscopevariable.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_functioncall.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_globalvariable.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashcount.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashelement.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashreferenceassert.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_indirectdata.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_instruction.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_instructionblock.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_localvariable.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulecallbackcommand.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulefunctioncall.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulesimplecommand.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_multipleparameteridentifier.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_objectfield.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_objectfunctioncall.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_operation.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_parameterreturn.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_rebindingswitch.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_scopeoperator.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_simplecommand.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_singleparameteridentifier.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommand.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandbreak.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommandclass.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommanddefpopup.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommanddo.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandfor.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandforeach.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandif.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandswitch.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommandunset.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandwhile.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_stringcast.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_switchlist.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_thisobjectfunctioncall.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_variable.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_voidfunctioncall.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_types.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_useraction.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="kvs\kvi_kvs_variant.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_variantlist.h" - > - </File> - </Filter> - <Filter - Name="kernel" - > - <File - RelativePath=".\kernel\kvi_action.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_actionmanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="sparser\kvi_antispam.h" - > - </File> - <File - RelativePath="kernel\kvi_app.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_asynchronousconnectiondata.h" - > - </File> - <File - RelativePath=".\kernel\kvi_coreactions.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_cryptcontroller.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_customtoolbardescriptor.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="" - Outputs="" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_customtoolbarmanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="" - Outputs="" - /> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_filetransfer.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_iconmanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_internalcmd.h" - > - </File> - <File - RelativePath="kernel\kvi_ipc.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircconnection.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionantictcpflooddata.h" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionasyncwhoisdata.h" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionnetsplitdetectordata.h" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionserverinfo.h" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionstatedata.h" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionstatistics.h" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectiontarget.h" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectiontargetresolver.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionuserinfo.h" - > - </File> - <File - RelativePath=".\kernel\kvi_irccontext.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircdatastreammonitor.h" - > - </File> - <File - RelativePath="kernel\kvi_irclink.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircsocket.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircurl.h" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_lagmeter.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_notifylist.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_options.h" - > - </File> - <File - RelativePath="kernel\kvi_out.h" - > - </File> - <File - RelativePath="kernel\kvi_sslmaster.h" - > - </File> - <File - RelativePath="kernel\kvi_texticonmanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_theme.h" - > - </File> - <File - RelativePath="kernel\kvi_useraction.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_userinput.h" - > - </File> - </Filter> - <Filter - Name="ui" - > - <File - RelativePath=".\ui\kvi_actiondrawer.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_channel.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_colorwin.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_console.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_ctcppagedialog.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_customtoolbar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_debugwindow.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_dynamictooltip.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_filedialog.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_frame.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_historywin.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_htmldialog.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_imagedialog.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_input.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_ipeditor.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_irctoolbar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_ircview.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_ircviewprivate.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="" - Outputs="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="" - Outputs="" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_ircviewtools.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_listview.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_maskeditor.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_mdicaption.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_mdichild.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_mdimanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_menubar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_modeeditor.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_modew.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_msgbox.h" - > - </File> - <File - RelativePath="ui\kvi_optionswidget.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_query.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_scriptbutton.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_scripteditor.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_selectors.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_splash.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_statusbar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_statusbarapplet.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_styled_controls.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_taskbar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_texticonwin.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_themedlabel.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_toolbar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_toolwindows_container.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_topicw.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_userlistview.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_window.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="sparser" - > - <File - RelativePath="sparser\kvi_ircmessage.h" - > - </File> - <File - RelativePath="sparser\kvi_numeric.h" - > - </File> - <File - RelativePath="sparser\kvi_sparser.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="module" - > - <File - RelativePath="module\kvi_mexlinkfilter.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="module\kvi_mexserverimport.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="module\kvi_mextoolbar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="module\kvi_module.h" - > - </File> - <File - RelativePath="module\kvi_moduleextension.h" - > - </File> - <File - RelativePath="module\kvi_modulemanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - </Filter> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" - > - <File - RelativePath="..\..\data\resources\icon1.ico" - > - </File> - <File - RelativePath="..\..\data\resources\kva.ico" - > - </File> - <File - RelativePath="..\..\data\resources\kvc.ico" - > - </File> - <File - RelativePath="..\..\data\resources\kvirc.rc" - > - </File> - <File - RelativePath="..\..\data\resources\kvs.ico" - > - </File> - <File - RelativePath="..\..\data\resources\kvt.ico" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3.4.0/src/kvirc/kvirc_vc05.vcproj b/3.4.0/src/kvirc/kvirc_vc05.vcproj deleted file mode 100644 index d8d73e9be9..0000000000 --- a/3.4.0/src/kvirc/kvirc_vc05.vcproj +++ /dev/null @@ -1,3998 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8,00" - Name="kvirc" - ProjectGUID="{92803FDD-DFDB-461D-8AA3-1F201F4EA06C}" - RootNamespace="kvirc" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin\" - IntermediateDirectory="Debug" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - InlineFunctionExpansion="0" - FavorSizeOrSpeed="1" - AdditionalIncludeDirectories=""$(ProjectDir)\..\kvilib\tal";"$(ProjectDir)\..\kvilib\system";"$(ProjectDir)\..\kvilib\irc";"$(ProjectDir)\..\kvilib\file";"$(ProjectDir)\..\kvilib\ext";"$(ProjectDir)\..\kvilib\net";"$(ProjectDir)\..\kvilib\core\wstring";"$(ProjectDir)\..\kvilib\core";"$(ProjectDir)\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\kvs";"$(ProjectDir)\module";"$(ProjectDir)\uparser\scripttoolbar";"$(ProjectDir)\uparser";"$(ProjectDir)\sparser";"$(ProjectDir)\kernel";"$(ProjectDir)\ui";"$(ZLIBINCDIR)"" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - RuntimeLibrary="3" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt-$(QTTAG).lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib zlib.lib msvcrt.lib user32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib shlwapi.lib" - OutputFile="$(OutDir)\kvirc.exe" - LinkIncremental="2" - AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE\";"$(QTDIR)\lib\";"$(SolutionDir)\win32build\bin\";"$(ZLIBLIBDIR)"" - GenerateManifest="true" - IgnoreAllDefaultLibraries="true" - GenerateDebugInformation="true" - ProgramDatabaseFile="$(OutDir)/kvirc.pdb" - SubSystem="2" - TurnOffAssemblyGeneration="false" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest" - VerboseOutput="true" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin" - IntermediateDirectory="Release" - ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="2" - AdditionalIncludeDirectories=""$(ProjectDir)\..\kvilib\tal";"$(ProjectDir)\..\kvilib\system";"$(ProjectDir)\..\kvilib\irc";"$(ProjectDir)\..\kvilib\file";"$(ProjectDir)\..\kvilib\ext";"$(ProjectDir)\..\kvilib\net";"$(ProjectDir)\..\kvilib\core\wstring";"$(ProjectDir)\..\kvilib\core";"$(ProjectDir)\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\kvs";"$(ProjectDir)\module";"$(ProjectDir)\uparser\scripttoolbar";"$(ProjectDir)\uparser";"$(ProjectDir)\sparser";"$(ProjectDir)\kernel";"$(ProjectDir)\ui";"$(ZLIBINCDIR)"" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - MinimalRebuild="false" - RuntimeLibrary="0" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt-$(QTTAG).lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib msvcrt.lib perl58.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib shlwapi.lib" - OutputFile="$(OutDir)\kvirc.exe" - LinkIncremental="1" - AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)"" - GenerateManifest="true" - IgnoreAllDefaultLibraries="true" - GenerateDebugInformation="false" - SubSystem="2" - OptimizeReferences="2" - TurnOffAssemblyGeneration="false" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest" - VerboseOutput="true" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm" - > - <Filter - Name="moc" - > - <File - RelativePath=".\kernel\moc_kvi_action.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_actiondrawer.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_actionmanager.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_coreactions.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_customtoolbar.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_debugwindow.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="kernel\moc_kvi_filetransfer.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_htmldialog.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\moc_kvi_imagedialog.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_ircconnection.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_ircconnectiontargetresolver.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_irccontext.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_irclink.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\moc_kvi_ircsocket.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_ircviewtools.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_action.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_asyncdnsoperation.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_asyncoperation.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_dnsmanager.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="kvs\moc_kvi_kvs_object.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_popupmenu.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_processmanager.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_timermanager.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\moc_kvi_kvs_useraction.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_listview.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\moc_kvi_mdicaption.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\moc_kvi_mdichild.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\moc_kvi_mdimanager.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="module\moc_kvi_mexlinkfilter.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="module\moc_kvi_mexserverimport.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="module\moc_kvi_mextoolbar.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath="module\moc_kvi_modulemanager.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_statusbar.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_statusbarapplet.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\moc_kvi_toolwindows_container.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="__KVIRC__" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="kernel" - > - <File - RelativePath=".\kernel\kvi_action.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_actionmanager.cpp" - > - </File> - <File - RelativePath="sparser\kvi_antispam.cpp" - > - </File> - <File - RelativePath="kernel\kvi_app.cpp" - > - </File> - <File - RelativePath="kernel\kvi_app_fs.cpp" - > - </File> - <File - RelativePath="kernel\kvi_app_setup.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_asynchronousconnectiondata.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_coreactions.cpp" - > - </File> - <File - RelativePath="ui\kvi_cryptcontroller.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_customtoolbardescriptor.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_customtoolbarmanager.cpp" - > - </File> - <File - RelativePath="kernel\kvi_filetransfer.cpp" - > - </File> - <File - RelativePath="kernel\kvi_iconmanager.cpp" - > - </File> - <File - RelativePath="kernel\kvi_internalcmd.cpp" - > - </File> - <File - RelativePath="kernel\kvi_ipc.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnection.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionantictcpflooddata.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionasyncwhoisdata.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionnetsplitdetectordata.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionserverinfo.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionstatedata.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionstatistics.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectiontarget.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectiontargetresolver.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionuserinfo.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_irccontext.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircdatastreammonitor.cpp" - > - </File> - <File - RelativePath="kernel\kvi_irclink.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircsocket.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_ircurl.cpp" - > - </File> - <File - RelativePath="kernel\kvi_lagmeter.cpp" - > - </File> - <File - RelativePath="kernel\kvi_main.cpp" - > - </File> - <File - RelativePath="kernel\kvi_notifylist.cpp" - > - </File> - <File - RelativePath="kernel\kvi_options.cpp" - > - </File> - <File - RelativePath="kernel\kvi_sslmaster.cpp" - > - </File> - <File - RelativePath="kernel\kvi_texticonmanager.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_theme.cpp" - > - </File> - <File - RelativePath="kernel\kvi_useraction.cpp" - > - </File> - <File - RelativePath=".\kernel\kvi_userinput.cpp" - > - </File> - </Filter> - <Filter - Name="ui" - > - <File - RelativePath=".\ui\kvi_actiondrawer.cpp" - > - </File> - <File - RelativePath="ui\kvi_channel.cpp" - > - </File> - <File - RelativePath="ui\kvi_colorwin.cpp" - > - </File> - <File - RelativePath="ui\kvi_console.cpp" - > - </File> - <File - RelativePath="ui\kvi_ctcppagedialog.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_customtoolbar.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_debugwindow.cpp" - > - </File> - <File - RelativePath="ui\kvi_dynamictooltip.cpp" - > - </File> - <File - RelativePath="ui\kvi_filedialog.cpp" - > - </File> - <File - RelativePath="ui\kvi_frame.cpp" - > - </File> - <File - RelativePath="ui\kvi_historywin.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_htmldialog.cpp" - > - </File> - <File - RelativePath="ui\kvi_imagedialog.cpp" - > - </File> - <File - RelativePath="ui\kvi_input.cpp" - > - </File> - <File - RelativePath="ui\kvi_ipeditor.cpp" - > - </File> - <File - RelativePath="ui\kvi_irctoolbar.cpp" - > - </File> - <File - RelativePath="ui\kvi_ircview.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_ircviewtools.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_listview.cpp" - > - </File> - <File - RelativePath="ui\kvi_maskeditor.cpp" - > - </File> - <File - RelativePath="ui\kvi_mdicaption.cpp" - > - </File> - <File - RelativePath="ui\kvi_mdichild.cpp" - > - </File> - <File - RelativePath="ui\kvi_mdimanager.cpp" - > - </File> - <File - RelativePath="ui\kvi_menubar.cpp" - > - </File> - <File - RelativePath="ui\kvi_modeeditor.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_modew.cpp" - > - </File> - <File - RelativePath="ui\kvi_msgbox.cpp" - > - </File> - <File - RelativePath="ui\kvi_optionswidget.cpp" - > - </File> - <File - RelativePath="ui\kvi_query.cpp" - > - </File> - <File - RelativePath="ui\kvi_scriptbutton.cpp" - > - </File> - <File - RelativePath="ui\kvi_scripteditor.cpp" - > - </File> - <File - RelativePath="ui\kvi_selectors.cpp" - > - </File> - <File - RelativePath="ui\kvi_splash.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_statusbar.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_statusbarapplet.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_styled_controls.cpp" - > - </File> - <File - RelativePath="ui\kvi_taskbar.cpp" - > - </File> - <File - RelativePath="ui\kvi_texticonwin.cpp" - > - </File> - <File - RelativePath="ui\kvi_themedlabel.cpp" - > - </File> - <File - RelativePath="ui\kvi_toolbar.cpp" - > - </File> - <File - RelativePath=".\ui\kvi_toolwindows_container.cpp" - > - </File> - <File - RelativePath="ui\kvi_topicw.cpp" - > - </File> - <File - RelativePath="ui\kvi_userlistview.cpp" - > - </File> - <File - RelativePath="ui\kvi_window.cpp" - > - </File> - </Filter> - <Filter - Name="sparser" - > - <File - RelativePath="sparser\kvi_ircmessage.cpp" - > - </File> - <File - RelativePath="sparser\kvi_sp_ctcp.cpp" - > - </File> - <File - RelativePath="sparser\kvi_sp_literal.cpp" - > - </File> - <File - RelativePath="sparser\kvi_sp_numeric.cpp" - > - </File> - <File - RelativePath="sparser\kvi_sp_tables.cpp" - > - </File> - <File - RelativePath="sparser\kvi_sparser.cpp" - > - </File> - </Filter> - <Filter - Name="module" - > - <File - RelativePath="module\kvi_mexlinkfilter.cpp" - > - </File> - <File - RelativePath="module\kvi_mexserverimport.cpp" - > - </File> - <File - RelativePath="module\kvi_mextoolbar.cpp" - > - </File> - <File - RelativePath="module\kvi_module.cpp" - > - </File> - <File - RelativePath="module\kvi_moduleextension.cpp" - > - </File> - <File - RelativePath="module\kvi_modulemanager.cpp" - > - </File> - </Filter> - <Filter - Name="kvs" - > - <File - RelativePath="kvs\kvi_kvs.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_action.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_aliasmanager.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_array.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_arraycast.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_asyncdnsoperation.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_asyncoperation.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_callbackobject.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_corecallbackcommands.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions_af.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions_gl.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions_mr.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions_sz.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands_af.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands_gl.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands_mr.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands_sz.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_dnsmanager.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_event.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventhandler.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventmanager.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventtable.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_hash.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_kernel.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_moduleinterface.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_object.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_class.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_controller.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functioncall.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functionhandler.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functionhandlerimpl.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_parameterprocessor.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser_command.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser_comment.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser_dollar.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser_expression.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser_lside.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser_specialcommands.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_popupmanager.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_popupmenu.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_processmanager.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_report.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_runtimecall.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_runtimecontext.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_rwevaluationresult.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_script.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_scriptaddonmanager.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_switchlist.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_timermanager.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_aliasfunctioncall.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_aliassimplecommand.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arraycount.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayelement.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayorhashelement.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayreferenceassert.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_base.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_baseobjectfunctioncall.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_callbackcommand.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_command.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_commandevaluation.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_commandwithparameters.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_compositedata.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_constantdata.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_corecallbackcommand.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_corefunctioncall.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_coresimplecommand.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_data.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_datalist.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_expression.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_expressionreturn.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_extendedscopevariable.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_functioncall.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_globalvariable.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashcount.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashelement.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashreferenceassert.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_indirectdata.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_instruction.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_instructionblock.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_localvariable.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulecallbackcommand.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulefunctioncall.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulesimplecommand.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_multipleparameteridentifier.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_objectfield.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_objectfunctioncall.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_operation.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_parameterreturn.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_rebindingswitch.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_scopeoperator.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_simplecommand.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_singleparameteridentifier.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommand.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandbreak.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommandclass.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommanddefpopup.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommanddo.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandfor.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandforeach.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandif.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandswitch.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommandunset.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandwhile.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_stringcast.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_switchlist.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_thisobjectfunctioncall.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_variable.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_voidfunctioncall.cpp" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_useraction.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_variant.cpp" - > - </File> - <File - RelativePath="kvs\kvi_kvs_variantlist.cpp" - > - </File> - </Filter> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc" - > - <File - RelativePath="..\..\data\resources\auto-generated\kvirc-auto-resource.h" - > - </File> - <File - RelativePath="..\..\data\resources\resource.h" - > - </File> - <Filter - Name="kvs" - > - <File - RelativePath="kvs\kvi_kvs.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_action.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="kvs\kvi_kvs_aliasmanager.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_array.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_arraycast.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_asyncdnsoperation.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\kvi_kvs_asyncoperation.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\kvi_kvs_callbackobject.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_corecallbackcommands.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_corefunctions.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_coresimplecommands.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_dnsmanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\kvi_kvs_event.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventhandler.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventmanager.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventtable.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_eventtriggers.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_hash.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_kernel.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_moduleinterface.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_object.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_class.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_controller.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functioncall.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functionhandler.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_object_functionhandlerimpl.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_parameterprocessor.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_parser_macros.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_popupmanager.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_popupmenu.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp " - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp " - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kvs\kvi_kvs_processmanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="kvs\kvi_kvs_report.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_runtimecall.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_runtimecontext.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_rwevaluationresult.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_script.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_scriptaddonmanager.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_switchlist.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_timermanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="kvs\kvi_kvs_treenode.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_aliasfunctioncall.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_aliassimplecommand.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arraycount.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayelement.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayorhashelement.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_arrayreferenceassert.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_base.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_baseobjectfunctioncall.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_callbackcommand.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_command.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_commandevaluation.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_commandwithparameters.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_compositedata.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_constantdata.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_corecallbackcommand.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_corefunctioncall.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_coresimplecommand.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_data.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_datalist.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_expression.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_expressionreturn.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_extendedscopevariable.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_functioncall.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_globalvariable.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashcount.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashelement.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_hashreferenceassert.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_indirectdata.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_instruction.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_instructionblock.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_localvariable.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulecallbackcommand.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulefunctioncall.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_modulesimplecommand.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_multipleparameteridentifier.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_objectfield.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_objectfunctioncall.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_operation.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_parameterreturn.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_rebindingswitch.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_scopeoperator.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_simplecommand.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_singleparameteridentifier.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommand.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandbreak.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommandclass.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommanddefpopup.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommanddo.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandfor.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandforeach.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandif.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandswitch.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_specialcommandunset.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_specialcommandwhile.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_treenode_stringcast.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_switchlist.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_thisobjectfunctioncall.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_variable.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_treenode_voidfunctioncall.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_types.h" - > - </File> - <File - RelativePath=".\kvs\kvi_kvs_useraction.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="kvs\kvi_kvs_variant.h" - > - </File> - <File - RelativePath="kvs\kvi_kvs_variantlist.h" - > - </File> - </Filter> - <Filter - Name="kernel" - > - <File - RelativePath=".\kernel\kvi_action.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_actionmanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="sparser\kvi_antispam.h" - > - </File> - <File - RelativePath="kernel\kvi_app.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_asynchronousconnectiondata.h" - > - </File> - <File - RelativePath=".\kernel\kvi_coreactions.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_cryptcontroller.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_customtoolbardescriptor.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="" - Outputs="" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_customtoolbarmanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="" - Outputs="" - /> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_filetransfer.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_iconmanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_internalcmd.h" - > - </File> - <File - RelativePath="kernel\kvi_ipc.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircconnection.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionantictcpflooddata.h" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionasyncwhoisdata.h" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionnetsplitdetectordata.h" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionserverinfo.h" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionstatedata.h" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionstatistics.h" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectiontarget.h" - > - </File> - <File - RelativePath=".\kernel\kvi_ircconnectiontargetresolver.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircconnectionuserinfo.h" - > - </File> - <File - RelativePath=".\kernel\kvi_irccontext.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircdatastreammonitor.h" - > - </File> - <File - RelativePath="kernel\kvi_irclink.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircsocket.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_ircurl.h" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_lagmeter.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_notifylist.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="kernel\kvi_options.h" - > - </File> - <File - RelativePath="kernel\kvi_out.h" - > - </File> - <File - RelativePath="kernel\kvi_sslmaster.h" - > - </File> - <File - RelativePath="kernel\kvi_texticonmanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_theme.h" - > - </File> - <File - RelativePath="kernel\kvi_useraction.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\kernel\kvi_userinput.h" - > - </File> - </Filter> - <Filter - Name="ui" - > - <File - RelativePath=".\ui\kvi_actiondrawer.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_channel.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_colorwin.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_console.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_ctcppagedialog.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_customtoolbar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_debugwindow.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_dynamictooltip.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_filedialog.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_frame.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_historywin.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_htmldialog.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_imagedialog.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_input.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_ipeditor.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_irctoolbar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_ircview.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_ircviewprivate.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="" - Outputs="" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="" - Outputs="" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_ircviewtools.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_listview.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_maskeditor.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_mdicaption.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_mdichild.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_mdimanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_menubar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_modeeditor.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_modew.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_msgbox.h" - > - </File> - <File - RelativePath="ui\kvi_optionswidget.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_query.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_scriptbutton.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_scripteditor.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_selectors.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_splash.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_statusbar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_statusbarapplet.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_styled_controls.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_taskbar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_texticonwin.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_themedlabel.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_toolbar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ui\kvi_toolwindows_container.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_topicw.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_userlistview.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath="ui\kvi_window.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="sparser" - > - <File - RelativePath="sparser\kvi_ircmessage.h" - > - </File> - <File - RelativePath="sparser\kvi_numeric.h" - > - </File> - <File - RelativePath="sparser\kvi_sparser.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - </Filter> - <Filter - Name="module" - > - <File - RelativePath="module\kvi_mexlinkfilter.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="module\kvi_mexserverimport.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="module\kvi_mextoolbar.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File - RelativePath="module\kvi_module.h" - > - </File> - <File - RelativePath="module\kvi_moduleextension.h" - > - </File> - <File - RelativePath="module\kvi_modulemanager.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\moc_$(InputName).cpp" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - </Filter> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" - > - <File - RelativePath="..\..\data\resources\icon1.ico" - > - </File> - <File - RelativePath="..\..\data\resources\kva.ico" - > - </File> - <File - RelativePath="..\..\data\resources\kvc.ico" - > - </File> - <File - RelativePath="..\..\data\resources\auto-generated\kvirc-auto.rc" - > - </File> - <File - RelativePath="..\..\data\resources\kvirc.rc" - > - </File> - <File - RelativePath="..\..\data\resources\kvs.ico" - > - </File> - <File - RelativePath="..\..\data\resources\kvt.ico" - > - </File> - </Filter> - </Files> - <Globals> - <Global - Name="QtVersion" - Value="3.3.6" - /> - </Globals> -</VisualStudioProject> diff --git a/3.4.0/src/kvirc/kvs/.svnignore b/3.4.0/src/kvirc/kvs/.svnignore deleted file mode 100644 index 74e3b9a7ca..0000000000 --- a/3.4.0/src/kvirc/kvs/.svnignore +++ /dev/null @@ -1,19 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -moc_kvi_*.cpp -*.o -*.lo -*.la -*.so -*.lai -kvirc -symlinks diff --git a/3.4.0/src/kvirc/kvs/Makefile.am b/3.4.0/src/kvirc/kvs/Makefile.am deleted file mode 100644 index c84487eb66..0000000000 --- a/3.4.0/src/kvirc/kvs/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -EXTRA_DIST = *.cpp *.h diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs.cpp deleted file mode 100644 index 6e4be07baf..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs.cpp +++ /dev/null @@ -1,144 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs.cpp -// Creation date : Wed 1 Oct 2003 01.38 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs.h" -#include "kvi_kvs_kernel.h" -#include "kvi_kvs_aliasmanager.h" -#include "kvi_kvs_dnsmanager.h" -#include "kvi_kvs_timermanager.h" -#include "kvi_kvs_popupmanager.h" -#include "kvi_kvs_eventmanager.h" -#include "kvi_kvs_scriptaddonmanager.h" -#include "kvi_kvs_object_controller.h" - -namespace KviKvs -{ - void init() - { - KviKvsKernel::init(); - KviKvsAliasManager::init(); - KviKvsPopupManager::init(); - KviKvsEventManager::init(); - // FIXME: Could we delay the init of these objects ? - // It could be delayed to the first *::instance() call - KviKvsScriptAddonManager::init(); - KviKvsTimerManager::init(); - KviKvsDnsManager::init(); - } - - void done() - { - //KviKvsScriptManager::done(); - KviKvsEventManager::done(); - KviKvsPopupManager::done(); - KviKvsAliasManager::done(); - KviKvsScriptAddonManager::done(); - KviKvsTimerManager::done(); - KviKvsDnsManager::done(); - KviKvsKernel::done(); - } - - void loadPopups(const QString &szFileName) - { - KviKvsPopupManager::instance()->load(szFileName); - } - - void savePopups(const QString &szFileName) - { - KviKvsPopupManager::instance()->save(szFileName); - } - - void clearPopups() - { - KviKvsPopupManager::instance()->clear(); - } - - void loadAliases(const QString &szFileName) - { - KviKvsAliasManager::instance()->load(szFileName); - } - - void saveAliases(const QString &szFileName) - { - KviKvsAliasManager::instance()->save(szFileName); - } - - void clearAliases() - { - KviKvsAliasManager::instance()->clear(); - } - - void loadAppEvents(const QString &szFileName) - { - KviKvsEventManager::instance()->loadAppEvents(szFileName); - } - - void saveAppEvents(const QString &szFileName) - { - KviKvsEventManager::instance()->saveAppEvents(szFileName); - } - - void clearAppEvents() - { - KviKvsEventManager::instance()->removeAllScriptAppHandlers(); - } - - void loadRawEvents(const QString &szFileName) - { - KviKvsEventManager::instance()->loadRawEvents(szFileName); - } - - void saveRawEvents(const QString &szFileName) - { - KviKvsEventManager::instance()->saveRawEvents(szFileName); - } - - void clearRawEvents() - { - KviKvsEventManager::instance()->removeAllScriptRawHandlers(); - } - - void loadScriptAddons(const QString &szFileName) - { - KviKvsScriptAddonManager::instance()->load(szFileName); - } - - void saveScriptAddons(const QString &szFileName) - { - KviKvsScriptAddonManager::instance()->save(szFileName); - } - - void clearScriptAddons() - { - KviKvsScriptAddonManager::instance()->clear(); - } - - void flushUserClasses() - { - KviKvsKernel::instance()->objectController()->flushUserClasses(); - } -}; - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs.h b/3.4.0/src/kvirc/kvs/kvi_kvs.h deleted file mode 100644 index 71a26cbc50..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef _KVI_KVS_H_ -#define _KVI_KVS_H_ -//============================================================================= -// -// File : kvi_kvs.h -// Creation date : Wed 1 Oct 2003 01.37 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - -// this header contains ALL the stuff that the user should see -#include "kvi_kvs_script.h" - -namespace KviKvs -{ - void init(); // this never fails - void done(); // this never fails - - void loadAliases(const QString &szFileName); - void saveAliases(const QString &szFileName); - void clearAliases(); - - void loadPopups(const QString &szFileName); - void savePopups(const QString &szFileName); - void clearPopups(); - - void loadAppEvents(const QString &szFileName); - void saveAppEvents(const QString &szFileName); - void clearAppEvents(); - - void loadRawEvents(const QString &szFileName); - void saveRawEvents(const QString &szFileName); - void clearRawEvents(); - - void loadScriptAddons(const QString &szFileName); - void saveScriptAddons(const QString &szFileName); - void clearScriptAddons(); - - void flushUserClasses(); -}; - - -#endif //!_KVI_KVS_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_action.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_action.cpp deleted file mode 100644 index 7035f5887f..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_action.cpp +++ /dev/null @@ -1,66 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_action.cpp -// Created on Sat 04 Dec 2004 04:22:12 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_action.h" -#include "kvi_kvs_script.h" -#include "kvi_window.h" - -KviKvsAction::KviKvsAction(QObject * pParent, - const QString &szName, - const QString &szScriptCode, - const QString &szVisibleName, - const QString &szDescription, - KviActionCategory * pCategory, - const QString &szBigIcon, - int iSmallIconId, - unsigned int uFlags, - const QString &szKeySequence) - : KviAction(pParent,szName,szVisibleName,szDescription,pCategory,szBigIcon,iSmallIconId,uFlags,szKeySequence) -{ - QString tmp = KVI_KVS_ACTION_SCRIPT_NAME_PREFIX; - tmp += szName; - m_pScript = new KviKvsScript(tmp,szScriptCode); -} - - -KviKvsAction::~KviKvsAction() -{ - unregisterAccelerator(); - delete m_pScript; -} - -const QString & KviKvsAction::scriptCode() -{ - return m_pScript->code(); -} - -void KviKvsAction::activate() -{ - // at the moment it executes externally! - // FIXME! - if(!isEnabled())return; // no way - m_pScript->run(g_pActiveWindow); // FIXME: complain more in case of error ? -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_action.h b/3.4.0/src/kvirc/kvs/kvi_kvs_action.h deleted file mode 100644 index 83f1ef557e..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_action.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef _KVI_KVSACTION_H_ -#define _KVI_KVSACTION_H_ -//============================================================================= -// -// File : kvi_kvs_action.h -// Created on Sat 04 Dec 2004 04:22:12 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_action.h" - -class KviKvsScript; - -#define KVI_KVS_ACTION_SCRIPT_NAME_PREFIX "action::" - -class KVIRC_API KviKvsAction : public KviAction -{ - Q_OBJECT -protected: - KviKvsScript * m_pScript; -public: - KviKvsAction(QObject * pParent, - const QString &szName, - const QString &szScriptCode, - const QString &szVisibleName, - const QString &szDescription, - KviActionCategory * pCategory = 0, - const QString &szBigIcon = QString::null, - int iSmallIconId = 0, - unsigned int uFlags = 0, - const QString &szKeySequence = QString::null); - ~KviKvsAction(); -public: - const QString & scriptCode(); - virtual void activate(); -}; - - - - -#endif //!_KVI_KVSACTION_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_aliasmanager.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_aliasmanager.cpp deleted file mode 100644 index 81e1234c2c..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_aliasmanager.cpp +++ /dev/null @@ -1,121 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_aliasmanager.cpp -// Created on Mon 15 Dec 2003 02:11:41 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_aliasmanager.h" -#include "kvi_config.h" - -KviKvsAliasManager * KviKvsAliasManager::m_pAliasManager = 0; - -KviKvsAliasManager::KviKvsAliasManager() -{ - m_pAliasManager = this; - m_pAliasDict = new KviPointerHashTable<QString,KviKvsScript>(51,false); - m_pAliasDict->setAutoDelete(true); -} - -KviKvsAliasManager::~KviKvsAliasManager() -{ - delete m_pAliasDict; -} - -void KviKvsAliasManager::init() -{ - if(KviKvsAliasManager::instance()) - { - debug("WARNING: Trying to create the KviKvsAliasManager twice!"); - return; - } - (void)new KviKvsAliasManager(); -} - -void KviKvsAliasManager::done() -{ - if(!KviKvsAliasManager::instance()) - { - debug("WARNING: Trying to destroy the KviKvsAliasManager twice!"); - return; - } - delete KviKvsAliasManager::instance(); -} - -void KviKvsAliasManager::completeCommand(const QString &word,KviPointerList<QString> * matches) -{ - KviPointerHashTableIterator<QString,KviKvsScript> it(*m_pAliasDict); - while(it.current()) - { - if(KviQString::equalCIN(word,it.current()->name(),word.length())) - matches->append(new QString(it.current()->name())); - ++it; - } -} - -// FIXME: #warning "A binary config would work better and faster here!" - -void KviKvsAliasManager::save(const QString & filename) -{ - KviConfig cfg(filename,KviConfig::Write); - cfg.clear(); - - KviPointerHashTableIterator<QString,KviKvsScript> it(*m_pAliasDict); - - while(it.current()) - { - cfg.setGroup(it.current()->name()); - cfg.writeEntry("_Buffer",it.current()->code()); - ++it; - } -} - -void KviKvsAliasManager::load(const QString & filename) -{ - m_pAliasDict->clear(); - KviConfig cfg(filename,KviConfig::Read); - - KviConfigIterator it(*(cfg.dict())); - - KviPointerList<QString> l; - l.setAutoDelete(true); - - while(it.current()) - { - l.append(new QString(it.currentKey())); - ++it; - } - - for(QString * s = l.first();s;s = l.next()) - { - cfg.setGroup(*s); - QString szCode = cfg.readQStringEntry("_Buffer",""); - if(!szCode.isEmpty()) - { - KviKvsScript * m = new KviKvsScript(*s,szCode); - m_pAliasDict->insert(*s,m); - } - ++it; - } -} - - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_aliasmanager.h b/3.4.0/src/kvirc/kvs/kvi_kvs_aliasmanager.h deleted file mode 100644 index 4d3871d4a9..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_aliasmanager.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef _KVI_KVS_ALIASMANAGER_H_ -#define _KVI_KVS_ALIASMANAGER_H_ -//============================================================================= -// -// File : kvi_kvs_aliasmanager.h -// Created on Mon 15 Dec 2003 02:11:41 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_pointerhashtable.h" - -#include "kvi_pointerlist.h" -#include "kvi_qstring.h" - -#include "kvi_kvs_script.h" - -class KVIRC_API KviKvsAliasManager -{ -protected: // it only can be created and destroyed by KviKvsAliasManager::init()/done() - KviKvsAliasManager(); - ~KviKvsAliasManager(); -protected: - KviPointerHashTable<QString,KviKvsScript> * m_pAliasDict; - static KviKvsAliasManager * m_pAliasManager; -public: - static KviKvsAliasManager * instance() - { return m_pAliasManager; }; - static void init(); // called by KviKvs::init() - static void done(); // called by KviKvs::done() - - KviPointerHashTable<QString,KviKvsScript> * aliasDict(){ return m_pAliasDict; }; - const KviKvsScript * lookup(const QString & szName) - { return m_pAliasDict->find(szName); }; - void add(const QString &szName,KviKvsScript * pAlias) - { m_pAliasDict->replace(szName,pAlias); }; - bool remove(const QString & szName) - { return m_pAliasDict->remove(szName); }; - void clear() - { m_pAliasDict->clear(); }; - - void save(const QString & filename); - void load(const QString & filename); - - void completeCommand(const QString &word,KviPointerList<QString> * matches); -}; - -// namespaces are handled completly in the editing! - -#endif //!_KVI_KVS_ALIASMANAGER_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_array.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_array.cpp deleted file mode 100644 index 33251a6e3f..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_array.cpp +++ /dev/null @@ -1,227 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_array.cpp -// Created on Tue 07 Oct 2003 01:07:31 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_array.h" -#include "kvi_malloc.h" - -#include <stdlib.h> - -#define KVI_KVS_ARRAY_ALLOC_CHUNK 8 - -KviKvsArray::KviKvsArray() -: KviHeapObject() -{ - m_pData = 0; - m_uSize = 0; - m_uAllocSize = 0; -} - -KviKvsArray::KviKvsArray(const KviKvsArray &a) -: KviHeapObject() -{ - m_uSize = a.m_uSize; - m_uAllocSize = a.m_uAllocSize; - if(m_uAllocSize > 0) - { - m_pData = (KviKvsVariant **)kvi_malloc((sizeof(KviKvsVariant *)) * m_uAllocSize); - kvs_uint_t i; - for(i=0;i<m_uSize;i++) - if(a.m_pData[i])m_pData[i] = new KviKvsVariant(*(a.m_pData[i])); - else m_pData[i] = 0; - } else { - m_pData = 0; - } -} - -KviKvsArray::~KviKvsArray() -{ - if(m_pData) - { - for(kvs_uint_t i=0;i<m_uSize;i++) - if(m_pData[i])delete m_pData[i]; - kvi_free(m_pData); - } -} - -static int kvs_array_reverse_compare_func(const void * v1,const void * v2) -{ - if(*((KviKvsVariant **)v1))return (*((KviKvsVariant **)v1))->compare(*((KviKvsVariant **)v2)); - if(*((KviKvsVariant **)v2))return -(*((KviKvsVariant **)v2))->compare(*((KviKvsVariant **)v1)); - return 0; -} - -static int kvs_array_compare_func(const void * v1,const void * v2) -{ - if(*((KviKvsVariant **)v1))return -(*((KviKvsVariant **)v1))->compare(*((KviKvsVariant **)v2)); - if(*((KviKvsVariant **)v2))return (*((KviKvsVariant **)v2))->compare(*((KviKvsVariant **)v1)); - return 0; -} - - -void KviKvsArray::sort() -{ - if(m_uSize < 2)return; // already sorted - qsort(m_pData,m_uSize,sizeof(KviKvsVariant *),kvs_array_compare_func); - findNewSize(); -} - -void KviKvsArray::rsort() -{ - if(m_uSize < 2)return; // already sorted - qsort(m_pData,m_uSize,sizeof(KviKvsVariant *),kvs_array_reverse_compare_func); - findNewSize(); -} - -void KviKvsArray::unset(kvs_uint_t uIdx) -{ - if(uIdx >= m_uSize)return; - - if(m_pData[uIdx]) - { - delete m_pData[uIdx]; - m_pData[uIdx] = 0; - } - - if(uIdx == (m_uSize - 1)) - { - findNewSize(); - } -} - -void KviKvsArray::findNewSize() -{ - // find the new size - if(m_uSize == 0)return; - kvs_uint_t u = m_uSize - 1; - while(u > 0) - { - if(m_pData[u])break; - u--; - } - if(m_pData[u])m_uSize = u + 1; - else { - // u == 0, and there is no data in there - m_uSize = 0; - } - // need to shrink ? - - if((m_uAllocSize - m_uSize) > KVI_KVS_ARRAY_ALLOC_CHUNK) - { - m_uAllocSize = m_uSize; - // m_pData is non-zero here since was m_uSize > 0 initally - if(m_uSize > 0) - { - m_pData = (KviKvsVariant **)kvi_realloc(m_pData,(sizeof(KviKvsVariant *)) * m_uAllocSize); - } else { - kvi_free(m_pData); - m_pData = 0; - } - } -} - -void KviKvsArray::set(kvs_uint_t uIdx,KviKvsVariant * pVal) -{ - if(uIdx >= m_uSize) - { - if(uIdx == m_uSize) - { - m_uAllocSize += KVI_KVS_ARRAY_ALLOC_CHUNK; // sequential set - } else { - m_uAllocSize = uIdx + 1; - } - if(m_pData) - m_pData = (KviKvsVariant **)kvi_realloc(m_pData,(sizeof(KviKvsVariant *)) * m_uAllocSize); - else - m_pData = (KviKvsVariant **)kvi_malloc((sizeof(KviKvsVariant *)) * m_uAllocSize); - for(kvs_uint_t u=m_uSize;u<uIdx;u++) - m_pData[u] = 0; - m_uSize = uIdx+1; - m_pData[uIdx] = pVal; - } else { - if(m_pData[uIdx])delete m_pData[uIdx]; - m_pData[uIdx] = pVal; - } -} - -KviKvsVariant * KviKvsArray::getAt(kvs_uint_t uIdx) -{ - if(uIdx >= m_uSize) - { - if(uIdx == m_uSize) - { - m_uAllocSize += KVI_KVS_ARRAY_ALLOC_CHUNK; // sequential set - } else { - m_uAllocSize = uIdx + 1; - } - if(m_pData) - m_pData = (KviKvsVariant **)kvi_realloc(m_pData,(sizeof(KviKvsVariant *)) * m_uAllocSize); - else - m_pData = (KviKvsVariant **)kvi_malloc((sizeof(KviKvsVariant *)) * m_uAllocSize); - for(kvs_uint_t u=m_uSize;u<uIdx;u++) - m_pData[u] = 0; - m_uSize = uIdx+1; - m_pData[uIdx] = new KviKvsVariant(); - } else { - if(!m_pData[uIdx]) - m_pData[uIdx] = new KviKvsVariant(); - } - return m_pData[uIdx]; -} - -void KviKvsArray::serialize(QString& result) -{ - QString tmpBuffer; - result="["; - kvs_uint_t u = 0; - bool bNeedComma = false; - while(u < m_uSize) - { - if(bNeedComma)result.append(','); - else bNeedComma = true; - if(m_pData[u]) { - m_pData[u]->serialize(tmpBuffer); - result.append(tmpBuffer); - } else { - result.append("null"); - } - u++; - } - result.append(']'); -} - -void KviKvsArray::appendAsString(QString &szBuffer) -{ - kvs_uint_t u = 0; - bool bNeedComma = false; - while(u < m_uSize) - { - if(bNeedComma)szBuffer.append(','); - else bNeedComma = true; - if(m_pData[u])m_pData[u]->appendAsString(szBuffer); - u++; - } -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_array.h b/3.4.0/src/kvirc/kvs/kvi_kvs_array.h deleted file mode 100644 index 6bf4fd655f..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_array.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef _KVI_KVS_ARRAY_H_ -#define _KVI_KVS_ARRAY_H_ -//============================================================================= -// -// File : kvi_kvs_array.h -// Created on Tue 07 Oct 2003 01:07:31 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_qstring.h" -#include "kvi_kvs_variant.h" -#include "kvi_heapobject.h" - - -// This class must not have virtual funcitons nor destructor -// Otherwise it will happily crash on windows when it is -// allocated in modules and destroyed anywhere else around... -class KVIRC_API KviKvsArray : public KviHeapObject -{ -public: - KviKvsArray(); - KviKvsArray(const KviKvsArray &a); - ~KviKvsArray(); -protected: - KviKvsVariant ** m_pData; - kvs_uint_t m_uSize; - kvs_uint_t m_uAllocSize; -public: - void unset(kvs_uint_t uIdx); - void set(kvs_uint_t uIdx,KviKvsVariant * pVal); - KviKvsVariant * at(kvs_uint_t uIdx) const { return (uIdx < m_uSize) ? m_pData[uIdx] : 0; }; - KviKvsVariant * getAt(kvs_uint_t uIdx); - bool isEmpty(){ return m_uSize == 0; }; - kvs_uint_t size(){ return m_uSize; }; - void appendAsString(QString &szBuffer); - void serialize(QString& result); - void sort(); - void rsort(); -protected: - void findNewSize(); -}; - - -#endif //!_KVI_KVS_ARRAY_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_arraycast.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_arraycast.cpp deleted file mode 100644 index c6732a2956..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_arraycast.cpp +++ /dev/null @@ -1,44 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_arraycast.cpp -// Created on Tue 10 May 2005 00:05:50 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_arraycast.h" - -KviKvsArrayCast::~KviKvsArrayCast() -{ - if(m_pArray) - if(m_bOwned) - delete m_pArray; -} - -void KviKvsArrayCast::clear() -{ - if(m_pArray) - { - if(m_bOwned) - delete m_pArray; - m_pArray = 0; - } -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_arraycast.h b/3.4.0/src/kvirc/kvs/kvi_kvs_arraycast.h deleted file mode 100644 index a45356757d..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_arraycast.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _KVI_KVS_ARRAYCAST_H_ -#define _KVI_KVS_ARRAYCAST_H_ -//============================================================================= -// -// File : kvi_kvs_arraycast.h -// Created on Tue 10 May 2005 00:05:50 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_array.h" - -class KVIRC_API KviKvsArrayCast -{ -protected: - KviKvsArray * m_pArray; - bool m_bOwned; -public: - KviKvsArrayCast() - : m_pArray(0) {}; - ~KviKvsArrayCast(); -public: - void clear(); - KviKvsArray * array() - { return m_pArray; }; - void release() - { m_bOwned = false; }; - void set(KviKvsArray * pArry,bool bOwned) - { m_pArray = pArry; m_bOwned = bOwned; }; -}; - - -#endif //!_KVI_KVS_ARRAYCAST_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_asyncdnsoperation.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_asyncdnsoperation.cpp deleted file mode 100644 index 0b7d3955e8..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_asyncdnsoperation.cpp +++ /dev/null @@ -1,122 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_asyncdnsoperation.cpp -// Created on Sun 10 Jul 2005 04:36:15 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_asyncdnsoperation.h" -#include "kvi_dns.h" -#include "kvi_kvs_script.h" -#include "kvi_kvs_variant.h" -#include "kvi_app.h" -#include "kvi_out.h" -#include "kvi_locale.h" -#include "kvi_error.h" -#include "kvi_kvs_variantlist.h" - -#include <qtimer.h> - - -KviKvsAsyncDnsOperation::KviKvsAsyncDnsOperation(KviWindow * pWnd,QString &szQuery,KviDns::QueryType eType,KviKvsScript * pCallback,KviKvsVariant * pMagic) -: KviKvsAsyncOperation(pWnd) -{ - m_pDns = new KviDns(); - m_szQuery = szQuery; - m_eType = eType; - m_pCallback = pCallback; - m_pMagic = pMagic; - connect(m_pDns,SIGNAL(lookupDone(KviDns *)),this,SLOT(lookupTerminated(KviDns *))); - if(!m_pDns->lookup(szQuery,eType)) - QTimer::singleShot(10,this,SLOT(dnsStartFailed())); -} - -KviKvsAsyncDnsOperation::~KviKvsAsyncDnsOperation() -{ - if(m_pDns)delete m_pDns; - if(m_pMagic)delete m_pMagic; - if(m_pCallback)delete m_pCallback; -} - -void KviKvsAsyncDnsOperation::dnsStartFailed() -{ - lookupTerminated(m_pDns); -} - -void KviKvsAsyncDnsOperation::lookupTerminated(KviDns *) -{ - KviWindow * pWnd = window(); - if(!g_pApp->windowExists(pWnd))pWnd = g_pActiveWindow; - - if(m_pCallback) - { - KviKvsVariantList params; - params.setAutoDelete(true); - if(m_pDns->state() == KviDns::Failure) - { - params.append(new KviKvsVariant(m_szQuery)); - params.append(new KviKvsVariant((kvs_int_t)0)); - params.append(new KviKvsVariant(KviError::getDescription(m_pDns->error()))); - params.append(new KviKvsVariant()); - params.append(new KviKvsVariant(*m_pMagic)); - } else { - QString * fh = m_pDns->hostnameList()->first(); - QString * fi = m_pDns->ipAddressList()->first(); - - params.append(new KviKvsVariant(m_szQuery)); - params.append(new KviKvsVariant((kvs_int_t)1)); - params.append(new KviKvsVariant(fi ? *fi : QString("?.?.?.?"))); - params.append(new KviKvsVariant(fh ? *fh : QString("?.?"))); - params.append(new KviKvsVariant(*m_pMagic)); - } - - m_pCallback->run(pWnd,¶ms,0,KviKvsScript::PreserveParams); - - delete this; - return; - } - - // we have no callback : output the results - QString szQuery = m_pDns->query(); - pWnd->output(KVI_OUT_HOSTLOOKUP,__tr2qs("DNS Lookup result for query \"%Q\""),&szQuery); - - if(m_pDns->state() == KviDns::Failure) - { - QString strDescription(KviError::getDescription(m_pDns->error())); - pWnd->output(KVI_OUT_HOSTLOOKUP,__tr2qs("Error: %Q"),&strDescription); - } else { - int idx = 1; - for(QString * h = m_pDns->hostnameList()->first();h;h = m_pDns->hostnameList()->next()) - { - pWnd->output(KVI_OUT_HOSTLOOKUP,__tr2qs("Hostname %d: %Q"),idx,h); - idx++; - } - idx = 1; - for(QString * a = m_pDns->ipAddressList()->first();a;a = m_pDns->ipAddressList()->next()) - { - pWnd->output(KVI_OUT_HOSTLOOKUP,__tr2qs("IP address %d: %Q"),idx,a); - idx++; - } - } - - delete this; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_asyncdnsoperation.h b/3.4.0/src/kvirc/kvs/kvi_kvs_asyncdnsoperation.h deleted file mode 100644 index a9fe09cc95..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_asyncdnsoperation.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef _KVI_KVS_ASYNCDNSOPERATION_H_ -#define _KVI_KVS_ASYNCDNSOPERATION_H_ -//============================================================================= -// -// File : kvi_kvs_asyncdnsoperation.h -// Created on Sun 10 Jul 2005 04:36:15 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_asyncoperation.h" -#include "kvi_qstring.h" -#include "kvi_dns.h" - -class KviWindow; -class KviKvsScript; -class KviKvsVariant; - -class KVIRC_API KviKvsAsyncDnsOperation : public KviKvsAsyncOperation -{ - Q_OBJECT -public: - KviKvsAsyncDnsOperation(KviWindow * pWnd,QString &szQuery,KviDns::QueryType eType,KviKvsScript * pCallback = 0,KviKvsVariant * pMagic = 0); - virtual ~KviKvsAsyncDnsOperation(); -protected: - KviDns * m_pDns; - KviDns::QueryType m_eType; - KviKvsVariant * m_pMagic; - KviKvsScript * m_pCallback; - QString m_szQuery; -protected slots: - void lookupTerminated(KviDns *); - void dnsStartFailed(); -}; - -#endif //!_KVI_KVS_ASYNCDNSOPERATION_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_asyncoperation.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_asyncoperation.cpp deleted file mode 100644 index ff503c02c2..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_asyncoperation.cpp +++ /dev/null @@ -1,66 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_asyncoperation.cpp -// Created on Sat 09 Jul 2005 04:54:24 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_asyncoperation.h" -#include "kvi_kvs_kernel.h" -#include "kvi_window.h" - -KviKvsAsyncOperation::KviKvsAsyncOperation(KviWindow * pWnd) -: QObject() -{ - m_pWnd = pWnd; - KviKvsKernel::instance()->asyncOperationManager()->registerOperation(this); -} - -KviKvsAsyncOperation::~KviKvsAsyncOperation() -{ - KviKvsKernel::instance()->asyncOperationManager()->unregisterOperation(this); -} - - -KviKvsAsyncOperationManager::KviKvsAsyncOperationManager() -{ - m_pOperationList = new KviPointerList<KviKvsAsyncOperation>; - m_pOperationList->setAutoDelete(false); -} - -KviKvsAsyncOperationManager::~KviKvsAsyncOperationManager() -{ - while(m_pOperationList->first()) - delete m_pOperationList->first(); - delete m_pOperationList; -} - -void KviKvsAsyncOperationManager::registerOperation(KviKvsAsyncOperation * o) -{ - m_pOperationList->append(o); -} - -void KviKvsAsyncOperationManager::unregisterOperation(KviKvsAsyncOperation * o) -{ - m_pOperationList->removeRef(o); -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_asyncoperation.h b/3.4.0/src/kvirc/kvs/kvi_kvs_asyncoperation.h deleted file mode 100644 index a870b40815..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_asyncoperation.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef _KVI_KVS_ASYNCOPERATION_H_ -#define _KVI_KVS_ASYNCOPERATION_H_ -//============================================================================= -// -// File : kvi_kvs_asyncoperation.h -// Created on Sat 09 Jul 2005 04:54:24 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_pointerlist.h" -#include <qobject.h> - -class KviWindow; - -class KVIRC_API KviKvsAsyncOperation : public QObject -{ - Q_OBJECT -public: - KviKvsAsyncOperation(KviWindow * pWnd); - virtual ~KviKvsAsyncOperation(); -protected: - KviWindow * m_pWnd; -public: - KviWindow * window(){ return m_pWnd; }; -}; - - -class KVIRC_API KviKvsAsyncOperationManager -{ - friend class KviKvsAsyncOperation; -public: - KviKvsAsyncOperationManager(); - ~KviKvsAsyncOperationManager(); -protected: - KviPointerList<KviKvsAsyncOperation> * m_pOperationList; -protected: - void registerOperation(KviKvsAsyncOperation * o); - void unregisterOperation(KviKvsAsyncOperation * o); -}; - -#endif //!_KVI_KVS_ASYNCOPERATION_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_callbackobject.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_callbackobject.cpp deleted file mode 100644 index e2baa1995e..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_callbackobject.cpp +++ /dev/null @@ -1,108 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_callbackobject.cpp -// Created on Mon 21 Nov 2005 01:46:51 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_callbackobject.h" -#include "kvi_console.h" -#include "kvi_app.h" - - -KviKvsCallbackObject::KviKvsCallbackObject(const QString &szCallbackName,KviWindow * pTargetWindow,const QString &szCallbackCode,KviKvsVariantList * pMagicParams,unsigned int uFlags) -: KviHeapObject() -{ - m_uFlags = uFlags; - m_pTargetWindow = pTargetWindow; - if(pTargetWindow) - m_pTargetConsole = pTargetWindow->console(); - else - m_pTargetConsole = 0; - m_pMagicParams = new KviKvsVariantList(); - if(pMagicParams) - for(KviKvsVariant * v = pMagicParams->first();v;v = pMagicParams->next()) - m_pMagicParams->append(new KviKvsVariant(*v)); - QString szName; - szName = szCallbackName; - szName += "::"; - szName += "callback"; - m_pScript = new KviKvsScript(szName,szCallbackCode); -} - -KviKvsCallbackObject::~KviKvsCallbackObject() -{ - delete m_pScript; - delete m_pMagicParams; -} - -KviKvsCallbackObject::CallbackStatus KviKvsCallbackObject::execute(KviKvsVariantList * pParams,KviKvsVariant * pRetVal) -{ - // first of all check the window - if(!m_pTargetWindow) - m_pTargetWindow = g_pApp->activeConsole(); - if(!g_pApp->windowExists(m_pTargetWindow)) - { - // target window dead - if(m_uFlags & OnlyIfWindowExists) - return TargetWindowDead; - // rebind - m_pTargetWindow = m_pTargetConsole; - if(!m_pTargetWindow) - { - m_pTargetWindow = g_pApp->activeConsole(); - if(!m_pTargetWindow) - return Error; // ooops... - } else { - if(!g_pApp->windowExists(m_pTargetWindow)) - { - m_pTargetWindow = g_pApp->activeConsole(); - if(!m_pTargetWindow) - return Error; // ooops... - } - } - } - // ok, got the window - // now take care of the params - KviKvsVariantList params; - params.setAutoDelete(false); - KviKvsVariant * v; - - if(pParams) - for(v = pParams->first();v;v = pParams->next()) - params.append(v); - - for(v = m_pMagicParams->first();v;v = m_pMagicParams->next()) - params.append(v); - - unsigned int uRet = m_pScript->run(m_pTargetWindow,¶ms,pRetVal,KviKvsScript::PreserveParams); - - if(uRet) - { - if(uRet & KviKvsScript::HaltEncountered) - return HaltEncountered; - return Success; - } - - // ooops... error - return Error; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_callbackobject.h b/3.4.0/src/kvirc/kvs/kvi_kvs_callbackobject.h deleted file mode 100644 index e161942cd3..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_callbackobject.h +++ /dev/null @@ -1,84 +0,0 @@ -#ifndef _KVI_KVS_CALLBACKOBJECT_H_ -#define _KVI_KVS_CALLBACKOBJECT_H_ -//============================================================================= -// -// File : kvi_kvs_callbackobject.h -// Created on Mon 21 Nov 2005 01:46:51 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_heapobject.h" - -#include "kvi_window.h" -#include "kvi_qstring.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_script.h" - - -// -// This is a simple callback object useful in stuff like dialog.message(){} -// You derive a class from KviKvsCallbackObject, pass the callback data (code,window and magic params) -// and when the time comes ask it to execute the callback (maybe by passing some special parameters) -// -// - -class KVIRC_API KviKvsCallbackObject : public KviHeapObject -{ -public: - enum CallbackFlags { - // Execute the callback only if the target window exists - // If this flag is not used then if the target window dies - // the callback is executed in another window (the associated console, if possible, otherwise the first available console) - OnlyIfWindowExists = 1 - }; - enum CallbackStatus { - // succesfull execution - Success, - // error in command - Error, - // succesfull execution, but halt encountered - HaltEncountered, - // execution aborted since OnlyIfWindowExists was passed and the target window is dead - TargetWindowDead - }; -public: - KviKvsCallbackObject( - const QString &szCallbackSource, // the name of this callback (should identify its source, like "dialog.message"): displayed in error messages - KviWindow * pTargetWindow, // the window that this callback should be triggered in (can be zero: to execute in the first available console) - const QString &szCallbackCode, // the callback code (may be empty!) - KviKvsVariantList * pMagicParams, // magic parameters that should be passed to the callback (this class makes a copy of them) - unsigned int uFlags = 0 // a combination of CallbackFlags - ); - virtual ~KviKvsCallbackObject(); -protected: - KviKvsScript * m_pScript; // the callback script - KviWindow * m_pTargetWindow; - KviWindow * m_pTargetConsole; - KviKvsVariantList * m_pMagicParams; - unsigned int m_uFlags; -protected: - // the parameter list is always shallow! - CallbackStatus execute(KviKvsVariantList * pParams = 0,KviKvsVariant * pRetVal = 0); -}; - - - -#endif //!_KVI_KVS_CALLBACKOBJECT_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_corecallbackcommands.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_corecallbackcommands.cpp deleted file mode 100644 index c45a8995ac..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_corecallbackcommands.cpp +++ /dev/null @@ -1,1187 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_corecallbackcommands.cpp -// Created on Fri 31 Oct 2003 04:07:58 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_corecallbackcommands.h" - -#include "kvi_kvs_kernel.h" -#include "kvi_kvs_timermanager.h" -#include "kvi_kvs_aliasmanager.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_asyncdnsoperation.h" -#include "kvi_kvs_eventmanager.h" -#include "kvi_kvs_processmanager.h" -#include "kvi_kvs_object_controller.h" - -#include "kvi_cmdformatter.h" -#include "kvi_ircconnectionasyncwhoisdata.h" -#include "kvi_ircconnection.h" -#include "kvi_scriptbutton.h" -#include "kvi_iconmanager.h" -#include "kvi_locale.h" - -#include <qregexp.h> -#include "kvi_tal_tooltip.h" - -namespace KviKvsCoreCallbackCommands -{ - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: ahost - @type: - command - @title: - host - @syntax: - ahost [-i] [-a] (<dnsquery:string>[,<magicdata:variant>]){ <callback command> } - @short: - DNS lookup - @switches: - !sw: --ipv6 | -i - Causes the command to run in IPv6 mode - !sw: --any | -a - Causes the command to run in unspecified mode and lookup both IPv4 and IPv6 addresses - @description: - Starts a DNS lookup for the <dnsquery> and reports the - results by calling the callback routine. - The -i switch causes the command to execute - in IpV6 mode (and lookup ONLY IpV6 hosts!).[br] - The -a switch causes the command to run in "unspecified" mode - and return any available address: IpV4 or Ipv6.[br] - This command also performs reverse lookups (if you pass an IP address as <hostname>).[br] - The callback command gets passed five parameters:[br] - $0 contains the query string (<dnsquery> in fact)[br] - $1 contains the value 1 if the query was succesfull.[br] - In that case the remaining parameters are set as follows:[br] - $2 contains the first ip address associated to the <dnsquery>[br] - $3 contains the hostname associated to the <dnsquery>[br] - $4 contains the eventual <magicdata> passed.[br] - If $1 contains the value 0 then the query has failed and[br] - $2 contains an error message explaining the failure.[br] - $3 is empty[br] - $4 contains the eventual <magicdata> passed.[br] - Please note that if the dns query fails to even start for some - reason then your callback MAY be called even before ahost() returns.[br] - @switches: - !sw: -i - Causes the command to execute in IpV6 mode (and lookup ONLY IpV6 hosts!). - !sw: -a - The -a switch causes the command to run in "unspecified" mode - and return any available address: IpV4 or Ipv6. - @examples: - [example] - ahost("localhost") - { - [cmd]echo[/cmd] "Lookup: "$0; - if($1) - { - [cmd]echo[/cmd] "Ip address: "$2; - [cmd]echo[/cmd] "Hostname: "$3; - } else { - [cmd]echo[/cmd] "Error: $2"; - } - } - ahost -i ("irc.flashnet.it","Hello :)") - { - [cmd]echo[/cmd] "Lookup: "$0; - [cmd]echo[/cmd] "Magic: $3"; - if($1) - { - [cmd]echo[/cmd] "Ip address: "$2; - [cmd]echo[/cmd] "Hostname: "$3; - } else { - [cmd]echo[/cmd] "Error: $2"; - } - } - ahost -a ("cafe:babe::dead:beef") - { - [cmd]echo[/cmd] "Lookup: "$0; - [cmd]echo[/cmd] "Magic: $3"; - if($1) - { - [cmd]echo[/cmd] "Ip address: "$2; - [cmd]echo[/cmd] "Hostname: "$3; - } else { - [cmd]echo[/cmd] "Error: $2"; - } - } - [/example] - @seealso: - [cmd]host[/cmd] - */ - - KVSCCC(ahost) - { - QString szQuery; - KviKvsVariant * pMagicPtr; - KVSCCC_PARAMETERS_BEGIN - KVSCCC_PARAMETER("dnsquery",KVS_PT_NONEMPTYSTRING,0,szQuery) - KVSCCC_PARAMETER("magic",KVS_PT_VARIANT,KVS_PF_OPTIONAL,pMagicPtr) - KVSCCC_PARAMETERS_END - - KviDns::QueryType queryType = KviDns::IpV4; - if(KVSCCC_pSwitches->find('i',"ipv6"))queryType = KviDns::IpV6; - if(KVSCCC_pSwitches->find('a',"any"))queryType = KviDns::Any; - - KviKvsVariant * pMagic = pMagicPtr ? new KviKvsVariant(*pMagicPtr) : new KviKvsVariant(); - - KviKvsAsyncDnsOperation * op = new KviKvsAsyncDnsOperation( - KVSCCC_pContext->window(), - szQuery, - queryType, - new KviKvsScript(*KVSCCC_pCallback), - pMagic); - - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: alias - @title: - alias - @type: - command - @short: - Adds a new alias or modifies an existing one - @syntax: - alias [-q] (<alias_name>) <implementation> - alias [-q] (<alias_name>){} - @switches: - !sw: -q | --quiet - Causes the command to run quietly - @description: - Adds the alias <alias_name> with the specified <implementation> code. - The implementation code can be either a single KVS instruction - or an instruction block (instruction list enclosed in braces).[br] - If the alias was already existing, it is replaced with the - new implementation.[br] - If the <implementation> is empty (eg. "{}" or just a ";") - the alias <alias_name> is removed instead of being added. - If the "remove" form is used but the specified <alias_name> is - not existing in the alias store then a warning is printed unless - the -q (--quiet) switch is used. - If <alias_name> contains a "<name>::" prefix, then the alias - is created in the namespace specified by <name>. - If the namespace is not existing, it is created. - Any alias without the "<name>::" prefix is created in the root - namespace. Namespaces are useful to avoid collisions in alias names - between scripts. Only really common aliases should be created - in the root namespace: all your script internal functionality - should be hidden in your own namespace. - @examples: - [example] - [comment]# Add the alias j[/comment] - alias(j) - { - [cmd]join[/cmd] $0; - } - [comment]# Remove the alias j[/comment] - alias(j){} - [comment]# Add the alias j in namespace letters[/comments] - alias(letters::j) - { - [cmd]echo[/cmd] "j" - } - [/example] - @seealso: - [doc:kvs_aliasesandfunctions]Aliases and functions[/doc] - */ - - /* - @doc: function - @title: - function - @type: - command - @short: - A synomim for alias - @syntax: - function [-q] (<function_name>) <implementation> - function [-q] (<function_name>){} - @switches: - !sw: -q | --quiet - Causes the command to run quietly - @description: - This command is a synonim for [cmd]alias[/cmd]. - @seealso: - [doc:kvs_aliasesandfunctions]Aliases and functions[/doc] - */ - - - KVSCCC(alias) - { - KviKvsVariant * vName = KVSCCC_pParams->first(); - - if(!vName || vName->isEmpty()) - { - KVSCCC_pContext->error(__tr2qs("Missing alias name")); - return false; - } - - QString szName; - vName->asString(szName); - - // we allow only [\w:]+ - QRegExp re("[\\w:]+"); - if(!re.exactMatch(szName)) - { - KVSCCC_pContext->error(__tr2qs("Alias names can contain only letters, digits, underscores and '::' namespace separators")); - return false; - } - - // make sure that we have only doubled "::" and not ":" or ":::..." - QString tmp = szName; - tmp.replace("::","@"); // @ is not allowed by the rule above - if(tmp.find(":") != -1) - { - KVSCCC_pContext->error(__tr2qs("Stray ':' character in alias name: did you mean ...<namespace>::<name> ?")); - return false; - } - - if(tmp.find("@@") != -1) - { - KVSCCC_pContext->error(__tr2qs("Found an empty namespace in alias name")); - return false; - } - - if(KVSCCC_pCallback->code().isEmpty()) - { - if(!KviKvsAliasManager::instance()->remove(szName)) - { - if(!KVSCCC_pSwitches->find('q',"quiet")) - KVSCCC_pContext->warning(__tr2qs("The alias %Q is not existing"),&szName); - } - } else { - KviKvsScript * pScript = new KviKvsScript(*KVSCCC_pCallback); - pScript->setName(szName); - KviKvsAliasManager::instance()->add(szName,pScript); - } - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: awhois - @type: - command - @title: - awhois - @syntax: - awhois [-i] (<nickname:string>[,<magic:variant>]) - { - <callback command> - } - @short: - Asynchronous WHOIS - @switches: - !sw: -i | --idle-time - Ask the whois informations to the server that <nickname> is - connected to, effectively returning the user's idle time. - @description: - AWHOIS stands for Asynchronous WHOIS. It is used to obtain data for a specified - irc user (designated by <nickname>). This command sends a WHOIS query to the - server and silently awaits the sequence of replies. When the "End of WHOIS" message - is received from server the <callback command> is executed passing the WHOIS - information as positional parameters.[br] - The <magic> string is an optional string to be evaluated at AWHOIS execution time. - It is passed as the last positional parameter.[br] - Callback command parameters:[br] - $0 = nickname[br] - $1 = username[br] - $2 = hostname[br] - $3 = realname (may be empty)[br] - $4 = server[br] - $5 = idle time (may be empty)[br] - $6 = signon time (may be empty)[br] - $7 = channels (may be empty)[br] - $8 = server that provided the information[br] - $9 = special information (may be empty)[br] - $10 = magic string evaluated at awhois call (may be empty)[br] - If the -i switch is specified , the whois message is sent to the server - that the <nickname> user is connected to; in this way you will probably - get the idle time of the user too.[br] - If the server replies with a "No such nick/channel error message" the - <callback command> will be still triggered , but will have all the parameters - empty with the exception of $0.[br] - If the connection gets interrupted before all the information have been received, - the <callback command> will never be triggered.[br] - This command is [doc:connection_dependant_commands]connection dependant[/doc].[br] - @examples: - [example] - awhois(pragma){ echo $0-; } - [/example] - */ - - KVSCCC(awhois) - { - QString szNick; - KviKvsVariant * pMagic; - KVSCCC_PARAMETERS_BEGIN - KVSCCC_PARAMETER("nickname",KVS_PT_NONEMPTYSTRING,0,szNick) - KVSCCC_PARAMETER("magic",KVS_PT_VARIANT,KVS_PF_OPTIONAL,pMagic) - KVSCCC_PARAMETERS_END - - KVSCCC_REQUIRE_CONNECTION - - KviQCString szN = KVSCCC_pConnection->encodeText(szNick); - - KviAsyncWhoisInfo * info = new KviAsyncWhoisInfo(); - info->pCallback = new KviKvsScript(*KVSCCC_pCallback); - info->pMagic = pMagic ? new KviKvsVariant(*pMagic) : new KviKvsVariant(); - info->szNick = szNick; - info->pWindow = KVSCCC_pWindow; - - KVSCCC_pConnection->asyncWhoisData()->add(info); - - if(KVSCCC_pSwitches->find('i',"idle-time"))KVSCCC_pConnection->sendFmtData("WHOIS %s %s",szN.data(),szN.data()); - else KVSCCC_pConnection->sendFmtData("WHOIS %s",szN.data()); - - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: button - @title: - button - @type: - command - @short: - Adds/removes/changes user definable buttons - @syntax: - button [-d] [-q] (<type_unused:variant>,<name:string>[,<image_id:string>[,<label_text:string>]]) - { - <callback_code> - } - @switches: - !sw: -d | --disabled - Creates the button as disabled - !sw: -q | --quiet - Run quietly, print no warnings - @description: - Adds a new user defined button with the specified <name>.[br] - [br] - The <type_unused> parameter is ignored and is present only for - backward compatibility. - [br] - The button image is specified by the [doc:image_id]<image_id>[/doc].[br] - The optional button text is specified by <label_text>.[br] - The <callback_code> will be executed as reaction to a button press.[br] - [br] - The "window" type button can be added only to the windows that have a button container: this - actually includes at least console , channels and queries.[br] - The button is added to the current window; if you want to add it to a different - window , use the [doc:command_rebinding]standard -r command rebinding[/doc] switch.[br] - The <callback_code> will be executed as reaction to a button press; the - code execution will be bound to the window that the button is attacched to.[br] - If a button with <name> already exists in the current window, its parameters are changed - according to the passed values (<image_id>, <label_text> and <callback_code>).[br] - [br] - Passing an empty <callback_value> removes the button.[br] - The callback parameters $0 and $1 will contain the screen coordinates of the bottom-left - corner of the button: this is useful for showing a popup menu in response to the click.[br] - If the -q switch is used , this command prints no warnings.[br] - The -d switch causes the button to be disabled (grayed).[br] - @examples: - [example] - button(w,test,-1,Test button){ echo Test!; } - button(w,test){} - [/example] - - */ - - KVSCCC(button) - { - KviKvsVariant * pUnused; - QString szName,szIcon,szLabel; - KVSCCC_PARAMETERS_BEGIN - KVSCCC_PARAMETER("type_unused",KVS_PT_VARIANT,0,pUnused) - KVSCCC_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName) - KVSCCC_PARAMETER("icon",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szIcon) - KVSCCC_PARAMETER("label",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szLabel) - KVSCCC_PARAMETERS_END - - KviScriptUserButton * pButton = 0; - - if(!KVSCCC_pWindow->buttonContainer()) - { - if(!KVSCCC_pSwitches->find('q',"quiet")) - KVSCCC_pContext->warning(__tr2qs("The specified window has no button containers")); - return true; - } - - pButton = (KviScriptUserButton *)(KVSCCC_pWindow->buttonContainer())->child(szName,"KviWindowScriptButton"); - - if(KVSCCC_pCallback->code().isEmpty()) - { - if(pButton)delete pButton; - else { - if(!KVSCCC_pSwitches->find('q',"quiet")) - KVSCCC_pContext->warning(__tr2qs("Window button '%Q' not found"),&szName); - } - return true; - } - - if(!pButton) - { - pButton = new KviWindowScriptButton(KVSCCC_pWindow->buttonContainer(),KVSCCC_pWindow,szName); - pButton->show(); - } - - KviTalToolTip::remove(pButton); - if(!szLabel.isEmpty()) - { - pButton->setButtonText(szLabel); - KviTalToolTip::add(pButton,szLabel); - } - - pButton->setButtonCode(new KviKvsScript(*KVSCCC_pCallback)); - - if(!szIcon.isEmpty()) - { - QPixmap * pix = g_pIconManager->getImage(szIcon); - if(pix) - { - pButton->setButtonPixmap(*pix); - } else { - if(!KVSCCC_pSwitches->find('q',"quiet")) - KVSCCC_pContext->warning(__tr2qs("Can't find the icon '%Q'"),&szIcon); - } - } - - pButton->setEnabled(!(KVSCCC_pSwitches->find('d',"disabled"))); - - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: event - @title: - event - @type: - command - @short: - Adds a new event handler - @syntax: - event [-q] (<event_name>,<handler_name>) - { - <implementation> - } - @switches: - !sw: -q | --quiet - Do not print any warnings - @description: - Adds the handler <handler_name> with <implementation> to - the list of handlers for the event <event_name>.[br] - If the <implementation> is empty - the handler <handler_name> is removed from the handler - list instead of being added.[br] - The <event_name> may be one of the kvirc-builtin event names - or a numeric code (from 0 to 999) of a raw server message.[br] - If the -q switch is specified then the command runs in quiet mode. - @seealso: - [cmd]eventctl[/cmd] - */ - - KVSCCC(event) - { - QString szEventName,szHandlerName; - KVSCCC_PARAMETERS_BEGIN - KVSCCC_PARAMETER("event_name",KVS_PT_NONEMPTYSTRING,0,szEventName) - KVSCCC_PARAMETER("handler_name",KVS_PT_NONEMPTYSTRING,0,szHandlerName) - KVSCCC_PARAMETERS_END - - bool bOk; - int iNumber = szEventName.toInt(&bOk); - bool bIsRaw = (bOk && (iNumber >= 0) && (iNumber < 1000)); - - if(bIsRaw) - { - if(!KviKvsEventManager::instance()->isValidRawEvent(iNumber)) - { - if(!KVSCCC_pSwitches->find('q',"quiet")) - KVSCCC_pContext->warning(__tr2qs("No such event (%Q)"),&szEventName); - return true; - } - } else { - iNumber = KviKvsEventManager::instance()->findAppEventIndexByName(szEventName); - if(!KviKvsEventManager::instance()->isValidAppEvent(iNumber)) - { - if(!KVSCCC_pSwitches->find('q',"quiet")) - KVSCCC_pContext->warning(__tr2qs("No such event (%Q)"),&szEventName); - return true; - } - } - - if(KVSCCC_pCallback->code().isEmpty()) - { - if(bIsRaw) - { - if(!KviKvsEventManager::instance()->removeScriptRawHandler(iNumber,szHandlerName)) - { - if(!KVSCCC_pSwitches->find('q',"quiet")) - KVSCCC_pContext->warning(__tr2qs("No handler '%Q' for raw numeric event '%d'"),&szHandlerName,iNumber); - } - } else { - if(!KviKvsEventManager::instance()->removeScriptAppHandler(iNumber,szHandlerName)) - { - if(!KVSCCC_pSwitches->find('q',"quiet")) - KVSCCC_pContext->warning(__tr2qs("No handler '%Q' for event '%Q'"),&szHandlerName,&szEventName); - } - } - } else { - if(bIsRaw) - { - // remove the old handler - KviKvsEventManager::instance()->removeScriptRawHandler(iNumber,szHandlerName); - QString contextName; - KviQString::sprintf(contextName,"RawEvent%d::%Q",iNumber,&szHandlerName); - KviKvsScriptEventHandler * pHandler = new KviKvsScriptEventHandler(szHandlerName,contextName,KVSCCC_pCallback->code()); - KviKvsEventManager::instance()->addRawHandler(iNumber,pHandler); - } else { - // remove the old handler - KviKvsEventManager::instance()->removeScriptAppHandler(iNumber,szHandlerName); - QString contextName; - KviQString::sprintf(contextName,"%Q::%Q",&szEventName,&szHandlerName); - KviKvsScriptEventHandler * pHandler = new KviKvsScriptEventHandler(szHandlerName,contextName,KVSCCC_pCallback->code()); - KviKvsEventManager::instance()->addAppHandler(iNumber,pHandler); - } - } - - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: exec - @type: - command - @title: - exec - @syntax: - exec [switches] (<commandline:string>[,<magic data:variant>]) - { - <callback command> - } - @short: - Asynchronous execution of external programs - @switches: - !sw: -q | --quiet - Quiet: do not print any warnings - !sw: -t | --trigger-termination - Trigger the termination event - !sw: -x | --trigger-startup - Trigger the startup event - !sw: -n | --no-stdout - Do NOT trigger any stdout events - !sw: -e | --trigger-stderr - Trigger stderr events - !sw: -b | --output-block - Trigger the <callback comand> with the stdout and stderr events exactly once, - passing the complete block of process output. The events are triggered even - if the process output is empty. - !sw: -k=<maximum run time> | --kill-after=<maximum run time> - Kill the process unconditionally after <maximum run time> milliseconds. - If the -t switch is used then the termination event will be - triggered just after the process has been killed. - !sw: -p=<timeout> | --trigger-ping=<timeout> - Trigger <callback command> with "ping" events every <timeout> milliseconds. - !sw: -w | --bind-to-window - Kill the process if the current window is closed. In this case the - termination event is NOT triggered (since the parent window has been lost). - If this switch is not used then the process is rebound to - the active console window and continues running. - !sw: -s=<interpreter command> | --shell=<interpreter command> - Use <interpreter command> instead of the default interpreter "sh -c". - The <interpreter command> should be able to launch the interpeter - and should contain the necessary arguments in order to allow - KVirc to pass the "commandline" by appending it as the last parameter. - !sw: -d | --direct - Use no command interpreter at all: run the command directly. - Takes precedence over -s. - !sw: -q | --quiet - Run quietly - @description: - [b]Overview[/b][br] - Executes the <commandline> by passing it to a command interpreter. - The <commandline> is executed asynchronously: this means that - when exec returns the control to the next command, <commandline> - may be still running.[br] - [br] - [b]The callback[/b][br] - The <callback command> is triggered on several events related to the - child process and it gets passed the following parameters:[br] - $0 = <event cause>[br] - $1 = <event parameter>[br] - $2 = <magic data>[br] - The first parameter specifies the event cause and contains one of the - following strings: "stdout","stderr","terminated","started" and "ping". - [b]By default (if no switches are used) only "stdout" type events are triggered[/b]. - The second parameter depends on the event cause and contains data sensible - to each event type. The third parameter is the eventual <magic data> - passed to the exec command call.[br] - [br] - [b]Interacting with the process[/b][br] - If you use [cmd]halt[/cmd] to terminate - the callback then the slave process is killed immediately and - no other callback events are triggered.[br] If you return some non empty string - then this string will be written to the process stdin stream. This trick - can be used to control interactive processes. Please note that you must - include all the relevant carriage returns and newlines in the return value - (see [fnc]$cr[/fnc] and [fnc]$lf[/fnc]).[br] - [br] - [b]Startup event[/b][br] - If the -x switch is used then the startup event is triggered - just after the process has been succesfully launched. - The $0 parameter passed to the callback contains the string "started". - Parameter $1 contains the pid of the slave process.[br] - [br] - [b]Stdout data event[/b][br] - The stdout data event is triggered when the process prints some output - on its stdout stream. This event is triggered by default and to disable - it you must use the -n switch. $0 contains the string "stdout". - If the -b switch is not used then $1 contains a single line of process - output with the trailing carriage return and/or line feed stripped. - If -b is used then $1 contains the whole process output - block (eventually empty) with all the cr/lf pairs.[br] - [br] - [b]Stderr data event[/b][br] - The stderr data event is similar to the stdout one but there are three differences. - The first one is that the stderr event is NOT triggered by default: you must - use the -e switch to enable it. The second difference is that $0 - contains "stderr" instead of "stdout". The last difference is that $1 contains data - coming from the slave process stderr stream.[br] - [br] - [b]Termination event[/b][br] - The termination event is triggered after the slave process has terminated its - execution. You must use the -t switch to enable it since it is - disabled by default. $0 contains the string "terminated". $1 contains the process exit - status value. (Note that if the process has crashed or has been terminated - by an external singnal then this value will be 0).[br] - [br] - [b]Ping event[/b][br] - The ping event is triggered only if the -p=<timeout> switch is passed.[br] - This event may be useful to monitor the process status while it is not - emitting any output, to write data to its stdin stream (by the means of [cmd]return[/cmd]) - or simply to give some feedback to the user while the slave process is - doing a long computation.[br] - [br] - [b]The extended scope variables[/b][br] - The <callback command> has a set of [doc:data_types]extended scope variables[/doc] - that conserve their value during the whole life time of the slave process.[br] - These variables can be accessed through the %:<varname> syntax and are - useful to store process private data between multiple <callback command> calls.[br] - [b]Some words about the switches[/b][br] - If the -b switch is used then the <callback command> is called only once - for the events stdout and stderr (if enabled) with the complete output block from the process. - With the -b switch the events stdout and stderr are triggered once even if the process - emits no output. - The -s=<interpreter> switch may be used to specify the path of the command interpreter - that is "sh -c" by default on unix machines and "cmd.exe /c" on windows. - The interpreter executable is searched on the system PATH. - If the process can't be started then a warning message is printed in the current window - unless the -q (quiet) flag is used.[br] - [br] - @examples: - [example] - [comment]# Really simple example: print only the stdout of a slave process[/comment] - exec("cat /proc/cpuinfo"){ echo $1; }; - [comment]# Now print only stderr: enable stderr and disable stdout[/comment] - exec -e -n ("sed -senseless"){ echo $1; }; - [comment]# Do it another way: enable stderr and filter out stdout[/comment] - exec -e ("sed -senseless"){ if($0 == "stderr")echo $1; } - [comment]# Now enable all (almost) events and print them[/comment] - exec -e -t -s ("cat /proc/cpuinfo && sed -senseless"){ echo [event:$0] $1; } - [comment]# Now see what happens if -b is used[/comment] - exec -b -e -t -s ("cat /proc/cpuinfo && sed -senseless"){ echo [event:$0] $1; } - [comment]# Run an iterative script and kill it after 20 seconds[/comment] - exec -k=20000 ("while true; do sleep 1; echo \"Tic\"; done"){ echo [event:$0] $1; } - [comment]# Run a blocking process, kill it after 20 seconds[/comment] - [comment]# and give feedback to the user by the means of ping[/comment] - exec -k=20000 -p=1000 -t ("cat") - { - if($0 == "ping")echo "[event:$0] Please wait while doing a huge computation ..." - else if($0 == "terminated")echo "[event:$0] Ok, done :)" - } - [comment]# Do the same but this time use the extended scope vars[/comment] - [comment]# Use also a nicer syntax[/comment] - exec -k=20000 -p=1000 -t ("cat") - { - switch($0) - { - case("ping"): - { - if(%:x == 1) - { - %:x = 0; - echo "Tic!" - } else { - %:x = 1; - echo "Tac!" - } - } - break; - case("terminated"): - { - echo "Ok, done :)" - } - break; - } - } - [comment]# Again do the same but kill the process explicitly[/comment] - exec -x -p=1000 -t ("cat") - { - switch($0) - { - case("started"): - { - [comment]# Initialize the counter[/comment] - %:x = 10; - } - break; - case("ping"): - { - echo %:x - %:x-- - [comment]# When the counter reaches zero, kill the process with halt[/comment] - if(%:x == 0)halt; - } - break; - case("terminated"): - { - echo "Boom!" - } - break; - } - } - [comment]# Now play with an interactive process[/comment] - [comment]# WARNING: Please note that spam is illegal and generates bad karma[/comment] - [comment]# Try it only with your own e-mail address as recipient[/comment] - exec -s -k=60000 -t ("telnet my.mail.server.com 25") - { - if($0 == "started") - { - %:state = 0 - [comment]# Returning an empty string does not write to stdin[/comment] - return - } - - if($1 == "stderr") - { - echo "[stderr] $1" - return - } - - if($1 == "terminated") - { - echo "[process terminated]" - return - } - - echo "[stdout] $1" - - switch(%:state) - { - case(0): - { - [comment]# Waiting for 220 (ready)[/comment] - if($str.match("220*",$1)) - { - %:state++ - echo "Sending HELO..." - return "HELO myhostname$cr$lf"; - } - } - break - case(1): - { - [comment]# Waiting for 250 (after the HELO)[/comment] - if($str.match("250*",$1)) - { - %:state++ - echo "Sending MAIL..." - return "MAIL From: <myname@mydomain.com>$cr$lf" - } else { - echo "HELO command not accepted: $1" - halt - } - } - break; - case(2): - { - [comment]# Waiting for another 250 (MAIL accepted)[/comment] - if($str.match("250*",$1)) - { - %:state++ - echo "Sending RCPT..." - return "RCPT To: <me@myself.org>$cr$lf" - } else { - echo "MAIL command not accepted: $1" - halt - } - } - break; - case(3): - { - [comment]# Waiting for another 250 (RCPT accepted)[/comment] - if($str.match("250*",$1)) - { - %:state++ - echo "Sending DATA..." - return "DATA$cr$lf" - } else { - echo "RCPT not accepted: $1" - halt - } - } - break; - case(4): - { - [comment]# Waiting for 354 (ok, go on)[/comment] - if($str.match("354*",$1)) - { - %:state++ - echo "Sending body..." - return "This is a test message :)$cr$lf$cr$lf.$cr$lf" - } else { - echo "Mail body not accepted: $1" - halt - } - } - break; - case(5): - { - [comment]# We don't wait anymore :)[/comment] - %:state++ - echo "Sending QUIT..." - return "QUIT$cr$lf" - } - break; - default: - { - [comment]# Usually the mail server closes the connection[/comment] - %:state++ - if(%:state > 10) - { - [comment]# But if it does not in few messages[/comment] - [comment]# Then force the process to die[/comment] - halt - } - } - } - } - [/example] - */ - - KVSCCC(exec) - { - QString szCommandline; - KviKvsVariant * pMagic; - KVSCCC_PARAMETERS_BEGIN - KVSCCC_PARAMETER("commandline",KVS_PT_NONEMPTYSTRING,0,szCommandline) - KVSCCC_PARAMETER("magic",KVS_PT_VARIANT,KVS_PF_OPTIONAL,pMagic) - KVSCCC_PARAMETERS_END - - int f = 0; - - if(KVSCCC_pSwitches->find('t',"trigger-termination") != 0)f |= KVI_KVS_PROCESSDESCRIPTOR_TRIGGERTERMINATED; - if(KVSCCC_pSwitches->find('n',"no-stdout") == 0)f |= KVI_KVS_PROCESSDESCRIPTOR_TRIGGERSTDOUT; - if(KVSCCC_pSwitches->find('e',"trigger-stderr") != 0)f |= KVI_KVS_PROCESSDESCRIPTOR_TRIGGERSTDERR; - if(KVSCCC_pSwitches->find('x',"trigger-startup") != 0)f |= KVI_KVS_PROCESSDESCRIPTOR_TRIGGERSTARTED; - if(KVSCCC_pSwitches->find('b',"output-block") != 0)f |= KVI_KVS_PROCESSDESCRIPTOR_OUTPUTBYBLOCKS; - if(KVSCCC_pSwitches->find('w',"bind-to-window") != 0)f |= KVI_KVS_PROCESSDESCRIPTOR_KILLIFNOWINDOW; - if(KVSCCC_pSwitches->find('d',"direct") != 0)f |= KVI_KVS_PROCESSDESCRIPTOR_NOSHELL; - - QString szShell; - KVSCCC_pSwitches->getAsStringIfExisting('s',"shell",szShell); - - kvs_int_t iPingTime = 0; - kvs_int_t iMaxRunTime = 0; - - KviKvsVariant * pPing = KVSCCC_pSwitches->find('p',"trigger-ping"); - if(pPing) - { - if(!(pPing->asInteger(iPingTime) && iPingTime > 0)) - { - KVSCCC_pContext->warning(__tr2qs("The specified ping time is invalid: assuming zero (no ping)")); - iPingTime = 0; - } - } - - KviKvsVariant * pKill = KVSCCC_pSwitches->find('k',"kill-after"); - if(pKill) - { - if(!(pKill->asInteger(iMaxRunTime) && iMaxRunTime > 0)) - { - KVSCCC_pContext->warning(__tr2qs("The specified maximum run time is invalid: assuming zero (infinite)")); - iMaxRunTime = 0; - } - } - - KviKvsProcessDescriptorData * d = new KviKvsProcessDescriptorData; - - d->szCommandline = szCommandline; - d->szShell = szShell; - d->pWnd = KVSCCC_pContext->window(); - d->pMagic =pMagic ? new KviKvsVariant(*pMagic) : 0; - d->iFlags = f; - d->pCallback = new KviKvsScript(*KVSCCC_pCallback); - d->iMaxRunTime = iMaxRunTime; - d->iPingTimeout = iPingTime; - - KviKvsProcessAsyncOperation * op = new KviKvsProcessAsyncOperation(d); - if(!op->start()) - { - if(KVSCCC_pSwitches->find('q',"quiet") == 0)KVSCCC_pContext->warning(__tr2qs("Failed to start the process")); - delete op; - } - - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: privateimpl - @title: - privateimpl - @type: - command - @short: - Adds a private implementation of a function - @syntax: - privateimpl(<object_handle>,<function_name>)<implementation> - @description: - Adds a private implementation of function <function_name> to the - existing object designed by <object_handle>. - <implementation> must be a valid command sequence.[br] - Side note:[br] - This command can not succesfully implement - the "constructor" function since it must be called - after this one has already been executed.[br] - To implement a constructor you MUST write your own class definition.[br] - @seealso: - [cmd]class[/cmd], - [doc:objects]Objects documentation[/doc] - */ - - KVSCCC(privateimpl) - { - kvs_hobject_t hObject; - QString szFunctionName; - KVSCCC_PARAMETERS_BEGIN - KVSCCC_PARAMETER("object_handle",KVS_PT_HOBJECT,0,hObject) - KVSCCC_PARAMETER("function_name",KVS_PT_NONEMPTYSTRING,0,szFunctionName) - KVSCCC_PARAMETERS_END - - KviKvsObject * o = KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if(!o) - { - KVSCCC_pContext->error(__tr2qs("The specified object does not exist")); - return false; - } - - o->registerPrivateImplementation(szFunctionName,KVSCCC_pCallback->code()); - - return true; - } - - - ///////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: timer - @title: - timer - @type: - command - @short: - Starts a timer - @syntax: - timer [-s] [-p] (<name>,<delay_in_msecs>[,<callback_param1>[,<callback_param2>[,...]]]) - { - <callback_command> - } - @switches: - !sw: -s | --single-shot - Causes the timer to trigger only once (single shot timer) - !sw: -p | --persistent - Creates a persistent timer bound to any existing window - @description: - Starts a new timer named <name> with the specified delay (in milliseconds).[br] - The timer periodically calls the specified <callback_command> code passing the - eventual <callback_param> strings as positional parameters.[br] - If a timer with the same name already exists, it is replaced by this one.[br] - [b]The <callback_command> is evaluated at timer "shot" time and NOT while - this command is being parsed. This means that the identifiers that you put - inside <callback_command> will NOT have the current values.[/b] - The values will be assigned at timer "shot" time.[br] - This is a common scripters error and problem: if it is not clear, look at the examples below.[br] - The timer is bound to the window in that this command is executed in.[br] - If the window gets destroyed, the timer is stopped; unless the -p switch is used.[br] - The -p switch causes the timer to be persistent across the application and exists until - the last window has been closed: it is basically rebound to another (random) window when the - original window is destroyed.[br] - The -s switch cuases this timer to trigger only once: it will be automatically destroyed after that.[br] - The time has an associated set of [doc:data_structures]extended scope variables[/doc]: - the variables that begin with "%:" have their life extended to the whole "life" of the timer.[br] - Using a very low delay is a common method to perform some background processing: you - basically split a huge job in small slices and execute them when the timer is triggered - until you run out of slices. A delay of 0 will cause the timer to be called whenever - KVIrc has some "idle time" to spend. - On the other hand, remember that timers are precious resources: many timers running - with a very low delay will cause KVIrc to slow down.[br] - Since all the kvirc timers share the same namespace it is a good idea to use - descriptive timer names: a timer named "a" is likely to be used by two or more scripts - at once causing one (or both) of them to fail.[br] - A timer can be stopped at any time by using the [cmd]killtimer[/cmd] command. - @seealso: - [cmd]killtimer[/cmd] - @examples: - [example] - [comment]# Just a plain timer[/comment] - timer(test,1000){ echo "Hello!"; } - [comment]# Now watch the timer running[/comment] - killtimer test - [comment]# Single shot timer[/comment] - timer -s (test,1000){ echo "This will fire only once!"; } - [comment]# The call above is equivalent to[/comment] - timer(test,1000){ echo "This will file only once!"; killtimer test; } - [comment]# Callback parameters: consider the following code[/comment] - %parameter = "some string value" - echo "Before calling /timer \%parameter is \"%parameter\"" - timer -s (test,1000,%parameter){ echo "inside the callback \%parameter is \"%parameter\" but \$0 is \"$0\""; } - [comment]# watch the timer running , and note the behaviour of the %parameter variable[/comment] - killtimer test - [comment]# Use the extended scope timer variables[/comment] - timer(test,1000) - { - [comment]# Use the extended scope %:count variable to keep track[/comment] - [comment]# of the times that this timer has been called[/comment] - [cmd]if[/cmd]("%:count" == "")%:count = 1 - else %:count++ - [cmd]echo[/cmd] "This timer has fired %:count times" - if(%:count == 10) - { - # This will kill the current timer, we don't need to specify the name - [cmd]killtimer[/cmd] - } - } - [comment]# Use isTimer to check if the timer exists[/comment] - [cmd]echo[/cmd] [fnc]$isTimer[/fnc](test) - [comment]# Repeat the command above after the 10th timeout...[/comment] - [/example] - */ - - KVSCCC(timer) - { - KviKvsVariant * vName = KVSCCC_pParams->first(); - KviKvsVariant * vDelay = KVSCCC_pParams->next(); - - if(!vName || vName->isEmpty()) - { - KVSCCC_pContext->error(__tr2qs("Missing timer name")); - return false; - } - - QString szName; - vName->asString(szName); - - if(!vDelay) - { - KVSCCC_pContext->error(__tr2qs("Missing timeout delay")); - return false; - } - - kvs_int_t iDelay; - if(!vDelay->asInteger(iDelay)) - { - KVSCCC_pContext->error(__tr2qs("The timeout delay didn't evaluate to an integer")); - return false; - } - - KviKvsTimer::Lifetime lt; - - if(KVSCCC_pSwitches->find('s',"single-shot"))lt = KviKvsTimer::SingleShot; - else if(KVSCCC_pSwitches->find('p',"persistent"))lt = KviKvsTimer::Persistent; - else lt = KviKvsTimer::WindowLifetime; - - // prepare the callback parameters - KviKvsVariantList * l = new KviKvsVariantList(); - l->setAutoDelete(true); - - KviKvsVariant * v = KVSCCC_pParams->next(); - while(v) - { - l->append(new KviKvsVariant(*v)); // copy - v = KVSCCC_pParams->next(); - } - - if(!KviKvsTimerManager::instance()->addTimer(szName,lt,KVSCCC_pContext->window(),iDelay,new KviKvsScript(*KVSCCC_pCallback),l)) - { - KVSCCC_pContext->error(__tr2qs("Unable to add the timer: insufficient system resources")); - return false; - } - - return true; - } - - - void init() - { - KviKvsKernel * pKern = KviKvsKernel::instance(); - -#define _REGCMD(__cmdName,__routine) \ - { \ - KviKvsCoreCallbackCommandExecRoutine * r = new KviKvsCoreCallbackCommandExecRoutine; \ - r->proc = KVI_PTR2MEMBER(KviKvsCoreCallbackCommands::__routine); \ - pKern->registerCoreCallbackCommandExecRoutine(QString(__cmdName),r); \ - } - -#ifdef COMPILE_NEW_KVS - _REGCMD("ahost",ahost); - _REGCMD("awhois",awhois); -#endif - _REGCMD("alias",alias); -#ifdef COMPILE_NEW_KVS - _REGCMD("button",button); - _REGCMD("event",event); - _REGCMD("exec",exec); - _REGCMD("privateimpl",privateimpl); -#endif - _REGCMD("function",alias); - _REGCMD("timer",timer); - -#undef _REGCMD - } -}; diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_corecallbackcommands.h b/3.4.0/src/kvirc/kvs/kvi_kvs_corecallbackcommands.h deleted file mode 100644 index 42632b83d3..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_corecallbackcommands.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef _KVI_KVS_CORECALLBACKCOMMANDS_H_ -#define _KVI_KVS_CORECALLBACKCOMMANDS_H_ -//============================================================================= -// -// File : kvi_kvs_corecallbackcommands.h -// Created on Fri 31 Oct 2003 04:07:58 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_switchlist.h" -#include "kvi_kvs_script.h" -#include "kvi_kvs_parameterprocessor.h" - - -#define KVSCCC(_name) bool _name(KviKvsRunTimeContext * __pContext,KviKvsVariantList * __pParams,KviKvsSwitchList * __pSwitches,const KviKvsScript * __pCallback) - -#define KVSCCC_pContext __pContext -#define KVSCCC_pParams __pParams -#define KVSCCC_pSwitches __pSwitches -#define KVSCCC_pCallback __pCallback - -#define KVSCCC_PARAMETER(a,b,c,d) KVS_PARAMETER(a,b,c,d) - -#define KVSCCC_PARAMETERS_BEGIN \ - KVS_PARAMETERS_BEGIN(parameter_format_list) - -#define KVSCCC_PARAMETERS_END \ - KVS_PARAMETERS_END \ - if(!KviKvsParameterProcessor::process(KVSCCC_pParams,KVSCCC_pContext,parameter_format_list))return false; - -#define KVSCCC_REQUIRE_CONNECTION \ - if(!KVSCCC_pContext->window()->context())return KVSCCC_pContext->errorNoIrcContext(); \ - if(!KVSCCC_pContext->window()->connection())return KVSCCC_pContext->warningNoIrcConnection(); - -#define KVSCCC_pWindow __pContext->window() -#define KVSCCC_pConnection __pContext->window()->connection() -#define KVSCCC_pIrcContext __pContext->context() - - -namespace KviKvsCoreCallbackCommands -{ -#ifdef COMPILE_NEW_KVS - KVSCCC(ahost); - KVSCCC(awhois); -#endif - KVSCCC(alias); -#ifdef COMPILE_NEW_KVS - KVSCCC(button); - KVSCCC(event); - KVSCCC(exec); - KVSCCC(privateimpl); -#endif - KVSCCC(timer); - - void init(); -}; - -#endif //!_KVI_KVS_CORECALLBACKCOMMANDS_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions.cpp deleted file mode 100644 index c7b3bff306..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions.cpp +++ /dev/null @@ -1,156 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_corefunctions.cpp -// Created on Fri 31 Oct 2003 01:52:04 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_corefunctions.h" - -#include "kvi_kvs_kernel.h" -#include "kvi_kvs_object.h" - -#include "kvi_locale.h" - -namespace KviKvsCoreFunctions -{ - void init() - { - KviKvsKernel * pKern = KviKvsKernel::instance(); - -#define _REGFNC(__fncName,__routine) \ - { \ - KviKvsCoreFunctionExecRoutine * r = new KviKvsCoreFunctionExecRoutine; \ - r->proc = KVI_PTR2MEMBER(KviKvsCoreFunctions::__routine); \ - pKern->registerCoreFunctionExecRoutine(QString(__fncName),r); \ - } - - // a_f - _REGFNC("active",active) - _REGFNC("array",array) - _REGFNC("ascii",unicode) - _REGFNC("asciiToHex",asciiToHex) - _REGFNC("asciiToBase64",asciiToBase64) - _REGFNC("away",away) - _REGFNC("b",b) - _REGFNC("base64ToAscii",base64ToAscii) - _REGFNC("bool",boolean) - _REGFNC("boolean",boolean) - _REGFNC("channel",channel) - _REGFNC("char",charCKEYWORDWORKAROUND) - _REGFNC("classDefined",classDefined) - _REGFNC("console",console) - _REGFNC("context",context) - _REGFNC("cr",cr) - _REGFNC("date",date) - _REGFNC("false",falseCKEYWORDWORKAROUND) - _REGFNC("features",features) - _REGFNC("firstConnectedConsole",firstConnectedConsole) - _REGFNC("flatten",flatten) - _REGFNC("fmtlink",fmtlink) - // g_l - _REGFNC("hash",hash); -// _REGFNC("inputText",inputText); - _REGFNC("hexToAscii",hexToAscii); - _REGFNC("hostname",hostname); - _REGFNC("hptimestamp",hptimestamp); - _REGFNC("ic",context); - _REGFNC("icon",icon); - _REGFNC("iconName",iconName); - _REGFNC("int",integer) - _REGFNC("integer",integer) - _REGFNC("isEmpty",isEmpty) - _REGFNC("isEventEnabled",isEventEnabled) - _REGFNC("isMainWindowActive",isMainWindowActive) - _REGFNC("isMainWindowMinimized",isMainWindowMinimized) - _REGFNC("isNumeric",isNumeric) - _REGFNC("isSet",isSet) - _REGFNC("isTimer",isTimer) - _REGFNC("isWellKnown",isWellKnown) - _REGFNC("k",k) - _REGFNC("keys",keys) - _REGFNC("lag",lag) - _REGFNC("lang",lang) - _REGFNC("length",length) - _REGFNC("lf",lf) - // m_r - _REGFNC("mask",mask) - _REGFNC("me",me) - _REGFNC("msgtype",msgtype) - _REGFNC("new",newCKEYWORDWORKAROUND) - _REGFNC("nothing",nothing) - _REGFNC("null",nullCKEYWORDWORKAROUND) - _REGFNC("o",o) - _REGFNC("option",option) - _REGFNC("query",query) - _REGFNC("r",r) - _REGFNC("rand",rand) - _REGFNC("real",real) - _REGFNC("receivedBytes",receivedBytes) - _REGFNC("rsort",rsort) - // s_z - _REGFNC("selected",selected) - _REGFNC("sentBytes",sentBytes) - _REGFNC("serialize",serialize) - _REGFNC("server",server) - _REGFNC("sort",sort) - _REGFNC("string",string) - _REGFNC("sw",sw) - _REGFNC("target",target) - _REGFNC("this",thisCKEYWORDWORKAROUND) - _REGFNC("tr",tr) - _REGFNC("true",trueCKEYWORDWORKAROUND) - _REGFNC("typeof",typeofCKEYWORDWORKAROUND) - _REGFNC("u",u) - _REGFNC("unicode",unicode) - _REGFNC("unixtime",unixtime) - _REGFNC("unserialize",unserialize) - _REGFNC("username",username) - _REGFNC("version",version) - _REGFNC("window",window) - _REGFNC("$",thisCKEYWORDWORKAROUND) - _REGFNC("@",strayAt) - _REGFNC("@?",mightBeStrayAtOrThis) -#undef _REGCMD - } - - static QString g_szStaticStrayConstantAt("@"); - - KVSCF(strayAt) - { - KVSCF_pRetBuffer->setString(g_szStaticStrayConstantAt); - return true; - } - - KVSCF(mightBeStrayAtOrThis) - { - KviKvsObject * o = KVSCF_pContext->thisObject(); - if(o) - { - KVSCF_pRetBuffer->setHObject(o->handle()); - } else { - KVSCF_pRetBuffer->setString(g_szStaticStrayConstantAt); - } - return true; - } -}; - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions.h b/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions.h deleted file mode 100644 index f04f83dd8b..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions.h +++ /dev/null @@ -1,148 +0,0 @@ -#ifndef _KVI_KVS_COREFUNCTIONS_H_ -#define _KVI_KVS_COREFUNCTIONS_H_ -//============================================================================= -// -// File : kvi_kvs_corefunctions.h -// Created on Fri 31 Oct 2003 01:52:04 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_variant.h" -#include "kvi_kvs_parameterprocessor.h" - - -#define KVSCF(_name) bool _name(KviKvsRunTimeContext * __pContext,KviKvsVariantList * __pParams,KviKvsVariant * __pRetBuffer) - -#define KVSCF_pContext __pContext -#define KVSCF_pParams __pParams -#define KVSCF_pRetBuffer __pRetBuffer - -#define KVSCF_PARAMETER(a,b,c,d) KVS_PARAMETER(a,b,c,d) - -#define KVSCF_PARAMETERS_BEGIN \ - KVS_PARAMETERS_BEGIN(parameter_format_list) - -#define KVSCF_PARAMETERS_END \ - KVS_PARAMETERS_END \ - if(!KviKvsParameterProcessor::process(KVSCF_pParams,KVSCF_pContext,parameter_format_list))return false; - - -namespace KviKvsCoreFunctions -{ - // a_f - KVSCF(active); - KVSCF(array); - KVSCF(asciiToBase64); - KVSCF(asciiToHex); - KVSCF(avatar); - KVSCF(away); - KVSCF(b); - KVSCF(base64ToAscii); - KVSCF(boolean); - KVSCF(channel); - KVSCF(charCKEYWORDWORKAROUND); - KVSCF(classDefined); - KVSCF(console); - KVSCF(context); - KVSCF(cr); - KVSCF(date); - KVSCF(falseCKEYWORDWORKAROUND); - KVSCF(features); - KVSCF(firstConnectedConsole); - KVSCF(flatten); - KVSCF(fmtlink); - - // g_l - KVSCF(hash); - KVSCF(inputText); - KVSCF(hexToAscii); - KVSCF(hostname); - KVSCF(hptimestamp); - KVSCF(icon); - KVSCF(iconName); - KVSCF(integer); - KVSCF(isAnyConsoleConnected); - KVSCF(isEmpty); - KVSCF(isEventEnabled); - KVSCF(isNumeric); - KVSCF(isMeOp); - KVSCF(isMeUserOp); - KVSCF(isMeHalfOp); - KVSCF(isMeVoice); - KVSCF(isMainWindowActive); - KVSCF(isMainWindowMinimized); - KVSCF(isSet); - KVSCF(isTimer); - KVSCF(isWellKnown); - KVSCF(k); - KVSCF(keys); - KVSCF(lag); - KVSCF(lang); - KVSCF(length); - KVSCF(lf); - // m_r - KVSCF(mask); - KVSCF(me); - KVSCF(msgtype); - KVSCF(newCKEYWORDWORKAROUND); - KVSCF(nothing); - KVSCF(nullCKEYWORDWORKAROUND); - KVSCF(o); - KVSCF(option); - KVSCF(query); - KVSCF(r); - KVSCF(rand); - KVSCF(real); - KVSCF(receivedBytes); - KVSCF(rsort); - // s_z - KVSCF(selected); - KVSCF(sentBytes); - KVSCF(serialize); - KVSCF(server); - KVSCF(sort); - KVSCF(split); - KVSCF(string); - KVSCF(sw); - KVSCF(target); - KVSCF(thisCKEYWORDWORKAROUND); - KVSCF(timeCFUNCTIONWORKAROUND); - KVSCF(tr); - KVSCF(trueCKEYWORDWORKAROUND); - KVSCF(typeofCKEYWORDWORKAROUND); - KVSCF(u); - KVSCF(unicode); - KVSCF(unixtime); - KVSCF(unserialize); - KVSCF(username); - KVSCF(version); - KVSCF(window); - // specials - KVSCF(strayAt); - KVSCF(mightBeStrayAtOrThis); - //bool redirectToModule(const QString &szFrom,const QString &szModName,const QString &szFuncName - - void init(); -}; - -#endif //!_KVI_KVS_COREFUNCTIONS_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions_af.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions_af.cpp deleted file mode 100644 index 473a8e2a5a..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions_af.cpp +++ /dev/null @@ -1,1131 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_corefunctions_af.cpp -// Created on Fri 31 Oct 2003 01:52:04 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_corefunctions.h" - -#include "kvi_kvs_kernel.h" -#include "kvi_kvs_object_controller.h" - -#include "kvi_locale.h" -#include "kvi_app.h" -#include "kvi_channel.h" -#include "kvi_console.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_mirccntrl.h" -#include "kvi_avatar.h" -#include "kvi_ircuserdb.h" -#include "kvi_time.h" - -namespace KviKvsCoreFunctions -{ - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: active - @type: - function - @title: - $active - @short: - Retrieves the window ID of the active window - @syntax: - <integer> $active[(<irc context id:integer>)] - @description: - Returns the [b]window ID[/b] of the active window - bound to the IRC context specified by <irc context id>. - If no window matches the specified IRC context, and invalid - window ID is returned (0).[br] - If no <irc context id> is specified, then - the application active window is returned (the window - that currently has the input focus). Note that in this - case the returned window may also belong to another IRC - context or be not bound to any IRC context at all. - In some extreme cases you may even get a window that - has no output widget and thus has its output redirected. - Using the "global" active window should be used only - for communicating something REALLY urgent (and maybe - unrelated to a specific IRC connection) to the user. - @seealso: - [fnc]$window[/fnc] - */ - - KVSCF(active) - { - kvs_uint_t uContextId; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("context_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uContextId) - KVSCF_PARAMETERS_END - - KviWindow * wnd; - KviConsole * cons; - if(KVSCF_pParams->count() > 0) - { - cons = g_pApp->findConsole(uContextId); - if(cons)wnd = cons->activeWindow(); - else wnd = 0; - } else { - wnd = g_pActiveWindow; - } - - KVSCF_pRetBuffer->setInteger((kvs_int_t)(wnd ? wnd->numericId() : 0)); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: ascii - @type: - function - @title: - $ascii - @short: - Returns the UNICODE code of a character - @syntax: - <variant> $ascii(<char:string>) - @description: - This function has been renamed to $unicode and is present - only for backward compatibility. - @seealso: - [fnc]$cr[/fnc], [fnc]$lf[/fnc], [fnc]$char[/fnc] - */ - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: asciiToBase64 - @type: - function - @title: - $asciiToBase64 - @short: - Returns an encoded base64 string - @syntax: - $asciiToBase64(<ascii_string>) - @description: - Encodes an ASCII string to its base64 encoded rappresentation - Please note that since KVS is UNICODE based, this function - will first encode the string in UTF8 and then base64-encode. - This means that it is substantially only 7bit safe (ASCII codes below 128). - @examples: - [cmd]echo[/cmd] $asciiToBase64("Hello!") - @seealso: - [fnc]$base64toascii[/fnc] - */ - - KVSCF(asciiToBase64) - { - QString szAscii; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("ascii_string",KVS_PT_STRING,0,szAscii) - KVSCF_PARAMETERS_END - - KviStr tmp1(szAscii); - if(tmp1.len() > 0) - { - KviStr tmp2; - tmp2.bufferToBase64(tmp1.ptr(),tmp1.len()); - KVSCF_pRetBuffer->setString(QString(tmp2.ptr())); - } else { - KVSCF_pRetBuffer->setString(QString::null); - } - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: asciiToHex - @type: - function - @title: - $asciiToHex - @short: - Returns an encoded hex string - @syntax: - <string> $asciiToHex(<ascii_string:string>) - @description: - Encodes an ASCII string to its hex encoded rappresentation. - Please note that since KVS is UNICODE based, this function - will first encode the string in UTF8 and then hex-encode. - This means that it is substantially only 7bit safe (ASCII codes below 128). - @examples: - [cmd]echo[/cmd] $asciiToHex("Hello!") - @seealso: - [fnc]$hextoascii[/fnc] - */ - - KVSCF(asciiToHex) - { - QString szAscii; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("ascii_string",KVS_PT_STRING,0,szAscii) - KVSCF_PARAMETERS_END - - KviStr tmp1(szAscii); - if(tmp1.len() > 0) - { - KviStr tmp2; - tmp2.bufferToHex(tmp1.ptr(),tmp1.len()); - KVSCF_pRetBuffer->setString(QString(tmp2.ptr())); - } else { - KVSCF_pRetBuffer->setString(QString::null); - } - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: array - @type: - function - @title: - $array - @short: - Explicitly creates an array - @syntax: - <array> $array(<item:variant>,<item:variant>,<item:variant>,....); - @description: - Returns an array with the specified items. The items are indexed starting from 0. - This is just an explicit way of creating an array with a defined set of items, - useful for increasing readability. - @examples: - [example] - [cmd]alias[/cmd](test) { - [cmd]return[/cmd] $array(1,2,3); - } - %x = $test(); - [cmd]foreach[/cmd](%y,%x) { - [cmd]echo[/cmd] %y; - } - [/example] - @seealso: - [fnc]$hash[/fnc] - */ - - KVSCF(array) - { -#ifdef COMPILE_NEW_KVS - KviKvsArray * a = new KviKvsArray(); - kvs_int_t idx = 0; - - for(KviKvsVariant * v = KVSCF_pParams->first();v;v = KVSCF_pParams->next()) - { - a->set(idx,new KviKvsVariant(*v)); - idx++; - } - - KVSCF_pRetBuffer->setArray(a); -#endif - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: away - @type: - function - @title: - $away - @short: - Returns true if the current user is away - @syntax: - <boolean> $away - @description: - Returns true if the current user is away, else false. - If the current IRC context is not connected at all, this function returns false. - */ - - KVSCF(away) - { - kvs_uint_t uCntx; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("irc_context_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uCntx) - KVSCF_PARAMETERS_END - - KviConsole * cns; - - if(KVSCF_pParams->count() > 0) - { - cns = g_pApp->findConsole(uCntx); - if(cns) - { - if(cns->context()->isConnected()) - KVSCF_pRetBuffer->setBoolean(cns->connection()->userInfo()->isAway()); - else - KVSCF_pRetBuffer->setNothing(); - } else { - KVSCF_pRetBuffer->setNothing(); - } - } else { - if(KVSCF_pContext->window()->console()) - { - cns = KVSCF_pContext->window()->console(); - if(cns->context()->isConnected()) - KVSCF_pRetBuffer->setBoolean(cns->connection()->userInfo()->isAway()); - else - KVSCF_pRetBuffer->setNothing(); - } else { - KVSCF_pContext->warning(__tr2qs("This window has no associated IRC context")); - KVSCF_pRetBuffer->setNothing(); - } - } - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: b - @type: - function - @title: - $b - @short: - Returns the BOLD mIRC control character - @syntax: - <string> $b - @description: - Returns the BOLD mIRC control character (CTRL+B).[br] - @seealso: - [fnc]$k[/fnc], [fnc]$u[/fnc] - */ - - KVSCF(b) - { - KVSCF_pRetBuffer->setString(QString(QChar(KVI_TEXT_BOLD))); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: base64toAscii - @type: - function - @title: - $base64ToAscii - @short: - Returns a decoded base64 string - @syntax: - <string> $base64ToAscii(<base_64_encoded_string:string>) - @description: - Decodes a base64 encoded string. - @seealso: - [fnc]$asciiToBase64[/fnc] - */ - - KVSCF(base64ToAscii) - { - QString szBase64; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("base64_encoded_string",KVS_PT_STRING,0,szBase64) - KVSCF_PARAMETERS_END - - KviStr tmp1(szBase64); - char * buf; - int len = tmp1.base64ToBuffer(&buf,true); - KVSCF_pRetBuffer->setString(QString(buf)); - KviStr::freeBuffer(buf); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: boolean - @type: - function - @title: - $boolean - @short: - Casts a variable to a boolean - @syntax: - <integer> $boolean(<data:variant>) - @description: - Forces <data> to be a boolean data type by first casting - to integer (see [fnc]$int[/fnc]()) and then comparing the result against zero. - A zero integer will result in a false value while a non-zero one - will result in a true value. - This function is similar to the C++ (bool) cast and is internally - aliased to [fnc]$bool[/fnc] too. - Note that since KVIrc does most of the casting work automatically - you shouldn't need to use this function. - @seealso: - [fnc]$real[/fnc] - [fnc]$integer[/fnc] - */ - - /* - @doc: bool - @type: - function - @title: - $bool - @short: - Casts a variable to a boolean - @syntax: - <integer> $bool(<data:variant>) - @description: - This is an internal alias to [fnc]$boolean[/fnc](). - @seealso: - [fnc]$real[/fnc] - [fnc]$integer[/fnc] - */ - - KVSCF(boolean) - { - KviKvsVariant * v; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("data",KVS_PT_VARIANT,0,v) - KVSCF_PARAMETERS_END - - kvs_int_t iVal; - v->castToInteger(iVal); - KVSCF_pRetBuffer->setBoolean(iVal); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: channel - @type: - function - @title: - $channel - @short: - Retrieves the window ID of a specified channel - @syntax: - $channel[(<channel name>[,<irc context id>])] - @description: - Returns the [b]window ID[/b] of channel matching the - <channel name> and bound to the connection specified by - <irc context id>[br] - If no window matches the specified name or connection, an invalid - window ID is returned (0).[br] - If no <irc context id> is specified, this function looks for - the channel in the current connection context (if any).[br] - If no <channel name> is specified, this function returns the current - channel window ID, if executed in a channel, else 0.[br] - @seealso: - [fnc]$window[/fnc], - [fnc]$query[/fnc], - [fnc]$console[/fnc], - [doc:window_naming_conventions]Window naming conventions[/doc] - */ - - KVSCF(channel) - { - QString szName; - kvs_uint_t uContextId; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("channel_name",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szName) - KVSCF_PARAMETER("context_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uContextId) - KVSCF_PARAMETERS_END - - KviWindow * wnd = 0; - if(KVSCF_pParams->count() > 0) - { - if(KVSCF_pParams->count() > 1) - { - KviConsole * cons = g_pApp->findConsole(uContextId); - if(!cons)KVSCF_pContext->warning(__tr2qs("No such IRC context (%u)"),uContextId); - else { - if(cons->connection()) - wnd = cons->connection()->findChannel(szName); - else - wnd = 0; - } - } else { - if(KVSCF_pContext->window()->connection())wnd = KVSCF_pContext->window()->connection()->findChannel(szName); - else { - if(!KVSCF_pContext->window()->console()) - KVSCF_pContext->warning(__tr2qs("This window is not associated to an IRC context")); - wnd = 0; - } - } - } else { - if(KVSCF_pContext->window()->type() == KVI_WINDOW_TYPE_CHANNEL)wnd = KVSCF_pContext->window(); - } - - KVSCF_pRetBuffer->setInteger((kvs_int_t)(wnd ? wnd->numericId() : 0)); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: char - @type: - function - @title: - $char - @short: - Returns a character specified by unicode - @syntax: - <string> $char(<unicode_value:integer>) - @description: - Returns a character corresponding to the UNICODE code <unicode_value>.[br] - This function can not return NUL character (UNICODE 0). Basically - you should never need it: if you do, drop me a mail.[br] - If the <unicode_code> is not a valid UNICODE code (or is 0), this function returns - an empty string.[br] - @seealso: - [fnc]$cr[/fnc], [fnc]$lf[/fnc], [fnc]$unicode[/fnc] - */ - - KVSCF(charCKEYWORDWORKAROUND) - { - kvs_uint_t ac; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("unicode_value",KVS_PT_UINT,0,ac) - KVSCF_PARAMETERS_END - - if(ac != 0 && ac < 65536) - KVSCF_pRetBuffer->setString(QString(QChar((unsigned short)ac))); - else - KVSCF_pRetBuffer->setString(QString::null); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: classdefined - @type: - function - @title: - $classdefined - @short: - Checks if a class is defined - @syntax: - $classdefined(<class_name>) - @description: - Returns 1 if the class <class_name> is defined, else 0. - */ - - KVSCF(classDefined) - { - // prologue: parameter handling - QString szClassName; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("className",KVS_PT_NONEMPTYSTRING,0,szClassName) - KVSCF_PARAMETERS_END - KVSCF_pRetBuffer->setBoolean(KviKvsKernel::instance()->objectController()->lookupClass(szClassName) != 0); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: console - @type: - function - @title: - $console - @short: - Retrieves the window ID of a specified console - @syntax: - $console[(<irc context id>)] - @description: - Returns the [b]window ID[/b] of the console bound - to the IRC context specified by <irc context id>. - If no window matches the specified IRC context, an invalid - window ID is returned (0).[br] - If no <irc context id> is specified, this function looks for - the console in the current IRC context (if any).[br] - @seealso: - [fnc]$window[/fnc], - [fnc]$channel[/fnc], - [fnc]$query[/fnc], - [doc:window_naming_conventions]Window naming conventions[/doc] - */ - - KVSCF(console) - { - kvs_uint_t uContextId; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("context_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uContextId) - KVSCF_PARAMETERS_END - - KviConsole * cons; - if(KVSCF_pParams->count() > 0) - { - cons = g_pApp->findConsole(uContextId); - } else { - cons = KVSCF_pContext->window()->console(); - if(!cons)KVSCF_pContext->warning(__tr2qs("This window is not associated to an IRC context")); - } - - KVSCF_pRetBuffer->setInteger((kvs_int_t)(cons ? cons->numericId() : 0)); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: context - @type: - function - @title: - $context - @short: - Retrieves the ID of the specified IRC context - @syntax: - $context[(<server>,<nickname>)] - @description: - Returns the [b]IRC context ID[/b] of the IRC context that uses - the specified <server> and local user's <nickname>.[br] This function can - find only connected IRC contexts. - If no context matches the server and nickname, and invalid - [b]IRC context ID[/b] is returned (0).[br] - If <server> is an empty string, the first context that matches - the specified nickname is returned. If <nickname> is an empty string - the first context that uses the specified server is returned. - If both parameters are missing this function returns the - id of the current IRC context, or '0' if the - window in that this call is executed is not bound to any IRC context. - Please note that in this last case you may find an [b]IRC context[/b] - that is 'not connected'. - This can only happen if the current window is a console that is - in "idle" state, with no connection established yet.[br] - It is a good idea to take a look at the - [doc:window_naming_conventions]window naming conventions[/doc]. - This identifier is equivalent to [fnc]$ic[/fnc].[br] - @seealso: - [fnc]$window.context[/fnc] - */ - - KVSCF(context) - { - QString szServer,szNick; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("server",KVS_PT_STRING,KVS_PF_OPTIONAL,szServer) - KVSCF_PARAMETER("nick",KVS_PT_STRING,KVS_PF_OPTIONAL,szNick) - KVSCF_PARAMETERS_END - - KviConsole * cons; - if(!(szServer.isEmpty() && szNick.isEmpty())) - { - cons = g_pApp->findConsole(szServer,szNick); - } else { - cons = KVSCF_pContext->window()->console(); - } - - KVSCF_pRetBuffer->setInteger(cons ? cons->ircContextId() : 0); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: cr - @type: - function - @title: - $cr - @short: - Returns a carriage return character - @syntax: - <string> $cr - @description: - Returns a carriage return character - @seealso: - [fnc]$lf[/fnc], [fnc]$ascii[/fnc], [fnc]$char[/fnc] - */ - - KVSCF(cr) - { - KVSCF_pRetBuffer->setString(QString(QChar('\r'))); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: date - @type: - function - @title: - $date - @short: - Returns a date/time string using a specified format - @syntax: - <string> $date(<format:string>[,<unixtime:integer>]) - @description: - Returns the string representation of <unixtime> or - of the current time if <unixtime> is not given, - based on <format>.[br] - The <format string> should contain a set of characters - that will be transformed according to the following rules:[br] - [br] - [table] - [tr][td][b]a[/b][/td][td]The abbreviated weekday name according to the current locale.[/td][/tr] - [tr][td][b]A[/b][/td][td]The full weekday name according to the current locale.[/td][/tr] - [tr][td][b]b[/b][/td][td]The abbreviated month name according to the current locale.[/td][/tr] - [tr][td][b]B[/b][/td][td]The full month name according to the current locale.[/td][/tr] - [tr][td][b]c[/b][/td][td]The preferred date and time representation for the current locale.[/td][/tr] - [tr][td][b]C[/b][/td][td]The century number (year/100) as a 2-digit integer. (SU)[/td][/tr] - [tr][td][b]d[/b][/td][td]The day of the month as a decimal number (range 01 to 31).[/td][/tr] - [tr][td][b]D[/b][/td][td]Equivalent to m/d/y.[/td][/tr] - [tr][td][b]e[/b][/td][td]Like d, the day of the month as a decimal number, but a leading - zero is replaced by a space. (SU)[/td][/tr] - [tr][td][b]E[/b][/td][td]Modifier: use alternative format, see below. (SU)[/td][/tr] - [tr][td][b]F[/b][/td][td]Equivalent to Y-m-d (the ISO 8601 date format). (C99)[/td][/tr] - [tr][td][b]G[/b][/td][td]The ISO 8601 year with century as a decimal number. The 4-digit - year corresponding to the ISO week number (see V). This has the - same format and value as y, except that if the ISO week number - belongs to the previous or next year, that year is used instead.[/td][/tr] - [tr][td][b]g[/b][/td][td]Like G, but without century, i.e., with a 2-digit year (00-99).[/td][/tr] - [tr][td][b]h[/b][/td][td]Equivalent to b.[/td][/tr] - [tr][td][b]H[/b][/td][td]The hour as a decimal number using a 24-hour clock (range 00 to 23).[/td][/tr] - [tr][td][b]I[/b][/td][td]The hour as a decimal number using a 12-hour clock (range 01 to 12).[/td][/tr] - [tr][td][b]j[/b][/td][td]The day of the year as a decimal number (range 001 to 366).[/td][/tr] - [tr][td][b]k[/b][/td][td]The hour (24-hour clock) as a decimal number (range 0 to 23); sin- - gle digits are preceded by a blank. (See also H.)[/td][/tr] - [tr][td][b]l[/b][/td][td]The hour (12-hour clock) as a decimal number (range 1 to 12); sin- - gle digits are preceded by a blank. (See also I.)[/td][/tr] - [tr][td][b]m[/b][/td][td]The month as a decimal number (range 01 to 12).[/td][/tr] - [tr][td][b]M[/b][/td][td]The minute as a decimal number (range 00 to 59).[/td][/tr] - [tr][td][b]n[/b][/td][td]A newline character. (SU)[/td][/tr] - [tr][td][b]p[/b][/td][td]Either `AM' or `PM' according to the given time value, or the cor- - responding strings for the current locale. Noon is treated as `pm' and midnight as `am'.[/td][/tr] - [tr][td][b]r[/b][/td][td]The time in a.m. or p.m. notation. In the POSIX locale this is - equivalent to `I:M:S p'.[/td][/tr] - [tr][td][b]s[/b][/td][td]The number of seconds since the Epoch, i.e., since 1970-01-01 - 00:00:00 UTC.[/td][/tr] - [tr][td][b]S[/b][/td][td]The second as a decimal number (range 00 to 60). (The range is up - to 60 to allow for occasional leap seconds.)[/td][/tr] - [tr][td][b]t[/b][/td][td]A tab character.[/td][/tr] - [tr][td][b]T[/b][/td][td]The time in 24-hour notation (H:M:S). (SU)[/td][/tr] - [tr][td][b]u[/b][/td][td]The day of the week as a decimal, range 1 to 7, Monday being 1. - See also w.[/td][/tr] - [tr][td][b]U[/b][/td][td]The week number of the current year as a decimal number, range 00 - to 53, starting with the first Sunday as the first day of week 01. See also V and W.[/td][/tr] - [tr][td][b]V[/b][/td][td]The ISO 8601:1988 week number of the current year as a decimal num- - ber, range 01 to 53, where week 1 is the first week that has at - least 4 days in the current year, and with Monday as the first day - of the week. See also U and W.[/td][/tr] - [tr][td][b]w[/b][/td][td]The day of the week as a decimal, range 0 to 6, Sunday being 0.[/td][/tr] - [tr][td][b]W[/b][/td][td]The week number of the current year as a decimal number, range 00 - to 53, starting with the first Monday as the first day of week 01.[/td][/tr] - [tr][td][b]x[/b][/td][td]The preferred date representation for the current locale without - the time.[/td][/tr] - [tr][td][b]X[/b][/td][td]The preferred time representation for the current locale without - the date.[/td][/tr] - [tr][td][b]y[/b][/td][td]The year as a decimal number without a century (range 00 to 99).[/td][/tr] - [tr][td][b]Y[/b][/td][td]The year as a decimal number including the century.[/td][/tr] - [tr][td][b]z[/b][/td][td]The time-zone as hour offset from GMT. Required to emit - RFC822-conformant dates (using "a, d b Y H:M:S z").[/td][/tr] - [tr][td][b]Z[/b][/td][td]The time zone or name or abbreviation.[/td][/tr] - [tr][td][b]+[/b][/td][td]The date and time in date(1) format. (TZ)[/td][/tr] - [/table] - WARNING: Please note that this list is taken from the unix version of the strftime - function and not all the escape codes may be supported by other platforms. - @examples: - [example] - [cmd]echo[/cmd] $date("d/m/Y H:M:S") - [/example] - @seealso: - [fnc]$time[/fnc], [fnc]$unixtime[/fnc] - */ - - KVSCF(date) - { - QString szFormat; - kvs_int_t iTime; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("format",KVS_PT_NONEMPTYSTRING,0,szFormat) - KVSCF_PARAMETER("unixtime",KVS_PT_INT,KVS_PF_OPTIONAL,iTime) - KVSCF_PARAMETERS_END - - KviStr tmpFormat(""); - - #ifdef COMPILE_ON_WINDOWS - QString szAllowedCharacters; - //windows version of strftime() - //kvirc crashes if other then these characters get an % character in front of them - szAllowedCharacters = "AaBbcdHIjMmpSUWwXxYyZz"; - #endif - - const QChar * c = KviQString::nullTerminatedArray(szFormat); - if(c) - { - while(c->unicode()) - { - //Check for right Characters - #ifdef COMPILE_ON_WINDOWS - if (szAllowedCharacters.find((char)(c->unicode()),0,true) >= 0) tmpFormat += '%'; - #else - if (c->isLetter()) tmpFormat += '%'; - #endif - tmpFormat += (char)(c->unicode()); - c++; - } - } - - kvi_time_t t; - if(KVSCF_pParams->count() > 1) - t = (kvi_time_t)iTime; - else - t = kvi_unixTime(); - - char buf[256]; - if(strftime(buf,255,tmpFormat.ptr(),localtime(&t))> 0) - { - KviStr tmp = buf; - if(tmp.lastCharIs('\n'))tmp.cutRight(1); - KVSCF_pRetBuffer->setString(QString(buf)); - } else { - KVSCF_pContext->warning(__tr2qs("The specified format string wasn't accepted by the underlying system time formatting function")); - } - - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: false - @type: - function - @title: - $false - @short: - The boolean false constant - @syntax: - <boolean> $false - @description: - Evaluates to the false boolean constant. True - is equivalent to the integer 0 too. This function/constant - is useful to keep your code readable: when you - have a variable that can assume boolean values it's - nicer to use [fnc]$true[/fnc] and $false instead of - the integer constants 1 and 0. The reader will - undestand immediately that the variable simply can't - assume any other value. - @examples: - [example] - %a = $false - [cmd]echo[/cmd] $typeof(%a) - [cmd]echo[/cmd] $(%a + 1) - [/example] - @seealso: - [fnc]$true[/fnc] - */ - - KVSCF(falseCKEYWORDWORKAROUND) - { -#ifdef COMPILE_NEW_KVS - KVSCF_pRetBuffer->setBoolean(false); -#endif - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: features - @type: - function - @title: - $features - @short: - Returns the features that KVIrc supports - @syntax: - <array> $features() - <boolean> $features(<test_feature:string>) - @description: - The parameterless form returns an array of feature descripton strings that this KVIrc executable supports.[br] - This function is useful when some part of your script depends on - an optional KVIrc feature (like SSL support or IPV6 support).[br] - The returned value may be assigned to a dictionary too: it will be used to simulate an array.[br] - The form with the [test_feature] parameter returns true if and only if [test_feature] is available.[br] - @examples: - [example] - %myfeats[] = $features - [cmd]echo[/cmd] %myfeats[] - %i = %myfeats[]# - [cmd]while[/cmd](%i > 0) - { - [cmd]echo[/cmd] "Supporting feature %myfeats[%i]" - %i--; - } - [/example] - Nearly the same loop, just really shorter: - [example] - [cmd]foreach[/cmd](%f,$features) - [cmd]echo[/cmd] "Supporting feature %myfeats[%i]" - [/example] - You can test for a specific feature in the following way: - [example] - [cmd]if[/cmd]($features("SSL"))[cmd]echo[/cmd] "Yes! SSL is available"; - [/example] - If used in "non-array" context it returns just a comma separated list of entries:[br] - [example] - [cmd]echo[/cmd] $features - [/example] - @seealso: - [fnc]$version[/fnc] - */ - - KVSCF(features) - { - QString szFeature; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("test_feature",KVS_PT_STRING,KVS_PF_OPTIONAL,szFeature) - KVSCF_PARAMETERS_END - - static const char * feature_array[]= - { - "IRC", - #ifdef COMPILE_IPV6_SUPPORT - "IPv6", - #endif - #ifdef COMPILE_CRYPT_SUPPORT - "Crypt", - #endif - #ifdef COMPILE_SSL_SUPPORT - "SSL", - #endif - #ifdef COMPILE_GET_INTERFACE_ADDRESS - "IfAddr", - #endif - #ifndef COMPILE_NO_IPC - "IPC", - #endif - #ifdef COMPILE_KDE_SUPPORT - "KDE", - #endif - #ifdef COMPILE_OSS_SUPPORT - "OSS", - #endif - #ifdef COMPILE_ARTS_SUPPORT - "ARTS", - #endif - #ifdef COMPILE_ESD_SUPPORT - "ESD", - #endif - #ifdef COMPILE_AUDIOFILE_SUPPORT - "Audiofile", - #endif - #ifdef COMPILE_PSEUDO_TRANSPARENCY - "Transparency", - #endif - #ifdef COMPILE_ix86_ASM - "ix86-ASM", - #endif - #ifdef COMPILE_SCRIPTTOOLBAR - "ScriptToolBar", - #endif // COMPILE_SCRIPTTOOLBAR - #ifdef COMPILE_USE_QT4 - "Qt4", - #else - "Qt3", - #endif - #ifdef COMPILE_NEW_KVS - "KVS", - #endif - 0 - }; - - if(!szFeature.isEmpty()) - { - for(int i=0;feature_array[i];i++) - { - if(KviQString::equalCI(feature_array[i],szFeature)) - { - KVSCF_pRetBuffer->setBoolean(true); - return true; - } - } - KVSCF_pRetBuffer->setBoolean(false); - } else { - KviKvsArray * a = new KviKvsArray(); - int id = 0; - for(int i=0;feature_array[i];i++)a->set(i,new KviKvsVariant(QString(feature_array[i]))); - KVSCF_pRetBuffer->setArray(a); - } - - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: firstconnectedconsole - @type: - function - @title: - $firstConnectedConsole - @short: - Returns the window id of the first connected console - @syntax: - <uint> $firstConnectedConsole() - @description: - Returns the window id of the first connected console - or 0 if no console is actually connected. - */ - - KVSCF(firstConnectedConsole) - { - KviConsole * c = g_pApp->topmostConnectedConsole(); - // FIXME: The window id's should be numeric!!! - KVSCF_pRetBuffer->setString(c ? c->id() : "0"); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: flatten - @type: - function - @title: - $flatten - @short: - Returns a flattened array of items - @syntax: - <array> $flatten(<data1:variant>[,<data2:variant>[,...]]) - @description: - Returns an array of items built from the passed arguments - with the following rules:[br] - [ul] - [li]If an argument is a scalar value then the argument itself - is appended to the result.[/li] - [li]If an argument is an array then each contained item - is appended to the result.[/li] - [li]If an argument is a hash then each contained value - is appended to the result.[/li] - [/ul] - A simple example of usage is to merge N arrays into a new one. - (Please note that for merging one array into another the - [doc:arrayconcatenation]<+ operator[/doc] is more efficient). - */ - - KVSCF(flatten) - { - KviKvsArray * a = new KviKvsArray(); - KVSCF_pRetBuffer->setArray(a); - unsigned int uIdx = 0; - for(KviKvsVariant * v = KVSCF_pParams->first();v;v = KVSCF_pParams->next()) - { - switch(v->type()) - { - case KviKvsVariantData::Array: - { - KviKvsArray * z = v->array(); - unsigned int uSize = z->size(); - unsigned int uIdx2 = 0; - while(uIdx2 < uSize) - { - KviKvsVariant * pInternal = z->at(uIdx2); - if(pInternal) - a->set(uIdx,new KviKvsVariant(*pInternal)); - // else - // don't set anything: just leave empty entry (nothing) - uIdx++; - uIdx2++; - } - } - break; - case KviKvsVariantData::Hash: - { - KviKvsHash * h = v->hash(); - KviKvsHashIterator it(*(h->dict())); - while(KviKvsVariant * pInternal = it.current()) - { - a->set(uIdx,new KviKvsVariant(*pInternal)); - uIdx++; - ++it; - } - } - break; - default: - a->set(uIdx,new KviKvsVariant(*v)); - uIdx++; - break; - } - } - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: fmtlink - @type: - function - @title: - $fmtlink - @short: - Returns a formatted link buffer - @syntax: - <string> $fmtlink(<link_text:string>,<double_click_command:string>[,<tooltip_text:string>]) - @description: - Returns a link formatted for the [cmd]echo[/cmd] command.[br] - If you pass the returned string to the echo command, the string will be displayed - as a link and will be highlighted when the user moves the mouse over it.[br] - If the user will leave the mouse for a few seconds over the link, the <tooltip_text> - will be displayed in a small tooltip window. If <tooltip_text> is not given, - then no tooltip will be shown.[br] - The <double_click_command> will be executed when the user will double click on the link.[br] - Please remember that if <double_click_command> contains identifiers - that must be evaluated at double-click time, you MUST escape them in the $fmtlink() call - to prevent the evaluation.[br] - You might also take a look at [doc:escape_sequences]the escape sequences documentation[/doc] - to learn more about how the links are implemented and how to create more powerful links (add - right and middle button actions, use predefined kvirc links etc...) - @seealso: - [doc:escape_sequences]the escape sequences documentation[/doc] - */ - - KVSCF(fmtlink) - { - QString szLinkText,szCmd,szToolTip; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("link_text",KVS_PT_NONEMPTYSTRING,0,szLinkText) - KVSCF_PARAMETER("double_click_command",KVS_PT_STRING,0,szCmd) - KVSCF_PARAMETER("tooltip_text",KVS_PT_STRING,KVS_PF_OPTIONAL,szToolTip) - KVSCF_PARAMETERS_END - - QString szPart; - KviQString::sprintf(szPart,"[!dbl]%Q",&szCmd); - if(!szToolTip.isEmpty())KviQString::appendFormatted(szPart,"[!txt]%Q",&szToolTip); - QString szLink; - KviQString::sprintf(szLink,"\r!%Q\r%Q\r",&szPart,&szLinkText); - KVSCF_pRetBuffer->setString(szLink); - return true; - } - -}; - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions_gl.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions_gl.cpp deleted file mode 100644 index 86e0c42cb0..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions_gl.cpp +++ /dev/null @@ -1,888 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_corefunctions_gl.cpp -// Created on Fri 31 Oct 2003 01:52:04 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003-2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_corefunctions.h" - -#include "kvi_kvs_kernel.h" - -#include "kvi_kvs_timermanager.h" -#include "kvi_kvs_arraycast.h" -#include "kvi_locale.h" -#include "kvi_input.h" -#include "kvi_app.h" -#include "kvi_channel.h" -#include "kvi_console.h" -#include "kvi_iconmanager.h" -#include "kvi_mirccntrl.h" -#include "kvi_frame.h" -#include "kvi_time.h" -#include "kvi_kvs_eventmanager.h" -#include "kvi_kvs_eventhandler.h" -#include <qregexp.h> -#include "kvi_lagmeter.h" - -namespace KviKvsCoreFunctions -{ - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: hash - @type: - function - @title: - $hash - @short: - Explicitly creates a hash - @syntax: - <hash> $hash([<key:string>,<value:variant>,[<key:string>,<value:variant>]],...) - @description: - Returns a hash with the specified items. Each <value> is indexed by the preceeding <key>. - This is just an explicit way of creating a hash with a defined set of items, - useful for increasing readability. - @examples: - [example] - [cmd]alias[/cmd](test){ [cmd]return[/cmd] $hash(1,X,2,Y,3,Z); }; - %x = $test(); - [cmd]foreach[/cmd](%y,%x) - { - [cmd]echo[/cmd] %y; - } - [cmd]foreach[/cmd](%y,[fnc]$keys[/fnc](%x)) - { - [cmd]echo[/cmd] %y - } - [/example] - @seealso: - [fnc]$array[/fnc] - */ - - KVSCF(hash) - { -#ifdef COMPILE_NEW_KVS - KviKvsHash * a = new KviKvsHash(); - - for(KviKvsVariant * key = KVSCF_pParams->first();key;key = KVSCF_pParams->next()) - { - KviKvsVariant * val = KVSCF_pParams->next(); - if(!val)break; - QString sz; - key->asString(sz); - a->set(sz,new KviKvsVariant(*val)); - } - - KVSCF_pRetBuffer->setHash(a); -#endif - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: hextoAscii - @type: - function - @title: - $hexToAscii - @short: - Returns a decoded hex string - @syntax: - $hexToAscii(<hex_encoded_string>) - @description: - Decodes the <hex_encoded_string> to its ASCII representation. - @examples: - [example] - [cmd]echo[/cmd] $hexToAscii(6B76697263) - [/example] - @seealso: - [fnc]$asciiToHex[/fnc] - */ - - KVSCF(hexToAscii) - { - QString szHex; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("hex_encoded_string",KVS_PT_STRING,0,szHex) - KVSCF_PARAMETERS_END - - KviStr tmp1(szHex); - char * buf; - int len = tmp1.hexToBuffer(&buf,true); - KVSCF_pRetBuffer->setString(QString(KviQCString(buf,len+1))); - KviStr::freeBuffer(buf); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: hostname - @type: - function - @title: - $hostname - @short: - Returns the hostname of the specified user - @syntax: - <string> $hostname(<nickname:string>) - @description: - Returns the hostname of the specified IRC user IF it is known.[br] - The hostname is known if [fnc]$isWellKnown[/fnc] returns 1.[br] - The hostname is generally known if the user is on a channel with you - or has an open query with you.[br] - Detailed explaination:[br] - KVIrc has an internal database of users that are currently - visible by *this client*: this includes users on open channels - and queries.[br] The other IRC users are NOT in the database: - this means that KVIrc knows NOTHING about them and can't return - any information immediately. In this case this function will return - an EMPTY string.[br] - If a user is in the database, at least his nickname is known.[br] - The username and hostname are known only if the server provides that information - spontaneously or after a KVIrc request.[br] - KVIrc requests user information for all the users in open queries - and channels. This information takes some time to be retrieved, - in this interval of time KVIrc knows only the user's nickname. - This function will return the string "*" in this case.[br] - @seealso: - [fnc]$isWellKnown[/fnc], [fnc]$username[/fnc], [cmd]awhois[/cmd] - */ - - KVSCF(hostname) - { - QString szNick; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("nick",KVS_PT_NONEMPTYSTRING,0,szNick) - KVSCF_PARAMETERS_END - - if(KVSCF_pContext->window()->console()) - { - if(KVSCF_pContext->window()->console()->isConnected()) - { - KviIrcUserEntry * e = KVSCF_pContext->window()->connection()->userDataBase()->find(szNick); - if(e) - { - KVSCF_pRetBuffer->setString(e->host()); - return true; - } - } - } - - KVSCF_pRetBuffer->setNothing(); - return true; - } - - //------------------------------------------------- - /* - @doc: lag - @type: - function - @title: - $lag - @short: - Returns the lag on the current server - @syntax: - <integer> lag - @description: - This function returns the lag in the current server, in milliseconds.[br] - */ - - KVSCF(lag) - { - if(!KVSCF_pContext->window()->console()) return KVSCF_pContext->errorNoIrcContext(); - if(!KVSCF_pContext->window()->console()->connection()) return KVSCF_pContext->warningNoIrcConnection(); - if(!KVSCF_pContext->window()->console()->connection()->lagMeter()) - { - KVSCF_pContext->warning(__tr2qs("Lag meter was not enabled")); - return false; - } - - KVSCF_pRetBuffer->setInteger( KVSCF_pContext->window()->console()->connection()->lagMeter()->lag()); - return true; - } - ///////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: hptimestamp - @type: - function - @title: - $hptimestamp - @short: - Returns a high precision timestamp - @syntax: - <float> $hptimestamp - @description: - Returns a high precision timestamp as a floaint point value. - The timestamp rappresent the number of seconds elapsed since - a certain moment in the past. The number of seconds - contains a "high precision" fractional part. The "certain moment" definition - depends on the platform KVIrc is executed. This means that - this timestamp is totally useless to rappresent a time value - but is useful to compute time intervals with sub-second precision. - @examples: - [example] - %tmp = $hptimestamp - [cmd]echo[/cmd] $($hptimestamp - %tmp) - [/example] - @seealso: - [fnc]$unixTime[/fnc], [fnc]$date[/fnc] - */ - - KVSCF(hptimestamp) - { - struct timeval tv; - kvi_gettimeofday(&tv,0); - kvs_real_t dTimestamp = (kvs_real_t)(tv.tv_sec); - dTimestamp += (((kvs_real_t)(tv.tv_usec)) / 1000000.0); - KVSCF_pRetBuffer->setReal(dTimestamp); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: icon - @type: - function - @title: - $icon - @short: - Returns the ID of an icon - @syntax: - <integer> $icon(<iconname:string>) - @description: - Returns the ID of the icon <iconname>. - You should always use this function where an <image_id> is required - and you want to use an internal icon. - See [fnc]$iconname[/fnc] for a list of the icon names supported by kvirc.[br] - @examples: - [example] - [cmd]echo[/cmd] $icon(linux) - [/example] - @seealso: - [fnc]$iconName[/fnc] - */ - - KVSCF(icon) - { - QString szName; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("iconName",KVS_PT_NONEMPTYSTRING,0,szName) - KVSCF_PARAMETERS_END - - KVSCF_pRetBuffer->setInteger(g_pIconManager->getSmallIconIdFromName(szName)); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: iconname - @type: - function - @title: - $iconname - @short: - Returns the name of an icon - @syntax: - $iconname(<iconid>) - @description: - Returns the name of a builtin icon given an <iconid>. - The <iconid> is returned by the function [fnc]$icon[/fnc]. - If the <iconid> is not valid, an empty name is returned.[br] - The following code will list all the available icon names:[br] - [example] - %i = 0 - [cmd]do[/cmd] { - %name = $iconname(%i) - echo The icon by ID %i is named %name - %i++ - } [cmd]while[/cmd](%name != "") - [/example] - @examples: - [example] - [cmd]echo[/cmd] $iconname(24) - [cmd]echo[/cmd] $iconname([fnc]$icon[/fnc](linux)) - [/example] - @seealso: - [fnc]$iconName[/fnc] - */ - - KVSCF(iconName) - { - kvs_uint_t uIco; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("iconid",KVS_PT_UINT,0,uIco) - KVSCF_PARAMETERS_END - - if(uIco < KVI_NUM_SMALL_ICONS) - { - KVSCF_pRetBuffer->setString(g_pIconManager->getSmallIconName(uIco)); - } else { - KVSCF_pRetBuffer->setNothing(); - } - return true; - } - - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: integer - @type: - function - @title: - $integer - @short: - Casts a variable to an integer - @syntax: - <integer> $integer(<data:variant>) - @description: - Forces <data> to be an integer data type with the following - semantics:[br] - [ul] - [li]If <data> is an integer, <data> itself is returned.[/li] - [li]If <data> is a boolean, its numeric value is returned (either 1 or 0).[/li] - [li]If <data> is a real, its integer part is returned.[/li] - [li]If <data> is an array, the count of its items is returned.[/li] - [li]If <data> is a hash, the count of its items is returned.[/li] - [li]If <data> is a string, its length is returned.[/li] - [li]If <data> is an object, 0 is returned if the reference is null (invalid) and 1 otherwise[/li] - [/ul] - This function is similar to the C (int) cast and is internally - aliased to [fnc]$int[/fnc]() too. - Note that since KVIrc does most of the casting work automatically - you shouldn't need to use this function. - @seealso: - [fnc]$real[/fnc] - [fnc]$boolean[/fnc] - */ - - /* - @doc: int - @type: - function - @title: - $int - @short: - Casts a variable to an integer - @syntax: - <integer> $int(<data:variant>) - @description: - This is an internal alias to [fnc]$integer[/fnc](). - @seealso: - [fnc]$real[/fnc] - [fnc]$boolean[/fnc] - */ - - KVSCF(integer) - { - KviKvsVariant * v; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("data",KVS_PT_VARIANT,0,v) - KVSCF_PARAMETERS_END - - kvs_int_t iVal; - v->castToInteger(iVal); - KVSCF_pRetBuffer->setInteger(iVal); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: isMainWindowActive - @type: - function - @title: - $isMainWindowActive - @short: - Checks if main KVirc window is active - @syntax: - <boolean> $isMainWindowActive() - @description: - Returns true if the KVIrc's window is currently - the active window on the current desktop. - */ - - KVSCF(isMainWindowActive) - { - KVSCF_pRetBuffer->setBoolean(g_pFrame->isActiveWindow()); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: isMainWindowMinimized - @type: - function - @title: - $isMainWindowMinimized - @short: - Checks if main KVirc window is minimized - @syntax: - <boolean> $isMainWindowMinimized() - @description: - Returns true if main KVirc window is minimized and false otherwise. - */ - - KVSCF(isMainWindowMinimized) - { - KVSCF_pRetBuffer->setBoolean(g_pFrame->isMinimized()); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: isempty - @type: - function - @title: - $isEmpty - @short: - Checks if a variable is set (empty or non empty) - @syntax: - <boolean> $isEmpty(<data:variant>) - @description: - Returns 0 if <data> is actually set to some non-empty value - and 1 otherwise. Since KVIrc treats unset variables as empty - ones then this function is the exact opposite of [fnc]$isSet[/fnc]. - @seealso: - [fnc]$isSet[/fnc] - */ - - KVSCF(isEmpty) - { -#ifdef COMPILE_NEW_KVS - KviKvsVariant * v; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("data",KVS_PT_VARIANT,0,v) - KVSCF_PARAMETERS_END - - KVSCF_pRetBuffer->setBoolean(v->isEmpty()); -#endif - return true; - } - //FIXME: documentation - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: iseventenabled - @type: - function - @title: - $isEventEnabled - @short: - Checks if an event enabled - @syntax: - <boolean> $isEventEnabled(<event_name:string>,<handler_name:string>) - @description: - Returns 1 if the event handler enabled - */ - - /////////////////////////////////////////////////////////////////////////////////////////////// - - KVSCF(isEventEnabled) - { - QString szEventName,szHandlerName; - KviKvsScriptEventHandler *h=0; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("event_name",KVS_PT_NONEMPTYSTRING,0,szEventName) - KVSCF_PARAMETER("handler_name",KVS_PT_NONEMPTYSTRING,0,szHandlerName) - KVSCF_PARAMETERS_END - - bool bOk; - int iNumber = szEventName.toInt(&bOk); - bool bIsRaw = (bOk && (iNumber >= 0) && (iNumber < 1000)); - - if(bIsRaw) - { - if(!KviKvsEventManager::instance()->isValidRawEvent(iNumber)) - { - KVSCF_pContext->warning(__tr2qs("No such event (%Q)"),&szEventName); - } else { - h=KviKvsEventManager::instance()->findScriptRawHandler(iNumber,szHandlerName); - } - } else { - iNumber = KviKvsEventManager::instance()->findAppEventIndexByName(szEventName); - if(!KviKvsEventManager::instance()->isValidAppEvent(iNumber)) - { - KVSCF_pContext->warning(__tr2qs("No such event (%Q)"),&szEventName); - } else { - h=KviKvsEventManager::instance()->findScriptAppHandler(iNumber,szHandlerName); - } - } - if(h) - KVSCF_pRetBuffer->setBoolean(h->isEnabled()); - else - KVSCF_pContext->warning(__tr2qs("No such event handler (%Q) for event %Q"),&szHandlerName,&szEventName); - - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: isnumeric - @type: - function - @title: - $isNumeric - @syntax: - <boolean> $isNumeric(<data:variant>) - @short: - Finds whether a variable contains a rappresentation of a number - @description: - Returns 1 if the <data> is an integer or a real number, 0 otherwise. - */ - - KVSCF(isNumeric) - { -#ifdef COMPILE_NEW_KVS - KviKvsVariant * v; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("data",KVS_PT_VARIANT,0,v) - KVSCF_PARAMETERS_END - - KviKvsNumber n; - KVSCF_pRetBuffer->setBoolean(v->asNumber(n)); -#endif - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: isset - @type: - function - @title: - $isSet - @short: - Checks if a variable is set (non-empty) - @syntax: - <boolean> $isSet(<data:variant>) - @description: - Returns 1 if <data> is actually set to some non-empty value - and 0 otherwise. If <data> is a variable , then this function - simply checks if the variable is set. If <data> is a constant - then this function checks if the constant is non empty. - Since KVIrc treats empty strings as "unset" values then - this function could be also called "isNonEmpty" and it is - the perfect opposite of [fnc]$isEmpty[/fnc] - @seealso: - [fnc]$isEmpty[/fnc], [cmd]unset[/cmd] - */ - - KVSCF(isSet) - { -#ifdef COMPILE_NEW_KVS - KviKvsVariant * v; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("data",KVS_PT_VARIANT,0,v) - KVSCF_PARAMETERS_END - - KVSCF_pRetBuffer->setBoolean(!v->isEmpty()); -#endif - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: istimer - @type: - function - @title: - $isTimer - @short: - Checks for a timer existence - @syntax: - <boolean> $istimer(<name:string>) - @description: - Returns 1 if the timer named <name> is actually running, else 0 - @seealso: - [cmd]timer[/cmd], [cmd]killtimer[/cmd] - */ - - KVSCF(isTimer) - { - QString szName; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("timerName",KVS_PT_NONEMPTYSTRING,0,szName) - KVSCF_PARAMETERS_END - KVSCF_pRetBuffer->setBoolean(KviKvsTimerManager::instance()->timerExists(szName)); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: iswellknown - @type: - function - @title: - $isWellKnown - @short: - Returns $true if the specified user is well known - @syntax: - <bool> $isWellKnown(<nickname:string>) - @description: - Returns 1 if KVIrc has the basic user information about the specified <nickname>.[br] - The basic information include the username and hostname.[br] - This is almost always true if the user is on a channel with you or - you have an open query with him.[br] - If $isWellKnown returns 0, [fnc]$username[/fnc] and [fnc]$hostname[/fnc] - will return empty strings.[br] - In this case you must use [cmd]awhois[/cmd] to obtain the user basic information.[br] - */ - - KVSCF(isWellKnown) - { - QString szNick; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("nick",KVS_PT_NONEMPTYSTRING,0,szNick) - KVSCF_PARAMETERS_END - - if(KVSCF_pContext->window()->console()) - { - if(KVSCF_pContext->window()->console()->isConnected()) - { - KviIrcUserEntry * e = KVSCF_pContext->window()->connection()->userDataBase()->find(szNick); - if(e) - { - KVSCF_pRetBuffer->setBoolean(e->hasHost() && e->hasUser()); - return true; - } - } - } - - KVSCF_pRetBuffer->setBoolean(false); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: k - @type: - function - @title: - $k - @short: - Returns the COLOR mIRC control character - @syntax: - <string> $k(<foreground:integer>[,<background:integer>]) - <string> $k - @description: - Returns the COLOR mIRC control character (Qt::CTRL+K).[br] - If <foreground> and <background> are passed, a standard mIRC - color escape is returned.[br] - @seealso: - [fnc]$b[/fnc] - */ - - KVSCF(k) - { - kvs_uint_t iFore,iBack; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("foreground",KVS_PT_UINT,KVS_PF_OPTIONAL,iFore) - KVSCF_PARAMETER("background",KVS_PT_UINT,KVS_PF_OPTIONAL,iBack) - KVSCF_PARAMETERS_END - - QString szRet = QChar(KVI_TEXT_COLOR); - if(KVSCF_pParams->count() > 0) - { - KviQString::appendFormatted(szRet,"%u",iFore); - if(KVSCF_pParams->count() > 1) - KviQString::appendFormatted(szRet,",%u",iBack); - } - KVSCF_pRetBuffer->setString(szRet); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: keys - @type: - function - @title: - $keys - @short: - Returns the array of keys of a hash - @syntax: - <array> $keys(<hash_value:hash>) - @description: - Returns an array with the keys of the <hash> parameter. - <hash> must be obviously a hash (or eventually an empty variable - that is treated as an empty hash). - @seealso: - [cmd]foreach[/cmd] - */ - - KVSCF(keys) - { -#ifdef COMPILE_NEW_KVS - KviKvsHash * pHash; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("hash",KVS_PT_HASH,0,pHash) - KVSCF_PARAMETERS_END - - KviKvsArray * a = new KviKvsArray(); - kvs_int_t idx = 0; - KviKvsHashIterator it(*(pHash->dict())); - while(it.current()) - { - a->set(idx,new KviKvsVariant(it.currentKey())); - idx++; - ++it; - } - KVSCF_pRetBuffer->setArray(a); -#endif - return true; - } - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: lang - @type: - function - @title: - $lang - @short: - Returns name of currently used language - @syntax: - <string> $lang([<type:string>]) - @description: - Returns the short name of currently used language - Type <type> should be one of: [br] - "full" - returns full locale name, such as ru_RU.UTF-8 (default) - "lang" - return language name, such as "ru_RU" - "short" - returns only language group such as "ru" - */ - - KVSCF(lang) - { - QString szType; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("type",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szType) - KVSCF_PARAMETERS_END - - QString szLocale(KviLocale::localeName().ptr()); - if(szType=="lang") KVSCF_pRetBuffer->setString(szLocale.left(5)); - else if(szType=="short") KVSCF_pRetBuffer->setString(szLocale.left(2)); - else KVSCF_pRetBuffer->setString(szLocale); - return true; - } - - - - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: length - @type: - function - @title: - $length - @short: - Returns the length of a variable - @syntax: - <integer> $length(<value:variant>) - @description: - When <value> is an array or a hash, it returns the number - of its elements. When <value> is an object reference it returns 0. - In all the other cases <value> is interpreted - as a string and its length is returned. - @seealso: - [fnc]$str.len[/fnc] - */ - - KVSCF(length) - { - KviKvsVariant * pVar; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("value",KVS_PT_VARIANT,0,pVar) - KVSCF_PARAMETERS_END - - switch(pVar->type()) - { - case KviKvsVariantData::Array: - KVSCF_pRetBuffer->setInteger(pVar->array()->size()); - break; - case KviKvsVariantData::Hash: - KVSCF_pRetBuffer->setInteger(pVar->hash()->size()); - break; - case KviKvsVariantData::HObject: - KVSCF_pRetBuffer->setInteger(0); - break; - default: - { - QString tmp; - pVar->asString(tmp); - KVSCF_pRetBuffer->setInteger(tmp.length()); - } - break; - } - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: lf - @type: - function - @title: - $lf - @short: - Returns a line feed character - @syntax: - <string> $lf - @description: - Returns a line feed character - @seealso: - [fnc]$cr[/fnc], [fnc]$ascii[/fnc], [fnc]$char[/fnc] - */ - - KVSCF(lf) - { - KVSCF_pRetBuffer->setString(QString(QChar('\n'))); - return true; - } - -}; - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions_mr.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions_mr.cpp deleted file mode 100644 index a39c132f66..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions_mr.cpp +++ /dev/null @@ -1,679 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_corefunctions_mr.cpp -// Created on Fri 31 Oct 2003 01:52:04 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_corefunctions.h" - -#include "kvi_kvs_kernel.h" -#include "kvi_kvs_arraycast.h" -#include "kvi_kvs_object_controller.h" - -#include "kvi_locale.h" -#include "kvi_ircconnection.h" -#include "kvi_mirccntrl.h" -#include "kvi_options.h" -#include "kvi_console.h" -#include "kvi_ircuserdb.h" -#include "kvi_ircmask.h" -#include "kvi_socket.h" -#include "kvi_app.h" -#include "kvi_query.h" - -#include <stdlib.h> // rand & srand - -namespace KviKvsCoreFunctions -{ - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: mask - @type: - function - @title: - $mask - @short: - Retrieves the host mask of a user - @syntax: - $mask[(<nickname>[,<mask_type>])] - @description: - Returns the specified type of mask for the user with <nickname>.[br] - If the host or username are not known, the mask may contain less information - than requested.[br] - If the <nickname> is not given it is assumed to be the current nickname.[br] - If <mask_type> is not given or is invalid, it is assumed to be 0.[br] - Available mask types:[br] - 0 : nick!user@machine.host.top (nick!user@XXX.XXX.XXX.XXX) (default)[br] - 1 : nick!user@*.abc.host.top (nick!user@XXX.XXX.XXX.*)[br] - 2 : nick!user@*[br] - 3 : nick!*@machine.host.top (nick!user@XXX.XXX.XXX.XXX)[br] - 4 : nick!*@*.abc.host.top (nick!user@XXX.XXX.XXX.*)[br] - 5 : nick!*@*[br] - 6 : *!user@machine.host.top (*!user@XXX.XXX.XXX.XX)[br] - 7 : *!user@*.abc.host.top (*!user@XXX.XXX.XXX.*)[br] - 8 : *!user@*[br] - 9 : *!*@machine.host.top (*!*@XXX.XXX.XXX.XXX)[br] - 10: *!*@*.abc.host.top (*!*@XXX.XXX.XXX.*)[br] - 11: nick!*user@machine.host.top (nick!*user@XXX.XXX.XXX.XXX)[br] - 12: nick!*user@*.abc.host.top (nick!*user@XXX.XXX.XXX.*)[br] - 13: nick!*user@*[br] - 14: *!*user@machine.host.top (*!*user@XXX.XXX.XXX.XXX)[br] - 15: *!*user@*.abc.host.top (*!*user@XXX.XXX.XXX.*)[br] - 16: *!*user@*[br] - 17: nick!~user@*.host.top (nick!~user@XXX.XXX.*)[br] - 18: nick!*@*.host.top (nick!*@XXX.XXX.*)[br] - 19: *!~user@*.host.top (*!~user@XXX.XXX.*)[br] - 20: nick!*user@*.host.top (nick!*user@XXX.XXX.*)[br] - 21: *!*user@*.host.top (*!user@*XXX.XXX.*)[br] - 22: nick!~user@*.host.top (nick!~user@XXX.XXX.*)[br] - 23: nick!*@*.host.top (nick!*@XXX.XXX.*)[br] - 24: *!~user@*.host.top (*!~user@XXX.XXX.*)[br] - 25: nick!*user@*.host.top (nick!*user@XXX.XXX.*)[br] - 26: *!*user@*.host.top (*!user@*XXX.XXX.*)[br] - If some data is missing, these types may change:[br] - For example, if the hostname is missing, the mask type 3 or 4 may be reduced to type 5.[br] - If the user with <nickname> is not found in the current IRC context user database, - an empty string is returned.[br] - The masks 22-26 are the smart versions of the masks 17-21 that try take care of masked ip addresses - in the form xxx.xxx.INVALID-TOP-MASK. If a masked ip address is found then - the XXX.XXX.* or XXX.* host mask is returned instead of the (wrong) *.INVALID-TOP-MASK - @examples: - @seealso: - */ - - KVSCF(mask) - { - QString szNick; - kvs_uint_t maskType; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("nickname",KVS_PT_STRING,KVS_PF_OPTIONAL,szNick) - KVSCF_PARAMETER("maskType",KVS_PT_UINT,KVS_PF_OPTIONAL,maskType) - KVSCF_PARAMETERS_END - - if(maskType > 26) maskType = 0; - - if(KVSCF_pContext->window()->console()) - { - if(KVSCF_pContext->window()->console()->isConnected()) - { - KviIrcUserEntry * e = KVSCF_pContext->window()->connection()->userDataBase()->find(szNick.isEmpty() ? KVSCF_pContext->window()->connection()->currentNickName() : szNick); - if(e) - { - KviIrcMask u; - u.setNick(szNick); - u.setUsername(e->user()); - u.setHost(e->host()); - - QString tmp; - u.mask(tmp,(KviIrcMask::MaskType)maskType); - KVSCF_pRetBuffer->setString(tmp); - return true; - } - } - } - KVSCF_pRetBuffer->setNothing(); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: me - @type: - function - @title: - $me - @short: - Returns the current nickname - @syntax: - <string> $me[(<irc_context_id:uint>)] - @description: - Returns the current nickname used in the specified IRC context.[br] - If no <irc_context_id> is specified, the current IRC context is used.[br] - If you are not connected to a server, this function will return a null string.[br] - If the current window is a DCC chat and no irc_context is specified, - the local nickname is returned.[br] - If the current window does not belong to any IRC context, no irc_context_id - is specified, and the current window is not a DCC chat, a warning is printed.[br] - */ - - KVSCF(me) - { - kvs_uint_t uCntx; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("irc_context_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uCntx) - KVSCF_PARAMETERS_END - - KviConsole * cns; - - if(KVSCF_pParams->count() > 0) - { - cns = g_pApp->findConsole(uCntx); - if(cns) - { - if(cns->isConnected()) - KVSCF_pRetBuffer->setString(cns->connection()->currentNickName()); - else - KVSCF_pRetBuffer->setNothing(); - } else { - KVSCF_pRetBuffer->setNothing(); - } - } else { - if(KVSCF_pContext->window()->console()) - { - cns = KVSCF_pContext->window()->console(); - if(cns->isConnected()) - KVSCF_pRetBuffer->setString(cns->connection()->currentNickName()); - else - KVSCF_pRetBuffer->setNothing(); - } else { - if(KVSCF_pContext->window()->type() == KVI_WINDOW_TYPE_DCCCHAT) - { - KVSCF_pRetBuffer->setString(KVSCF_pContext->window()->localNick()); - } else { - KVSCF_pContext->warning(__tr2qs("This window has no associated IRC context and is not a DCC chat")); - KVSCF_pRetBuffer->setNothing(); - } - } - } - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: msgtype - @type: - function - @title: - $msgtype - @short: - Returns the id of a message type color set - @syntax: - $msgtype(<message type color set name>) - @description: - Returns the id of a message type color set used by the [cmd]echo[/cmd] command. - You can take a look at the options dialog section related to the - message output to see the list of available message type names. - @examples: - [example] - [cmd]echo[/cmd] -i=$msgtype(Highlight) Highlighted text! - [/example] - @seealso: - [cmd]echo[/cmd] - */ - - KVSCF(msgtype) - { - QString szName; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("msg_type_color_set_name",KVS_PT_NONEMPTYSTRING,0,szName) - KVSCF_PARAMETERS_END - - KviStr tmp(szName); - for(int i=0;i< KVI_NUM_MSGTYPE_OPTIONS;i++) - { - if(kvi_strEqualCI(tmp.ptr(),(g_msgtypeOptionsTable[i].name + 7))) - { - KVSCF_pRetBuffer->setInteger(i); - return true; - } - } - KVSCF_pRetBuffer->setInteger(0); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: new - @type: - function - @title: - $new - @short: - Creates a new object - @syntax: - $new(<className>,[<parentHandle> [,<name>[,<param>[,<param>[...]]]]) - @description: - Creates a new instance of the object <class> with - the parent object <parent_id> and the specified <name>.[br] - <name> and <parent_id> are optional: if not specified, <name> - is assumed to be an empty string and <parent_id> default to 0 (parentless object).[br] - Please see the [doc:objects]objects documentation[/doc] for more information.[br] - @examples: - [example] - %myobj = $new(widget,0,pippo) - [/example] - @seealso: - [doc:objects]Objects documentation[/doc], [cmd]delete[/cmd] - */ - - KVSCF(newCKEYWORDWORKAROUND) - { - // prologue: parameter handling - QString szClassName; - QString szName; - kvs_hobject_t hParent; - KviKvsVariantList vList; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("className",KVS_PT_NONEMPTYSTRING,0,szClassName) - KVSCF_PARAMETER("parentHandle",KVS_PT_HOBJECT,KVS_PF_OPTIONAL,hParent) - KVSCF_PARAMETER("name",KVS_PT_STRING,KVS_PF_OPTIONAL,szName) - KVSCF_PARAMETER("parameterList",KVS_PT_VARIANTLIST,KVS_PF_OPTIONAL,vList) - KVSCF_PARAMETERS_END - - KviKvsObjectClass * pClass = KviKvsKernel::instance()->objectController()->lookupClass(szClassName); - if(!pClass) - { - KVSCF_pContext->error(__tr2qs("Class \"%Q\" is not defined"),&szClassName); - return false; - } - - KviKvsObject * pParent; - if(hParent != (kvs_hobject_t)0) - { - pParent = KviKvsKernel::instance()->objectController()->lookupObject(hParent); - if(!pParent) - { - KVSCF_pContext->error(__tr2qs("The specified parent object does not exist")); - return false; - } - } else { - pParent = 0; - } - - KviKvsObject * pObject = pClass->allocateInstance(pParent,szName,KVSCF_pContext,&vList); - - // epilogue: set the return value - KVSCF_pRetBuffer->setHObject(pObject ? pObject->handle() : (kvs_hobject_t)0); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: nothing - @type: - function - @title: - $nothing - @short: - Evaluates to an empty variable - @syntax: - <nothing> $nothing - @description: - Evaluates to an empty variable. This is a special value somewhat similar - to the [fnc]$null[/fnc] object: it is used to denote absence - of information. For example, a function might decide to return - a meaningful value when the input parameters are correct and - $nothing when the input parameters are wrong. - @seealso: - [fnc]$null[/fnc] - */ - - KVSCF(nothing) - { - KVSCF_pRetBuffer->setNothing(); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - - /* - @doc: null - @type: - function - @title: - $null - @short: - Evaluates to the null object handle. - @syntax: - <hobject> $null - @description: - Evaluates to the null object handle. This is a special - object handle that is returned by some functions. - Please note that writing $null is semantically equivalent to writing 0 - or even [fnc]$nothing[/fnc] in place of the handle, but $null increases code readability. - @seealso: - [fnc]$new[/fnc], [fnc]$nothing[/fnc] - */ - - KVSCF(nullCKEYWORDWORKAROUND) - { - KVSCF_pRetBuffer->setHObject(0); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: o - @type: - function - @title: - $o - @short: - Returns the RESET mIRC control character - @syntax: - <string> $o - @description: - Returns the RESET mIRC control character (CTRL+O).[br] - @seealso: - [fnc]$k[/fnc], [fnc]$b[/fnc], [fnc]$u[/fnc], [fnc]$r[/fnc] - */ - - KVSCF(o) - { - KVSCF_pRetBuffer->setString(QString(QChar(KVI_TEXT_RESET))); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: option - @type: - function - @title: - $option - @short: - Returns the value of an option - @syntax: - <string> $option(<optionName:string>) - @description: - Returns the current value of the internal option named <optionName>. - See the [cmd]option[/cmd] command documentation for more info about options. - @examples: - [example] - [cmd]echo[/cmd] $option(fontIrcView) - [/example] - @seealso: - [cmd]option[/cmd], - */ - - KVSCF(option) - { - QString szOpt; - // FIXME: This should return a variant in general - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("optionName",KVS_PT_NONEMPTYSTRING,0,szOpt) - KVSCF_PARAMETERS_END - QString tmp; - if(g_pApp->getOptionString(szOpt,tmp))KVSCF_pRetBuffer->setString(tmp); - else { - KVSCF_pContext->warning(__tr2qs("There is no option named '%Q'"),&szOpt); - KVSCF_pRetBuffer->setNothing(); - } - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: query - @type: - function - @title: - $query - @short: - Retrieves the window ID of a specified query - @syntax: - $query[(<target>[,<irc context id>])] - @description: - Returns the [b]window ID[/b] of the query that has <target> - in the list of targets and is bound to the connection specified by - <irc context id>[br] - If no window matches the specified target or context, and invalid - window ID is returned (0).[br] - If no <irc context id> is specified, this function looks for - the query in the current connection context (if any).[br] - If no <target> is specified, this function returns the current - query window ID, if executed in a query, else 0.[br] - @examples: - [example] - [/example] - @seealso: - [fnc]$window[/fnc], - [fnc]$channel[/fnc], - [fnc]$console[/fnc] - [doc:window_naming_conventions]Window naming conventions[/doc] - */ - - KVSCF(query) - { - QString szName; - kvs_uint_t uContextId; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("query_name",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szName) - KVSCF_PARAMETER("context_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uContextId) - KVSCF_PARAMETERS_END - - KviWindow * wnd; - if(KVSCF_pParams->count() > 0) - { - if(KVSCF_pParams->count() > 1) - { - KviConsole * cons = g_pApp->findConsole(uContextId); - if(!cons)KVSCF_pContext->warning(__tr2qs("No such IRC context (%u)"),uContextId); - else { - if(cons->connection()) - wnd = cons->connection()->findQuery(szName); - else - wnd = 0; - } - } else { - if(KVSCF_pContext->window()->connection())wnd = KVSCF_pContext->window()->connection()->findQuery(szName); - else { - if(!KVSCF_pContext->window()->console()) - KVSCF_pContext->warning(__tr2qs("This window is not associated to an IRC context")); - wnd = 0; - } - } - } else { - if(KVSCF_pContext->window()->type() == KVI_WINDOW_TYPE_QUERY)wnd = KVSCF_pContext->window(); - } - - KVSCF_pRetBuffer->setInteger((kvs_int_t)(wnd ? wnd->numericId() : 0)); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: r - @type: - function - @title: - $r - @short: - Returns the REVERSE mIRC control character - @syntax: - <string> $r - @description: - Returns the REVERSE mIRC control character (CTRL+R).[br] - @seealso: - [fnc]$k[/fnc], [fnc]$b[/fnc], [fnc]$u[/fnc], [fnc]$o[/fnc] - */ - - KVSCF(r) - { - KVSCF_pRetBuffer->setString(QString(QChar(KVI_TEXT_REVERSE))); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: rand - @type: - function - @title: - $rand - @short: - Generates a random number - @syntax: - $rand(<max>) - @description: - Returns a random integer number from 0 to max inclusive. - You can repeat sequences of random numbers by calling [cmd]srand[/cmd] - with the same seed value. If [cmd]srand[/cmd] has not been called - $rand is automatically seeded with value of 1. - If no <max> is specified, this function returns an integer between - 0 and RAND_MAX that is system dependant. - @examples: - [example] - [/example] - @seealso: - [cmd]srand[/cmd] - */ - - KVSCF(rand) - { - // prologue: parameter handling - kvs_uint_t uMax; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("max",KVS_PT_UINT,KVS_PF_OPTIONAL,uMax) - KVSCF_PARAMETERS_END - if(KVSCF_pParams->count() > 0) - { - KVSCF_pRetBuffer->setInteger(::rand() % (uMax+1)); - } else { - KVSCF_pRetBuffer->setInteger(::rand()); - } - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: real - @type: - function - @title: - $real - @short: - Casts a variable to a real - @syntax: - <real> $real(<data:variant>) - @description: - Forces <data> to be a "real" data type with the following - semantics:[br] - [ul] - [li]If <data> is a real, <data> itself is returned.[/li] - [li]If <data> is an integer, <data> itself is returned, in its real form.[/li] - [li]If <data> is a boolean, its numeric value is returned (either 1.0 or 0.0).[/li] - [li]If <data> is an array, the count of its items is returned.[/li] - [li]If <data> is a hash, the count of its items is returned.[/li] - [li]If <data> is a string, its length is returned.[/li] - [li]If <data> is an object, 0.0 is returned if the reference is null (invalid) and 1.0 otherwise[/li] - [/ul] - This function is similar to the C (double) cast.[br] - Note that since KVIrc does most of the casting work automatically - you shouldn't need to use this function. - @seealso: - [fnc]$int[/fnc] - */ - - KVSCF(real) - { - KviKvsVariant * v; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("data",KVS_PT_VARIANT,0,v) - KVSCF_PARAMETERS_END - - kvs_real_t dVal; - if(v->asReal(dVal)) - KVSCF_pRetBuffer->setReal(dVal); - else { - kvs_int_t iVal; - v->castToInteger(iVal); - KVSCF_pRetBuffer->setReal((double)iVal); - } - return true; - } - - /* - @doc: receivedBytes - @type: - function - @title: - $receivedBytes - @short: - Returns total received bytes - @syntax: - <uint> $receivedBytes() - @description: - Returns total received bytes - @seealso: - [fnc]$sentBytes[/fnc] - */ - - KVSCF(receivedBytes) - { - KVSCF_pRetBuffer->setInteger(g_uIncomingTraffic); - return true; - } - - /* - @doc: rsort - @type: - function - @title: - $rsort - @short: - Sorts an array in reverse order - @syntax: - <array> $rsort(<data:array>) - @description: - Sorts an array in descending order. - @seealso: - [fnc]$sort[/fnc] - */ - - KVSCF(rsort) - { - KviKvsArrayCast a; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("data",KVS_PT_ARRAYCAST,0,a) - KVSCF_PARAMETERS_END - - if(a.array()) - { - KviKvsArray * arry = new KviKvsArray(*(a.array())); - arry->rsort(); - KVSCF_pRetBuffer->setArray(arry); - } else { - KVSCF_pRetBuffer->setArray(new KviKvsArray()); - } - return true; - } -}; - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions_sz.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions_sz.cpp deleted file mode 100644 index 3fb132aa35..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_corefunctions_sz.cpp +++ /dev/null @@ -1,1109 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_corefunctions_sz.cpp -// Created on Fri 31 Oct 2003 01:52:04 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_corefunctions.h" - -#include "kvi_kvs_kernel.h" -#include "kvi_kvs_arraycast.h" -#include "kvi_kvs_object_controller.h" - -#include "kvi_window.h" -#include "kvi_out.h" -#include "kvi_locale.h" -#include "kvi_app.h" -#include "kvi_options.h" -#include "kvi_channel.h" -#include "kvi_console.h" -#include "kvi_time.h" -#include "kvi_ircuserdb.h" -#include "kvi_modulemanager.h" -#include "kvi_mirccntrl.h" -#include "kvi_sourcesdate.h" -#include "kvi_socket.h" - -#include <stdlib.h> // rand & srand - -/* - Data types: - - <variant> - <nothing> - <scalar> - <boolean> - <string> - <numeric> - <integer> - <real> - <array> - <hash> - <object> - - $isEmpty(<nothing>) == $true - - <nothing> == <empty string> - <null> == <null object> - - -*/ - -namespace KviKvsCoreFunctions -{ - ///////////////////////////////////////////////////////////////////////////////////////// - - // FIXME: #warning "THIS HAS TO WORK FOR QUERIES TOO!" - /* - @doc: selected - @type: - function - @title: - $selected - @short: - Returns the list of selected nicknames in the channel - @syntax: - <array> $selected - <array> $selected(<window id:string>) - @description: - The form with the <window id> parameter returns an array of the selected - nicknames in the channel designated by <window id>. - The form without parameters returns an array of the selected nicknames - in the current window (assuming that it is a channel), - thus it is equivalent to calling $selected([fnc]$window[/fnc]) - The returned value may be assigned to a dictionary too: it will be used to simulate an array.[br] - In a non-array/dictionary context it returns the selected nicknames as a comma separated list. - @examples: - [example] - [cmd]echo[/cmd] $selected - [cmd]foreach[/cmd](%i,$selected)[cmd]echo[/cmd] %i - [/example] - @seealso: - [fnc]$window[/fnc], - [fnc]$channel[/fnc], - [doc:window_naming_conventions]Window naming conventions[/doc] - */ - - KVSCF(selected) - { - QString winId; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("winId",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,winId) - KVSCF_PARAMETERS_END - - KviWindow * wnd; - if(KVSCF_pParams->count() > 0) - { - wnd = g_pApp->findWindow(winId.utf8().data()); - if(!wnd) - { - KVSCF_pContext->warning(__tr2qs("Window with ID '%s' not found, returning empty string"),winId.utf8().data()); - KVSCF_pRetBuffer->setNothing(); - return true; - } - } else { - wnd = KVSCF_pContext->window(); - } - - if(wnd->type() != KVI_WINDOW_TYPE_CHANNEL) - { - KVSCF_pContext->warning(__tr2qs("The specified window is not a channel")); - KVSCF_pRetBuffer->setNothing(); - return true; - } - - KviKvsArray * a = new KviKvsArray(); - - kvs_int_t i = 0; - for(QString * s = ((KviChannel *)wnd)->firstSelectedNickname();s;s = ((KviChannel *)wnd)->nextSelectedNickname()) - { - a->set(i,new KviKvsVariant(*s)); - i++; - } - - KVSCF_pRetBuffer->setArray(a); - return true; - } - - - /* - @doc: sentBytes - @type: - function - @title: - $sentBytes - @short: - Returns total sent bytes - @syntax: - <uint> $sentBytes() - @description: - Returns total sent bytes - @seealso: - [fnc]$receivedBytes[/fnc] - */ - - KVSCF(sentBytes) - { - KVSCF_pRetBuffer->setInteger(g_uOutgoingTraffic); - return true; - } - - /* - @doc: serialize - @type: - function - @title: - <string> $serialize(<data:mixed>) - @short: - Encodes variable to JSON string - @syntax: - <string> $serialize(<data:mixed>) - @description: - Decodes JSON-encoded string - $serialize() returns a string containing a byte-stream representation of value that can be stored anywhere. - @seealso: - [fnc]$serialize[/fnc] - */ - KVSCF(serialize) - { - KviKvsVariant *pVar = 0; - QString szBuffer; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("data",KVS_PT_VARIANT,0,pVar) - KVSCF_PARAMETERS_END - - if(!pVar) return false; - pVar->serialize(szBuffer); - KVSCF_pRetBuffer->setString(szBuffer); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: server - @type: - function - @title: - $server - @short: - Returns the current server name (if any) - @syntax: - <string> $server[(irc_context_id:uint)] - @description: - Returns the current server name of the specified IRC context.[br] - If no <irc_context_id> is specified, the current IRC context is used.[br] - If you are not connected to a server, this function will return an empty string.[br] - If the current window does not belong to any IRC context and no irc_context_id - is specified, this function prints a warning and also returns an empty string.[br] - */ - - KVSCF(server) - { - kvs_uint_t uCntx; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("irc_context_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uCntx) - KVSCF_PARAMETERS_END - - KviConsole * cns; - - if(KVSCF_pParams->count() > 0) - { - cns = g_pApp->findConsole(uCntx); - if(cns) - { - if(cns->context()->isConnected() || cns->context()->isLoggingIn()) - KVSCF_pRetBuffer->setString(cns->connection()->currentServerName()); - else - KVSCF_pRetBuffer->setNothing(); - } else { - KVSCF_pRetBuffer->setNothing(); - } - } else { - if(KVSCF_pContext->window()->console()) - { - cns = KVSCF_pContext->window()->console(); - if(cns->context()->isConnected() || cns->context()->isLoggingIn()) - KVSCF_pRetBuffer->setString(cns->connection()->currentServerName()); - else - KVSCF_pRetBuffer->setNothing(); - } else { - KVSCF_pContext->warning(__tr2qs("This window has no associated IRC context")); - KVSCF_pRetBuffer->setNothing(); - } - } - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: sort - @type: - function - @title: - $sort - @short: - Sorts an array - @syntax: - <array> $sort(<data:array>) - @description: - Sorts an array in ascending order. - @seealso: - [fnc]$rsort[/fnc] - */ - - KVSCF(sort) - { - KviKvsArrayCast a; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("data",KVS_PT_ARRAYCAST,0,a) - KVSCF_PARAMETERS_END - - if(a.array()) - { - KviKvsArray * arry = new KviKvsArray(*(a.array())); - arry->sort(); - KVSCF_pRetBuffer->setArray(arry); - } else { - KVSCF_pRetBuffer->setArray(new KviKvsArray()); - } - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: string - @type: - function - @title: - $string - @short: - Casts a variable to a string - @syntax: - <integer> $string(<data:variant>) - @description: - Forces <data> to be a string data type with the following semantics: - [ul] - [li]If <data> is a string then <data> itself is returned.[/li] - [li]If <data> is an integer then its decimal rappresentation is returned.[/li] - [li]If <data> is a real then its decimal floating-point rappresentation is returned.[/li] - [li]If <data> is a boolean then the string "1" is returned for a true value and the string "0" for a false value.[/li] - [li]If <data> is nothing (unset) then an empty string is returned[/li] - [li]If <data> is an array then a string with all the items converted to strings and separated by commas is returned[/li] - [li]If <data> is a hash then a string with all the values converted to strings and separated by commas is returned[/li] - [li]If <data> is a hobject then the string "object" is returned[/li] - [/ul] - Note that since KVIrc does most of the casting work automatically - you shouldn't need to use this function. - @seealso: - [fnc]$real[/fnc] - [fnc]$integer[/fnc] - */ - - KVSCF(string) - { - KviKvsVariant * v; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("data",KVS_PT_VARIANT,0,v) - KVSCF_PARAMETERS_END - - QString szVal; - v->asString(szVal); - KVSCF_pRetBuffer->setString(szVal); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: sw - @type: - function - @title: - $sw - @short: - Returns the value of a switch for an alias - @syntax: - <variant> $sw(<switch_name:string>[,<long_switch_name:string>]) - @description: - This function is valid and useful only in aliases. - It allows an alias to handle switches just like any other - KVIrc command. If a switch in the form -<letter> was - passed to the current alias then $sw(<letter>) - returns 1 (true). If a switch in the form -<letter>=<value> - was passed to the current alias then <value> is returned. - If the switch was not present at all then this function - returns an empty string (that evaluates to false in an expression). - A warning is printed if this function is used non-alias code. - @examples: - [example] - [cmd]alias[/cmd](test){ - if($sw(a,append)) [cmd]echo[/cmd] "Switch -a was passed" - %x = $sw(x); - if(%x) [cmd]echo[/cmd] "Switch -x=%x was passed" - } - test -a - test -x - test --append -x - test -a -x - test -a -x=test - test -a=10 -x=test - [/example] - */ - - KVSCF(sw) - { - QString szSwitch; - QString szLongSwitch; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("switch_name",KVS_PT_STRING,0,szSwitch) - KVSCF_PARAMETER("long_name",KVS_PT_STRING | KVS_PF_OPTIONAL ,0,szLongSwitch) - KVSCF_PARAMETERS_END - - KviKvsSwitchList * sl = KVSCF_pContext->aliasSwitchList(); - if(!sl) - { - KVSCF_pContext->warning(__tr2qs("The $sw() function can be used only in aliases")); - return true; - } - - KviKvsVariant * v; - - - if(szSwitch.length() > 1) - { - if(szLongSwitch.isEmpty()) - v = sl->find(szSwitch); - else - v = sl->find(szSwitch[0].unicode(),szLongSwitch); - }else { - if(szLongSwitch.isEmpty()) - v = sl->find(szSwitch[0]); - else - v = sl->find(szSwitch[0].unicode(),szLongSwitch); - } - - if(v)KVSCF_pRetBuffer->copyFrom(*v); - else KVSCF_pRetBuffer->setNothing(); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: target - @type: - function - @title: - $target - @short: - Returns the target of the current window - @syntax: - <string> $target - <string> $target(<window id>) - @description: - The form with the <window id> parameter returns the target - of the channel,query or dcc that has the specified ID. - The form without parameters returns the target of the current window, - thus it is equivalent to calling $target([fnc]$window[/fnc]). - For channel windows the target is the channel name, - for query windows it is the list of the "queried" users, for the - dcc windows it is the remote end of the connection. - The other windows have an empty target. - @examples: - [example] - [cmd]echo[/cmd] $target - [/example] - @seealso: - [fnc]$window[/fnc], - [fnc]$console[/fnc], - [fnc]$channel[/fnc], - [fnc]$query[/fnc], - [doc:window_naming_conventions]Window naming conventions[/doc] - */ - - KVSCF(target) - { - QString winId; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("winId",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,winId) - KVSCF_PARAMETERS_END - - KviWindow * wnd; - if(KVSCF_pParams->count() > 0) - { - wnd = g_pApp->findWindow(winId.utf8().data()); - if(!wnd) - { - KVSCF_pContext->warning(__tr2qs("Window with ID '%s' not found, returning empty string"),winId.utf8().data()); - KVSCF_pRetBuffer->setNothing(); - return true; - } - } else { - wnd = KVSCF_pContext->window(); - } - - //debug("CALLING $target on window %s",wnd->name()); - QString szTa = wnd->target(); - - - KVSCF_pRetBuffer->setString(wnd->target()); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: this - @type: - function - @title: - $this - @short: - Retrieves the ID of the current object - @syntax: - $this - @description: - Returns the ID of the current object or ('0') if there is - none. This function has a "quick" version with syntax: - [b]$$[/b][br] - */ - - /* - @doc: $ - @type: - function - @title: - $$ - @short: - Retrieves the ID of the current object - @syntax: - $$ - @description: - Returns the ID of the current object or ('0') if there is - none. This function has equivalent to [fnc]$this[/fnc] - */ - - KVSCF(thisCKEYWORDWORKAROUND) - { - // prologue: parameter handling - KviKvsObject * o = KVSCF_pContext->thisObject(); - KVSCF_pRetBuffer->setHObject(o ? o->handle() : ((kvs_hobject_t)0)); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: script_localization - @type: - generic - @title: - Localization of scripts - @short: - Explains how to add translation capabilities to your scripts - @body: - [p] - [big]Introduction[/big] - [/p] - [p] - Adding the translated versions of the strings adds a great - value to your scripts. The process of translating a part of - software is called localization. KVIrc offers some commands - and functions for this purpose and this document explains - briefly how to use them. - [/p] - - [p] - [big]The big picture[/big] - [/p] - [p] - All of the strings in your script are written in a "primary language". - The most common "primary language" is english, but theoretically - it can be any language of your choice. - [/p] - [p] - By the means of the gettext package programs you extract - the strings from your script and produce a translation file. - [/p] - [p] - The translation file is then effectively translated in another - language and later compiled in a binary form. - [/p] - [p] - The binary form translations are then loaded in the KVIrc - executable at runtime and a function is used to look up the - translations. - [/p] - - [p] - [big]How to translate scripts[/big] - [/p] - [p] - Your strings should be surrounded by the [fnc]$tr[/fnc]() function in the following way: - [example] - [fnc]$tr[/fnc]("your default language text") - [/example] - [/p] - [p] - Then you should run the xgettext command on your script files. - This is done by a shell commandline similar to the following:[br] - [pre]xgettext -o myscript.pot -ktr mykvsfile1.kvs mykvsfile2.kvs ...[/pre] - [/p] - [p] - Copy the translation file obtained in the following way:[br] - [pre]cp myscript.pot myscript_XX.pot[/pre] - Where the XX is your country/language code. For example, for Italian - it would be:[br] - [pre]cp myscript.pot myscript_it.po[/pre] - [/p] - [p] - Translate mytranslation_it.po. The format of the po file is straightforward. - There are msgid lines with the original english text and immediately - following msgstr lines that must be filled with the corresponding translation. - For example in Italian you would translate:[br] - msgid "your default language text" - msgstr "il tuo testo in linguaggio predefinito" - [/p] - [p] - Compile your translation to binary form with the following command:[br] - [pre]msgfmt -o myscript_it.mo myscript_it.po[/pre] - [/p] - [p] - Copy the generated *.mo file to the "locale" subdirectory - in the KVIrc's local directory (usually $HOME/.kvirc/locale/). - [/p] - [p] - Set the system language to the XX above with the following command:[br] - [pre]export LANG="XX"[/pre][br] - For Italian it would be:[br] - [pre]export LANG="it"[/pre][br] - [/p] - [p] - Start KVIrc and type in the commandline: - [example] - [cmd]echo[/cmd] [fnc]$tr[/fnc]("your default language text","myscript") - [/example] - If you did everything well, you should see the translated - text echoed in the window :)[br] - [/p] - [p] - Obviously if you don't set LANG="XX", the same command will - output the original string unchanged. - [/p] - [p] - You can manage translations in several languages by producing - several *.mo files all with the proper language/country code appended. - The right *.mo file will be magically loaded by KVIrc that - will look up the user's LANG variable. (If you don't want - to use LANG, you can use KVIRC_LANG instead, it will still work). - [/p] - - [big]Caveats[/big] - [/p] - [p] - You should NEVER use variables or identifiers inside the $tr() function. - This because the translation files are generated offline, - when the string is not evaluated yet (i.e variables ad identifiers - are not substituted by their actual return values). - The translation process, instead, happens at runtime, when - the variables and identifiers have been substituted by their - actual values. This would lead to a mismatch between the - string you look up in the translation catalogue and the - effectively translated one. If you need to include variables - in your strings you should compose the string with smaller pieces - [example] - [cmd]echo[/cmd] [fnc]$tr[/fnc]("On this channel") %number [fnc]$tr[/fnc]("users are operators") - [/example] - [/p] - [p] - The translation process can be realized only if your - scripts are written in external files. This makes sense since - if you're translating the script then you will probably want to - distribute it and the only way to distribute it is on files. - But well.. this is a caveat. - [/p] - */ - - /* - @doc: tr - @type: - function - @title: - $tr - @short: - Translates an english string to the current language - @syntax: - <string> $tr(<default_language_string:string>[,<catalogue:string>]) - @description: - This function searches for the translation of <default_language_string> - in the specified translation <catalogue> or in the main - KVIrc translation file if <catalogue> is omitted.[br] - If no translation is found then <english_string> is returned.[br] - <default_language_string> is a string in your script default - language (which should probably be english since it is the - most common language spoken by the translators...).[br] - If the <catalogue> is not loaded yet, KVIrc will attempt to load it, - but only the first time that the catalogue is accessed (i.e. a load - failure will cause the catalogue to be ignored completly until [cmd]trunload[/cmd] - is explicitly used.[br] - KVIrc will search the catalogue only in [fnc]$file.localdir[/fnc]/locale/ - and in [fnc]$file.globaldir[/fnc]/locale/. If your catalogues are - in some other place then you must load them explicitly by the - means of [cmd]trload[/cmd]. - For more informations see the documentation about [doc:script_localization]script localization[/doc]. - @examples: - [example] - [cmd]echo[/cmd] $tr("Hello World!") - [/example] - @seealso: - [cmd]trload[/cmd], [cmd]trunload[/cmd] - */ - - KVSCF(tr) - { - // prologue: parameter handling - QString szString; - QString szCatalogue; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("default_language_string",KVS_PT_STRING,0,szString) - KVSCF_PARAMETER("catalogue",KVS_PT_STRING,KVS_PF_OPTIONAL,szCatalogue) - KVSCF_PARAMETERS_END - if(szString.isEmpty()) return true; - // body: the real job - QString translation; - - if(!szCatalogue.isEmpty()) - { - KviMessageCatalogue * pCat = KviLocale::getLoadedCatalogue(szCatalogue); - if(pCat) - { - translation = pCat->translateToQString(szString); - } else { - // attempt to load it automatically - QString szDir; - g_pApp->getLocalKvircDirectory(szDir,KviApp::Locale); - if(!KviLocale::loadCatalogue(szCatalogue,szDir)) - { - g_pApp->getGlobalKvircDirectory(szDir,KviApp::Locale); - KviLocale::loadCatalogue(szCatalogue,szDir); - } - // If the code above fails to load the catalogue - // then __tr2qs_ctx_no_xgettext will place - // a dummy catalogue in its place - // This means that the next call to getLoadedCatalogue will - // not fail unless /trunload is explicitly used - // This will avoid trashing the user's disk too much - // when a catalogue for a given language is not available - translation = __tr2qs_ctx_no_xgettext(szString,szCatalogue); - } - } else { - translation = __tr2qs_no_xgettext(szString); - } - - // epilogue: set the return value - KVSCF_pRetBuffer->setString(translation); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: true - @type: - function - @title: - $true - @short: - The boolean true constant - @syntax: - <boolean> $true - @description: - Evaluates to the true boolean constant. True - is equivalent to the integer 1 too. This function/constant - is useful to keep your code readable: when you - have a variable that can assume boolean values it's - nicer to use $true and [fnc]$false[/fnc] instead of - the integer constants 1 and 0. The reader will - undestand immediately that the variable simply can't - assume any other value. - @examples: - [example] - %a = $true - [cmd]echo[/cmd] $typeof(%a) - [cmd]echo[/cmd] $(%a + 1) - [/example] - @seealso: - [fnc]$false[/fnc] - */ - - KVSCF(trueCKEYWORDWORKAROUND) - { -#ifdef COMPILE_NEW_KVS - KVSCF_pRetBuffer->setBoolean(true); -#endif - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: typeof - @type: - function - @title: - $typeof - @short: - Returns the internal data type of a variable - @syntax: - <string> $typeof(<data:variant>) - @description: - Returns the internal data type of the <data>. - @examples: - [example] - [cmd]echo[/cmd] $typeof("test") - %a = "test" - [cmd]echo[/cmd] $typeof(%a) - %a = 1 - [cmd]echo[/cmd] $typeof(%a) - %a = $(1 + 2) - [cmd]echo[/cmd] $typeof(%a) - [cmd]echo[/cmd] $typeof($typeof(%a)) - [/example] - */ - - KVSCF(typeofCKEYWORDWORKAROUND) - { -#ifdef COMPILE_NEW_KVS - KviKvsVariant * v; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("data",KVS_PT_VARIANT,0,v) - KVSCF_PARAMETERS_END - - QString szType; - v->getTypeName(szType); - KVSCF_pRetBuffer->setString(szType); -#endif - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: u - @type: - function - @title: - $u - @short: - Returns the UNDERLINE mIRC control character - @syntax: - <string> $u - @description: - Returns the UNDERLINE mIRC control character (CTRL+U).[br] - @seealso: - [fnc]$k[/fnc], [fnc]$b[/fnc], [fnc]$r[/fnc], [fnc]$o[/fnc] - */ - - KVSCF(u) - { - KVSCF_pRetBuffer->setString(QString(QChar(KVI_TEXT_UNDERLINE))); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: unicode - @type: - function - @title: - $unicode - @short: - Returns the UNICODE code of a sets of characters - @syntax: - <variant> $unicode(<char:string>) - @description: - If <char> is composed only of a single character - then returns its UNICODE code point as an integer. - If <char> is composed of more than one character - then an array of UNICODE code points is returned. - @seealso: - [fnc]$cr[/fnc], [fnc]$lf[/fnc], [fnc]$char[/fnc] - */ - - KVSCF(unicode) - { - QString sz; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("char",KVS_PT_NONEMPTYSTRING,0,sz) - KVSCF_PARAMETERS_END - - if(sz.length() > 1) - { - KviKvsArray * a = new KviKvsArray(); - for(kvs_int_t i=0;i<sz.length();i++) - a->set(i,new KviKvsVariant((kvs_int_t)(sz[(int)i].unicode()))); - KVSCF_pRetBuffer->setArray(a); - } else { - KVSCF_pRetBuffer->setInteger((kvs_int_t)(sz[0].unicode())); - } - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: unixtime - @type: - function - @title: - $unixTime - @short: - Returns the current UNIX time - @syntax: - <integer> $unixtime - @description: - Returns the time since the Epoch (00:00:00 UTC, January 1, 1970), - measured in seconds. - @seealso: - [fnc]$date[/fnc], [fnc]$hpTimeStamp[/fnc] - */ - - KVSCF(unixtime) - { - KVSCF_pRetBuffer->setInteger((kvs_int_t)(time(0))); - return true; - } - - /* - @doc: unserialize - @type: - function - @title: - <mixed> $unserialize(<data:string>) - @short: - Decodes JSON-encoded string - @syntax: - <mixed> $unserialize(<data:string>) - @description: - Decodes JSON-encoded string - @seealso: - [fnc]$serialize[/fnc] - */ - - KVSCF(unserialize) - { - QString szData; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("data",KVS_PT_NONEMPTYSTRING,0,szData) - KVSCF_PARAMETERS_END - - KviKvsVariant *pVar = KviKvsVariant::unserialize(szData); - if(pVar) - KVSCF_pRetBuffer->copyFrom(pVar); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: username - @type: - function - @title: - $username - @short: - Returns the username of the specified user - @syntax: - <string> $username(<nickname:string>) - @description: - Returns the username of the specified IRC user IF it is known.[br] - The username is known if [fnc]$isWellKnown[/fnc] returns 1.[br] - The username is generally known if the user is on a channel with you - or has an open query with you.[br] - Detailed explaination:[br] - KVIrc has an internal database of users that are currently - visible by *this client*: this includes users on open channels - and queries.[br] The other IRC users are NOT in the database: - this means that KVIrc knows NOTHING about them and can't return - any information immediately. In this case this function will return - an EMPTY string.[br] - If a user is in the database, at least his nickname is known.[br] - The username and hostname are known only if the server provides that information - spontaneously or after a KVIrc request.[br] - KVIrc requests user information for all the users in open queries - and channels. This information takes some time to be retrieved, - in this interval of time KVIrc knows only the user's nickname. - This function will return the string "*" in this case.[br] - @seealso: - [fnc]$isWellKnown[/fnc], [$fnc]$hostname[/fnc], [cmd]awhois[/cmd] - */ - - KVSCF(username) - { - QString szNick; - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("nick",KVS_PT_NONEMPTYSTRING,0,szNick) - KVSCF_PARAMETERS_END - - if(KVSCF_pContext->window()->console()) - { - if(KVSCF_pContext->window()->console()->isConnected()) - { - KviIrcUserEntry * e = KVSCF_pContext->window()->connection()->userDataBase()->find(szNick); - if(e) - { - KVSCF_pRetBuffer->setString(e->user()); - return true; - } - } - } - - KVSCF_pRetBuffer->setNothing(); - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: version - @type: - function - @title: - $version - @short: - Returns informations about the version of KVIrc. - @syntax: - <string> $version() - <string> $version(<type:string>) - @description: - Returns informations about the version of the currently running KVIrc.[br] - Type can be one of:[br] - [ul] - [li]v: return the current numeric version[/li] - [li]s: return the current sources date[/li] - [li]r: return the release name[/li] - [li]b: return the build date in human readable form[/li] - [/ul] - If <type> is omitted then v is assumed.[br] - @examples: - [example] - [cmd]echo[/cmd] $version $version(r) - [/example] - @seealso: - [fnc]$features[/fnc] - */ - - KVSCF(version) - { - QString szType; - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("type",KVS_PT_STRING,KVS_PF_OPTIONAL,szType) - KVSCF_PARAMETERS_END - - if(szType.isEmpty()) - KVSCF_pRetBuffer->setString(KVI_VERSION); - else { - if(szType.find('r') != -1)KVSCF_pRetBuffer->setString(KVI_RELEASE_NAME); - else if(szType.find('s') != -1)KVSCF_pRetBuffer->setString(KVI_SOURCES_DATE); - else if(szType.find('b') != -1)KVSCF_pRetBuffer->setString(KVI_BUILD_DATE); - else KVSCF_pRetBuffer->setString(KVI_VERSION); - } - return true; - } - - ///////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: window - @type: - function - @title: - $window - @short: - Retrieve the id of a specified window. - @syntax: - <string> $window - <string> $window([<caption_text:hash>[,<context_id:uint>]]) - @description: - Returns the [b]window id[/b] of the first window that - has the specified <caption text>.[br] - If no window matches the specified <caption text>, and invalid - window id is returned (0).[br] - If no <caption text> is specified , this function returns the id - of the current window.[br] - <context_id> restricts search in only one irc context. - @examples: - [example] - [cmd]echo[/cmd] This is the window with id $window - [/example] - @seealso: - [fnc]$channel[/fnc], - [fnc]$query[/fnc], - [fnc]$console[/fnc], - [doc:window_naming_conventions]Window naming conventions[/doc] - */ - - KVSCF(window) - { - //#warning "FIXME: the window identifiers could be numbers!" - QString szCaption; - kvs_int_t iContextId; // kvs_int_t is 64bit while int is 32 (and thus KVSCF_PARAMETER() crashes) - - KVSCF_PARAMETERS_BEGIN - KVSCF_PARAMETER("caption_text",KVS_PT_STRING,KVS_PF_OPTIONAL,szCaption) - KVSCF_PARAMETER("context_id",KVS_PT_INTEGER,KVS_PF_OPTIONAL,iContextId) - KVSCF_PARAMETERS_END - - if(KVSCF_pParams->count() < 2) - iContextId = -1; - - KviWindow * pWnd; - if(szCaption.isEmpty()) - { - pWnd = KVSCF_pContext->window(); - } else { - pWnd = g_pApp->findWindowByCaption(szCaption,iContextId); - if(!pWnd) - { - //follow the documented behaviour - KVSCF_pRetBuffer->setInteger(0); - return true; - } - } - KVSCF_pRetBuffer->setInteger(pWnd->numericId()); - return true; - } -}; - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands.cpp deleted file mode 100644 index 04af2d8583..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands.cpp +++ /dev/null @@ -1,237 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_coresimplecommands.cpp -// Created on Fri 31 Oct 2003 00:04:25 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_ircconnectionserverinfo.h" - -#include "kvi_kvs_coresimplecommands.h" - -#include "kvi_kvs_kernel.h" -#include "kvi_options.h" -#include "kvi_ircconnection.h" -#include "kvi_locale.h" -#include "kvi_kvs_treenode_command.h" - -#include <qregexp.h> -#include <qstringlist.h> - -namespace KviKvsCoreSimpleCommands -{ - void init() - { - KviKvsKernel * pKern = KviKvsKernel::instance(); - -#define _REGCMD(__cmdName,__routine) \ - { \ - KviKvsCoreSimpleCommandExecRoutine * r = new KviKvsCoreSimpleCommandExecRoutine; \ - r->proc = KVI_PTR2MEMBER(KviKvsCoreSimpleCommands::__routine); \ - pKern->registerCoreSimpleCommandExecRoutine(QString(__cmdName),r); \ - } - // a_f - _REGCMD("admin",rfc2812wrapper) - _REGCMD("away",away) - _REGCMD("back",back) - _REGCMD("ban",ban) - _REGCMD("beep",beep) - _REGCMD("buttonctl",buttonctl) - _REGCMD("codepage",rfc2812wrapper) - _REGCMD("ctcp",ctcp) - _REGCMD("debug",debug) - _REGCMD("delete",deleteCKEYWORDWORKAROUND) - _REGCMD("delpopupitem",delpopupitem) - _REGCMD("destroy",deleteCKEYWORDWORKAROUND) - _REGCMD("deop",deop) - _REGCMD("devoice",devoice) - _REGCMD("die",error) - _REGCMD("echoprivmsg",echoprivmsg) - _REGCMD("echo",echo) - _REGCMD("error",error) - _REGCMD("eval",eval) - _REGCMD("eventctl",eventctl) - _REGCMD("exit",exit) - // g_l - _REGCMD("halt",halt) - _REGCMD("help",help) - _REGCMD("host",host) - _REGCMD("include",parse) - _REGCMD("info",rfc2812wrapper) - _REGCMD("invite",rfc2812wrapper) - _REGCMD("join",join) - _REGCMD("kick",kick) - _REGCMD("killtimer",killtimer) - _REGCMD("leave",part) - _REGCMD("links",rfc2812wrapper) - _REGCMD("list",rfc2812wrapper) - _REGCMD("listtimers",listtimers) - _REGCMD("lusers",rfc2812wrapper) - // m_r - _REGCMD("me",me) - _REGCMD("mode",mode) - _REGCMD("motd",rfc2812wrapper) - _REGCMD("msg",privmsg) - _REGCMD("nick",nick) - _REGCMD("notice",notice) - _REGCMD("op",op) - _REGCMD("openurl",openurl) - _REGCMD("oper",rfc2812wrapper) - _REGCMD("option",option) - _REGCMD("parse",parse) - _REGCMD("part",part) - _REGCMD("pass",rfc2812wrapper) - _REGCMD("play",play) - _REGCMD("popup",popup) - _REGCMD("privmsg",privmsg) - _REGCMD("query",query) - _REGCMD("quit",quit) - _REGCMD("quote",raw) - _REGCMD("raise",raise) - _REGCMD("raw",raw) - _REGCMD("return",returnCKEYWORDWORKAROUND) - _REGCMD("rebind",rebind) - // s_z - _REGCMD("run",run) - _REGCMD("say",say) - _REGCMD("server",server) - _REGCMD("service",rfc2812wrapper) - _REGCMD("setmenu",setmenu) - _REGCMD("setreturn",setreturn) - _REGCMD("sockets",rfc2812wrapper) - _REGCMD("squery",rfc2812wrapper) - _REGCMD("squit",rfc2812wrapper) - _REGCMD("srand",srand) - _REGCMD("stats",rfc2812wrapper) - _REGCMD("time",rfc2812wrapper) - _REGCMD("topic",topic) - _REGCMD("trace",rfc2812wrapper) - _REGCMD("trload",trload) - _REGCMD("trunload",trunload) - _REGCMD("unban",unban) - _REGCMD("version",rfc2812wrapper) - _REGCMD("voice",voice) - _REGCMD("warning",warning) - _REGCMD("who",rfc2812wrapper) - _REGCMD("whois",whois) - _REGCMD("whowas",whowas) - -#undef _REGCMD - } - - - bool multipleModeCommand(KviKvsRunTimeContext * __pContext,KviKvsVariantList * __pParams,KviKvsSwitchList * __pSwitches,char plusminus,char flag) - { - QString szTokens; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("tokens",KVS_PT_STRING,KVS_PF_APPENDREMAINING,szTokens) - KVSCSC_PARAMETERS_END - - KVSCSC_REQUIRE_CONNECTION - - if(KVSCSC_pWindow->type() != KVI_WINDOW_TYPE_CHANNEL) - { - KVSCSC_pContext->warning(__tr2qs("This is not a channel")); - return true; - } - - QStringList sl = QStringList::split(QRegExp("[, ]+"),szTokens,false); - - KviQCString szFlags; - KviQCString szTarget = KVSCSC_pConnection->encodeText(KVSCSC_pWindow->windowName()); - KviQCString szMessage; - - int i = 0; - for(QStringList::Iterator it = sl.begin();it != sl.end();++it) - { - KviQCString szTxt = KVSCSC_pConnection->encodeText(*it); - if(!szTxt.isEmpty()) - { - szFlags += flag; - if(szMessage.length() > 0)szMessage += " "; - szMessage += szTxt; - i++; - if(i >= KVSCSC_pConnection->serverInfo()->maxModeChanges()) - { - if(!KVSCSC_pConnection->sendFmtData("MODE %s %c%s %s",szTarget.data(),plusminus,szFlags.data(),szMessage.data())) - return KVSCSC_pContext->warningNoIrcConnection(); - i = 0; - szFlags = ""; - szMessage = ""; - } - } - } - - if(i > 0) - { - if(!KVSCSC_pConnection->sendFmtData("MODE %s %c%s %s",szTarget.data(),plusminus,szFlags.data(),szMessage.data())) - return KVSCSC_pContext->warningNoIrcConnection(); - } - - return true; - } - - /* - @doc: rfc2821wrappers - @title: - RFC2821 Wrappers - @type: - generic - @short: - Wrappers for rfc2821 commands - @body: - Some less used KVIrc commands are implemented as simple wrappers - around the standard [doc]rfc2821[/doc] commands.[br] - For example, the /OPER command will be used only by server operators - and probably only once per connection.[br] - These commands should only be needed by experienced IRC users. - Due to this fact, these commands have no special kind of parsing performed by KVIrc; - the parameters are extracted, the identifiers are parsed normally - and are sent to the server without any semantic check.[br] - This means that while OPER requires two parameters, KVIrc will not - complain if you send a single parameter only or use ten parameters.[br] - The exact parameter syntax/semantic checking is left to you.[br] - This also means that if some of these commands accept parameters with spaces, - it is left to you to add the leading ':' before the last parameter.[br] - You should refer to [doc]rfc2812[/doc] if any of these commands do not work properly for you.[br] - */ - - KVSCSC(rfc2812wrapper) - { - QString szText; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("text",KVS_PT_STRING,KVS_PF_OPTIONAL | KVS_PF_APPENDREMAINING,szText) - KVSCSC_PARAMETERS_END - - KVSCSC_REQUIRE_CONNECTION - - KviQCString txt = KVSCSC_pConnection->encodeText(szText); - KviQCString cmd = KVSCSC_pConnection->encodeText(((KviKvsTreeNodeCommand *)(KVSCSC_pContext->defaultReportLocation()))->commandName()); - - if(!KVSCSC_pConnection->sendFmtData("%s %s",cmd.data(),txt.data() ? txt.data() : "")) - return KVSCSC_pContext->warningNoIrcConnection(); - - return true; - } - -}; - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands.h b/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands.h deleted file mode 100644 index d218f37d55..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef _KVI_KVS_CORESIMPLECOMMANDS_H_ -#define _KVI_KVS_CORESIMPLECOMMANDS_H_ -//============================================================================= -// -// File : kvi_kvs_coresimplecommands.h -// Created on Fri 31 Oct 2003 00:04:25 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_switchlist.h" -#include "kvi_kvs_parameterprocessor.h" - - -#define KVSCSC(_name) bool _name(KviKvsRunTimeContext * __pContext,KviKvsVariantList * __pParams,KviKvsSwitchList * __pSwitches) - -#define KVSCSC_pContext __pContext -#define KVSCSC_pParams __pParams -#define KVSCSC_pSwitches __pSwitches - -#define KVSCSC_PARAMETER(a,b,c,d) KVS_PARAMETER(a,b,c,d) - -#define KVSCSC_PARAMETERS_BEGIN \ - KVS_PARAMETERS_BEGIN(parameter_format_list) - -#define KVSCSC_PARAMETERS_END \ - KVS_PARAMETERS_END \ - if(!KviKvsParameterProcessor::process(KVSCSC_pParams,KVSCSC_pContext,parameter_format_list))return false; - -#define KVSCSC_REQUIRE_CONNECTION \ - if(!KVSCSC_pContext->window()->context())return KVSCSC_pContext->errorNoIrcContext(); \ - if(!KVSCSC_pContext->window()->connection())return KVSCSC_pContext->warningNoIrcConnection(); - -#define KVSCSC_pWindow __pContext->window() -#define KVSCSC_pConnection __pContext->window()->connection() -#define KVSCSC_pIrcContext __pContext->context() - -namespace KviKvsCoreSimpleCommands -{ - // a_f - KVSCSC(away); - KVSCSC(back); - KVSCSC(ban); - KVSCSC(beep); - KVSCSC(buttonctl); - KVSCSC(ctcp); - KVSCSC(debug); - KVSCSC(deleteCKEYWORDWORKAROUND); - KVSCSC(delpopupitem); - KVSCSC(deop); - KVSCSC(devoice); - KVSCSC(echoprivmsg); - KVSCSC(echo); - KVSCSC(error); - KVSCSC(eval); - KVSCSC(eventctl); - KVSCSC(exit); - // g_l - KVSCSC(halt); - KVSCSC(help); - KVSCSC(host); - KVSCSC(join); - KVSCSC(kick); - KVSCSC(killtimer); - KVSCSC(listtimers); - // m_r - KVSCSC(me); - KVSCSC(mode); - KVSCSC(nick); - KVSCSC(notice); - KVSCSC(op); - KVSCSC(openurl); - KVSCSC(option); - KVSCSC(parse); - KVSCSC(part); - KVSCSC(play); - KVSCSC(popup); - KVSCSC(privmsg); - KVSCSC(query); - KVSCSC(quit); - KVSCSC(raise); - KVSCSC(raw); - KVSCSC(returnCKEYWORDWORKAROUND); - KVSCSC(rebind); - KVSCSC(rfc2812wrapper); - KVSCSC(run); - // s_z - KVSCSC(say); - KVSCSC(server); - KVSCSC(setmenu); - KVSCSC(setreturn); - KVSCSC(srand); - KVSCSC(topic); - KVSCSC(trload); - KVSCSC(trunload); - KVSCSC(unban); - KVSCSC(voice); - KVSCSC(warning); - KVSCSC(whois); - KVSCSC(whowas); - - bool multipleModeCommand(KviKvsRunTimeContext * __pContext,KviKvsVariantList * __pParams,KviKvsSwitchList * __pSwitches,char plusminus,char flag); - - void init(); -}; - -#endif //!_KVI_KVS_CORESIMPLECOMMANDS_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands_af.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands_af.cpp deleted file mode 100644 index 39fabce058..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands_af.cpp +++ /dev/null @@ -1,1277 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_coresimplecommands_af.cpp -// Created on Fri 31 Oct 2003 00:04:25 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_coresimplecommands.h" - - -#include "kvi_window.h" -#include "kvi_out.h" -#include "kvi_locale.h" -#include "kvi_app.h" -#include "kvi_options.h" -#include "kvi_ircview.h" // this is only for KviIrcView::NoTimestamp -#include "kvi_debugwindow.h" -#include "kvi_console.h" -#include "kvi_scriptbutton.h" -#include "kvi_iconmanager.h" - -#include "kvi_kvs_popupmanager.h" -#include "kvi_kvs_eventmanager.h" -#include "kvi_kvs_kernel.h" -#include "kvi_kvs_object_controller.h" - -#ifndef COMPILE_NO_X_BELL - #include "kvi_xlib.h" // XBell : THIS SHOULD BE INCLUDED AS LAST! - #include <unistd.h> // for usleep(); - - #ifdef COMPILE_USE_QT4 - #include <qx11info_x11.h> - #define get_xdisplay QX11Info::display - #else - #define get_xdisplay qt_xdisplay - #endif - -#endif - -#include "kvi_tal_tooltip.h" - -// kvi_app.cpp -extern KviPointerHashTable<const char *,KviWindow> * g_pGlobalWindowDict; - -namespace KviKvsCoreSimpleCommands -{ - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: admin - @type: - command - @title: - admin - @syntax: - admin [target server] - @short: - Requests the admin info from a server - @description: - Requests admin information from the specified server or the current server if no [target server] is specified.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RFC2821 wrapper - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: away - @type: - command - @title: - away - @syntax: - away [-a | --all-networks] [<reason:string>] - @short: - Puts you into 'away' state - @switches: - !sw: -a | --all-networks - Set away on all networks - @description: - Puts you into 'away' state in the connection associated to the - current [b]IRC context[/b].[br] This command is "server based"; - this means that the effects will be visible only after the - server has acknowledged the change.[br] - When you use this command, other people will know that you are - away from the keyboard, and they will know why you're not here.[br] - To return from being away you must use [cmd]back[/cmd].[br] - This command is [doc:connection_dependant_commands]connection dependant[/doc].[br] - @examples: - [example] - away I'm asleep. Don't wake me up. - [/example] - */ - - KVSCSC(away) - { - QString szReason; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("reason",KVS_PT_STRING,KVS_PF_OPTIONAL | KVS_PF_APPENDREMAINING,szReason) - KVSCSC_PARAMETERS_END - - KVSCSC_REQUIRE_CONNECTION - - if(szReason.isEmpty())szReason = KVI_OPTION_STRING(KviOption_stringAwayMessage); - - if(KVSCSC_pSwitches->find('a',"all-networks")) - { - KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict); - while(KviWindow * wnd = it.current()) - { - if(wnd->type()==KVI_WINDOW_TYPE_CONSOLE) - { - KviConsole* pConsole=(KviConsole*)wnd; - if(pConsole->isConnected()) - pConsole->connection()->sendFmtData("AWAY :%s", - pConsole->connection()->encodeText(szReason).data() - ); - } - ++it; - } - } else { - KviQCString szR = KVSCSC_pConnection->encodeText(szReason); - if(!(KVSCSC_pConnection->sendFmtData("AWAY :%s",szR.data()))) - return KVSCSC_pContext->warningNoIrcConnection(); - } - - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: back - @type: - command - @title: - back - @syntax: - back [-a | --all-networks] - @switches: - !sw: -a | --all-networks - Set back on all networks - @short: - Allows you to return from being away - @description: - Using this command makes you return from being [cmd]away[/cmd] in the connection associated to the - current [b]IRC context[/b].[br] This command is "server based"; - this means that the effects will be visible only after the - server has acknowledged the change.[br] - This command is [doc:connection_dependant_commands]connection dependant[/doc].[br] - @examples: - [example] - back - [/example] - */ - - KVSCSC(back) - { - - if(KVSCSC_pSwitches->find('a',"all-networks")) - { - KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict); - while(KviWindow * wnd = it.current()) - { - if(wnd->type()==KVI_WINDOW_TYPE_CONSOLE) - { - KviConsole* pConsole=(KviConsole*)wnd; - if(pConsole->isConnected()) - pConsole->connection()->sendFmtData("AWAY"); - } - ++it; - } - } else { - KVSCSC_REQUIRE_CONNECTION - - if(!(KVSCSC_pConnection->sendFmtData("AWAY"))) - return KVSCSC_pContext->warningNoIrcConnection(); - } - - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: ban - @type: - command - @title: - ban - @syntax: - ban <mask_list> - @short: - Sets ban masks for the channel - @description: - Sets the ban masks specified in the <mask_list>, - which is a comma separated list of nicknames. - This command works only if executed in a channel window. - The command is translated to a set of MODE messages containing - a variable number of +b flags. - This command is [doc:connection_dependant_commands]connection dependant[/doc]. - @examples: - [example] - ban Maxim,Gizmo!*@*,*!root@* - [/example] - @seealso: - [cmd]op[/cmd], - [cmd]deop[/cmd], - [cmd]voice[/cmd], - [cmd]devoice[/cmd], - [cmd]unban[/cmd] - */ - - KVSCSC(ban) - { - return multipleModeCommand(__pContext,__pParams,__pSwitches,'+','b'); - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: beep - @type: - command - @title: - beep - @syntax: - beep [-p=<pitch:uint>] [-d=<duration:uint>] [-s] [volume:uint] - @short: - Beep beep! - @switches: - !sw: -p=<pitch:uint> | --pitch=<pitch:uint> - Sets the bell to the specified pitch, if possible - !sw: -d=<duration:uint> | --duration=<duration:uint> - Sets the duration of the beep to <duration> milliseconds - !sw: -s | --synchronous - Causes KVIrc to wait for completion of the beeping before - returning from this command - @description: - Beeps (when possible :D)[br] - ...[br] - No , really..[br] - This command rings the bell on the keyboard (the PC speaker). - The volume must be in range 0-100; the default is 100.[br] - The pitch is specified in Hz and must be positive.[br] - The duration is specified in milliseconds.[br] - An invalid (or unspecified) pitch, volume or duration - makes KVIrc to use the default values set by the system.[br] - The duration of the bell is only indicative and - can be shortened by a subsequent call to /beep (that - will override the currently playing one).[br] - On Windows, the bell is always synchronous and it is not - event granted that the bell will be a bell at all... you might - get the system default sound instead.. so be careful if you - want to write portable scripts :)[br] - If the -s switch is specified the bell becomes synchronous: - KVIrc waits the bell to complete before continuing.[br] - Obviously -s is senseless on Windows.[br] - (WARNING : the main KVIrc thread is stopped in that case - so if you play long notes (duration > 100) - the entire application will appear to freeze for a while).[br] - The precision of the bell pitch, duration and - volume is strongly dependant on the system and the underlying hardware.[br] - */ - - KVSCSC(beep) - { - kvs_uint_t uVolume; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("volume",KVS_PT_UINT,KVS_PF_OPTIONAL,uVolume) - KVSCSC_PARAMETERS_END - - kvs_int_t pitch = -1; - kvs_int_t duration = -1; - bool bSync = (KVSCSC_pSwitches->find('s',"sync") != 0); - bool bOk = false; - - KviKvsVariant * pPitch = KVSCSC_pSwitches->find('p',"pitch"); - if(pPitch) - { - if(!pPitch->asInteger(pitch)) - { - KVSCSC_pContext->warning(__tr2qs("Invalid pitch value: using default")); - pitch = -1; - } - } - - KviKvsVariant * pDuration = KVSCSC_pSwitches->find('d',"duration"); - if(pDuration) - { - if(!pDuration->asInteger(duration)) - { - KVSCSC_pContext->warning(__tr2qs("Invalid duration value: using default")); - duration = -1; - } - } - - if((uVolume > 100) || (uVolume < 1))uVolume = 100; - -#ifdef COMPILE_ON_WINDOWS - Beep(pitch,duration); -#else - #ifndef COMPILE_NO_X_BELL - - - - XKeyboardState st; - XKeyboardControl ctl; - - XGetKeyboardControl(get_xdisplay(),&st); - - unsigned long mask = KBBellPercent; - ctl.bell_percent = uVolume; - if(pitch >= 0) - { - ctl.bell_pitch = pitch; - mask |= KBBellPitch; - } - if(duration >= 0) - { - ctl.bell_duration = duration; - mask |= KBBellDuration; - } - XChangeKeyboardControl(get_xdisplay(),mask,&ctl); - - XBell(get_xdisplay(),100); - - if(bSync) - { - if(duration >= 0)usleep(duration * 1000); - else usleep(st.bell_duration * 1000); - } - - ctl.bell_pitch = st.bell_pitch; - ctl.bell_duration = st.bell_duration; - ctl.bell_percent = st.bell_percent; - - XChangeKeyboardControl(get_xdisplay(),mask,&ctl); - - #endif //COMPILE_NO_X_BELL -#endif - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: buttonctl - @title: - buttonctl - @type: - command - @short: - changes user definable buttons - @syntax: - buttonctl [-q] <type:string> <name:string> <operation:string> [parameter:string] - @switches: - !sw: -q | --quiet - Run quietly - @description: - Changes an existing user defined button.[br] - <type_unused> is ignored and present only for backward compatibility.[br] - <name> is the name of the button.[br] - <operation> may be one of the constant strings "enable", "disable", "image", - "text".[br] - Operations "enable" and "disable" do not require the fourth [parameter] and have - the obvious meaning.[br] Operation "image" requires the [parameter] to be - a valid [doc:image_id]image_id[/doc] and sets the button image.[br] - Operation "text" requires the [parameter] (and in fact all the following ones) - to be a string containing the button text label.[br] - The <operation> constants may be abbreviated, even to the single letters 'e','d','i' and 't'.[br] - The -q switch causes the command to be quiet about errors and warnings.[br] - @seealso: - [cmd]button[/cmd] - */ - -//#warning "ALSO /HELP must NOT interpret the identifiers!" -//#warning "ALSO /DEBUG that relays to the DEBUG WINDOW" - - KVSCSC(buttonctl) - { - QString tbTypeUnused,tbName,tbOp,tbPar; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("type",KVS_PT_STRING,0,tbTypeUnused) - KVSCSC_PARAMETER("name",KVS_PT_STRING,0,tbName) - KVSCSC_PARAMETER("operation",KVS_PT_STRING,0,tbOp) - KVSCSC_PARAMETER("parameter",KVS_PT_STRING,KVS_PF_OPTIONAL,tbPar) - KVSCSC_PARAMETERS_END - - KviScriptUserButton * pButton = 0; - - if(!KVSCSC_pWindow->buttonContainer()) - { - if(!KVSCSC_pSwitches->find('q',"quiet"))KVSCSC_pContext->warning(__tr2qs("The specified window has no button containers")); - return true; - } - - pButton = (KviScriptUserButton *)(KVSCSC_pWindow->buttonContainer())->child(tbName,"KviWindowScriptButton"); - - if(!pButton) - { - if(!KVSCSC_pSwitches->find('q',"quiet"))KVSCSC_pContext->warning(__tr2qs("No button with type %Q named %Q"),&tbTypeUnused,&tbName); - return true; - } - QChar o; - if (tbOp.length() > 0) o=tbOp[0]; - else o=QChar('x'); - - // QChar o = tbOp.length() > 0 ? tbOp[0] : QChar('x'); - - switch(o.unicode()) - { - case 't': - KviTalToolTip::remove(pButton); - KviTalToolTip::add(pButton,tbPar); - pButton->setButtonText(tbPar); - break; - case 'i': - if(!tbPar.isEmpty()) - { - QPixmap * pix = g_pIconManager->getImage(tbPar); - if(pix) - { - pButton->setButtonPixmap(*pix); - } else { - if(!KVSCSC_pSwitches->find('q',"quiet"))KVSCSC_pContext->warning(__tr2qs("Can't find the icon '%Q'"),&tbPar); - } - } - break; - case 'e': - pButton->setEnabled(true); - break; - case 'd': - pButton->setEnabled(false); - break; - } - return true; - - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: codepage - @type: - command - @title: - codepage - @syntax: - codepage <encoding name> - @short: - Tries to set the codepage on server - @description: - This is a not-widely implemented extension - that allows the user to set the codepage mapping - on server. - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RFC2821 wrapper - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: ctcp - @type: - command - @title: - ctcp - @syntax: - ctcp [-n] <target:string> <ctcp_data:string> - @short: - Sends a CTCP message - @description: - Sends a CTCP message to the specified <target>.[br] - The target may be a nickname , a channel, or a comma separated list of nicknames.[br] - The <ctcp_data> is a string containing the ctcp type followed by the ctcp parameters.[br] - For more info take a look at the [doc:ctcp_handling]ctcp protocol implementation notes[/doc].[br] - The CTCP message will be a request (sent through a PRIVMSG) unless the -n switch - specified: in that case it will be a reply (sent through a NOTICE).[br] - If <ctcp_data> is the single string "ping" then a trailing time string argument - is added in order to determine the round trip time when the ping reply comes back. - To override this behaviour simply specify your own time string parameter.[br] - This command is [doc:connection_dependant_commands]connection dependant[/doc].[br] - @examples: - [example] - ctcp Pragma VERSION - [/example] - */ - - KVSCSC(ctcp) - { - QString szTarget,szCtcpData; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget) - KVSCSC_PARAMETER("ctcp_data",KVS_PT_STRING,KVS_PF_OPTIONAL | KVS_PF_APPENDREMAINING,szCtcpData) - KVSCSC_PARAMETERS_END - - KVSCSC_REQUIRE_CONNECTION - - if(KviQString::equalCI(szCtcpData,"PING")) - { - struct timeval tv; - kvi_gettimeofday(&tv,0); - KviQString::appendFormatted(szCtcpData," %d.%d",tv.tv_sec,tv.tv_usec); - } - - KviQCString szT = KVSCSC_pConnection->encodeText(szTarget); - KviQCString szD = KVSCSC_pConnection->encodeText(szCtcpData); - - if(!(KVSCSC_pConnection->sendFmtData("%s %s :%c%s%c", - KVSCSC_pSwitches->find('n',"notice") ? "NOTICE" : "PRIVMSG",szT.data(),0x01,szD.data(),0x01))) - return KVSCSC_pContext->warningNoIrcConnection(); - - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: debug - @type: - command - @title: - debug - @syntax: - debug <text> - @short: - Outputs text to the debug window - @switches: - @description: - Outputs the <text> to the debug window.[br] - @seealso: - */ - - KVSCSC(debug) - { - QString szAll; - KVSCSC_pParams->allAsString(szAll); - KviWindow * pWnd = KviDebugWindow::getInstance(); - pWnd->outputNoFmt(KVI_OUT_NONE,szAll); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: delete - @type: - command - @title: - delete - @syntax: - delete [-q] [-i] <objectHandle> - @short: - Destroys an object - @switches: - !sw: -q | --quiet - Causes the command to run quietly - !sw: -i | --immediate - Causes the object to be destroyed immediately - instead of simply scheduling its later deletion. - @description: - Schedules for destruction the object designed by <objectHandle>. - This command is internally aliased to [cmd]destroy[/cmd]. - Please note that the object is NOT immediately destroyed: - it will be destroyed when KVIrc returns to the main event loop, - so after the current script code part has been executed. - This behaviour makes the object destruction safe in any - part of the script, but may lead to problems when - using signals and slots.[br] - For example, when you delete an object that emits some signals, - the signals may be still emitted after the delete call. - You have to disconnect the signals explicitly if you don't want it - to happen.[br] - Alternatively you can use the -i switch: it causes the object - to be destructed immediately but is intrinsicly unsafe: - in complex script scenarios it may lead to a SIGSEGV; - usually when called from one of the deleted object function - handlers, or from a slot connected to one of the deleted object - signals. Well, it actually does not SIGSEGV, but I can't guarantee it; - so, if use the -i switch, test your script 10 times before releasing it. - The -q switch causes the command to run a bit more silently: it still - complains if the parameter passed is not an object reference, but - it fails silently if the reference just points to an inexisting object (or is null). - @examples: - [example] - [/example] - */ - - /* - @doc: destroy - @type: - command - @title: - destroy - @syntax: - destroy [-q] [-i] <objectHandle> - @short: - Destroys an object - @description: - This is a builtin alias for the command [cmd]delete[/cmd] - */ - - KVSCSC(deleteCKEYWORDWORKAROUND) - { - kvs_hobject_t hObject; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("objectHandle",KVS_PT_HOBJECT,0,hObject) - KVSCSC_PARAMETERS_END - if(hObject == (kvs_hobject_t)0) - { - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("Can't delete a null object reference")); - } else { - KviKvsObject * o = KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if(!o) - { - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("Can't delete an inexisting object")); - } else { - if(KVSCSC_pSwitches->find('i',"immediate")) - o->dieNow(); - else - o->die(); - } - } - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: delpopupitem - @type: - command - @title: - delpopupitem - @syntax: - delpopupitem [-d] [-q] <popupname:string> <item_id:string> - @short: - Deletes an item from a popup - @switches: - !sw: -q | --quiet - Run quietly - !sw: -d | --deep - Search the whole popup tree instead of only the first level - @description: - Deletes the item specified by <id> from the poup <popupname>. - If the -d flag is specified then the item with the specified - <id> is seached in the whole popup tree (containing submenus) - otherwise it is searched only in the first level.[br] - If the -q flag is specified the command does not complain - about inexisting items or inexisting popup menus.[br] - See [cmd]defpopup[/cmd] for more informations.[br] - @seealso: - [cmd]defpopup[/cmd], [cmd]popup[/cmd] - */ - // FIXME: #warning "Separator should have the expression too ?" - - - KVSCSC(delpopupitem) - { - QString szPopupName,szItemId; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("popupname",KVS_PT_NONEMPTYSTRING,0,szPopupName) - KVSCSC_PARAMETER("item_id",KVS_PT_NONEMPTYSTRING,0,szItemId) - KVSCSC_PARAMETERS_END - - KviKvsPopupMenu * p = KviKvsPopupManager::instance()->lookup(szPopupName); - if(!p) - { - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("Inexisting popup \"%Q\""),&szPopupName); - return true; - } - - if(p->isLocked()) - { - KVSCSC_pContext->error(__tr2qs("Popup menu self-modification is not allowed (the popup is probably open)")); - return false; - } - - if(!p->removeItemByName(szItemId,KVSCSC_pSwitches->find('d',"deep"))) - { - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("The menu item with id \"%Q\" does not exist in popup \"%Q\""),&szItemId,&szPopupName); - } - - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: deop - @type: - command - @title: - deop - @syntax: - deop <nickname_list> - @short: - Removes chanop status from the specified users - @description: - Removes channel operator status to the users specified in <nickname_list>, - which is a comma separated list of nicknames. - This command works only if executed in a channel window. - The command is translated to a set of MODE messages containing - a variable number of -o flags. - This command is [doc:connection_dependant_commands]connection dependant[/doc]. - @examples: - [example] - deop Pragma,Crocodile - [/example] - @seealso: - [cmd]op[/cmd], [cmd]voice[/cmd], [cmd]devoice[/cmd] - */ - - KVSCSC(deop) - { - return multipleModeCommand(__pContext,__pParams,__pSwitches,'-','o'); - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: devoice - @type: - command - @title: - devoice - @syntax: - devoice <nickname_list> - @short: - Removes voice flag for the specified users - @description: - Removes the voice flag for the users specified in <nickname_list>, - which is a comma separated list of nicknames. - This command works only if executed in a channel window. - The command is translated to a set of MODE messages containing - a variable number of -v flags. - This command is [doc:connection_dependant_commands]connection dependant[/doc]. - @examples: - [example] - devoice Pragma,Crocodile - [/example] - @seealso: - [cmd]op[/cmd], [cmd]deop[/cmd], [cmd]voice[/cmd] - */ - - KVSCSC(devoice) - { - return multipleModeCommand(__pContext,__pParams,__pSwitches,'-','v'); - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: die - @type: - command - @title: - die - @syntax: - die <message:text> - @short: - Prints an error message and stops the script - @description: - Prints an error message and stops the current script - This command is equivalent to [cmd]error[/cmd] - */ - // Internally aliased to error - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: echo - @type: - command - @title: - echo - @syntax: - echo [-d] [-w=<window_id>] [-i=<icon_number>] [-n] <text> - @short: - Outputs text to a KVirc window - @switches: - !sw: -w=<window_id> | --window=<window_id> - Causes the output to be redirected to the window specified by <window_id> - !sw: -i=<icon_number> | --icon=<icon_number> - Causes the output to use the icon & color scheme specified by <icon_number> - !sw: -n | --no-timestamp - Disables the message timestamping - !sw: -d | --debug - Send the output to the debug window (takes precedence over -w) - @description: - Outputs the <text> to the current window.[br] - If the 'w' switch is present , outputs the <text> - to the specified window instead of the current one. - The <window_id&> parameter is the [doc:window_naming_conventions]global ID[/doc] of the window - that has to be used.[br] - If the 'i' switch is given , it uses the specified - icon scheme (icon and colors) , otherwise it uses - the default one (0).[br] - If the -d switch is used then the output is sent to a special - window called "Debug" (the window is created if not existing yet). - This is useful for script debugging purposes (you get the output - in Debug regardless of the window that the executed command is attacched to). - The KVIrc view widgets support clickable links that can be realized by using special [doc:escape_sequences]escape sequences[/doc].[br] - The 'n' switch disables timestamping so you can output your own timestamp - or not timestamp at all.[br] - @examples: - [example] - echo Hey! this is my first echo test! - echo -i=10 This text has a specified icon and colors - echo --icon=[fnc]$icon[/fnc](parser error) this has the colors of the parser error messages - [/example] - @seealso: - [fnc]$window[/fnc], - [doc:window_naming_conventions]window naming conventions documentation[/doc] - */ - - KVSCSC(echo) - { - QString szAll; - KVSCSC_pParams->allAsString(szAll); - - kvs_int_t iMsgType = KVI_OUT_NONE; - KviWindow * pWnd = KVSCSC_pContext->window(); - - if(!KVSCSC_pSwitches->isEmpty()) - { - KviKvsVariant * v; - if((v = KVSCSC_pSwitches->find('w',"window"))) - { - QString szWnd; - v->asString(szWnd); - //#warning "FIXME: the window database is not unicode! (we even could keep integer window id's at this point!)" - pWnd = g_pApp->findWindow(szWnd.utf8().data()); - if(!pWnd) - { - KVSCSC_pContext->warning(__tr2qs("The argument of the -w switch did not evaluate to a valid window id: using default")); - pWnd = KVSCSC_pContext->window(); - } - } - - if((v = KVSCSC_pSwitches->find('i',"icon"))) - { - if(!v->asInteger(iMsgType)) - { - KVSCSC_pContext->warning(__tr2qs("The argument of the i switch did not evaluate to a number: using default")); - iMsgType = KVI_OUT_NONE; - } else { - iMsgType = iMsgType % KVI_NUM_MSGTYPE_OPTIONS; - } - } - - if(KVSCSC_pSwitches->find('d',"debug")) - { - pWnd = KviDebugWindow::getInstance(); - } - } - - int iFlags = KVSCSC_pSwitches->find('n',"no-timestamp") ? KviIrcView::NoTimestamp : 0; - pWnd->outputNoFmt(iMsgType,szAll,iFlags); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: echoprivmsg - @type: - command - @title: - echoprivmsg - @syntax: - echoprivmsg [switches] <nick:string> <user:string> <host:string> <text:string> - @short: - Outputs text to a KVIrc window - @switches: - !sw: -p[=<nick_prefix>] | --prefix[=<prefix>] - The message is printed with the specified custom nickname prefix. - If <nick_prefix> is omitted then an empty string is assumed. - !sw: -s[=<nick_suffix>] | --suffix[=<nicksuffix>] - The message is printed with the specified custom nickname suffix. - If <nick_suffix> is omitted then an empty string is assumed. - !sw: -w=<window_id> | --window=<window_id> - The message is printed to the window specified by [doc:window_naming_conventions]window_id[/doc] - !sw: -i=<color_set> | --color-set=<color_set> - Causes the message to use the specified icon scheme (icon and colors). - !sw: -n | --no-highlighting - Do not apply the highlighting rules - !sw: -x | --no-notifier - Never cause the notifier window to pop up - !sw: -f | --no-flashing - Never cause the window taskbar entry to flash (this works only on some platforms) - @description: - Outputs a <text> to the current window in the privmsg format.[br] - The <nick> <user> and <host> parameters are formatted - as specified by the user preferences (for example - the nick may use smart colorisation). - If you don't know the username and host then just use '*' for - that parameters. - The message will also get the highlighting rules applied. - If the 'w' switch is present, outputs <text> - to the specified window instead of the current one. - The <window_id> parameter is the [doc:window_naming_conventions]global ID[/doc] of the window - that has to be used.[br] - Please note that this is not the same as the standard - [doc:command_rebinding]-r rebinding switch[/doc]: - -w causes the specified window to be used only for output, - but the command parameters are evaluated in the current window.[br] - If the 'i' switch is given , it uses the specified - icon scheme (icon and colors) , otherwise it uses - the default one (0).[br] - If the -n switch is present then the highlighting rules - are not applied.[br] - If the -x switch is present then the message will never cause - the notifier window to be popped up.[br] - If the -f switch is present then the message will never cause - the system taskbar to flash.[br] - Actually -x and -f have a sense only if highlighting is used and thus -n is not present.[br] - For more informations about the icon/color schemes see [fnc]$msgtype[/fnc]. - The KVIrc view widgets support clickable sockets that can be realized by using special [doc:escape_sequences]escape sequences[/doc].[br] - @examples: - [example] - echoprivmsg Test * * This is a test message - echoprivmsg -i=$msgtype(ChanPrivmsgCrypted) Pragma pragma staff.kvirc.net Hi people! :) - [/example] - @seealso: - [fnc]$window[/fnc], - [fnc]$window.caption[/fnc], - [fnc]$msgtype[/fnc], - [cmd]echo[/cmd], - [doc:window_naming_conventions]Window Naming Conventions[/doc] - */ - - KVSCSC(echoprivmsg) - { - QString szNick,szUser,szHost,szText; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("nick",KVS_PT_NONEMPTYSTRING,0,szNick) - KVSCSC_PARAMETER("user",KVS_PT_STRING,0,szUser) - KVSCSC_PARAMETER("host",KVS_PT_STRING,0,szHost) - KVSCSC_PARAMETER("text",KVS_PT_STRING,KVS_PF_OPTIONAL | KVS_PF_APPENDREMAINING,szText) - KVSCSC_PARAMETERS_END - - int type = KVI_OUT_NONE; - KviWindow * pWnd = KVSCSC_pWindow; - KviConsole * pConsole = pWnd->console(); - if(!pConsole)pConsole = g_pApp->activeConsole(); - - KviKvsVariant * v; - - if(v = KVSCSC_pSwitches->find('i',"color-set")) - { - kvs_int_t msgType; - if(v->asInteger(msgType)) - { - if(msgType < 0)msgType = -msgType; - type = (int)(msgType % KVI_NUM_MSGTYPE_OPTIONS); - } else KVSCSC_pContext->warning(__tr2qs("Invalid color-set specification, using default")); - } - - if(v = KVSCSC_pSwitches->find('w',"window")) - { - QString szWin; - v->asString(szWin); - KviStr window = szWin; - pWnd = g_pApp->findWindow(window.ptr()); - if(!pWnd) - { - KVSCSC_pContext->warning(__tr2qs("Window '%s' not found, using current one"),window.ptr()); - pWnd = KVSCSC_pWindow; - } - } - - QString szPrefix,szSuffix; - bool bPrefix = false; - bool bSuffix = false; - - if(v = KVSCSC_pSwitches->find('p',"prefix")) - { - v->asString(szPrefix); - bPrefix = true; - } - if(v = KVSCSC_pSwitches->find('s',"suffix")) - { - v->asString(szSuffix); - bSuffix = true; - } - - int iFlags = 0; - if(KVSCSC_pSwitches->find('n',"no-highlighting"))iFlags |= KviConsole::NoHighlighting; - if(KVSCSC_pSwitches->find('f',"no-flashing"))iFlags |= KviConsole::NoWindowFlashing; - if(KVSCSC_pSwitches->find('x',"no-notifier"))iFlags |= KviConsole::NoNotifier; - - pConsole->outputPrivmsg(pWnd,type, - szNick,szUser,szHost,szText, - iFlags, - bPrefix ? szPrefix : QString::null,bSuffix ? szSuffix : QString::null); - - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: error - @type: - command - @title: - error - @syntax: - error <message:text> - @short: - Prints an error message and stops the script - @description: - Prints an error message and stops the current script - This command is equivalent to [cmd]die[/cmd] - @seealso: - [cmd]warning[/cmd] - */ - - KVSCSC(error) - { -#ifdef COMPILE_NEW_KVS - QString szAll; - KVSCSC_pParams->allAsString(szAll); - KVSCSC_pContext->error("%Q",&szAll); -#endif - return false; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: eval - @type: - command - @title: - eval - @syntax: - eval [-q] [-r=<window>] <command> - @switches: - !sw: -q | --quiet - Disable any error output - !sw: -f | --force - Continue execution even if <command> fails with an error - @short: - Change the behaviour of a set of commands - @description: - This command is useful to execute variable command sequences.[br] - <command> is first evaluated as a normal parameter (thus identifiers - and variables are substituted) then the evaluated string is executed - as a command sequence.[br] - -q causes eval to run quietly and don't display any errors in the inner command.[br] - -f causes eval to ignore the errors inside <command> and continue execution.[br] - This command may be used to rebind the <command> to a specified window. - <command> shares the local variables with this command scope so you - can easily exchange data with it. - Remember that <command> is still a normal parameter and it must be - enclosed in quotes if youwant it to be a complex command sequence. - eval propagates the <command> return value.[br] - @examples: - [example] - [comment]# evaluate a variable command[/comment] - [cmd]if[/cmd](%somecondition)%tmp = "echo yeah" - else %tmp = "echo -i=10 yeah" - eval %tmp - [comment]# Rebind the command to the #linux channel to get the user list[/comment] - eval -r=[fnc]$channel[/fnc](#linux) "%Nicks[]=$chan.array;" - [comment]# A nice alias that allows iterating commands through all the consoles[/comment] - [comment]# This is by LatinSuD :)[/comment] - [cmd]alias[/cmd](iterate) - { - %ctxt[]=[fnc]$window.list[/fnc](console,all) - [cmd]for[/cmd](%i=0;%i<%ctxt[]#;%i++) - { - [cmd]eval[/cmd] -r=%ctxt[%i] $0- - } - } - iterate [cmd]echo[/cmd] Hi ppl! :) - [comment]# A little bit shorter (but less "colorful") version might be...[/comment] - [cmd]alias[/cmd](iterate) - { - [cmd]foreach[/cmd](%x,[fnc]$window.list[/fnc](console,all)) - [cmd]eval[/cmd] -r=%x $0-; - } - iterate [cmd]echo[/cmd] Hi again! - [comment]# Evaluate a command block[/comment] - eval "{ echo First command!; echo Second command!; }" - [/example] - */ - - KVSCSC(eval) - { - QString szCommands; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("commands",KVS_PT_STRING,KVS_PF_APPENDREMAINING,szCommands) - KVSCSC_PARAMETERS_END - - KviKvsScript s("eval::inner",szCommands); - int iRunFlags = 0; - if(KVSCSC_pContext->reportingDisabled() || KVSCSC_pSwitches->find('q',"quiet")) - iRunFlags |= KviKvsScript::Quiet; - bool bRet = s.run(KVSCSC_pContext,iRunFlags) ? true : false; - if(!bRet) - { - if(!KVSCSC_pSwitches->find('f',"force")) - return false; - KVSCSC_pContext->clearError(); - } - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: eventctl - @title: - eventctl - @type: - command - @short: - Controls the execution of event handlers - @syntax: - eventctl [-u] [-e] [-d] [-q] <event_name:string> <handler_name:string> [parameters] - @switches: - !sw: -u | --unregister - Unregisters the specified handler - !sw: -e | --enable - Enables the specified handler - !sw: -d | --disable - Disables the specified handler - !sw: -q | --quiet - Do not print any warnings - @description: - Performs control actions on the handler <handler_name> for - the event <event_name>. - Without any switch it triggers the handler for testing purposes, - eventually passing [parameters].[br] - With the -u switch the handler <handler_name> is unregistered.[br] - With the -d swtich is is disabled (so it is never executed) - and with -e is enabled again.[br] - The <event_name> may be one of the kvirc-builtin event names - or a numeric code (from 0 to 999) of a raw server message.[br] - @seealso: - [cmd]event[/cmd] - */ - KVSCSC(eventctl) - { - QString szEventName,szHandlerName; - KviKvsVariantList vList; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("event_name",KVS_PT_NONEMPTYSTRING,0,szEventName) - KVSCSC_PARAMETER("handler_name",KVS_PT_NONEMPTYSTRING,0,szHandlerName) - KVSCSC_PARAMETER("parameters",KVS_PT_VARIANTLIST,KVS_PF_OPTIONAL,vList) - KVSCSC_PARAMETERS_END - - bool bOk; - int iNumber = szEventName.toInt(&bOk); - bool bIsRaw = (bOk && (iNumber >= 0) && (iNumber < 1000)); - - if(bIsRaw) - { - if(!KviKvsEventManager::instance()->isValidRawEvent(iNumber)) - { - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("No such event (%Q)"),&szEventName); - return true; - } - } else { - iNumber = KviKvsEventManager::instance()->findAppEventIndexByName(szEventName); - if(!KviKvsEventManager::instance()->isValidAppEvent(iNumber)) - { - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("No such event (%Q)"),&szEventName); - return true; - } - } - - if(KVSCSC_pSwitches->find('u',"unregister")) - { - // unregister it - if(bIsRaw) - { - if(!KviKvsEventManager::instance()->removeScriptRawHandler(iNumber,szHandlerName)) - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("No handler '%Q' for raw numeric event '%d'"),&szHandlerName,iNumber); - } else { - if(!KviKvsEventManager::instance()->removeScriptAppHandler(iNumber,szHandlerName)) - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("No handler '%Q' for event '%Q'"),&szHandlerName,&szEventName); - } - } else if(KVSCSC_pSwitches->find('e',"enable") || KVSCSC_pSwitches->find('d',"disable")) - { - // enable it - if(bIsRaw) - { - if(!KviKvsEventManager::instance()->enableScriptRawHandler(iNumber,szHandlerName,KVSCSC_pSwitches->find('e',"enable"))) - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("No handler '%Q' for raw numeric event '%d'"),&szHandlerName,iNumber); - } else { - if(!KviKvsEventManager::instance()->enableScriptAppHandler(iNumber,szHandlerName,KVSCSC_pSwitches->find('e',"enable"))) - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("No handler '%Q' for event '%Q'"),&szHandlerName,&szEventName); - } - } else { - // trigger it - KviKvsScriptEventHandler * h; - QString code; - - if(bIsRaw) - { - h = KviKvsEventManager::instance()->findScriptRawHandler(iNumber,szHandlerName); - } else { - h = KviKvsEventManager::instance()->findScriptAppHandler(iNumber,szHandlerName); - } - - if(h) - { - KviKvsScript * s = h->script(); - KviKvsScript copy(*s); - KviKvsVariant retVal; - copy.run(KVSCSC_pWindow,&vList,0,KviKvsScript::PreserveParams); - } else { - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("No handler '%Q' for event '%Q'"),&szHandlerName,&szEventName); - } - } - - return true; - } - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: exit - @type: - command - @title: - exit - @syntax: - exit - @switches: - @short: - Closes KVIrc - @description: - It closes KVirc application - */ - - KVSCSC(exit) - { - g_pApp->quit(); - return true; - } - -}; diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands_gl.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands_gl.cpp deleted file mode 100644 index 6f1ffb642d..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands_gl.cpp +++ /dev/null @@ -1,693 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_coresimplecommands_gl.cpp -// Created on Fri 31 Oct 2003 00:04:25 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_coresimplecommands.h" - -#include "kvi_kvs_timermanager.h" -#include "kvi_kvs_asyncdnsoperation.h" -#include "kvi_kvs_script.h" - -#include "kvi_fileutils.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionserverinfo.h" -#include "kvi_locale.h" - -#include "kvi_out.h" - -#ifdef COMPILE_USE_QT4 - #include <q3mimefactory.h> -#endif - -namespace KviKvsCoreSimpleCommands -{ - /* - @doc: halt - @type: - command - @title: - halt - @syntax: - halt - @short: - Stops the execution of the current script - @description: - Stops the execution of the current script.[br] - Note that this is different from [cmd]return[/cmd]: halt doesn't - set the return value (use [cmd]setreturn[/cmd] for that) and - in the event handlers this command may have additional semantics: - refer to the specific event documentation for more info.[br] - In fact , this command should be used [b]only[/b] in the event handlers, - use [cmd]return[/cmd] in any other context.[br] - */ - - KVSCSC(halt) - { -#ifdef COMPILE_NEW_KVS - KVSCSC_pContext->setHaltCalled(); -#endif - return false; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: help - @type: - command - @title: - help - @syntax: - help [-s] <topic> - @short: - Shows a help page - @description: - Shows a help page about <topic>.[br] - <topic> can be a command name , or an identifier.[br] - If <topic> starts with a slash , it is assumed to be a full path - to a html file to be displayed in the help browser.[br] - This command is a shortcut for the [cmd]help.open[/cmd] module command.[br] - @examples: - [example] - help run - help help - help index - help $mask - help /home/pragma/myfile.html - [/example] - */ - - static bool file_in_path(QStringList &pathlist,QString &file) - { - for(QStringList::Iterator it = pathlist.begin();it != pathlist.end();++it) - { - QString tmp = *it; - tmp.append('/'); - tmp.append(file); - KviFileUtils::adjustFilePath(tmp); - if(KviFileUtils::fileExists(tmp))return true; - } - return false; - } - - KVSCSC(help) - { - QString szTopic; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("topic",KVS_PT_STRING,KVS_PF_OPTIONAL | KVS_PF_APPENDREMAINING,szTopic) - KVSCSC_PARAMETERS_END - - szTopic.stripWhiteSpace(); - if(szTopic.endsWith(";")) - { - szTopic.truncate(szTopic.length() - 1); - szTopic.stripWhiteSpace(); - } - - QString szCommand; - if(szTopic.isEmpty())szCommand = "help.open index.html"; - else { - bool bWasFunc = false; - if(szTopic[0] == QChar('$')) - { - bWasFunc = true; - szTopic.remove(0,1); - } - - QString szOriginal = szTopic; - - QString topik = szTopic; -#ifdef COMPILE_USE_QT4 - QStringList pl = Q3MimeSourceFactory::defaultFactory()->filePath(); -#else - QStringList pl = QMimeSourceFactory::defaultFactory()->filePath(); -#endif - - bool bLowCaseTried = false; - bool bFound = KviFileUtils::fileExists(szTopic); - -try_again: - if((!bFound) && bWasFunc) - { - topik = szTopic; - topik += ".html"; - topik.prepend("fnc_"); - bFound = file_in_path(pl,topik); - } - - if(!bFound) - { - topik = szTopic; - bFound = file_in_path(pl,topik); - } - - if(!bFound) - { - topik = szTopic; - topik += ".html"; - bFound = file_in_path(pl,topik); - } - - if(!bFound) - { - topik = szTopic; - topik += ".html"; - topik.prepend("cmd_"); - bFound = file_in_path(pl,topik); - } - - if(!bFound) - { - topik = szTopic; - topik += ".html"; - topik.prepend("doc_"); - bFound = file_in_path(pl,topik); - } - - if(!bFound) - { - topik = szTopic; - topik += ".html"; - topik.prepend("event_"); - bFound = file_in_path(pl,topik); - } - - if(!bFound) - { - topik = szTopic; - topik += ".html"; - topik.prepend("module_"); - bFound = file_in_path(pl,topik); - } - - if(!bFound) - { - topik = szTopic; - topik += ".html"; - topik.prepend("widget_"); - bFound = file_in_path(pl,topik); - } - - if(!bFound) - { - topik = szTopic; - topik += ".html"; - topik.prepend("class_"); - bFound = file_in_path(pl,topik); - } - - if(!bFound && !bLowCaseTried) - { - // try again with lowercase - szTopic = szTopic.lower(); - bLowCaseTried = true; - goto try_again; - } - - if(!bFound) - { - // let the help.open function decide... - topik = szOriginal; - topik += ".html"; - } - - szCommand = "help.open "; - szCommand += topik; - } - - // We don't care about the return value... - KviKvsScript s("help",szCommand); - s.run(KVSCSC_pContext->window()); - - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: host - @type: - command - @title: - host - @syntax: - host [-i] [-a] <dnsquery:string> - @short: - DNS lookup - @switches: - !sw: --ipv6 | -i - Causes the command to run in IPv6 mode - !sw: --any | -a - Causes the command to run in unspecified mode and lookup both IPv4 and IPv6 addresses - @description: - Starts a DNS lookup for the <dnsquery> (hostname) and prints - the results in the current window.[br] - The -i switch causes the command to execute - in IpV6 mode (and lookup ONLY IpV6 hosts!).[br] - The -a switch causes the command to run in "unspecified" mode - and return any available address: IpV4 or Ipv6.[br] - This command also performs reverse lookups (if you pass an IP address as <hostname>).[br] - @examples: - [example] - host localhost - host irc.flashnet.it - host -i irc.flashnet.it - host -i A0E0:FFFF:::1010:1111:E0E0:A0A0 - host -a 127.0.0.1 - host 255.41.31.23 - host -a irc.stealth.net - [/example] - @seealso: - [cmd]ahost[/cmd] - */ - - KVSCSC(host) - { - QString szQuery; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("dnsquery",KVS_PT_NONEMPTYSTRING,0,szQuery) - KVSCSC_PARAMETERS_END - - KviDns::QueryType queryType = KviDns::IpV4; - if(KVSCSC_pSwitches->find('i',"ipv6"))queryType = KviDns::IpV6; - if(KVSCSC_pSwitches->find('a',"any"))queryType = KviDns::Any; - - KviKvsAsyncDnsOperation * op = new KviKvsAsyncDnsOperation( - KVSCSC_pContext->window(), - szQuery, - queryType); - - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: include - @type: - command - @title: - include - @syntax: - include [-q] [-e] [-f] [-r] <filename:string> [<parameter1:variant> [<parameter2:variant> [...]]] - @short: - A builtin alias for parse - @description: - This is a builtin alias for [cmd]parse[/cmd] that gives scripts a "more C-ish" look :) - @seealso: - [cmd]parse[/cmd] - */ - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: info - @type: - command - @title: - info - @syntax: - info [target server] - @short: - Requests the server daemon info from a server - @description: - Requests server daemon information from the specified server or the current server if no [target server] is specified.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RFC2821 wrapper - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: invite - @type: - command - @title: - invite - @syntax: - invite <nickname> <channel> - @short: - Invites an user to a channel - @description: - Invites the specified user to the <channel>.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RCF2821 wrapper - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: join - @type: - command - @title: - join - @syntax: - join <channel list> [key list] - @short: - Joins the specified channels - @description: - Joins the channels specified in <channel list> by using the - optional keys in the [key list].[br] - This command is "server based"; you will see its results only - after the server acknowledges it.[br] - This command is [doc:connection_dependant_commands]connection dependant[/doc].[br] - @examples: - [example] - join #kvirc - join #linux-it,#xmms,#kde linus - [/example] - */ - - KVSCSC(join) - { - QString szChans,szKeys; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("chans",KVS_PT_NONEMPTYSTRING,0,szChans) - KVSCSC_PARAMETER("keys",KVS_PT_STRING,KVS_PF_OPTIONAL,szKeys) - KVSCSC_PARAMETERS_END - - KVSCSC_REQUIRE_CONNECTION - - QStringList slChans = QStringList::split(",",szChans); - - QString szChanTypes = KVSCSC_pConnection->serverInfo()->supportedChannelTypes(); - for(QStringList::Iterator it=slChans.begin();it != slChans.end();++it) - { - if(!(*it).isEmpty()) - { - bool bFound = false; - int id = 0; - QChar f = (*it)[0]; - while((id < szChanTypes.length()) && !bFound) - { - if(f == szChanTypes[id])bFound = true; - id++; - } - if(!bFound) - (*it).prepend("#"); - } - } - - szChans = slChans.join(","); - KviQCString szEncodedChans = KVSCSC_pConnection->encodeText(szChans); - - if(szKeys.isEmpty()) - { - if(!(KVSCSC_pConnection->sendFmtData("JOIN %s",szEncodedChans.data()))) - return KVSCSC_pContext->warningNoIrcConnection(); - } else { - KviQCString szEncodedKeys = KVSCSC_pConnection->encodeText(szKeys); - if(!(KVSCSC_pConnection->sendFmtData("JOIN %s %s",szEncodedChans.data(),szEncodedKeys.data()))) - return KVSCSC_pContext->warningNoIrcConnection(); - } - - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: kick - @type: - command - @title: - kick - @syntax: - kick <user:string> [reason:string] - @short: - Kicks an user from a channel - @description: - Kicks the specified <user> from the current channel.[br] - This command is a simple wrapper over the IRC KICK command. - This command is [doc:connection_dependant_commands]connection dependant[/doc]. - @examples: - [example] - kick Pragma Go coding in Pascal! - [/example] - */ - - KVSCSC(kick) - { - QString szUser; - QString szReason; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("user",KVS_PT_NONEMPTYSTRING,0,szUser) - KVSCSC_PARAMETER("reason",KVS_PT_STRING,KVS_PF_OPTIONAL | KVS_PF_APPENDREMAINING,szReason) - KVSCSC_PARAMETERS_END - - KVSCSC_REQUIRE_CONNECTION - - if(KVSCSC_pWindow->type() != KVI_WINDOW_TYPE_CHANNEL) - { - KVSCSC_pContext->warning(__tr2qs("The current window is not a channel")); - return false; - } - - KviQCString szC = KVSCSC_pConnection->encodeText(KVSCSC_pWindow->target()); - KviQCString szU = KVSCSC_pConnection->encodeText(szUser); - KviQCString szR = KVSCSC_pConnection->encodeText(szReason); - - if(szR.isEmpty()) - { - if(!KVSCSC_pConnection->sendFmtData("KICK %s %s",szC.data(),szU.data())) - return KVSCSC_pContext->warningNoIrcConnection(); - } else { - if(!KVSCSC_pConnection->sendFmtData("KICK %s %s :%s",szC.data(),szU.data(),szR.data())) - return KVSCSC_pContext->warningNoIrcConnection(); - } - - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: killtimer - @title: - killtimer - @type: - command - @short: - Stops a timer - @syntax: - killtimer [-a] - killtimer [-q] [name] - @switches: - !sw: -a | --active - Requests to kill all the active timers - !sw: -q | --quiet - Does not print warnings if the specified timer is not running - @description: - The first version (with -a) kill all the running timers.[br] - The second verdion kills a running timer named [name].[br] - The timer has been started by the [cmd]timer[/cmd].[br] - [name] can be omitted if this command is called from a [cmd]timer[/cmd] callback: - in this case the current timer will be scheduled for killing immediately - after it has returned control to KVIrc. - @seealso: - [cmd]timer[/cmd], [fnc]$isTimer[/fnc], [cmd]listtimers[/cmd] - */ - - KVSCSC(killtimer) - { - QString szName; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("name",KVS_PT_STRING,KVS_PF_OPTIONAL,szName) - KVSCSC_PARAMETERS_END - - if(KVSCSC_pSwitches->find('a',"active")) - { - KviKvsTimerManager::instance()->deleteAllTimers(); - return true; - } - - if(szName.isEmpty()) - { - if(!KviKvsTimerManager::instance()->deleteCurrentTimer()) - { - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("Timer name omitted but there is not current timer (this is not a timer callback)")); - } - } else { - if(!KviKvsTimerManager::instance()->deleteTimer(szName)) - { - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("Can't kill the timer '%Q' since it is not running"),&szName); - } - } - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: leave - @type: - command - @title: - leave - @syntax: - leave [-k] [-q] [-s] <channel list> [part message] - @short: - Alias for part - @description: - Builtin alias for the command [cmd]part[/cmd]. - */ - // Internally aliased to leave - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: links - @type: - command - @title: - links - @syntax: - links - @short: - Lists server links - @description: - List server links.[br] - The syntax of the parameters of this command is different on many servers.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RFC2821 wrapper - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: list - @type: - command - @title: - list - @syntax: - list [ <channel> *( "," <channel> ) [ <target> ] ] - @short: - Lists channels - @description: - List channels.[br] - The syntax of the parameters of this command is different on many servers.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RFC2821 wrapper - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: listtimers - @title: - listtimers - @type: - command - @short: - Lists the active timers - @syntax: - listtimers - @description: - Lists the currently active timers - @seealso: - [cmd]timer[/cmd], [fnc]$isTimer[/fnc], [cmd]killtimer[/cmd] - */ - - KVSCSC(listtimers) - { - KviPointerHashTable<QString,KviKvsTimer> * pTimerDict = KviKvsTimerManager::instance()->timerDict(); - - if(!pTimerDict) - return true; - - KviPointerHashTableIterator<QString,KviKvsTimer> it(*pTimerDict); - - KVSCSC_pContext->window()->outputNoFmt(KVI_OUT_VERBOSE,__tr2qs("List of active timers")); - - unsigned int uCnt = 0; - - while(KviKvsTimer * pTimer = it.current()) - { - QString szName = pTimer->name(); - QString szLifetime; - switch(pTimer->lifetime()) - { - case KviKvsTimer::Persistent: - szLifetime = __tr2qs("Persistent"); - break; - case KviKvsTimer::WindowLifetime: - szLifetime = __tr2qs("WindowLifetime"); - break; - case KviKvsTimer::SingleShot: - szLifetime = __tr2qs("SingleShot"); - break; - default: - szLifetime = __tr2qs("Unknown"); - break; - } - QString szDelay; - szDelay.setNum(pTimer->delay()); - QString szWindow; - szWindow = pTimer->window() ? pTimer->window()->id() : __tr2qs("None"); - - KVSCSC_pContext->window()->output(KVI_OUT_VERBOSE, - "Timer \"%Q\": Lifetime: %Q, Delay: %Q, Window: %Q", - &szName,&szLifetime,&szDelay,&szWindow - ); - - uCnt++; - ++it; - } - - KVSCSC_pContext->window()->output(KVI_OUT_VERBOSE,__tr2qs("Total: %u timers running"),uCnt); - - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: lusers - @type: - command - @title: - lusers - @syntax: - lusers [ <mask> [ <target> ] ] - @short: - Requests statistics about users on IRC - @description: - The LUSERS command is used to get statistics about the size of the - IRC network.[br]If no parameter is given, the reply will be about the - whole net.[br]If a <mask> is specified, then the reply will only - concern the part of the network formed by the servers matching the - mask.[br]Finally, if the <target> parameter is specified, the request - is forwarded to that server which will generate the reply.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RFC2821 wrapper - - -}; - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands_mr.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands_mr.cpp deleted file mode 100644 index 3bbfccb184..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands_mr.cpp +++ /dev/null @@ -1,1335 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_coresimplecommands_mr.cpp -// Created on Fri 31 Oct 2003 00:04:25 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_coresimplecommands.h" - -#include "kvi_window.h" -#include "kvi_console.h" -#include "kvi_query.h" -#include "kvi_ircuserdb.h" -#include "kvi_out.h" -#include "kvi_locale.h" -#include "kvi_app.h" -#include "kvi_options.h" -#include "kvi_fileutils.h" -#include "kvi_filedialog.h" -#include "kvi_ircconnection.h" -#include "kvi_channel.h" -#include "kvi_ircurl.h" -#include "kvi_frame.h" -#include "kvi_modulemanager.h" -#include "kvi_kvs_moduleinterface.h" - -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_script.h" -#include "kvi_kvs_popupmanager.h" - -#include <qcursor.h> -#include <qprocess.h> -#include <qtimer.h> - -namespace KviKvsCoreSimpleCommands -{ - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: me - @type: - command - @title: - me - @syntax: - me <text:string> - @short: - Sends a CTCP ACTION - @description: - Sends a CTCP ACTION to the current channel, query or dcc chat.[br] - If you execute it in any other window type, you will get an error.[br] - If you want to use this command in a window that is not a channel - query or dcc chat, you may use the [doc:command_rebinding]standard -r switch[/doc]. - @examples: - [example] - me is Hungry! - [/example] - */ - - KVSCSC(me) - { - QString szText; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("text",KVS_PT_STRING,KVS_PF_OPTIONAL | KVS_PF_APPENDREMAINING,szText) - KVSCSC_PARAMETERS_END - - KVSCSC_REQUIRE_CONNECTION - - switch(KVSCSC_pWindow->type()) - { - case KVI_WINDOW_TYPE_CHANNEL: - case KVI_WINDOW_TYPE_QUERY: - case KVI_WINDOW_TYPE_DCCCHAT: - KVSCSC_pWindow->ownAction(szText); - break; - default: - KVSCSC_pContext->warning(__tr2qs("/me can be used only in channels, queries and DCC chat windows")); - break; - } - - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: mode - @type: - command - @title: - mode - @syntax: - mode <target> <modeflags> [mode parameters] - @short: - Sends a MODE irc message - @description: - Sends a MODE irc message to the server of the current IRC context.[br] - The parameters are not modified in any way by KVIrc: so - you should use the RFC1459 syntax.[br] - This command is [doc:connection_dependant_commands]connection dependant[/doc]. - @examples: - [example] - mode #kvirc +oo-b Pragma Buti *!*root@* - [/example] - */ - - KVSCSC(mode) - { - QString szText; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("text",KVS_PT_STRING,KVS_PF_APPENDREMAINING,szText) - KVSCSC_PARAMETERS_END - - KVSCSC_REQUIRE_CONNECTION - - KviQCString szTxt = KVSCSC_pConnection->encodeText(szText); - - if(!szTxt.isEmpty()) - { - if(!KVSCSC_pConnection->sendFmtData("MODE %s",szTxt.data())) - return KVSCSC_pContext->warningNoIrcConnection(); - } - - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: motd - @type: - command - @title: - motd - @syntax: - motd [target server] - @short: - Requests the Message of the day - @description: - Requests the Message of the day from the specified server or the current server if no [target server] is specified.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RCF2821 wrapper - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: msg - @type: - command - @title: - msg - @syntax: - msg [-q] <target:string> <text:string> - @short: - Alias for privmsg - @switches: - !sw: -q | --quiet - Do not print any output - @description: - Sends a private message to the specified <target>. - <target> may be any PRIVMSG target allowed by the underlying - IRC protocol (see RFC1459). - This is really similar to [cmd]privmsg[/cmd] but also outputs the - message locally (unless the [-q] switch is used).[br] - This command is [doc:connection_dependant_commands]connection dependant[/doc].[br] - */ - // Internally aliased to privmsg - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: nick - @type: - command - @title: - nick - @syntax: - nick <new nickname:string> - @short: - Changes your nickname - @description: - Changes your nickname in the connection associated to the - current [b]IRC context[/b].[br] This command is "server based"; - this means that the effects will be visible only after the - server has acknowledged the change.[br] - This command is [doc:connection_dependant_commands]connection dependant[/doc].[br] - @examples: - [example] - nick Pragma - [/example] - */ - - KVSCSC(nick) - { - QString szNick; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("nickname",KVS_PT_NONEMPTYSTRING,0,szNick) - KVSCSC_PARAMETERS_END - - KVSCSC_REQUIRE_CONNECTION - - KviQCString szData = KVSCSC_pConnection->encodeText(szNick); - if(!szData.data())szData = ""; - - if(!KVSCSC_pConnection->sendFmtData("NICK %s",szData.data())) - return KVSCSC_pContext->warningNoIrcConnection(); - - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: notice - @type: - command - @title: - notice - @syntax: - notice [-q] <target:string> <text:string> - @short: - Sends a private notice - @switches: - !sw: -q | --quiet - Do not print any output - @description: - Sends a private notice to the specified <target>. - <target> may be any NOTICE target allowed by the underlying - IRC protocol (see RFC1459). - If the [-q] switch is specified, no output is printed. - This command is [doc:connection_dependant_commands]connection dependant[/doc].[br] - @examples: - [example] - notice Pragma Hello! - notice Pragma,Crocodile Hello to you both! - notice #kvirc Hello from outside! - [/example] - */ - - KVSCSC(notice) - { - QString szTarget,szText; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget) - KVSCSC_PARAMETER("text",KVS_PT_STRING,KVS_PF_OPTIONAL | KVS_PF_APPENDREMAINING,szText) - KVSCSC_PARAMETERS_END - - KVSCSC_REQUIRE_CONNECTION - - KviWindow * w = KVSCSC_pConnection->findChannel(szTarget); - if(!w)w = KVSCSC_pConnection->findQuery(szTarget); - - KviQCString szT = KVSCSC_pConnection->encodeText(szTarget); - KviQCString szD = w ? w->encodeText(szText) : KVSCSC_pConnection->encodeText(szText); - if(!szT.data())szT = ""; // encoding problems ? - if(!szD.data())szD = ""; // encoding problems ? - - if(!(KVSCSC_pConnection->sendFmtData("NOTICE %s :%s",szT.data(),szD.data()))) - return KVSCSC_pContext->warningNoIrcConnection(); - - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pWindow->output(KVI_OUT_OWNPRIVMSG,"[NOTICE >>> %Q]: %Q",&szTarget,&szText); - - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: op - @type: - command - @title: - op - @syntax: - op <nickname_list> - @short: - Sets chanop status to the specified users - @description: - Sets channel operator status to the users specified in <nickname_list>, - which is a comma separated list of nicknames. - This command works only if executed in a channel window. - The command is translated to a set of MODE messages containing - a variable number of +o flags. - This command is [doc:connection_dependant_commands]connection dependant[/doc]. - @examples: - [example] - op Pragma,Crocodile - [/example] - @seealso: - [cmd]deop[/cmd], [cmd]voice[/cmd], [cmd]devoice[/cmd] - */ - - KVSCSC(op) - { - return multipleModeCommand(__pContext,__pParams,__pSwitches,'+','o'); - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: openurl - @type: - command - @title: - openurl - @syntax: - openurl <url:string> - @short: - Opens an url - @description: - Opens the specified <url> with an appropriate handler.<br> - The handlers for the supported url types are specified in the options dialog.<br> - Each handler is a kvirc commandline that the url will be passed to as the first parameter ($0).<br> - The supported url types are:<br> - HTTP: http://<url> or sth that begins with "www." <br> - HTTPS: https://<url><br> - FILE: file://<url><br> - IRC: irc[s][6]://<server>[:<port>][/<channel>[?<pass>]] (Handled internally)<br> - FTP: ftp://<url> or sth that begins with "ftp."<br> - MAIL: mailto:<mailaddress><br> - @examples: - [example] - openurl http://www.kvirc.net - openurl https://www.secure.net - openurl file://home/pragma/pippo.txt - openurl irc://irc.eu.dal.net:6667 - openurl irc6://irc.ircd.it/#kvirc - openurl ircs://crypto.azzurra.org:9999 - openurl ircs6://ngnet.azzurra.org:9999 - openurl ftp://ftp.localhost.net/pub/kvirc/ - openurl mailto:users@domain.extension - [/example] - */ - - KVSCSC(openurl) - { - QString szUrl; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("url",KVS_PT_NONEMPTYSTRING,KVS_PF_APPENDREMAINING,szUrl) - KVSCSC_PARAMETERS_END - - QString szCommand; - if(KviQString::equalCIN(szUrl,"www.",4)) - { - szCommand = KVI_OPTION_STRING(KviOption_stringUrlHttpCommand); - szUrl.prepend("http://"); - } else if(KviQString::equalCIN(szUrl,"http:",5)) - { - szCommand = KVI_OPTION_STRING(KviOption_stringUrlHttpCommand); - } else if(KviQString::equalCIN(szUrl,"https:",6)) - { - szCommand = KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand); - } else if(KviQString::equalCIN(szUrl,"ftp",3)) - { - szCommand = KVI_OPTION_STRING(KviOption_stringUrlFtpCommand); - if(KviQString::equalCIN(szUrl,"ftp.",4))szUrl.prepend("ftp://"); - } else if(KviQString::equalCIN(szUrl,"file",4)) - { - szCommand = KVI_OPTION_STRING(KviOption_stringUrlFileCommand); - } else if(KviQString::equalCIN(szUrl,"irc",3)) - { - if(KviIrcUrl::run(szUrl,KviIrcUrl::FirstFreeContext,KVSCSC_pContext->console()) & KviIrcUrl::InvalidProtocol) - { - KVSCSC_pContext->warning(__tr2qs("Invalid IRC url (%Q)"),&szUrl); - } - return true; - } else if(KviQString::equalCIN(szUrl,"mailto",6)) - { - szCommand = KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand); - } -#ifdef COMPILE_ON_WINDOWS - if(KVI_OPTION_BOOL(KviOption_boolUseSystemUrlHandlers)) - { - ShellExecute(NULL, "open", szUrl.local8Bit().data(), - NULL, NULL, SW_SHOWNORMAL); - } else { -#endif - if(szCommand.isEmpty())szCommand = KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand); - - if(!szCommand.isEmpty()) - { - KviKvsVariantList vList; - vList.append(new KviKvsVariant(szUrl)); - - QString szName = "openurl::handler"; - KviKvsScript script(szName,szCommand); - - if(!script.run(KVSCSC_pWindow,&vList,0,KviKvsScript::PreserveParams)) - KVSCSC_pContext->warning(__tr2qs("The commandline for this url type seems to be broken (%Q)"),&szUrl); - - } else KVSCSC_pContext->warning(__tr2qs("No commandline specified for this type of url (%Q)"),&szUrl); -#ifdef COMPILE_ON_WINDOWS - } -#endif - - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - /* - @doc: oper - @type: - command - @title: - oper - @syntax: - oper <name> <password> - @short: - Requests IRC operator status - @description: - Requests IRC operator status.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RFC2821 wrapper - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: option - @type: - command - @title: - option - @syntax: - option [<optName:string> <optValue:string>] - @short: - Sets an internal option - @description: - Sets an internal option named <optName> to the value <optValue>. The value - must be appropriate for the type of option that you're going to set.[br] - With no parameters this command lists all the available option names - sorted by option type.[br] The possible option types are:[br] - [b]Boolean[/b]: <optValue> must be "1" or "0"[br] - [b]String[/b]: <optValue> can be any string[br] - [b]StringList[/b]: <optValue> must be a comma separated list of strings (eventually empty)[br] - [b]Color[/b]: <optValue> must have the format #RRGGBB where R G and B are hex digits[br] - [b]Font[/b]: <optValue> is a comma separated list of font properties: - <family>,<pointsize>,<style>,<charset>,<weight>,<flags>. <family> is the font face name - ("arial" , "helvetica" etc..), <pointsize> is more or less the indicator of the size of the font - (try sth like 12,14), <style> is an integer that indicates the font style (fixed for example), - <charset> is an integer that indicates the charset of the font (maybe one day I'll document it better), - <weight> indicates the (ehm) weight of the font (50,100,150...matches Bold,DemiBold etc..), - <flags> is a combination of 'b','i','u','s,' and 'f' that match respectively bold,italic - underline,strikeout and fixed.[br] - [b]MessageType[/b]: <optValue> is a comma separated list of message type properties: - <icon>,<foreground>,<background>,<logBoolean>,<level>: <icon> is the index of the internal - small icon that has to be shown with the message type, <foreground> is an integer - indicating the mirc color to be used for the message type text (0-15), - <background> is similar to foreground and accepts also the value of 100 that means transparent. - <logBoolean> is a boolean value (0/1) that indicates wheter this message type has to be logged or not. - <level> is the message level (actually from 0 to 5).[br] - [b]Rectangle[/b]: <optValue> is a comma separated list of integer values that indicate <x>,<y>,<width> and <height>.[br] - [b]Pixmap[/b]: <optValue> must be an ABSOLUTE path of the image that you want to load.[br] - [b]Int[/b]: <optValue> must be an integer.[br] - [b]Uint[/b]: <optValue> must be an UNSIGNED positive integer.[br] - Almost all the options available in the option dialog can be set by this command.[br] - Some GUI options might require a KVIrc restart to work properly (altough I've tried to avoid that when possible). - @examples: - [example] - [comment]# List available options[/comment] - option - [comment]# Set the mdi mananger background image[/comment] - option pixmapMdiBackground /home/pragma/myback1.png - [comment]# Set the frame caption text[/comment] - option stringFrameCaption KVIrc rulez! - [comment]# Enable verbose mode[/comment] - option boolBeVerbose 1 - [comment]# Set the irc view font[/comment] - option fontIrcView helvetica,24,5,1,50 - [/example] - @seealso: - [fnc]$option[/fnc] - */ - - KVSCSC(option) - { - QString szName; - QString szValue; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("optName",KVS_PT_STRING,KVS_PF_OPTIONAL,szName) - KVSCSC_PARAMETER("optValue",KVS_PT_STRING,KVS_PF_OPTIONAL | KVS_PF_APPENDREMAINING,szValue) - KVSCSC_PARAMETERS_END - - if(szName.isEmpty()) - { - // list available options - g_pApp->listAvailableOptions(KVSCSC_pWindow); - } else { - if(!g_pApp->setOptionValue(szName,szValue))KVSCSC_pContext->warning(__tr2qs("Option setting error: Unknown option or invalid value for option type")); - } - - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: parse - @type: - command - @title: - parse - @syntax: - parse [-q] [-e] [-f] [-r] <filename:string> [<parameter1:variant> [<parameter2:variant> [...]]] - @short: - Executes commands from a file - @switches: - !sw: -e | --fail-on-load - Causes the command to terminate with an error when the file - can't be loaded: the error termination stops the parsing - of the current script too. If the -e switch is not used then - file load failures are eventually reported only as a warning - or not reported at all (if -q is used). - !sw: -f | --fail-on-error - Causes the command to terminate with an error when the execution - of the script loaded from disk generates an error. - This error termination stops the parsing of the current script too. - If the -f switch is not used then the loaded script errors - do not stop the current script. - !sw: -q | --quiet - Causes the command to run quietly without printing warnings about - empty <filename> and file loading errors. - !sw: -r | --propagate-return - Causes the return value of the script to be propagated to the - calling context. This allows the usage of ${ } trick to extract - this return value. See the examples section for a sample usage. - @description: - Executes commands from the external file <filename>.[br] - <filename> can be an absolute or relative path.[br] - If it is a relative path then KVIrc will try to look it up - in the path of the calling script (if any) and in the current - KVIrc working directory. - The file must be utf8-encoded (see below). - [parameters] is a space separated string of parameters to be - passed to the script. The parameter $0 will contain the - path of the file being parsed, the other parameters will - be available starting from $1.[br] - If <filename> is an existing directory name a file dialog - will pop up, allowing you to choose a file to parse. - The file dialog will start in the directory specified by <filename>. - If you don't know the name of an existing directory, just pass "." - or "/". The command just prints a warning if the file cannot be loaded for - some reason. If you want the command to stop with an error in - this case then use the -e switch.[br] - This command has a builtin alias called [cmd]include[/cmd]. - [br][br] - Note that script files, especially the ones that you distribute, - MUST be encoded in utf8. Any other encoding (especially the exotic - ones like KOI8R or Shift-JIS) may screw things up. - The reason for such a constraint is simple: KVIrc has no means - of knowing the encoding that one or other scripter uses to - edit his files. Unlike other languages (like HTML, for example) - there is no "external" metadata that will allow for - encoding detection before the data is actually decoded. - UTF8 is the right way (tm). Use it. - @examples: - [example] - parse /home/pragma/myscript.kvs - [/example] - [example] - [comment]# Here we are assuming that fetchdata.kvs returns a string[/comment] - [comment]# We evaluate the return value thru ${} and echo it[/comment] - echo ${ parse -r /home/pragma/fetchdata.kvs; }; - [/example] - */ - - KVSCSC(parse) - { - QString szFileName; - KviKvsVariantList vList; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,0,szFileName) - KVSCSC_PARAMETER("params",KVS_PT_VARIANTLIST,KVS_PF_OPTIONAL,vList) - KVSCSC_PARAMETERS_END - - KviFileUtils::adjustFilePath(szFileName); - - if(KviFileUtils::directoryExists(szFileName)) - { - QString szTmp; - KVSCSC_pContext->enterBlockingSection(); - - bool bResult = KviFileDialog::askForOpenFileName(szTmp,__tr2qs("Choose a file to parse"),szFileName.utf8().data(),"*.kvs"); - - if(!KVSCSC_pContext->leaveBlockingSection())return false; // need to stop immediately - if(!bResult)return true; - - szFileName = szTmp; - - if(szFileName.isEmpty())return true; // done - KviFileUtils::adjustFilePath(szFileName); - } else { - QFileInfo inf(szFileName); - if(inf.isRelative()) - { - if(QString * pszPath = KVSCSC_pContext->scriptFilePath()) - { - QFileInfo inf2(*pszPath); - QString szCheckFileName = inf2.dirPath(); - KviQString::ensureLastCharIs(szCheckFileName,KVI_PATH_SEPARATOR_CHAR); - szCheckFileName += szFileName; - if(KviFileUtils::fileExists(szCheckFileName)) - szFileName = szCheckFileName; - } - } - } - - QFileInfo infz(szFileName); - szFileName = infz.absFilePath(); - - QString szBuffer; - if(!KviFileUtils::loadFile(szFileName,szBuffer,true)) // <-- scripts SHOULD be shipped in utf8 format - { - if(KVSCSC_pSwitches->find('e',"fail-on-load")) - { - KVSCSC_pContext->error(__tr2qs("Failed to load the file '%Q' for parsing"),&szFileName); - return false; - } else { - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("Failed to load the file '%Q' for parsing"),&szFileName); - return true; - } - } - - KviKvsScript s(szFileName,szBuffer); - - KviKvsVariant * pRetVal = KVSCSC_pSwitches->find('r',"propagate-return") ? KVSCSC_pContext->returnValue() : 0; - KviKvsVariant vFileName(szFileName); - vList.prepend(&vFileName); - - KviKvsExtendedRunTimeData rtd(&szFileName); - - if(!s.run(KVSCSC_pContext->window(),&vList,pRetVal,KviKvsScript::PreserveParams,&rtd)) - { - if(KVSCSC_pSwitches->find('f',"fail-on-error"))return false; - } - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: part - @type: - command - @title: - part - @syntax: - part [-k] [-q] [-s] [<channel list> [part message]] - @short: - Leaves the specified channels - @switches: - !sw: -k | --keep - Keeps the channel windows open after the part. - !sw: -q | --quiet - Runs the command in quiet mode (no warnings printed) - !sw: -s | --silent - Does not show the part message in the channel window - @description: - Leaves the channels specified in the <channel list>. - If no channels are specified, the current channel is used. - This command is "server based"; you will see its results only - after the server acknowledges it.[br] - If the -k switch is specified then the channel windows are left open - after the part (the channels become dead channels).[br] - If the -s switch is specified then the part message is not shown - in the channel window.[br] - This command is [doc:connection_dependant_commands]connection dependant[/doc].[br] - This command is equivalent to [cmd]leave[/cmd] - @examples: - [example] - part #kvirc Byez! - part #linux-it,#xmms,#kde Time to sleep - [/example] - */ - - KVSCSC(part) - { - QString szChans,szMsg; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("chans",KVS_PT_STRING,KVS_PF_OPTIONAL,szChans) - KVSCSC_PARAMETER("part_message",KVS_PT_STRING,KVS_PF_OPTIONAL | KVS_PF_APPENDREMAINING,szMsg) - KVSCSC_PARAMETERS_END - - KVSCSC_REQUIRE_CONNECTION - - if(szChans.isEmpty()) - { - if(KVSCSC_pWindow->type() == KVI_WINDOW_TYPE_CHANNEL) - szChans = KVSCSC_pWindow->target(); - else { - if(!KVSCSC_pSwitches->find('q',"quiet"))KVSCSC_pContext->warning(__tr2qs("Missing channel list")); - return true; - } - } - - KviQCString szEncodedChans = KVSCSC_pConnection->encodeText(szChans); - - QStringList sl = QStringList::split(",",szChans); - - if(!szMsg.isEmpty()) - { - KviQCString szText; - if(sl.count() == 1) - { - // single chan , use channel encoding if possible - KviChannel * ch = KVSCSC_pConnection->findChannel(szChans); - if(ch) - szText = ch->encodeText(szMsg); - else - szText = KVSCSC_pConnection->encodeText(szMsg); - } else { - // multiple chans, use connection encoding - szText = KVSCSC_pConnection->encodeText(szMsg); - } - if(!(KVSCSC_pConnection->sendFmtData("PART %s :%s",szEncodedChans.data(),szText.data()))) - return KVSCSC_pContext->warningNoIrcConnection(); - } else { - if(!(KVSCSC_pConnection->sendFmtData("PART %s",szEncodedChans.data()))) - return KVSCSC_pContext->warningNoIrcConnection(); - } - - for(QStringList::Iterator it=sl.begin();it != sl.end();it++) - { - KviChannel * ch = KVSCSC_pConnection->findChannel(*it); - if(ch) - { - ch->partMessageSent(!KVSCSC_pSwitches->find('k',"keep"),!KVSCSC_pSwitches->find('s',"silent")); - } else { - if(!KVSCSC_pSwitches->find('q',"quiet"))KVSCSC_pContext->warning(__tr2qs("You don't appear to be on channel %s"),(*it).utf8().data()); - } - } - - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: pass - @type: - command - @title: - pass - @syntax: - pass <password> - @short: - Sends a password to the server - @description: - Sends a password to the server: usually KVIrc takes care of it , but well.. this is useful with bouncers.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RFC2821 wrapper - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: play - @type: - command - @title: - play - @syntax: - play <filename:string> - @short: - DEPRECATED: Use $snd.play instead! - @description: - This command has been moved to the snd module. - See [cmd]snd.play[/cmd] - */ - - KVSCSC(play) - { - // cool, no ? - - KviModule * m = g_pModuleManager->getModule("snd"); - if(!m) - { - KVSCSC_pContext->error(__tr2qs("Module command call failed: can't load the module 'snd'")); - return false; - } - - KviKvsModuleSimpleCommandExecRoutine * proc = m->kvsFindSimpleCommand("play"); - if(!proc) - { - KVSCSC_pContext->error(__tr2qs("Module command call failed: the module 'snd' doesn't export a command named 'play'")); - return false; - } - - KviKvsModuleCommandCall call(m,KVSCSC_pContext,KVSCSC_pParams,KVSCSC_pSwitches); - - return (*proc)(&call); - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: popup - @type: - command - @title: - popup - @syntax: - popup [-p=<screen_coordinates:string>] <popup_name:string> [<parameter1:variant> [<parameter2:variant> [...]]] - @short: - Shows a popup menu - @switches: - !sw: -p=<screen_coordinates:string> | --point=<screen_coordinates:string> - @description: - Shows the popup menu <popup_name> at the current cursor position, - eventually passing the [parameters]. Please note that you can't - use this command inside one of the [cmd]defpopup[/cmd] command - handlers for <popup_name>. In other words, you can't "popup - a popup" while it is being popped up. :) (This would - be an endless recursive behaviour).[br] - If the -p switch is used , then <screen_coordinates> must be - in the form <x>,<y> and will be used as screen coordinates - for the placement of the popup (instead of the current cursor position).[br] - @seealso: - [cmd]defpopup[/cmd] - */ - - KVSCSC(popup) - { - QString szPopupName; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("popup_name",KVS_PT_NONEMPTYSTRING,0,szPopupName) - KVSCSC_PARAMETERS_END - - // copy parameters - KviKvsVariantList * pPopupParams = new KviKvsVariantList(); - KVSCSC_pParams->first(); - while(KviKvsVariant * v = KVSCSC_pParams->next())pPopupParams->append(new KviKvsVariant(*v)); - - KviKvsPopupMenu * pMenu = KviKvsPopupManager::instance()->lookup(szPopupName); - - if(!pMenu) - { - delete pPopupParams; - pPopupParams = 0; - KVSCSC_pContext->error(__tr2qs("Popup %Q is not defined"),&szPopupName); - return false; - } - - if(pMenu->isLocked()) - { - delete pPopupParams; - pPopupParams = 0; - KVSCSC_pContext->error(__tr2qs("A popup menu cannot be popped up twice")); - return false; - } - - QPoint pnt = QCursor::pos(); - - KviKvsVariant * pCoords = KVSCSC_pSwitches->find('p',"point"); - if(pCoords) - { - QString szCoords; - pCoords->asString(szCoords); - - int idx = szCoords.find(','); - bool bCoordsOk = true; - if(idx == -1)bCoordsOk = false; - else { - QString szX = szCoords.left(idx); - szCoords.remove(0,idx + 1); - bool bOk1,bOk2; - int iX = szX.toInt(&bOk1); - int iY = szCoords.toInt(&bOk2); - if(bOk1 && bOk2)pnt = QPoint(iX,iY); - else bCoordsOk = false; - } - - if(!bCoordsOk)KVSCSC_pContext->warning(__tr2qs("Invalid syntax for screen coordinates, using cursor position")); - } - - pMenu->doPopup(pnt,KVSCSC_pContext->window(),pPopupParams); - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: privmsg - @type: - command - @title: - privmsg - @syntax: - privmsg <target:string> <text:string> - @short: - Sends a private message - @switches: - !sw: -q | --quiet - Do not print any output - @description: - Sends a private message to the specified <target>. - <target> may be any PRIVMSG target allowed by the underlying - IRC protocol (see RFC1459). - This command is really similar to [cmd]msg[/cmd] but it does not - output the message locally.[br] - This command is [doc:connection_dependant_commands]connection dependant[/doc].[br] - This command is equivalent to [cmd]msg[/cmd] - @examples: - [example] - privmsg Pragma Hello! - privmsg Pragma,Crocodile Hello to you both! - privmsg #kvirc Hello from outside! - [/example] - */ - - KVSCSC(privmsg) - { - QString szTarget,szText; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget) - KVSCSC_PARAMETER("text",KVS_PT_STRING,KVS_PF_OPTIONAL | KVS_PF_APPENDREMAINING,szText) - KVSCSC_PARAMETERS_END - - KVSCSC_REQUIRE_CONNECTION - - KviWindow * w = KVSCSC_pConnection->findChannel(szTarget); - if(!w)w = KVSCSC_pConnection->findQuery(szTarget); - - if(w)w->ownMessage(szText); - else { - - KviQCString szT = KVSCSC_pConnection->encodeText(szTarget); - KviQCString szD = w ? w->encodeText(szText) : KVSCSC_pConnection->encodeText(szText); - if(!szT.data())szT = ""; // encoding problems ? - if(!szD.data())szD = ""; // encoding problems ? - - if(!(KVSCSC_pConnection->sendFmtData("PRIVMSG %s :%s",szT.data(),szD.data()))) - return KVSCSC_pContext->warningNoIrcConnection(); - - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pWindow->output(KVI_OUT_OWNPRIVMSG,"[PRIVMSG >>> %Q]: %Q",&szTarget,&szText); - } - - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: query - @type: - command - @title: - query - @syntax: - query <nickname list> [text] - @short: - Opens one or more query windows - @description: - Opens a query window for each user specified in <nickname list> - which is a [b]comma separated[/b] list of nicknames.[br] - If [text] is speficied, it is sent to the - query window just as it would have been written in the query itself. - If a query with one of the specified targets already exists, - it is simply focused and the [text] is sent to the target.[br] - This command is [doc:connection_dependant_commands]connection dependant[/doc].[br] - @examples: - [example] - [comment]# Open a single query to Pragma[/comment] - query Pragma - [comment]# Open a query to Pragma and to Crocodile , say "Hello!" in both windows[/comment] - query Pragma,Crocodile Hello ! - [/example] - */ - - KVSCSC(query) - { - QString szTargets,szText; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("targets",KVS_PT_NONEMPTYSTRING,0,szTargets) - KVSCSC_PARAMETER("text",KVS_PT_STRING,KVS_PF_OPTIONAL | KVS_PF_APPENDREMAINING,szText) - KVSCSC_PARAMETERS_END - - KVSCSC_REQUIRE_CONNECTION - - KviQuery * query; - - QStringList sl = QStringList::split(",",szTargets); - for(QStringList::Iterator it = sl.begin();it != sl.end();it++) - { - QString szNick = *it; - if(szNick.isEmpty())KVSCSC_pContext->warning(__tr2qs("Empty target specified")); - else { - query = KVSCSC_pWindow->console()->connection()->findQuery(szNick); - if(!query) { - query = KVSCSC_pWindow->console()->connection()->createQuery(szNick); - QString user; - QString host; - KviIrcUserDataBase * db = KVSCSC_pWindow->connection()->userDataBase(); - if(db) - { - KviIrcUserEntry * e = db->find(szNick); - if(e) - { - user = e->user(); - host = e->host(); - } - } - query->setTarget(szNick,user,host); - } - query->autoRaise(); - query->setFocus(); - if(!szText.isEmpty())query->ownMessage(szText); - } - } - - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: quit - @type: - command - @title: - quit - @syntax: - quit [-f] [-u] [quit-message:string] - quit -q - @short: - Terminates the current IRC connection or the entier application - @switches: - !sw: -q | --quit - Terminates this KVIrc application instance - !sw: -f | --force - Forces the immediate termination of the current IRC session (The QUIT message may be not sent) - !sw: -u | --unexpected - Simulates an "unexpected disconnection" - @description: - Terminates the current IRC session.[br] - By default this command sends a QUIT message - and waits for the server to close the connection.[br] - If you want to force KVIrc to close the connection - immediately after sending the QUIT message you must use the -f switch.[br] - Forcing the connection may cause your quit message to not be - displayed to the other IRC users: most likely it will be replaced - by a 'Connection reset by peer' or a 'EOF from client'.[br] - If the -u switch is specified then an "unexpected disconnection" will be simulated - and all the related options will be applied (e.g. automatic reconnection, - channels and queries kept open etc..). The QUIT message will be still sent unless - the -f switch is used. You can control all the "unexpected - disconnection" options in the options dialog. - If the -q switch is specified , this command terminates KVIrc immediately.[br] - @examples: - [example] - quit Time to sleep - [/example] - */ - - KVSCSC(quit) - { - QString szReason; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("reason",KVS_PT_STRING,KVS_PF_OPTIONAL | KVS_PF_APPENDREMAINING,szReason) - KVSCSC_PARAMETERS_END - - if(KVSCSC_pSwitches->find('q',"quit")) - { - QTimer::singleShot(0,g_pApp,SLOT(quit())); - } else { - KVSCSC_REQUIRE_CONNECTION - KVSCSC_pWindow->context()->terminateConnectionRequest(KVSCSC_pSwitches->find('f',"force"),szReason,KVSCSC_pSwitches->find('u',"unexpected")); - } - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: quote - @type: - command - @title: - quote - @syntax: - quote [-q] <raw command:string> - @short: - Builtin alias for raw - @switches: - !sw: -q | --quiet - Be quiet: do echo the raw data. - @description: - Builtin alias for the command [cmd]raw[/cmd]. - */ - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: raise - @type: - command - @title: - raise - @syntax: - raise - @short: - Raises a KVIrc frame window - @description: - Raises and activates the current KVIrc frame window....assuming that your window manager supports it.[br] - */ - - KVSCSC(raise) - { - if(!KVSCSC_pWindow->frame()->isVisible())KVSCSC_pWindow->frame()->show(); - KVSCSC_pWindow->frame()->raise(); - //KVSCSC_pWindow->frame()->setActiveWindow(); - //KVSCSC_pWindow->frame()->setFocus(); - ((KviTalMainWindow *)KVSCSC_pWindow->frame())->setActiveWindow(); - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: raw - @type: - command - @title: - raw - @syntax: - raw [-q] <raw command:string> - @short: - Sends raw data to the server - @switches: - !sw: -q | --quiet - Be quiet: do echo the raw data. - @description: - Sends a raw data string to the server of the current [b]IRC context[/b].[br] - If the -q switch (quiet) is specified, no output is printed. - This command is [doc:connection_dependant_commands]connection dependant[/doc].[br] - This command is equivalent to [cmd]quote[/cmd]. - @examples: - [example] - [comment]# Send a private message "by hand"[/comment] - raw PRIVMSG Pragma :hello! - [comment]# Send a private message thru another connection[/comment] - raw -r=[fnc]$console[/fnc]([fnc]$ic[/fnc](irc.otherserver.com,othernick)) PRIVMSG Pragma :heya on this side! - [/example] - */ - - KVSCSC(raw) - { - QString szRawCommand; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("raw_command",KVS_PT_STRING,KVS_PF_APPENDREMAINING,szRawCommand) - KVSCSC_PARAMETERS_END - - KVSCSC_REQUIRE_CONNECTION - - KviQCString szData = KVSCSC_pConnection->encodeText(szRawCommand); - if(!szData.data())szData = ""; - - if(!KVSCSC_pConnection->sendData(szData.data())) - return KVSCSC_pContext->warningNoIrcConnection(); - - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pWindow->output(KVI_OUT_RAW,__tr2qs("[RAW]: %Q"),&szRawCommand); - - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: rebind - @type: - command - @title: - rebind: - @syntax: - rebind [-q] <window_id:string> - @short: - Rebinds a command sequence to a specified window - @switches: - !sw: -q | --quiet - Causes the command to run quietly, print no warnings - and don't fail when the window identifier passed is empty. - @description: - Rebinds the current command sequence to the window specified by <window_id>.[br] - The new window will be inherited by all the subcommands and aliases called.[br] - -q causes the command to run quietly.[br] - [b]Handle with care.[/b] - @examples: - [comment]# Try this example in a channel or query window[/comment] - [comment]# Remember the current window id[/comment] - %winid = $window - [comment]# Rebind to the console of the current irc context[/comment] - rebind $console - echo "Hello from the console :)" - echo "Hello again.. still in the console" - [comment]# Rebind back[/comment] - rebind %winid - echo "Again in this window :)" - */ - - KVSCSC(rebind) - { - QString szWinId; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("window_id",KVS_PT_NONEMPTYSTRING,0,szWinId) - KVSCSC_PARAMETERS_END - - KviWindow * pAux = g_pApp->findWindow(szWinId.utf8().data()); - if(pAux)KVSCSC_pContext->setWindow(pAux); - else { - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("Window with id %Q not found: no rebinding performed"),&szWinId); - } - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: return - @type: - command - @title: - return - @syntax: - return <value:variant> - @short: - Returns from the current command sequence and sets it return value - @description: - Sets the return value of the current command sequence to <string> - and stops the execution.[br] - This is more or less equivalent to calling [cmd]setreturn[/cmd] <string> - and then [cmd]halt[/cmd], but has no additional semantics in events.[br] - Starting from version 3.0.0 of kvirc you can also return - arrays and hashes just like any other variable types. - @examples: - return $array(item1,item2,3213,itemX); - @seealso: - [cmd]setreturn[/cmd], [cmd]break[/cmd], [cmd]halt[/cmd] - */ - - KVSCSC(returnCKEYWORDWORKAROUND) - { - if(KVSCSC_pParams->count() == 0) - { - KVSCSC_pContext->returnValue()->setNothing(); - return false; - } - if(KVSCSC_pParams->count() == 1) - { - KVSCSC_pContext->returnValue()->copyFrom(*(KVSCSC_pParams->first())); - return false; - } - - QString all; - KVSCSC_pParams->allAsString(all); - KVSCSC_pContext->returnValue()->setString(all); - return false; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: run - @type: - command - @title: - run - @syntax: - run <commandline:string> - @short: - Runs an external process - @description: - Runs an external process. This command does not allow - any other interaction with the process started. If you want - to grab the process output you probably need to use [cmd]exec[/cmd]. - Run doesn't spawn a subshell in order to execute the <commandline> - and thus if you need shell substitutions to be made you must invoke - the shell by yourself (probably by passing the real command as the -c argument). - @examples: - [example] - run xterm - run xmessage -center * - [comment]# note the difference in * processing[/comment] - run /bin/bash -c "xmessage -center *" - [/example] - */ - - KVSCSC(run) - { - QString szCommand; - QStringList l; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("command",KVS_PT_STRING,0,szCommand) - KVSCSC_PARAMETER("parameters",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,l) - KVSCSC_PARAMETERS_END - -#ifdef COMPILE_USE_QT4 - QProcess proc; - proc.start(szCommand,l); - // FIXME: KVSCSC_pContext->warning(__tr2qs("Failed to execute command '%Q'"),&szCommand); -#else - QProcess proc(szCommand); - for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it ) proc.addArgument(*it); - if(!proc.start())KVSCSC_pContext->warning(__tr2qs("Failed to execute command '%Q'"),&szCommand); -#endif - return true; - } -}; - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands_sz.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands_sz.cpp deleted file mode 100644 index 332414ca45..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_coresimplecommands_sz.cpp +++ /dev/null @@ -1,974 +0,0 @@ -// //============================================================================= -// -// File : kvi_kvs_coresimplecommands_sz.cpp -// Created on Fri 31 Oct 2003 00:04:25 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_coresimplecommands.h" - -#include "kvi_kvs_popupmanager.h" -#include "kvi_kvs_script.h" - -#include "kvi_ircconnection.h" -#include "kvi_console.h" -#include "kvi_locale.h" -#include "kvi_app.h" -#include "kvi_asynchronousconnectiondata.h" -#include "kvi_frame.h" -#include "kvi_netutils.h" -#include "kvi_menubar.h" -#include "kvi_userinput.h" - -namespace KviKvsCoreSimpleCommands -{ - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: say - @type: - command - @title: - say - @syntax: - say [-x] [-q] [-r=<window_id>] <text:string> - @switches: - !sw: -q | --quiet - Run quietly - !sw: -r=<window_id> | --rebind=<window_id> - Standard command rebinding switch - !sw: -x | --allow-exec - Allow the execution of commands by interpreting the leading slash in th <text> - @short: - Type text in a window - @description: - This command is more or less equivalent to typing text in the input - entry of the current window. If the -r switch is used - then the command is rebound to the window specified by <window_id>. - The main difference is that the variables and identifiers in <text> - are always parsed (when typing this happen only if the text is a command).[br] - With -x you can also use this command to execute "variable" commands too: - if <text> begins with a slash then it will be treated as a command - to be executed (after parsing the identifiers etc.).[br] - Please note that using /say -x with a <text> that isn't a constant - in the script but comes from some unidentified external source (e.g. the network) - is a potential security flaw: don't do it. - When the -x switch is not used, the text is never interpreted as command. - -q causes the command to run quietly.[br] - Please note that /say will also trigger the [event:ontextinput]OnTextInput[/event] event. - [b]Handle with care.[/b] - */ - - KVSCSC(say) - { - QString szText; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("text",KVS_PT_STRING,KVS_PF_APPENDREMAINING,szText) - KVSCSC_PARAMETERS_END - - if(KVSCSC_pSwitches->find('x',"allow-exec")) - { - // allow execution of commands - if(!KviUserInput::parse(szText,KVSCSC_pWindow,__tr2qs("say: injected commandline"))) - { - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("Say parse error: Broken command")); - } - } else { - KviUserInput::parseNonCommand(szText,KVSCSC_pWindow); - } - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: server - @type: - command - @title: - server - @syntax: - server [switches] [<server:string> [<port:uint>]] - @keyterms: - connecting to a server - @short: - Connects to the specified server - @switches: - !sw: -b=<local address:string> | --bind-address=<local address:string> - Bind the outgoing connection to <local address>. The <local address> must be - the IP address of a local interface suitable for contacting the remote <server>: - this means that if you're going to use the -i switch, the <local address> - must be an IPV6 address. - On most systems it is also possible to use a local interface name as <local address>; - in this way the interface address can be resolved at runtime by the KVIrc network engine. - - !sw: -c=<command sequence:string> | --command=<command sequence:string> - The <command sequence> will be executed just after the login operations - have been completed. - - !sw: -f=<socket filter:string> | --filter=<socket filter:string> - Activates <socket filter> on the connection. - A socket filter is a plugin that can adapt the IRC protocol to other existing protocols such as OpenNap. - For plain IRC it is not needed. - - !sw: -i | --ipv6 - Makes the connection by using the IPV6 protocol - (if supported by the executable) - - !sw: -n | --new-context - Forces the connection to be attempted in a new IRC context instead of the current one. - - !sw: -p=<password:string> | --password=<password:string> - Uses <password> to login to the server (the password will be stored in the server - entry too). - - !sw: -q=<nick:string> | --nickname=<nick:string> - Uses <nick> to login to the server (the nicknames will be stored in the server - entry too). - - !sw: -s | --ssl - Activates the SSL support for this connection - - !sw: -u | --unused-context - Forces the connection to be attempted in the first IRC context that has - no connection in progress. If all the IRC contexts have connections in progress - then a new one is created. - - !sw: -l | --last - When <server> and <port> are empty use the last - @description: - Attempts a connection to the specified <server> - on the specified <port>. If no <port> is specified - the default 6667 is used. If no <server> is specified, - the currently selected server from the server list is used - unless the -l switch is passed: in this case the last server - that was used in the IRC context is re-used. - If the <server> is a valid IPV6 address, the -i switch is implied.[br] - The <server> is added to the server list (if not already - there) and set as current.[br] - [br] - If <server> is in the form "id:<some_string>" then <some_string> - is interpreted as the server's internal id (specified in the options dialog). - This is useful when you need to force kvirc to choose between multiple - server entries with the same hostname and port stored in the database.[br] - Please note that this form causes most of the switches to have no effect - since the entry in the database will override them. If no server - entry with the specified identifier is found then an error will be generated - and the connection attempt will stop. - [br] - If <server> doesn't seem to be a valid ip address or hostname (i.e. it contains no dots) - and it doesn't look to be in the form "id:<some_string>" then - it is assumed to be a network name and if such a network is found - in the server list then the best server for that network is contacted. - (KVIrc tries to guess the round-robin (random) servers first).[br] - This behaviour can be forced by adding the "net:" prefix to the <server> - (so it will work even if the network name contains a dot).[br] - [br] - The connection is attempted in the current IRC context. If there is already - a connection in progress then it is "brutally" terminated.[br] - @examples: - [example] - server irc.tin.it - server -i irc6.ircd.it - server -i ircd.stealth.net 6667 - server irc.undernet.org 6665 - server -n irc.openprojects.net - server -c="join #kvirc" irc.stealth.net 6665 - server -b=ppp0 irc.tin.it - server undernet - server id:mybouncerwithusername1 - server id:mybouncerwithusername2 - server net:under.net - [/example] - */ - - KVSCSC(server) - { - QString szServer; - kvs_uint_t uPort; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("server",KVS_PT_STRING,KVS_PF_OPTIONAL,szServer) - KVSCSC_PARAMETER("port",KVS_PT_UINT,KVS_PF_OPTIONAL,uPort) - KVSCSC_PARAMETERS_END - - KviConsole * console = 0; - if(KVSCSC_pSwitches->find('n',"new-context"))console = KVSCSC_pWindow->frame()->createNewConsole(); - else { - if(KVSCSC_pSwitches->find('u',"unused-context")) - { - // first try the current console - console = KVSCSC_pWindow->console(); - if(console) - { - // if there is a connection in progress, proceed in searching - if(console->connectionInProgress()) - { - console = 0; - } - } - if(!console) - { - // yep , have to search - console = KVSCSC_pWindow->frame()->firstNotConnectedConsole(); - if(!console) - { - console = KVSCSC_pWindow->frame()->createNewConsole(); - } - } - } else console = KVSCSC_pWindow->console(); - } - - QString szCmd,szBindAddress,szSocketFilter,szPassword,szNick; - KVSCSC_pSwitches->getAsStringIfExisting('c',"command",szCmd); - KVSCSC_pSwitches->getAsStringIfExisting('b',"bind-address",szBindAddress); - KVSCSC_pSwitches->getAsStringIfExisting('f',"filter",szSocketFilter); - KVSCSC_pSwitches->getAsStringIfExisting('p',"password",szPassword); - KVSCSC_pSwitches->getAsStringIfExisting('q',"nickname",szNick); - - if(!console) - { - KVSCSC_pContext->error(__tr2qs("Couldn't find a suitable IRC context for the connection, try using -n or -u")); - return false; - } - - if(szServer.isEmpty()) - { - // just as hitting "connect" - if(console->connectionInProgress()) - { - KVSCSC_pContext->error(__tr2qs("Another connection is already in progress in the selected IRC context")); - return false; - } else { - KviAsynchronousConnectionData * d = new KviAsynchronousConnectionData(); - d->bUseLastServerInContext = KVSCSC_pSwitches->find('l',"last") != 0; - d->szCommandToExecAfterConnect = szCmd; - d->szBindAddress = szBindAddress; - d->szPass = szPassword; - d->szNick = szNick; - d->szLinkFilter = szSocketFilter; - console->context()->setAsynchronousConnectionData(d); - console->context()->connectToCurrentServer(); - } - } else { - // server is not empty. - KviAsynchronousConnectionData * d = new KviAsynchronousConnectionData(); - d->bUseSSL = (KVSCSC_pSwitches->find('s',"ssl") != 0); - d->szServer = szServer; - d->uPort = (kvi_u32_t)uPort; - d->szLinkFilter = szSocketFilter; - d->bPortIsOk = (uPort > 0); -#ifdef COMPILE_IPV6_SUPPORT - d->bUseIpV6 = (KVSCSC_pSwitches->find('i',"ipv6") != 0) || KviNetUtils::isValidStringIp_V6(szServer); -#else - d->bUseIpV6 = false; -#endif - d->szCommandToExecAfterConnect = szCmd; - d->szBindAddress = szBindAddress; - d->szPass = szPassword; - d->szNick = szNick; - console->context()->setAsynchronousConnectionData(d); - console->context()->beginAsynchronousConnect(0); - } - - return true; - }; - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: service - @type: - command - @title: - service - @syntax: - service <nickname> <reserved> <distribution> <type> <reserved> [:]<info> - @short: - Registers a new service - @description: - Registers a new IRC service: this is for IRC operators only.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - WARNING: the <info> parameter may contain spaces: in that case you MUST add the leading ':' character.[br] - */ - // RFC2921 wrapper - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: setmenu - @type: - command - @title: - setmenu - @syntax: - setmenu [-q] [-i=<index:integer>] <visible_text:string> [menu_name:string] - @short: - Adds a popup menu to the menu bar - @switches: - !sw: -q | --quiet - Run quietly: do not print any warnings - !sw: -i=<index:integer> | --index=<index:integer> - Place the popup menu on the left of the existing menubar item at the specified index - @description: - Adds an [b]existing[/b] popup menu to the current frame's menu bar.[br] - <visible_text> is used as menu identification and obviously as the visible - menu bar text for the new popup.[br] - If a popup menu with the same <visible_text> already exists in the current frame - it is removed first.[br] - <visible_text> can optionally contain the "&" character to identify - the popup menu accelerator.[br] - [menu_name] , if given , must be avalid name of a popup menu created earlier - with [cmd]defpopup[/cmd] (or the script center).[br] - If [menu_name] is not given , the popup menu identified by <visible_text> is removed.[br] - If the -i switch is used , <index> is a [b]zero based index[/b] of the default - menu-bar text item: the new popup menu will be placed on the left of that default item.[br] - If -q is used , this command prints no warnings (so you can safely use it to remove - popup menus without being sure that they actually are in there). - The warning itself serves to debugging purposes for the scripter.[br] - @seealso: - [cmd]defpopup[/cmd] - @examples: - setmenu -q -i=2 Test apopup - setmenu Test - setmenu ThisDoesNotExist - setmenu -q ThisDoesNotExist - */ - - KVSCSC(setmenu) - { - QString szVisibleText,szPopupName; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("visible_text",KVS_PT_NONEMPTYSTRING,0,szVisibleText) - KVSCSC_PARAMETER("popup_name",KVS_PT_STRING,KVS_PF_OPTIONAL,szPopupName) - KVSCSC_PARAMETERS_END - - if(szPopupName.isEmpty()) - { - if(!(KVSCSC_pWindow->frame()->mainMenuBar()->removeMenu(szVisibleText))) - { - if(!KVSCSC_pSwitches->find('q',"quiet"))KVSCSC_pContext->warning(__tr2qs("No menu bar item with text '%Q'"),&szPopupName); - } - return true; - } - - KviKvsPopupMenu * p = KviKvsPopupManager::instance()->lookup(szPopupName); - int idx = -1; - if(KviKvsVariant * pIdx = KVSCSC_pSwitches->find('i',"index")) - { - kvs_int_t iIdx; - if(pIdx->asInteger(iIdx)) - idx = iIdx; - else { - if(!KVSCSC_pSwitches->find('q',"quiet")) - KVSCSC_pContext->warning(__tr2qs("Invalid index specified: ignored")); - } - } - KVSCSC_pWindow->frame()->mainMenuBar()->removeMenu(szVisibleText); - - idx = KVSCSC_pWindow->frame()->mainMenuBar()->getDefaultItemRealIndex(idx); - - if(p)KVSCSC_pWindow->frame()->mainMenuBar()->addMenu(szVisibleText,p,idx); - else { - if(!KVSCSC_pSwitches->find('q',"quiet"))KVSCSC_pContext->warning(__tr2qs("The popup '%Q' is not defined"),&szPopupName); - } - - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: setreturn - @type: - command - @title: - setreturn - @syntax: - setreturn <string> - @short: - Sets the return value of the current command sequence - @description: - Sets the return value of the current command sequence to <string>. - You can call this command multiple times in a command sequence - (so in fact use it as a write-only variable). - @examples: - @seealso: - [cmd]return[/cmd] - */ - - KVSCSC(setreturn) - { - if(KVSCSC_pParams->count() == 0) - { - KVSCSC_pContext->returnValue()->setNothing(); - return false; - } - if(KVSCSC_pParams->count() == 1) - { - KVSCSC_pContext->returnValue()->copyFrom(*(KVSCSC_pParams->first())); - return false; - } - - QString all; - KVSCSC_pParams->allAsString(all); - KVSCSC_pContext->returnValue()->setString(all); - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: sockets - @type: - command - @title: - sockets - @syntax: - sockets [[remote server] server mask] - @short: - Requests the sockets info from a server - @description: - Requests the sockets information from the specified server or the current server if no [remote server] is specified.[br] - The reply can be filtered by <server mask>.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RFC2821 wrapper - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: squery - @type: - command - @title: - squery - @syntax: - squery <target> :<text> - @short: - Sends a message to a service - @description: - Sends a message to a service in a form similar to [cmd]privmsg[/cmd].[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RFC2821 wrapper - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: squit - @type: - command - @title: - squit - @syntax: - squit <server> [:]<comment> - @short: - Disconnects a server socket (ircops only) - @description: - Disconnects a server socket: this is for IRC operators only.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - WARNING: the <comment> parameter may contain spaces: in that case you MUST add the leading ':' character - before.[br] - */ - // RFC2821 wrapper - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: srand - @type: - command - @title: - srand - @syntax: - srand <seed:integer> - @short: - Initializes the random number generator - @description: - Initializes the random number generator "seeding" it with - <seed> which must be an integer. If no <seed> is passed it defaults to 1. - Sequences of random numbers can be repeated by using the - same <seed> value. - @examples: - */ - - KVSCSC(srand) - { - kvs_int_t iSeed; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("seed",KVS_PT_INT,KVS_PF_OPTIONAL,iSeed) - KVSCSC_PARAMETERS_END - if(KVSCSC_pParams->count() < 1)iSeed = 1; - ::srand(iSeed); - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: stats - @type: - command - @title: - stats - @syntax: - stats [query [target server]] - @short: - Requests the stats info from a server - @description: - Requests the stats information from the specified server or the current server if no [target server] is specified.[br] - The query parameter is usually a letter indicating the type of the query requested: some query letters - are defined by [doc]rfc2812[/doc] and some others are server implementation dependant.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RFC2821 wrapper - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: time - @type: - command - @title: - time - @syntax: - time [target server] - @short: - Requests the current local time info from a server - @description: - Requests time information from the specified server or the current server if no [target server] is specified.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RFC2821 wrapper - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: topic - @type: - command - @title: - topic - @syntax: - topic [<channel:string> [topic text:string]] - @short: - Changes topic for the specified channel - @description: - Changes the topic for the specified <channel> to <topic text>. - If no topic is specified, the current channel topic will be returned.[br] - This command is "server based"; you will see its results only - after the server acknowledges it.[br] - This command is [doc:connection_dependant_commands]connection dependant[/doc]. - @examples: - [example] - topic #kvirc KVIrc 3.4.0 has been released! - [/example] - */ - - KVSCSC(topic) - { - QString szChannel; - QString szTopic; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("channel",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szChannel) - KVSCSC_PARAMETER("topic",KVS_PT_STRING,KVS_PF_OPTIONAL | KVS_PF_APPENDREMAINING,szTopic) - KVSCSC_PARAMETERS_END - - KVSCSC_REQUIRE_CONNECTION - - if(szChannel.isEmpty()) - { - if(KVSCSC_pWindow->type() == KVI_WINDOW_TYPE_CHANNEL) - szChannel = KVSCSC_pWindow->target(); - else { - KVSCSC_pContext->error(__tr2qs("No target channel specified and the current window is not a channel")); - return false; - } - } - - KviQCString szC = KVSCSC_pConnection->encodeText(szChannel); - KviQCString szT = KVSCSC_pConnection->encodeText(szTopic); - if(szTopic.isEmpty()) - { - if(!KVSCSC_pConnection->sendFmtData("TOPIC %s",szC.data())) - return KVSCSC_pContext->warningNoIrcConnection(); - } else { - if(!KVSCSC_pConnection->sendFmtData("TOPIC %s :%s",szC.data(),szT.data())) - return KVSCSC_pContext->warningNoIrcConnection(); - } - - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: trace - @type: - command - @title: - trace - @syntax: - trace <target> - @short: - Requests trace information about a specified machine in the network - @description: - Requests trace information about a specified machine in the network.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RFC2821 wrapper - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: trload - @type: - command - @title: - trload - @syntax: - trload [-v] <catalogue:string> [<catalogue_dir:string>] - @switches: - !sw: -v | --verbose - Warn if a catalogue for the current language cannot be found - @short: - Loads a translation catalogue - @description: - Loads the specified translation <catalogue> in the current user language.[br] - The translation catalogues are *.mo files compiled with the standard - msgfmt program from the gettext package.[br] - The syntax of the catalogue names is:[br] - [b]<catalogue_dir>/<catalogue>_<language>.mo[/b][br] - KVIrc looks for the catalogues in <catalogue_dir> (if specified) - and in the locale subdirectory of the global and local KVIrc directories.[br] - <language> is choose automatically by KVIrc depending on the user's locale.[br] - Catalogues MUST be in UTF8 encoding.[br] - After a translation catalogue has been loaded you can - access its strings by the means of [fnc]$tr[/fnc].[br] - This function doesn't print any warning unless -v is specified.[br] - Please note that KVIrc attempts to load the <catalogue> automatically - when $tr() is used but it looks only in [fnc]$file.localdir[/fnc]/locale/ - and in [fnc]$file.globaldir[/fnc]/locale/. This command is then useful - to load catalogues that reside in different directories.[br] - [b]NOTE[/b][br] - This feature is currently work in progress: the scripting engine - is not yet fully unicode and thus some more exotic translations may still suffer... - @seealso: - [fnc]$tr[/fnc], [cmd]trunload[/cmd] - */ - - KVSCSC(trload) - { - QString szCatalogue,szDir; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("catalogue",KVS_PT_NONEMPTYSTRING,0,szCatalogue) - KVSCSC_PARAMETER("catalogueDir",KVS_PT_STRING,KVS_PF_OPTIONAL,szDir) - KVSCSC_PARAMETERS_END - - if(!szDir.isEmpty()) - { - if(KviLocale::loadCatalogue(szCatalogue,szDir)) - return true; - } - - g_pApp->getLocalKvircDirectory(szDir,KviApp::Locale); - - if(KviLocale::loadCatalogue(szCatalogue,szDir)) - return true; - - g_pApp->getGlobalKvircDirectory(szDir,KviApp::Locale); - - if(KviLocale::loadCatalogue(szCatalogue,szDir)) - return true; - - if(KVSCSC_pSwitches->find('v',"verbose")) - KVSCSC_pContext->warning(__tr2qs("No catalogue %Q for the current language found"),&szCatalogue); - - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: trunload - @type: - command - @title: - trunload - @syntax: - trunload [-v] <catalogue:string> - @switches: - !sw: -v | --verbose - Warn if the specified catalogue wasn't loaded at all - @short: - Unloads a translation catalogue - @description: - Unloads a specified translation catalogue.[br] - When you no longer need the translation strings contained in the - catalogue just unload it to free memory.[br] - This command prints no warnings unload -v is used.[br] - @seealso: - [fnc]$tr[/fnc], [cmd]trload[/cmd] - */ - - KVSCSC(trunload) - { - QString szCatalogue; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("catalogue",KVS_PT_NONEMPTYSTRING,0,szCatalogue) - KVSCSC_PARAMETERS_END - - if(!KviLocale::unloadCatalogue(szCatalogue)) - { - if(KVSCSC_pSwitches->find('v',"verbose")) - KVSCSC_pContext->warning(__tr2qs("The catalogue %Q was not loaded"),&szCatalogue); - } - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: unban - @type: - command - @title: - unban - @syntax: - unban <mask_list> - @short: - Unsets ban masks for the channel - @description: - Removes the ban masks specified in the <mask_list>, - which is a comma separated list of nicknames. - This command works only if executed in a channel window. - The command is translated to a set of MODE messages containing - a variable number of -b flags. - This command is [doc:connection_dependant_commands]connection dependant[/doc]. - @examples: - [example] - # Unban people on the current channel (say #kvirc) - unban Maxim,Gizmo!*@*,*!root@* - # Do the same but from another window belongin to this IRC context - unban -r=[fnc]$channel[/fnc](#kvirc) Maxim,Gizmo!*@*,*!root@* - # Do the same from any window - unban -r=[fnc]$channel[/fnc](#kvirc,[fnc]$context[/fnc](irc.myirc.net,Pragma)) Maxim,Gizmo!*@*,*!root*@* - [/example] - @seealso: - [cmd]op[/cmd], - [cmd]deop[/cmd], - [cmd]voice[/cmd], - [cmd]devoice[/cmd], - [cmd]ban[/cmd] - */ - - KVSCSC(unban) - { - return multipleModeCommand(__pContext,__pParams,__pSwitches,'-','b'); - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: version - @type: - command - @title: - version - @syntax: - version [target server] - @short: - Requests the version of a server - @description: - Requests the version information from the specified server or the current server if no [target server] is specified.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RFC2821 wrapper - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: voice - @type: - command - @title: - voice - @syntax: - voice <nickname_list> - @short: - Sets voice flag for the specified users - @description: - Sets the voice flag for the users specified in <nickname_list>, - which is a comma separated list of nicknames. - This command works only if executed in a channel window. - The command is translated to a set of MODE messages containing - a variable number of +v flags. - This command is [doc:connection_dependant_commands]connection dependant[/doc]. - @examples: - [example] - voice Pragma,Crocodile - [/example] - @seealso: - [cmd]op[/cmd], [cmd]deop[/cmd], [cmd]devoice[/cmd] - */ - - KVSCSC(voice) - { - return multipleModeCommand(__pContext,__pParams,__pSwitches,'+','v'); - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: warning - @type: - command - @title: - warning - @syntax: - warning <message:text> - @short: - Prints a warning message - @description: - Prints a warning message with the appropriate color and message type. - It doesn't alter the execution of the current script. - @seealso: - [cmd]error[/cmd] - */ - - KVSCSC(warning) - { - QString szAll; - KVSCSC_pParams->allAsString(szAll); - KVSCSC_pContext->warning("%Q",&szAll); - - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: who - @type: - command - @title: - who - @syntax: - who {[mask] | [channel]} - @short: - Requests WHO information - @description: - Requests WHO information about the specified user or channel.[br] - This command is a [doc:rfc2821wrappers]RFC2821 command wrapper[/doc]; see that document for more information.[br] - */ - // RFC2821 wrapper - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: whois - @type: - command - @title: - whois - @syntax: - whois [server] <nickname> - @short: - Requests user information - @description: - Requests information about an irc user specified by <nickname>.[br] - If [server] is specified, the request is directed to that one. [server] - may be a nickname so that the request is redirected to the server that - the user with that nickname is connected to.[br] - An useful trick is to use the following syntax:[br] - whois <nickname> <nickname>[br] - This will requests information about the user <nickname> to the server that he is currently - connected to; returning the idle time among the other common information.[br] - This command is [doc:connection_dependant_commands]connection dependant[/doc]. - @examples: - [example] - [comment]# Query info about Pragma[/comment] - whois Pragma - [comment]# Get the Pragma idle time[/comment] - whois Pragma Pragma - [/example] - @seealso: - [cmd]whowas[/cmd] - */ - - KVSCSC(whois) - { - QString szNick; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("nickname",KVS_PT_NONEMPTYSTRING,KVS_PF_APPENDREMAINING,szNick) - KVSCSC_PARAMETERS_END - - KviQCString szData = KVSCSC_pContext->window()->encodeText(szNick); - - if(!KVSCSC_pContext->connection())return KVSCSC_pContext->warningNoIrcConnection(); - if(!KVSCSC_pContext->connection()->sendFmtData("WHOIS %s",szData.data()))return KVSCSC_pContext->warningNoIrcConnection(); - - return true; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /* - @doc: whowas - @type: - command - @title: - whowas - @syntax: - whowas <nickname> - @short: - Requests user information - @description: - Requests information about an irc user specified by <nickname>.[br] - Whowas requests "history" records. See [doc:rfc2812]RFC2812[/doc] for more info.[br] - This command is [doc:connection_dependant_commands]connection dependant[/doc]. - @examples: - [example] - [comment]# Query past info about Pragma[/comment] - whowas Pragma - [/example] - @seealso: - [cmd]whois[/cmd] - */ - - KVSCSC(whowas) - { - QString szNick; - KVSCSC_PARAMETERS_BEGIN - KVSCSC_PARAMETER("nickname",KVS_PT_NONEMPTYSTRING,KVS_PF_APPENDREMAINING,szNick) - KVSCSC_PARAMETERS_END - - KviQCString szData = KVSCSC_pContext->window()->encodeText(szNick); - - if(!KVSCSC_pContext->connection())return KVSCSC_pContext->warningNoIrcConnection(); - if(!KVSCSC_pContext->connection()->sendFmtData("WHOWAS %s",szData.data()))return KVSCSC_pContext->warningNoIrcConnection(); - - return true; - } - -}; diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_dnsmanager.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_dnsmanager.cpp deleted file mode 100644 index bfca60eb05..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_dnsmanager.cpp +++ /dev/null @@ -1,180 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_dnsmanager.cpp -// Created on Wed 04 Aug 2004 04:38:31 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_dnsmanager.h" -#include "kvi_dns.h" -#include "kvi_app.h" -#include "kvi_window.h" -#include "kvi_out.h" -#include "kvi_iconmanager.h" -#include "kvi_kvs_script.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_string.h" -#include "kvi_locale.h" -#include "kvi_error.h" - -KviKvsDnsManager * KviKvsDnsManager::m_pInstance = 0; - - -KviKvsDnsObject::KviKvsDnsObject(KviDns * pDns,KviWindow * pWnd,const QString &szQuery,bool bRebindOnWindowClose,KviKvsScript * pCallback,KviKvsVariantList * pParameterList) -{ - m_pDns = pDns; - m_pWindow = pWnd; - m_szQuery = szQuery; - m_pCallback = pCallback; - m_pParameterList = pParameterList; - m_bRebindOnWindowClose = bRebindOnWindowClose; -} - -KviKvsDnsObject::~KviKvsDnsObject() -{ - QObject::disconnect(m_pDns,0,0,0); - if(m_pDns->isRunning()) - { - g_pApp->collectGarbage(m_pDns); - } else { - delete m_pDns; - } - if(m_pCallback)delete m_pCallback; - if(m_pParameterList)delete m_pParameterList; -} - - -KviKvsDnsManager::KviKvsDnsManager() -: QObject() -{ - m_pDnsObjects = 0; -} - -KviKvsDnsManager::~KviKvsDnsManager() -{ - if(m_pDnsObjects)delete m_pDnsObjects; -} - -void KviKvsDnsManager::init() -{ - if(KviKvsDnsManager::m_pInstance) - { - debug("Trying to double init() the dns manager!"); - return; - } - KviKvsDnsManager::m_pInstance = new KviKvsDnsManager(); -} - -void KviKvsDnsManager::done() -{ - if(!KviKvsDnsManager::m_pInstance) - { - debug("Trying to call done() on a non existing dns manager!"); - return; - } - delete KviKvsDnsManager::m_pInstance; - KviKvsDnsManager::m_pInstance = 0; -} - -void KviKvsDnsManager::addDns(KviKvsDnsObject * pObject) -{ - if(!m_pDnsObjects) - { - m_pDnsObjects = new KviPointerHashTable<void *,KviKvsDnsObject>; - m_pDnsObjects->setAutoDelete(true); - } - m_pDnsObjects->replace(pObject->dns(),pObject); - connect(pObject->dns(),SIGNAL(lookupDone(KviDns *)),this,SLOT(dnsLookupTerminated(KviDns *))); -} - -void KviKvsDnsManager::dnsLookupTerminated(KviDns * pDns) -{ - KviKvsDnsObject * o = m_pDnsObjects->find(pDns); - if(!o) - { - debug("KviKvsDnsManager::dnsLookupTerminated(): can't find the KviKvsDnsObject structure"); - return; - } - - if(!g_pApp->windowExists(o->window())) - { - if(o->rebindOnWindowClose()) - { - o->setWindow(g_pActiveWindow); - } else { - // just kill it - m_pDnsObjects->remove(pDns); - return; - } - } - - if(o->callback()) - { - KviKvsScript copy(*(o->callback())); - if(!o->parameterList()) - o->setParameterList(new KviKvsVariantList()); - - if(o->dns()->state() == KviDns::Failure) - { - // $4... is the magic data - o->parameterList()->prepend(new KviKvsVariant()); // $3 - o->parameterList()->prepend(new KviKvsVariant(KviError::getDescription(o->dns()->error()))); // $2 - o->parameterList()->prepend(new KviKvsVariant((kvs_int_t)0)); // $1 - } else { - QString * fh = o->dns()->hostnameList()->first(); - QString * fi = o->dns()->ipAddressList()->first(); - - // $4... is the magic data - o->parameterList()->prepend(new KviKvsVariant(fh ? *fh : QString("?.?"))); // $3 - o->parameterList()->prepend(new KviKvsVariant(fi ? *fi : QString("?.?.?.?"))); // $2 - o->parameterList()->prepend(new KviKvsVariant((kvs_int_t)1)); // $1 - } - o->parameterList()->prepend(new KviKvsVariant(o->query())); // $0 - - copy.run(o->window(),o->parameterList(),0,KviKvsScript::PreserveParams); - - } else { - QString szQuery = o->dns()->query(); - o->window()->output(KVI_OUT_HOSTLOOKUP,__tr2qs("DNS Lookup result for query \"%Q\""),&szQuery); - - if(o->dns()->state() == KviDns::Failure) - { - QString szErr = KviError::getDescription(o->dns()->error()); - o->window()->output(KVI_OUT_HOSTLOOKUP,__tr2qs("Error: %Q"),&szErr); - } else { - int idx = 1; - for(QString * h = o->dns()->hostnameList()->first();h;h = o->dns()->hostnameList()->next()) - { - o->window()->output(KVI_OUT_HOSTLOOKUP,__tr2qs("Hostname %d: %Q"),idx,h); - idx++; - } - idx = 1; - for(QString * a = o->dns()->ipAddressList()->first();a;a = o->dns()->ipAddressList()->next()) - { - o->window()->output(KVI_OUT_HOSTLOOKUP,__tr2qs("IP address %d: %Q"),idx,a); - idx++; - } - } - } - - m_pDnsObjects->remove(pDns); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_dnsmanager.h b/3.4.0/src/kvirc/kvs/kvi_kvs_dnsmanager.h deleted file mode 100644 index ae0cbc663f..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_dnsmanager.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef _KVI_KVS_DNSMANAGER_H_ -#define _KVI_KVS_DNSMANAGER_H_ -//============================================================================= -// -// File : kvi_kvs_dnsmanager.h -// Created on Wed 04 Aug 2004 04:38:31 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include <qobject.h> -#include "kvi_pointerhashtable.h" -#include <qstring.h> - -class KviDns; -class KviWindow; -class KviKvsScript; -class KviKvsVariantList; - -class KviKvsDnsObject -{ -public: - KviKvsDnsObject(KviDns * pDns, - KviWindow * pWnd, - const QString &szQuery, - bool bRebindOnWindowClose = true, - KviKvsScript * pCallback = 0, - KviKvsVariantList * pParameterList = 0); - ~KviKvsDnsObject(); -protected: - KviDns * m_pDns; - KviWindow * m_pWindow; - QString m_szQuery; - KviKvsScript * m_pCallback; // callback to be executed when the dns terminates - KviKvsVariantList * m_pParameterList; // parameter list (magic) - bool m_bRebindOnWindowClose; // should we trigger the callback even if m_pWindow no longer exists ? -public: - KviDns * dns(){ return m_pDns; }; - KviWindow * window(){ return m_pWindow; }; - KviKvsScript * callback(){ return m_pCallback; }; - KviKvsVariantList * parameterList(){ return m_pParameterList; }; - const QString & query(){ return m_szQuery; }; - bool rebindOnWindowClose(){ return m_bRebindOnWindowClose; }; - void setWindow(KviWindow * pWnd){ m_pWindow = pWnd; }; - void setParameterList(KviKvsVariantList * pList){ m_pParameterList = pList; }; -}; - -class KviKvsDnsManager : public QObject -{ - Q_OBJECT -public: - KviKvsDnsManager(); - ~KviKvsDnsManager(); -protected: - static KviKvsDnsManager * m_pInstance; - KviPointerHashTable<void *,KviKvsDnsObject> * m_pDnsObjects; -public: - static KviKvsDnsManager * instance(){ return m_pInstance; }; - static void init(); - static void done(); - - void addDns(KviKvsDnsObject * pObject); -protected slots: - void dnsLookupTerminated(KviDns * pDns); -private: - void abortAll(); -}; - -#endif //!_KVI_KVS_DNSMANAGER_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_event.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_event.cpp deleted file mode 100644 index d86f3e8852..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_event.cpp +++ /dev/null @@ -1,80 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_event.cpp -// Created on Mon 23 Feb 2004 03:00:02 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_event.h" - - -KviKvsEvent::~KviKvsEvent() -{ - clear(); -} - -void KviKvsEvent::clear() -{ - if(m_pHandlers)delete m_pHandlers; - m_pHandlers = 0; -} - -void KviKvsEvent::removeHandler(KviKvsEventHandler * h) -{ - m_pHandlers->removeRef(h); - if(m_pHandlers->isEmpty()) - { - delete m_pHandlers; - m_pHandlers = 0; - } -} - -void KviKvsEvent::addHandler(KviKvsEventHandler * h) -{ - if(!m_pHandlers) - { - m_pHandlers = new KviPointerList<KviKvsEventHandler>(); - m_pHandlers->setAutoDelete(true); - } - m_pHandlers->append(h); -} - -void KviKvsEvent::clearScriptHandlers() -{ - if(!m_pHandlers)return; - KviPointerList<KviKvsEventHandler> dl; - dl.setAutoDelete(false); - KviKvsEventHandler * e; - for(e = m_pHandlers->first();e;e = m_pHandlers->next()) - { - if(e->type() == KviKvsEventHandler::Script)dl.append(e); - } - for(e = dl.first();e;e = dl.next()) - { - m_pHandlers->removeRef(e); - } - if(m_pHandlers->isEmpty()) - { - delete m_pHandlers; - m_pHandlers = 0; - } -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_event.h b/3.4.0/src/kvirc/kvs/kvi_kvs_event.h deleted file mode 100644 index f88936b7b2..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_event.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef _KVI_KVS_EVENT_H_ -#define _KVI_KVS_EVENT_H_ -//============================================================================= -// -// File : kvi_kvs_event.h -// Created on Mon 23 Feb 2004 03:00:02 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_pointerlist.h" - -#include "kvi_kvs_eventhandler.h" - -class KVIRC_API KviKvsEvent -{ -protected: - QString m_szName; - QString m_szParameterDescription; - KviPointerList<KviKvsEventHandler> * m_pHandlers; -public: - // the event name and the parameter description are NOT translated - KviKvsEvent(const char * szEventName,const char * szParameterDescription) - : m_szName(szEventName), m_szParameterDescription(szParameterDescription), m_pHandlers(0) {}; - ~KviKvsEvent(); - void clear(); - void clearScriptHandlers(); - bool hasHandlers(){ return m_pHandlers != 0; }; - KviPointerList<KviKvsEventHandler> * handlers(){ return m_pHandlers; }; - void addHandler(KviKvsEventHandler * h); - void removeHandler(KviKvsEventHandler * h); - const QString & name(){ return m_szName; }; - const QString & parameterDescription(){ return m_szParameterDescription; }; -}; - -#endif //!_KVI_KVS_EVENT_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_eventhandler.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_eventhandler.cpp deleted file mode 100644 index 5bfe267122..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_eventhandler.cpp +++ /dev/null @@ -1,78 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_eventhandler.cpp -// Created on Mon 23 Feb 2004 03:04:58 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_eventhandler.h" - -KviKvsEventHandler::KviKvsEventHandler(Type t) -: KviHeapObject(), m_type(t) -{ -} - -KviKvsEventHandler::~KviKvsEventHandler() -{ -} - - - -KviKvsScriptEventHandler::KviKvsScriptEventHandler(const QString &szHandlerName,const QString &szContextName,const QString &szCode,bool bEnabled) -: KviKvsEventHandler(KviKvsEventHandler::Script), m_szName(szHandlerName), m_bEnabled(bEnabled) -{ - m_pScript = new KviKvsScript(szContextName,szCode); -} - -KviKvsScriptEventHandler::~KviKvsScriptEventHandler() -{ - delete m_pScript; -} - -KviKvsScriptEventHandler * KviKvsScriptEventHandler::createInstance(const QString &szHandlerName,const QString &szContextName,const QString &szCode,bool bEnabled) -{ - return new KviKvsScriptEventHandler(szHandlerName,szContextName,szCode,bEnabled); -} - - -KviKvsModuleEventHandler::KviKvsModuleEventHandler(KviKvsModuleInterface * m,KviKvsModuleEventHandlerRoutine proc) -: KviKvsEventHandler(KviKvsEventHandler::Module), m_pModule(m) -{ - m_pProc = new KviKvsModuleEventHandlerRoutine(proc); -} - -KviKvsModuleEventHandler::~KviKvsModuleEventHandler() -{ - delete m_pProc; -} - - -/* -KviKvsOldModuleEventHandler::KviKvsOldModuleEventHandler(KviModuleEventParseProc p,KviModule * m) -: KviKvsEventHandler(KviKvsEventHandler::OldModule), m_pModule(m), m_proc(p) -{ -} - -KviKvsOldModuleEventHandler::~KviKvsOldModuleEventHandler() -{ -} -*/ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_eventhandler.h b/3.4.0/src/kvirc/kvs/kvi_kvs_eventhandler.h deleted file mode 100644 index 38b3fda3e4..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_eventhandler.h +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef _KVI_KVS_EVENTHANDLER_H_ -#define _KVI_KVS_EVENTHANDLER_H_ -//============================================================================= -// -// File : kvi_kvs_eventhandler.h -// Created on Mon 23 Feb 2004 03:04:58 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_script.h" -#include "kvi_qstring.h" -#include "kvi_kvs_moduleinterface.h" -#include "kvi_heapobject.h" - -class KVIRC_API KviKvsEventHandler : public KviHeapObject -{ -public: - enum Type { Script , Module }; -protected: - Type m_type; -public: - KviKvsEventHandler(Type t); - virtual ~KviKvsEventHandler(); -public: - Type type(){ return m_type; }; -}; - - -class KVIRC_API KviKvsScriptEventHandler : public KviKvsEventHandler -{ -public: - // the event handler becomes the owned of pszCode! - KviKvsScriptEventHandler(const QString &szHandlerName,const QString &szContextName,const QString &szCode,bool bEnabled = true); - virtual ~KviKvsScriptEventHandler(); -protected: - QString m_szName; - KviKvsScript * m_pScript; - bool m_bEnabled; -public: - KviKvsScript * script(){ return m_pScript; }; - const QString & name(){ return m_szName; }; - const QString & code(){ return m_pScript->code(); }; - - bool isEnabled(){ return m_bEnabled; }; - void setEnabled(bool bEnabled){ m_bEnabled = bEnabled; }; - - // Static allocator function. - // This MUST be used by the modules to allocate event structures - // instead of the new operator. - // See kvi_heapobject.cpp for an explaination. - static KviKvsScriptEventHandler * createInstance(const QString &szHandlerName,const QString &szContextName,const QString &szCode,bool bEnabled = true); -}; - - -class KVIRC_API KviKvsModuleEventHandler : public KviKvsEventHandler -{ -protected: - KviKvsModuleInterface * m_pModule; - KviKvsModuleEventHandlerRoutine * m_pProc; -public: - KviKvsModuleEventHandler(KviKvsModuleInterface * m,KviKvsModuleEventHandlerRoutine proc); - virtual ~KviKvsModuleEventHandler(); -public: - KviKvsModuleInterface * moduleInterface(){ return m_pModule; }; - KviKvsModuleEventHandlerRoutine * handlerRoutine(){ return m_pProc; }; -}; - - -/* -#include "kvi_module.h" - -class KVIRC_API KviKvsOldModuleEventHandler : public KviKvsEventHandler -{ -protected: - KviModule * m_pModule; - KviModuleEventParseProc m_proc; -public: - KviKvsOldModuleEventHandler(KviModuleEventParseProc p,KviModule * m); - virtual ~KviKvsOldModuleEventHandler(); -public: - KviModule * module(){ return m_pModule; }; - void setModule(KviModule * m){ m_pModule = m; }; - KviModuleEventParseProc proc(){ return m_proc; }; - void setProc(KviModuleEventParseProc p){ m_proc = p; }; -}; - -*/ -#endif //!_KVI_KVS_EVENTHANDLER_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_eventmanager.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_eventmanager.cpp deleted file mode 100644 index b4f9ee70cd..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_eventmanager.cpp +++ /dev/null @@ -1,678 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_eventmanager.cpp -// Created on Thu Aug 17 2000 13:59:12 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2000-2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_eventmanager.h" -#include "kvi_config.h" -#include "kvi_kvs_script.h" -#include "kvi_kvs_variant.h" -#include "kvi_options.h" -#include "kvi_locale.h" -#include "kvi_out.h" -#include "kvi_module.h" -#include "kvi_window.h" -#include "kvi_kvs_variantlist.h" - -/* - @doc: events - @type: - language - @keyterms: - events,event handlers,event - @title: - Events - @short: - Events: user reactions - @body: - KVIrc triggers an event when a particular situation occurs (hehe :D).[br] - You can define a set of event handlers for each event type.[br] - An event handler is a snippet of user-defined code that gets executed when the event is triggered.[br] - Event handlers can be created or destroyed by using the scriptcenter (graphic interface) - or even from the commandline (or script) by using the [cmd]event[/cmd] command.[br] - For example, the [event:onirc]OnIRC[/event] is triggered when the login operations have - been terminated and you can consider yourself "completely" on IRC. For example , you might - want to "auto-join" some channels. Nothing easier! The following snippet of code - adds a handler to the OnIRC event that joins three channels:[br] - [example] - [cmd]event[/cmd](OnIRC,autojoin) - { - [cmd]echo[/cmd] Auto-joining my preferred channels... - [cmd]join[/cmd] #kvirc,#siena,#linux - } - [/example] - Now try to connect to a server and you'll see that it joins automatically the three channels!.[br] - You might also want to do some other actions just after the connection has been established, - for example you might want to look immediately for a friend of yours by issuing a [cmd]whois[/cmd] - to the server (well.. you could use the notify list for that, but well, this is an example).[br] - You can add the [cmd]whois[/cmd] request to the handler above or just create a new one:[br] - [example] - [cmd]event[/cmd](OnIRC,lookforfred) - { - [cmd]echo[/cmd] Looking for fred... - [cmd]whois[/cmd] fred - } - [/example] - (An even nicer idea would be to use the [cmd]awhois[/cmd] command...but that's left to the reader as exercise.[br] - To remove an event handler you still use the [cmd]event[/cmd] command , but with an empty code block:[br] - [example] - [cmd]event[/cmd](OnIRC,lookforfred){}[br] - [/example] - [br] - Certain events will pass you some data in the positional parameters.[br] - For example, when you are being banned from a channel, KVIrc triggers the [event:onmeban]OnMeBan[/event] - event: you might be interested in WHO has banned you. KVIrc will pass the "ban source" informations - in the positional parameters $0,$1 and $2.[br] - (Please note that the parameters started from $1 in KVIrc versions older than 3.0.0!).[br] - You may take a look at the list of available [doc:event_index_all]events[/doc].[br] -*/ - - -KviKvsEventManager * KviKvsEventManager::m_pInstance = 0; - -KviKvsEventManager::KviKvsEventManager() -{ - m_pInstance = this; - for(int i=0;i<KVI_KVS_NUM_RAW_EVENTS;i++) - m_rawEventTable[i] = 0; -} - -KviKvsEventManager::~KviKvsEventManager() -{ - clear(); -} - -void KviKvsEventManager::init() -{ - if(KviKvsEventManager::instance()) - { - debug("WARNING: Trying to create KviKvsEventManager twice!"); - return; - } - (void) new KviKvsEventManager(); -} - -void KviKvsEventManager::done() -{ - if(!KviKvsEventManager::instance()) - { - debug("WARNING: Trying to destroy the KviKvsEventManager twice!"); - return; - } - delete KviKvsEventManager::instance(); -} - -unsigned int KviKvsEventManager::findAppEventIndexByName(const QString &szName) -{ - for(unsigned int u = 0;u < KVI_KVS_NUM_APP_EVENTS;u++) - { - if(KviQString::equalCI(szName,m_appEventTable[u].name()))return u; - //Backwards compatibility >_< - if((u == 4) && KviQString::equalCI(szName,"OnIrcConnectionEstabilished")) - return u; - } - return KVI_KVS_NUM_APP_EVENTS; // <-- invalid event number -} - -KviKvsEvent * KviKvsEventManager::findAppEventByName(const QString &szName) -{ - for(unsigned int u = 0;u < KVI_KVS_NUM_APP_EVENTS;u++) - { - if(KviQString::equalCI(szName,m_appEventTable[u].name()))return &(m_appEventTable[u]); - //Backwards compatibility >_< - if((u == 4) && KviQString::equalCI(szName,"OnIrcConnectionEstabilished")) - return &(m_appEventTable[u]); - } - return 0; -} - -bool KviKvsEventManager::addAppHandler(unsigned int uEvIdx,KviKvsEventHandler * h) -{ - if(uEvIdx >= KVI_KVS_NUM_APP_EVENTS)return false; - m_appEventTable[uEvIdx].addHandler(h); - return true; -} - -bool KviKvsEventManager::addRawHandler(unsigned int uRawIdx,KviKvsEventHandler * h) -{ - if(uRawIdx >= KVI_KVS_NUM_RAW_EVENTS)return false; - if(!m_rawEventTable[uRawIdx]) - { - m_rawEventTable[uRawIdx] = new KviPointerList<KviKvsEventHandler>(); - m_rawEventTable[uRawIdx]->setAutoDelete(true); - } - m_rawEventTable[uRawIdx]->append(h); - return true; -} - -bool KviKvsEventManager::removeScriptAppHandler(unsigned int uEvIdx,const QString &szName) -{ - if(uEvIdx >= KVI_KVS_NUM_APP_EVENTS)return false; - KviKvsEventHandler * h; - if(!(m_appEventTable[uEvIdx].handlers()))return false; - for(h = m_appEventTable[uEvIdx].handlers()->first();h;h = m_appEventTable[uEvIdx].handlers()->next()) - { - if(h->type() == KviKvsEventHandler::Script) - { - if(KviQString::equalCI(((KviKvsScriptEventHandler *)h)->name(),szName)) - { - m_appEventTable[uEvIdx].removeHandler(h); - return true; - } - } - } - return false; -} - -KviKvsScriptEventHandler * KviKvsEventManager::findScriptRawHandler(unsigned int uEvIdx,const QString &szName) -{ - if(uEvIdx >= KVI_KVS_NUM_RAW_EVENTS)return 0; - if(!m_rawEventTable[uEvIdx])return 0; - KviKvsEventHandler * h; - for(h = m_rawEventTable[uEvIdx]->first();h;h = m_rawEventTable[uEvIdx]->next()) - { - if(h->type() == KviKvsEventHandler::Script) - { - if(KviQString::equalCI(((KviKvsScriptEventHandler *)h)->name(),szName)) - { - return (KviKvsScriptEventHandler *)h; - } - } - } - return 0; -} - -KviKvsScriptEventHandler * KviKvsEventManager::findScriptAppHandler(unsigned int uEvIdx,const QString &szName) -{ - if(uEvIdx >= KVI_KVS_NUM_APP_EVENTS)return 0; - KviKvsEventHandler * h; - if(!(m_appEventTable[uEvIdx].handlers()))return 0; - for(h = m_appEventTable[uEvIdx].handlers()->first();h;h = m_appEventTable[uEvIdx].handlers()->next()) - { - if(h->type() == KviKvsEventHandler::Script) - { - if(KviQString::equalCI(((KviKvsScriptEventHandler *)h)->name(),szName)) - { - return (KviKvsScriptEventHandler *)h; - } - } - } - return 0; -} - -bool KviKvsEventManager::enableScriptAppHandler(unsigned int uEvIdx,const QString &szName,bool bEnable) -{ - KviKvsScriptEventHandler * h = findScriptAppHandler(uEvIdx,szName); - if(!h)return false; - h->setEnabled(bEnable); - return true; -} - - -bool KviKvsEventManager::removeModuleAppHandler(unsigned int uEvIdx,KviKvsModuleInterface *i) -{ - if(uEvIdx >= KVI_KVS_NUM_APP_EVENTS)return false; - KviKvsEventHandler * h; - if(!(m_appEventTable[uEvIdx].handlers()))return false; - for(h = m_appEventTable[uEvIdx].handlers()->first();h;h = m_appEventTable[uEvIdx].handlers()->next()) - { - if(h->type() == KviKvsEventHandler::Module) - { - if(((KviKvsModuleEventHandler *)h)->moduleInterface() == i) - { - m_appEventTable[uEvIdx].removeHandler(h); - return true; - } - } - // COMPAT - /* - } else if(h->type() == KviKvsEventHandler::OldModule) - { - if(((KviKvsOldModuleEventHandler *)h)->module() == i) - { - m_appEventTable[uEvIdx].removeHandler(h); - return true; - } - } - */ - // END COMPAT - } - return false; -} - -void KviKvsEventManager::removeAllModuleAppHandlers(KviKvsModuleInterface *pIface) -{ - KviKvsEventHandler * h; - for(unsigned int i =0;i< KVI_KVS_NUM_APP_EVENTS;i++) - { - if(!m_appEventTable[i].handlers())continue; - - KviPointerList<KviKvsEventHandler> l; - l.setAutoDelete(false); - for(h = m_appEventTable[i].handlers()->first();h;h = m_appEventTable[i].handlers()->next()) - { - if(h->type() == KviKvsEventHandler::Module) - { - if(((KviKvsModuleEventHandler *)h)->moduleInterface() == pIface) - { - l.append(h); - } - } - // COMPAT - /* - } else if(h->type() == KviKvsEventHandler::OldModule) - { - if(((KviKvsOldModuleEventHandler *)h)->module() == pIface) - { - l.append(h); - } - } - */ - // END COMPAT - - } - for(h = l.first();h;h = l.next())m_appEventTable[i].removeHandler(h); - } -} - -void KviKvsEventManager::removeAllModuleRawHandlers(KviKvsModuleInterface *pIface) -{ - KviKvsEventHandler * h; - for(unsigned int i =0;i< KVI_KVS_NUM_RAW_EVENTS;i++) - { - if(!m_rawEventTable[i])continue; - - KviPointerList<KviKvsEventHandler> l; - l.setAutoDelete(false); - for(h = m_rawEventTable[i]->first();h;h = m_rawEventTable[i]->next()) - { - if(h->type() == KviKvsEventHandler::Module) - { - if(((KviKvsModuleEventHandler *)h)->moduleInterface() == pIface) - { - l.append(h); - } - } - // COMPAT - /* - } else if(h->type() == KviKvsEventHandler::OldModule) - { - if(((KviKvsOldModuleEventHandler *)h)->module() == pIface) - { - l.append(h); - } - } - */ - // END COMPAT - - } - for(h = l.first();h;h = l.next())m_rawEventTable[i]->removeRef(h); - if(m_rawEventTable[i]->isEmpty()) - { - delete m_rawEventTable[i]; - m_rawEventTable[i] = 0; - } - } -} - -bool KviKvsEventManager::removeScriptRawHandler(unsigned int uEvIdx,const QString &szName) -{ - if(uEvIdx >= KVI_KVS_NUM_RAW_EVENTS)return false; - if(!m_rawEventTable[uEvIdx])return false; - KviKvsEventHandler * h; - for(h = m_rawEventTable[uEvIdx]->first();h;h = m_rawEventTable[uEvIdx]->next()) - { - if(h->type() == KviKvsEventHandler::Script) - { - if(KviQString::equalCI(((KviKvsScriptEventHandler *)h)->name(),szName)) - { - m_rawEventTable[uEvIdx]->removeRef(h); - if(m_rawEventTable[uEvIdx]->isEmpty()) - { - delete m_rawEventTable[uEvIdx]; - m_rawEventTable[uEvIdx] = 0; - } - return true; - } - } - } - return false; -} - - -bool KviKvsEventManager::enableScriptRawHandler(unsigned int uEvIdx,const QString &szName,bool bEnable) -{ - KviKvsScriptEventHandler * h = findScriptRawHandler(uEvIdx,szName); - if(!h)return false; - h->setEnabled(bEnable); - return true; -} - - -bool KviKvsEventManager::removeModuleRawHandler(unsigned int uRawIdx,KviKvsModuleInterface *i) -{ - if(uRawIdx >= KVI_KVS_NUM_RAW_EVENTS)return false; - if(!m_rawEventTable[uRawIdx])return false; - KviKvsEventHandler * h; - for(h = m_rawEventTable[uRawIdx]->first();h;h = m_rawEventTable[uRawIdx]->next()) - { - if(h->type() == KviKvsEventHandler::Module) - { - if(((KviKvsModuleEventHandler *)h)->moduleInterface() == i) - { - m_rawEventTable[uRawIdx]->removeRef(h); - if(m_rawEventTable[uRawIdx]->isEmpty()) - { - delete m_rawEventTable[uRawIdx]; - m_rawEventTable[uRawIdx] = 0; - } - return true; - } - } - // COMPAT - /* - } else if(h->type() == KviKvsEventHandler::OldModule) - { - if(((KviKvsOldModuleEventHandler *)h)->module() == i) - { - m_rawEventTable[uRawIdx]->removeRef(h); - if(m_rawEventTable[uRawIdx]->isEmpty()) - { - delete m_rawEventTable[uRawIdx]; - m_rawEventTable[uRawIdx] = 0; - } - return true; - } - } - */ - // END COMPAT - - } - return false; -} - -void KviKvsEventManager::removeAllModuleHandlers(KviKvsModuleInterface * pIface) -{ - removeAllModuleAppHandlers(pIface); - removeAllModuleRawHandlers(pIface); -} - -void KviKvsEventManager::removeAllScriptAppHandlers() -{ - for(int i=0;i< KVI_KVS_NUM_APP_EVENTS;i++) - { - m_appEventTable[i].clearScriptHandlers(); - } -} - -void KviKvsEventManager::removeAllScriptRawHandlers() -{ - for(int i=0;i< KVI_KVS_NUM_RAW_EVENTS;i++) - { - if(m_rawEventTable[i]) - { - KviPointerList<KviKvsEventHandler> dl; - dl.setAutoDelete(false); - KviKvsEventHandler * e; - for(e = m_rawEventTable[i]->first();e;e = m_rawEventTable[i]->next()) - { - if(e->type() == KviKvsEventHandler::Script)dl.append(e); - } - - for(e = dl.first();e;e = dl.next()) - { - m_rawEventTable[i]->removeRef(e); - } - - if(m_rawEventTable[i]->isEmpty()) - { - delete m_rawEventTable[i]; - m_rawEventTable[i] = 0; - } - } - } -} - -void KviKvsEventManager::clearRawEvents() -{ - for(int i=0;i<KVI_KVS_NUM_RAW_EVENTS;i++) - { - if(m_rawEventTable[i])delete m_rawEventTable[i]; - m_rawEventTable[i] = 0; - } -} - -void KviKvsEventManager::clearAppEvents() -{ - for(int i=0;i<KVI_KVS_NUM_APP_EVENTS;i++) - { - m_appEventTable[i].clear(); - } -} - -void KviKvsEventManager::clear() -{ - clearRawEvents(); - clearAppEvents(); -} - -bool KviKvsEventManager::triggerHandlers(KviPointerList<KviKvsEventHandler> * pHandlers,KviWindow *pWnd,KviKvsVariantList *pParams) -{ - if(!pHandlers)return false; - - bool bGotHalt = false; - for(KviKvsEventHandler * h = pHandlers->first();h;h = pHandlers->next()) - { - switch(h->type()) - { - case KviKvsEventHandler::Script: - { - if(((KviKvsScriptEventHandler *)h)->isEnabled()) - { - KviKvsScript * s = ((KviKvsScriptEventHandler *)h)->script(); - KviKvsScript copy(*s); - KviKvsVariant retVal; - int iRet = copy.run(pWnd,pParams,&retVal,KviKvsScript::PreserveParams); - if(!iRet) - { - // error! disable the handler if it's broken - if(KVI_OPTION_BOOL(KviOption_boolDisableBrokenEventHandlers)) - { - ((KviKvsScriptEventHandler *)h)->setEnabled(false); - pWnd->output(KVI_OUT_PARSERERROR,__tr2qs("Event handler %Q is broken: disabling"),&(s->name())); - } - } - if(!bGotHalt)bGotHalt = (iRet & KviKvsScript::HaltEncountered); - } - } - break; - case KviKvsEventHandler::Module: - { - KviModule * m = (KviModule *)((KviKvsModuleEventHandler *)h)->moduleInterface(); - KviKvsModuleEventHandlerRoutine * proc = ((KviKvsModuleEventHandler *)h)->handlerRoutine(); - KviKvsVariant retVal; - KviKvsRunTimeContext ctx(0,pWnd,pParams,&retVal); - KviKvsModuleEventCall call(m,&ctx,pParams); - if(!(*proc)(&call))bGotHalt = true; - } - break; - } - } - return bGotHalt; -} - - -void KviKvsEventManager::loadRawEvents(const QString &szFileName) -{ - KviConfig cfg(szFileName,KviConfig::Read); - removeAllScriptRawHandlers(); - int i; - - for(i=0;i<KVI_KVS_NUM_RAW_EVENTS;i++) - { - QString tmp; - KviQString::sprintf(tmp,"RAW%d",i); - if(cfg.hasGroup(tmp)) - { - cfg.setGroup(tmp); - unsigned int nHandlers = cfg.readUIntEntry("NHandlers",0); - if(nHandlers) - { - m_rawEventTable[i] = new KviPointerList<KviKvsEventHandler>(); - m_rawEventTable[i]->setAutoDelete(true); - for(unsigned int index = 0;index < nHandlers;index++) - { - KviQString::sprintf(tmp,"Name%u",index); - QString szName = cfg.readQStringEntry(tmp,"unnamed"); - KviQString::sprintf(tmp,"Buffer%u",index); - QString szCode = cfg.readQStringEntry(tmp,""); - KviQString::sprintf(tmp,"RawEvent%u::%Q",index,&szName); - KviKvsScriptEventHandler * s = new KviKvsScriptEventHandler(szName,tmp,szCode); - KviQString::sprintf(tmp,"Enabled%u",index); - s->setEnabled(cfg.readBoolEntry(tmp,false)); - m_rawEventTable[i]->append(s); - } - } - } - } -} - -void KviKvsEventManager::saveRawEvents(const QString &szFileName) -{ - KviConfig cfg(szFileName,KviConfig::Write); - cfg.clear(); - int i; - - for(i=0;i<KVI_KVS_NUM_RAW_EVENTS;i++) - { - if(m_rawEventTable[i]) - { - QString tmp; - KviQString::sprintf(tmp,"RAW%d",i); - cfg.setGroup(tmp); - - int index = 0; - for(KviKvsEventHandler * s = m_rawEventTable[i]->first();s; s = m_rawEventTable[i]->next()) - { - if(s->type() == KviKvsEventHandler::Script) - { - KviQString::sprintf(tmp,"Name%d",index); - cfg.writeEntry(tmp,((KviKvsScriptEventHandler *)s)->name()); - KviQString::sprintf(tmp,"Buffer%d",index); - cfg.writeEntry(tmp,((KviKvsScriptEventHandler *)s)->code()); - KviQString::sprintf(tmp,"Enabled%d",index); - cfg.writeEntry(tmp,((KviKvsScriptEventHandler *)s)->isEnabled()); - index++; - } - } - cfg.writeEntry("NHandlers",index); - } - } - -} - -void KviKvsEventManager::loadAppEvents(const QString &szFileName) -{ - KviConfig cfg(szFileName,KviConfig::Read); - removeAllScriptAppHandlers(); - - int i; - for(i=0;i<KVI_KVS_NUM_APP_EVENTS;i++) - { - QString szEventName(m_appEventTable[i].name()); - // Backwards compatibility >_< - if((i == 4) && !cfg.hasGroup(szEventName)) - szEventName = "OnIrcConnectionEstabilished"; - if(cfg.hasGroup(szEventName)) - { - cfg.setGroup(szEventName); - unsigned int nHandlers = cfg.readUIntEntry("NHandlers",0); - if(nHandlers) - { - for(unsigned int index = 0;index < nHandlers;index++) - { - QString tmp; - KviQString::sprintf(tmp,"Name%u",index); - QString szName = cfg.readQStringEntry(tmp,"unnamed"); - KviQString::sprintf(tmp,"Buffer%u",index); - QString szCode = cfg.readQStringEntry(tmp,""); - KviQString::sprintf(tmp,"Enabled%u",index); - bool bEnabled = cfg.readBoolEntry(tmp,false); - QString szCntx; - KviQString::sprintf(szCntx,"%Q::%Q",&(m_appEventTable[i].name()),&szName); - KviKvsScriptEventHandler *s = new KviKvsScriptEventHandler(szName,szCntx,szCode,bEnabled); - m_appEventTable[i].addHandler(s); - } - } - } - } - -} - -void KviKvsEventManager::saveAppEvents(const QString &szFileName) -{ - KviConfig cfg(szFileName,KviConfig::Write); - cfg.clear(); - int i; - bool bCompat = FALSE; - - for(i=0;i<KVI_KVS_NUM_APP_EVENTS;i++) - { - if(m_appEventTable[i].hasHandlers()) - { - QString szEventName(m_appEventTable[i].name()); - // Backwards compatibility >_< - if((i == 4) && cfg.hasGroup(szEventName)) - { - szEventName = "OnIRCConnectionEstabilished"; - bCompat = TRUE; - } - cfg.setGroup(szEventName); - int index = 0; - for(KviKvsEventHandler* s = m_appEventTable[i].handlers()->first();s; s = m_appEventTable[i].handlers()->next()) - { - if(s->type() == KviKvsEventHandler::Script) - { - QString tmp; - KviQString::sprintf(tmp,"Name%d",index); - cfg.writeEntry(tmp,((KviKvsScriptEventHandler *)s)->name()); - KviQString::sprintf(tmp,"Buffer%d",index); - cfg.writeEntry(tmp,((KviKvsScriptEventHandler *)s)->code()); - KviQString::sprintf(tmp,"Enabled%d",index); - cfg.writeEntry(tmp,((KviKvsScriptEventHandler *)s)->isEnabled()); - index++; - } - } - cfg.writeEntry("NHandlers",index); - - // Backwards compatibility >_< - if((i == 4) && !bCompat) - i--; - } - } -} - - - - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_eventmanager.h b/3.4.0/src/kvirc/kvs/kvi_kvs_eventmanager.h deleted file mode 100644 index 14a78e0292..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_eventmanager.h +++ /dev/null @@ -1,120 +0,0 @@ -#ifndef _KVI_KVS_EVENTMANAGER_H_ -#define _KVI_KVS_EVENTMANAGER_H_ -//============================================================================= -// -// File : kvi_kvs_eventmanager.h -// Created on Thu Aug 17 2000 13:59:12 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2000-2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_kvs_event.h" -#include "kvi_pointerlist.h" -#include "kvi_kvs_eventtable.h" - -class KviWindow; -class KviKvsModuleInterface; -class KviKvsVariantList; - -#define KVI_KVS_NUM_RAW_EVENTS 1000 - -class KVIRC_API KviKvsEventManager -{ - friend class KviModule; // compatibility only! -protected: // it only can be created and destroyed by KviKvsAliasManager::init()/done() - KviKvsEventManager(); - ~KviKvsEventManager(); -protected: - static KviKvsEventManager * m_pInstance; - - static KviKvsEvent m_appEventTable[KVI_KVS_NUM_APP_EVENTS]; - KviPointerList<KviKvsEventHandler> * m_rawEventTable[KVI_KVS_NUM_RAW_EVENTS]; -public: - static KviKvsEventManager * instance(){ return m_pInstance; }; - static void init(); // called by KviKvs::init() - static void done(); // called by KviKvs::done() - - KviKvsEvent * appEvent(unsigned int uEvIdx){ return &(m_appEventTable[uEvIdx]); }; - - bool hasAppHandlers(unsigned int uEvIdx){ return m_appEventTable[uEvIdx].hasHandlers(); }; - KviPointerList<KviKvsEventHandler> * appHandlers(unsigned int uEvIdx){ return m_appEventTable[uEvIdx].handlers(); }; - - bool hasRawHandlers(unsigned int uEvIdx){ return m_rawEventTable[uEvIdx]; }; - KviPointerList<KviKvsEventHandler> * rawHandlers(unsigned int uEvIdx){ return m_rawEventTable[uEvIdx]; }; - - KviKvsEvent * findAppEventByName(const QString &szName); - unsigned int findAppEventIndexByName(const QString &szName); - bool isValidAppEvent(unsigned int uEvIdx){ return (uEvIdx < KVI_KVS_NUM_APP_EVENTS); }; - - bool isValidRawEvent(unsigned int uEvIdx){ return (uEvIdx < KVI_KVS_NUM_RAW_EVENTS); }; - - bool addAppHandler(unsigned int uEvIdx,KviKvsEventHandler * h); - bool addRawHandler(unsigned int uRawIdx,KviKvsEventHandler * h); - - bool removeScriptAppHandler(unsigned int uEvIdx,const QString &szName); - bool removeScriptRawHandler(unsigned int uEvIdx,const QString &szName); - - bool enableScriptAppHandler(unsigned int uEvIdx,const QString &szName,bool bEnable); - bool enableScriptRawHandler(unsigned int uEvIdx,const QString &szName,bool bEnable); - - bool removeModuleAppHandler(unsigned int uEvIdx,KviKvsModuleInterface *i); - bool removeModuleRawHandler(unsigned int uRawIdx,KviKvsModuleInterface *i); - - void removeAllModuleAppHandlers(KviKvsModuleInterface *i); - void removeAllModuleRawHandlers(KviKvsModuleInterface *i); - - void removeAllModuleHandlers(KviKvsModuleInterface * i); - - KviKvsScriptEventHandler * findScriptRawHandler(unsigned int uEvIdx,const QString &szName); - KviKvsScriptEventHandler * findScriptAppHandler(unsigned int uEvIdx,const QString &szName); - - // returns true if further processing should be stopped - // none of these functions takes params ownership, so be sure to delete them ! - bool triggerHandlers(KviPointerList<KviKvsEventHandler> * pHandlers,KviWindow *pWnd,KviKvsVariantList *pParams); - bool trigger(unsigned int uEvIdx,KviWindow * pWnd,KviKvsVariantList * pParams) - { return triggerHandlers(m_appEventTable[uEvIdx].handlers(),pWnd,pParams); }; - bool triggerRaw(unsigned int uEvIdx,KviWindow *pWnd,KviKvsVariantList * pParams) - { return triggerHandlers(m_rawEventTable[uEvIdx],pWnd,pParams); }; - - // this is the only that takes parameter ownership and deletes them - bool triggerDeleteParams(unsigned int uEvIdx,KviWindow * pWnd,KviKvsVariantList * pParams) - { - bool bRet = triggerHandlers(m_appEventTable[uEvIdx].handlers(),pWnd,pParams); - delete pParams; - return bRet; - }; - - void removeAllScriptAppHandlers(); - void removeAllScriptRawHandlers(); - - void clearAppEvents(); - void clearRawEvents(); - void clear(); - - void loadAppEvents(const QString &szFileName); - void saveAppEvents(const QString &szFileName); - void loadRawEvents(const QString &szFileName); - void saveRawEvents(const QString &szFileName); -}; - - - -#endif //!_KVI_KVS_EVENTMANAGER_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_eventtable.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_eventtable.cpp deleted file mode 100644 index 11621f593a..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_eventtable.cpp +++ /dev/null @@ -1,3147 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_eventtable.cpp -// Created on Mon 23 Feb 2004 03:23:18 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_event.h" -#include "kvi_kvs_eventtable.h" -#include "kvi_kvs_eventmanager.h" - -#define EVENT(_name,_parm) KviKvsEvent(_name,_parm) - -KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_NUM_SCRIPT_EVENTS]= -{ - /* - @doc: onkvircstartup - @type: - event - @title: - OnKVIrcStartup - @short: - Triggered on KVIrc startup - @parameters: - None - @window: - Console of the first IRC context - @description: - This event is triggered on KVIrc startup. - It is bound to the console of the first created IRC context. - This is a little tricky, since this event is triggered - before the related [event:onirccontextcreated]OnIRCContextCreated[/event] event. - This is to make OnApplicationStartup be the absolutely first - event triggered at all. - This event is a good place to load your script configuration - and eventually initialize your variables. - @seealso: - [event:onkvircshutdown]OnKVIrcShutdown[/event] - */ - EVENT("OnKVIrcStartup",""), - /* - @doc: onkvircshutdown - @type: - event - @title: - OnKVIrcShutdown - @short: - Triggered on KVIrc shutdown - @parameters: - None - @window: - Console of the last IRC context - @description: - This event is triggered on KVIrc shutdown. - It is bound to the console of the last existing IRC context. - This is a little tricky, since this event is triggered - immediately after the on [event:onirccontextdestroyed]OnIRCContextDestroyed[/event] event, - so in theory the console should be already destroyed. - This is to make OnApplicationShutdown be the absolutely last event - triggered at all. - This event is a good place to save your script configuration. - @seealso: - [event:onkvircstartup]OnKVIrcStartup[/event] - */ - EVENT("OnKVIrcShutdown",""), - /* - @doc: onirccontextcreated - @type: - event - @title: - OnIRCContextCreated - @short: - Triggered when a new IRC context is created - @parameters: - None - @window: - Console of the created IRC context - @description: - This event is triggered when a new IRC context is created. - It is bound to the console of the related IRC context, - that is the first window that is created. - @seealso: - [event:onirccontextdestroyed]OnIRCContextDestroyed[/event] - */ - EVENT("OnIRCContextCreated",""), - /* - @doc: onirccontextdestroyed - @type: - event - @title: - OnIRCContextDestroyed - @short: - Triggered when an IRC context is destroyed - @parameters: - None - @window: - Console of the destroyed IRC context - @description: - This event is triggered when an IRC context is being destroyed. - It is bound to the console of the related IRC context, - that is the last window of the context that is destroyed. - @seealso: - [event:onirccontextcreated]OnIRCContextCreated[/event] - */ - EVENT("OnIRCContextDestroyed",""), - /* - @doc: onircconnectionestablished - @type: - event - @title: - OnIRCConnectionEstablished - @short: - Triggered when a new IRC connection has been established - @parameters: - None - @window: - Console of the related IRC context - @description: - This event is triggered immediately after an IRC connection - has been established. No data has been sent to the server yet - and you have not logged in: it is not a good idea - attempting to send data to the server (READ: [b]This is NOT - a good place for joining channels[/b]). - Your nickname is still "undefined" too. - If you're looking for the appropriate moment for sending - data to the server look at the [event:onirc]OnIRC[/event] event. - This event is a good place for initializing connection related - variables. By calling [cmd]halt[/cmd] in this event you will stop the - "Connection established" output. - @seealso: - [event:onircconnectionterminated]OnIRCConnectionTerminated[/event] - */ - EVENT("OnIRCConnectionEstablished",""), - /* - @doc: onircconnectionterminated - @type: - event - @title: - OnIRCConnectionTerminated - @short: - Triggered when an IRC connection has been terminated - @parameters: - None - @window: - Console of the related IRC context - @description: - This event is triggered immediately after an IRC connection - has been terminated. The socket is already closed, so you - can't send data to the server. You can still read - the connection parameters like the server name or - network name. By calling [cmd]halt[/cmd] in this - event you will stop the "Connection terminated..." output. - @seealso: - [event:onircconnectionestablished]OnIRCConnectionEstablished[/event] - */ - EVENT("OnIRCConnectionTerminated",""), - /* - @doc: onirc - @type: - event - @title: - OnIRC - @short: - Triggered when the login operations are terminated - @parameters: - None - @window: - Console of the related IRC context - @description: - This event is triggered immediately after the login - operations have been terminated. From now on you are - "completely on IRC": your nickname has been defined - and the server is ready to accept commands from you. - This is a good place to join the "preferred channels". - By calling [cmd]halt[/cmd] in this event you will - stop the "Login operations complete..." output. - @seealso: - [event:onircconnectionestablished]OnIRCConnectionEstablished[/event] - [event:onircconnectionterminated]OnIRCConnectionTerminated[/event] - */ - EVENT("OnIRC",""), - /* - @doc: onchannelnickpopuprequest - @type: - event - @title: - OnChannelNickPopupRequest - @short: - Allows customization of the nick-on-channel context popup - @parameters: - $0 = nick list - @window: - Channel window - @description: - This event is triggered when the user right-clicks in the channel user list - or on a nickname link in the channel text view.[br] - The first parameter ($0) contains a comma separated list of selected nicknames (if it is an user list click) - or a single nickname (if it is a link).[br] - In both cases all the nicknames are currently on the channel.[br] - You should popup a popup-menu with a set of possible channel-related actions, - like op/deop , voice/devoice , whois etc... - @seealso: - [event:onchannelnickdefaultactionrequest]OnChannelNickDefaultActionRequest[/event] - */ - EVENT("OnChannelNickPopupRequest","$0 = nick list"), - /* - @doc: onchannelnickdefaultactionrequest - @type: - event - @title: - OnChannelNickDefaultActionRequest - @short: - Allows customization of the double click on nicknames - @parameters: - $0 = nick list - @window: - Channel window - @description: - @seealso: - [event:onchannelnickpopuprequest]OnChannelNickPopupRequest[/event] - */ - EVENT("OnChannelNickDefaultActionRequest","$0 = nick list"), - /* - @doc: onframewindowcreated - @type: - event - @title: - OnFrameWindowCreated - @short: - Triggered when a new frame window is opened - @parameters: - None - @window: - First console in the frame window - @description: - This event is triggered in the first console of a new frame window. - A frame window is the toplevel window that contains the consoles - and the other MDI children windows. - @seealso: - [event:onframewindowdestroyed]OnFrameWindowDestroyed[/event] - */ - EVENT("OnFrameWindowCreated",""), - /* - @doc: onframewindowdestroyed - @type: - event - @title: - OnFrameWindowDestroyed - @short: - Triggered when a frame window is being destroyed - @parameters: - None - @window: - Last console in the frame window - @description: - This event is triggered in the last console of a frame window that is - being destroyed. In fact the frame window is not destroyed yet, but it - is going to: there would be no way to trigger this event after the - last frame window destruction. - @seealso: - [event:onframewindowcreated]OnFrameWindowCreated[/event] - */ - EVENT("OnFrameWindowDestroyed",""), - /* - @doc: onchannelpopuprequest - @type: - event - @title: - OnChannelPopupRequest - @short: - Triggered when the channel text view is right-clicked - @parameters: - None - @window: - Channel window - @description: - This event is triggered when the user clicks the channel - text view with the right mouse button. It is a good place - to activate a [cmd]popup[/cmd] menu :) - @seealso: - [event:ondccchatpopuprequest]OnDCCChatPopupRequest[/event], - [event:onconsolepopuprequest]OnConsolePopupRequest[/event], - [event:onquerypopuprequest]OnQueryPopupRequest[/event] - */ - EVENT("OnChannelPopupRequest",""), - /* - @doc: onconsolepopuprequest - @type: - event - @title: - OnConsolePopupRequest - @short: - Triggered when the console text view is right-clicked - @parameters: - None - @window: - Console window - @description: - This event is triggered when the user clicks the console - text view with the right mouse button. It is a good place - to activate a [cmd]popup[/cmd] menu :) - @seealso: - [event:ondccchatpopuprequest]OnDCCChatPopupRequest[/event], - [event:onchannelpopuprequest]OnChannelPopupRequest[/event], - [event:onquerypopuprequest]OnQueryPopupRequest[/event] - */ - EVENT("OnConsolePopupRequest",""), - /* - @doc: onquerypopuprequest - @type: - event - @title: - OnQueryPopupRequest - @short: - Triggered when the query text view is right-clicked - @parameters: - None - @window: - Query - @description: - This event is triggered when the user clicks the query - text view with the right mouse button. It is a good place - to activate a [cmd]popup[/cmd] menu :) - @seealso: - [event:ondccchatpopuprequest]OnDCCChatPopupRequest[/event], - [event:onconsolepopuprequest]OnConsolePopupRequest[/event], - [event:onchannelpopuprequest]OnChannelPopupRequest[/event], - */ - EVENT("OnQueryPopupRequest",""), - /* - @doc: onchannelsync - @type: - event - @title: - OnChannelSync - @short: - Triggered when all the channel informations have been received - @parameters: - $0 = channel sync time in milliseconds - @window: - Channel - @description: - This event is triggered after you have joined a channel - and all the informations have been received.[br] - This includes the channel users list, the ban list, - the channel mode, the topic and eventually - the invite and ban exception lists.[br] - Calling halt in this even stops the "channel synchronized" output.[br] - (the output will be halted anyway if [fnc]$option[/fnc](boolShowChannelSyncTime) evaluates to false) - @seealso: - [event:ondccchatpopuprequest]OnDCCChatPopupRequest[/event], - [event:onconsolepopuprequest]OnConsolePopupRequest[/event], - [event:onchannelpopuprequest]OnChannelPopupRequest[/event] - */ - EVENT("OnChannelSync","$0 = Channel sync time in milliseconds"), - /* - @doc: onurl - @type: - event - @title: - OnURL - @short: - Triggered when an URL appears in one of the output windows - @parameters: - $0 = URL - @window: - The window that the URL appeared in - @description: - This event is triggered every time that an URL is going to appear - in a KVIrc window output widget. You cannot stop it or modify it. - This event is good for implementing an URL catcher.[br] - WARNING: If you attempt to "echo $0" inside this event, you will cause an infinite loop. - */ - EVENT("OnURL","$0 = URL"), - /* - @doc: onwindowpopuprequest - @type: - event - @title: - OnWindowPopupRequest - @short: - Triggered when the user middle-clicks in a text view (or right-clicks with the CTRL key pressed). - @parameters: - none - @window: - The window that the user has clicked in. - @description: - This event is here to allow easy customization of the window popup (it was builtin in KVIrc version prior to 3.0.0).[br] - Actually it is triggered when the user middle-clicks in a text view (or right-clicks with the CTRL key pressed).[br] - You should use it to popup your own version of the window popup that should interface the logging and window-behaviour functions. - */ - EVENT("OnWindowPopupRequest",""), - /* - @doc: onhostlinkpopuprequest - @type: - event - @title: - OnHostLinkPopupRequest - @short: - Triggered when an user right clicks on a hostname link in the text view. - @parameters: - $0 = actual name - $1 - visible name - $2 - command name - @window: - The window that the user has clicked in. - @description: - This event is triggered when an user has right clicked on a hostname link in the text view. - The double click link action is builtin and it causes KVIrc to perform a DNS query on the hostname. - This is a good place to show a popup menu with some operations that can be done on the hostname like - "telnet", "traceroute", some special kind of DNS lookup (maybe an xterm with nslookup or sth). - */ - EVENT("OnHostLinkPopupRequest","$0 = actual name\n$1 - visible name\n$2 - command name"), - /* - @doc: onurllinkpopuprequest - @type: - event - @title: - OnURLLinkPopupRequest - @short: - URL link popup customization - @parameters: - $0 = actual name - $1 - visible name - $2 - command name - @window: - The window that the user has clicked in - @description: - Actual name is equal to the command name if command name is not null. - Visible name is the link text (as it shown by user) - Command name is set if the visible name differs with the actual link target(probably contains mIRC colors,etc). It is equal to the actual target name. - This event is triggered when an user has right clicked on an URL link in - the text view. The double click link action is builtin and it causes KVIrc - to open the URL with a browser (konqueror in KDE compilation mode or netscape).[br] - This is a good place to show a [cmd]popup[/cmd] menu with some operations - that can be performed with the URL , like bookmarking in some way or opening - with a specific browser.[br] - */ - EVENT("OnURLLinkPopupRequest","$0 = actual name\n$1 - visible name\n$2 - command name"), - /* - @doc: onserverlinkpopuprequest - @type: - event - @title: - OnServerLinkPopupRequest - @short: - Server link popup customization - @parameters: - $0 = actual name - $1 - visible name - $2 - command name - @window: - The window that the user has clicked in - @description: - Actual name is equal to the command name if command name is not null. - Visible name is the link text (as it shown by user) - Command name is set if the visible name differs with the actual link target(probably contains mIRC colors,etc). It is equal to the actual target name. - This event is triggered when an user has right clicked on an server name link in - the text view. The double click link action is builtin and it causes KVIrc - to query the MOTD of the server.[br] - This is a good place to show a [cmd]popup[/cmd] menu with some operations - that can be performed with the server name , like querying stats or links.[br] - Please note that the server name is generally NOT a hostname: some parts of - it are often hidden. The name of the server is generally valid only within - the IRC network that you are connected to.[br] - */ - EVENT("OnServerLinkPopupRequest","$0 = actual name\n$1 - visible name\n$2 - command name"), - /* - @doc: onchannellinkpopuprequest - @type: - event - @title: - OnChannelLinkPopupRequest - @short: - Channel link popup customization - @parameters: - $0 = actual name - $1 - visible name - $2 - command name - @window: - The window that the user has clicked in - @description: - Actual name is equal to the command name if command name is not null. - Visible name is the link text (as it shown by user) - Command name is set if the visible name differs with the actual link target(probably contains mIRC colors,etc). It is equal to the actual target name. - This event is triggered when an user has right clicked on an channel link in - the text view. The double click link action is builtin and it causes KVIrc - to join the channel (unless the user is already on).[br] - This is a good place to show a [cmd]popup[/cmd] menu with some operations - that can be performed with the channel name like bookmarking, joining with a password, - performing a [cmd]who[/cmd] etc... - */ - EVENT("OnChannelLinkPopupRequest","$0 = actual name\n$1 - visible name\n$2 - command name"), - /* - @doc: onnicklinkpopuprequest - @type: - event - @title: - OnNickLinkPopupRequest - @short: - Nick link popup customization - @parameters: - $0 = actual name - $1 - visible name - $2 - command name - @window: - The window that the user has clicked in - @description: - Actual name is equal to the command name if command name is not null. - Visible name is the link text (as it shown by user) - Command name is set if the visible name differs with the actual link target(probably contains mIRC colors,etc). It is equal to the actual target name. - This event is triggered when an user has right clicked on an "unknown" nickname link in - the text view.[br] - This is a good place to show a [cmd]popup[/cmd] menu with some operations - that can be performed with the nickname like querying , sending a file by dcc or opening a dcc.chat. - Please note that NOT ALL the nickname links will receive this event.[br] - The nickname links that appear in the text view of the channel that they are actually in - are handled by the [event:onchannelnickpopuprequest]OnChannelNickPopupRequest[/event] event.[br] - The nickname links that appear in the text view of the query in that they are a remote end - are handled by the [event:onquerynickpopuprequest]OnQueryNickPopupRequest[/event] event.[br] - */ - EVENT("OnNickLinkPopupRequest","$0 = actual name\n$1 - visible name\n$2 - command name"), - /* - @doc: onquerynickpopuprequest - @type: - event - @title: - OnQueryNickPopupRequest - @short: - Query nicklist popup customization - @parameters: - $0 = actual name - $1 - visible name - $2 - command name - @window: - The window that the user has clicked in - @description: - Actual name is equal to the command name if command name is not null. - Visible name is the link text (as it shown by user) - Command name is set if the visible name differs with the actual link target(probably contains mIRC colors,etc). It is equal to the actual target name. - This event is triggered when an user has right clicked on a set of nicknames in - the query target list.[br] - This is a good place to show a [cmd]popup[/cmd] menu with some operations - that can be performed with the nickname like sending a file by dcc, opening a dcc.chat or - performing a whois.[br] - */ - EVENT("OnQueryNickPopupRequest","$0 = actual name\n$1 - visible name\n$2 - command name"), - /* - @doc: onquerynickdefaultactionrequest - @type: - event - @title: - OnQueryNickDefaultActionRequest - @short: - Query double click customization - @parameters: - $0 = actual name - $1 - visible name - $2 - command name - @window: - The window that the user has clicked in - @description: - Actual name is equal to the command name if command name is not null. - Visible name is the link text (as it shown by user) - Command name is set if the visible name differs with the actual link target(probably contains mIRC colors,etc). It is equal to the actual target name. - This event is triggered when an user has double clicked on a nickname in - the query target list.[br] - You should use this event to do some significant action associated with the double click.[br] - A good example might be a [cmd]whois[/cmd] query or a [cmd]dcc.chat[/cmd] - */ - EVENT("OnQueryNickDefaultActionRequest","$0 = actual name\n$1 - visible name\n$2 - command name"), - /* - @doc: onnicklinkdefaultactionrequest - @type: - event - @title: - OnNickLinkDefaultActionRequest - @short: - Nick link double click customization - @parameters: - $0 = actual name - $1 - visible name - $2 - command name - @window: - The window that the user has clicked in - @description: - Actual name is equal to the command name if command name is not null. - Visible name is the link text (as it shown by user) - Command name is set if the visible name differs with the actual link target(probably contains mIRC colors,etc). It is equal to the actual target name. - This event is triggered when an user has double clicked on a nickname link.[br] - You should use this event to perform some significant action associated with the double click.[br] - A good example might be a [cmd]whois[/cmd] or a [cmq]query[/cmd] call.[br] - Please note that NOT ALL nickname links will cause this event to be triggered: some nickname - links default actions are actually handled by the - [event:onquerynickdefaultactionrequest]OnQueryNickDefaultActionRequest[/event] and - [event:onchannelnickdefatulactionrequest]OnChannelNickDefaultActionRequest[/event] events.[br] - */ - EVENT("OnNickLinkDefaultActionRequest","$0 = actual name\n$1 - visible name\n$2 - command name"), - /* - @doc: ontextviewdoublecliked - @type: - event - @title: - OnTextViewDoubleClicked - @short: - Text view link double click customization - @parameters: - $0 = actual name - $1 - visible name - $2 - command name - @window: - The window that the user has clicked in - @description: - Actual name is equal to the command name if command name is not null. - Visible name is the link text (as it shown by user). - Command name is set if the visible name differs with the actual link target (probably contains mIRC colors,etc). It is equal to the actual target name. - This event is triggered when an user has double clicked on a text view and has not hit any link.[br] - I have no idea what you can do in this event....maybe some sort of channel-central dialog? :) - */ - EVENT("OnTextViewDoubleClicked",""), - /* - @doc: onnotifylistdefaultactionrequest - @type: - event - @title: - OnNotifyListDefaultActionRequest - @short: - Notify list double click customization - @parameters: - $0 = nickname - @window: - The window that the user has clicked in - @description: - This event is triggered when an user has double clicked on a nickname in - the notify list (console window).[br] - You should use this event to do some significant action associated with the double click.[br] - A good example might be a [cmd]whois[/cmd] query or a [cmd]dcc.chat[/cmd] - */ - EVENT("OnNotifyListDefaultActionRequest","$0 = nickname"), - /* - @doc: onnotifylistpopuprequest - @type: - event - @title: - OnNotifyListPopupRequest - @short: - Notify list context popup customization - @parameters: - $0 = nickname list - @window: - The window that the user has clicked in - @description: - This event is triggered when an user has right clicked on a list of nicknames in - the notify list (console window).[br] - This is a good place to show a [cmd]popup[/cmd] with some actions that can be performed - on the nicknames like querying , performing a whois lookup or sth similar.[br] - */ - EVENT("OnNotifyListPopupRequest","$0 = nickname list"), - /* - @doc: onping - @type: - event - @title: - OnPing - @short: - Server ping handler - @parameters: - $0 = server - $1 = ping message parameters - @window: - Console - @description: - Triggered when a PING message was received from a server.[br] - Calling 'halt' in this event will stop the informational message about 'ping->pong'.[br] - */ - EVENT("OnPing","$0 = server\n$1 = message parameters"), - /* - @doc: onmejoin - @type: - event - @title: - OnMeJoin - @short: - Local user joining a channel - @parameters: - None - @window: - Channel - @description: - Triggered just after the local user has joined a channel.[br] - Sine this event is triggered in the chanel window, - you can get the channel name by using the [fnc]$target[/fnc] function.[br] - Calling 'halt' in this event will stop the join message output.[br] - @seealso: - [event:onjoin]OnJoin[/event] - */ - EVENT("OnMeJoin",""), - /* - @doc: onjoin - @type: - event - @title: - OnJoin - @short: - Non-local user joining a channel - @parameters: - $0 = nickname - $1 = username - $2 = hostname - @window: - Channel - @description: - Triggered just after a non-local user has joined a channel.[br] - Sine this event is triggered in the chanel window, - you can get the channel name by using the [fnc]$target[/fnc] function.[br] - Calling 'halt' in this event will stop the join message output.[br] - @seealso: - [event:onmejoin]OnMeJoin[/event] - */ - EVENT("OnJoin","$0 = nickname\n$1 = username\n$2 = hostname"), - /* - @doc: ontopic - @type: - event - @title: - OnTopic - @short: - Topic change on a channel - @parameters: - $0 = nickname - $1 = username - $2 = hostname - $3 = new topic string - @window: - Channel - @description: - Triggered when a TOPIC message is received for a given channel.[br] - The topic change has not been executed effectively in the current window - so you can still access the old topic by the channel functions.[br] - The new topic is passed as fourth parameter and will effectively - become the current topic just after this event handler has been executed.[br] - Sine this event is triggered in the chanel window, - you can get the channel name by using the [fnc]$target[/fnc] function.[br] - Calling 'halt' in this event will stop the topic message output.[br] - @seealso: - [event:onmejoin]OnMeJoin[/event] - */ - EVENT("OnTopic","$0 = nickname\n$1 = username\n$2 = hostname\n$3 = topic"), - /* - @doc: onmepart - @type: - event - @title: - OnMePart - @short: - Local user is leaving a channel - @parameters: - $0 = part message - @window: - Channel - @description: - Triggered when the local user is leaving a channel.[br] - The PART message has already been processed by the server , so - the user is effectively no longer on the channel. - On the other side, it might be useful to access the channel data from - this event, thus the handler is called effectively just BEFORE the - user effectively leaves the channel (and thus BEFORE the channel window gets - destroyed).[br] - Sine this event is triggered in the chanel window, - you can get the channel name by using the [fnc]$target[/fnc] function.[br] - Calling 'halt' in this event will stop the part message output.[br] - @seealso: - [event:onmejoin]OnMeJoin[/event], [event:OnJoin]OnJoin[/event], - [event:onpart]OnPart[/event] - */ - EVENT("OnMePart","$0 = part message"), - /* - @doc: onpart - @type: - event - @title: - OnPart - @short: - Non-local user is leaving a channel - @parameters: - $0 = nickname - $1 = username - $2 = hostname - $3 = part message - @window: - Channel - @description: - Triggered when a NON-local user is leaving a channel.[br] - The PART message has already been processed by the server , so - the user is effectively no longer on the channel. - On the other side, it might be useful to access the user-related channel data from - this event, thus the handler is called effectively just BEFORE the - user effectively leaves the channel (and thus BEFORE the user-related channel data gets - destroyed).[br] - Since this event is triggered in the chanel window, - you can get the channel name by using the [fnc]$target[/fnc] function.[br] - Calling 'halt' in this event will stop the part message output.[br] - @seealso: - [event:onmejoin]OnMeJoin[/event], [event:OnJoin]OnJoin[/event], - [event:onmepart]OnMePart[/event] - */ - EVENT("OnPart","$0 = nickname\n$1 = username\n$2 = host\n$3 = part message"), - /* - @doc: onquit - @type: - event - @title: - OnQuit - @short: - An user is leaving a channel - @parameters: - $0 = nickname - $1 = username - $2 = hostname - $3 = quit message - $4 = channels - @window: - Console - @description: - Triggered when an user is quitting IRC.[br] - The QUIT message has already been processed by the server , so - the user is effectively no longer on IRC. - On the other side, it might be useful to access the user-related data from - this event, thus the handler is called effectively just BEFORE the - user is effectively removed from the IRC user list (and thus from the channels and query windows).[br] - The fifth parameter ($4) contains the list of channels on that the user was - just before quitting. - Calling 'halt' in this event will stop the quit message output (in ALL the windows!).[br] - @seealso: - [event:onpart]OnPart[/event], - [event:onmepart]OnMePart[/event] - @examples: - [example] - foreach(%cname,$4)echo -r=$channel(%cname) User $0 is quitting... - [/example] - */ - EVENT("OnQuit","$0 = nickname\n$1 = username\n$2 = host\n$3 = part message\n$4 = channels"), - /* - @doc: onusermode - @type: - event - @title: - OnUserMode - @short: - The local user has changed mode - @parameters: - $0 = mode flags - @window: - Console - @description: - Triggered when the local user has changed his user mode.[br] - The first parameter is the changed mode flag with a leading '+' or '-' sign: - if the mode was removed it will be something like "-x" , otherwise something like "+x".[br] - Calling 'halt' in this event will stop the "mode" message output.[br] - */ - EVENT("OnUserModeChanged","$0 = mode flags"), - /* - @doc: onmekick - @type: - event - @title: - OnMeKick - @short: - Local user is being kicked from a channel - @parameters: - $0 = source nickname - $1 = source username - $2 = source hostname - $3 = kick reason - @window: - Channel - @description: - Triggered when the local user has been kicked from a channel.[br] - The KICK message has already been processed by the server , so - the user is effectively no longer on the channel. - On the other side, it might be useful to access the user-related channel data from - this event, thus the handler is called effectively just BEFORE the - user is effectively removed from the channel internal structures - (and thus BEFORE the channel data itself gets destroyed).[br] - Sine this event is triggered in the chanel window, - you can get the channel name by using the [fnc]$target[/fnc] function.[br] - Calling 'halt' in this event will stop the kick message output.[br] - @seealso: - [event:onkick]OnKick[/event] - */ - EVENT("OnMeKick","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = reason"), - /* - @doc: onkick - @type: - event - @title: - OnKick - @short: - Non-local user is being kicked from a channel - @parameters: - $0 = source nickname - $1 = source username - $2 = source hostname - $3 = kicked nickname - $4 = kick reason - @window: - Channel - @description: - Triggered when a non-local user is being kicked from a channel.[br] - The KICK message has already been processed by the server , so - the user is effectively no longer on the channel. - On the other side, it might be useful to access the user-related channel data from - this event, thus the handler is called effectively just BEFORE the - user is effectively removed from the channel internal structures.[br] - Sine this event is triggered in the chanel window, - you can get the channel name by using the [fnc]$target[/fnc] function.[br] - Calling 'halt' in this event will stop the kick message output.[br] - @seealso: - [event:onmekick]OnMeKick[/event] - */ - EVENT("OnKick","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = kicked nick\n$4 = reason"), - /* - @doc: onmeaway - @type: - event - @title: - OnMeAway - @short: - Local user sets the AWAY status - @parameters: - $0 = server message trailing - @window: - Console - @description: - Triggered when the local user enters the AWAY state. - Calling 'halt' in this event disables the server "You have been marked as being away" message.[br] - @seealso: - [event:onmeback]OnMeBack[/event] - */ - EVENT("OnMeAway","$0- = server message trailing"), - /* - @doc: onmeback - @type: - event - @title: - OnMeBack - @short: - Local user cancels the AWAY status - @parameters: - $0 = away start time - $1- = server message trailing - @window: - Console - @description: - Triggered when the local user leaves the AWAY state.[br] - The $0 parameter contains the [b]unix time[/b] of the away status start.[br] - You can obtain the current [b]unix time[/b] from the function [fnc]$unixtime[/fnc].[br] - Calling 'halt' in this event disables the server "You are no longer marked as being away" message.[br] - @seealso: - [event:onmeaway]OnMeAway[/event] - */ - EVENT("OnMeBack","$0 = away start time\n$1- = server message trailing"), - /* - @doc: onchannelwindowcreated - @type: - event - @title: - OnChannelWindowCreated - @short: - A channel window has just been opened - @parameters: - none - @window: - Channel window - @description: - Triggered when a channel window has just been created - Note that the channel is still empty: no users have joined it. - @seealso: - [event:onquerywindowcreated]OnQueryWindowCreated[/event] - */ - EVENT("OnChannelWindowCreated",""), - /* - @doc: onquerywindowcreated - @type: - event - @title: - OnQueryWindowCreated - @short: - A query window has just been opened - @parameters: - none - @window: - Query window - @description: - Triggered when a query window has just been created - Note that the query is still empty: it has no targets. - If you want to trigger some events in response to a query - creation by some remote user then you probably need - [event:onquerywindowrequest]OnQueryWindowRequest[/event] or - [event:onquerytargetadded]OnQueryTargetAdded[/event]. - @seealso: - [event:onchannelwindowcreated]OnChannelWindowCreated[/event] - [event:onquerywindowrequest]OnQueryWindowRequest[/event] - [event:onquerytargetadded]OnQueryTargetAdded[/event] - */ - EVENT("OnQueryWindowCreated",""), - /* - @doc: onban - @type: - event - @title: - OnBan - @short: - Someone has set a +b flag on the channel - @parameters: - $0 = source nick - $1 = source username - $2 = source hostname - $3 = ban mask - @window: - Channel window - @description: - Triggered when someone sets a +b flag on the channel - @seealso: - [event:onunban]OnUnban[/event] - */ - EVENT("OnBan","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = ban mask"), - /* - @doc: onunban - @type: - event - @title: - OnUnban - @short: - Someone has set a -b flag on the channel - @parameters: - $0 = source nick - $1 = source username - $2 = source hostname - $3 = unban mask - @window: - Channel window - @description: - Triggered when someone sets a -b flag on the channel - @seealso: - [event:onban]OnBan[/event] - */ - EVENT("OnUnBan","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = ban mask"), - /* - @doc: onmeban - @type: - event - @title: - OnMeBan - @short: - Local user is being banned in a channel - @parameters: - $0 = source nickname - $1 = source username - $2 = source hostname - $3 = ban mask - @window: - Channel - @description: - Triggered when someone has set a +b flag that matches your mask (bans you) in the channel.[br] - @seealso: - [event:onmeunban]OnMeUnban[/event] - */ - EVENT("OnMeBan","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = ban mask"), - /* - @doc: onmeunban - @type: - event - @title: - OnMeUnban - @short: - Local user is being de-banned in a channel - @parameters: - $0 = source nickname - $1 = source username - $2 = source hostname - $3 = ban mask - @window: - Channel - @description: - Triggered when someone has set a -b flag that matches your mask (debans you) in the channel.[br] - @seealso: - [event:onmeban]OnMeBan[/event] - */ -EVENT("OnMeUnban","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = ban mask"), - /* - @doc: onbanexception - @type: - event - @title: - OnBanException - @short: - Someone has set a +e flag on the channel - @parameters: - $0 = source nick - $1 = source username - $2 = source hostname - $3 = banexception mask - @window: - Channel window - @description: - Triggered when someone sets a +e (Ban Exception) flag on the channel - @seealso: - [event:onbanexceptionremove]OnBanExceptionRemove[/event] - */ - - EVENT("OnBanException","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = ban exception mask"), - /* - @doc: onbanexceptionremove - @type: - event - @title: - OnBanExceptionRemove - @short: - Someone has set a -e flag on the channel - @parameters: - $0 = source nick - $1 = source username - $2 = source hostname - $3 = unban mask - @window: - Channel window - @description: - Triggered when someone sets a -e (Removed a Ban Exception) flag on the channel - @seealso: - [event:onbanexception]OnBanException[/event] - */ - EVENT("OnBanExceptionRemove","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = ban exception mask"), - /* - @doc: onmebanexception - @type: - event - @title: - OnMeBanException - @short: - Someone has set a +e flag on the local user - @parameters: - $0 = source nick - $1 = source username - $2 = source hostname - $3 = mask - @window: - Channel window - @description: - Triggered when someone sets a +e (puts a Ban Exception) flag on the local user in the active -channel - @seealso: - [event:onmebanexceptionremove]OnMeBanExceptionRemove[/event] - */ - EVENT("OnMeBanException","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = mask"), - /* - @doc: onmebanexceptionremove - @type: - event - @title: - OnMeBanExceptionRemove - @short: - Someone has set a -e flag on the local user - @parameters: - $0 = source nick - $1 = source username - $2 = source hostname - $3 = mask - @window: - Channel window - @description: - Triggered when someone sets a -e (removes a Ban Exception) flag on the local user in the active channel - @seealso: - [event:onmebanexception]OnMeBanException[/event] - */ - EVENT("OnMeBanExceptionRemove","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = mask"), - /* - @doc: onop - @type: - event - @title: - OnOp - @short: - Someone has given a user the +o flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = opped nick - @window: - Channels window - @description: - Triggered when someone sets a +o (has made Op) flag on a user of the active channel. - @seealso: - [event:ondeop]OnDeOp[/event] - */ - EVENT("OnOp","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = opped nick"), - /* - @doc: ondeop - @type: - event - @title: - OnDeOp - @short: - Someone has given a user the -o flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = deopped nick - @window: - Channels window - @description: - Triggered when someone sets a -o (DeOp) flag on a user in the active channel. - @seealso: - [event:onop]OnOp[/event] - */ - EVENT("OnDeOp","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = deopped nick"), - /* - @doc: onmeop - @type: - event - @title: - OnMeOp - @short: - Someone has given the +o flag to the local user - @parameters: - $0 = source nick - $1 = source username - $2 = source host - @window: - Channels window - @description: - Triggered when someone sets a +o (has made Op) flag on the local user in the active channel. - @seealso: - [event:onmedeop]OnMeDeOp[/event] - */ - EVENT("OnMeOp","$0 = source nick\n$1 = source username\n$2 = source hostname"), - /* - @doc: onmedeop - @type: - event - @title: - OnMeDeOp - @short: - Someone has given the -o flag to the local user - @parameters: - $0 = source nick - $1 = source username - $2 = source host - @window: - Channels window - @description: - Triggered when someone sets a -o (has deoped) flag on the local user in the active channel. - @seealso: - [event:onmeop]OnMeOp[/event] - */ - EVENT("OnMeDeOp","$0 = source nick\n$1 = source username\n$2 = source hostname"), - /* - @doc: onlimitset - @type: - event - @title: - OnLimitSet - @short: - The channel users limit has been set - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = limit - @window: - Channels window - @description: - Triggered when someone change or sets the active channel user limit (+l) - @seealso: - [event:onlimitunset]OnLimitUnset[/event] - */ - EVENT("OnLimitSet","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = limit"), - /* - @doc: onlimitunset - @type: - event - @title: - OnLimitUnSet - @short: - The channel users limit has been unset - @parameters: - $0 = source nick - $1 = source username - $2 = source host - @window: - Channels window - @description: - Triggered when someone unsets the active channel user limit (-l) - @seealso: - [event:onlimitunset]OnLimitUnset[/event] - */ - EVENT("OnLimitUnset","$0 = source nick\n$1 = source username\n$2 = source hostname"), - /* - @doc: onkeyset - @type: - event - @title: - OnKeySet - @short: - The channel users key has been set - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = key - @window: - Channels window - @description: - Triggered when someone change or sets the active channel access key (+k) - @seealso: - [event:onkeyunset]OnKeyUnset[/event] - */ - EVENT("OnKeySet","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = key"), - /* - @doc: onkeyunset - @type: - event - @title: - OnKeyUnset - @short: - The channel users key has been unset - @parameters: - $0 = source nick - $1 = source username - $2 = source host - @window: - Channels window - @description: - Triggered when someone unsets the active channel access key (-k) - @seealso: - [event:onkeyunset]OnKeyUnset[/event] - */ - EVENT("OnKeyUnset","$0 = source nick\n$1 = source username\n$2 = source hostname"), - /* - @doc: oninvite - @type: - event - @title: - OnInvite - @short: - The local user has received an invitation - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = channel - @window: - Active window/console - @description: - Triggered when someone invites the local user to join a channel - */ - EVENT("OnInvite","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = channel"), - /* - @doc: onchannelmessage - @type: - event - @title: - OnChannelMessage - @short: - A message has been received from the channel - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = message - $4 = [target mode prefixes] - @window: - Channels window - @description: - Triggered when a channel message is received - $0!$1@$2 is the source of the message, $3 is the message text - and $4 are the eventual mode prefixes added to the target channel (i.e: - if the message is only for channel operators then you will get the string @ in $4). - @seealso: - [event:onquerymessage]OnQueryMessage[/event] - [event:ondccchatmessage]OnDCCChatMessage[/event] - */ - EVENT("OnChannelMessage","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = message\n$4 = target mode prefixes"), - /* - @doc: onquerymessage - @type: - event - @title: - OnQueryMessage - @short: - A message has been received from a query - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = message - @window: - Query or console window. - @description: - Triggered when a query message is received.[br] - If you [cmd]return[/cmd] [fnc]$false[/fnc] in this event, the message output will be stopped.[br] - This event is triggered in the query window associated to the source nick, or in - the IRC context console window if the query window has not been created for some reason. - Note that you can't stop the query window creation with this event: you must - use [event:onquerywindowrequest]OnQueryWindowRequest[/event] for that purpose. - Note also that you may not receive this event if the anti-spam option is in use and - KVIrc has detected that this might be a spam message. This is usually not an issue - but if you care about it then write to pragma at kvirc dot net asking to add a OnSpam event. - @seealso: - [event:onquerywindowrequest]OnQueryWindowRequest[/event] - [event:onquerywindowcreated]OnQueryWindowCreated[/event] - [event:onquerytargetadded]OnQueryTargetAdded[/event] - [event:onchannelmessage]OnChannelMessage[/event] - [event:ondccchatmessage]OnDCCChatMessage[/event] - */ - EVENT("OnQueryMessage","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = message"), - /* - @doc: onvoice - @type: - event - @title: - OnVoice - @short: - Someone has given a user the +v flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = voiced nick - @window: - Channels window - @description: - Triggered when someone sets a +v (voice) flag to someone in the active channel. - @seealso: - [event:ondevoice]OnDeVoice[/event] - */ - EVENT("OnVoice","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = voiced nick"), - /* - @doc: ondevoice - @type: - event - @title: - OnDeVoice - @short: - Someone has given a user the -v flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = devoiced nick - @window: - Channels window - @description: - Triggered when someone sets a -v (devoice) flag to someone in the active channel. - @seealso: - [event:ondevoice]OnDeVoice[/event] - */ - EVENT("OnDeVoice","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = voiced nick"), - /* - @doc: onmevoice - @type: - event - @title: - OnMeVoice - @short: - Someone has give the local user a +v flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - @window: - Channels window - @description: - Triggered when someone sets a +v (devoice) flag for the local user in the active channel. - @seealso: - [event:onmedevoice]OnMeDeVoice[/event] - */ - EVENT("OnMeVoice","$0 = source nick\n$1 = source username\n$2 = source hostname"), - /* - @doc: onmedevoice - @type: - event - @title: - OnMeDeVoice - @short: - Someone has give the local user a -v flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - @window: - Channels window - @description: - Triggered when someone sets a -v (devoice) flag for the local user in the active channel. - @seealso: - [event:onmevoice]OnMeVoice[/event] - */ - EVENT("OnMeDeVoice","$0 = source nick\n$1 = source username\n$2 = source hostname"), - /* - @doc: onnickchange - @type: - event - @title: - OnNickChange - @short: - Someone has changed his nickname - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = new nickname - @window: - Console window - @description: - Triggered when someone has changed his nickname. - The change has already been processed by the server, but not by the - local KVIrc database. - @seealso: - [event:onmenickchange]OnMeNickChange[/event] - */ - EVENT("OnNickChange","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = new nickname"), - /* - @doc: onmenickchange - @type: - event - @title: - OnMeNickChange - @short: - The local user has changed his nickname - @parameters: - $0 = old nick - $1 = new nickname - @window: - Console window - @description: - Triggered when the local user is going to change his nickname. - The change has already been processed by the server, but not by the - local KVIrc database. - @seealso: - [event:onnickchange]OnNickChange[/event] - */ - EVENT("OnMeNickChange","$0 = old nick\n$1 = new nick"), - /* - @doc: onctcprequest - @type: - event - @title: - OnCTCPRequest - @short: - A CTCP request has been received - @parameters: - $0 = source nick - $1 = source user - $2 = source host - $3 = target - $4 = ctcp type - $5- = ctcp parameters - @window: - Console window - @description: - A CTCP request has been received.[br] - If you call [cmd]halt[/cmd] in this event, you will stop the further - processing of the CTCP (thus, you can disable some of the KVIrc features). - Be careful when using this. - @seealso: - [event:onctcpreply]OnCTCPReply[/event] - */ - EVENT("OnCTCPRequest","$0 = source nick\n$1 = source user\n$2 = source host\n$3 = target\n$4 = ctcp type\n$5- = ctcp parameters"), - /* - @doc: onctcpreply - @type: - event - @title: - OnCTCPReply - @short: - A CTCP reply has been received - @parameters: - $0 = source nick - $1 = source user - $2 = source host - $3 = target - $4 = ctcp type - $5- = ctcp parameters - @window: - Console window - @description: - A CTCP reply has been received.[br] - If you call [cmd]halt[/cmd] in this event, you will stop the further - processing of the CTCP (thus, you can disable some of the KVIrc features). - Be careful when using this. - @seealso: - [event:onctcpreply]OnCTCPReply[/event] - */ - EVENT("OnCTCPReply","$0 = source nick\n$1 = source user\n$2 = source host\n$3 = target\n$4 = ctcp type\n$5- = ctcp parameters"), - /* - @doc: onunhandledliteral - @type: - event - @title: - OnUnhandledLiteral - @short: - An unhandled literal server message has been received - @parameters: - $0 = source mask - $1 = message (literal) - $2- = parameters - @window: - Console window - @description: - An unhandled/unrecognized literal server message has been received.[br] - The KVIrc core code hasn't been able to recognize it nor handle it - in any way.[br] - If you call [cmd]halt[/cmd] you will stop the standard or warning message output.[br] - For server numerics there is no "unhandled" event, you should use the - raw numeric events to handle them.[br] - @seealso: - */ - EVENT("OnUnhandledLiteral","$0 = source mask\n$1 = message\n$2- parameters"), - /* - @doc: onmehalfop - @type: - event - @title: - OnMeHalfOp - @short: - Someone has given the local user the +h flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - @window: - Channels window - @description: - Triggered when someone sets a +h (halfop) flag for the local user in the active channel. - @seealso: - [event:onmedehalfop]OnMeDeHalfOp[/event] - */ - EVENT("OnMeHalfOp","$0 = source nick\n$1 = source username\n$2 = source hostname"), - /* - @doc: onmedehalfop - @type: - event - @title: - OnMeDeHalfOp - @short: - Someone has given the local user the -h flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - @window: - Channels window - @description: - Triggered when someone sets a -h (dehalfop) flag for the local user in the active channel. - @seealso: - [event:onmehalfop]OnMeHalfOp[/event] - */ - EVENT("OnMeDeHalfOp","$0 = source nick\n$1 = source username\n$2 = source hostname"), - /* - @doc: onhalfop - @type: - event - @title: - OnHalfOp - @short: - Someone has given a user the +h flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = halfopped nick - @window: - Channels window - @description: - Triggered when someone sets a +h flag on a user of the active channel. - @seealso: - [event:ondehalfop]OnDeHalfOp[/event] - */ - EVENT("OnHalfOp","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = halfopped nick"), - /* - @doc: ondehalfop - @type: - event - @title: - OnDeHalfOp - @short: - Someone has given a user the -h flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = dehalfopped nick - @window: - Channels window - @description: - Triggered when someone sets a -h (dehalfop) flag on a user in the active channel. - @seealso: - [event:onhalfop]OnHalfOp[/event] - */ - EVENT("OnDeHalfOp","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = dehalfopped nick"), - /* - @doc: oninviteexception - @type: - event - @title: - OnInviteException - @short: - A +I mode has been set - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = target mask - @window: - Channels window - @description: - Someone has set mode +I on a channel - @seealso: - [event:oninviteexceptionremove]OnInviteExceptionRemove[/event] - */ - EVENT("OnInviteException","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = target mask"), - /* - @doc: oninviteexceptionremove - @type: - event - @title: - OnInviteExceptionRemove - @short: - Move -I has been set - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = target mask - @window: - Channels window - @description: - Someone has set mode -I on a channel - @seealso: - [event:oninviteexceptionremove]OnInviteExceptionRemove[/event] - */ - EVENT("OnInviteExceptionRemove","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = target mask"), - /* - @doc: onmeinviteexception - @type: - event - @title: - OnMeInviteException - @short: - A +I mode has been set - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = mask - @window: - Channels window - @description: - Someone has set mode +I on a channel with a target mask that matches - the local user mask - @seealso: - [event:onmeinviteexceptionremove]OnMeInviteExceptionRemove[/event] - */ - EVENT("OnMeInviteException","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = mask"), - /* - @doc: onmeinviteexceptionremove - @type: - event - @title: - OnMeInviteExceptionRemove - @short: - Move -I has been set - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = mask - @window: - Channels window - @description: - Someone has set mode -I on a channel with a target mask that matches - the local user mask - @seealso: - [event:onmeinviteexceptionremove]OnMeInviteExceptionRemove[/event] - */ - EVENT("OnMeInviteExceptionRemove","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = mask"), - /* - @doc: onaction - @type: - event - @title: - OnAction - @short: - Someone issued a CTCP ACTION - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = message target - $4 = action message text - @window: - Channels and query windows - @description: - This event is triggered when a remote user issues a CTCP ACTION.[br] - (The CTCP ACTION is usually triggered by the /me command).[br] - The parameters $0-$2 identify the source user.[br] - $3 identifies the message target and can be one of the following:[br] - - The local user nickname : this is a private CTCP ACTION and is triggered inside a query window.[br] - - A channel name : this is a channel CTCP ACTION and is triggered in the channel window.[br] - - Any other string : this is either a broadcast CTCP ACTION (sent by a privileged user - to a subset of clients) or a sign of the server brain damage :D In this - case the event is triggered in the console window.[br] - Calling [cmd]halt[/cmd] in this event stops the message output.[br] - */ - - EVENT("OnAction", \ - "$0 = source nick\n" \ - "$1 = source username\n" \ - "$2 = source hostname\n" \ - "$3 = message target\n" \ - "$4 = action message text"), - /* - @doc: onctcpflood - @type: - event - @title: - OnCTCPFlood - @short: - Someone tried to flood you with CTCP requests - @parameters: - $0 = source nick - $1 = source username - $2 = source hostname - $3 = target - $4 = ctcp type - $5- = ctcp parameters - @window: - Console window - @description: - On IRC there is a kind of attack called 'CTCP Flood'. It consist of a lot of CTCP request in a short period of time, trying to made your client reply to them and made the server kick you. This event is triggered when one of such attacks is detected. - @seealso: - [event:onctcprequest]OnCTCPRequest[/event] - [event:onctcpreply]OnCTCPReply[/event] - */ - EVENT("OnCTCPFlood", "$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = target\n$4 = ctcp type\n$5- = ctcp parameters"), - /* - @doc: onchannelnotice - @type: - event - @title: - OnChannelNotice - @short: - A NOTICE have been issued to a channel - @parameters: - $0 = source nick - $1 = message - $2 = target - @window: - Channel window - @description: - Someone has issued a NOTICE with a channel as his target - For normal channel notices $2 parameter will only a channel name. - For channel op or channel voice notices it will contain also the leading '@' or '+' flag. - Please note that this convention is different from the one used in [event:onchannelprivmsg]OnChannelPrivmsg[/event]: - the incompatibility is here for historical reasons: it is not a big deal so we're not fighting it :) - @seealso: - [event:onservernotice]OnServerNotice[/event] - */ - EVENT("OnChannelNotice", "$0 = source nick\n$1 = message,\n$2 = target"), - /* - @doc: onservernotice - @type: event - @title: - OnServerNotice - @short: - A server NOTICE have been issued. - @parameters: - $0 = source nick - $1 = message - @window: - Console window - @description: - Someone has issued a server NOTICE. - @seealso: - [event:onchannelnotice]OnChannelNotice[/event] - */ - EVENT("OnServerNotice", "$0 = source nick\n$1 = message"), - /* - @doc: ondccchatwindowcreated - @type: event - @title: - OnDCCChatWindowCreated - @short: - A dcc chat window has been just created - @parameters: - $0 = DCC session ID - @window: - DCC Chat - @description: - A DCC Chat window has been just created. - The [module:dcc]dcc[/module] module functions - can be used to retrieve the informations about the - window and the data transfer. - The DCC Chat connection attempt starts from here: - you can get [event:ondccchatterminated]OnDCCChatError[/event] - in any moment - @seealso: - [event:ondccchatterminated]OnDCCChatTerminated[/event] - */ - EVENT("OnDCCChatWindowCreated", "$0 = DCC session ID"), - /* - @doc: ondccchatconnectioninprogress - @type: - event - @title: - OnDCCChatConnectionInProgress - @short: - A DCC Chat connection has just been started - @parameters: - $0 = DCC session ID - @window: - DCC Chat - @description: - A DCC Chat connection has just been started succesfully. - The [module:dcc]dcc[/module] module functions - can be used to retrieve the informations about the - window and the data transfer. - In case of a passive DCC Chat, the local ip and port - are known from the moment that this event triggers. - @seealso: - */ - EVENT("OnDCCChatConnectionInProgress","$0 = DCC session ID"), - /* - @doc: ondccchatconnected - @type: - event - @title: - OnDCCChatConnected - @short: - A DCC Chat connection has been established - @parameters: - $0 = DCC session ID - @window: - DCC Chat - @description: - A DCC Chat connection has just been established. - The [module:dcc]dcc[/module] module functions - can be used to retrieve the informations about the - window and the data transfer. - @seealso: - */ - EVENT("OnDCCChatConnected","$0 = DCC session ID"), - /* - @doc: ondccchatmessage - @type: - event - @title: - OnDCCChatMessage - @short: - A DCC Chat message has just been received - @parameters: - $0 = message text - $1 = DCC session ID - @window: - DCC Chat - @description: - A DCC Chat message has just been received. - The [module:dcc]dcc[/module] module functions - can be used to retrieve the informations about the - window and the data transfer. - @seealso: - */ - EVENT("OnDCCChatMessage","$0 = text\n$1 = DCC session ID"), - /* - @doc: ondccchaterror - @type: - event - @title: - OnDCCChatError - @short: - A DCC Chat error has just been triggered - @parameters: - $0 = error message - $1 = DCC session ID - @window: - DCC Chat - @description: - A DCC Chat error has just been triggered - The [module:dcc]dcc[/module] module functions - can be used to retrieve the informations about the - window and the data transfer. - A DCC Chat can terminate because an error has - interrupted the connection or because - the local user has closed the window forcibly. - The remote end closing the connection is considered - an error. - @seealso: - */ - EVENT("OnDCCChatError","$0 = error message,$1 = DCC session ID"), - /* - @doc: ondccchatdisconnected - @type: - event - @title: - OnDCCChatDisconnected - @short: - A DCC Chat has been just disconnected - @parameters: - $0 = DCC session ID - @window: - DCC Chat - @description: - A DCC Chat has just been disconnected for some reason. - The [module:dcc]dcc[/module] module functions - can be used to retrieve the informations about the - window and the data transfer. - @seealso: - */ - EVENT("OnDCCChatDisconnected","$0 = DCC session ID"), - /* - @doc: ondccchatwindowclosing - @type: - event - @title: - OnDCCChatWindowClosing - @short: - A DCC Chat is going to be closed - @parameters: - $0 = DCC session ID - @window: - DCC Chat - @description: - A DCC Chat window is going to be closed. - The [module:dcc]dcc[/module] module functions - can be used to retrieve the informations about the - window and the data transfer. - @seealso: - */ - EVENT("OnDCCChatWindowClosing","$0 = DCC session ID"), - /* - @doc: onaccelkeypressed - @type: - event - @title: - OnAccelKeyPressed - @short: - An accelerator key was pressed - @parameters: - $0 = keys - @window: - Active window - @description: - An accelerator key has been pressed by the user.[br] - The key sequence that the user has pressed is passed in $0 as a - human readable string.[br] - The keys that actually work with KVIrc are:[br] - F2 to F12, F1 to F12 with SHIFT key pressed, 0 to 9 with CTRL key pressed.[br] - This means that you can set up 33 "quick" aliases...that's really more than - an user can remember.[br] - If you need more keys , mail me , I'll see what I can do :)[br] - */ - EVENT("OnAccelKeyPressed", "$0 = keys"), - /* - @doc: onhighlight - @type: - event - @title: - OnHighlight - @short: - A channel or query message is going to be highlighted - @parameters: - $0 = talker nick - $1 = target username - $2 = target hostname - $3 = message - $4 = highlight word - $5 = message type - $6 = is action - @window: - Channel or query window - @description: - A channel or query message is going to be highlighted.[br] - The message may be either a PRIVMSG, a NOTICE or a CTCP ACTION.[br] - The highlight may be either caused by a "highlight word" or by your own nickname - (if that option was specified).[br] - $5 contains the original color/icon set of the message that depends on - the type of the message itself.[br] - Since the CTCP ACTION messages generally have different format of output - then for your convenience $6 contains 1 if the message was caused by a - CTCP ACTION and 0 otherwise.[br] - If you call [cmd]halt[/cmd] in this event the message output will be completely disabled - (thus, KVIrc assumes that YOU have provided the necessary output and feedback to the user).[br] - A common error here is to call halt and re-echo the unmodified output; [b]this - can cause another OnHighlight event to be triggered and create an infinite loop![/b]. - [cmd]echoprivmsg[/cmd] [b]-n[/b] is the command you probably want. - */ - EVENT("OnHighlight", "$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = message\n$4 = highlight word"), - /* - @doc: onwindowactivated - @type: - event - @title: - OnWindowActivated - @short: - A window has just been activated - @parameters: - none - @window: - Any window - @description: - This event is triggered when a KVIrc MDI window gets activated.[br] - This might be a good place to update your toolbar button status (for example).[br] - */ - EVENT("OnWindowActivated",""), - /* - @doc: onnotifyonline - @type: - event - @title: - OnNotifyOnline - @short: - An user in the notify list is on-line - @parameters: - $0 = nickname - @window: - Console or active window of the IRC context - @description: - This event is triggered when one of the users in your [doc:notify_list]notify[/doc] lists - is detected to be ON-Line.[br] - The event is triggered in the console window or the active window of the IRC context depending - on the user options.[br] - (Note: If you call [cmd]halt[/cmd] in this event , you will stop the "Nick is on irc" output, - but this is rather a bad idea since KVIrc gives a lot of additional informations to the - user with some notify-methods).[br] - This is a good place to play a sound or attract the user attention in some other way.[br] - - */ - EVENT("OnNotifyOnline","$0 = nickname"), - /* - @doc: onnotifyoffline - @type: - event - @title: - OnNotifyOffline - @short: - An user in the notify list went off-line - @parameters: - $0 = nickname - @window: - Console or active window of the IRC context - @description: - This event is triggered when one of the users in your [doc:notify_list]notify[/doc] lists - has just left IRC.[br] - The event is triggered in the console window or the active window of the IRC context depending - on the user options.[br] - (Note: If you call [cmd]halt[/cmd] in this event , you will stop the "Nick has left irc" output, - but this is rather a bad idea since KVIrc gives a lot of additional informations to the - user with some notify-methods).[br] - This is a good place to play a sound or attract the user attention in some other way.[br] - */ - EVENT("OnNotifyOffline","$0 = nickname"), - /* - @doc: onpong - @type: - event - @title: - OnPong - @short: - Server pong handler - @parameters: - $0 = server - $1 = pong message parameters - @window: - Console - @description: - Triggered when a PONG message was received from a server.[br] - Calling 'halt' in this event will stop the informational message about the pong'.[br] - */ - EVENT("OnPong", "$0 = server\n$1 = pong message parameters"), - /* - @doc: onlagalarmtimeup - @type: - event - @title: - OnLagAlarmTimeUp - @short: - High-Lag Alarm Started - @parameters: - $0 = server - $1 = Lag value in miliseconds - @window: - Console - @description: - Triggered when the Lag on the server tied to this console is higher than the[br] - configured Lag-Alarm time. - */ - EVENT("OnLagAlarmTimeUp", "$0 = server\n$1 = lag time in miliseconds"), - /* - @doc: onlagalarmtimedown - @type: - event - @title: - OnLagAlarmTimeDown - @short: - High-Lag Alarm Stopped - @parameters: - $0 = server - $1 = Lag value in miliseconds - @window: - Console - @description: - Triggered when the Lag on the server tied to this console is lower than the[br] - configured Lag-Alarm time but was higher in the previous lag check. - */ - EVENT("OnLagAlarmTimeDown", "$0 = server\n$1 = lag time in miliseconds"), - /* - @doc: onlagcheck - @type: - event - @title: - OnLagCheck - @short: - The lag metering engine has checked the lag - @parameters: - $0 = server - $1 = Lag value in miliseconds - @window: - Console - @description: - Triggered when the lag metering engine calculate a new current lag.[br] - */ - EVENT("OnLagCheck", "$0 = server\n$1 = lag time in miliseconds"), - /* - @doc: onquerynotice - @type: - event - @title: - OnQueryNotice - @short: - A private notice has been received - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = message - @window: - Query window or console - @description: - Triggered when a private notice is received.[br] - If you call [cmd]halt[/cmd] in this event, the message output will be stopped - and if the message was going to cause a query window creation, the window will NOT be created.[br] - @seealso: - [event:onchannelmessage]OnChannelMessage[/event] - [event:onchannelnotice]OnChannelNotice[/event] - */ - EVENT("OnQueryNotice", "$0 = source nick\n$1 = source username\n$2 = source host\n$3 = message"), - /* - @doc: onchanservnotice - @type: - event - @title: - OnChanServNotice - @short: - A notice from ChanServ has been received - @parameters: - $0 = ChanServ nick - $1 = ChanServ username - $2 = ChanServ host - $3 = message - @window: - console - @description: - Triggered when a notice is received and the source user is recognized as - the ChanServ service.<br> - Calling [cmd]halt[/cmd] stops the message output. - @seealso: - [event:onquerynotice]OnQueryNotice[/event] - [event:onnickservnotice]OnNickServNotice[/event] - */ - EVENT("OnChanServNotice", "$0 = ChanServ nick\n$1 = ChanServ username\n$2 = ChanServ host\n$3 = message"), - /* - @doc: onnickservnotice - @type: - event - @title: - OnNickServNotice - @short: - A notice from NickServ has been received - @parameters: - $0 = NickServ nick - $1 = NickServ username - $2 = NickServ host - $3 = message - @window: - console - @description: - Triggered when a notice is received and the source user is recognized as - the NickServ service.<br> - Calling [cmd]halt[/cmd] stops the message output. - @seealso: - [event:onquerynotice]OnQueryNotice[/event] - [event:onchanservnotice]OnChanServNotice[/event] - */ - EVENT("OnNickServNotice", "$0 = NickServ nick\n$1 = NickServ username\n$2 = NickServ host\n$3 = message"), - /* - @doc: onchanadmin - @type: - event - @title: - OnChanAdmin - @short: - Someone has given a user the +a flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = target nick - @window: - Channels window - @description: - Triggered when someone sets a +a (has made Channel Administrator) flag on a user of the active channel. - @seealso: - [event:ondechanadmin]OnDeChanAdmin[/event] - */ - EVENT("OnChanAdmin","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = target nick"), - /* - @doc: ondechanadmin - @type: - event - @title: - OnDeChanAdmin - @short: - Someone has given a user the -a flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = target nick - @window: - Channels window - @description: - Triggered when someone sets a -a (DeChanAdmin) flag on a user in the active channel. - @seealso: - [event:onchanadmin]OnChanAdmin[/event] - */ - EVENT("OnDeChanAdmin","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = target nick"), - /* - @doc: onmechanadmin - @type: - event - @title: - OnMeChanAdmin - @short: - Someone has given the +a flag to the local user - @parameters: - $0 = source nick - $1 = source username - $2 = source host - @window: - Channels window - @description: - Triggered when someone sets a +a (has made Channel administrator) flag on the local user in the active channel. - @seealso: - [event:onmedeop]OnMeDeChanAdmin[/event] - */ - EVENT("OnMeChanAdmin","$0 = source nick\n$1 = source username\n$2 = source hostname"), - /* - @doc: onmedechanadmin - @type: - event - @title: - OnMeDeChanAdmin - @short: - Someone has given the -a flag to the local user - @parameters: - $0 = source nick - $1 = source username - $2 = source host - @window: - Channels window - @description: - Triggered when someone sets a -a (has removed channel admin status) flag on the local user in the active channel. - @seealso: - [event:onmeop]OnMeOp[/event] - */ - EVENT("OnMeDeChanAdmin","$0 = source nick\n$1 = source username\n$2 = source hostname"), - /* - @doc: onmeuserop - @type: - event - @title: - OnMeUserOp - @short: - Someone has given the local user the +u flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - @window: - Channels window - @description: - Triggered when someone sets a +u (userop) flag for the local user in the active channel. - @seealso: - [event:onmedeuserop]OnMeDeUserOp[/event] - */ - EVENT("OnMeUserOp","$0 = source nick\n$1 = source username\n$2 = source hostname"), - /* - @doc: onmedeuserop - @type: - event - @title: - OnMeDeUserOp - @short: - Someone has given the local user the -u flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - @window: - Channels window - @description: - Triggered when someone sets a -u (deuserop) flag for the local user in the active channel. - @seealso: - [event:onmeuserop]OnMeUserOp[/event] - */ - EVENT("OnMeDeUserOp","$0 = source nick\n$1 = source username\n$2 = source hostname"), - /* - @doc: onuserop - @type: - event - @title: - OnUserOp - @short: - Someone has given a user the +u flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = useropped nick - @window: - Channels window - @description: - Triggered when someone sets a +u flag on a user of the active channel. - @seealso: - [event:ondeuserop]OnDeUserOp[/event] - */ - EVENT("OnUserOp","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = useropped nick"), - /* - @doc: ondeuserop - @type: - event - @title: - OnDeUserOp - @short: - Someone has given a user a -u flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = deuseropped nick - @window: - Channels window - @description: - Triggered when someone sets a -u (deuserop) flag on a user in the active channel. - @seealso: - [event:onuserop]OnUserOp[/event] - */ - EVENT("OnDeUserOp","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = deuseropped nick"), - /* - @doc: onquerywindowrequest - @type: - event - @title: - OnQueryWindowRequest - @short: - A new query window is going to be opened because a remote message has been received - @parameters: - $0 = source nickname - $1 = source username - $2 = source host - $3 = message - @window: - console window - @description: - Triggered when a PRIVMSG or NOTICE has been received from a remote user and a query - for that user doesn't exist yet. KVIrc has already checked its internal conditions - and you have the last word on the query creation. If you call halt in this event - you will prevent the creation of the query window, in all other cases the window - will be created. This is useful for filtering out spam messages that popup unwanted - windows in front of the user. You have also the option of creating the query window - yourself (by calling [cmd]query[/cmd]). This may be useful if you want to create - the query windows in a particular state (minimized, positioned in some special place - or maybe undocked if some conditions are verified). - The next event you will catch related to this query window will be - [event:onquerywindowcreated]OnQueryWindowCreated[/event] and [event:onquerytargetadded]OnQueryTargetAdded[/event]. - After that you will get [event:onquerymessage]OnQueryMessage[/event] with exactly - the parameters passed to this event. - */ - EVENT("OnQueryWindowRequest","$0 = source nick\n$1 = source user\n$2 = source host\n$3 = message"), - /* - @doc: onquerytargetadded - @type: - event - @title: - OnQueryTargetAdded - @short: - A new query target has been added - @parameters: - $0 = nickname - $1 = username (may be *) - $2 = host (may be *) - @window: - query window - @description: - Triggered when a new remote target has been added to a query window. - This is the event to catch when you want to perform some specific actions - when someone queries you. - KVIrc supports multiple target queries and thus, this event is triggered also - when a new query target is added by using [cmd]addtarget[/cmd].[br] - */ - EVENT("OnQueryTargetAdded","$0 = nick\n$1 = username (may be *)\n$2 = hostname (may be *)"), - /* - @doc: onnetsplit - @type: - event - @title: - OnNetsplit - @short: - A netsplit has been detected - @parameters: - $0 = server1 - $1 = server2 - @window: - console - @description: - Triggered when KVIrc detects a netsplit by looking at an user's quit message. - The two parameters passed are the two servers that lost the link and were - signaled in that particular quit message.[br] - The actual netsplit detector in the KVIrc core uses the following rule - (extracted from the eggdrop bot code): "determine if signoff string matches "%.% %.%", - and only one space".[br] - [b]Note that this may be not accurate and KVIrc CAN be fooled by specially - formatted quit messages that aren't really netsplits.[/b][br] - KVIrc tries to avoid duplicate netsplit warnings thus this event will NOT - be triggered for EVERY quit in a netsplit: you will get it once for every - different set of servers that lost the link.[br] - Determining where the network link has been exactly broken may be a hard - task since the quit messages you see may not involve - the servers on the split boundary. - */ - EVENT("OnNetsplit","$0 = server1\n$1 = server2"), - /* - @doc: ondccsessioncreated - @type: - event - @title: - OnDCCSessionCreated - @short: - A new DCC session has just been created - @parameters: - $0 = DCC session ID - @window: - console - @description: - Triggered when a new DCC session has just been created. - You can retrieve the session information by calling the [module:dcc]dcc[/module].* - module functions. - */ - EVENT("OnDCCSessionCreated","$0 = DCC session ID"), - /* - @doc: ondccsessiondestroyed - @type: - event - @title: - OnDCCSessionDestroyed - @short: - A new DCC session has just been destroyed - @parameters: - $0 = DCC session ID - @window: - console - @description: - Triggered when a new DCC session has just been destroyed. - You can retrieve the session information by calling the [module:dcc]dcc[/module].* - module functions and by passing the DCC session ID parameter. - */ - EVENT("OnDCCSessionDestroyed","$0 = DCC session ID"), - /* - @doc: ontextinput - @type: - event - @title: - OnTextInput - @short: - The user has just entered some text in the text input - @parameters: - $0 = text - @window: - window in that the text is entered - @description: - Triggered when the user enters some text in the text input - window and presses return. - Calling [cmd]halt[/cmd] will stop the automatic text processing - and the result depends on the window the text is typed in. - In channel/query and console windows the text will NOT be sent to - the IRC server. This event might be useful for performing - substitutions in the text sent to the server. If you stop the - text processing in a channel or query window then the local - echo of the message will be omitted too. You might want to - realize the echo by the means of the [cmd]echoprivmsg[/cmd] command. - This event is NOT triggered when the user enters a command - in the input window. - @seealso: - [cmd]echoprivmsg[/cmd] - */ - EVENT("OnTextInput","$0 = text"), - /* - @doc: ondccchatpopuprequest - @type: - event - @title: - OnDCCChatPopupRequest - @short: - Triggered when the DCC chat text view is right-clicked - @parameters: - $0 = DCC session ID - @window: - DCC Chat window - @description: - This event is triggered when the user clicks the DCC chat - text view with the right mouse button. It is a good place - to activate a [cmd]popup[/cmd] menu :) - You can retrieve the session information by calling the [module:dcc]dcc[/module].* - module functions and by passing the DCC session ID parameter. - @seealso: - [event:onconsolepuprequest]OnConsolePopupRequest[/event], - [event:onchannelpopuprequest]OnChannelPopupRequest[/event], - [event:onquerypopuprequest]OnQueryPopupRequest[/event] - */ - EVENT("OnDCCChatPopupRequest","$0 = DCC session ID"), - /* - @doc: ondccfiletransferconnectioninprogress - @type: - event - @title: - OnDCCFileTransferConnectionInProgress - @short: - Triggered when a DCC File transfer is waiting for a connection - @parameters: - $0 = DCC session ID - @window: - unspecified - @description: - Triggered when a DCC File transfer has been set up and - is waiting for the connection to be established.[br] - Note that the real data transfer is not started until - [event:ondccfiletransferbegin]OnDCCFileTransferBegin[/event] is triggered - but from this moment on you will be notified of success - or failure by the means of [event:ondccfiletransfersuccess]OnDCCFileTransferSuccess[/event] - or [event:ondccfiletransferfailed]OnDCCFileTransferFailed[/event].[br] - You can retrieve the session information by calling the [module:dcc]dcc[/module].* - module functions and by passing the DCC session ID parameter. - @seealso: - [event:ondccfiletransferfailed]OnDCCFileTransferFailed[/event], - [event:ondccfiletransfersuccess]OnDCCFileTransferSuccess[/event], - [event:ondccfiletransferbegin]OnDCCFileTransferBegin[/event] - */ - EVENT("OnDCCFileTransferConnectionInProgress","$0 = DCC session ID"), - /* - @doc: ondccfiletransferbegin - @type: - event - @title: - OnDCCFileTransferBegin - @short: - Triggered when a DCC File transfer begins - @parameters: - $0 = DCC session ID - @window: - unspecified - @description: - Triggered when a DCC file transfer connection is established - and the real data transfer starts.[br] - You can retrieve the session information by calling the [module:dcc]dcc[/module].* - module functions and by passing the DCC session ID parameter. - @seealso: - [event:ondccfiletransferconnectioninprogress]OnDCCFileTransferConnectionInProgress[/event], - [event:ondccfiletransfersuccess]OnDCCFileTransferSuccess[/event], - [event:ondccfiletransferfailed]OnDCCFileTransferFailed[/event] - */ - EVENT("OnDCCFileTransferBegin","$0 = DCC session ID"), - /* - @doc: ondccfiletransfersuccess - @type: - event - @title: - OnDCCFileTransferSuccess - @short: - Triggered when a DCC File transfer succeeds - @parameters: - $0 = bytes transferred - $1 = DCC session ID - @window: - unspecified - @description: - Triggered when a DCC File transfer terminates succesfully.[br] - $0 contains the number of bytes transferred in the session.[br] - You can retrieve the session information by calling the [module:dcc]dcc[/module].* - module functions and by passing the DCC session ID parameter. - @seealso: - [event:ondccfiletransferconnectioninprogress]OnDCCFileTransferConnectionInProgress[/event], - [event:ondccfiletransferfailed]OnDCCFileTransferFailed[/event], - [event:ondccfiletransferbegin]OnDCCFileTransferBegin[/event] - */ - EVENT("OnDCCFileTransferSuccess","$0 = bytes transferred\n$1 = DCC session ID"), - /* - @doc: ondccfiletransferfailed - @type: - event - @title: - OnDCCFileTransferFailed - @short: - Triggered when a DCC File transfer fails - @parameters: - $0 = failure reason message - $1 = bytes transferred - $2 = DCC session ID - @window: - unspecified - @description: - Triggered when a DCC File transfer fails. $0 contains a message - explaining the reason of the failure.[br] - $1 contains the number of bytes transferred in the session, eventually 0.[br] - You can retrieve the session information by calling the [module:dcc]dcc[/module].* - module functions and by passing the DCC session ID parameter. - @seealso: - [event:ondccfiletransferconnectioninprogress]OnDCCFileTransferConnectionInProgress[/event], - [event:ondccfiletransfersuccess]OnDCCFileTransferSuccess[/event], - [event:ondccfiletransferbegin]OnDCCFileTransferBegin[/event] - */ - EVENT("OnDCCFileTransferFailed","$0 = failure reason\n$1 = bytes transferred\n$2 = DCC session ID"), - /* - @doc: onwallops - @type: - event - @title: - OnWallops - @short: - Triggered when a WALLOPS message is received from the server - @parameters: - $0 = source nick - $1 = source user - $2 = source host - $3 = message text - @window: - channel - @description: - Triggered when a WALLOPS message is received from the server. - If you call [cmd]halt[/cmd] the message output will be stopped. - @seealso: - */ - EVENT("OnWallops","$0 = nick\n$1 = user\n$2 = host\n$3 = message text"), - /* - @doc: ondisconnectrequest - @type: - event - @title: - OnDisconnectRequest - @short: - Triggered when the user requests a disconnection - @parameters: - none - @window: - console - @description: - Triggered when the user requests a disconnection from - a server by pressing the "disconnect", by closing - the console or closing KVIrc. It is your last chance - to send some meaningful data to the server before the QUIT message - is sent. You can't prevent the user from disconnecting: [cmd]halt [/cmd]does nothing here.[br] - This event is useful to either give a salute to all the users - you were talking with or maybe to send some commands to the - bouncer you're connected to. Note that you can override the QUIT - message sent by KVIrc by sending it by youself first.[br] - @seealso: - */ - EVENT("OnDisconnectRequest","none"), - /* - @doc: onchanowner - @type: - event - @title: - OnChanOwner - @short: - Someone has given a user the +q flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = target nick - @window: - Channels window - @description: - Triggered when someone sets a +q (has made Channel Owner) flag on a user of the active channel. - @seealso: - [event:ondechanowner]OnDeChanOwner[/event] - */ - EVENT("OnChanOwner","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = target nick"), - /* - @doc: ondechanowner - @type: - event - @title: - OnDeChanOwner - @short: - Someone has given a user the -q flag - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = target nick - @window: - Channels window - @description: - Triggered when someone sets a -q (DeChanOwner) flag on a user in the active channel. - @seealso: - [event:onchanowner]OnChanOwner[/event] - */ - EVENT("OnDeChanOwner","$0 = source nick\n$1 = source username\n$2 = source hostname\n$3 = target nick"), - /* - @doc: onmechanowner - @type: - event - @title: - OnMeChanOwner - @short: - Someone has given the +q flag to the local user - @parameters: - $0 = source nick - $1 = source username - $2 = source host - @window: - Channels window - @description: - Triggered when someone sets a +q (has made Channel owner) flag on the local user in the active channel. - @seealso: - [event:onmedechanowner]OnMeDeChanOwner[/event] - */ - EVENT("OnMeChanOwner","$0 = source nick\n$1 = source username\n$2 = source hostname"), - /* - @doc: onmedechanowner - @type: - event - @title: - OnMeDeChanOwner - @short: - Someone has given the -q flag to the local user - @parameters: - $0 = source nick - $1 = source username - $2 = source host - @window: - Channels window - @description: - Triggered when someone sets a -q (has removed channel owner status) flag on the local user in the active channel. - @seealso: - [event:onmechanowner]OnMeChanOwner[/event] - */ - EVENT("OnMeDeChanOwner","$0 = source nick\n$1 = source username\n$2 = source hostname"), - /* - @doc: onerror - @type: - event - @title: - OnError - @short: - Server ERROR message received - @parameters: - $0 = message source - $1 = error reason - @window: - Console - @description: - Triggered when an ERROR message is received from the server.[br] - $0 is the message (server) source but be aware that it often happens to be empty.[br] - Calling 'halt' in this event will stop the default output.[br] - */ - EVENT("OnError","$0 = message source\n$1 = error reason"), - /* - @doc: OnQueryFileDropped - @type: - event - @title: - OnQueryFileDropped - @short: - Drop in query - @parameters: - $0 = source nick - $1 = filedropped - @window: - Query - @description: - Triggered when a file is dropped in a query window.[br] - $target is the nick.[br] - $0 is the dropped file.[br] - */ - EVENT("OnQueryFileDropped","$0 = nick\n$1 = filedropped"), //-|Grifisx & Noldor|- - /* - @doc: OnHTTPGetTerminated - @type: - event - @title: - OnHTTPGetTerminated - @short: - A http.get command has terminated execution - @parameters: - $0 = status - $1 = remote url - $2 = local file - $3 = magic identifier - @window: - Console - @description: - Triggered when a [cmd]http.get[/cmd] file download has terminated execution. - If the transfer has been succesfull then $0 will contain the value 1 (true), - otherwise will contain the value 0. $1 contains the remote url and $2 the local - path on disk of the saved file. $3 contains the magic identifier passed to - the http.get command by the means of the -i switch. - */ - EVENT("OnHTTPGetTerminated","$0 = status\n$1 = remote url\n$2 = local file\n$3 = magic identifier"), - /* - @doc: OnChannelModeChange - @type: - event - @title: - OnChannelModeChange - @short: - The channel mode has been changed - @parameters: - $0 = source nick - $1 = source user - $2 = source host - $3 = modeflags - $4 = mode parameter string - @window: - channel - @description: - Triggered when a channel mode has been changed, AFTER all the mode specific events - were triggered. $3 contains the unparsed mode flags (-o+b...) and $4 contains - the unparsed mode parameter string (you need to split it!). - */ - EVENT("OnChannelModeChange","$0 = sourcenick\n$1 = sourceusername\n$2 = sourcehost\n$3 = modeflags\n$4 = mode params"), - /* - @doc: OnChannelNickLinkClick - @type: - event - @title: - OnChannelNickLinkClick - @short: - Clicked on nick in channel - @parameters: - $0 = nick list - @window: - channel - @description: - Triggered when user clicks on nickname in channel window - It will be triggered only at the left mouse button click - */ - EVENT("OnChannelNickLinkClick",""), - /* - @doc: OnQueryNickLinkClick - @type: - event - @title: - OnQueryNickLinkClick - @short: - Triggered when user clicks on nickname in query window - @parameters: - $0 = nickname list - @window: - query - @description: - Triggered when user clicks on nickname in query window - It will be triggered only at the left mouse button click - */ - EVENT("OnQueryNickLinkClick","$0 = nickname list"), - /* - @doc: OnConsoleNickLinkClick - @type: - event - @title: - OnConsoleNickLinkClick - @short: - Triggered when user clicks on nickname in console window - @parameters: - $0 = nickname - @window: - console - @description: - Triggered when user clicks on nickname in console window - It will be triggered only at the left mouse button click - */ - EVENT("OnConsoleNickLinkClick","$0 = nickname"), - /* - @doc: OnHostLinkClick - @type: - event - @title: - OnHostLinkClick - @short: - Triggered when user clicks on any hostname in any window - @parameters: - $0 = host name - @window: - any - @description: - Triggered when user clicks on any hostname in any window - It will be triggered only at the left mouse button click - */ - EVENT("OnHostLinkClick","$0 = host name") - , /* - @doc: OnUrlLinkClick - @type: - event - @title: - OnUrlLinkClick - @short: - Triggered when user clicks on any URL link in any window - @parameters: - $0 = url - @window: - any - @description: - Triggered when user clicks on any URL link in any window - It will be triggered only at the left mouse button click - */ - EVENT("OnUrlLinkClick","$0 = url"), - /* - @doc: OnChannelLinkClick - @type: - event - @title: - OnChannelLinkClick - @short: - Triggered when user clicks on any channel name in any window - @parameters: - $0 = channel name - @window: - any - @description: - Triggered when user clicks on any channel name in any window - It will be triggered only at the left mouse button click - */ - EVENT("OnChannelLinkClick","$0 = channel name"), - /* - @doc: OnServerLinkClick - @type: - event - @title: - OnServerLinkClick - @short: - Triggered when user clicks on server name in any window - @parameters: - $0 = server name - @window: - any - @description: - Triggered when user clicks on server name in any window - It will be triggered only at the left mouse button click - */ - EVENT("OnServerLinkClick","$0 = server name"), - /* - @doc: OnIgnoredMessage - @type: - event - @title: - OnIgnoredMessage - @short: - Triggered when a message is ignored. - @parameters: - $0 = source nick - $1 = source username - $2 = source host - $3 = message target - $4 = message - @window: - any - @description: - Triggered when a message is ignored. - */ - EVENT("OnIgnoredMessage","$0 = source nick\n$1 = source username\n$2 = source host\n$3 = message target\n$4 = message"), - /* - @doc: OnNickServAuth - @type: - event - @title: - OnNickServAuth - @short: - Triggered when ircd sets a registered user mode. - @parameters: - @window: - any - @description: - Triggered when ircd sets a registered user mode. - */ - EVENT("OnNickServAuth",""), - /* - @doc: onmeaction - @type: - event - @title: - OnMeAction - @short: - User issued a CTCP ACTION - @parameters: - $0 = action message text - @window: - Channels and query windows - @description: - This event is triggered when user issues a CTCP ACTION.[br] - (The CTCP ACTION is usually triggered by the /me command).[br] - */ - - EVENT("OnMeAction","$0 = action message text") -}; - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_eventtable.h b/3.4.0/src/kvirc/kvs/kvi_kvs_eventtable.h deleted file mode 100644 index 05d1b0db5f..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_eventtable.h +++ /dev/null @@ -1,212 +0,0 @@ -#ifndef _KVI_KVS_EVENTTABLE_H_ -#define _KVI_KVS_EVENTTABLE_H_ -//============================================================================= -// -// File : kvi_kvs_eventtable.h -// Created on Mon 23 Feb 2004 03:23:18 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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. -// -//============================================================================= - -// Application -#define KviEvent_OnKVIrcStartup 0 -#define KviEvent_OnKVIrcShutdown 1 -// Irc Context -#define KviEvent_OnIrcContextCreated 2 -#define KviEvent_OnIrcContextDestroyed 3 -// Irc connection -#define KviEvent_OnIrcConnectionEstabilished 4 -#define KviEvent_OnIrcConnectionTerminated 5 -// Login complete -#define KviEvent_OnIrc 6 -// Channel userlist clicks -#define KviEvent_OnChannelNickPopupRequest 7 -#define KviEvent_OnChannelNickDefaultActionRequest 8 -// Frame window -#define KviEvent_OnFrameWindowCreated 9 -#define KviEvent_OnFrameWindowDestroyed 10 -// Text view -#define KviEvent_OnChannelPopupRequest 11 -#define KviEvent_OnConsolePopupRequest 12 -#define KviEvent_OnQueryPopupRequest 13 - -#define KviEvent_OnChannelSync 14 - -#define KviEvent_OnUrl 15 - -#define KviEvent_OnWindowPopupRequest 16 - -#define KviEvent_OnHostLinkPopupRequest 17 -#define KviEvent_OnUrlLinkPopupRequest 18 -#define KviEvent_OnServerLinkPopupRequest 19 -#define KviEvent_OnChannelLinkPopupRequest 20 -#define KviEvent_OnNickLinkPopupRequest 21 -// Query nick clicks -#define KviEvent_OnQueryNickPopupRequest 22 -#define KviEvent_OnQueryNickDefaultActionRequest 23 - -#define KviEvent_OnNickLinkDefaultActionRequest 24 -#define KviEvent_OnTextViewDoubleClicked 25 - -#define KviEvent_OnNotifyListDefaultActionRequest 26 -#define KviEvent_OnNotifyListPopupRequest 27 - -#define KviEvent_OnPing 28 - -#define KviEvent_OnMeJoin 29 -#define KviEvent_OnJoin 30 - -#define KviEvent_OnTopic 31 - -#define KviEvent_OnMePart 32 -#define KviEvent_OnPart 33 - -#define KviEvent_OnQuit 34 - -#define KviEvent_OnUserMode 35 - -#define KviEvent_OnMeKick 36 -#define KviEvent_OnKick 37 - -#define KviEvent_OnMeAway 38 -#define KviEvent_OnMeBack 39 - -#define KviEvent_OnChannelWindowCreated 40 -#define KviEvent_OnQueryWindowCreated 41 -#define KviEvent_OnBan 42 -#define KviEvent_OnUnban 43 -#define KviEvent_OnMeBan 44 -#define KviEvent_OnMeUnban 45 -#define KviEvent_OnBanException 46 -#define KviEvent_OnBanExceptionRemove 47 -#define KviEvent_OnMeBanException 48 -#define KviEvent_OnMeBanExceptionRemove 49 -#define KviEvent_OnOp 50 -#define KviEvent_OnDeOp 51 -#define KviEvent_OnMeOp 52 -#define KviEvent_OnMeDeOp 53 -#define KviEvent_OnLimitSet 54 -#define KviEvent_OnLimitUnset 55 -#define KviEvent_OnKeySet 56 -#define KviEvent_OnKeyUnset 57 -#define KviEvent_OnInvite 58 -#define KviEvent_OnChannelMessage 59 -#define KviEvent_OnQueryMessage 60 -#define KviEvent_OnVoice 61 -#define KviEvent_OnDeVoice 62 -#define KviEvent_OnMeVoice 63 -#define KviEvent_OnMeDeVoice 64 -#define KviEvent_OnNickChange 65 -#define KviEvent_OnMeNickChange 66 -#define KviEvent_OnCtcpRequest 67 -#define KviEvent_OnCtcpReply 68 -#define KviEvent_OnUnhandledLiteral 69 -#define KviEvent_OnMeHalfOp 70 -#define KviEvent_OnMeDeHalfOp 71 -#define KviEvent_OnHalfOp 72 -#define KviEvent_OnDeHalfOp 73 -#define KviEvent_OnInviteException 74 -#define KviEvent_OnInviteExceptionRemove 75 -#define KviEvent_OnMeInviteException 76 -#define KviEvent_OnMeInviteExceptionRemove 77 -#define KviEvent_OnAction 78 -#define KviEvent_OnCtcpFlood 79 -#define KviEvent_OnChannelNotice 80 -#define KviEvent_OnServerNotice 81 -#define KviEvent_OnDCCChatWindowCreated 82 -#define KviEvent_OnDCCChatConnectionInProgress 83 -#define KviEvent_OnDCCChatConnected 84 -#define KviEvent_OnDCCChatMessage 85 -#define KviEvent_OnDCCChatError 86 -#define KviEvent_OnDCCChatDisconnected 87 -#define KviEvent_OnDCCChatWindowClosing 88 -#define KviEvent_OnAccelKeyPressed 89 -#define KviEvent_OnHighlight 90 -#define KviEvent_OnWindowActivated 91 -#define KviEvent_OnNotifyOnLine 92 -#define KviEvent_OnNotifyOffLine 93 -#define KviEvent_OnPong 94 -#define KviEvent_OnLagAlarmTimeUp 95 -#define KviEvent_OnLagAlarmTimeDown 96 -#define KviEvent_OnLagCheck 97 - -#define KviEvent_OnQueryNotice 98 -#define KviEvent_OnChanServNotice 99 -#define KviEvent_OnNickServNotice 100 - -#define KviEvent_OnChanAdmin 101 -#define KviEvent_OnDeChanAdmin 102 -#define KviEvent_OnMeChanAdmin 103 -#define KviEvent_OnMeDeChanAdmin 104 - -#define KviEvent_OnMeUserOp 105 -#define KviEvent_OnMeDeUserOp 106 -#define KviEvent_OnUserOp 107 -#define KviEvent_OnDeUserOp 108 - -#define KviEvent_OnQueryWindowRequest 109 -#define KviEvent_OnQueryTargetAdded 110 - -#define KviEvent_OnNetsplit 111 - -#define KviEvent_OnDCCSessionCreated 112 -#define KviEvent_OnDCCSessionDestroyed 113 - -#define KviEvent_OnTextInput 114 - -#define KviEvent_OnDCCChatPopupRequest 115 - -#define KviEvent_OnDCCFileTransferConnectionInProgress 116 -#define KviEvent_OnDCCFileTransferBegin 117 -#define KviEvent_OnDCCFileTransferSuccess 118 -#define KviEvent_OnDCCFileTransferFailed 119 - -#define KviEvent_OnWallops 120 - -#define KviEvent_OnDisconnectRequest 121 - -#define KviEvent_OnChanOwner 122 -#define KviEvent_OnDeChanOwner 123 -#define KviEvent_OnMeChanOwner 124 -#define KviEvent_OnMeDeChanOwner 125 -#define KviEvent_OnError 126 -#define KviEvent_OnQueryFileDropped 127 - -#define KviEvent_OnHTTPGetTerminated 128 - -#define KviEvent_OnChannelModeChange 129 - -#define KviEvent_OnChannelNickLinkClick 130 -#define KviEvent_OnQueryNickLinkClick 131 -#define KviEvent_OnConsoleNickLinkClick 132 -#define KviEvent_OnHostLinkClick 133 -#define KviEvent_OnUrlLinkClick 134 -#define KviEvent_OnChannelLinkClick 135 -#define KviEvent_OnServerLinkClick 136 -#define KviEvent_OnIgnoredMessage 137 - -#define KviEvent_OnNickServAuth 138 - -#define KviEvent_OnMeAction 139 - -#define KVI_KVS_NUM_APP_EVENTS 140 -// compat -#define KVI_NUM_SCRIPT_EVENTS KVI_KVS_NUM_APP_EVENTS - -#endif //!_KVI_KVS_EVENTTABLE_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_eventtriggers.h b/3.4.0/src/kvirc/kvs/kvi_kvs_eventtriggers.h deleted file mode 100644 index 47b4756983..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_eventtriggers.h +++ /dev/null @@ -1,289 +0,0 @@ -#ifndef _KVI_KVS_EVENTTRIGGERS_H_ -#define _KVI_KVS_EVENTTRIGGERS_H_ -//============================================================================= -// -// File : kvi_kvs_eventtriggers.h -// Created on Thu Oct 22 2005 04:57:12 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_kvs_eventtable.h" -#include "kvi_kvs_eventmanager.h" -#include "kvi_kvs_variantlist.h" - -// -// KVS Macros for triggering events -// -// KviKvsVariantList vParams; -// vParams.append(bSomething); -// vParams.append(iSomething); -// vParams.append(szSomething); -// KVS_TRIGGER_EVENT(KviEvent_OnSomething,pSomeWindow,&vParams) -// -// if(KVS_TRIGGER_EVENT_HALTED(KviEvent_OnSomething,pSomeWindow,&vParams)) -// msg->haltOutput() -// -// - -// THESE TWO ARE SLOW, but allow reusing the params -#define KVS_TRIGGER_EVENT(__idx,__wnd,__parms) \ - if(KviKvsEventManager::instance()->hasAppHandlers(__idx)) \ - KviKvsEventManager::instance()->trigger(__idx,__wnd,__parms); - -#define KVS_TRIGGER_EVENT_HALTED(__idx,__wnd,__parms) \ - (KviKvsEventManager::instance()->hasAppHandlers(__idx) ? \ - KviKvsEventManager::instance()->trigger(__idx,__wnd,__parms) : false) - - -// FAST CALLING MACROS -#define KVS_TRIGGER_EVENT_0(__idx,__wnd) \ - if(KviKvsEventManager::instance()->hasAppHandlers(__idx)) \ - { \ - KviKvsVariantList _vLocalParamList; \ - KviKvsEventManager::instance()->trigger(__idx,__wnd,&_vLocalParamList); \ - } - -#define KVS_TRIGGER_EVENT_1(__idx,__wnd,__param1) \ - if(KviKvsEventManager::instance()->hasAppHandlers(__idx)) \ - { \ - KviKvsVariantList _vLocalParamList( \ - new KviKvsVariant(__param1) \ - ); \ - KviKvsEventManager::instance()->trigger(__idx,__wnd,&_vLocalParamList); \ - } - -#define KVS_TRIGGER_EVENT_2(__idx,__wnd,__param1,__param2) \ - if(KviKvsEventManager::instance()->hasAppHandlers(__idx)) \ - { \ - KviKvsVariantList _vLocalParamList( \ - new KviKvsVariant(__param1), \ - new KviKvsVariant(__param2) \ - ); \ - KviKvsEventManager::instance()->trigger(__idx,__wnd,&_vLocalParamList); \ - } - -#define KVS_TRIGGER_EVENT_3(__idx,__wnd,__param1,__param2,__param3) \ - if(KviKvsEventManager::instance()->hasAppHandlers(__idx)) \ - { \ - KviKvsVariantList _vLocalParamList( \ - new KviKvsVariant(__param1), \ - new KviKvsVariant(__param2), \ - new KviKvsVariant(__param3) \ - ); \ - KviKvsEventManager::instance()->trigger(__idx,__wnd,&_vLocalParamList); \ - } - -#define KVS_TRIGGER_EVENT_4(__idx,__wnd,__param1,__param2,__param3,__param4) \ - if(KviKvsEventManager::instance()->hasAppHandlers(__idx)) \ - { \ - KviKvsVariantList _vLocalParamList( \ - new KviKvsVariant(__param1), \ - new KviKvsVariant(__param2), \ - new KviKvsVariant(__param3), \ - new KviKvsVariant(__param4) \ - ); \ - KviKvsEventManager::instance()->trigger(__idx,__wnd,&_vLocalParamList); \ - } - -#define KVS_TRIGGER_EVENT_5(__idx,__wnd,__param1,__param2,__param3,__param4,__param5) \ - if(KviKvsEventManager::instance()->hasAppHandlers(__idx)) \ - { \ - KviKvsVariantList _vLocalParamList( \ - new KviKvsVariant(__param1), \ - new KviKvsVariant(__param2), \ - new KviKvsVariant(__param3), \ - new KviKvsVariant(__param4), \ - new KviKvsVariant(__param5) \ - ); \ - KviKvsEventManager::instance()->trigger(__idx,__wnd,&_vLocalParamList); \ - } - -#define KVS_TRIGGER_EVENT_6(__idx,__wnd,__param1,__param2,__param3,__param4,__param5,__param6) \ - if(KviKvsEventManager::instance()->hasAppHandlers(__idx)) \ - { \ - KviKvsVariantList _vLocalParamList( \ - new KviKvsVariant(__param1), \ - new KviKvsVariant(__param2), \ - new KviKvsVariant(__param3), \ - new KviKvsVariant(__param4), \ - new KviKvsVariant(__param5), \ - new KviKvsVariant(__param6) \ - ); \ - KviKvsEventManager::instance()->trigger(__idx,__wnd,&_vLocalParamList); \ - } - -#define KVS_TRIGGER_EVENT_7(__idx,__wnd,__param1,__param2,__param3,__param4,__param5,__param6,__param7) \ - if(KviKvsEventManager::instance()->hasAppHandlers(__idx)) \ - { \ - KviKvsVariantList _vLocalParamList( \ - new KviKvsVariant(__param1), \ - new KviKvsVariant(__param2), \ - new KviKvsVariant(__param3), \ - new KviKvsVariant(__param4), \ - new KviKvsVariant(__param5), \ - new KviKvsVariant(__param6), \ - new KviKvsVariant(__param7) \ - ); \ - KviKvsEventManager::instance()->trigger(__idx,__wnd,&_vLocalParamList); \ - } - - -#define KVS_TRIGGER_EVENT_0_HALTED(__idx,__wnd) \ - ( \ - KviKvsEventManager::instance()->hasAppHandlers(__idx) \ - ? \ - KviKvsEventManager::instance()->triggerDeleteParams( \ - __idx, \ - __wnd, \ - new KviKvsVariantList() \ - ) \ - : \ - false \ - ) - -#define KVS_TRIGGER_EVENT_1_HALTED(__idx,__wnd,__param1) \ - ( \ - KviKvsEventManager::instance()->hasAppHandlers(__idx) \ - ? \ - KviKvsEventManager::instance()->triggerDeleteParams( \ - __idx, \ - __wnd, \ - new KviKvsVariantList( \ - new KviKvsVariant(__param1) \ - ) \ - ) \ - : \ - false \ - ) - -#define KVS_TRIGGER_EVENT_2_HALTED(__idx,__wnd,__param1,__param2) \ - ( \ - KviKvsEventManager::instance()->hasAppHandlers(__idx) \ - ? \ - KviKvsEventManager::instance()->triggerDeleteParams( \ - __idx, \ - __wnd, \ - new KviKvsVariantList( \ - new KviKvsVariant(__param1), \ - new KviKvsVariant(__param2) \ - ) \ - ) \ - : \ - false \ - ) - -#define KVS_TRIGGER_EVENT_3_HALTED(__idx,__wnd,__param1,__param2,__param3) \ - ( \ - KviKvsEventManager::instance()->hasAppHandlers(__idx) \ - ? \ - KviKvsEventManager::instance()->triggerDeleteParams( \ - __idx, \ - __wnd, \ - new KviKvsVariantList( \ - new KviKvsVariant(__param1), \ - new KviKvsVariant(__param2), \ - new KviKvsVariant(__param3) \ - ) \ - ) \ - : \ - false \ - ) - -#define KVS_TRIGGER_EVENT_4_HALTED(__idx,__wnd,__param1,__param2,__param3,__param4) \ - ( \ - KviKvsEventManager::instance()->hasAppHandlers(__idx) \ - ? \ - KviKvsEventManager::instance()->triggerDeleteParams( \ - __idx, \ - __wnd, \ - new KviKvsVariantList( \ - new KviKvsVariant(__param1), \ - new KviKvsVariant(__param2), \ - new KviKvsVariant(__param3), \ - new KviKvsVariant(__param4) \ - ) \ - ) \ - : \ - false \ - ) - -#define KVS_TRIGGER_EVENT_5_HALTED(__idx,__wnd,__param1,__param2,__param3,__param4,__param5) \ - ( \ - KviKvsEventManager::instance()->hasAppHandlers(__idx) \ - ? \ - KviKvsEventManager::instance()->triggerDeleteParams( \ - __idx, \ - __wnd, \ - new KviKvsVariantList( \ - new KviKvsVariant(__param1), \ - new KviKvsVariant(__param2), \ - new KviKvsVariant(__param3), \ - new KviKvsVariant(__param4), \ - new KviKvsVariant(__param5) \ - ) \ - ) \ - : \ - false \ - ) - -#define KVS_TRIGGER_EVENT_6_HALTED(__idx,__wnd,__param1,__param2,__param3,__param4,__param5,__param6) \ - ( \ - KviKvsEventManager::instance()->hasAppHandlers(__idx) \ - ? \ - KviKvsEventManager::instance()->triggerDeleteParams( \ - __idx, \ - __wnd, \ - new KviKvsVariantList( \ - new KviKvsVariant(__param1), \ - new KviKvsVariant(__param2), \ - new KviKvsVariant(__param3), \ - new KviKvsVariant(__param4), \ - new KviKvsVariant(__param5), \ - new KviKvsVariant(__param6) \ - ) \ - ) \ - : \ - false \ - ) - -#define KVS_TRIGGER_EVENT_7_HALTED(__idx,__wnd,__param1,__param2,__param3,__param4,__param5,__param6,__param7) \ - ( \ - KviKvsEventManager::instance()->hasAppHandlers(__idx) \ - ? \ - KviKvsEventManager::instance()->triggerDeleteParams( \ - __idx, \ - __wnd, \ - new KviKvsVariantList( \ - new KviKvsVariant(__param1), \ - new KviKvsVariant(__param2), \ - new KviKvsVariant(__param3), \ - new KviKvsVariant(__param4), \ - new KviKvsVariant(__param5), \ - new KviKvsVariant(__param6), \ - new KviKvsVariant(__param7) \ - ) \ - ) \ - : \ - false \ - ) - -#endif //!_KVI_KVS_EVENTTRIGGERS_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_hash.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_hash.cpp deleted file mode 100644 index 09ce85cf5f..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_hash.cpp +++ /dev/null @@ -1,96 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_hash.cpp -// Created on Tue 07 Oct 2003 01:22:37 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_hash.h" - -KviKvsHash::KviKvsHash() -{ - m_pDict = new KviPointerHashTable<QString,KviKvsVariant>(17,false); - m_pDict->setAutoDelete(true); -} - -KviKvsHash::KviKvsHash(const KviKvsHash &h) -{ - m_pDict = new KviPointerHashTable<QString,KviKvsVariant>(); - m_pDict->setAutoDelete(true); - KviPointerHashTableIterator<QString,KviKvsVariant> it(*(h.m_pDict)); - while(it.current()) - { - m_pDict->replace(it.currentKey(),new KviKvsVariant(*(it.current()))); - ++it; - } -} - -KviKvsHash::~KviKvsHash() -{ - delete m_pDict; -} - -void KviKvsHash::appendAsString(QString &szBuffer) const -{ - KviPointerHashTableIterator<QString,KviKvsVariant> it(*m_pDict); - bool bNeedComma = false; - while(KviKvsVariant * s = it.current()) - { - if(bNeedComma)szBuffer.append(','); - else bNeedComma = true; - s->appendAsString(szBuffer); - ++it; - } -} - -void KviKvsHash::serialize(QString& result) -{ - QString tmpBuffer; - result="{"; - KviPointerHashTableIterator<QString,KviKvsVariant> it(*m_pDict); - bool bNeedComma = false; - while(KviKvsVariant * s = it.current()) - { - if(bNeedComma)result.append(','); - else bNeedComma = true; - - tmpBuffer = it.currentKey(); - KviKvsVariant::serializeString(tmpBuffer); - result.append(tmpBuffer); - - result.append(":"); - s->serialize(tmpBuffer); - result.append(tmpBuffer); - - ++it; - } - result.append('}'); -} - -KviKvsVariant * KviKvsHash::get(const QString &szKey) -{ - KviKvsVariant * v = m_pDict->find(szKey); - if(v)return v; - v = new KviKvsVariant(); - m_pDict->replace(szKey,v); - return v; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_hash.h b/3.4.0/src/kvirc/kvs/kvi_kvs_hash.h deleted file mode 100644 index 482cad41f7..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_hash.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef _KVI_KVS_HASH_H_ -#define _KVI_KVS_HASH_H_ -//============================================================================= -// -// File : kvi_kvs_hash.h -// Created on Tue 07 Oct 2003 01:22:37 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_pointerhashtable.h" -#include "kvi_qstring.h" - -#include "kvi_kvs_variant.h" -#include "kvi_heapobject.h" - -typedef KVIRC_API KviPointerHashTableIterator<QString,KviKvsVariant> KviKvsHashIterator; - -// This class must not have virtual funcitons nor destructor -// Otherwise it will happily crash on windows when it is -// allocated in modules and destroyed anywhere else around... -class KVIRC_API KviKvsHash : public KviHeapObject -{ -public: - KviKvsHash(); - KviKvsHash(const KviKvsHash &h); - ~KviKvsHash(); -protected: - KviPointerHashTable<QString,KviKvsVariant> * m_pDict; -public: - void unset(const QString &szKey){ m_pDict->remove(szKey); }; - void set(const QString &szKey,KviKvsVariant * pVal){ m_pDict->replace(szKey,pVal); }; - KviKvsVariant * find(const QString &szKey) const { return m_pDict->find(szKey); }; - KviKvsVariant * get(const QString &szKey); - - bool isEmpty() const { return m_pDict->isEmpty(); }; - kvs_uint_t size() const { return m_pDict->count(); }; - - void appendAsString(QString &szBuffer) const; - - const KviPointerHashTable<QString,KviKvsVariant> * dict(){ return m_pDict; }; - - void serialize(QString& result); -}; - -#endif //!_KVI_KVS_HASH_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_kernel.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_kernel.cpp deleted file mode 100644 index a3aac1f4ff..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_kernel.cpp +++ /dev/null @@ -1,221 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_kernel.cpp -// Creation date : Tue 30 Sep 2003 05.12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_kernel.h" -#include "kvi_kvs_parser.h" -#include "kvi_kvs_hash.h" -#include "kvi_kvs_aliasmanager.h" -#include "kvi_kvs_coresimplecommands.h" -#include "kvi_kvs_corefunctions.h" -#include "kvi_kvs_corecallbackcommands.h" -#include "kvi_kvs_switchlist.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_script.h" -#include "kvi_kvs_object_controller.h" -#include "kvi_kvs_asyncoperation.h" -#include "kvi_modulemanager.h" - -KviKvsKernel * KviKvsKernel::m_pKvsKernel = 0; - -//////////////////////////////////////////////////////////////////////////////// -// CONSTRUCTION AND DESTRUCTION - -KviKvsKernel::KviKvsKernel() -{ - m_pKvsKernel = this; - - m_pSpecialCommandParsingRoutineDict = new KviPointerHashTable<QString,KviKvsSpecialCommandParsingRoutine>(17,false); - m_pSpecialCommandParsingRoutineDict->setAutoDelete(true); - m_pCoreSimpleCommandExecRoutineDict = new KviPointerHashTable<QString,KviKvsCoreSimpleCommandExecRoutine>(51,false); - m_pCoreSimpleCommandExecRoutineDict->setAutoDelete(true); - m_pCoreFunctionExecRoutineDict = new KviPointerHashTable<QString,KviKvsCoreFunctionExecRoutine>(51,false); - m_pCoreFunctionExecRoutineDict->setAutoDelete(true); - m_pCoreCallbackCommandExecRoutineDict = new KviPointerHashTable<QString,KviKvsCoreCallbackCommandExecRoutine>(17,false); - m_pCoreCallbackCommandExecRoutineDict->setAutoDelete(true); - - m_pGlobalVariables = new KviKvsHash(); - m_pEmptyParameterList = new KviKvsVariantList(); - m_pObjectController = new KviKvsObjectController(); - m_pObjectController->init(); - m_pAsyncOperationManager = new KviKvsAsyncOperationManager(); - - KviKvsParser::init(); - - KviKvsCoreSimpleCommands::init(); - KviKvsCoreFunctions::init(); - KviKvsCoreCallbackCommands::init(); -} - -KviKvsKernel::~KviKvsKernel() -{ - delete m_pAsyncOperationManager; - delete m_pObjectController; - delete m_pEmptyParameterList; - delete m_pGlobalVariables; - - delete m_pSpecialCommandParsingRoutineDict; - delete m_pCoreSimpleCommandExecRoutineDict; - delete m_pCoreFunctionExecRoutineDict; - delete m_pCoreCallbackCommandExecRoutineDict; -} - -//////////////////////////////////////////////////////////////////////////////// -// INSTANCE MANAGEMENT - -void KviKvsKernel::init() -{ - if(!m_pKvsKernel)m_pKvsKernel = new KviKvsKernel(); -} - -void KviKvsKernel::done() -{ - if(m_pKvsKernel) - { - delete m_pKvsKernel; - m_pKvsKernel = 0; - } -} - -#define COMPLETE_COMMAND_BY_DICT(__type,__dict) \ - { \ - KviPointerHashTableIterator<QString,__type> it(*__dict); \ - int l = szCommandBegin.length(); \ - while(it.current()) \ - { \ - if(KviQString::equalCIN(szCommandBegin,it.currentKey(),l)) \ - pMatches->append(new QString(it.currentKey())); \ - ++it; \ - } \ - } - - -void KviKvsKernel::completeCommand(const QString &szCommandBegin,KviPointerList<QString> * pMatches) -{ - int idx = szCommandBegin.find(QChar('.')); - if(idx == -1) - { - // no module name inside - COMPLETE_COMMAND_BY_DICT(KviKvsCoreSimpleCommandExecRoutine,m_pCoreSimpleCommandExecRoutineDict) - COMPLETE_COMMAND_BY_DICT(KviKvsSpecialCommandParsingRoutine,m_pSpecialCommandParsingRoutineDict) - COMPLETE_COMMAND_BY_DICT(KviKvsCoreCallbackCommandExecRoutine,m_pCoreCallbackCommandExecRoutineDict) - - KviPointerList<QString> lModules; - lModules.setAutoDelete(true); - g_pModuleManager->completeModuleNames(szCommandBegin,&lModules); - QString szEmpty = ""; - for(QString * pszModuleName = lModules.first();pszModuleName;pszModuleName = lModules.next()) - completeModuleCommand(*pszModuleName,szEmpty,pMatches); - - KviKvsAliasManager::instance()->completeCommand(szCommandBegin,pMatches); - } else { - // contains a module name - QString szModuleName = szCommandBegin.left(idx); - QString szRight = szCommandBegin.right(szCommandBegin.length() - (idx+1)); - completeModuleCommand(szModuleName,szRight,pMatches); - } -} - -void KviKvsKernel::completeModuleCommand(const QString &szModuleName,const QString &szCommandBegin,KviPointerList<QString> * pMatches) -{ - KviModule * pModule = g_pModuleManager->getModule(szModuleName.latin1()); - if(!pModule)return; - - KviPointerList<QString> lModuleMatches; - lModuleMatches.setAutoDelete(true); - pModule->completeCommand(szCommandBegin,&lModuleMatches); - for(QString * pszModuleMatch = lModuleMatches.first();pszModuleMatch;pszModuleMatch = lModuleMatches.next()) - { - QString * pszMatch = new QString(*pszModuleMatch); - pszMatch->prepend("."); - pszMatch->prepend(szModuleName); - pMatches->append(pszMatch); - } -} - -void KviKvsKernel::completeFunction(const QString &szFunctionBegin,KviPointerList<QString> * pMatches) -{ - int idx = szFunctionBegin.find(QChar('.')); - if(idx == -1) - { - // no module name inside - - KviPointerHashTableIterator<QString,KviKvsCoreFunctionExecRoutine> it(*m_pCoreFunctionExecRoutineDict); - int l = szFunctionBegin.length(); - while(it.current()) - { - if(KviQString::equalCIN(szFunctionBegin,it.currentKey(),l)) - { - QString * pMatch = new QString(it.currentKey()); - //pMatch->prepend("$"); - pMatches->append(pMatch); - } - ++it; - } - - KviPointerList<QString> lModules; - lModules.setAutoDelete(true); - g_pModuleManager->completeModuleNames(szFunctionBegin,&lModules); - QString szEmpty = ""; - for(QString * pszModuleName = lModules.first();pszModuleName;pszModuleName = lModules.next()) - completeModuleFunction(*pszModuleName,szEmpty,pMatches); - - KviPointerList<QString> lAliases; - lAliases.setAutoDelete(true); - - KviKvsAliasManager::instance()->completeCommand(szFunctionBegin,&lAliases); - for(QString * pszAlias = lAliases.first();pszAlias;pszAlias = lAliases.next()) - { - QString * pszAliasMatch = new QString(*pszAlias); - //pszAliasMatch->prepend("$"); - pMatches->append(pszAliasMatch); - } - } else { - // contains a module name - QString szModuleName = szFunctionBegin.left(idx); - QString szRight = szFunctionBegin.right(szFunctionBegin.length() - (idx+1)); - completeModuleFunction(szModuleName,szRight,pMatches); - } - - -} - -void KviKvsKernel::completeModuleFunction(const QString &szModuleName,const QString &szCommandBegin,KviPointerList<QString> * pMatches) -{ - KviModule * pModule = g_pModuleManager->getModule(szModuleName.latin1()); - if(!pModule)return; - - KviPointerList<QString> lModuleMatches; - lModuleMatches.setAutoDelete(true); - pModule->completeFunction(szCommandBegin,&lModuleMatches); - for(QString * pszModuleMatch = lModuleMatches.first();pszModuleMatch;pszModuleMatch = lModuleMatches.next()) - { - QString * pszMatch = new QString(*pszModuleMatch); - pszMatch->prepend("."); - pszMatch->prepend(szModuleName); - //pszMatch->prepend("$"); - pMatches->append(pszMatch); - } -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_kernel.h b/3.4.0/src/kvirc/kvs/kvi_kvs_kernel.h deleted file mode 100644 index 8e6e556429..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_kernel.h +++ /dev/null @@ -1,134 +0,0 @@ -#ifndef _KVI_KVS_KERNEL_H_ -#define _KVI_KVS_KERNEL_H_ -//============================================================================= -// -// File : kvi_kvs_kernel.h -// Creation date : Tue 30 Sep 2003 13.46 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_kvs_parser.h" -#include "kvi_pointerlist.h" -#include "kvi_qstring.h" - -#include "kvi_pointerhashtable.h" - -class KviKvsTreeNodeSpecialCommand; -class KviKvsObjectController; -class KviKvsAsyncOperationManager; -class KviKvsRunTimeContext; -class KviKvsVariantList; -class KviKvsSwitchList; -class KviKvsVariant; -class KviKvsScript; -class KviKvsHash; - - -typedef KviKvsTreeNodeCommand * (KviKvsParser::*specialCommandParsingRoutine)(); -typedef struct _KviKvsSpecialCommandParsingRoutine -{ - specialCommandParsingRoutine proc; -} KviKvsSpecialCommandParsingRoutine; - -typedef bool (*coreSimpleCommandExecRoutine)(KviKvsRunTimeContext * c,KviKvsVariantList * pParams,KviKvsSwitchList * pSwitches); -typedef struct _KviKvsCoreSimpleCommandExecRoutine -{ - coreSimpleCommandExecRoutine proc; -} KviKvsCoreSimpleCommandExecRoutine; - -typedef bool (*coreFunctionExecRoutine)(KviKvsRunTimeContext * c,KviKvsVariantList * pParams,KviKvsVariant * pRetBuffer); -typedef struct _KviKvsCoreFunctionExecRoutine -{ - coreFunctionExecRoutine proc; -} KviKvsCoreFunctionExecRoutine; - -typedef bool (*coreCallbackCommandExecRoutine)(KviKvsRunTimeContext * c,KviKvsVariantList * pParams,KviKvsSwitchList * pSwitches,const KviKvsScript * pCallback); -typedef struct _KviKvsCoreCallbackCommandExecRoutine -{ - coreCallbackCommandExecRoutine proc; -} KviKvsCoreCallbackCommandExecRoutine; - - -class KVIRC_API KviKvsKernel -{ -public: - KviKvsKernel(); - ~KviKvsKernel(); -private: - static KviKvsKernel * m_pKvsKernel; // global kernel object - - KviPointerHashTable<QString,KviKvsSpecialCommandParsingRoutine> * m_pSpecialCommandParsingRoutineDict; - - KviPointerHashTable<QString,KviKvsCoreSimpleCommandExecRoutine> * m_pCoreSimpleCommandExecRoutineDict; - KviPointerHashTable<QString,KviKvsCoreCallbackCommandExecRoutine> * m_pCoreCallbackCommandExecRoutineDict; - KviPointerHashTable<QString,KviKvsCoreFunctionExecRoutine> * m_pCoreFunctionExecRoutineDict; - - KviKvsHash * m_pGlobalVariables; - KviKvsVariantList * m_pEmptyParameterList; - - KviKvsObjectController * m_pObjectController; - KviKvsAsyncOperationManager * m_pAsyncOperationManager; -public: - static void init(); - static void done(); - static KviKvsKernel * instance(){ return m_pKvsKernel; }; - - KviKvsVariantList * emptyParameterList(){ return m_pEmptyParameterList; }; - - KviKvsHash * globalVariables(){ return m_pGlobalVariables; }; - - KviKvsObjectController * objectController(){ return m_pObjectController; }; - - KviKvsAsyncOperationManager * asyncOperationManager(){ return m_pAsyncOperationManager; }; - - void registerSpecialCommandParsingRoutine(const QString &szCmdName,KviKvsSpecialCommandParsingRoutine * r) - { m_pSpecialCommandParsingRoutineDict->replace(szCmdName,r); }; - KviKvsSpecialCommandParsingRoutine * findSpecialCommandParsingRoutine(const QString &szCmdName) - { return m_pSpecialCommandParsingRoutineDict->find(szCmdName); }; - - void registerCoreSimpleCommandExecRoutine(const QString &szCmdName,KviKvsCoreSimpleCommandExecRoutine * r) - { m_pCoreSimpleCommandExecRoutineDict->replace(szCmdName,r); }; - KviKvsCoreSimpleCommandExecRoutine * findCoreSimpleCommandExecRoutine(const QString &szCmdName) - { return m_pCoreSimpleCommandExecRoutineDict->find(szCmdName); }; - - void registerCoreFunctionExecRoutine(const QString &szFncName,KviKvsCoreFunctionExecRoutine * r) - { m_pCoreFunctionExecRoutineDict->replace(szFncName,r); }; - KviKvsCoreFunctionExecRoutine * findCoreFunctionExecRoutine(const QString &szFncName) - { return m_pCoreFunctionExecRoutineDict->find(szFncName); }; - - void registerCoreCallbackCommandExecRoutine(const QString &szCmdName,KviKvsCoreCallbackCommandExecRoutine * r) - { m_pCoreCallbackCommandExecRoutineDict->replace(szCmdName,r); }; - KviKvsCoreCallbackCommandExecRoutine * findCoreCallbackCommandExecRoutine(const QString &szCmdName) - { return m_pCoreCallbackCommandExecRoutineDict->find(szCmdName); }; - - void completeCommand(const QString &szCommandBegin,KviPointerList<QString> * pMatches); - void completeFunction(const QString &szFunctionBegin,KviPointerList<QString> * pMatches); - void completeModuleCommand(const QString &szModuleName,const QString &szCommandBegin,KviPointerList<QString> * matches); - void completeModuleFunction(const QString &szModuleName,const QString &szFunctionBegin,KviPointerList<QString> * matches); -/* - KviPointerList<QString> * completeCommandAllocateResult(const QString &szCommandBegin); - KviPointerList<QString> * completeFunctionAllocateResult(const QString &szFunctionBegin); - void freeCompletionResult(KviPointerList<QString> * l); -*/ -}; - -#endif //!_KVI_KVS_KERNEL_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_moduleinterface.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_moduleinterface.cpp deleted file mode 100644 index a87a2eca17..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_moduleinterface.cpp +++ /dev/null @@ -1,180 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_moduleinterface.cpp -// Created on Tue 16 Dec 2003 00:27:54 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003-2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_moduleinterface.h" -#include "kvi_kvs_eventmanager.h" -#include "kvi_module.h" -#include "kvi_modulemanager.h" -#include "kvi_locale.h" -#include "kvi_kvs_treenode_data.h" -#include "kvi_kvs_treenode_datalist.h" - -bool KviKvsModuleCallbackCommandCall::getParameterCode(unsigned int uParamIdx,QString &szParamBuffer) -{ - if(!m_pParameterDataList)return false; - KviKvsTreeNodeData * d = m_pParameterDataList->item(uParamIdx); - if(!d)return false; - const QChar * pBegin = d->location(); - const QChar * pEnd = d->endingLocation(); - if(!(pBegin && pEnd))return false; - szParamBuffer.setUnicode(pBegin,pEnd - pBegin); - szParamBuffer.stripWhiteSpace(); - return true; -} - - -KviKvsModuleInterface::KviKvsModuleInterface() -{ - m_pModuleSimpleCommandExecRoutineDict = new KviPointerHashTable<QString,KviKvsModuleSimpleCommandExecRoutine>(17,false); - m_pModuleSimpleCommandExecRoutineDict->setAutoDelete(true); - m_pModuleFunctionExecRoutineDict = new KviPointerHashTable<QString,KviKvsModuleFunctionExecRoutine>(17,false); - m_pModuleFunctionExecRoutineDict->setAutoDelete(true); - m_pModuleCallbackCommandExecRoutineDict = new KviPointerHashTable<QString,KviKvsModuleCallbackCommandExecRoutine>(17,false); - m_pModuleCallbackCommandExecRoutineDict->setAutoDelete(true); -} - -KviKvsModuleInterface::~KviKvsModuleInterface() -{ - kvsUnregisterAllEventHandlers(); - delete m_pModuleSimpleCommandExecRoutineDict; - delete m_pModuleFunctionExecRoutineDict; - delete m_pModuleCallbackCommandExecRoutineDict; -} - -#define COMPLETE_WORD_BY_DICT(__word,__list,__type,__dict) \ - { \ - KviPointerHashTableIterator<QString,__type> it(*__dict); \ - int l = __word.length(); \ - while(it.current()) \ - { \ - if(KviQString::equalCIN(__word,it.currentKey(),l)) \ - __list->append(new QString(it.currentKey())); \ - ++it; \ - } \ - } - -void KviKvsModuleInterface::completeCommand(const QString &szCommandBegin,KviPointerList<QString> * pMatches) -{ - COMPLETE_WORD_BY_DICT(szCommandBegin,pMatches,KviKvsModuleSimpleCommandExecRoutine,m_pModuleSimpleCommandExecRoutineDict) - COMPLETE_WORD_BY_DICT(szCommandBegin,pMatches,KviKvsModuleCallbackCommandExecRoutine,m_pModuleCallbackCommandExecRoutineDict) -} - -void KviKvsModuleInterface::completeFunction(const QString &szFunctionBegin,KviPointerList<QString> * pMatches) -{ - COMPLETE_WORD_BY_DICT(szFunctionBegin,pMatches,KviKvsModuleFunctionExecRoutine,m_pModuleFunctionExecRoutineDict) -} - - -void KviKvsModuleInterface::kvsRegisterSimpleCommand(const QString &szCommand,KviKvsModuleSimpleCommandExecRoutine r) -{ - m_pModuleSimpleCommandExecRoutineDict->replace(szCommand,new KviKvsModuleSimpleCommandExecRoutine(r)); -} - -void KviKvsModuleInterface::kvsRegisterCallbackCommand(const QString &szCommand,KviKvsModuleCallbackCommandExecRoutine r) -{ - m_pModuleCallbackCommandExecRoutineDict->replace(szCommand,new KviKvsModuleCallbackCommandExecRoutine(r)); -} - -void KviKvsModuleInterface::kvsRegisterFunction(const QString &szFunction,KviKvsModuleFunctionExecRoutine r) -{ - m_pModuleFunctionExecRoutineDict->replace(szFunction,new KviKvsModuleFunctionExecRoutine(r)); -} - - -bool KviKvsModuleInterface::kvsRegisterAppEventHandler(unsigned int iEventIdx,KviKvsModuleEventHandlerRoutine r) -{ - KviKvsModuleEventHandler * h = new KviKvsModuleEventHandler(this,r); - if(!KviKvsEventManager::instance()->addAppHandler(iEventIdx,h)) - { - delete h; - return false; - } - return true; -} - -bool KviKvsModuleInterface::kvsRegisterRawEventHandler(unsigned int iRawIdx,KviKvsModuleEventHandlerRoutine r) -{ - KviKvsModuleEventHandler * h = new KviKvsModuleEventHandler(this,r); - if(!KviKvsEventManager::instance()->addRawHandler(iRawIdx,h)) - { - delete h; - return false; - } - return true; -} - -void KviKvsModuleInterface::kvsUnregisterAppEventHandler(unsigned int uEventIdx) -{ - KviKvsEventManager::instance()->removeModuleAppHandler(uEventIdx,this); -} - -void KviKvsModuleInterface::kvsUnregisterRawEventHandler(unsigned int uRawIdx) -{ - KviKvsEventManager::instance()->removeModuleRawHandler(uRawIdx,this); -} - -void KviKvsModuleInterface::kvsUnregisterAllAppEventHandlers() -{ - KviKvsEventManager::instance()->removeAllModuleAppHandlers(this); -} - -void KviKvsModuleInterface::kvsUnregisterAllRawEventHandlers() -{ - KviKvsEventManager::instance()->removeAllModuleRawHandlers(this); -} - -void KviKvsModuleInterface::kvsUnregisterAllEventHandlers() -{ - kvsUnregisterAllAppEventHandlers(); - kvsUnregisterAllRawEventHandlers(); -} - -static bool default_module_kvs_cmd_load(KviKvsModuleCommandCall *) -{ - return true; -} - -static bool default_module_kvs_cmd_unload(KviKvsModuleCommandCall *c) -{ - if(c->module()->isLocked()) - { - if(!c->switches()->find('f',"force")) - { - c->warning(__tr2qs("Can't unload the module: it has locked itself in memory")); - return true; - } - } - g_pModuleManager->unloadModule(c->module()->name()); - return true; -} - -void KviKvsModuleInterface::registerDefaultCommands() -{ - kvsRegisterSimpleCommand("load",default_module_kvs_cmd_load); - kvsRegisterSimpleCommand("unload",default_module_kvs_cmd_unload); -} - - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_moduleinterface.h b/3.4.0/src/kvirc/kvs/kvi_kvs_moduleinterface.h deleted file mode 100644 index 77f1e4117a..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_moduleinterface.h +++ /dev/null @@ -1,228 +0,0 @@ -#ifndef _KVI_KVS_MODULEINTERFACE_H_ -#define _KVI_KVS_MODULEINTERFACE_H_ -//============================================================================= -// -// File : kvi_kvs_moduleinterface.h -// Created on Tue 16 Dec 2003 00:27:54 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_pointerhashtable.h" - -#include "kvi_kvs_runtimecall.h" -#include "kvi_kvs_parameterprocessor.h" -#include "kvi_kvs_switchlist.h" -#include "kvi_kvs_script.h" -#include "kvi_pointerlist.h" -#include "kvi_qstring.h" - -class KviModule; -class KviKvsTreeNodeDataList; - -class KVIRC_API KviKvsModuleRunTimeCall : public KviKvsRunTimeCall -{ -protected: - KviModule * m_pModule; -public: - KviKvsModuleRunTimeCall(KviModule * pModule, - KviKvsRunTimeContext * pContext, - KviKvsVariantList * pParams) - : KviKvsRunTimeCall(pContext,pParams), m_pModule(pModule) {} - ~KviKvsModuleRunTimeCall(){}; -public: - KviModule * module(){ return m_pModule; }; -}; - -class KVIRC_API KviKvsModuleEventCall : public KviKvsModuleRunTimeCall -{ -public: - KviKvsModuleEventCall(KviModule * pModule, - KviKvsRunTimeContext * pContext, - KviKvsVariantList * pParams) - : KviKvsModuleRunTimeCall(pModule,pContext,pParams){}; - ~KviKvsModuleEventCall(){}; -}; - -class KVIRC_API KviKvsModuleCommandCall : public KviKvsModuleRunTimeCall -{ -protected: - KviKvsSwitchList * m_pSwitchList; -public: - KviKvsModuleCommandCall(KviModule * pModule, - KviKvsRunTimeContext * pContext, - KviKvsVariantList * pParams, - KviKvsSwitchList * pSwitches) - : KviKvsModuleRunTimeCall(pModule,pContext,pParams), m_pSwitchList(pSwitches){}; - ~KviKvsModuleCommandCall(){}; -public: - KviKvsSwitchList * switches(){ return m_pSwitchList; }; - KviKvsSwitchList * switchList(){ return m_pSwitchList; }; - - // forwarders for the switch list - bool hasSwitch(unsigned short u,const QString &szSwitch){ return (m_pSwitchList->find(u,szSwitch) != 0); }; - KviKvsVariant * getSwitch(unsigned short u,const QString &szSwitch){ return m_pSwitchList->find(u,szSwitch); }; -}; - -class KVIRC_API KviKvsModuleCallbackCommandCall : public KviKvsModuleCommandCall -{ -protected: - const KviKvsScript * m_pCallback; - KviKvsTreeNodeDataList * m_pParameterDataList; // core subtree that rappresents the parameter list -public: - KviKvsModuleCallbackCommandCall(KviModule * pModule, - KviKvsRunTimeContext * pContext, - KviKvsVariantList * pParams, - KviKvsSwitchList * pSwitches, - const KviKvsScript * pCallback, - KviKvsTreeNodeDataList * pDataList) - : KviKvsModuleCommandCall(pModule,pContext,pParams,pSwitches), m_pCallback(pCallback), m_pParameterDataList(pDataList) {}; - ~KviKvsModuleCallbackCommandCall(){}; -public: - // Never NULL, but may have empty code - const KviKvsScript * callback(){ return m_pCallback; }; - virtual bool getParameterCode(unsigned int uParamIdx,QString &szParamBuffer); -}; - - -class KVIRC_API KviKvsModuleFunctionCall : public KviKvsModuleRunTimeCall -{ - friend class KviKvsTreeNodeModuleFunctionCall; -protected: - KviKvsVariant * m_pResult; -public: - KviKvsModuleFunctionCall(KviModule * pModule, - KviKvsRunTimeContext * pContext, - KviKvsVariantList * pParams, - KviKvsVariant * pResult) - : KviKvsModuleRunTimeCall(pModule,pContext,pParams), m_pResult(pResult) - {}; - ~KviKvsModuleFunctionCall(){}; -public: - KviKvsVariant * returnValue(){ return m_pResult; }; -}; - - - -typedef bool (*KviKvsModuleSimpleCommandExecRoutine)(KviKvsModuleCommandCall * c); -typedef bool (*KviKvsModuleFunctionExecRoutine)(KviKvsModuleFunctionCall * c); -typedef bool (*KviKvsModuleCallbackCommandExecRoutine)(KviKvsModuleCallbackCommandCall * c); -typedef bool (*KviKvsModuleEventHandlerRoutine)(KviKvsModuleEventCall * c); - - - -class KVIRC_API KviKvsModuleInterface -{ - friend class KviKvsModuleManager; -public: - KviKvsModuleInterface(); - ~KviKvsModuleInterface(); -protected: - KviPointerHashTable<QString,KviKvsModuleSimpleCommandExecRoutine> * m_pModuleSimpleCommandExecRoutineDict; - KviPointerHashTable<QString,KviKvsModuleFunctionExecRoutine> * m_pModuleFunctionExecRoutineDict; - KviPointerHashTable<QString,KviKvsModuleCallbackCommandExecRoutine> * m_pModuleCallbackCommandExecRoutineDict; -public: - void kvsRegisterSimpleCommand(const QString &szCommand,KviKvsModuleSimpleCommandExecRoutine r); - void kvsRegisterCallbackCommand(const QString &szCommand,KviKvsModuleCallbackCommandExecRoutine r); - void kvsRegisterFunction(const QString &szFunction,KviKvsModuleFunctionExecRoutine r); - bool kvsRegisterAppEventHandler(unsigned int iEventIdx,KviKvsModuleEventHandlerRoutine r); - bool kvsRegisterRawEventHandler(unsigned int iRawIdx,KviKvsModuleEventHandlerRoutine r); - - void kvsUnregisterSimpleCommand(const QString &szCommand) - { m_pModuleSimpleCommandExecRoutineDict->remove(szCommand); }; - void kvsUnregisterCallbackCommand(const QString &szCommand) - { m_pModuleCallbackCommandExecRoutineDict->remove(szCommand); }; - void kvsUnregisterFunction(const QString &szFunction) - { m_pModuleFunctionExecRoutineDict->remove(szFunction); }; - void kvsUnregisterAppEventHandler(unsigned int iEventIdx); - void kvsUnregisterRawEventHandler(unsigned int iRawIdx); - - void kvsUnregisterAllSimpleCommands() - { m_pModuleSimpleCommandExecRoutineDict->clear(); }; - void kvsUnregisterAllCallbackCommands() - { m_pModuleCallbackCommandExecRoutineDict->clear(); }; - void kvsUnregisterAllFunctions() - { m_pModuleFunctionExecRoutineDict->clear(); }; - void kvsUnregisterAllAppEventHandlers(); - void kvsUnregisterAllRawEventHandlers(); - void kvsUnregisterAllEventHandlers(); - - KviKvsModuleSimpleCommandExecRoutine * kvsFindSimpleCommand(const QString &szCommand) - { return m_pModuleSimpleCommandExecRoutineDict->find(szCommand); }; - KviKvsModuleCallbackCommandExecRoutine * kvsFindCallbackCommand(const QString &szCommand) - { return m_pModuleCallbackCommandExecRoutineDict->find(szCommand); }; - KviKvsModuleFunctionExecRoutine * kvsFindFunction(const QString &szFunction) - { return m_pModuleFunctionExecRoutineDict->find(szFunction); }; - - void completeCommand(const QString &cmd,KviPointerList<QString> * matches); - void completeFunction(const QString &cmd,KviPointerList<QString> * matches); -protected: - void registerDefaultCommands(); -}; - - - -#define KVSM_REGISTER_SIMPLE_COMMAND(_pModule,_szCmd,_procname) \ - _pModule->kvsRegisterSimpleCommand(_szCmd,_procname); - -#define KVSM_UNREGISTER_SIMPLE_COMMAND(_pModule,_szCmd) \ - _pModule->kvsUnregisterSimpleCommand(_szCmd); - -#define KVSM_REGISTER_CALLBACK_COMMAND(_pModule,_szCmd,_procname) \ - _pModule->kvsRegisterCallbackCommand(_szCmd,_procname); - -#define KVSM_UNREGISTER_CALLBACK_COMMAND(_pModule,_szCmd) \ - _pModule->kvsUnregisterCallbackCommand(_szCmd); - -#define KVSM_REGISTER_FUNCTION(_pModule,_szFnc,_procname) \ - _pModule->kvsRegisterFunction(_szFnc,_procname); \ - -#define KVSM_UNREGISTER_FUNCTION(_pModule,_szFnc) \ - _pModule->kvsUnregisterFunction(_szFnc); - -#define KVSM_UNREGISTER_ALL_SIMPLE_COMMANDS(_pModule) \ - _pModule->kvsUnregisterAllSimpleCommands(); - -#define KVSM_UNREGISTER_ALL_CALLBACK_COMMANDS(_pModule) \ - _pModule->kvsUnregisterAllCallbackCommands(); - -#define KVSM_UNREGISTER_ALL_FUNCTIONS(_pModule) \ - _pModule->kvsUnregisterAllFunctions(); - - -#define KVSM_PARAMETER(a,b,c,d) KVS_PARAMETER(a,b,c,d) -#define KVSM_PARAMETER_IGNORED(a) KVS_PARAMETER_IGNORED(a) - -#define KVSM_PARAMETERS_BEGIN(pCall) \ - KVS_PARAMETERS_BEGIN(parameter_format_list) - -#define KVSM_PARAMETERS_END(pCall) \ - KVS_PARAMETERS_END \ - if(!KviKvsParameterProcessor::process(pCall->params(),pCall->context(),parameter_format_list))return false; - -#define KVSM_REQUIRE_CONNECTION(pCall) \ - if(!pCall->window()->context())return c->context()->errorNoIrcContext(); \ - if(!pCall->window()->connection())return c->context()->warningNoIrcConnection(); - - - -#endif //!_KVI_KVS_MODULEINTERFACE_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_object.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_object.cpp deleted file mode 100644 index c3c2761c99..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_object.cpp +++ /dev/null @@ -1,1743 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_object.cpp -// Created on Wed 08 Oct 2003 02:31:57 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_object.h" -#include "kvi_kvs_hash.h" -#include "kvi_kvs_kernel.h" -#include "kvi_window.h" -#include "kvi_app.h" - -#include "kvi_modulemanager.h" -#include "kvi_console.h" -#include "kvi_locale.h" -#include "kvi_error.h" -#include "kvi_out.h" -#include "kvi_mirccntrl.h" -#include "kvi_iconmanager.h" -#include "kvi_malloc.h" - -#include "kvi_kvs_object_controller.h" -#include "kvi_kvs_object_functioncall.h" -#include "kvi_kvs_object_functionhandlerimpl.h" - -#include <qmetaobject.h> -#include <qtimer.h> -#include <time.h> -#include <qiconset.h> - - - -/* - @doc: objects - @title: - Object scripting - @short: - Object scripting overview - @keyterms: - objects , object scripting , complex data structures - @body: - [big]Introduction[/big] - - The KVIrc scripting language is not object oriented in nature. - Anyway , objects are a highlevel abstraction that allow - to write complex code in a "clean" way. - So I've added at least some pseudo-object support.[br][br] - - [big]Basic concepts[/big] - - Objects are arranged in tree structures. - Each object that you create is either toplevel object or a children - of another object. A toplevel object is a parentless one. - Obviously all objects can have children objects.[br][br] - - When an object is destroyed , all its children are also destroyed. - The toplevel objects are automatically destroyed when KVIrc quits. - The objects are global to the entire application (this is different - from previous KVIrc releases where the objects were local - to the current frame window and arranged in a single tree - with a builtin root object).[br][br] - - Each object is an instance of a class that defines its features. - Each object has also a name , that is not necessary unique and is assigned - by the programmer; the name is just a mnemonic expedient, and - you may also not need it.[br][br] - - Each object is identified by an [b]OPAQUE UNIQUE ID[/b]. - The ID is assigned by KVIrc and can be held in any variable. - You can think the object id as a "handle for the object" or the object's pointer. - Any action performed on the object will require its ID.[br][br] - - [big]Creation and destruction[/big] - - To create an object you must use the [fnc]$new[/fnc]() - function. [fnc]$new[/fnc]() requires three parameters:[br] - - The object class (more about object classes later in this document)[br] - - The ID of the parent object , (that can be 0 for toplevel objects).[br] - - The object name (eventually empty)[br] - [example] - %myobject = [fnc]$new[/fnc]([class]object[/class],0,theName) - [/example] - [fnc]$new[/fnc]() returns the ID of the newly created object, or - the STRING "0" if the object creation fails - (it is a string because the object id's are generally strings, and 0 is an "invalid object id"). - In well written scripts it is not common that the object creation fails, anyway - you can check if the creation has failed in the following way:[br] - [example] - [cmd]if[/cmd](%myobject)[cmd]echo[/cmd] "Object created!" - else [cmd]echo[/cmd] "Object creation failed!" - [/example] - You can also test the object ID's for equality:[br] - [example] - [cmd]if[/cmd](%myobject == %anotherobject)[cmd]echo[/cmd] "This is the same object!"; - [/example] - The parent object id is optional, if not specified it is assumed to be 0. - The object name is optional , but it may help you later in finding the object.[br][br] - - To destroy an object use the [cmd]delete[/cmd] command. (In previous versions - this command was named "destroy" and delete is currently aliased to that name too).[br] - [example] - [cmd]delete[/cmd] %myobject - [/example] - If the destroyed object has children objects , these are destroyed too.[br][br] - - [big]Fields : objects as pseudo-structures[/big] - - All the objects can contain variable fields. - You can set an object's field by using the object scope operator "->":[br] - [example] - %myobject->%fieldVariable = dataString - [/example] - To unset a field set it with empty data string (just like with a normal variable). - To retrieve the field data use the object scope operator in the same way:[br] - [example] - [cmd]echo[/cmd] %myobject->%fieldVariable - [/example] - The '->' operator has been stolen from the C language. - In the KVIrc scripting language it switches from the global namespace - to the object's one.[br] - So in the above example %fieldVariable is owned by the object.[br] - The first character of the variable name has no special meaning in the - object namespace (in the global namespace the variables starting - with an uppercase letter are global to the application , the other ones are local - to the command sequence). The variable names are completely case insensitive.[br][br] - - Any [doc:operators]operator[/doc] can be used with the object field variables:[br] - [example] - %myobject->%fieldVariable = 0 - %myobject->%fieldVarialbe ++ - [cmd]if[/cmd]0(%myobject->%fieldVariable != 1)[cmd]echo[/cmd] KVIrc is drunk , maybe a reboot will help ? - [/example] - You can simulate C structures "on the fly" by using objects and fields:[br] - [example] - # Create an user description on the fly - %myobj = [fnc]$new[/fnc]([class]object[/class],0,userDescription) - # Set the fields - %myobj->%nickname = Pragma - %myobj->%username = daemon - %myobj->%hostname = pippo.pragma.org - %myobj->%info = Pragma goes always sleep too late - %myobj->%info [doc:operators]<<[/doc] and wakes up too late too! - # Call an (user defined) alias that stores the data to a file - storetofile %myobj - # Destroy the object - [cmd]delete[/cmd] %myobj - [/example] - The field variables can be also dictionaries:[br] - [example] - %theobj->%field[key] = something - [/example] - Unlike in C , there is no need to declare object fields. - Any object can have any field variable ; an "unset" field is equivalent to an "empty" field.[br] - Note:[br] - The KVIrc scripting language is not typed. - Any object class (be patient...I'll explain classes in a while) identifier can be stored in any KVIrc variable: - it is not possible to find out the object features by "examining" its identifier. - This may make the usage of objects a bit "unclear"; - Howewer , with some experience you will be able to use the objects in a very powerful way. - The type-safety can be also simulated by a careful usage of object names; - in the above example , the %myobj object was created with the "userDescription" name. - The storetofile alias could check the passed object's name and refuse to work - if that does not match "userDescription".[br][br] - - A more complex use of fields will be described later in this document.[br][br] - - [big]Member functions[/big] - - Just like in C++ , the objects have member functions. - For example , the "object" class (again...read on) objects export the [classfnc:object]$name[/classfnc]() - and [classfnc:object]$className[/classfnc]() functions.[br] - [example] - %tmp = [fnc]$new[/fnc]([class]object[/class],0,myobject) - [cmd]echo[/cmd] The object's name is %tmp->[classfnc:object]$name[/classfnc]() , the class name is %tmp->[classfnc:object]$className[/classfnc]() - # Destroy the object - [cmd]delete[/cmd] %tmp - [/example] - Another cool function exported by the [class:object]object[/class] class is the - [classfnc:object]$children[/classfnc]() function. - It returns a comma separated list of children identifiers.[br] - [example] - %tmp = [fnc]$new[/fnc]([class]object[/class],0,myobject) - %tmpchild = [fnc]$new[/fnc]([class]object[/class],%tmp,child1) - %tmpchild = [fnc]$new[/fnc]([class]object[/class],%tmp,child2) - %tmpchild = [fnc]$new[/fnc]([class]object[/class],%tmp,child3) - [cmd]echo[/cmd] The object's children list is : %tmp->[classfnc:object]$children[/classfnc]() - # Destroy the object and the children - [cmd]delete[/cmd] %tmp - [/example] - There are two special functions for each objects: the "constructor" and the "destructor". - You will find more informations on constructors and destructors later in this document, - for now it's enough that you know that these functions are called automatically by KVirc: - the constructor is called when the object is created and the destructor is called when the - object is being destroyed with [cmd]delete[/cmd].[br][br] - - The object functions can be reimplemented on-the-fly - by using the [cmd]privateimpl[/cmd] command: you can simply modify the behaviour of the function - by writing your own function body. - (This is an uncommon feature: unlike many other languages , you can reimplement object - functions at run-time, when the object has been already created.)[br][br] - - A more complex example[br] - [example] - %tmp = [fnc]$new[/fnc]([class]object[/class],0,myobject) - [cmd]foreach[/cmd](%i,1,2,3) - { - %tmpchild = [fnc]$new[/fnc]([class]object[/class],%tmp,child%i) - [cmd]privateimpl[/cmd](%tmpchild,destructor){ [cmd]echo[/cmd] Object [fnc]$this[/fnc] ([fnc]$this[/fnc]->[classfnc:object]$name[/classfnc]()) destroyed; } - } - [cmd]privateimpl[/cmd](%tmp,destructor) - { - %count = 0; - [cmd]foreach[/cmd](%t,[fnc]$this[/fnc]->[classfnc:object]$children[/classfnc]()) - { - [cmd]echo[/cmd] Children : %t->[classfnc:object]$name[/classfnc]() with class %t->[classfnc:object]$class[/classfnc]() - %count++ - } - [cmd]echo[/cmd] Just before destroying my %count children. - } - # Destroy the object and the children - [cmd]delete[/cmd] %tmp - [/example] - - In the example above four objects have been created. - A "parent" object named "myobject" , and three children objects. - The destructor has been reimplemented for each child object, - to make it "say" its name (Please note the usage of [fnc]$this[/fnc]). - In the parent destructor the children have been counted and listed.[br] - Then the parent object is destroyed causing to:[br] - - trigger the parent destructor.[br] - - destroy all the children (and conseguently trigger all the "individual" destructors).[br][br] - - Not all the object functions must return a value: - If a function does not return a meaningful value , or you just want to ignore it , you can call it in the following way:[br] - [example] - %anyobject->$functionname() - [/example] - [br] - - [big]Classes[/big] - As said before , all objects are instances of a specific class. - This concept is common to almost all object oriented languages. - A class is a collection of methods that define an object's behaviour. - Hehe...it is not easy to explain it , so I'll try with an example:[br] - [example] - class HostAddress - { - field hostname - function ipnumber() - function isLocalhost() - } - [/example] - The above class is a rappresentation of a host address. - You create an [b]instance of this class[/b] and set the hostname field, for example, - to www.kernel.org. - The object is now able to give you informations about the hostname in a transparent way: - You can call the ipnumber() function, and the object will return you the - digits and dots rappresentation of www.kernel.org. - The isLocalhost() function will return true if the hostname refers to the local machine - The object internal job is hidden from the user , but probably it will be a huge job. - To obtain the IP number from the hostname , the object will probably have to perform a DNS call (usually a complex task). - To check if the hostname references the local machine , the object will have to obtain the local hostname - from the system (in some "unspecified" way) and then compare it with the given "hostname" field.[br][br] - - The internal job of the object is defined by the "implementation of the class". - Obviously , the programmer that creates the class has to write that implementation.[br] - - [example] - class HostAddress - { - field hostname - function ipnumber() - { - find the nearest DNS server - make the dns call - wait for the response - decode the response - } - function isLocalhost() - { - query the kernel for the local hostname - compare the obtained hostname with the hostname field - } - } - [/example] - In the above example I have "implemented" the two functions by using a "fantastic" language.[br][br] - - Let's go back to the real world.[br][br] - - KVirc contains a [doc:classes]set of built-in ready-to-use classes[/doc]. - The basic class is [class]object[/class]: all the other classes are derived from this (more about - object inheritance later in this doc).[br][br] - - Another available class is [class]socket[/class] that is an interface to the real system sockets. - An instance of the [class]socket[/class] class can connect and communicate with other hosts on the net.[br][br] - - The [b]class definitions are GLOBAL to the entire application[/b]: all server windows share them.[br][br] - - So now we can say that in KVIrc - [b]a CLASS is a collection of features that define the behaviour of an object. - The user interface to the class are the member functions and the events.[/b][br][br] - - [big]Inheritance[/big] - - Someone asked for derived classes ?[br] - Here we go:[br] - The [cmd]class[/cmd] command allows you to define new object classes. - In KVI++, A new class must be always derived from some other class: the lowest possible - level of inheritance is 1: deriving from class [class]object[/class].[br] - [example] - [cmd]class[/cmd](helloworld,object) - { - sayhello() - { - [cmd]echo[/cmd] Hello world! - } - } - [/example] - - The above class is named "helloworld". It inherits the [class]object[/class] class. - This means that it acquires all the [class]object[/class] fuunctions: [classfnc:object]$name[/classfnc]() , - [classfnc:object]$class[/class]() , [classfnc:object]$children[/classfnc]()... - Additionally , it has the $sayhello() function, that "echoes Hello world" to the console. - Now you can create an instance of this class: - [example] - %instance = [fnc]$new[/fnc](helloworld) - %instance->$sayhello() - [/example] - You should see "Hello world" printed in the console. - Easy job...let's make the things a bit more complex now: - derive another class from helloworld and make it say "hello" in two different languages:[br] - [example] - [cmd]class[/cmd](localizedhelloworld,helloworld) - { - [comment]# define the setlanguage function[/comment] - [comment]# note that <$0 = language> is just a programmer reminder[/comment] - setlanguage(<$0 = language>) - { - [cmd]if[/cmd](($0 == english) || ($0 == italian)) - { - [fnc:$this]$$[/fnc]->%lang = $0 - [cmd]return[/cmd] 1 - } else { - [cmd]echo[/cmd] I don't know that language ($0) - [cmd]echo[/cmd] defaulting to english - [fnc:$this]$$[/fnc]->%lang = english - [cmd]return[/cmd] 0 - } - } - - sayhello() - { - [cmd]if[/cmd]([fnc:$this]$$[/fnc]->%lang == italian)[cmd]echo[/cmd] Ciao mondo! - else [fnc:$this]$$[/fnc]->$helloworld:sayhello() - } - } - [/example] - Now you can call:[br] - [example] - %m = [fnc]$new[/fnc](localizedhelloworld) - %m->$setLanguage(italian) - %m->$sayhello() - %m->$setLanguage(english) - %m->$sayhello() - %m->$setLanguage(turkish) - %m->$sayhello() - [cmd]delete[/cmd] %myobj - [/example] - The class defined above is inherited from the previously defined helloworld class: - so it inherits the "object" class functions and events and the sayhello function from "helloworld". - In addition a setlanguage function is defined that stores in a variable the language name passed - as a parameter (after checking its validity). ($0 evaluates to the first parameter passed) - If the language is unknown the setlanguage function will return 0 (false). - Now we want to be able to say "hello world" in italian and english. - So we [b]override[/b] the inherited sayhello function. - "To override" means "to reimplement" : if you call %object->$sayhello() and %object - contains the ID of an instance of class "localizedhelloworld" , the new implementation of that function willl be called (executed). - The inherited sayhello was able to say "hello world" only in english , so we can still use it in the new implementation - without rewriting its contents. So if the language set is "not italian" we assume that it is english and - call the [b]base class implementation[/b].[br] - [example] - [fnc]$this/[fnc]->$helloworld:sayhello() - [comment]# equivalent to $$->$helloworld:sayhello(),[/comment] - [comment]# to $this->$helloworld::sayhello(),[/comment] - [comment]# and to $$->$helloworld::sayhello()[/comment] - [/example] - otherwise the language is italian and we say "hello" in italian :). - So , to call a base class implementation of a function we "prepend" the base class name before the function name in the call. - The base class name could be also [class]object[/class] in this case , but the [class]object[/class] class has no "sayhello" function defined - so it would result in an error.[br][br] - In the above example , all the values of [fnc]$this[/fnc]</a>->%language - that are not equal to "italian" are assumed to be "english". - This is not always true , for example , just after the object creation the %language variable field - is effectively empty. The above class works correctly in this case , but we might want to have always - a coherent state of the field variables , so we need another concept: the class [b]constructor[/b] - that will be discussed in the next paragraph.[br][br] - - Note: multiple inheritance (inheritance from more than one base class) is not implemented , KVIrc is not a compiler :)[br][br] - - Objects are much more powerful....[br][br] - - Do a [cmd]clearobjects[/cmd] to cleanup the old class definitions , and read on.[br][br] - - [big]Constructors and destructors[/big] - - The class constructor is a [b]function[/b] that is called automatically just after the object - has been created internally by KVIrc and just before the [fnc]$new[/fnc] - function returns. It should be used to setup the internal object state.[br] - Unlike in C++ , in KVIrc , the constructor CAN return a value:[br] - If it returns 0 it signals the object creation failure : the object - is immediately destroyed and [fnc]$new[/fnc]() returns 0 to the caller. - Any other return value is treated as success , so the object is effectively - created and [fnc]$new[/fnc]() returns its ID to the caller.[br] - All the builtin classes have a constructor defined that will almost never fail (only if we run out of memory), - so you can avoid to check the [fnc]$new[/fnc]() return value - when creating the instances of the built-in classes.[br][br] - - In derived classes you can override the constructor to setup your object's state.[br] - You should [b]always call the base class constructor[/b] in your overridden one , to setup - the base class state , and propagate its return value (eventually modified if the base class - constructor is succesfull but your derived class initialization fails).[br] - In practice , the builtin class constructors do nothing other than setting the return - value to 1 so you can even avoid to call them, but in any other case you must do it.[br][br] - - This is different from C (for example), where the constructors are called (more or less) - automatically.[br][br] - - [big]Signals and slots[/big] - - The signals and slots are a powerful mean of inter-object communication. - A signal is emitted by an object to notify a change in its state. - For example , the [class:button]button class[/class] emits the - [classsignal:button]clicked[/classsignal] signal when the user clicks the button.[br][br] - A signal is emitted by an object and can be received and handled by any other existing object - (including the object that emits the signal).[br] - The handler function for a signal is called "slot".[br] - It is just a convention : in fact , a slot is a normal object function (and any object function can be a slot). - More than one slot can be connected to a single signal , and more signals can be connected to a single slot.[br] - In this way , many objects can be notified of a change in a single object , as well as a single object - can easily handle state-changes for many objects.[br] - The signal / slot behaviour could be easily implemented by a careful usage of object functions. - [b]So why signals and slots ?[/b][br] - Because signals are much more powerful in many situations. - The signals have no equivalent in C/C++...but they have been implemented in many highlevel - C/C++ libraries and development kits (including the system-wide signal/handler mechanism implemented - by all the modern kernels and used in inter-process communication).[br] -*/ - - - - -/////////////////////////////////////////////////////////////////////////////////////// - -/* - @doc: object - @keyterms: - object class, object, class - @title: - object class - @type: - class - @short: - Base class for all the KVIrc objects - @inherits: - none - @description: - This is the base class for all the builtin KVirc object classes. - It exports the functions to retrieve the object name, to iterate - through children objects and to lookup a child object by name or class. - Additionally , this class provides the builtin timer functionality. - The [classfnc]$constructor[/classfnc] and [classfnc]$destructor[/classfnc] - functions are empty implementations that all the other classes inherit. - @functions: - !fn: $constructor() - Constructor for this object class. - The default implementation does nothing. - !fn: $destructor() - Destructor for this object class. - The default implementation emits the signal "[classsignal]destroyed[/classsignal]". - !fn: $name() - Returns the name of this object. - !fn: $parent() - Returns the parent object of this object or 0 if this object has no parent. - !fn: $timerEvent(<timerId>) - Handler for the timer events. - The default implementation does nothing. - See also [classfnc]$startTimer[/classfnc]() - and [classfnc]$killTimer[/classfnc](). - !fn: $startTimer(<timeout>) - Starts a builtin timer for this object and returns its timer id - as a string or '-1' if the <timeout> was invalid. - The [classfnc]$timerEvent[/classfnc]() handler function - will be called at each <timeout>. The <timeout> is in milliseconds. - !fn: $killTimer(<timer id>) - Stops the timer specified by <timer id>. - !fn: $killTimers() - Stops all the builtin timers running. - !fn: $className() - Returns the class name of this object instance - !fn: $findChild(<class>,<name>) - Returns the first child that matches <class> and <name>. - If <class> is an empty string, any class matches, - if <name> is an empty string, any name matches. - This function traverses the entire tree of children - but is NOT recursive. - !fn: $childCount() - Returns the number of children objects - !fn: $emit(<signal_name>[,parameters]) - Emits the signal <signal_name> passing the optional [parameters]. - See the [doc:objects]objects documentation[/doc] for an overview of signals and slots. - !fn: $children() - Returns an array of children object identifiers. - !fn: $signalSender() - Returns the current signal sender when in a slot connected to a signal. - In other contexts this function returns an empty string. - You can safely use it to test if the current function has been - triggered directly or from a signal emission. - !fn: $signalName() - Returns the name of the signal last signal that has triggered - one of this object's slots. - This means that in a slot handler it returns the name of the signal - that has triggered it. - !fn: $property(<Qt property name>[,bNowarning:boolean]) - This is for really advanced scripting.[br] - All KVIrc widgets are based on the Qt library ones.[br] - The Qt library allow to set and read special properties.[br] - You will have to take a look at the Qt documentation for each widget type - to see the available property names.[br] - The supported property types are: Rect, Size, Point, Color, String, CString, - Int, UInt, Bool and enumeration types.[br] - For example, the widget's x coordinate can be retrieved by using the [classfnc]$x[/classfnc]() - function or by calling $property(x).[br] - There are many properties that are available ony through the [classfnc]$property()[classfnc]" call:[br] - For example, you can find out if the widget accepts drops by calling [classfnc]$property(acceptDrops)[classfnc].[br] - This function will be mainly useful in the [class]wrapper[/class] class. - !fn: $setProperty(<Qt property>,<property value>) - Sets a qt property for this widget.[br] - This is for advanced scripting, and can control really many features of the Qt widgets.[br] - For example, the [class]multilineedit[/class] widgets can be set to - the "password" echo mode only by using this function call:[br] - [example] - %X=$new(lineedit, 0, a_name) - %X->$show() - %X->$setProperty(echoMode,Password) - [/example] - The available properties to be set are listed by [classfnc]$listProperties[/classfnc]()[br] - and must appear in the list as writeable.[br] - This function will be mainly useful in the [class]wrapper[/class] class. - !fn: $listProperties([bArray]) - Lists the properties of this object.[br] - If <bArray> is $true then the function returns the properties - as an array of descriptive strings, otherwise the properties are dumped to the - active window. If <bArray> is not passed then it is assumed to be $false. - This function will be mainly useful in the [class]wrapper[/class] class. - @signals: - !sg: destroyed() - Emitted by the default implementation of [classfnc]$destructor[/classfnc]. - If you reimplement [classfnc]$destructor[/classfnc] in one of the derived - classes (or as a private implementation), and still want this signal - to be emitted you must emit it by yourself, or (better) call the base class - destructor. -*/ - -// we use a char * pointer just to store a number -// we don't use void * just because incrementing a void pointer doesn't look that good -static char * g_hNextObjectHandle = (char *)0; - - -KviKvsObject::KviKvsObject(KviKvsObjectClass * pClass,KviKvsObject * pParent,const QString &szName) -: QObject(pParent) -{ - if(g_hNextObjectHandle == 0)g_hNextObjectHandle++; // make sure it's never 0 - m_hObject = (kvs_hobject_t)g_hNextObjectHandle; - g_hNextObjectHandle++; - - m_pObject = 0; - m_bObjectOwner = true; // true by default - - m_szName = szName; - - m_pClass = pClass; - - m_pChildList = new KviPointerList<KviKvsObject>; - m_pChildList->setAutoDelete(false); - - m_pDataContainer = new KviKvsHash(); - - m_pFunctionHandlers = 0; // no local function handlers yet! - - m_bInDelayedDeath = false; - - m_pSignalDict = 0; // no signals connected to remote slots - m_pConnectionList = 0; // no local slots connected to remote signals - - if(pParent)pParent->registerChild(this); - - KviKvsKernel::instance()->objectController()->registerObject(this); - -// debug("Hello world!"); -// [root@localhost cvs3]# kvirc -// Hello world! -// [root@localhost cvs3]# date -// Tue Sep 5 21:53:54 CEST 2000 -// [root@localhost cvs3]# - -// Ported to KVS on 29.04.2005 -} - -KviKvsObject::~KviKvsObject() -{ - m_bInDelayedDeath = true; - - callFunction(this,"destructor"); - - while(m_pChildList->first())delete m_pChildList->first(); - delete m_pChildList; - -#if 0 - // Disconnect all the signals - if(m_pSignalDict) - { - KviPointerHashTableIterator<QString,KviKvsObjectConnectionList> it(*m_pSignalDict); - - while(it.current()) - { - KviKvsObjectConnectionListIterator cit(*(it.current())); - while(cit.current()) - { - disconnectSignal(it.currentKey(),cit.current()); - // ++cit // NO!...we point to the next now! - } - // the iterator should automatically point to the next now - //if(m_pSignalDict)++it; - } - } - - // Disconnect all the slots - if(m_pConnectionList) - { - KviKvsObjectConnectionListIterator cit(*m_pConnectionList); - while(cit.current()) - { - QString szSig = cit.current()->szSignal; - cit.current()->pSourceObject->disconnectSignal(szSig,cit.current()); - //++cit;// NO!... we point to the next now! - } - } -#else - // Disconnect all the signals - for(;;) - { - if(!m_pSignalDict)break; - KviPointerHashTableEntry<QString,KviKvsObjectConnectionList> * pSignalList = m_pSignalDict->firstEntry(); - if(!pSignalList)break; - KviKvsObjectConnection * pConnection = pSignalList->data()->first(); - if(!pConnection)break; - disconnectSignal(pSignalList->key(),pConnection); - } - - // Disconnect all the slots - for(;;) - { - if(!m_pConnectionList)break; - KviKvsObjectConnection * pConnection = m_pConnectionList->first(); - if(!pConnection)break; - QString szSignalCopy = pConnection->szSignal; // we need this since pConnection is deleted inside disconnectSignal() and pConnection->szSignal dies too (but is referenced after the connection delete) - pConnection->pSourceObject->disconnectSignal(szSignalCopy,pConnection); - } -#endif - - KviKvsKernel::instance()->objectController()->unregisterObject(this); - - if(parentObject())parentObject()->unregisterChild(this); - - if(m_pObject) - { - disconnect(m_pObject,SIGNAL(destroyed()),this,SLOT(objectDestroyed())); - if(m_bObjectOwner)delete m_pObject; - } - - delete m_pDataContainer; - if(m_pFunctionHandlers)delete m_pFunctionHandlers; -} - -bool KviKvsObject::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) -{ - return true; -} - -QWidget * KviKvsObject::parentScriptWidget() -{ - if(parentObject()) - { - if(parentObject()->object()) - { - if(parentObject()->object()->isWidgetType()) - return (QWidget *)(parentObject()->object()); - } - } - return 0; -} - -void KviKvsObject::unregisterChild(KviKvsObject *pChild) -{ - m_pChildList->removeRef(pChild); -} - -void KviKvsObject::registerChild(KviKvsObject *pChild) -{ - m_pChildList->append(pChild); -} - -// SIGNAL/SLOT stuff - -bool KviKvsObject::connectSignal(const QString &sigName,KviKvsObject * pTarget,const QString &slotName) -{ - if(!pTarget->lookupFunctionHandler(slotName))return false; // no such slot - - if(!m_pSignalDict) - { - m_pSignalDict = new KviPointerHashTable<QString,KviKvsObjectConnectionList>(7,false); - m_pSignalDict->setAutoDelete(true); - } - - KviKvsObjectConnectionList * l = m_pSignalDict->find(sigName); - if(!l) - { - l = new KviKvsObjectConnectionList; - l->setAutoDelete(true); - m_pSignalDict->insert(sigName,l); - } - - KviKvsObjectConnection * con = new KviKvsObjectConnection; - - con->pSourceObject = this; - con->pTargetObject = pTarget; - con->szSignal = sigName; - con->szSlot = slotName; - - l->append(con); - pTarget->registerConnection(con); - return true; -} - -void KviKvsObject::registerConnection(KviKvsObjectConnection *pConnection) -{ - if(!m_pConnectionList) - { - m_pConnectionList = new KviKvsObjectConnectionList; - m_pConnectionList->setAutoDelete(false); - } - m_pConnectionList->append(pConnection); -} - -bool KviKvsObject::disconnectSignal(const QString &sigName,KviKvsObject * pTarget,const QString &slotName) -{ - if(!m_pSignalDict)return false; //no such signal to disconnect - - KviKvsObjectConnectionList * l = m_pSignalDict->find(sigName); - if(!l)return false; - - KviKvsObjectConnectionListIterator it(*l); - - while(KviKvsObjectConnection * sl = it.current()) - { - if(sl->pTargetObject == pTarget) - { - if(KviQString::equalCI(sl->szSlot,slotName)) - { - pTarget->unregisterConnection(sl); - l->removeRef(sl); - if(l->isEmpty())m_pSignalDict->remove(sigName); - if(m_pSignalDict->isEmpty()) - { - delete m_pSignalDict; - m_pSignalDict = 0; - } - return true; - } - } - ++it; - } - return false; -} - -bool KviKvsObject::disconnectSignal(const QString &sigName,KviKvsObjectConnection * pConnection) -{ - if(!m_pSignalDict)return false; - KviKvsObjectConnectionList * l = m_pSignalDict->find(sigName); - //__range_valid(l); - if(!l)return false; - pConnection->pTargetObject->unregisterConnection(pConnection); - //__range_valid(l->findRef(pConnection) > -1); - l->removeRef(pConnection); - if(l->isEmpty())m_pSignalDict->remove(sigName); - if(m_pSignalDict->isEmpty()) - { - delete m_pSignalDict; - m_pSignalDict = 0; - } - return true; -} - -bool KviKvsObject::unregisterConnection(KviKvsObjectConnection * pConnection) -{ - if(!m_pConnectionList)return false; - bool bOk = m_pConnectionList->removeRef(pConnection); // no auto delete ! - if(!bOk)return false; - if(m_pConnectionList->isEmpty()) - { - delete m_pConnectionList; - m_pConnectionList = 0; - } - return true; -} - -int KviKvsObject::emitSignal(const QString &sigName,KviKvsObjectFunctionCall * pOuterCall,KviKvsVariantList * pParams) -{ - if(!m_pSignalDict)return 0; - - KviKvsObjectConnectionList * l = m_pSignalDict->find(sigName); - if(!l)return 0; // no slots registered - - KviKvsVariant retVal; - - // The objects we're going to disconnect - KviPointerList<KviKvsObjectConnection> * pDis = 0; - - kvs_int_t emitted = 0; - - KviKvsObjectConnectionListIterator it(*l); - - while(KviKvsObjectConnection * s = it.current()) - { - // save it , since s may be destroyed in the call! - KviKvsObject * pTarget = s->pTargetObject; - - emitted++; - - kvs_hobject_t hTarget = pTarget->handle(); - kvs_hobject_t hOld = pTarget->signalSender(); - - pTarget->setSignalSender(m_hObject); - pTarget->setSignalName(sigName); - - if(!pTarget->callFunction(this,s->szSlot,QString::null,pOuterCall->context(),&retVal,pParams)) - { - if(KviKvsKernel::instance()->objectController()->lookupObject(hTarget) && it.current()) - { - pOuterCall->warning( - __tr2qs("Broken slot '%Q' in target object '%Q::%Q' while emitting signal '%Q' from object '%Q::%Q': disconnecting"), - &(s->szSlot), - &(s->pTargetObject->getClass()->name()), - &(s->pTargetObject->getName()), - &(sigName), - &(getClass()->name()), - &m_szName); - - if(!pDis) - { - pDis = new KviPointerList<KviKvsObjectConnection>; - pDis->setAutoDelete(false); - } - pDis->append(s); - } else { - // else destroyed in the call! (already disconnected) - - pOuterCall->warning( - __tr2qs("Slot target object destroyed while emitting signal '%Q' from object '%Q::%Q'"), - &(sigName), - &(getClass()->name()), - &m_szName); - } - } - - if(KviKvsKernel::instance()->objectController()->lookupObject(hTarget)) - { - pTarget->setSignalSender(hOld); - } - - ++it; - } - - if(pDis) - { - // we have some signals to disconnect (because they're broken) - for(KviKvsObjectConnection * con = pDis->first();con;con = pDis->next()) - disconnectSignal(sigName,con); - delete pDis; - } - - return emitted; -} - -bool KviKvsObject::function_name(KviKvsObjectFunctionCall * c) -{ - c->returnValue()->setString(getName()); - return true; -} - -bool KviKvsObject::function_parent(KviKvsObjectFunctionCall * c) -{ - KviKvsObject * o = parentObject(); - c->returnValue()->setHObject(o ? o->handle() : (kvs_hobject_t)0); - return true; -} - -bool KviKvsObject::function_className(KviKvsObjectFunctionCall * c) -{ - c->returnValue()->setString(getClass()->name()); - return true; -} - -bool KviKvsObject::function_childCount(KviKvsObjectFunctionCall * c) -{ - c->returnValue()->setInteger((kvs_int_t)(m_pChildList->count())); - return true; -} - -bool KviKvsObject::function_signalSender(KviKvsObjectFunctionCall * c) -{ - c->returnValue()->setHObject(m_hSignalSender); - return true; -} - -bool KviKvsObject::function_signalName(KviKvsObjectFunctionCall * c) -{ - c->returnValue()->setString(m_szSignalName); - return true; -} - -bool KviKvsObject::function_destructor(KviKvsObjectFunctionCall * c) -{ - emitSignal("destroyed",c); - return true; -} - -bool KviKvsObject::function_children(KviKvsObjectFunctionCall * c) -{ - KviKvsArray * a = new KviKvsArray(); - int id=0; - for(KviKvsObject * o = m_pChildList->first();o;o = m_pChildList->next()) - { - a->set(id,new KviKvsVariant(o->handle())); - id++; - } - c->returnValue()->setArray(a); - return true; -} -bool KviKvsObject::function_findChild(KviKvsObjectFunctionCall * c) -{ - QString szClass,szName; - KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("className",KVS_PT_STRING,KVS_PF_OPTIONAL,szClass) - KVSO_PARAMETER("objectName",KVS_PT_STRING,KVS_PF_OPTIONAL,szName) - KVSO_PARAMETERS_END(c) - - KviKvsObject * o = findChild(szClass,szName); - c->returnValue()->setHObject(o ? o->handle() : (kvs_hobject_t)0); - - return true; -} - -bool KviKvsObject::function_emit(KviKvsObjectFunctionCall * c) -{ - QString szSignal; - KviKvsVariantList vList; - KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("signal",KVS_PT_NONEMPTYSTRING,0,szSignal) - KVSO_PARAMETER("params",KVS_PT_VARIANTLIST,KVS_PF_OPTIONAL,vList) - KVSO_PARAMETERS_END(c) - - emitSignal(szSignal,c,&vList); - return true; -} - -bool KviKvsObject::function_startTimer(KviKvsObjectFunctionCall * c) -{ - kvs_int_t timeout; - KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("timeout",KVS_PT_UINT,0,timeout) - KVSO_PARAMETERS_END(c) - - c->returnValue()->setInteger((kvs_int_t)(startTimer(timeout))); - return true; -} - -bool KviKvsObject::function_killTimer(KviKvsObjectFunctionCall * c) -{ - kvs_int_t id; - KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("timerId",KVS_PT_INT,0,id) - KVSO_PARAMETERS_END(c) - killTimer(id); - return true; -} - -bool KviKvsObject::function_killTimers(KviKvsObjectFunctionCall * c) -{ - // FIXME: QT4 does not seem to have QObject::killTimers() -#ifndef COMPILE_USE_QT4 - killTimers(); -#endif - return true; -} - -bool KviKvsObject::function_listProperties(KviKvsObjectFunctionCall * c) -{ - bool bArray; - KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bArray",KVS_PT_BOOL,KVS_PF_OPTIONAL,bArray) - KVSO_PARAMETERS_END(c) - - c->returnValue()->setNothing(); - - KviKvsArray * a = bArray ? new KviKvsArray() : 0; - - KviWindow * w = c->context()->window(); - - if(!bArray) - w->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Listing Qt properties for object named \"%Q\" of KVS class %Q"),&m_szName,&(m_pClass->name())); - kvs_int_t cnt = 0; - if(m_pObject) - { - const QMetaObject *o = m_pObject->metaObject(); - if(!bArray) - w->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Properties for Qt class %s"),o->className()); -#ifndef COMPILE_USE_QT4 - while(o) - { -#endif - kvs_int_t idx = 0; - #ifdef COMPILE_USE_QT4 - QMetaProperty prop = o->property(idx); - const QMetaProperty *p = ∝ - #else - const QMetaProperty *p = o->property(idx); - #endif - - while(p) - { - QString szOut; - QString szName = p->name(); - #ifdef COMPILE_USE_QT4 - QString szType = p->typeName(); - #else - QString szType = p->type(); - #endif - if(bArray) - KviQString::sprintf(szOut,"%Q, %Q",&szName,&szType); - else { - KviQString::sprintf(szOut,__tr2qs("Property: %c%Q%c, type %Q"),KVI_TEXT_BOLD,&szName,KVI_TEXT_BOLD,&szType); - szOut.prepend(" "); - } - - if(p->isEnumType()) - { - szOut += ", enum("; -#ifndef COMPILE_USE_QT4 - // FIXME: Qt 4.x needs QMetaEnum for this loop - QStrList le = p->enumKeys(); - int i = 0; - for(char *c2 = le.first(); c2; c2 = le.next()) - { - if(i == 0) - i++; - else - szOut.append(", "); - szOut.append(c2); - } -#endif - szOut += ")"; - } - - -#ifdef COMPILE_USE_QT4 - // FIXME: QT4 Need to read better the docs and check the changes: there seem to be too many - // for me to fix now. Actually I need to get the whole executable working... - if(p->isWritable())szOut += ", writable"; -#else - if(p->isSetType())szOut += ", set"; - if(p->writable())szOut += ", writable"; -#endif - if(bArray) - a->set(cnt,new KviKvsVariant(szOut)); - else - w->outputNoFmt(KVI_OUT_SYSTEMMESSAGE,szOut); -#ifdef COMPILE_USE_QT4 - idx++; - if (idx<o->propertyCount()){ - prop = o->property(idx); - p = ∝ - } - else p=0; -#else - p = o->property(idx); - idx++; -#endif - - cnt++; - } -#ifndef COMPILE_USE_QT4 - o = o->superClass(); - } -#endif - - } - - if(bArray) - c->returnValue()->setArray(a); - else - w->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("%d properties listed"),cnt); - return true; -} - - -// rewritten using the new KVS features :) -bool KviKvsObject::function_setProperty(KviKvsObjectFunctionCall * c) -{ - QString szName; - KviKvsVariant * v; - KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("propertyName",KVS_PT_NONEMPTYSTRING,0,szName) - KVSO_PARAMETER("propertyValue",KVS_PT_VARIANT,0,v) - KVSO_PARAMETERS_END(c) - - c->returnValue()->setNothing(); - - if(!m_pObject) - { - // there are no Qt properties at all - c->warning(__tr2qs("The object named \"%Q\" of class %Q has no Qt properties"),&m_szName,&(m_pClass->name())); - return true; - } - -#ifdef COMPILE_USE_QT4 - int idx = m_pObject->metaObject()->indexOfProperty(szName); -#else - int idx = m_pObject->metaObject()->findProperty(szName,true); -#endif - if(idx < 0) - { - c->warning(__tr2qs("No Qt property named \"%Q\" for object named \"%Q\" of class %Q"),&szName,&m_szName,&(m_pClass->name())); - return true; - } -#ifdef COMPILE_USE_QT4 - QMetaProperty prop = m_pObject->metaObject()->property(idx); - const QMetaProperty * p = ∝ -#else - const QMetaProperty * p = m_pObject->metaObject()->property(idx,true); -#endif - if(!p) - { - c->warning(__tr2qs("Can't find property named \"%Q\" for object named \"%Q\" of class %Q: the property is indexed but it doesn't really exist"),&szName,&m_szName,&(m_pClass->name())); - return true; - } - - QVariant vv = m_pObject->property(szName); - if(!vv.isValid()) - { - c->warning(__tr2qs("Can't find property named \"%Q\" for object named \"%Q\" of class %Q: the property is indexed and defined but the returned variant is not valid"),&szName,&m_szName,&(m_pClass->name())); - return true; - } - - if(p->isEnumType()) - { - QString szKey; - v->asString(szKey); -#ifdef COMPILE_USE_QT4 - int val = p->enumerator().keyToValue(szKey); -#else - int val = p->keyToValue(szKey); -#endif - QVariant var(val); - m_pObject->setProperty(szName,var); - return true; - } - -#define WRONG_TYPE(__therighttype) \ - { \ - c->warning(__tr2qs("The property is of type %s but the supplied argument can't be converted to that type (expecting \"%s\")"),p->type(),__therighttype); \ - return true; \ - } - - switch(vv.type()) - { - case QVariant::Int: - { - kvs_int_t i; - if(!v->asInteger(i))WRONG_TYPE("integer") - m_pObject->setProperty(szName,QVariant((int)i)); - } - break; - case QVariant::UInt: - { - kvs_int_t i; - if(!v->asInteger(i))WRONG_TYPE("unsigned integer") - if(i < 0)WRONG_TYPE("unsigned integer") - m_pObject->setProperty(szName,QVariant((unsigned int)i)); - } - break; - case QVariant::Bool: - m_pObject->setProperty(szName,QVariant(v->asBoolean())); - break; - case QVariant::String: - { - QString s; - v->asString(s); - m_pObject->setProperty(szName,QVariant(s)); - } - break; - case QVariant::CString: - { - QString s; - v->asString(s); - m_pObject->setProperty(szName,QVariant(s.utf8())); - } - break; - case QVariant::Point: - { - if(!v->isArray())WRONG_TYPE("array(integer,integer)") - KviKvsArray * a = v->array(); - KviKvsVariant * x = a->at(0); - KviKvsVariant * y = a->at(1); - if(!x || !y)WRONG_TYPE("array(integer,integer)") - kvs_int_t iX,iY; - if(!x->asInteger(iX) || !y->asInteger(iY))WRONG_TYPE("array(integer,integer)") - m_pObject->setProperty(szName,QVariant(QPoint(iX,iY))); - } - break; - case QVariant::Size: - { - if(!v->isArray())WRONG_TYPE("array(integer,integer)") - KviKvsArray * a = v->array(); - KviKvsVariant * w = a->at(0); - KviKvsVariant * h = a->at(1); - if(!w || !h)WRONG_TYPE("array(integer,integer)") - kvs_int_t iW,iH; - if(!w->asInteger(iW) || !h->asInteger(iH))WRONG_TYPE("array(integer,integer)") - m_pObject->setProperty(szName,QVariant(QSize(iW,iH))); - } - break; - case QVariant::Rect: - { - if(!v->isArray())WRONG_TYPE("array(integer,integer,integer,integer)") - KviKvsArray * a = v->array(); - KviKvsVariant * x = a->at(0); - KviKvsVariant * y = a->at(1); - KviKvsVariant * w = a->at(2); - KviKvsVariant * h = a->at(3); - if(!x || !y || !w || !h)WRONG_TYPE("array(integer,integer,integer,integer)") - kvs_int_t iX,iY,iW,iH; - if(!x->asInteger(iX) || !y->asInteger(iY) || !w->asInteger(iW) || !h->asInteger(iH))WRONG_TYPE("array(integer,integer,integer,integer)") - m_pObject->setProperty(szName,QVariant(QRect(iX,iY,iW,iH))); - } - break; -#ifndef COMPILE_USE_QT4 - // FIXME: QT4 ???? - case QVariant::Color: - { - if(!v->isArray())WRONG_TYPE("array(integer,integer,integer)") - KviKvsArray * a = v->array(); - KviKvsVariant * r = a->at(0); - KviKvsVariant * g = a->at(1); - KviKvsVariant * b = a->at(3); - if(!r || !g || !b)WRONG_TYPE("array(integer,integer,integer)") - kvs_int_t iR,iG,iB; - if(!r->asInteger(iR) || !g->asInteger(iG) || !b->asInteger(iB))WRONG_TYPE("array(integer,integer,integer)") - m_pObject->setProperty(szName,QVariant(QColor(iR,iG,iB))); - } - break; - case QVariant::Font: - { - if(!v->isArray())WRONG_TYPE("array(string,integer,string)") - KviKvsArray * a = v->array(); - KviKvsVariant * ff = a->at(0); - KviKvsVariant * ps = a->at(1); - KviKvsVariant * fl = a->at(3); - if(!ff || !ps)WRONG_TYPE("array(string,integer,string)") - kvs_int_t iPs; - if(!ps->asInteger(iPs))WRONG_TYPE("array(string,integer,string)") - QString szFf,szFl; - ff->asString(szFf); - if(fl)fl->asString(szFl); - QFont fnt; - fnt.setFamily(szFf); - fnt.setPointSize(iPs); - if(szFl.find('b') != -1)fnt.setBold(true); - if(szFl.find('i') != -1)fnt.setItalic(true); - if(szFl.find('u') != -1)fnt.setUnderline(true); - if(szFl.find('o') != -1)fnt.setOverline(true); - if(szFl.find('f') != -1)fnt.setFixedPitch(true); - if(szFl.find('s') != -1)fnt.setStrikeOut(true); - m_pObject->setProperty(szName,QVariant(fnt)); - } - break; - case QVariant::Pixmap: - case QVariant::IconSet: - { - if(v->isHObject()) - { - if(v->hobject() == (kvs_hobject_t)0) - { - // null pixmap - if(vv.type() == QVariant::Pixmap) - m_pObject->setProperty(szName,QVariant(QPixmap())); - else - m_pObject->setProperty(szName,QVariant(QIconSet())); - } else { - KviKvsObject * pix = KviKvsKernel::instance()->objectController()->lookupObject(v->hobject()); - if(!pix->inherits("KviScriptPixmapObject")) - c->warning(__tr2qs("A pixmap object, an image_id or an image file path is required for this property")); - else { - QVariant pixv = pix->property("pixmap"); - if(vv.type() == QVariant::Pixmap) - m_pObject->setProperty(szName,pixv); - else - m_pObject->setProperty(szName,QVariant(QIconSet(pixv.toPixmap()))); - } - } - } else { - QString szStr; - v->asString(szStr); - QPixmap * pPix = g_pIconManager->getImage(szStr); - if(pPix) - { - if(vv.type() == QVariant::Pixmap) - m_pObject->setProperty(szName,QVariant(*pPix)); - else - m_pObject->setProperty(szName,QVariant(QIconSet(*pPix))); - } - else - c->warning(__tr2qs("Can't find the requested image")); - } - } - break; -#endif - default: - c->warning(__tr2qs("Property \"%Q\" for object named \"%Q\" of class %Q has an unsupported data type"),&szName,&m_szName,&(m_pClass->name())); - c->returnValue()->setNothing(); - break; - } - return true; -} - -bool KviKvsObject::function_property(KviKvsObjectFunctionCall * c) -{ - QString szName; - bool bNoerror; - KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("propertyName",KVS_PT_NONEMPTYSTRING,0,szName) - KVSO_PARAMETER("bNowarning",KVS_PT_BOOL,KVS_PF_OPTIONAL,bNoerror) - KVSO_PARAMETERS_END(c) - - if(!m_pObject) - { - // there are no Qt properties at all - if (bNoerror) c->returnValue()->setString("No Qt properties"); - else - { - c->warning(__tr2qs("The object named \"%Q\" of class %Q has no Qt properties"),&m_szName,&(m_pClass->name())); - c->returnValue()->setNothing(); - } - return true; - } - -#ifdef COMPILE_USE_QT4 - int idx = m_pObject->metaObject()->indexOfProperty(szName); -#else - int idx = m_pObject->metaObject()->findProperty(szName,true); -#endif - if(idx < 0) - { - if (bNoerror) c->returnValue()->setString("No Qt properties"); - else - { - c->warning(__tr2qs("No Qt property named \"%Q\" for object named \"%Q\" of class %Q"),&szName,&m_szName,&(m_pClass->name())); - c->returnValue()->setNothing(); - } - return true; - } -#ifdef COMPILE_USE_QT4 - QMetaProperty prop = m_pObject->metaObject()->property(idx); - const QMetaProperty * p = ∝ -#else - const QMetaProperty * p = m_pObject->metaObject()->property(idx,true); -#endif - if(!p) - { - c->warning(__tr2qs("Can't find property named \"%Q\" for object named \"%Q\" of class %Q: the property is indexed but it doesn't really exist"),&szName,&m_szName,&(m_pClass->name())); - c->returnValue()->setNothing(); - return true; - } - - QVariant v = m_pObject->property(szName); - if(!v.isValid()) - { - c->warning(__tr2qs("Can't find property named \"%Q\" for object named \"%Q\" of class %Q: the property is indexed and defined but the returned variant is not valid"),&szName,&m_szName,&(m_pClass->name())); - c->returnValue()->setNothing(); - return true; - } - - if(p->isEnumType()) - { -#ifdef COMPILE_USE_QT4 - c->returnValue()->setString(p->enumerator().valueToKey(v.toInt())); -#else - c->returnValue()->setString(p->valueToKey(v.toInt())); -#endif - return true; - } - - switch(v.type()) - { - case QVariant::Int: - c->returnValue()->setInteger((kvs_int_t)v.toInt()); - break; - case QVariant::UInt: - c->returnValue()->setInteger((kvs_int_t)v.toUInt()); - break; - case QVariant::Bool: - c->returnValue()->setBoolean(v.toBool()); - break; - case QVariant::String: - c->returnValue()->setString(v.toString()); - break; - case QVariant::CString: - c->returnValue()->setString(QString::fromUtf8(v.toCString().data())); - break; - case QVariant::Point: - { - QPoint p = v.toPoint(); - KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant((kvs_int_t)p.x())); - a->set(1,new KviKvsVariant((kvs_int_t)p.y())); - c->returnValue()->setArray(a); - } - break; - case QVariant::Size: - { - QSize p = v.toSize(); - KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant((kvs_int_t)p.width())); - a->set(1,new KviKvsVariant((kvs_int_t)p.height())); - c->returnValue()->setArray(a); - } - break; - case QVariant::Rect: - { - QRect p = v.toRect(); - KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant((kvs_int_t)p.x())); - a->set(1,new KviKvsVariant((kvs_int_t)p.y())); - a->set(2,new KviKvsVariant((kvs_int_t)p.width())); - a->set(3,new KviKvsVariant((kvs_int_t)p.height())); - c->returnValue()->setArray(a); - } - break; -#ifndef COMPILE_USE_QT4 - // FIXME: QT4 ? - case QVariant::Color: - { - QColor clr = v.toColor(); - KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant((kvs_int_t)clr.red())); - a->set(1,new KviKvsVariant((kvs_int_t)clr.green())); - a->set(2,new KviKvsVariant((kvs_int_t)clr.blue())); - c->returnValue()->setArray(a); - } - break; - case QVariant::Font: - { - QFont f = v.toFont(); - KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant(f.family())); - a->set(1,new KviKvsVariant((kvs_int_t)f.pointSize())); - QString szFlags; - if(f.bold())szFlags += "b"; - if(f.underline())szFlags += "u"; - if(f.overline())szFlags += "o"; - if(f.strikeOut())szFlags += "s"; - if(f.fixedPitch())szFlags += "f"; - if(f.italic())szFlags += "i"; - a->set(2,new KviKvsVariant(szFlags)); - c->returnValue()->setString(szFlags); - } - break; -#endif - default: - if (bNoerror) c->returnValue()->setString("Unsupported_data_type"); - else - { - c->warning(__tr2qs("Property \"%Q\" for object named \"%Q\" of class %Q has an unsupported data type"),&szName,&m_szName,&(m_pClass->name())); - c->returnValue()->setNothing(); - } - break; - } - return true; -} - -void KviKvsObject::killAllChildrenWithClass(KviKvsObjectClass *cl) -{ - KviPointerList<KviKvsObject> l; - l.setAutoDelete(true); - for(KviKvsObject * o=m_pChildList->first();o;o=m_pChildList->next()) - { - if(o->getClass() == cl) - { - l.append(o); - } else o->killAllChildrenWithClass(cl); - } -} - -bool KviKvsObject::inheritsClass(KviKvsObjectClass * pClass) -{ - if(pClass == m_pClass)return true; - KviKvsObjectClass * cl = m_pClass->m_pParentClass; - while(cl) - { - if(cl == pClass)return true; - else cl = cl->m_pParentClass; - } - return false; -} - -KviKvsObjectClass * KviKvsObject::getClass(const QString & classOverride) -{ - if(classOverride.isEmpty())return m_pClass; - KviKvsObjectClass * cl = m_pClass; // class override can be also THIS class - // if object->$function() is a local override, class::object->$function() - // is the class member function (not the local override) - while(cl) - { - if(KviQString::equalCI(cl->name(),classOverride))break; - else cl = cl->m_pParentClass; - } - return cl; -} - -KviKvsObjectFunctionHandler * KviKvsObject::lookupFunctionHandler(const QString & funcName,const QString & classOverride) -{ - KviKvsObjectFunctionHandler * h = 0; - - if(classOverride.isEmpty() && m_pFunctionHandlers) - { - // lookup the local overrides - h = m_pFunctionHandlers->find(funcName); - } - - if(!h) - { - // not a local override function... lookup in the class - KviKvsObjectClass * cl = getClass(classOverride); - if(cl)return cl->lookupFunctionHandler(funcName); - } - - return h; -} - - -bool KviKvsObject::die() -{ - if(m_bInDelayedDeath)return false; - m_bInDelayedDeath = true; - QTimer::singleShot(0,this,SLOT(delayedDie())); - return true; -} - -bool KviKvsObject::dieNow() -{ - if(m_bInDelayedDeath)return false; - m_bInDelayedDeath = true; - delete this; - return true; -} - -void KviKvsObject::delayedDie() -{ - delete this; // byez! -} - -void KviKvsObject::setObject(QObject * o,bool bIsOwned) -{ - //__range_invalid(m_pObject); - m_bObjectOwner = bIsOwned; - m_pObject = o; - o->installEventFilter(this); - connect(m_pObject,SIGNAL(destroyed()),this,SLOT(objectDestroyed())); -} - -void KviKvsObject::objectDestroyed() -{ - m_pObject = 0; - die(); -} - -bool KviKvsObject::eventFilter(QObject *o,QEvent *e) -{ - return false; // do not stop -} - -void KviKvsObject::timerEvent(QTimerEvent *e) -{ - KviKvsVariant * v = new KviKvsVariant(); - v->setInteger(e->timerId()); - KviKvsVariantList parms(v); - - callFunction(this,"timerEvent",&parms); -} - -bool KviKvsObject::callFunction(KviKvsObject * pCaller,const QString &fncName,KviKvsVariant * pRetVal,KviKvsVariantList * pParams) -{ - KviKvsVariant rv; - if(!pRetVal)pRetVal = &rv; - KviKvsRunTimeContext ctx(0,g_pApp->activeConsole(),KviKvsKernel::instance()->emptyParameterList(),pRetVal,0); - if(!pParams)pParams = KviKvsKernel::instance()->emptyParameterList(); - return callFunction(pCaller,fncName,QString::null,&ctx,pRetVal,pParams); -} - - -bool KviKvsObject::callFunction(KviKvsObject * pCaller,const QString &fncName,KviKvsVariantList * pParams) -{ - KviKvsVariant fakeRetVal; - return callFunction(pCaller,fncName,&fakeRetVal,pParams); -} - -bool KviKvsObject::callFunction( - KviKvsObject * pCaller, - const QString & fncName, - const QString & classOverride, - KviKvsRunTimeContext * pContext, - KviKvsVariant * pRetVal, - KviKvsVariantList * pParams) -{ - KviKvsObjectFunctionHandler * h = lookupFunctionHandler(fncName,classOverride); - - if(!h) - { - if(classOverride.isEmpty()) - pContext->error(__tr2qs("Cannot find object function $%Q for object named \"%Q\" of class %Q"),&fncName,&m_szName,&(getClass()->name())); - else - pContext->error(__tr2qs("Cannot find object function $%Q::%Q for object named \"%Q\" of class %Q"),&classOverride,&fncName,&m_szName,&(getClass()->name())); - return false; - } - - if(h->flags() & KviKvsObjectFunctionHandler::Internal) - { - if(pCaller != this) - { - pContext->error(__tr2qs("Cannot call internal object function $%Q (for object named \"%Q\" of class %Q) from this context"),&fncName,&m_szName,&(getClass()->name())); - return false; - } - } - - KviKvsObjectFunctionCall fc(pContext,pParams,pRetVal); - - return h->call(this,&fc); - - // Not only gcc spits out compiler errors: - // 25.09.2001 , at this point in file - - // c:\programmi\microsoft visual studio\myprojects\kvirc3\src\kvirc\uparser\kvi_scriptobject.cpp(1234) : fatal error C1001: INTERNAL COMPILER ERROR - // (compiler file 'E:\8168\vc98\p2\src\P2\main.c', line 494) - // Please choose the Technical Support command on the Visual C++ - // Help menu, or open the Technical Support help file for more information -} - - - -void KviKvsObject::registerPrivateImplementation(const QString &szFunctionName,const QString &szCode) -{ - if(szCode.isEmpty()) - { - if(m_pFunctionHandlers) - { - m_pFunctionHandlers->remove(szFunctionName); - if(m_pFunctionHandlers->isEmpty()) - { - delete m_pFunctionHandlers; - m_pFunctionHandlers = 0; - } - } - } else { - if(!m_pFunctionHandlers) - { - m_pFunctionHandlers = new KviPointerHashTable<QString,KviKvsObjectFunctionHandler>(7,false); - m_pFunctionHandlers->setAutoDelete(true); - } - - QString szContext = m_pClass->name(); - szContext += "[privateimpl]::"; - szContext += szFunctionName; - - m_pFunctionHandlers->replace(szFunctionName,new KviKvsObjectScriptFunctionHandler(szContext,szCode)); - } -} - - -KviKvsObject * KviKvsObject::findChild(const QString &szClass,const QString &szName) -{ - for(KviKvsObject * o = m_pChildList->first();o;o= m_pChildList->next()) - { - if(szClass.isEmpty()) - { - // any class matches - if(szName.isEmpty())return o; // any name matches - // name must match - if(KviQString::equalCI(szName,o->name()))return o; - } else { - if(KviQString::equalCI(szClass,o->getClass()->name())) - { - if(szName.isEmpty())return o; // any name matches - // name must match - if(KviQString::equalCI(szName,o->name()))return o; - } - } - KviKvsObject * c = o->findChild(szClass,szName); - if(c)return c; - } - return 0; -} - - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_object.h b/3.4.0/src/kvirc/kvs/kvi_kvs_object.h deleted file mode 100644 index 0f7db263db..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_object.h +++ /dev/null @@ -1,192 +0,0 @@ -#ifndef _KVI_KVS_OBJECT_H_ -#define _KVI_KVS_OBJECT_H_ -//============================================================================= -// -// File : kvi_kvs_object.h -// Created on Wed 08 Oct 2003 02:31:57 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_pointerlist.h" -#include "kvi_kvs_runtimecall.h" -#include "kvi_kvs_parameterprocessor.h" -#include "kvi_kvs_object_functionhandler.h" -#include "kvi_kvs_types.h" - -#include <qobject.h> - - -class KviKvsObjectFunctionCall; - -typedef struct _KviKvsObjectConnection -{ - KviKvsObject * pSourceObject; // source object (owner of the struct) - KviKvsObject * pTargetObject; // target object - QString szSignal; // source signal name - QString szSlot; // target slot function -} KviKvsObjectConnection; - -typedef KviPointerList<KviKvsObjectConnection> KviKvsObjectConnectionList; -typedef KviPointerListIterator<KviKvsObjectConnection> KviKvsObjectConnectionListIterator; - -class KVIRC_API KviKvsObject : public QObject -{ - friend class KviKvsObjectController; - friend class KviKvsObjectClass; - Q_OBJECT -public: - KviKvsObject(KviKvsObjectClass * pClass,KviKvsObject * pParent,const QString &szName); - virtual ~KviKvsObject(); -protected: - // main data - QString m_szName; // object name - kvs_hobject_t m_hObject; // global object handle - KviKvsObjectClass * m_pClass; // the class definition - - KviKvsHash * m_pDataContainer; // member variables - - KviPointerList<KviKvsObject> * m_pChildList; - - KviPointerHashTable<QString,KviKvsObjectFunctionHandler> * m_pFunctionHandlers; // our function handlers - - KviPointerHashTable<QString,KviKvsObjectConnectionList> * m_pSignalDict; // our signals connected to other object functions - - KviKvsObjectConnectionList * m_pConnectionList; // signals connected to this object functions - - // this is valid when processing one of our slots - kvs_hobject_t m_hSignalSender; - QString m_szSignalName; - - // if this object wraps a qt one, it is here - QObject * m_pObject; - bool m_bObjectOwner; // do we have to destroy it ? - - // internal stuff for die() - bool m_bInDelayedDeath; -public: - kvs_hobject_t handle(){ return m_hObject; }; - - // the wrapped Qt object (may be 0!) - QObject * object() const { return m_pObject; }; - void setObject(QObject * o,bool bIsOwned = true); - - const QString & getName(){ return m_szName; }; - - KviKvsObject * parentObject(){ return (KviKvsObject *)parent(); }; - QWidget * parentScriptWidget(); - - bool connectSignal(const QString &sigName,KviKvsObject * target,const QString &slotName); - bool disconnectSignal(const QString &sigName,KviKvsObjectConnection * con); - bool disconnectSignal(const QString &sigName,KviKvsObject * target,const QString & slotName); - - // Emits a signal by calling all the attacched slots in an unspecified order. - // Returns the number of slots called (may be 0, if no slot is connected) - // The parameters are preserved. - // this is intended to be called from other function calls (the parameters are copied from pOuterCall) - // since we should NEVER emit totally spontaneous signals: all of them - // should be generated inside object functions (either from scripting or by core calls) - int emitSignal(const QString &sigName,KviKvsObjectFunctionCall * pOuterCall,KviKvsVariantList * pParams = 0); - - void setSignalSender(kvs_hobject_t hObject){ m_hSignalSender = hObject; }; - kvs_hobject_t signalSender(){ return m_hSignalSender; }; - void setSignalName(const QString &szSigName){ m_szSignalName = szSigName; }; - - KviPointerHashTable<QString,KviKvsObjectFunctionHandler> * functionHandlers(){ return m_pFunctionHandlers; }; - - KviKvsHash * dataContainer(){ return m_pDataContainer; }; - - bool die(); - bool dieNow(); - - KviKvsObjectClass * getExactClass(){ return m_pClass; }; - KviKvsObjectClass * getClass(const QString & classOverride = QString::null); - bool inheritsClass(KviKvsObjectClass * pClass); - KviKvsObjectFunctionHandler * lookupFunctionHandler(const QString & funcName,const QString & classOverride = QString::null); - - // Registers a private implementation of a function - // The function may or may not be already registered in the class - // If szCode is empty the the private implementation is removed instead - void registerPrivateImplementation(const QString &szFunctionName,const QString &szCode); - - // ONLY pCaller can be zero here! - // please use one of the wrappers, if possible - bool callFunction( - KviKvsObject * pCaller, // calling object, can be zero (used for the "internal" access list verification) - const QString & fncName, // name of the function to call - const QString & classOverride, // eventual class override for the functon call, may be QString::null - KviKvsRunTimeContext * pContext, // calling runtime context (you'll have problems with instantiating this... :P ) - KviKvsVariant * pRetVal, // the return value - KviKvsVariantList * pParams); // the parameters for the call - // a nice and simple wrapper: it accepts a parameter list only (eventually 0) - bool callFunction(KviKvsObject * pCaller,const QString &fncName,KviKvsVariantList * pParams = 0); - // this one gets a non null ret val too - bool callFunction(KviKvsObject * pCaller,const QString &fncName,KviKvsVariant * pRetVal,KviKvsVariantList * pParams = 0); - - KviKvsObject * findChild(const QString &szClass,const QString &szName); - void killAllChildrenWithClass(KviKvsObjectClass *cl); -protected: - void registerConnection(KviKvsObjectConnection * con); - bool unregisterConnection(KviKvsObjectConnection * con); - - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); - - void registerChild(KviKvsObject * c); - void unregisterChild(KviKvsObject *c); - - virtual bool eventFilter(QObject *o,QEvent *e); //necessary ? - virtual void timerEvent(QTimerEvent *e); -protected: - bool function_name(KviKvsObjectFunctionCall *c); - bool function_startTimer(KviKvsObjectFunctionCall *c); - bool function_killTimer(KviKvsObjectFunctionCall *c); - bool function_killTimers(KviKvsObjectFunctionCall *c); - bool function_className(KviKvsObjectFunctionCall *c); - bool function_findChild(KviKvsObjectFunctionCall *c); - bool function_childCount(KviKvsObjectFunctionCall *c); - bool function_emit(KviKvsObjectFunctionCall *c); - bool function_children(KviKvsObjectFunctionCall *c); - bool function_signalSender(KviKvsObjectFunctionCall *c); - bool function_signalName(KviKvsObjectFunctionCall *c); - bool function_destructor(KviKvsObjectFunctionCall *c); - bool function_parent(KviKvsObjectFunctionCall *c); - bool function_property(KviKvsObjectFunctionCall *c); - bool function_setProperty(KviKvsObjectFunctionCall *c); - bool function_listProperties(KviKvsObjectFunctionCall *c); -protected slots: - void delayedDie(); - void objectDestroyed(); -}; - - -#define KVSO_PARAMETER(a,b,c,d) KVS_PARAMETER(a,b,c,d) - -#define KVSO_PARAMETERS_BEGIN(pCall) \ - KVS_PARAMETERS_BEGIN(parameter_format_list) - -#define KVSO_PARAMETERS_END(pCall) \ - KVS_PARAMETERS_END \ - if(!KviKvsParameterProcessor::process(pCall->params(),pCall->context(),parameter_format_list))return false; - - - - -#endif //!_KVI_KVS_OBJECT_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_object_class.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_object_class.cpp deleted file mode 100644 index aa1554a41c..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_object_class.cpp +++ /dev/null @@ -1,234 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_objectclass.cpp -// Created on Sat 23 Apr 2005 20:31:32 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_object_class.h" -#include "kvi_kvs_object_controller.h" -#include "kvi_kvs_object.h" -#include "kvi_kvs_kernel.h" -#include "kvi_kvs_object_functionhandlerimpl.h" -#include "kvi_kvs_object_functioncall.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_script.h" -#include "kvi_fileutils.h" -#include "kvi_window.h" -#include "kvi_cmdformatter.h" - -KviKvsObjectClass::KviKvsObjectClass( - KviKvsObjectClass * pParent, - const QString &szName, - KviKvsObjectAllocateInstanceProc pProc, - bool bBuiltin) -{ - m_pParentClass = pParent; - if(m_pParentClass) - m_pParentClass->registerChildClass(this); - m_szName = szName; - m_bBuiltin = bBuiltin; - m_bDirty = !bBuiltin; - m_pFunctionHandlers = new KviPointerHashTable<QString,KviKvsObjectFunctionHandler>(17,false); - m_pFunctionHandlers->setAutoDelete(true); - m_pChildClasses = new KviPointerList<KviKvsObjectClass>; - m_pChildClasses->setAutoDelete(false); - m_allocProc = pProc ? pProc : pParent->m_allocProc; - - // inherit everything from the class above - if(pParent) - { - KviPointerHashTableIterator<QString,KviKvsObjectFunctionHandler> it(*(pParent->functionHandlers())); - while(KviKvsObjectFunctionHandler * fh = it.current()) - { - m_pFunctionHandlers->insert(it.currentKey(),fh->clone()); - ++it; - } - } - - // "object" class is automatically registered in the controller constructor - KviKvsKernel::instance()->objectController()->registerClass(this); -} - -KviKvsObjectClass::~KviKvsObjectClass() -{ - // order here is critical - - // first of all kill our child classes - while(m_pChildClasses->first())delete m_pChildClasses->first(); - // then kill all objects that belong to our class - KviKvsKernel::instance()->objectController()->killAllObjectsWithClass(this); - // now we're quite clean: should have no object depending on us alive - // unregister from the parent, if any - if(m_pParentClass)m_pParentClass->unregisterChildClass(this); - // unregister from the object controller - KviKvsKernel::instance()->objectController()->unregisterClass(this); - // and start effectively dying - delete m_pFunctionHandlers; - // this is empty now - delete m_pChildClasses; -} - -void KviKvsObjectClass::registerFunctionHandler(const QString & szFunctionName,KviKvsObjectFunctionHandlerProc pProc,unsigned int uFlags) -{ - m_pFunctionHandlers->replace(szFunctionName,new KviKvsObjectCoreCallFunctionHandler(pProc,uFlags)); -} - -void KviKvsObjectClass::registerFunctionHandler(const QString & szFunctionName,const QString &szBuffer,unsigned int uFlags) -{ - QString szContext = m_szName; - szContext += "::"; - szContext += szFunctionName; - m_pFunctionHandlers->replace(szFunctionName,new KviKvsObjectScriptFunctionHandler(szContext,szBuffer,uFlags)); -} - -void KviKvsObjectClass::registerStandardNothingReturnFunctionHandler(const QString &szFunctionName) -{ - m_pFunctionHandlers->replace(szFunctionName,new KviKvsObjectStandardNothingReturnFunctionHandler()); -} - -void KviKvsObjectClass::registerStandardTrueReturnFunctionHandler(const QString &szFunctionName) -{ - m_pFunctionHandlers->replace(szFunctionName,new KviKvsObjectStandardTrueReturnFunctionHandler()); -} - -void KviKvsObjectClass::registerStandardFalseReturnFunctionHandler(const QString &szFunctionName) -{ - m_pFunctionHandlers->replace(szFunctionName,new KviKvsObjectStandardFalseReturnFunctionHandler()); -} - - -KviKvsObject * KviKvsObjectClass::allocateInstance(KviKvsObject * pParent,const QString &szName,KviKvsRunTimeContext * pContext,KviKvsVariantList * pParams) -{ - if(!m_allocProc)return 0; - KviKvsObject * pObject = m_allocProc(this,pParent,szName); - if(!pObject)return 0; - - KviKvsVariant * v=pParams->first(); // FIXME: what the hell is this ? - if(!pObject->init(pContext,pParams)) - { - // internal init failure : abort - delete pObject; - return 0; - } - - KviKvsVariant ret; - KviKvsVariantList copy; - copy.setAutoDelete(false); - while(v) - { - copy.append(v); - v = pParams->next(); - } - - if(!pObject->callFunction(pObject,"constructor",QString::null,pContext,&ret,©)) - { - // ops...constructor failed (script error!) - delete pObject; - return 0; - } else { - if(ret.isInteger()) - { - if(ret.integer() == 0) - { - // implementation failure... - delete pObject; - return 0; - } - } else if(ret.isHObject()) - { - if(ret.hobject() == (kvs_hobject_t)0) - { - // implementation failure... - delete pObject; - return 0; - } - } - } - - return pObject; -} - -void KviKvsObjectClass::registerChildClass(KviKvsObjectClass *pClass) -{ - m_pChildClasses->append(pClass); -} - -void KviKvsObjectClass::unregisterChildClass(KviKvsObjectClass *pClass) -{ - m_pChildClasses->removeRef(pClass); -} - -bool KviKvsObjectClass::save(const QString &szFileName) -{ - if(!m_pParentClass)return false; - if(isBuiltin())return false; - - - QString szBuffer; - QString szParentName = m_pParentClass->name(); - - KviQString::sprintf(szBuffer, - "# Automatically generated KVS class dump\n\n" \ - "class(\"%Q\",\"%Q\")\n" \ - "{\n", - &m_szName,&szParentName); - - KviPointerHashTableIterator<QString,KviKvsObjectFunctionHandler> it(*m_pFunctionHandlers); - - while(KviKvsObjectFunctionHandler * h = it.current()) - { - if(h->isScriptHandler()) - { - szBuffer += " "; - if(h->flags() & KviKvsObjectFunctionHandler::Internal) - szBuffer += "internal "; - szBuffer += "function "; - szBuffer += it.currentKey(); - szBuffer += "()\n"; - QString szCode = h->scriptHandlerCode(); - KviCommandFormatter::blockFromBuffer(szCode); - KviCommandFormatter::indent(szCode); - szBuffer += szCode; - szBuffer += "\n"; - } - ++it; - } - - szBuffer += "}\n"; - - return KviFileUtils::writeFile(szFileName,szBuffer); -} -void KviKvsObjectClass::getFunctionCode(QString &szCode,KviKvsObjectFunctionHandler &h) -{ - szCode=h.scriptHandlerCode(); -} - - - -bool KviKvsObjectClass::load(const QString &szFileName) -{ - QString szBuffer; - if(!KviFileUtils::readFile(szFileName,szBuffer,0xffffff))return false; - return KviKvsScript::run(szBuffer,g_pActiveWindow); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_object_class.h b/3.4.0/src/kvirc/kvs/kvi_kvs_object_class.h deleted file mode 100644 index 10ab10d6fd..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_object_class.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef _KVI_KVS_OBJECTCLASS_H_ -#define _KVI_KVS_OBJECTCLASS_H_ -//============================================================================= -// -// File : kvi_kvs_objectclass.h -// Created on Sat 23 Apr 2005 20:31:32 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_pointerlist.h" - -#include "kvi_pointerhashtable.h" - -#include "kvi_kvs_object_functionhandler.h" - -class KviKvsObject; -class KviKvsObjectClass; -class KviKvsRunTimeContext; -class KviKvsVariantList; - -// Object allocation function -// parameters are: the class, the parent object (eventually 0), the object name (eventually empty) -typedef KviKvsObject * (*KviKvsObjectAllocateInstanceProc)(KviKvsObjectClass *,KviKvsObject *,const QString &); - -// An object function callback -typedef bool (KviKvsObject::*KviKvsObjectFunctionHandlerProc)(KviKvsObjectFunctionCall * pCall); - - -// The descriptor of a kvirc object class - -class KVIRC_API KviKvsObjectClass -{ - friend class KviKvsObject; - friend class KviKvsObjectController; -public: - KviKvsObjectClass( - KviKvsObjectClass * pParent, // parent class - const QString & szName, // class name - KviKvsObjectAllocateInstanceProc proc, // intance allocation proc - bool bBuiltin = true // this is a builtin or script based class ? - ); - ~KviKvsObjectClass(); -protected: - KviKvsObjectClass * m_pParentClass; // the parent (base) class - QString m_szName; // the class name - bool m_bBuiltin; // is this a builtin or script based class ? - KviPointerHashTable<QString,KviKvsObjectFunctionHandler> * m_pFunctionHandlers; // all our function handlers - KviPointerList<KviKvsObjectClass> * m_pChildClasses; // - KviKvsObjectAllocateInstanceProc m_allocProc; - bool m_bDirty; // not yet flushed to disk (only for not builtin classes) -protected: - void registerChildClass(KviKvsObjectClass *pClass); - void unregisterChildClass(KviKvsObjectClass *pClass); - KviPointerHashTable<QString,KviKvsObjectFunctionHandler> * functionHandlers(){ return m_pFunctionHandlers; }; -public: - void clearDirtyFlag(){ m_bDirty = false; }; - bool isDirty(){ return m_bDirty; }; - bool isBuiltin(){ return m_bBuiltin; }; - const QString & name(){ return m_szName; }; - KviKvsObjectClass * parentClass(){ return m_pParentClass; }; - // pProc CAN'T be zero here! - void registerFunctionHandler(const QString & szFunctionName,KviKvsObjectFunctionHandlerProc pProc,unsigned int uFlags = 0); - void registerFunctionHandler(const QString & szFunctionName,const QString &szBuffer,unsigned int uFlags = 0); - - // registers an empty handler that returns "nothing" - void registerStandardNothingReturnFunctionHandler(const QString & szFunc); - // retisters an empty handler that returns $true - void registerStandardTrueReturnFunctionHandler(const QString & szFunc); - // retisters an empty handler that returns $false - void registerStandardFalseReturnFunctionHandler(const QString & szFunc); - - KviKvsObjectFunctionHandler * lookupFunctionHandler(const QString & szFunc){ return m_pFunctionHandlers->find(szFunc); }; - KviKvsObject * allocateInstance(KviKvsObject * pParent,const QString &szName,KviKvsRunTimeContext * pContext,KviKvsVariantList * pParams); - - bool save(const QString &szFileName); - static bool load(const QString &szFileName); - void getFunctionCode(QString &szCode,KviKvsObjectFunctionHandler &h); - KviPointerHashTable<QString,KviKvsObjectFunctionHandler> * getHandlers(){return m_pFunctionHandlers;}; - -}; - - -#endif //!_KVI_KVS_OBJECTCLASS_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_object_controller.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_object_controller.cpp deleted file mode 100644 index 2292c17dc3..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_object_controller.cpp +++ /dev/null @@ -1,229 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_object_controller.cpp -// Created on Sun 24 Apr 2005 05:23:04 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005-2006 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_object_controller.h" -#include "kvi_modulemanager.h" -#include "kvi_fileutils.h" -#include "kvi_app.h" - -//////////////////////////////////////////////////////////////////////////////////////// - -static KviKvsObject * objectClassCreateInstance(KviKvsObjectClass *pClass,KviKvsObject *pParent,const QString &szName) -{ - return new KviKvsObject(pClass,pParent,szName); -} - -//////////////////////////////////////////////////////////////////////////////////////// - -KviKvsObjectController::KviKvsObjectController() -{ - m_pTopLevelObjectList = new KviPointerList<KviKvsObject>; - m_pTopLevelObjectList->setAutoDelete(false); - m_pObjectDict = new KviPointerHashTable<void *,KviKvsObject>(101); - m_pObjectDict->setAutoDelete(false); - m_pClassDict = new KviPointerHashTable<QString,KviKvsObjectClass>(31,false); - m_pClassDict->setAutoDelete(false); -} - -KviKvsObjectController::~KviKvsObjectController() -{ - flushUserClasses(); - while(m_pTopLevelObjectList->first())delete m_pTopLevelObjectList->first(); - delete m_pTopLevelObjectList; // empty list - delete m_pObjectDict; // empty dict - m_pObjectDict = 0; - delete m_pObjectClass; // delete the class tree - delete m_pClassDict; // empty dict -} - -void KviKvsObjectController::init() -{ - // allocate the "object" builtin class - // this is the only one that is always in core memory - m_pObjectClass = new KviKvsObjectClass(0,"object",objectClassCreateInstance,true); - - m_pObjectClass->registerFunctionHandler("name",KVI_PTR2MEMBER(KviKvsObject::function_name)); - m_pObjectClass->registerFunctionHandler("startTimer",KVI_PTR2MEMBER(KviKvsObject::function_startTimer)); - m_pObjectClass->registerFunctionHandler("killTimer",KVI_PTR2MEMBER(KviKvsObject::function_killTimer)); - m_pObjectClass->registerFunctionHandler("killTimers",KVI_PTR2MEMBER(KviKvsObject::function_killTimers)); - m_pObjectClass->registerFunctionHandler("className",KVI_PTR2MEMBER(KviKvsObject::function_className)); - m_pObjectClass->registerFunctionHandler("findChild",KVI_PTR2MEMBER(KviKvsObject::function_findChild)); - m_pObjectClass->registerFunctionHandler("childCount",KVI_PTR2MEMBER(KviKvsObject::function_childCount)); - m_pObjectClass->registerFunctionHandler("emit",KVI_PTR2MEMBER(KviKvsObject::function_emit)); - m_pObjectClass->registerFunctionHandler("children",KVI_PTR2MEMBER(KviKvsObject::function_children)); - m_pObjectClass->registerFunctionHandler("signalSender",KVI_PTR2MEMBER(KviKvsObject::function_signalSender)); - m_pObjectClass->registerFunctionHandler("signalName",KVI_PTR2MEMBER(KviKvsObject::function_signalName)); - m_pObjectClass->registerFunctionHandler("destructor",KVI_PTR2MEMBER(KviKvsObject::function_destructor)); - m_pObjectClass->registerFunctionHandler("parent",KVI_PTR2MEMBER(KviKvsObject::function_parent)); - m_pObjectClass->registerFunctionHandler("property",KVI_PTR2MEMBER(KviKvsObject::function_property)); - m_pObjectClass->registerFunctionHandler("setProperty",KVI_PTR2MEMBER(KviKvsObject::function_setProperty)); - m_pObjectClass->registerFunctionHandler("listProperties",KVI_PTR2MEMBER(KviKvsObject::function_listProperties)); - - m_pObjectClass->registerStandardNothingReturnFunctionHandler("constructor"); - m_pObjectClass->registerStandardNothingReturnFunctionHandler("timerEvent"); - - m_pClassDict->insert("object",m_pObjectClass); -} - -void KviKvsObjectController::killAllObjectsWithClass(KviKvsObjectClass * pClass) -{ - if(!m_pObjectDict)return; // no more objects at all... - KviPointerList<KviKvsObject> l; - l.setAutoDelete(true); - - for(KviKvsObject * o = m_pTopLevelObjectList->first();o;o = m_pTopLevelObjectList->next()) - { - if(o->getClass() == pClass)l.append(o); - else o->killAllChildrenWithClass(pClass); - } -} - -void KviKvsObjectController::clearUserClasses() -{ - flushUserClasses(); - KviPointerHashTableIterator<QString,KviKvsObjectClass> it(*m_pClassDict); - KviPointerList<KviKvsObjectClass> l; - l.setAutoDelete(true); - while(it.current()) - { - if(!(it.current()->isBuiltin())) - { - l.append(it.current()); - } - ++it; - } -} - -void KviKvsObjectController::clearInstances() -{ - while(m_pTopLevelObjectList->first())delete m_pTopLevelObjectList->first(); - delete m_pTopLevelObjectList; // empty list - delete m_pObjectDict; // empty dict - m_pTopLevelObjectList = new KviPointerList<KviKvsObject>; - m_pTopLevelObjectList->setAutoDelete(false); - m_pObjectDict = new KviPointerHashTable<void *,KviKvsObject>(101); - m_pObjectDict->setAutoDelete(false); -} - -void KviKvsObjectController::registerClass(KviKvsObjectClass *pClass) -{ - m_pClassDict->insert(pClass->name(),pClass); -} - -void KviKvsObjectController::unregisterClass(KviKvsObjectClass *pClass) -{ - if(!pClass->isBuiltin()) - { - if(pClass->isDirty())flushUserClasses(); - } - m_pClassDict->remove(pClass->name()); -} - -void KviKvsObjectController::registerObject(KviKvsObject *pObject) -{ - m_pObjectDict->insert(pObject->handle(),pObject); - if(pObject->parent() == 0)m_pTopLevelObjectList->append(pObject); -} - -void KviKvsObjectController::unregisterObject(KviKvsObject *pObject) -{ - m_pObjectDict->remove(pObject->handle()); - if(pObject->parent() == 0)m_pTopLevelObjectList->removeRef(pObject); -} - -void KviKvsObjectController::flushUserClasses() -{ - KviPointerHashTableIterator<QString,KviKvsObjectClass> it(*m_pClassDict); - while(KviKvsObjectClass * c = it.current()) - { - if(!c->isBuiltin()) - { - if(c->isDirty()) - { - QString szPath; - QString szFileName = c->name().lower(); - szFileName += ".kvs"; - szFileName.replace("::","--"); - g_pApp->getLocalKvircDirectory(szPath,KviApp::Classes,szFileName); - if(c->save(szPath)) - c->clearDirtyFlag(); - else - debug("Oops.. failed to save the object class %s",c->name().latin1()); - } - } - ++it; - } -} - -KviKvsObjectClass * KviKvsObjectController::lookupClass(const QString &szClass,bool bBuiltinOnly) -{ - KviKvsObjectClass * pC = m_pClassDict->find(szClass); - if(!pC) - { - // maybe we need to load the object library ? - KviModule * pModule = g_pModuleManager->getModule("objects"); - if(!pModule) - { - debug("ops...something wrong with the libkviobjects module!"); - return 0; - } else pC = m_pClassDict->find(szClass); - if(!pC) - { - if(bBuiltinOnly)return 0; - // maybe we need to load it from permanent storage... - QString szPath; - QString szFileName = szClass.lower(); - szFileName += ".kvs"; - szFileName.replace("::","--"); - g_pApp->getLocalKvircDirectory(szPath,KviApp::Classes,szFileName); - if(!KviFileUtils::fileExists(szPath)) - g_pApp->getGlobalKvircDirectory(szPath,KviApp::Classes,szFileName); - if(!KviFileUtils::fileExists(szPath))return 0; - if(!KviKvsObjectClass::load(szPath))return 0; - pC = m_pClassDict->find(szClass); - if(pC)pC->clearDirtyFlag(); // just loaded from disk: no need to sync it - } - } else { - if(bBuiltinOnly) - { - if(!pC->isBuiltin())return 0; - } - } - return pC; -}; - - -void KviKvsObjectController::deleteClass(KviKvsObjectClass * pClass) -{ - QString szPath; - QString szFileName = pClass->name().lower(); - szFileName += ".kvs"; - szFileName.replace("::","--"); - g_pApp->getLocalKvircDirectory(szPath,KviApp::Classes,szFileName); - KviFileUtils::removeFile(szPath); - delete pClass; -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_object_controller.h b/3.4.0/src/kvirc/kvs/kvi_kvs_object_controller.h deleted file mode 100644 index c2e4350219..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_object_controller.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef _KVI_KVS_OBJECT_CONTROLLER_H_ -#define _KVI_KVS_OBJECT_CONTROLLER_H_ -//============================================================================= -// -// File : kvi_kvs_object_controller.h -// Created on Sun 24 Apr 2005 05:23:04 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_qstring.h" -#include "kvi_pointerlist.h" - -#include "kvi_pointerhashtable.h" -#include "kvi_pointerhashtable.h" - -#include "kvi_kvs_object.h" -#include "kvi_kvs_object_class.h" - -class KVIRC_API KviKvsObjectController -{ - friend class KviKvsObject; - friend class KviKvsObjectClass; -public: - KviKvsObjectController(); - ~KviKvsObjectController(); -protected: - KviPointerList<KviKvsObject> * m_pTopLevelObjectList; - KviPointerHashTable<void *,KviKvsObject> * m_pObjectDict; - KviPointerHashTable<QString,KviKvsObjectClass> * m_pClassDict; - KviKvsObjectClass * m_pObjectClass; //base class -protected: - // the classes and the objects register themselves with the controller - void registerObject(KviKvsObject *pObject); - void unregisterObject(KviKvsObject *pObject); - void registerClass(KviKvsObjectClass *pClass); - void unregisterClass(KviKvsObjectClass *pClass); -public: - void init(); - void deleteClass(KviKvsObjectClass * pClass); - void clearInstances(); - void clearUserClasses(); - void flushUserClasses(); - void killAllObjectsWithClass(KviKvsObjectClass * pClass); - KviKvsObjectClass * lookupClass(const QString &szClass,bool bBuiltinOnly = false); - KviKvsObject * lookupObject(kvs_hobject_t hObject){ return m_pObjectDict->find(hObject); }; - KviPointerHashTable<void *,KviKvsObject> * objectDict(){ return m_pObjectDict; }; - KviPointerHashTable<QString,KviKvsObjectClass> * classDict(){ return m_pClassDict; }; -}; - -#endif //!_KVI_KVS_OBJECT_CONTROLLER_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_object_functioncall.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_object_functioncall.cpp deleted file mode 100644 index 3ef242360f..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_object_functioncall.cpp +++ /dev/null @@ -1,28 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_object_functioncall.cpp -// Created on Sun 24 Apr 2005 04:05:54 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_object_functioncall.h" - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_object_functioncall.h b/3.4.0/src/kvirc/kvs/kvi_kvs_object_functioncall.h deleted file mode 100644 index 8aa7f14d76..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_object_functioncall.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef _KVI_KVS_OBJECT_FUNCTIONCALL_H_ -#define _KVI_KVS_OBJECT_FUNCTIONCALL_H_ -//============================================================================= -// -// File : kvi_kvs_object_functioncall.h -// Created on Sun 24 Apr 2005 04:05:54 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_kvs_runtimecall.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_variant.h" - - -class KVIRC_API KviKvsObjectFunctionCall : public KviKvsRunTimeCall -{ -protected: - KviKvsVariant * m_pResult; -public: - KviKvsObjectFunctionCall(KviKvsRunTimeContext * pContext, - KviKvsVariantList * pParams, - KviKvsVariant * pResult) - : KviKvsRunTimeCall(pContext,pParams), m_pResult(pResult) - {}; - ~KviKvsObjectFunctionCall(){}; -public: - KviKvsVariant * returnValue(){ return m_pResult; }; -}; - -#endif //!_KVI_KVS_OBJECT_FUNCTIONCALL_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_object_functionhandler.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_object_functionhandler.cpp deleted file mode 100644 index 173d86fbf1..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_object_functionhandler.cpp +++ /dev/null @@ -1,50 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_object_functionhandler.cpp -// Created on Sat 23 Apr 2005 21:53:23 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_object_functionhandler.h" - -KviKvsObjectFunctionHandler::KviKvsObjectFunctionHandler(unsigned int uFlags) -: m_uFlags(uFlags) -{ -} - -KviKvsObjectFunctionHandler::~KviKvsObjectFunctionHandler() -{ -} - -bool KviKvsObjectFunctionHandler::isScriptHandler() -{ - return false; -} - -QString KviKvsObjectFunctionHandler::scriptHandlerCode() -{ - return QString::null; -} - - - - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_object_functionhandler.h b/3.4.0/src/kvirc/kvs/kvi_kvs_object_functionhandler.h deleted file mode 100644 index 1393f58c4c..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_object_functionhandler.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef _KVI_KVS_OBJECT_FUNCTIONHANDLER_H_ -#define _KVI_KVS_OBJECT_FUNCTIONHANDLER_H_ -//============================================================================= -// -// File : kvi_kvs_object_functionhandler.h -// Created on Sat 23 Apr 2005 21:53:23 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" - -class KviKvsObjectClass; -class KviKvsObjectFunctionCall; -class KviKvsObject; - - -class KVIRC_API KviKvsObjectFunctionHandler -{ - friend class KviKvsObject; - friend class KviKvsObjectClass; -public: - enum Flags { Internal = 1 }; -protected: - unsigned int m_uFlags; -protected: - KviKvsObjectFunctionHandler(unsigned int uFlags = 0); -public: - virtual ~KviKvsObjectFunctionHandler(); -public: - unsigned int flags(){ return m_uFlags; }; -protected: - virtual bool isScriptHandler(); - virtual QString scriptHandlerCode(); - virtual KviKvsObjectFunctionHandler * clone() = 0; - virtual bool call(KviKvsObject * pObject,KviKvsObjectFunctionCall * pCall) = 0; -}; - - -#endif //!_KVI_KVS_OBJECT_FUNCTIONHANDLER_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_object_functionhandlerimpl.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_object_functionhandlerimpl.cpp deleted file mode 100644 index bff1a12677..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_object_functionhandlerimpl.cpp +++ /dev/null @@ -1,148 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_object_functionhandlerimpl.cpp -// Created on Sun 24 Apr 2005 04:01:14 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_object_functionhandlerimpl.h" -#include "kvi_kvs_object_functioncall.h" -#include "kvi_kvs_script.h" - - - -KviKvsObjectFunctionHandler * KviKvsObjectStandardTrueReturnFunctionHandler::clone() -{ - return new KviKvsObjectStandardTrueReturnFunctionHandler(); -} - -bool KviKvsObjectStandardTrueReturnFunctionHandler::call(KviKvsObject * pObject,KviKvsObjectFunctionCall * pCall) -{ - pCall->returnValue()->setBoolean(true); - return true; -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -KviKvsObjectFunctionHandler * KviKvsObjectStandardFalseReturnFunctionHandler::clone() -{ - return new KviKvsObjectStandardFalseReturnFunctionHandler(); -} - -bool KviKvsObjectStandardFalseReturnFunctionHandler::call(KviKvsObject * pObject,KviKvsObjectFunctionCall * pCall) -{ - pCall->returnValue()->setBoolean(false); - return true; -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -KviKvsObjectFunctionHandler * KviKvsObjectStandardNothingReturnFunctionHandler::clone() -{ - return new KviKvsObjectStandardNothingReturnFunctionHandler(); -} - -bool KviKvsObjectStandardNothingReturnFunctionHandler::call(KviKvsObject * pObject,KviKvsObjectFunctionCall * pCall) -{ - pCall->returnValue()->setNothing(); - return true; -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -KviKvsObjectCoreCallFunctionHandler::KviKvsObjectCoreCallFunctionHandler(KviKvsObjectFunctionHandlerProc pProc,unsigned int uFlags) -: KviKvsObjectFunctionHandler(uFlags) -{ - m_pProc = pProc; -} - -KviKvsObjectCoreCallFunctionHandler::KviKvsObjectCoreCallFunctionHandler(const KviKvsObjectCoreCallFunctionHandler &h) -: KviKvsObjectFunctionHandler(h.m_uFlags) -{ - m_pProc = h.m_pProc; -} - -KviKvsObjectCoreCallFunctionHandler::~KviKvsObjectCoreCallFunctionHandler() -{ -} - -KviKvsObjectFunctionHandler * KviKvsObjectCoreCallFunctionHandler::clone() -{ - return new KviKvsObjectCoreCallFunctionHandler(*this); -} - -bool KviKvsObjectCoreCallFunctionHandler::call(KviKvsObject * pObject,KviKvsObjectFunctionCall * pCall) -{ - // Actually m_pProc can't be 0: if it's zero then it's a BUG and should be traced down: we just crash - //if(m_pProc) - return (pObject->*m_pProc)(pCall); - //else { - // empty handler - //pCall->returnValue()->setNothing(); - //return true; - //} -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -KviKvsObjectScriptFunctionHandler::KviKvsObjectScriptFunctionHandler(const QString &szScriptContext,const QString &szCode,unsigned int uFlags) -: KviKvsObjectFunctionHandler(uFlags) -{ - m_pHandler = new KviKvsScript(szScriptContext,szCode,KviKvsScript::InstructionList); -} - -KviKvsObjectScriptFunctionHandler::KviKvsObjectScriptFunctionHandler(const KviKvsObjectScriptFunctionHandler &h) -: KviKvsObjectFunctionHandler(h.m_uFlags) -{ - // ref - m_pHandler = new KviKvsScript(*(h.m_pHandler)); -} - -KviKvsObjectScriptFunctionHandler::~KviKvsObjectScriptFunctionHandler() -{ - delete m_pHandler; -} - -bool KviKvsObjectScriptFunctionHandler::isScriptHandler() -{ - return true; -} - -QString KviKvsObjectScriptFunctionHandler::scriptHandlerCode() -{ - return m_pHandler->code(); -} - - - - -KviKvsObjectFunctionHandler * KviKvsObjectScriptFunctionHandler::clone() -{ - return new KviKvsObjectScriptFunctionHandler(*this); -} - -bool KviKvsObjectScriptFunctionHandler::call(KviKvsObject * pObject,KviKvsObjectFunctionCall * pCall) -{ - KviKvsExtendedRunTimeData rd(pObject); - return m_pHandler->run(pCall->window(),pCall->params(),pCall->returnValue(),KviKvsScript::PreserveParams,&rd); -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_object_functionhandlerimpl.h b/3.4.0/src/kvirc/kvs/kvi_kvs_object_functionhandlerimpl.h deleted file mode 100644 index d4504a1054..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_object_functionhandlerimpl.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef _KVI_KVS_OBJECT_FUNCTIONHANDLERIMPL_H_ -#define _KVI_KVS_OBJECT_FUNCTIONHANDLERIMPL_H_ -//============================================================================= -// -// File : kvi_kvs_object_functionhandlerimpl.h -// Created on Sun 24 Apr 2005 04:01:14 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_object.h" -#include "kvi_kvs_object_class.h" -#include "kvi_kvs_object_functionhandler.h" -#include "kvi_qstring.h" - -class KviKvsObjectClass; -class KviKvsScript; -class KviKvsObjectFunctionCall; - - -class KVIRC_API KviKvsObjectCoreCallFunctionHandler : public KviKvsObjectFunctionHandler -{ - friend class KviKvsObject; - friend class KviKvsObjectClass; -protected: - KviKvsObjectCoreCallFunctionHandler(KviKvsObjectFunctionHandlerProc pProc,unsigned int uFlags = 0); - KviKvsObjectCoreCallFunctionHandler(const KviKvsObjectCoreCallFunctionHandler &h); -public: - virtual ~KviKvsObjectCoreCallFunctionHandler(); -protected: - KviKvsObjectFunctionHandlerProc m_pProc; -protected: - virtual KviKvsObjectFunctionHandler * clone(); - virtual bool call(KviKvsObject * pObject,KviKvsObjectFunctionCall * pCall); -}; - -class KVIRC_API KviKvsObjectScriptFunctionHandler : public KviKvsObjectFunctionHandler -{ - friend class KviKvsObject; - friend class KviKvsObjectClass; -protected: - KviKvsObjectScriptFunctionHandler(const QString &szScriptContext,const QString &szCode,unsigned int uFlags = 0); - KviKvsObjectScriptFunctionHandler(const KviKvsObjectScriptFunctionHandler &h); -public: - virtual ~KviKvsObjectScriptFunctionHandler(); -protected: - KviKvsScript * m_pHandler; -protected: - virtual bool isScriptHandler(); - virtual QString scriptHandlerCode(); - virtual KviKvsObjectFunctionHandler * clone(); - virtual bool call(KviKvsObject * pObject,KviKvsObjectFunctionCall * pCall); -}; - -class KVIRC_API KviKvsObjectStandardTrueReturnFunctionHandler : public KviKvsObjectFunctionHandler -{ - friend class KviKvsObject; - friend class KviKvsObjectClass; -protected: - KviKvsObjectStandardTrueReturnFunctionHandler() - : KviKvsObjectFunctionHandler() {}; -public: - virtual ~KviKvsObjectStandardTrueReturnFunctionHandler(){}; -protected: - virtual KviKvsObjectFunctionHandler * clone(); - virtual bool call(KviKvsObject * pObject,KviKvsObjectFunctionCall * pCall); -}; - -class KVIRC_API KviKvsObjectStandardFalseReturnFunctionHandler : public KviKvsObjectFunctionHandler -{ - friend class KviKvsObject; - friend class KviKvsObjectClass; -protected: - KviKvsObjectStandardFalseReturnFunctionHandler() - : KviKvsObjectFunctionHandler() {}; -public: - virtual ~KviKvsObjectStandardFalseReturnFunctionHandler(){}; -protected: - virtual KviKvsObjectFunctionHandler * clone(); - virtual bool call(KviKvsObject * pObject,KviKvsObjectFunctionCall * pCall); -}; - -class KVIRC_API KviKvsObjectStandardNothingReturnFunctionHandler : public KviKvsObjectFunctionHandler -{ - friend class KviKvsObject; - friend class KviKvsObjectClass; -protected: - KviKvsObjectStandardNothingReturnFunctionHandler() - : KviKvsObjectFunctionHandler() {}; -public: - virtual ~KviKvsObjectStandardNothingReturnFunctionHandler(){}; -protected: - virtual KviKvsObjectFunctionHandler * clone(); - virtual bool call(KviKvsObject * pObject,KviKvsObjectFunctionCall * pCall); -}; - -#endif //!_KVI_KVS_OBJECT_FUNCTIONHANDLERIMPL_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_parameterprocessor.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_parameterprocessor.cpp deleted file mode 100644 index 956135909c..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_parameterprocessor.cpp +++ /dev/null @@ -1,371 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_parameterprocessor.cpp -// Created on Sun 17 Apr 2005 16:47:09 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_parameterprocessor.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_array.h" -#include "kvi_kvs_arraycast.h" -#include "kvi_kvs_hash.h" -#include "kvi_kvs_object.h" - -#include "kvi_qstring.h" -#include "kvi_locale.h" -#include "kvi_pointerlist.h" - - -#include <qstringlist.h> - -namespace KviKvsParameterProcessor -{ - void setDefaultValue(KviKvsParameterProcessor::ParameterFormat * pFmtArray) - { -#ifdef COMPILE_NEW_KVS - switch(pFmtArray->uType) - { - case KVS_PT_STRING: - case KVS_PT_NONEMPTYSTRING: - *((QString *)(pFmtArray->pContainer)) = QString::null; - break; - case KVS_PT_INT: - *((kvs_int_t *)(pFmtArray->pContainer)) = 0; - break; - case KVS_PT_UINT: - *((kvs_uint_t *)(pFmtArray->pContainer)) = 0; - break; - case KVS_PT_DOUBLE: - *((kvs_real_t *)(pFmtArray->pContainer)) = 0.0; - break; - case KVS_PT_BOOL: - *((bool *)(pFmtArray->pContainer)) = false; - break; - case KVS_PT_HASH: - *((KviKvsHash **)(pFmtArray->pContainer)) = 0; - break; - case KVS_PT_ARRAY: - *((KviKvsArray **)(pFmtArray->pContainer)) = 0; - break; - case KVS_PT_ARRAYCAST: - ((KviKvsArrayCast *)(pFmtArray->pContainer))->clear(); - break; - case KVS_PT_VARIANT: - *((KviKvsVariant **)(pFmtArray->pContainer)) = 0; - break; - case KVS_PT_CSTRING: - case KVS_PT_NONEMPTYCSTRING: - *((KviQCString *)(pFmtArray->pContainer)) = 0; - break; - case KVS_PT_STRINGLIST: - ((QStringList *)(pFmtArray->pContainer))->clear(); - break; - case KVS_PT_VARIANTLIST: - ((KviKvsVariantList *)(pFmtArray->pContainer))->clear(); - ((KviKvsVariantList *)(pFmtArray->pContainer))->setAutoDelete(false); - break; - case KVS_PT_HOBJECT: - *((kvs_hobject_t *)(pFmtArray->pContainer)) = (kvs_hobject_t)0; - break; - case KVS_PT_IGNORE: - // ignore :) - break; - default: - debug("Internal error in KviKvsParameterProcessor::setDefaultValue(): unknown parameter type %d",pFmtArray->uType); - break; - } -#endif - } - - bool handleParameterTypeError(KviKvsRunTimeContext * pContext,KviKvsParameterProcessor::ParameterFormat * pFmtArray,KviKvsVariant * v,const char * szExpectedType) - { - if(pFmtArray->uFlags & KVS_PF_OPTIONAL) - { - if(v->isEmpty()) - { - setDefaultValue(pFmtArray); - return true; // empty optional - } - } - - QString szError; - KviQString::sprintf(szError,__tr2qs("Invalid data type for parameter \"%s\""),pFmtArray->szName); - szError += ": "; - - if(v->isString()) - { - QString tmp = v->string(); - if(tmp.isEmpty()) - { - KviQString::appendFormatted(szError,__tr2qs("found empty string where type '%s' was expected"),&tmp,szExpectedType); - } else { - if(tmp.length() > 15) - { - tmp.truncate(15); - tmp.append("..."); - } - KviQString::appendFormatted(szError,__tr2qs("found string value \"%Q\" where type '%s' was expected"),&tmp,szExpectedType); - } - } else { - QString tmp; - v->getTypeName(tmp); - KviQString::appendFormatted(szError,__tr2qs("found type %Q where type '%s' was expected"),&tmp,szExpectedType); - } - pContext->error(szError); - return false; - } - - bool process(KviKvsVariantList * pVariantList,KviKvsRunTimeContext * pContext,KviKvsParameterProcessor::ParameterFormat * pFmtArray) - { - KviKvsVariant * v = pVariantList->first(); - - while(pFmtArray->szName) - { - if(!v) - { - // parameter not present - // it MUST be optional - if(!(pFmtArray->uFlags & KVS_PF_OPTIONAL)) - { - // bad luck - QString szError; - KviQString::sprintf(szError,__tr2qs("Missing non-optional parameter \"%s\""),pFmtArray->szName); - pContext->error(szError); - return false; - } - // ok, missing but optional (all the following are implicitly optional too) - // set to default values - do { - setDefaultValue(pFmtArray); - pFmtArray++; - } while(pFmtArray->szName); - return true; - } - // here we do only "light" casts: hard ones must be done explicitly by the user - switch(pFmtArray->uType) - { - case KVS_PT_STRING: - v->asString(*((QString *)(pFmtArray->pContainer))); - if(pFmtArray->uFlags & KVS_PF_APPENDREMAINING) - { - v = pVariantList->next(); - while(v) - { - *((QString *)(pFmtArray->pContainer)) += QChar(' '); - v->appendAsString(*((QString *)(pFmtArray->pContainer))); - v = pVariantList->next(); - } - return true; - } - break; - case KVS_PT_STRINGLIST: - { - ((QStringList *)(pFmtArray->pContainer))->clear(); - QString pSz; - v->asString(pSz); - ((QStringList *)(pFmtArray->pContainer))->append(pSz); - v = pVariantList->next(); - while(v) - { - v->asString(pSz); - ((QStringList *)(pFmtArray->pContainer))->append(pSz); - v = pVariantList->next(); - } - return true; - } - break; - case KVS_PT_VARIANTLIST: - { - ((KviKvsVariantList *)(pFmtArray->pContainer))->clear(); - ((KviKvsVariantList *)(pFmtArray->pContainer))->setAutoDelete(false); - ((KviKvsVariantList *)(pFmtArray->pContainer))->append(v); - v = pVariantList->next(); - while(v) - { - ((KviKvsVariantList *)(pFmtArray->pContainer))->append(v); - v = pVariantList->next(); - } - return true; - } - break; - case KVS_PT_NONEMPTYSTRING: - { - v->asString(*((QString *)(pFmtArray->pContainer))); - bool bDoReturn = false; - if(pFmtArray->uFlags & KVS_PF_APPENDREMAINING) - { - v = pVariantList->next(); - while(v) - { - *((QString *)(pFmtArray->pContainer)) += QChar(' '); - v->appendAsString(*((QString *)(pFmtArray->pContainer))); - v = pVariantList->next(); - } - bDoReturn = true; - } - if(((QString *)(pFmtArray->pContainer))->isEmpty()) - { - QString szError; - KviQString::sprintf(szError,__tr2qs("Invalid data type for parameter \"%s\""),pFmtArray->szName); - szError += ": "; - KviQString::sprintf(szError,__tr2qs("found empty string while a non empty one was expected")); - pContext->error(szError); - return false; - } - if(bDoReturn)return true; - } - break; - case KVS_PT_CSTRING: - { - QString tmp; - v->asString(tmp); - if(pFmtArray->uFlags & KVS_PF_APPENDREMAINING) - { - v = pVariantList->next(); - while(v) - { - *((KviQCString *)(pFmtArray->pContainer)) += ' '; - v->appendAsString(tmp); - v = pVariantList->next(); - } - *((KviQCString *)(pFmtArray->pContainer)) = tmp.utf8(); - return true; - } - *((KviQCString *)(pFmtArray->pContainer)) = tmp.utf8(); - } - break; - case KVS_PT_NONEMPTYCSTRING: - { - QString tmp; - v->asString(tmp); - bool bDoReturn = false; - if(pFmtArray->uFlags & KVS_PF_APPENDREMAINING) - { - v = pVariantList->next(); - while(v) - { - *((KviQCString *)(pFmtArray->pContainer)) += ' '; - v->appendAsString(tmp); - v = pVariantList->next(); - } - *((KviQCString *)(pFmtArray->pContainer)) = tmp.utf8(); - bDoReturn = true; - } - *((KviQCString *)(pFmtArray->pContainer)) = tmp.utf8(); - if(((KviQCString *)(pFmtArray->pContainer))->isEmpty()) - { - QString szError; - KviQString::sprintf(szError,__tr2qs("Invalid data type for parameter \"%s\""),pFmtArray->szName); - szError += ": "; - KviQString::sprintf(szError,__tr2qs("found empty string while a non empty one was expected")); - pContext->error(szError); - return false; - } - if(bDoReturn)return true; - } - break; - case KVS_PT_INT: - if(!v->asInteger(*((kvs_int_t *)(pFmtArray->pContainer)))) - { - if(!handleParameterTypeError(pContext,pFmtArray,v,"integer")) - return false; - } - break; - case KVS_PT_UINT: - { - kvs_int_t iTmp; - if(!v->asInteger(iTmp)) - { - if(!handleParameterTypeError(pContext,pFmtArray,v,"unsigned integer")) - return false; - } - if(iTmp < 0) - { - QString szError; - KviQString::sprintf(szError,__tr2qs("Invalid data type for parameter \"%s\""),pFmtArray->szName); - szError += ": "; - KviQString::sprintf(szError,__tr2qs("found signed integer \"%d\" where type 'unsigned integer' was expected"),iTmp); - pContext->error(szError); - return false; - } - *((kvs_uint_t *)(pFmtArray->pContainer)) = (kvs_uint_t)iTmp; - } - break; - case KVS_PT_DOUBLE: - if(!v->asReal(*((kvs_real_t *)(pFmtArray->pContainer)))) - { - if(!handleParameterTypeError(pContext,pFmtArray,v,"real")) - return false; - } - break; - case KVS_PT_HASH: - if(!v->isHash()) - { - if(!handleParameterTypeError(pContext,pFmtArray,v,"hash")) - return false; - } else { - *((KviKvsHash **)(pFmtArray->pContainer)) = v->hash(); - } - break; - case KVS_PT_ARRAYCAST: - v->castToArray((KviKvsArrayCast *)(pFmtArray->pContainer)); - break; - case KVS_PT_ARRAY: - if(!v->isArray()) - { - if(!handleParameterTypeError(pContext,pFmtArray,v,"array")) - return false; - } else { - *((KviKvsArray **)(pFmtArray->pContainer)) = v->array(); - } - case KVS_PT_BOOL: - // this never fails: anything is converted to a boolean - *((bool *)(pFmtArray->pContainer)) = v->asBoolean(); - break; - case KVS_PT_VARIANT: - *((KviKvsVariant **)(pFmtArray->pContainer)) = v; - break; - case KVS_PT_HOBJECT: - if(!v->asHObject(*((kvs_hobject_t *)(pFmtArray->pContainer)))) - { - if(!handleParameterTypeError(pContext,pFmtArray,v,"hobject")) - return false; - } - break; - case KVS_PT_IGNORE: - // ignore - break; - default: - debug("Internal error in KviKvsParameterProcessor::processAsParameters(): unknown parameter type %d",pFmtArray->uType); - return false; - break; - } - pFmtArray++; - v = pVariantList->next(); - } - return true; - } - -}; diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_parameterprocessor.h b/3.4.0/src/kvirc/kvs/kvi_kvs_parameterprocessor.h deleted file mode 100644 index 83e50b3e86..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_parameterprocessor.h +++ /dev/null @@ -1,140 +0,0 @@ -#ifndef _KVI_KVS_PARAMETERPROCESSOR_H_ -#define _KVI_KVS_PARAMETERPROCESSOR_H_ -//============================================================================= -// -// File : kvi_kvs_parameterprocessor.h -// Created on Sun 17 Apr 2005 16:47:09 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" - - -// Data type: QString -// Default: QString::null -#define KVS_PT_STRING 0 - -// Data type: QString -// Default: QString::null -#define KVS_PT_NONEMPTYSTRING 1 - -// Data type: kvs_int_t -// Default: 0 -#define KVS_PT_INT 2 - #define KVS_PT_INTEGER 2 - -// Data type: kvs_uint_t -// Default: 0 -#define KVS_PT_UINT 3 - #define KVS_PT_UNSIGNEDINTEGER 3 - -// Data type: kvs_real_t -// default: 0.0 -#define KVS_PT_DOUBLE 4 - #define KVS_PT_REAL 4 - -// Data type: bool -// default: false -#define KVS_PT_BOOL 5 - #define KVS_PT_BOOLEAN 5 - -// Data type: KviKvsHash * -// default: 0 -#define KVS_PT_HASH 6 - -// Data type: KviKvsArrayCast -// default empty cast -#define KVS_PT_ARRAYCAST 7 - -// Data type: KviKvsVariant * -// default: 0 -#define KVS_PT_VARIANT 8 - -// Data type: QCString -// default null string (0) -#define KVS_PT_CSTRING 9 - -// Data type: QCString -// default null string (0) -#define KVS_PT_NONEMPTYCSTRING 10 - -// Data type: QStringList -// default: list cleared -// This eats all the remaining params in the list! -#define KVS_PT_STRINGLIST 11 - -// Data type: KviKvsVariantList -// default: list cleared -// This eats all the remaining params in the list! -// The list has autodelete set to off since the copies are SHALLOW! -#define KVS_PT_VARIANTLIST 12 - -// Data type: kvs_hobjec_t -// default: (kvs_hobject_t)0 -#define KVS_PT_HOBJECT 13 - -// Data type: KviKvsArray * -// default 0 -#define KVS_PT_ARRAY 14 - -// Data type: ignored -#define KVS_PT_IGNORE 15 - -// If omitted, set to default -#define KVS_PF_OPTIONAL 1 -// Valid only for string types: it's the last parameter that eats all the remaining ones -#define KVS_PF_APPENDREMAINING 2 - -class KviKvsVariantList; -class KviKvsRunTimeContext; - -namespace KviKvsParameterProcessor -{ - class KVIRC_API ParameterFormat - { - public: - const char * szName; - const unsigned char uType; - const unsigned char uFlags; - void * pContainer; - public: - ParameterFormat(const char * n,const unsigned char t,const unsigned char f,void * p) - : szName(n), uType(t), uFlags(f), pContainer(p) {}; - }; - - KVIRC_API bool process(KviKvsVariantList * pVariantList,KviKvsRunTimeContext * pContext,KviKvsParameterProcessor::ParameterFormat * pFmtArray); -}; - - -#define KVS_PARAMETERS_BEGIN(__name) \ - KviKvsParameterProcessor::ParameterFormat __name[] = \ - { - -#define KVS_PARAMETERS_END \ - KviKvsParameterProcessor::ParameterFormat(0,0,0,0) \ - }; - -#define KVS_PARAMETER(__name,__type,__flags,__void) \ - KviKvsParameterProcessor::ParameterFormat(__name,__type,__flags,((void *)(&(__void)))), - -#define KVS_PARAMETER_IGNORED(__name) \ - KviKvsParameterProcessor::ParameterFormat(__name,KVS_PT_IGNORE,0,0), - -#endif //!_KVI_KVS_PARAMETERPROCESSOR_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_parser.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_parser.cpp deleted file mode 100644 index e13aee2521..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_parser.cpp +++ /dev/null @@ -1,3827 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_parser.cpp -// Creation date : Thu 25 Sep 2003 05.12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - - -#include "kvi_kvs_parser.h" - -#include "kvi_kvs_treenode.h" - -#include "kvi_kvs_report.h" -#include "kvi_kvs_kernel.h" - -#include "kvi_kvs_script.h" - -#include "kvi_kvs_parser_macros.h" - -#include "kvi_locale.h" - -#include "kvi_options.h" - -//FIXME: @ == $$-> == $this-> - -KviKvsParser::KviKvsParser(KviKvsScript * pScript,KviWindow * pOutputWindow) -{ - // no need to initialize m_pBuffer - // no need to initialize m_ptr - // no need to initialize m_bError - m_pGlobals = 0; - m_pScript = pScript; - m_pWindow = pOutputWindow; -} - -KviKvsParser::~KviKvsParser() -{ - if(m_pGlobals)delete m_pGlobals; -} - - - - -void KviKvsParser::init() -{ - KviKvsKernel * pKern = KviKvsKernel::instance(); - -#define _REG_CNTRL_CMD(__cntrlCmdName,__parsingRoutine) \ - { \ - KviKvsSpecialCommandParsingRoutine * r = new KviKvsSpecialCommandParsingRoutine; \ - r->proc = KVI_PTR2MEMBER(KviKvsParser::__parsingRoutine); \ - pKern->registerSpecialCommandParsingRoutine(QString(__cntrlCmdName),r); \ - } - - _REG_CNTRL_CMD("if",parseSpecialCommandIf); - _REG_CNTRL_CMD("global",parseSpecialCommandGlobal); - _REG_CNTRL_CMD("while",parseSpecialCommandWhile); - _REG_CNTRL_CMD("break",parseSpecialCommandBreak); - _REG_CNTRL_CMD("do",parseSpecialCommandDo); - _REG_CNTRL_CMD("for",parseSpecialCommandFor); - _REG_CNTRL_CMD("foreach",parseSpecialCommandForeach); - _REG_CNTRL_CMD("switch",parseSpecialCommandSwitch); - _REG_CNTRL_CMD("defpopup",parseSpecialCommandDefpopup); - _REG_CNTRL_CMD("unset",parseSpecialCommandUnset); - _REG_CNTRL_CMD("class",parseSpecialCommandClass); - _REG_CNTRL_CMD("help",parseSpecialCommandHelp); - -#undef _REG_CNTRL_CMD -} - -void KviKvsParser::report(bool bError,const QChar * pLocation,const QString &szMsgFmt,kvi_va_list va) -{ - QString szMsg; - KviQString::vsprintf(szMsg,szMsgFmt,va); - - KviPointerList<QString> * pCodeListing = 0; - QString szLocation; - - if(pLocation) - { - pCodeListing = new KviPointerList<QString>; - pCodeListing->setAutoDelete(true); - - int iLine,iCol; - - KviKvsReport::findLineColAndListing(m_pBuffer,pLocation,iLine,iCol,pCodeListing); - - KviQString::sprintf(szLocation,__tr2qs("line %d, near character %d"),iLine,iCol); - } else { - szLocation = __tr2qs("beginning of input"); - } - - KviKvsReport rep(bError ? KviKvsReport::ParserError : KviKvsReport::ParserWarning,m_pScript->name(),szMsg,szLocation,m_pWindow); - if(pCodeListing)rep.setCodeListing(pCodeListing); - - KviKvsReport::report(&rep,m_pWindow); -} - -void KviKvsParser::errorBadChar(const QChar * pLocation,char cExpected,const char * szCommandName) -{ - if(pLocation->unicode()) - error(pLocation,__tr2qs("Found character '%q' (unicode 0x%x) where '%c' was expected: see \"/help %s\" for the command syntax"), - pLocation,pLocation->unicode(),cExpected,szCommandName); - else - error(pLocation,__tr2qs("Found end of input where character '%c' was expected: see \"/help %s\" for the command syntax"), - cExpected,szCommandName); -} - -void KviKvsParser::error(const QChar * pLocation,const QString &szMsgFmt,...) -{ - m_bError = true; - - kvi_va_list va; - kvi_va_start_by_reference(va,szMsgFmt); - report(true,pLocation,szMsgFmt,va); - kvi_va_end(va); -} - -void KviKvsParser::warning(const QChar * pLocation,const QString &szMsgFmt,...) -{ - kvi_va_list va; - kvi_va_start_by_reference(va,szMsgFmt); - report(false,pLocation,szMsgFmt,va); - kvi_va_end(va); -} - -KviKvsTreeNodeInstruction * KviKvsParser::parse(const QChar * pBuffer,int iFlags) -{ - m_iFlags = iFlags; - - m_bError = false; - if(m_pGlobals)m_pGlobals->clear(); // this shouldn't be needed since this is a one time parser - - m_pBuffer = pBuffer; - m_ptr = pBuffer; - - if(!pBuffer) - { - error(0,__tr2qs("Empty script")); - return 0; - } - return parseInstructionList(); -} - -KviKvsTreeNodeInstruction * KviKvsParser::parseAsExpression(const QChar * pBuffer,int iFlags) -{ - m_iFlags = iFlags; - - m_bError = false; - if(m_pGlobals)m_pGlobals->clear(); // this shouldn't be needed since this is a one time parser - - m_pBuffer = pBuffer; - m_ptr = pBuffer; - - if(!pBuffer) - { - error(0,__tr2qs("Empty script")); - return 0; - } - - KviKvsTreeNodeExpression * expr = parseExpression(0); - if(!expr)return 0; - return new KviKvsTreeNodeExpressionReturn(pBuffer,expr); -} - -KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer,int iFlags) -{ - m_iFlags = iFlags; - - m_bError = false; - if(m_pGlobals)m_pGlobals->clear(); // this shouldn't be needed since this is a one time parser - - m_pBuffer = pBuffer; - m_ptr = pBuffer; - - if(!pBuffer) - { - error(0,__tr2qs("Empty script")); - return 0; - } - - KviKvsTreeNodeDataList * l = parseCommandParameterList(); - if(!l)return 0; - - return new KviKvsTreeNodeParameterReturn(pBuffer,l); -} - - - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// THE REAL KVS -// -// <script> ::= <instruction list> '\0' -// -// <instruction list> ::= <instruction> [ <instruction list> ] -// <instruction> ::= <instruction block> | <command> | <operation> | <comment> -// <instruction block> ::= '{' <instruction list> '}' -// -// <comment> ::= <bash style line comment> | <c++ style comment> | <c style comment> -// <bash style comment> ::='#' <any char not including newline or null> <newline or null> -// <c++ style comment> ::= '//' <any char not including newline or null> <newline or null> -// <c style comment> ::= '/*' <any char not including null or the sequence */> '*/' -// -// <command> ::= <simple command> | <callback command> | <control command> -// <simple command> ::= <core command> | <module command> | <alias command> -// <core command> ::= <command identifier> <switch list> <command parameter list> <command terminator> -// <switch list> ::= '-'<switch body> [<switch list>] -// <command parameter list> ::= <command parameter>[<space><command parameter>] -// <command parameter> ::= <command parameter part>[<command parameter>] -// <command parameter part> ::= <command literal parameter> | <string parameter> | <data evaluation> -// <command literal parameter> ::= <anything except space , null , newline , ; , " , $ or %> -// <string parameter> ::= '"'<string parameter body>'"' -// <string parameter body> ::= <anything except '"' or null>... -// <command terminator> ::= ';' | '\n' | '\0' - -// <data> ::= -// <data_reference> ::= <function_call> | <structured_data> -// <structured_data> ::= <data_structure> | <variable> | <pointer_data> -// <data_structure> ::= <array> | <hash> -// <array> ::= '%'<identifier>'[]' -// <hash> ::= '%'<identifier>'{}' -// <variable> ::= '%'<identifier> | <array_element> | <hash_element> -// <array_element> ::= '%'<identifier>'['<expression>']' -// <hash_element> ::= '%'<identifier>'{'<key>'}' -// <function_call> ::= <simple_function_call> | <pointer_function_call> -// <simple_function_call> ::= '$'<identifier>'('<function_parameter_list>')' -// <pointer_function_call> ::= <variable>'->'<function_call> | <simple_function_call>'->'<function_call> -// <pointer_data> ::= <variable>'->'<data>' | <simple_function_call>'->'<data> - - -// -// This must evaluate SCOPE OBJECT operators! -// thus...first evaluate the <data> or <simple_function_call> -// If it was <simple_function_call> or <data> evaluation results in returning a <variable> -// then check if there is a scope operator -// if there is then take it as the top of the tree, the <variable> or <simple_function_call> -// go at the left param of the scope operator and re-evaluate the right side <data> or <simple_function_call> -// - - - - - - - -/* - @doc: kvs_introduction - @type: - language - @keyterms: - kvs, compilation - @title: - KVIrc scripting language introduction - @short: - KVIrc scripting language introduction - @body: - [p] - [b]KVS[/b] is the [b]KV[/b]irc [b]S[/b]cripting language. - It was inspired by C++,sh,perl,php and mIrc scripting language implementations. - It is a compromise between flexibility and speed, a 'workaround' for many intrinsic - problems of an IRC-oriented scripting language. - [/p] - [p] - KVS is semi-interpreted: the execution is done in two main stages. - The first stage is the compilation where a syntactic tree is built. - The second stage is the real execution and is performed by visiting the tree - in the proper order. The syntactic trees are cached in memory so - the next executions can jump directly into the second stage. - This two-stage approach has been introduced in version 3.0.0, the previous - versions of the language used a single-stage on-the-fly interpreter. - [/p] - [p] - KVS allows you to:[br] - [ul] - [li]Implement automated reactions to the events generated by an IRC network[/li] - [li]Add new complex commands[/li] - [li]Add interface elements like popups, toolbars, buttons...[/li] - [li]Add advanced interface elements like complete dialogs or even widgets integrated in KVIrc[/li] - [/ul] - [/p] - [p] - KVS contains all the common constructs of structured programming. - You will find almost all the C control commands, sh/perl-like variables, arrays and and functions. - There are also some object-oriented characteristics: you will find C++ like - objects with constructors, destructors and class inheritance. - There are also more exotic concepts like the signal-slots interobject-communication. - Obviously you will also find most of the RFC1459 IRC commands and - other tools to "play" with an IRC connection. - [/p] - [p] - I'll try to explain the language by using examples - instead of strict syntactic rules. (Actually I have even - tried to write the rules...take a look [doc:syntactic_rules]here[/doc][br][br] - And please...forgive me for my "fantastic" english :) - [/p] - Szymon Stefanek -*/ - -/* - @doc: kvs_basicconcepts - @type: - language - @keyterms: - script - @title: - KVS basic concepts - @short: - KVS basic concepts - @body: - [big]Scripts[/big] - [p] - You use KVS to implement [b]scripts[/b]. - A script is basically a finite list of KVS instructions. - When you type a command in the KVIrc input window you in fact - execute a small one-line script. You can store - longer scripts in KVIrc memory and execute them at later time. - Scripts can be also read from external files by the means of the - [cmd]parse[/cmd] command. - [/p] - [p] - There is an issue with the word [i]script[/i] that is worth clearing here. - It is common usage to call [i]script[/i] a thing that is something more - that a finite list of (some scripting language) instructions. - In fact a set of scripts, documentation files, graphics or other multimedia - files and sometimes executable binaries is still called a [i]script[/i]...just like - the "PrincoScript" or "dynamirc" (tough this last one should be categorized as "malware" instead). - In KVIrc such a collection of items is called [i]addon[/i], but be prepared - for both usages of the word in this documentation and around the web. - [/p] - [p] - More about addons in this [doc:addons]document[/doc] - [/p] - - [big]Hello world![/big] - [p] - This documentation contains a lot of script examples. - They will appear like the following block of code: - [example] - [cmd]echo[/cmd] Hello world! - [/example] - The best way to experiment is to execute the scripts from an external file. - Try to copy & paste the example above to a file and save it in - a known place. Then in the command input window type - [example] - [b]/[/b][cmd]parse[/cmd] <filename> - [/example] - where <filename> stands for the name of the file you just have saved. - Some simple examples (like the one above) can be also typed - directly in the command input window. - You must remember that the command input window needs - a leading slash ('/') character to recognize a script. - The command input window can also be put in multiline mode by clicking - on the button on the right. - Another alternative for testing scripts is the code tester window. - You can access it by selecting "New code tester" from the Scripting menu - at the top of the KVIrc window. You will soon have the opportunity to - experiment with all the methods. Read on. - [/p] - - [big]Basic syntax[/big] - [p] - A script contains a list of instructions separated by newlines or ';' characters. - Placing an instruction per line does not require a terminating character, - placing more instructions in a single line require them to be separated by ';'. - The most common instructions in KVS are [b]commands[/b]. A command is basically - a keyword followed by a list of space separater parameters. - The simplest (and the most useful) command in KVS is [cmd]echo[/cmd]; it prints - all its parameters to a KVIrc window.[br] - The following is an example of a valid script that uses only [cmd]echo[/cmd] commands. - [example] - echo "This is the first line" - ECHO This is the second line; - echo "This is the third line"; echo This is still on the third line; - eChO "This is the fourth line"; Echo "This is still on the fourth line" - [/example] - You have probably noticed that the terminating ';' character is optional - when the command is the last in a line. - The commands are [b]case insensitive[/b]; 'echo' is equivalent to 'Echo', - to 'ECHO' and to 'eChO'. In fact, most of KVS is case insensitive. - (There are obvious unavoidable exceptions for this rule; for example, - on UNIX systems file names are case sensitive and this must be - also reflected in KVS). - Another interesting thing is that when you execute the script you - don't see the enclosing quotes around the printed text: more about this - in the following sections.[br] - [note] - Cryptic note (you may skip it for now):[br] - Yes, the command terminator is a problem for those that want to use ';)' at the end - of IRC commands like [cmd]msg[/cmd]. It is almost unavoidable (read: the cost for - avoiding it is too high). Note that using '|' or any other character as command terminator - will NOT solve the problem: if the terminator is too difficult to type it will annoy the - scripters (and me), if it is too easy then there will be always someone that wants to use it - at the end (or in the middle) of a command with the original meaning. - The solution is to escape the ';' character: - [example] - [cmd]echo[/cmd] You can do it now \;) - [/example] - [/note] - [/p] - - [big]Parameter processing[/big] - [p] - Most of the commands accept (and sometimes require) a list of parameters. - For example, the [cmd]join[/cmd] command (that is used to join an IRC channel) - accepts two parameters: the first one is the channel to join and the second is - the password. The simplified syntax for join is: - [example] - [cmd]join[/cmd] <channel> [password] - [/example] - The line above is an example of syntax specification. All the commands - are described by such syntax lines. [cmd]join[/cmd] is the command and it stands exactly - for the literal string "join" typed in a script. <channel> is in angular parenthesis - and rappresents a mandatory parameter: you must substitute a real channel name in its place - otherwise the command will fail and KVIrc will probably complain too. - [password] is still a parameter but the square parentheses indicate that it is - optional: if you specify it, then it will be interpreted as the channel password, - if you don't then no password will be used. - [note] - The syntax is written in a simplified BNF. I say simplified because it is not - totally strict around the KVIrc documentation. I just prefer the syntax to be - clear and easy to read instead of being formally perfect. - [/note] - You can finally join a channel by writing: - [example] - [cmd]join[/cmd] #kvirc kvircrocks - [/example] - or , since #kvirc usually has no password , by writing: - [example] - [cmd]join[/cmd] #kvirc - [/example] - In the example above the optional parameter [password] is omitted. - [note] - In fact it is not really omitted: KVIrc interprets it as an empty string that later - means "do not send the password to the server". - Empty strings are equivalent to omitted ones. - [/note] - [/p] - - [big]Parameters, spaces and quotes[/big] - [p] - From the examples above is obvious that KVS command parameters are separated by spaces. - What is not totally obvious is that multiple spaces are allowed but KVIrc - will automatically reduce them to exactly one (just like HTML parsers or the shell - interpreters do). This is an useful behaviour in an IRC client since spaces usually - carry no information and in text oriented protocols make the parsing really harder (:D). - [/p] - [p] - The spaces are simplified in normal processing but there are ways to force KVIrc - to interpret the spaces just as they are. - The first method are the quotation marks: all the spaces enclosed in quotation marks - will be preserved. - [example] - [cmd]echo[/cmd] This     text     will     have     spaces     simplified - [cmd]echo[/cmd] But     "this       one     not" - [/example] - The first example will print out with spaces simplified but the second not. - The quotes are also a nice trick to embed spaces into a single parameter that - would be obviously splitted in two or more. - [example] - [cmd]echo[/cmd] Parameter1 Parameter2 "Parameter 3 ( with spaces )" Parameter4 - [/example] - By running the examples above you may have noticed that the spaces are preserved but the - quotes are then stripped! Yes, this is another tricky behaviour. But don't be afraid: - it is really easier to use than to explain. - There is obviously a method to preserve the quotes too and it is also another - method to preserve the spaces but that leads us to the next paragraph. - [/p] - - [big]Escape character[/big] - [p] - You may have already noticed that KVS treats some characters in a special way. - For example the double-quote characters can be used to enclose strings - and are stripped by the parser. - Another example of a special character is the command terminator (';'): - it has the "special" meaning of terminating a command. - If you want to enclose a literal quote in your text, you need to [b]escape[/b] it. - Like in most other programming languages, the escaping character is the backslash ('\'). - [example] - [cmd]echo[/cmd] You can smile this way too! \;) - [/example] - The above example will treat the ';' as a part of the parameters and print it.[br] - In some languages the action of "escaping" a character is called "quoting". - Altough there is some confusion in this term, the meaning is to either use quotes - or to use the escape character to remove special meaning from some characters. - By quoting the spaces you can include them in a parameter, by escaping the quotes - you can include them in a command. - [example] - [cmd]echo[/cmd] "And he said \"Hello world!\"" - [/example] - The example above will have the internal quotes preserved. - You can use the escape backslash to escape a newline: - [example] - [cmd]echo[/cmd] This text will be \ -     printed on a single line! - [/example] - After an escaped newline all the leading space and tab characters are skipped, - so you must include the needed spaces [b]before[/b] the escape character. - The previous example will be printed as:[br][br] - [i]This text will be printed on a single line[/i][br] - Another example:[br] - [example] - [cmd]echo[/cmd] "The new kvirc       \ -     IS OUT!" - [cmd]echo[/cmd] Check it out at http://www.kvi\ -     rc.net! - [/example] - This will be printed as:[br][br] - [i] - The new kvirc       IS OUT![br] - Check it out at http://www.kvirc.net! - [/i][br] - Finally, you can escape an escape character to include it literally in a parameter (and - this is really the end of these tricks :) - Later we will discover other common usages of the backslash escape, such - as preventing KVIrc from interpreting a literal percent character as a variable - or separating variable names from the text. - [/p] - - [big]Command switches[/big] - [p] - Many commands accept switch parameters. - [b]A switch modifies the behaviour of a command.[/b] - Any switch can optionally accept a parameter, that must - be specified after an equal ('=') sign. - [example] - [cmd]echo[/cmd] [b]-i = 2[/b] This text uses a specific color scheme - [/example] - The -i switch (just for example) changes the attributes - and the icon of the printed text. - [b]The switch must be specified immediately after the command keyword.[/b] - [example] - [cmd]echo[/cmd] This -i = 2 will obviously not work... - [/example] - If you want to start the first parameter of a command (that is not a switch) - with a literal '-' you must again escape it: - [example] - [cmd]echo[/cmd] \--- This text has three minus signs on the left - [/example] - or use the quotes: - [example] - [cmd]echo[/cmd] "--- This text has three minus signs on the left" - [/example] - [/p] - - [big]Command blocks[/big] - [p] - Commands can be 'grouped' in blocks by using the classic C++ braces. - Here is a single line example:[br] - [example] - { [cmd]echo[/cmd] First command; [cmd]echo[/cmd] Second command; } [cmd]echo[/cmd] Third command - [/example] - Multi line example:[br] - [example] - { - [cmd]echo[/cmd] First command - [cmd]echo[/cmd] Second command - } - [cmd]echo[/cmd] Third command - [/example] - [note] - Reminder : copy the example above to a text file - and then use /[cmd]parse[/cmd] <filename> - [/note] - In this case the command block has no special meaning - other than making the code more readable , but command blocks - will be useful later (see [cmd]if[/cmd],[cmd]while[/cmd]...).[br] - [note] - Unlike in C or C++, the braces do NOT automatically define a variable scope - (with few exceptions to this rule ... just to complicate the things a bit more). - You will recall this last assertion later, when reading about [doc:data_structures]data structures[/doc]. - [/note] - [/p] - - [big]Comments[/big] - [p] - KVIrc supports comments in command sequences.[br] - A comment starts with the character '#' and terminates with a newline. - You can start a comment anywhere a command can start.[br] - [example] - # This is a comment , it occupies the whole line - [cmd]echo[/cmd] After the comment!; # This is an end-line comment - [/example] - You can't escape newline characters in this case. - (or better: escape characters have no meaning in comments... - maybe one day I'll implement it).[br] - Starting from version 3.0.0 kvirc supports also C++ single line and C multiline comments.[br] - A C++ comment starts with two slashes '//' and terminates with a newline. - A multiline C comment starts with '/*' and ends at the first '* /' encountered. - Since KVIrc has no pre-processor, the C/C++ comments usually can't be placed in the middle of a command: - they must start where a command would start and end before the begin of another command.[br] - [/p] - - [big]Indentation[/big] - [p] - You [b]should[/b] use spaces or [b]tabs[/b] to [b]indent[/b] your code. Note that the [b]should[/b] - word is written in bold characters: I mean that you really should indent your code. - Indenting helps both you (the script writer) and the reader (any other user that will - read your script). A good indenting practice is the first step to become a great programmer :) - [note] - Please note that the command parameters should be separated by - space characters (ascii 32). Tabs are not granted to work as parameter separators.[br] - [/note] - [example] - { - <tab>[cmd]echo[/cmd] Indented command - <tab>{ - <tab><tab># Comment - <tab><tab>[cmd]echo[/cmd] Really Really long indented \ - <tab><tab><tab>command - <tab>} - } - [/example] - Tabs behave better than spaces as indentation characters since other users can - adjust the tab size to match their taste. I personally prefer 4 character tabs - while most text/code editors usually come with 8 characters as default. - [/p] - - [big]And now ?[/big] - [p] - You're now ready to really start experimenting with KVS. You can take - a look at the [doc:commands]command index[/doc] and start trying to use them - while keeping in mind the rules described in this document. - The next suggested lecture is the documentation about [doc:kvs_aliasesandfunctions]the aliases and the functions[/doc]. - Have fun :) - [/p] -*/ - -/* - @doc: kvs_aliasesandfunctions - @type: - language - @keyterms: - aliases, functions - @title: - KVS Functions and aliases - @short: - KVS Functions and aliases - @body: - [big]Introduction[/big] - [p] - Since you're here, you should already have readed about the [doc:kvs_basicconcepts]KVS basic concepts[/doc] - and have visited the [doc:commands]command index[/doc]. If you feel ready to take the next step - then read on. - [/p] - - [big]Functions[/big][br] - [p] - KVS has many internal [doc]functions[/doc] that can be used as command parameters.[br] - [b]All the function names start with a literal '$' character.[/b][br] - [example] - [cmd]echo[/cmd] This window caption is [fnc]$window.caption[/fnc] - [/example] - The [fnc]$window.caption[/fnc] [doc:functions]function[/doc] - is evaluated before the command executes, - and it is changed into the current window caption text.[br] - The [doc]functions[/doc] can be used also as switch parameters.[br] - [example] - [cmd]echo[/cmd] -w = [fnc]$window[/fnc] This text will be surely \ -     printed in the current window - [/example] - The -w switch allows to redirect the echo text to a specified window --- in this - case the one that you are typing in.[br] - [i](Surprise: in this case the -w switch is useless , - since echo prints text to the current window by default... - but it will work correctly. :)[/i] - [/p] - [p] - Normal function names can be made of "anycase" letters, digits and underscores, - with the restriction that the first character is not a digit.[br] - Some kind of functions can contain a dot '.' character inside the name - and these are assumed to be module references (see [doc:modules]the modules documentation[/doc]).[br] - [/p] - [p] - By now we have seen only simple functions, but there's more...[br] - The functions can accept parameters; the general syntax for a function call is:[br] - [b]$<function name>['('<parameter_list>')'][/b][br] - where <parameter_list> is a list of comma separated parameters, - eventually empty. - [example] - [cmd]echo[/cmd] The word 'neural' is [fnc]$str.len[/fnc](neural) characters long - [/example] - The function [fnc]$str.len[/fnc] accepts a single parameter and returns the - length in characters of the parameter string. The returned value is always - a string: in this case it can be also interpreted as a number.[br] - When passing an empty list you can avoid the parenthesis. - (And you have found the "simple" functions shown above). - So the followind two calls are equal:[br] - [example] - [cmd]echo[/cmd] [fnc]$window.caption[/fnc] - [cmd]echo[/cmd] [fnc]$window.caption()[/fnc] - [/example] - If you want to pass an "empty" string as the first parameter you have to use - the following syntax:[br] - [example] - [cmd]echo[/cmd] [fnc]$str.len[/fnc]("") - [/example] - Obviously a function is valid as a function parameter.[br] - [example] - [cmd]echo[/cmd] [fnc]$str.len[/fnc]([fnc]$window.caption[/fnc]) - [/example] - If you want to place a literal '(' or ')' in the function parameters - you must escape it. - A special case for when you want to use 'matching' parentheses: - an opened '(' corresponds to a closed ')'. - In this case you can omit the 'escape' character.[br] - [example] - [cmd]echo[/cmd] The length of '(a+b)' is : [fnc]$str.len[/fnc]( (a+b) ) - [/example] - This is useful for algebraic and boolean expressions , like the ones - accepted by the special function $() (see next paragraphs).[br] - [/p] - - - [big]Aliases[/big][br] - An alias is an user defined command. It can be used to rename the builtin kvirc commands or functions, - to automatize complex tasks or as structured programming mean. - Aliases can be created or destroyed by using the scriptcenter (graphic interface) - or from the commandline (or script) by using the [cmd]alias[/cmd] command. - Once created, an alias remains stored permanently in the KVIrc configuration files - until it is explicitly deleted. - A couple of examples will make the things clear. - join is a really commonly used command. It might be a good idea to rename it to - simply "j" .. just to type it faster. - Nothing easier in KVirc: just try this commandline: - [example] - [cmd]alias[/cmd](j){ [cmd]join[/cmd] $0-; }; - [/example] - - This will create the alias "j". From this moment you can use /j as it was a normal command. - [example] - j #kvirc - [/example] - You may have notices the strange $0- function in the alias body: it stands for - "all parameters passed to the alias". This means that when you call - [example] - j #kvirc testpassword - [/example] - then both the parameters (#kvirc and testpassword) are passed to the join command. - The $N functions are special functions that return the positional parameters passed - to the current script context. In an alias the script context is the script body and - it is the alias caller that generates the parameters. - $N (where N is a digit) returns the (N-1)-th positional parameter passed by the caller. - It returns the parameter numbered N-1 and not N since the parameters are indexed starting - from zero ($0 is the first parameter!). - $N-M returns the parameters from (N-1)-th to the (M-1)-th (a parameter range) and $N- returns - all the parameters from (N-1)-th to the last one. In the example above $0- stands for - all the parameters starting from the first one. - [/p] - [p] - To remove an alias use again the alias command with an empty body: - [example] - [cmd]alias[/cmd](j){} - [/example] - This will remove the alias "j" defined above. - [/p] - [p] - A common task in channel management is the kick & ban action. - You first ban an user from the channel and then eventually kick him - (obviously assuming that he is actually on the channel). - This involves using two commands: ban and then kick. - It could be a nice idea to have a single "kb" command to perform this action. - Well...easy: - [example] - [cmd]alias[/cmd](kb){ [cmd]ban[/cmd] $0; [cmd]kick[/cmd] $0-; }; - [/example] - This adds the "kb" alias: it can be called as a normal command: - [example] - kb spammer You're not welcome here! - [/example] - This will first execute "ban spammer" and then "kick spammer You're not welcome here". - Our kb is a really simple example... it doesn't check for the validity of the parameters: - the server will warn us if the parameters passed to kb were empty. - [/p] - [p] - The alias can be modified at any time by re-using the alias command. - Let's make our "kb" a bit more intelligent and add a check for the parameters. - TIP: It is a good idea to write the following examples in a text file and then use /parse <filename> to execute it. - [example] - [cmd]alias[/cmd](kb) - { - [cmd]if[/cmd]("$0" == "") - { - [cmd]echo[/cmd] "Usage: /kb <nickname> <kick reason>" - [cmd]return[/cmd] - } - [cmd]ban[/cmd] $0 - %reason = $1- - [cmd]if[/cmd]("%reason" == "")%reason = "You're not welcome here!" - [cmd]kick[/cmd] $0 %reason - } - [/example] - The example above will first check the validity of the <nickname> passed to kb: - if no nickname was passed , it will warn the user and stop. - The next step will be the "ban <nickname>" call. Another enchancement is the "default reason": - we first assign the remaining parameters ($1- means "from $1 to the end") to a temporary variable, - if the variable is empty , a default kick reason is assigned. - Finally the "kick <nickname> <reason>" will be executed. - Get used to looking at the single command documentation pages, they will give - you the hints necessary to fully understand the above piece of code. - [/p] - [p] - Aliases can be used as a mean for structured programming. - In large scripts you will SURELY have "common tasks" to perform (like having specially - colored output or calculating a value from a set of other values)... - Aliases are the way of writing the common tasks: they are equivalent to the "procedures" - or "functions" in many high-level programming languages. - The alias as a procedure (subroutine or sub-task) has been shown in the "kb" example above: - it might be commonly called from complexier scripts or other aliases in case that a - kick & ban action is needed. - [/p] - [p] - The aliases can be used also as functions. - Assume that you need really often to calculate the sum of three numbers: a function-alias is the way. - [example] - [cmd]alias[/cmd](sum3){ [cmd]return[/cmd] $($0 + $1 + $2); }; - [/example] - This will add the alias "sum3" and make it available both as a command and a function. - The "return" command sets the return value of a sequence of commands - (an alias is a sequence of commands...remember ?) and terminates the execution (by returning - the control to the caller). - So return $($0 + $1 + $2); will set the return value of the alias to the value - computed by $($0 + $1 + $2) that actually is the sum of the first three parameters passed. - You will then use it in the following way: - [example] - ... - %myfirstsum = $sum3(%somevalue,%someothervalue,4) - %anothersum = $sum3(12,%somevalue,%anothervalue) - ... - [/example] - Ops.. I've used some variables without actually explaining them... hehe.. please forgive me and read on. - This example is again really simple , but you might have complexier function-aliases. - The function-aliases are also normal aliases.... you can use it as a command: - [example] - /sum3 1 2 3 - [/example] - Is a perfectly valid call.... it's just that it will have no visible results - (just because a command call implies ignoring the return value. - In fact there is no difference al all between function-aliases and normal-aliases: - the caller makes the difference: by calling an alias as a command the return value - just disappears in hyperspace, by calling an alias as a function , the return value - is propagated (and in fact "used"). - (There are some "nice" exceptions to this rule...but you don't need to care about it, for now). - If return is not called inside an alias body , the return value will be just a null value. - [/p] - [p] - Aliases can accept switches just like any other command. The [fnc]$sw[/fnc] is there - exactly for that purpose. Check it out. - [/p] - - [big]Special functions[/big] - [p] - We have already seen the positional parameter functions. - The functions of type [b]$N[-[M]][/b] (where N and M are positive - numbers starting from 0 and N < M) evaluate to the sequence of - [b]positional parameters[/b] from Nth to Mth."[br] - If M is omitted , the function evaluate to the sequence of [b]positional - parameters[/b] from Nth to the last one. If the whole -M block is omitted - the function evaluate to the Nth positional parameter. - We will discover more on the [b]positional parameters[/b] when talking - of aliases and events.[br] - [example] - $0 evaluates to the 1st positional parameter - $0-4 evaluates to the parameters from first to 5th - $41- evaluates to the parameters from 41st to the last avaiable - [/example] - The function [b]$#[/b] evaluates to the number of positional parameters available. - The [b]positional parameter[/b] functions do not accept parameters.[br] - The special function [b]$(<expression>)[/b] returns the result - of the evaluation of the <expression>. In previous versions of KVIrc this - function was called [fnc]$calc[/fnc].[br] - [example] - [cmd]echo[/cmd] $(2 + (3 ^ 7) <= 1 * (3 && 2)) - [/example] - The special function [b]${<command sequence>}[/b] evaluates to the - return value of the <command sequence>.[br] - The special function [b]$$[/b] evaluates to the current object id, - but it is too early to explain it here...[br] -*/ - -/* - @doc: command_rebinding - @type: - language - @keyterms: - Rebinding commands to another window - @title: - Standard rebinding switch - @short: - Standard rebinding switch - @syntax: - <command> -r=<window_id> <parameters> - @body: - The -r switch is standardized along all the commands. It rebinds a command - to the windows specified by <window_id>. It is useful to launch commands - in windows that are not the current one. For example, you might want to - say something in a specific channel while processing an event bound to - a console, or say something in all the channels bound to the current irc context. - The examples below will make everything clear. - @examples: - [example] - [comment]# Run a command in the console of the current IRC context[/comment] - [cmd]echo[/cmd] -r=$console This command is executed in the console ($window.caption) - [comment]# Say something to all the channels of the current IRC context[/comment] - [cmd]foreach[/cmd](%w,[fnc]$window.list[/fnc](channel))[cmd]say[/cmd] -r=%w Hi ppl on [fnc]$chan.name[/fnc] - [/example] -*/ - - /* - @doc: window_naming_conventions - @type: - language - @title: - Window naming conventions - @keyterms: - IRC context,window ID,frame window,connection ID - @short: - KVIrc window structure and the window naming conventions - @body: - [big]Introduction[/big][br] - Starting from the release 3.0.0 KVIrc window structure has - grown in complexity. Older releases allowed one connetion - per "frame window" and thus had a dedicated command parser - for each connection. Finding a window in that scenario - was quite easy: it was enough to designate it by "name" - (that was exactly the text displayed in the window caption). - It was sufficient to have an "unique" name for ever window; - condition that was granted by the underlying IRC protocol - and by the KVIrc core design.[br] - In this version, the unique window names are impossible to be granted.[br] - [big]Scenario[/big][br] - The command parser is now "global" to the application. - There can be two or more consoles in each frame and the user - is able to join the same channel with two different nicknames - using two separate connections. - [ul] - [li] - Application (Unique command parser) - [ul] - [li] - Frame X - [ul] - [li] - Console M (IRC context) - [ul] - [li]Channel windows[/li] - [li]Query windows[/li] - [li]Other connection related windows[/li] - [/ul] - [/li] - [li] - Console N (IRC context) - [ul] - [li]Channel windows[/li] - [li]Query windows[/li] - [li]Other connection related windows[/li] - [/ul] - [/li] - [li] - Other windows - [/li] - [li] - ... - [/li] - [/ul] - [/li] - [li] - Frame Y - [ul] - [li] - Console O (IRC context) - [ul] - [li]Channel windows[/li] - [li]Query windows[/li] - [li]Other connection related windows[/li] - [/ul] - [/li] - [li] - Console P (IRC context) - [ul] - [li]Channel windows[/li] - [li]Query windows[/li] - [li]Other connection related windows[/li] - [/ul] - [/li] - [li] - Other windows - [/li] - [li] - ... - [/li] - [/ul] - [/li] - [li] - ... - [/li] - [/ul] - [/li] - [/ul] - [br] - A naming convention has becomed necessary to resolve ambiguities.[br] - [big]Basic assumptions[/big] - Every KVIrc window has four main properties:[br] - -[b]an unique numeric identifier[/b][br] - -[b]the logical name[/b][br] - -[b]the type identifier[/b][br] - -[b]the caption text[/b][br] - The [b]numeric identifier[/b] is unique to the whole application, - and is the one returned by the [fnc]$window[/fnc] function.[br] - The identifier is assigned by KVIrc when the window is created - and is not changed until the window is destroyed. - This identifier will be referred as [b]window ID[/b].[br] - The [b]logical name[/b] is a property of some kind of windows. - It usually corresponds to the first part of the window caption. - For example, for channel windows it is the channel name, for - queries it is the list of the targets. For some other windows - the logical name corresponds to the caption text. This will be discussed later.[br] - The [b]type identifier[/b] describes the properties of a certain window. - For channel windows the type identifier is "channel" , for query windows is "query" , - for console windows it is "console", etc..[br] - - [big]Irc contexts[/big][br] - The KVIrc frame windows are numbered starting from 0 and named - "frame_<number>". Each frame can contain an unlimited number of consoles.[br] - Each console is bound to an [b]IRC context[/b]. (The part "is bound to" could - be substituted by "defines" or "is contained in").[br] - [i]An [b]IRC context[/b] is a set of resources that can deal with a single - IRC connection.[/i][br] - The association between an [b]IRC context[/b] - and a console is bijective: each [b]IRC context[/b] is associated - to a single console window.[br] - An [b]IRC context[/b] can be in connected or not-connected state. - When in connected state, it contains a set of windows beside the console: - mainly channels and query windows. - The channels and query windows can exist ONLY if the associated - [b]IRC context[/b] exists.[br] - Channels and queries have unique names inside a connection so - there is no way to confuse it. (Theoretically there can - be more than one query window with the same name, but in fact - all the windows refer to the same target so they are instances - of the same resource). - All this creates a sort of namespace: the channels and queries can be identified - as "bound" to a specific [b]IRC context[/b].[br] - An [b]IRC context[/b] can "contain" other windows, such as the "sockets" - window or the "list" window. KVIrc takes care of making them - unique inside the [b]IRC context[/b] namespace.[br] - Each [b]IRC context[/b] has its own unique [b]IRC context ID[/b] (see [fnc]$context[/fnc]).[br] - Since to a single [b]IRC context[/b] may correspond only a single irc connection, - when in connected state, the [b]IRC context[/b] may be referred also as [b]connection[/b] - or [b]connection context[/b], and the associated [b]IRC context Id[/b] can be - referred as [b]connection ID[/b] or [b]connection context ID[/b].[br] - There are classes of windows that are not bound to any [b]IRC context[/b]: - this includes user created windows, DCC windows, browsers etc.[br] - KVIrc will try to keep that windows with unique logical names.[br] - [big]How to identify a window[/big][br] - So what we have until now is:[br] - [ul] - [li]Each window has its own unique [b]window ID[/b]: we - will refer windows always using this identifier.[/li] - [li]Each window has a set of properties including: - window type, logical name.[/li] - [li]Subsets of windows are bound to a single [b]IRC context[/b][/li] - [/ul] - The simplest (but also the less significant) method of looking for - a window is to finding it by caption.[br] - The [fnc]$window[/fnc] function finds the first KVIrc window matching - the "caption text" and returns its [b]window ID[/b].[br] - This method will likely fail when there are more windows with the same - caption text; for this reason several specific functions - have been added to allow finding the correct window.[br] - The [fnc]$console[/fnc] finds a console window bound to a specified - [b]IRC context[/b].[br] - The [fnc]$channel[/fnc] finds a channel window matching the specified - name and bound to a specified [b]IRC context[/b].[br] - The [fnc]$query[/fnc] finds a query window that has a specified target - and is bound to a specified [b]IRC context[/b].[br] - */ - - - /* - @doc: connection_dependant_commands - @type: - language - @title: - Connection dependant commands - @keyterms: - IRC context, connection dependant commands - @body: - Many KVIrc commands are connection dependant: - you need an IRC connection to succesfully execute them; - usually because some data needs to be sent to the server. - This includes commands like [cmd]whois[/cmd],[cmd]raw[/cmd],[cmd]query[/cmd], - [cmd]msg[/cmd],[cmd]notice[/cmd],[cmd]op[/cmd],[cmd]ctcp[/cmd]...[br] - These commands must be executed in a window that is bound to a - [b]connected [doc:window_naming_conventions]IRC context[/doc][/b]. - You will obviously get an error message if you try to use them in a window - that has no associated IRC connection.[br] - For instance: [cmd]whois[/cmd] will work only if you execute it - in a console , channel or query window.[br] - If you want to use these commands in a window that is not associated to - any IRC context you may use the [doc:command_rebinding]standard -r switch[/doc]. - You can use the same switch to execute a command in an [b]IRC context[/b] that is - not the current one. - */ - - -/* - @doc: aliases - @type: - language - @keyterms: - aliases - @title: - Aliases - @short: - Aliases : user definable command sequences - @body: - An alias is an user defined command. It can be used to rename the builtin kvirc commands or functions, - to automatize complex tasks or as structured programming mean. - Aliases can be created or destroyed by using the scriptcenter (graphic interface) - or from the commandline (or script) by using the [cmd]alias[/cmd] command. - Once created, an alias remains stored permanently in the KVIrc configuration files - until it is explicitly deleted. - A couple of examples will make the things clear. - join is a really commonly used command. It might be a good idea to rename it to - simply "j" .. just to type it faster. - Nothing easier in KVirc: just try this commandline: - [example] - [cmd]alias[/cmd](j){ [cmd]join[/cmd] $0-; }; - [/example] - - This will create the alias "j". From this moment you can use /j as it was a normal command. - [example] - j #kvirc - [/example] - You may have notices the strange $0- function in the alias body: it stands for - "all parameters passed to the alias". This means that when you call - [example] - j #kvirc testpassword - [/example] - then both the parameters (#kvirc and testpassword) are passed to the join command. - The $N functions are special functions that return the positional parameters passed - to the current script context. In an alias the script context is the script body and - it is the alias caller that generates the parameters. - $N (where N is a digit) returns the (N-1)-th positional parameter passed by the caller. - It returns the parameter numbered N-1 and not N since the parameters are indexed starting - from zero ($0 is the first parameter!). - $N-M returns the parameters from (N-1)-th to the (M-1)-th (a parameter range) and $N- returns - all the parameters from (N-1)-th to the last one. In the example above $0- stands for - all the parameters starting from the first one. - [/p] - [p] - To remove an alias use again the alias command with an empty body: - [example] - [cmd]alias[/cmd](j){} - [/example] - This will remove the alias "j" defined above. - [/p] - [p] - A common task in channel management is the kick & ban action. - You first ban an user from the channel and then eventually kick him - (obviously assuming that he is actually on the channel). - This involves using two commands: ban and then kick. - It could be a nice idea to have a single "kb" command to perform this action. - Well...easy: - [example] - [cmd]alias[/cmd](kb){ [cmd]ban[/cmd] $0; [cmd]kick[/cmd] $0-; }; - [/example] - This adds the "kb" alias: it can be called as a normal command: - [example] - kb spammer You're not welcome here! - [/example] - This will first execute "ban spammer" and then "kick spammer You're not welcome here". - Our kb is a really simple example... it doesn't check for the validity of the parameters: - the server will warn us if the parameters passed to kb were empty. - [/p] - [p] - The alias can be modified at any time by re-using the alias command. - Let's make our "kb" a bit more intelligent and add a check for the parameters. - TIP: It is a good idea to write the following examples in a text file and then use /parse <filename> to execute it. - [example] - [cmd]alias[/cmd](kb) - { - [cmd]if[/cmd]("$0" == "") - { - [cmd]echo[/cmd] "Usage: /kb <nickname> <kick reason>" - [cmd]return[/cmd] - } - [cmd]ban[/cmd] $0 - %reason = $1- - [cmd]if[/cmd]("%reason" == "")%reason = "You're not welcome here!" - [cmd]kick[/cmd] $0 %reason - } - [/example] - The example above will first check the validity of the <nickname> passed to kb: - if no nickname was passed , it will warn the user and stop. - The next step will be the "ban <nickname>" call. Another enchancement is the "default reason": - we first assign the remaining parameters ($1- means "from $1 to the end") to a temporary variable, - if the variable is empty , a default kick reason is assigned. - Finally the "kick <nickname> <reason>" will be executed. - Get used to looking at the single command documentation pages, they will give - you the hints necessary to fully understand the above piece of code. - [/p] - [p] - Aliases can be used as a mean for structured programming. - In large scripts you will SURELY have "common tasks" to perform (like having specially - colored output or calculating a value from a set of other values)... - Aliases are the way of writing the common tasks: they are equivalent to the "procedures" - or "functions" in many high-level programming languages. - The alias as a procedure (subroutine or sub-task) has been shown in the "kb" example above: - it might be commonly called from complexier scripts or other aliases in case that a - kick & ban action is needed. - [/p] - [p] - The aliases can be used also as functions. - Assume that you need really often to calculate the sum of three numbers: a function-alias is the way. - [example] - [cmd]alias[/cmd](sum3){ [cmd]return[/cmd] $($0 + $1 + $2); }; - [/example] - This will add the alias "sum3" and make it available both as a command and a function. - The "return" command sets the return value of a sequence of commands - (an alias is a sequence of commands...remember ?) and terminates the execution (by returning - the control to the caller). - So return $($0 + $1 + $2); will set the return value of the alias to the value - computed by $($0 + $1 + $2) that actually is the sum of the first three parameters passed. - You will then use it in the following way: - [example] - ... - %myfirstsum = $sum3(%somevalue,%someothervalue,4) - %anothersum = $sum3(12,%somevalue,%anothervalue) - ... - [/example] - Ops.. I've used some variables without actually explaining them... hehe.. please forgive me and read on. - This example is again really simple , but you might have complexier function-aliases. - The function-aliases are also normal aliases.... you can use it as a command: - [example] - /sum3 1 2 3 - [/example] - Is a perfectly valid call.... it's just that it will have no visible results - (just because a command call implies ignoring the return value. - In fact there is no difference al all between function-aliases and normal-aliases: - the caller makes the difference: by calling an alias as a command the return value - just disappears in hyperspace, by calling an alias as a function , the return value - is propagated (and in fact "used"). - (There are some "nice" exceptions to this rule...but you don't need to care about it, for now). - If return is not called inside an alias body , the return value will be just a null value. - [/p] - [p] - Aliases can accept switches just like any other command. The [fnc]$sw[/fnc] is there - exactly for that purpose. Check it out. - [/p] -*/ - - -/* - @doc: kvs_addons - @type: - language - @keyterms: - addons, addon - @title: - The KVIrc addon system - @short: - Writing KVIrc addons - @body: - [big]Introduction[/big] - [p] - An addon is basically a set of KVS scripts, multimedia, documentation - and accessory files that implement a KVIrc feature. - It might be a simple automatic-away subsystem, a GUI newsticker or a complex file sharing - service (commonly called "fserve"). Addons are sometimes called "scripts". - In fact a KVIrc addon is usually made of more than one KVS script. - [/p] - [p] - KVIrc has a builtin addon management system that allows the users - to install, configure and uninstall features with a nice graphical interface. - The management system allows the addons to have documentation integrated in the - KVIrc help and to be translated in several languages. - [/p] - - [big]Addon installation[/big] - [p] - The addons are usually shipped in compressed archives (such as tar.gz "tarballs" or - zip files). Once uncompressed they should contain a KVS script file called "install.kvs". - KVIrc will look for and execute this file when the user will ask for your addon to - be installed. The install.kvs will usually contain the code for the [b]registration[/b] - of your addon and will [cmd]include[/cmd] all the other necessary source files. - [/p] - - [big]The minimal addon[/big] - [p] - The smallest addon that you can write is the one that does nothing. - It just need to be writte in a file named install.kvs and contain code - similar to the following: - [example] - [cmd]addon.register[/cmd]("myaddon", \ - "1.0.0", \ - "My First Addon", \ - "An addon that is really cool but does simply nothing", \ - "3.2.0.99.20051230") - { - } - [/example] - The code above does nothing but registers the "myaddon" addon. - [/p] - [p] - The first parameter is the internal addon id which can be used to identify - your addon inside KVIrc. The id must be unique: two addons that share the same - name cannot be installed. The second parameter is the addon version. It should - be expressed in the classic format [major].[minor].[pathlevel] or something - really similar (in fact KVIrc just expects the version to be a string composed - of numbers separated by dots). The version is compared when an addon is installed - and KVIrc complains if the user tries to downgrade an addon (that is to install - a less recent version over a more recent one). The third parameter - is the visible name of your addon: it will be displayed to the user in the - addon management dialog. It can contain the [fnc]$tr[/fnc] function so you - can have it translated to several languages. The fourth parameter - is a short description of the feature that the addon implements; it can contain - the $tr() function too. The fifth parameter is the minimal KVIrc version - required to run the addon. There is also a sixth parameter (the icon) and - some switches that can be used to fiddle a little bit more :) - [/p] - [p] - The callback instruction that follows the registration command is the - uninstallation code. KVIrc will invoke it when the user will ask for - your addon to be uninstalled. Don't assume that your addon will be never uninstalled: - sooner or later it will be. For example, when upgrading an addon KVIrc - will first uninstall the existing version and after that install the new one. - The uninstallation process is a very important requisite for any program (in any - programming language). In the example above there is nothing to uninstall (yet) - so the callback code is empty, but if you continue reading we will soon fill it. - [/p] - - [big]A typical addon layout[/big] - [p] - As stated above, the addons are usually shipped in a compressed archive. - Once uncompressed, the archive will expand into a small directory tree - containing the addon code and all the related files. - In order to have uniformity I encourage you to use the following directory structure. - [/p] - [p] - [pre] -     [b]addonId-version/[/b] -         install.kvs -         INSTALL -         [b]src[/b] -                 source1.kvs -                 source2.kvs -                 source3.kvs -                 ... -         [b]pics[/b] -                 addonId_pic1.png -                 addonId_pic2.png -                 addonId_pic3.png -                 ... -         [b]audio[/b] -                 addonId_audio1.png -                 addonId_audio2.png -                 addonId_audio3.png -                 ... -         [b]help[/b] -                 en -                         index.html -                         hints.html -                         ... -                 it -                         index.html -                         hints.html -                         ... -                 ... -         [b]locale[/b] -                 addonId_it.mo -                 addonId_ru.mo -                 addonId_de.mo -                 ... -         [b]...[/b] -                 ... -                 ... -                 ... -                 ... - [/pre] - [/p] - [p] - The entries in [b]bold[/b] are directories while the other are files. - Please note that this is a general layout for a huge and rather complex - addon: you might not need all of these directories. Remember: the minimal - addon has only an install.kvs file. Anyway, a really cool addon - will probably have all of them and maybe some more. - [/p] - [p] - The toplevel directory should be named with your addonId and version. - Try to use no spaces in the directory entries (this will make the things - simplier for people that want to use your addon). The toplevel - directory should contain your install.kvs script and a file with - a small description and the basic installation instructions. - This file can be named INSTALL or README. - [/p] - [p] - Hint: Remember that your addon is going to be installed on different platforms - (at least linux, macosx and windows based). - The poor windows notepad has serious problems with reading text - files that contain only linefeeds as line separators. Keep it in mind... - [/p] - [p] - The main source directory for your addon should be named "src" and - should contain the implementation of the feature(s) you're going to provide. - These files should be executed by the means of the [cmd]parse[/cmd] - command (or [cmd]include[/cmd] if you like the C/C++ style) from install.kvs. - [/p] - [p] - The "pics" and "audio" (if relevant) directories should contain your - multimedia files. It is a good idea to prefix the filenames with your addon id - in order to avoid collisions with other addons. The install.kvs script - should copy these files to the appropriate locations under the KVIrc local - directory returned by [fnc]$file.localdir[/fnc](). - [/p] - [p] - The "help" directory should contain subdirectories for each language that - your help files are written in. The languages dirs should be named - with the language code also used for the translation files (like "en","it" etc...). - Please note that english is the default language and KVIrc will - fallback to the "en" subdirectory when no other language is found around... - The help files (and subdirectories) should be copied to the "help" subdirectory of the KVIrc local - directory returned by [fnc]$file.localdir[/fnc](). - Since there will be many help files inside the language dirs, it is a good idea - to either prefix your help files with your addon id or (better) to create - a subdirectory named agains your addon inside the help language directory. - For an english file this would lead to something like... - [example] - file.copy index.html $file.localdir("help/en/myaddon") - [/example] - [/p] - [p] - The "locale" directory should contain the *.mo files for your tranlations. - The localization process of a script is explained in [doc:localization]this document[/doc]. - The *.mo files should be copied to the "locale" subdirectory of the KVIrc local - directory returned by [fnc]$file.localdir[/fnc](). - Your *.mo filenames should be prefixed by your addon id (again to avoid collisions). - [/p] - - [big]The help and configuration callbacks[/big] - [p] - Each addon can have a help and a configuration callback. These are set - respectively by [cmd]addon.sethelpcallback[/cmd] and [cmd]addon.setconfigurecallback[/cmd]. - [/p] - [p] - The help callback will be invoked by KVIrc when the user will ask help for your addon (mainly - from the addon management dialog, but not necessairly). It should call [cmd]help.open[/cmd] - with the name of your documentation index html file (it should be relative - to the help language directory: help.open myaddon/index.html will automatically - lookup the right language). If you provide no help callback, the buttons - for requesting help will be simply disabled. (A good an relatively complex addon - *should* have at least a minimal help file explaining the features). - [/p] - [p] - The configuration callback will be invoked when the user will try to configure - your addon from the addon management dialog. This callback is useful - mainly for complexier graphical scripts that can show up a dialog - that allows configuring all of the addon features. To use this callback - you will probably need some object scripting. - [/p] - - [big]The real addon work[/big] - [p] - The real addon work is done by the scripts contained in the src directory. - They will likely add aliases (maybe in a nice namespace named agains your addon), - register event handlers, create actions, timers, toolbars and object classes. - You should install all of this stuff from your addon source files. - Remember that your source files will NOT be parsed every time KVIrc starts up: - your stuff must be registered in KVIrc and be able to startup itself, if needed. - Remember that you must clean up [b]everything[/b] in your uninstallation callback. - This means that you must remove the aliases, unregister the event handlers, - destroy the actions, kill the timers and the object classes you've created. - Be a clean coder :) - [/p] - - [big]Where to start[/big] - [p] - It is a good idea to start on the KVIrc web site. There are surely - several addons to look at. Pick one that seems simple and analyze its - layout and code (wow... the free software!). It will be easier to do than it was to explain it :D - [/p] - [p] - Have fun! :) - [/p] -*/ - - -/* - @doc: kvs_codingtips - @type: - generic - @title: - Coding tips - @keyterms: - indentation,indent,readability - @short: - Generic coding tips for scripters (and not only) - @body: - Here comes a small list of "coding tips".[br] - These apply to programming in general , not only to KVIrc scripting.[br] - [br] - 1. [b]Comment your code[/b][br] - A well commented code is easy to mantain, and easy to read by others.[br] - [br] - 2. [b]Indent your code[/b][br] - Indentation increases the code readability; this is again for you and - other developers that will be going to read your code.[br] - [br] - 3. [b]Use TABS to indent your code[/b][br] - ...and use ONLY TABS to indent.[br] - Tabs are better than space since most code editors allow you - to set the tab sice and thus to have the indentation steps smaller or bigger.[br] - This is really important since the indentation size is really a matter of personal taste.[br] - Mixing spaces and tabs is Evil (tm), since it makes the code look really - ugly in editors that have the tab size different than yours; in some cases the - code gets really unreadable.[br] - [br] - 4. [b]Use descriptive variable names[/b][br] - Using 'foo' as variable name implies tracing its semantic the next - time that you're going to read the code that uses it.[br] - This is really annoying and time-consuming, especially if the project - is getting large.[br] - Obviously using "thisIsACounterVariable" as name for a simple counter - is also a suicide.[br] - A good convention on variable names can speed up writing , debugging and mantaining code.[br] - Encoding the type of the variable in the variable name might be also a good idea, - but this is a matter of taste; personally I feel really well with that.[br] - Just as example, here go my fundamental convention rules for C++:[br] - [br] - - The type of the variable is encoded at the beginning of the variable name:[br] - [br] - - b prefix for the boolean varables[br] - - i prefix for signed integers[br] - - u prefix for unsigned integers[br] - - f and d prefixes for floating point stuff[br] - - sz prefix for strings (this is rather for string classes)[br] - - ...[br] - [br] - - Pointers have a "p" prefix prepended[br] - - Global variables start with a "g_" prefix[br] - - Member variables start with a "m_" prefix[br] - - Exception comes for local variables with obvious semantics[br] - [br] - - i,j,k,l for local loop counters[br] - - "aux" and "tmp" for local obvious short-term temporary variables[br] - [br] - So actually by ONLY reading "g_pszQuitMessage" I know that this is a global pointer to a string variable - containing a quit message. :)[br] - [/p] -*/ - -// FIXME: #warning "FINISH THE SYNTACTIC RULES DOC" - -/* - @doc: syntactic_rules - @type: - language - @keyterms: - productions - @title: - Syntactic rules - @short: - Syntactic rules of the KVIrc scripting language - @body: - - In the following table you can find a good part of the - KVIrc scripting language syntactic rules.[br] - [br] - <entity> indicates a ENTITY THAT CAN APPEAR EXACTLY ONE TIME.[br] - [<entity>] indicates an OPTIONAL ENTITY.[br] - {<entity>} indicates an ENTITY THAT CAN APPEAR ONE OR MORE TIMES.[br] - 'entity' indicates a LITERAL ENTITY: written exactly as it is.[br] - <entity1>|<entity2> indicates mutually exclusive choices.[br] - The mutually exclusive choices are often separated in two or more - rules (productions), to improve readability.[br] - [table] - [tr] - [td]<command buffer>[/td] - [td][<whitespace>][<command block>]{<command buffer>}[/td] - [/tr] - [tr] - [td]<command buffer>[/td] - [td][<whitespace>][<single command>]{<command buffer>}[/td] - [/tr] - [tr] - [td]<whitespace>[/td] - [td]{<space>|<tab>|<newline>}['\'<newline>][<whitespace>][/td] - [/tr] - [tr] - [td]<space>[/td] - [td]' '['\'<newline>][<space>] (Ascii space character)[/td] - [/tr] - [tr] - [td]<tab>[/td] - [td]'\t' (Ascii horizontal tabulation character)[/td] - [/tr] - [tr] - [td]<newline>[/td] - [td]'\n' (Ascii line feed (LF) character)[/td] - [/tr] - [tr] - [td]<command block>[/td] - [td]'{' <command buffer>[<whitespace>] '}'[/td] - [/tr] - [tr] - [td]<single command>[/td] - [td]<comment>[/td] - [/tr] - [tr] - [td]<single command>[/td] - [td]<lvalue command> <command terminator>[/td] - [/tr] - [tr] - [td]<single command>[/td] - [td]<rvalue command> <command terminator>[/td] - [/tr] - [tr] - [td]<comment>[/td] - [td]'#' {<non comment terminator>} <comment terminator>[/td] - [/tr] - [tr] - [td]<comment terminator>[/td] - [td]<newline> | <end of string>[/td] - [/tr] - [tr] - [td]<end of string>[/td] - [td]No character (internally Ascii character 0)[/td] - [/tr] - [tr] - [td]<command terminator>[/td] - [td]<newline> | <end of string> | ';'[/td] - [/tr] - [tr] - [td]<non comment-terminator>[/td] - [td]Any Ascii character except <newline> and <end of string>[/td] - [/tr] - [tr] - [td]<simple command>[/td] - [td][<module name>'.']<command name>[<switch list>]{<space>}<command dependant part>[/td] - [/tr] - [tr] - [td]<lvalue command>[/td] - [td]<variable>[<space>]<operation>[/td] - [/tr] - [tr] - [td]<lvalue command>[/td] - [td]<variable>'->'<object command>[/td] - [/tr] - [tr] - [td]<lvalue command>[/td] - [td]<identifier>'->'<object command>[/td] - [/tr] - [tr] - [td]<operation>[/td] - [td]<one op operator>[/td] - [/tr] - [tr] - [td]<operation>[/td] - [td]<two op operator>[<space>]<param string>[/td] - [/tr] - [tr] - [td]<switch list>[/td] - [td]{<space>}'-'<alpha char>[{<space>}'='<single parameter>][<switch list>][/td] - [/tr] - [tr] - [td]<command name>[/td] - [td]<alphanumeric char>{<alphanumeric char>}[/td] - [/tr] - [tr] - [td]<module name>[/td] - [td]<alphanumeric char>{<alphanumeric char>}[/td] - [/tr] - [tr] - [td]<alphanumeric char>[/td] - [td]Ascii characters 'A' to 'Z' , 'a' to 'z' , '0' to '9' and '_'[/td] - [/tr] - [tr] - [td]<variable>[/td] - [td]<global variable> | <local variable>[/td] - [/tr] - [tr] - [td]<global variable>[/td] - [td]'%' <uppercase letter> [<alphanumeric char>]['['<param string>']'][/td] - [/tr] - [tr] - [td]<local variable>[/td] - [td]'%' <lowercase letter> [<alphanumeric char>]['['<param string>']'][/td] - [/tr] - [tr] - [td]<param string>[/td] - [td][<single parameter>][<space>[<param string>]][/td] - [/tr] - [tr] - [td]<single parameter>[/td] - [td]<variable> | <identifier> | <nonterminator token> | <string>[/td] - [/tr] - [tr] - [td]<nonterminator token>[/td] - [td]<nonterminator char>['\'<newline><nonterminator char>][/td] - [/tr] - [tr] - [td]<nonterminator char>[/td] - [td]Any ascii character except <space> and <command terminator>[/td] - [/tr] - [tr] - [td]<command dependant part>[/td] - [td][b]Production in each command help page[/b][/td] - [/tr] - [/table] - To be continued... -*/ - -/* - @doc: command_rebinding - @type: - language - @keyterms: - Not supported - @title: - Standard -r switch no longer supported - @short: - Standard -r switch no longer supported - @body: - Starting from version 3.0.0 the standard -r switch to commands is no longer supported. - You should rebind your command sequences with [cmd]rebind[/cmd] -*/ - -/* - @doc: kvs_datatypes - @type: - language - @keyterms: - global variable, global variables, local variable, local variables, - variables, variable, array, hash, dictionary, global variables, local variables,variable evaluation, - associative arrays, scalars, data types, percent sign, extended scope - @title: - Variables and Data types - @short: - All about the KVS variable and datatype management - @body: - [title]Basic syntax[/title] - - [p] - A variable identifier is composed by a '%' (percent) sign followed - by a sequence of letters, digits or underscores. - Examples of valid variable names are: - [/p] - - [example] - %i - %variable - %MyVar - %1 - %thisisavar - %2ndName - %_hidden - [/example] - - [p] - Variables are created when you assign something to them: there is no need - for a declaration (unlike other languages such as C/C++, Java or VB). - [/p] - - [example] - [comment]# create a variable named %X by assigning the value 10 to it[/comment] - %X = 10 - [comment]# use the variable[/comment] - echo "The value of X is" %X - [/example] - - [title]Local and global variables[/title] - - [p] - Variables can be local or global. - Local variables preserve their contents only inside the [b]scope[/b] of a single script. - Global variables are shared between all the scripts and preserve their contents - until they are explicitly unset or until KVIrc quits. - [/p] - - [p] - Local variables start with a [b]lowercase letter[/b] while the global ones with an [b]uppercase letter[/b]. - [/p] - - [example] - %var = 10; [comment]# this is a local variable[/comment] - %Var = 10; [comment]# this is a global variable[/comment] - [/example] - - [p] - You can also force a variable that start with a lowercase letter to be global - by predeclaring it with the [cmd]global[/cmd] keyword.[br] - [/p] - - [example] - [comment]# copy this script to a file and run /[cmd]parse[/cmd] <filename>[/comment] - global %a - %a = "The contents of the variable a" - %b = "The contents of the variable b" - [comment]# %a is a global variable now : all the other scripts can see its value[/comment] - [comment]# %b is a local variable and no other scripts can see its value[/comment] - [/example] - - [p] - If you have executed the example above from a file (by the means of [cmd]parse[/cmd]) - then now you can type - [/p] - - [example] - [cmd]echo[/cmd] %a - [/example] - - [p] - in the commandline to see the contents of the variable %a. - If you also try - [/p] - - [example] - [cmd]echo[/cmd] %b - [/example] - - [p] - you will see nothing printed since %b was local to the parsed script. - [/p] - - [title]Data types[/title] - - [p] - KVS has three main categories of data types: scalars, arrays and associative - arrays (also known as dictionaries or hashes). - [/p] - - [subtitle]Scalars[/subtitle] - - [p] - The scalars are simple variables containing a single value (a string or an integer). - [/p] - - [example] - [comment]# %a is a scalar variable[/comment] - %a = "This is a string" - [cmd]echo[/cmd] %a - %a = 24.5 - [cmd]echo[/cmd] %a - [/example] - - [subtitle]Arrays[/subtitle] - - [p] - Arrays are collections of items indexed by integers. The array items - are selected by placing the index in square brackets just after the array name. - [/p] - - [example] - %arrayName[index] - [/example] - - [p] - An easy way to create an array is to use the [fnc]$array[/fnc] function. - [/p] - - [example] - %a = $array("element1","element2","element3"); [comment]# Create an array with 3 items[/comment] - [cmd]for[/cmd](%i=0;%i<3;%i++) - { - echo %a[%i]; [comment]# Accessing the %i'th element of the array[/comment] - } - [/example] - - [p] - Note that in the example above %a refers to the whole array while %a[%i] refers - to one of its elements, in particular the one with index %i. - You also create an array by explicitly assigning to one of its elements: - [/p] - - [example] - %a[9] = "This is an array element"; - [/example] - - [p] - Array indexes are zero-based so in the example above you have created an array - with 10 items. You can find out an array's length with the [fnc]$length[/fnc]() function. - [/p] - - [example] - %a[9] = "This is an array element"; - echo $length(%a) - [/example] - - [p] - Be aware that by making such an assignment you implicitly consume some memory for - all the preceeding array items (even if they are unset). This means that - a simple instruction like the following may eat a huge amount of memory at once: - [/p] - - [example] - %a[1000000] = "An array element faaaaaar away..."; - echo $length(%a) - [/example] - - [note] - [p] - Food for thoughts: - [/p] - [p] - KVIrc allocates a pointer for each item in the array. The pointer is - empty when the item is unset and points to an additional block - of memory when the item is set. The size of a pointer is platform - dependant: on the platforms supported by KVIrc it's either 32 or 64 bit. - The size of the additional block depends both on the platform - and on the contents of the item... it's average value may - be around 16 bytes. The array size is determined by the last SET element index. - All this this means that in the worst case (64 bit assumption) an array in - that the highest indexed item set is N eats up at least N*8+16 bytes of memory. - [/p] - [/note] - - [p] - Besides the traditional indexed looping method you - can also use the [cmd]foreach[/cmd] command to iterate the items of an array. - Be aware that [cmd]foreach[/cmd] will NOT iterate over unset items in the - array unless you use the -a switch. - [/p] - - [example] - %Array[0]=Pippo - %Array[1]=Pluto - %Array[2]=Paperino - %Array[5]=Prova - [cmd]foreach[/cmd](%item,%Array)[cmd]echo[/cmd] Got Item: %item - [/example] - - [p] - Note that the items 3 and 4 are simply skipped. - [/p] - - [subtitle]Hashes[/subtitle] - - [p] - The hashes are collections of items indexed by strings: the word "hash" - is in fact a shortcut for "hashtable". In literature hashes are also called - "associative arrays", "dictionaries" or "key-value pair sets". - The hash items are selected by placing the key in curly brackets - just after the hash name. - [/p] - - [example] - %hashName{key} - [/example] - - [p] - An easy way to create a hash is to use the [fnc]$hash[/fnc] function. - [/p] - [example] - %a = $hash("key1","value1","key2","value2","key3","value3") - [cmd]foreach[/cmd](%key,[fnc]$keys[/fnc](%a)) - { - echo "KEY:" %key "VALUE:" %a{%key}; - } - [/example] - - [p] - Note that in the example above %a refers to the whole hash while %a{%i} refers - to one of its elements, in particular the one with the key %key. - You also create a hash by explicitly assigning to one of its elements: - [/p] - - [example] - %a{"MyKey"} = "MyValue" - [/example] - - [p] - You may have already noticed that the [fnc]$key[/fnc]() function returns - the array of the hash keys: it is useful to iterate over the hash items. - [/p] - - [title]Mutability of variables[/title] - - [p] - KVS is not strictly typed: any variable can assume different type identities at different times, - even in the same script. - [/p] - - [example] - [comment]# %a is a scalar[/comment] - %a = "This is a string" - [comment]# %a becomes an array with 3 elements[/comment] - %a = $array("element1","element2","element3"); - [comment]# %a becomes a hash with two values[/comment] - %a = $hash("key1","value1","key2","value2"); - [/example] - - [p] - In literature this kind of variable is called [b]variant[/b] and this is the - term that you will find all around the documentation when an explicit - data type is not requested. - [/p] - - [p] - Note that array and hash items are variants too. This means that you can have arrays - of arrays, hashes of arrays of hashes and any other multidimensional combination you like. - However remember that hash keys are strings and not variants so you can't use an array as hash key. - [/p] - - [example] - [comment]# here we eat 256 locations of memory at once :)[/comment] - %a[16][16] = 10 - [comment]# a hash of hashes: here we eat just two memory locations[/comment] - %a{"16"}{"16"} = 10 - [/example] - - - [p] - In most cases the KVS engine manages automatically the conversion between data types. - For example, when you put an array in a place where a scalar is requested, KVIrc - automatically transforms it to a scalar string by joining all the items with a comma. - [/p] - - [example] - %a = $array("element1","element2","element3"); - echo %a; [comment]# echo expects its arguments to be scalar[/comment] - [/example] - - [p] - Conversely, when you put a scalar in place of an array, KVIrc automatically - transforms it to an array with a single item. In this way a function like - [fnc]$sort[/fnc] works also with a scalar. - [/p] - - [p] - In literature the conversions between data types are called [b]casts[/b]. When - the conversion is automatic the cast is said to be [b]implicit[/b]. - [/p] - - [p] - KVS handles also the other possible implicit casts: scalar->hash,hash->scalar,array->hash,hash->array. - Experiment with it. - [/p] - - [title]More about scalars[/title] - - [p] - Internally KVS is implicitly typed: the "scalar" data type is in fact - a set of types that KVIrc manages silently. The types are: integer, string, real, boolean and hobject. - [/p] - - [p] - Integers are non-floating point numbers. Their allowable range depends on the underlying - platform integer size: usually 32 or 64 bit. - [/p] - - [p] - Reals are floating point numbers. Their allowable range and precision depends on the underlying - platform. - [/p] - - [p] - Booleans are either true or false values. - [/p] - - [p] - Hobject stands for Handle to Object and it is a sort of a C++ pointer. - Detailed description of objects is in [doc:objects]this document[/doc]. - [/p] - - [p] - Basically anything else fails in the "string" category. - [/p] - - [p] - In most cases KVS manages all the conversions between data types automatically. - For example an integer becomes a true boolean when it's non zero and a false boolean - otherwise, a real becomes an integer by truncating it's fractional part... - [/p] - - [p] - You can find out the type of a specified variable by using the [fnc]$typeof[/fnc]() function. - [/p] - - [example] - %a = 1 - echo $typeof(%a) - %a = 1.1 - echo $typeof(%a) - %a = $true - echo $typeof(%a) - %a = "test" - echo $typeof(%a) - [/example] - - [p] - There is also another subtle type of scalar called "nothing". It stands for an - empty (unset) variable. - [/p] - - [example] - %a = $nothing - echo $typeof(%a) - [/example] - - [p] - Nothing is something in between a data type and a special value for all the other data types: - it rappresents absence of information. - This may look a bit confusing but realize that all the unreferenced KVS variable are in fact of type "nothing": - they just don't exist. This means that you can use [fnc]$nothing[/fnc]() to effectively - unset a variable. - [p] - - [p] - Again, when possible, the conversion between nothing and the other data types is - performed automatically. Nothing becomes an empty string, a null object handle or an empty array. - [/p] - - - [title]Explicit casts[/title] - - [p] - You can make explicit conversions between some data types by using the casting functions. - [fnc]$integer[/fnc]() will attempt to convert the variant parameter to an integer, [fnc]$real[/fnc]() - will cast to a floating point value, [fnc]$boolean[/fnc]() will convert to a - true/false value, [fnc]$string[/fnc]() will explicitly convert to a string, - [fnc]$array[/fnc]() will convert to an array and [fnc]$hash[/fnc] will return - a dictionary. By assigning the special [fnc]$nothing[/fnc]() value you will - convert to the nothing data type (or simply unset the variable). - The only explicit conversion that is not possible is to hobject. - [/p] - - [p] - As stated several times in this document, KVS tries to manage the casts automatically - so you usually don't need to care about it. The explicit casts are provided for - the very few cases where an automatic conversion would lead to an unexpected value (for your script) - and for writer's clarity. - [/p] - - [title]More about variables lifecycle[/title] - - [p] - As stated above variables start their existence when you assign something to them. - After a variable has been created it persists until it goes out of his scope (remember - about local and global variables ?) or you explicitly destroy it. You will usually - not care about it and just leave the KVS engine to do his cleaning job but it's still worth - knowing that you actually can force KVIrc to free the memory used by a variable. - [/p] - - [p] - The first method to explicitly destroy a variable is to call [cmd]unset[/cmd] on it. - [cmd]unset[/cmd] in fact accepts a list of variables so you can destroy more variables at once. - [/p] - - [example] - %a = [fnc]$array[/fnc]("data","for","a","really","huge","array","of","items") - %b = 10 - %c = "just a string that eats memory" - [cmd]unset[/cmd] %a,%b,%c - [/example] - - [p] - The KVS engine treats unset variables just like empty strings. The opposite is also valid: empty - strings behave like empty (unset) variables. This means that you can assign an empty string - to a variable to unset it. - [/p] - - [example] - %a = "test"; [comment]# %a starts his existence[/comment] - %b = "test2"; - %a = ""; [comment]# %a is in fact unset[/comment] - %b = ; [comment]# syntactically this is just the same as above[/comment] - [/example] - - [p] - Note that because of mutability of variables (explained above) you can use the empty string - assignment also to free arrays and hashes. - [/p] - - [title]Extended scope variables[/title] - - [p] - Beside local and global variables there is a third family of them. - Variables that have a ':' character just after the leading '%' are [b]extended scope[/b] variables. - "%:index" , "%:Hello" , "%:something.else" are all valid special scope variable names. - They're actually used in popups and in timers (but later I might find other usages as well :). - "Extended scope" means that these variables are somewhere in the middle between - global and local variables. They normally act as local , but in some cases their [b]lifetime[/b] and [b]visibility[/b] - may be extended. - [/p] - - [p] - For example , in the popups , all the special scope variables - are visible during all the "lifetime" of a popup (so from the prologue code call to - the moment when the user selects an item and the corresponding code is executed). - This allows you to pre-calculate some data or conditions in the popup prologue - and use this data in the popup item conditions and item handlers. - [/p] - - [title]Variable evaluation[/title] - - [p] - A variable can appear in every place where a parameter - is expected: so after the command name, after a switch or inside - an identifier parameters. The KVS parser will try to extract the longest possible variable - name after a literal percent '%' sign everywhere in the parameter string. So the command sequence - [/p] - [example] - %number = 1st; echo this is my %number variable test - [/example] - [p] - will first assign "1st" to the variable "%number" and then execute - "echo this is my 1st variable test". The following example will NOT work as expected. - [/p] - [example] - %number = 1; echo this is my %numberst variable test - [/example] - [p] - KVS will assign "1" to %number in this case but the next variable - name extracted will be "%numberst" that is actually empty; so finally - "echo this is my variable test" will be executed. - To avoid this problem you can use the backslash escape character: - [/p] - [example] - %number = 1; echo this is my %number\st variable test - [/example] - - [title]Putting it all together[/title] - - [p] - Variables can be either local, global or have an extended scope. Their start to exist - when you first assign something to them and they disappear when they go out of their - scope or you explicitly destroy them. - [/p] - - [p] - KVS has 8 builtin data types: string, integer, real, boolean, hobject, nothing, array and hash. - The first 6 are scalar data types while the last two are not. - [/p] - - [p] - When possible, KVS manages all the conversions between data types silently. - In the few cases in that an implicit conversion is not possible you have to manage the conversion - manually otherwise KVS will complain. - [/p] -*/ - - - -void KviKvsParser::skipSpaces() -{ - while((KVSP_curCharUnicode == ' ') || (KVSP_curCharUnicode == '\t')) - { - KVSP_skipChar; - } - - if(KVSP_curCharUnicode == '\\') - { - KVSP_skipChar; - if(KVSP_curCharUnicode == '\n') - { - KVSP_skipChar; - skipSpaces(); - return; - } else if(KVSP_curCharUnicode == '\r') - { - KVSP_skipChar; - if(KVSP_curCharUnicode == '\n') - { - KVSP_skipChar; - skipSpaces(); - return; - } else { - KVSP_backChar; - KVSP_backChar; - } - } else { - KVSP_backChar; - } - } -} - - - -bool KviKvsParser::skipSpacesAndNewlines() -{ - while((KVSP_curCharUnicode == ' ') || (KVSP_curCharUnicode == '\t') || (KVSP_curCharUnicode == '\n') || (KVSP_curCharUnicode == '\r')) - { - KVSP_skipChar; - } - - switch(KVSP_curCharUnicode) - { - case '\\': - KVSP_skipChar; - if(KVSP_curCharUnicode == '\n') - { - KVSP_skipChar; - return skipSpacesAndNewlines(); - } else if(KVSP_curCharUnicode == '\r') - { - KVSP_skipChar; - if(KVSP_curCharUnicode == '\n') - { - KVSP_skipChar; - return skipSpacesAndNewlines(); - } else { - KVSP_backChar; - KVSP_backChar; - } - } else { - KVSP_backChar; - } - break; - case '#': - case '/': - // we allow comments too! - (void)parseComment(); // this will return 0 anyway (and never trigger an error here) - if(error())return false; - return skipSpacesAndNewlines(); - break; - } - return true; -} - -void KviKvsParser::skipToNextLine() -{ - while((KVSP_curCharUnicode != 0) && (KVSP_curCharUnicode != '\n')) - KVSP_skipChar; - - if(KVSP_curCharUnicode == '\n')KVSP_skipChar; -} - - -KviKvsTreeNodeInstruction * KviKvsParser::parseInstructionList() -{ - KviKvsTreeNodeInstructionBlock * l = new KviKvsTreeNodeInstructionBlock(KVSP_curCharPointer); - - - for(;;) - { - if(!skipSpacesAndNewlines()) - { - delete l; - return 0; - } - - if(KVSP_curCharUnicode != 0) - { - // instruction - KviKvsTreeNodeInstruction * i = parseInstruction(); - if(i)l->addInstruction(i); - else { - if(error()) - { - // ops... - delete l; - return 0; - } // else empty instruction - } - } else { - if(l->instructionCount() == 1) - { - // return the single instruction instead - KviKvsTreeNodeInstruction * i = l->releaseFirst(); - delete l; - return i; - } - // end of buffer - return l; - } - } - - // never here - KVSP_ASSERT(false); - return 0; -} - - - - -KviKvsTreeNodeData * KviKvsParser::parseParameterPercentOrDollar() -{ - KVSP_ASSERT((KVSP_curCharUnicode == '%') || (KVSP_curCharUnicode == '$') || (KVSP_curCharUnicode == '@')); - - if(KVSP_curCharUnicode == '%') - { - KVSP_skipChar; - if(!KVSP_curCharIsLetter && (KVSP_curCharUnicode != ':')) - { - // be flexible : allow an "alone" '%' char - return new KviKvsTreeNodeConstantData(KVSP_curCharPointer - 1,new KviKvsVariant(QString("%"))); - } - // this is surely a variable or function - KVSP_backChar; - } else if(KVSP_curCharUnicode == '$') - { - KVSP_skipChar; - if(!KVSP_curCharIsFunctionStart) - { - // be flexible : allow an "alone" '$' char - return new KviKvsTreeNodeConstantData(KVSP_curCharPointer - 1,new KviKvsVariant(QString("$"))); - } - // this is surely a variable or function - KVSP_backChar; - } - - return parsePercentOrDollar(); -} - - - -KviKvsTreeNodeData * KviKvsParser::parsePercentOrDollar(bool bInObjScope) -{ - KVSP_ASSERT((KVSP_curCharUnicode == '%') || (KVSP_curCharUnicode == '$') || (KVSP_curCharUnicode == '@')); - - KviKvsTreeNodeData * r; - const QChar * pBegin; - - if(KVSP_curCharUnicode == '%') - { - r = parsePercent(bInObjScope); - if(!r)return 0; - } else if(KVSP_curCharUnicode == '$') - { - r = parseDollar(bInObjScope); - if(!r)return 0; - } else { - // this is @ - static QString szStrayAtRoutineName("@"); - static QString szMightBeStrayAtOrThisRoutineName("@?"); - - pBegin = KVSP_curCharPointer; - - KVSP_skipChar; - - if(bInObjScope || ((KVSP_curCharUnicode != '$') && (KVSP_curCharUnicode != '%'))) - { - // we're sure this is just a stray @ - // we use a trick here: when @ is not supposed to be an object scope call - // then we create a function that will return the @ itself as a string - KviKvsCoreFunctionExecRoutine * pRoutine = KviKvsKernel::instance()->findCoreFunctionExecRoutine(szStrayAtRoutineName); - r = new KviKvsTreeNodeCoreFunctionCall(KVSP_curCharPointer,szStrayAtRoutineName,pRoutine,new KviKvsTreeNodeDataList(KVSP_curCharPointer)); - //KVSP_skipChar; - return r; - } - // we're not in object scope and cur char is either $ or % - // check for the common syntax $0!$1@$2 seen in hostmasks - // @$<digit> is non valid anyway - if(KVSP_curCharUnicode == '$') - { - KVSP_skipChar; - if(KVSP_curCharIsNumber) - { - // again a stray @ - KVSP_backChar; - KviKvsCoreFunctionExecRoutine * pRoutine = KviKvsKernel::instance()->findCoreFunctionExecRoutine(szStrayAtRoutineName); - r = new KviKvsTreeNodeCoreFunctionCall(KVSP_curCharPointer,szStrayAtRoutineName,pRoutine,new KviKvsTreeNodeDataList(KVSP_curCharPointer)); - return r; - } - KVSP_backChar; - } - - // now we're unsure: we will be able to decide only at runtime if it is a stray @ or the shortcut for $this - // this design was a bit ugly.. I must admit it... but it is really useful when writing object classes... - KviKvsCoreFunctionExecRoutine * pRoutine = KviKvsKernel::instance()->findCoreFunctionExecRoutine(szMightBeStrayAtOrThisRoutineName); - // MUST BE THERE! - // core function call - r = new KviKvsTreeNodeCoreFunctionCall(pBegin,szMightBeStrayAtOrThisRoutineName,pRoutine,new KviKvsTreeNodeDataList(pBegin)); - - skipSpaces(); - - goto handle_scope_operator; - } - - pBegin = KVSP_curCharPointer; - - while((KVSP_curCharUnicode == '[') || (KVSP_curCharUnicode == '{')) - { - if(KVSP_curCharUnicode == '[') - { - // array index - KVSP_skipChar; - skipSpaces(); - if(KVSP_curCharUnicode == ']') - { - KVSP_skipChar; - if(KVSP_curCharUnicode == '#') - { - // count - KVSP_skipChar; - return new KviKvsTreeNodeArrayCount(pBegin,r); - } else { - // a hash reference assert - return new KviKvsTreeNodeArrayReferenceAssert(pBegin,r); - } - } - - KviKvsTreeNodeExpression * e = parseExpression(']'); - if(!e) - { - delete r; - return 0; - } - - r = new KviKvsTreeNodeArrayElement(pBegin,r,e); - } else { - // hash key - KVSP_skipChar; - skipSpaces(); - - if(KVSP_curCharUnicode == '}') - { - // entire hash ? - KVSP_skipChar; - if(KVSP_curCharUnicode == '#') - { - KVSP_skipChar; - return new KviKvsTreeNodeHashCount(pBegin,r); - } - return new KviKvsTreeNodeHashReferenceAssert(pBegin,r); - } - - KviKvsTreeNodeData * i = parseHashKey(); - if(!i) - { - // error - delete r; - return 0; - } - - KVSP_ASSERT(KVSP_curCharUnicode == '}'); - - KVSP_skipChar; - - r = new KviKvsTreeNodeHashElement(pBegin,r,i); - } - } - - if(KVSP_curCharUnicode != '-') - { - return r; - } - - if(!r->canEvaluateToObjectReference())return r; // FIXME: maybe print a warning ? - - // might be a scope operator - - KVSP_skipChar; - if(KVSP_curCharUnicode != '>') - { - KVSP_backChar; - return r; - } - - - KVSP_skipChar; - skipSpaces(); - - if((KVSP_curCharUnicode != '$') && (KVSP_curCharUnicode != '%')) - { - KVSP_setCurCharPointer(pBegin); - return r; - } - -handle_scope_operator: - - // hmmm... there really seems to be a scope operator there... - if(KVSP_curCharUnicode == '%') - { - KVSP_skipChar; - if(!KVSP_curCharIsLetter) - { - // be flexible : allow an "alone" '%' char - KVSP_setCurCharPointer(pBegin); - return r; - } - } else { - KVSP_skipChar; - if(!KVSP_curCharIsFunctionStart) - { - // be flexible : allow an "alone" '$' char - KVSP_setCurCharPointer(pBegin); - return r; - } - } - - // ok : try the scope operator - KVSP_backChar; - - pBegin = KVSP_curCharPointer; - - KviKvsTreeNodeData * r2 = parsePercentOrDollar(true); - - if(!r2) - { - // must be an error - delete r; - return 0; - } - - if(!r2->canEvaluateInObjectScope()) - { - // ops... it really wasn't - delete r2; - KVSP_setCurCharPointer(pBegin); - return r; - } - - return new KviKvsTreeNodeScopeOperator(pBegin,r,r2); -} - - - - - -KviKvsTreeNodeVariable * KviKvsParser::parsePercent(bool bInObjScope) -{ - KVSP_ASSERT(KVSP_curCharUnicode == '%'); - - const QChar * pBegin = KVSP_curCharPointer; - - KVSP_skipChar; - - bool bExtScope; - - if(KVSP_curCharUnicode == ':') - { - bExtScope = true; - KVSP_skipChar; - } else { - bExtScope = false; - } - - if(!((KVSP_curCharIsLetterOrNumber) || (KVSP_curCharUnicode == '_'))) - { - error(KVSP_curCharPointer,__tr2qs("Syntax error after '%' variable prefix. If you want to use a plain '%' in the code you need to escape it")); - return 0; - } - - const QChar * pIdBegin = KVSP_curCharPointer; - - while((KVSP_curCharIsLetterOrNumber) || (KVSP_curCharUnicode == '_') || (KVSP_curCharUnicode == '.'))KVSP_skipChar; - - QString szIdentifier(pIdBegin,KVSP_curCharPointer - pIdBegin); - -//#warning "ADD A KviKvsTreeNodeBuiltinCleanupVariablesCommand on this KviKvsParser object" -//#warning "KviKvsParser will append it to the script" - - if(bExtScope) - { - if(bInObjScope) - { - error(KVSP_curCharPointer,__tr2qs("Objects have no extended scope variables")); - return 0; - } - return new KviKvsTreeNodeExtendedScopeVariable(pBegin,szIdentifier); - } - - if(bInObjScope) - return new KviKvsTreeNodeObjectField(pBegin,szIdentifier); - - if(m_pGlobals) - { - if(m_pGlobals->find(szIdentifier))return new KviKvsTreeNodeGlobalVariable(pBegin,szIdentifier); - } - - if(m_iFlags & AssumeLocals) - return new KviKvsTreeNodeLocalVariable(pBegin,szIdentifier); - - if(pIdBegin->category() & QChar::Letter_Uppercase) - { - //if(m_iFlags & Pedantic) - // warning(pIdBegin,__tr2qs("Declaring global variables with an uppercase letter is deprecated. Global variables should be declared with 'global'")); - return new KviKvsTreeNodeGlobalVariable(pBegin,szIdentifier); - } - - return new KviKvsTreeNodeLocalVariable(pBegin,szIdentifier); -} - -KviKvsTreeNodeInstruction * KviKvsParser::parseInstruction() -{ - switch(KVSP_curCharUnicode) - { - case '#': - case '/': - (void)parseComment(); // this will return 0 anyway - return 0; - break; - case 0: // empty instruction - return 0; - break; - case '\n': - case '\r': - case ';': // empty instruction - KVSP_skipChar; - return 0; - break; - case '{': // command block - return parseInstructionBlock(); - break; - case '$': - case '%': - case '@': - return parseVoidFunctionCallOrOperation(); - break; - default: - if(KVSP_curCharIsLetter || (KVSP_curCharUnicode == '_')) - { - // must be a command - return parseCommand(); - } else { - // what the heck is this ? - error(KVSP_curCharPointer,__tr2qs("Found character '%q' (unicode %x) where an instruction was expected"),KVSP_curCharPointer,KVSP_curCharUnicode); - return 0; - } - break; - } - - // never here - KVSP_ASSERT(false); - return 0; -} - -KviKvsTreeNodeInstruction * KviKvsParser::parseInstructionBlock() -{ - KVSP_ASSERT(KVSP_curCharUnicode == '{'); - - KVSP_skipChar; - - const QChar * pBegin = KVSP_curCharPointer; - - KviKvsTreeNodeInstructionBlock * b = new KviKvsTreeNodeInstructionBlock(pBegin - 1); - - for(;;) - { - if(!skipSpacesAndNewlines()) - { - delete b; - return 0; - } - - switch(KVSP_curCharUnicode) - { - case 0: - delete b; - warning(pBegin,__tr2qs("Unterminated instruction block")); - error(KVSP_curCharPointer,__tr2qs("Unexpected end of script in instruction block (missing closing brace)")); - return 0; - break; - case '}': - KVSP_skipChar; - if(b->instructionCount() <= 1) - { - if(b->instructionCount() < 1) - { - delete b; - return 0; // just an empty block - } - // a single instruction - KviKvsTreeNodeInstruction * i = b->releaseFirst(); - delete b; - return i; - } - return b; - break; - default: - // instruction - KviKvsTreeNodeInstruction * i = parseInstruction(); - if(i)b->addInstruction(i); - else { - if(error()) - { - // ops... - delete b; - return 0; - } // else empty instruction - } - break; - } - } - // never reached - return 0; -} - -KviKvsTreeNodeSwitchList * KviKvsParser::parseCommandSwitchList() -{ - KVSP_ASSERT(KVSP_curCharUnicode == '-'); - - KviKvsTreeNodeSwitchList * sw = new KviKvsTreeNodeSwitchList(KVSP_curCharPointer); - - while(KVSP_curCharUnicode == '-') - { - const QChar * pBegin = KVSP_curCharPointer; - KVSP_skipChar; - - bool bLong = false; - - if(KVSP_curCharUnicode == '-') - { - // long switch - pBegin = KVSP_curCharPointer; - KVSP_skipChar; - bLong = true; - } - - skipSpaces(); - if(!KVSP_curCharIsLetter) - { - if(KVSP_curCharIsNumber || KVSP_curCharIsEndOfCommand) - { - // a -digit : this is probably a negative number instead - // or just a single dash (or couple of dashes) - // go back to the initial dash and treat it as text...and return the current switch list - KVSP_setCurCharPointer(pBegin); - if(sw->isEmpty()) - { - // not an error! - delete sw; - return 0; - } - return sw; - } else { - delete sw; - warning(pBegin,__tr2qs("The dash after a command should be followed by a letter (switch), by a digit (negative number) or be escaped")); - - if(KVSP_curCharUnicode == 0) - { - error(KVSP_curCharPointer,__tr2qs("Unexpected character '%q' (unicode %x) after a switch dash"),KVSP_curCharPointer,KVSP_curCharUnicode); - } else { - error(KVSP_curCharPointer,__tr2qs("Unexpected end of script after a switch dash")); - } - return 0; - } - } - - const QChar * pSw = KVSP_curCharPointer; - - KVSP_skipChar; - while((KVSP_curCharIsLetterOrNumber) || (KVSP_curCharUnicode == '-'))KVSP_skipChar; - - const QChar * pSwEnd = KVSP_curCharPointer; - - skipSpaces(); - - if(KVSP_curCharUnicode == '=') - { - KVSP_skipChar; - skipSpaces(); - KviKvsTreeNodeData * p = parseCommandParameter(); - if(!p) - { - // must be an error :( - if(error()) - { - error(pBegin,__tr2qs("The above problem might be related to the switch dash and the following equal sign")); - delete sw; - return 0; - } else { - // assume empty string - p = new KviKvsTreeNodeConstantData(KVSP_curCharPointer,new KviKvsVariant(QString(""))); - } - } - - skipSpaces(); - - if(bLong) - sw->addLong(QString(pSw,pSwEnd - pSw),p); - else - sw->addShort(pSw->lower().unicode(),p); - } else { - if(bLong) - sw->addLong(QString(pSw,pSwEnd - pSw),new KviKvsTreeNodeConstantData(KVSP_curCharPointer,new KviKvsVariant(true))); // empty param - else - sw->addShort(pSw->lower().unicode(),new KviKvsTreeNodeConstantData(KVSP_curCharPointer,new KviKvsVariant(true))); // empty param - } - } - - return sw; -} - - - -KviKvsTreeNodeDataList * KviKvsParser::parseCommandParameterList() -{ - KviKvsTreeNodeDataList * l = new KviKvsTreeNodeDataList(KVSP_curCharPointer); - - for(;;) - { - skipSpaces(); - switch(KVSP_curCharUnicode) - { - case 0: - return l; - break; - case '\r': - case '\n': - case ';': - KVSP_skipChar; - return l; - break; - default: - // anything else is a parameter - KviKvsTreeNodeData * p = parseCommandParameter(); - if(!p) - { - // this is an error - delete l; - return 0; - } - l->addItem(p); - break; - } - } - - // never here - KVSP_ASSERT(false); - return 0; -} - - -KviPointerList<QString> * KviKvsParser::parseCommaSeparatedParameterListNoTree() -{ - KviPointerList<QString> * l = new KviPointerList<QString>; - l->setAutoDelete(true); - - KVSP_skipChar; - - for(;;) - { - skipSpaces(); - switch(KVSP_curCharUnicode) - { - case 0: - error(KVSP_curCharPointer,__tr2qs("Unexpected end of script in parameter list")); - delete l; - return 0; - break; - case '\r': - case '\n': - error(KVSP_curCharPointer,__tr2qs("Unexpected end of line in parameter list")); - delete l; - return 0; - break; - /* - case ',': - KVSP_skipChar; - break; - case ')': - KVSP_skipChar; - return l; - break; - */ - default: - { - // anything else is a parameter - const QChar *pBegin = KVSP_curCharPointer; - KviKvsTreeNodeData * p = parseCommaSeparatedParameter(); - if(!p) - { - // this is an error - delete l; - return 0; - } - delete p; - QString * s = new QString(pBegin,KVSP_curCharPointer - pBegin); - s->stripWhiteSpace(); - l->append(s); - - switch(KVSP_curCharUnicode) - { - case ',': - KVSP_skipChar; - break; - case ')': - KVSP_skipChar; - return l; - break; - } - } - break; - } - } - - // never here - KVSP_ASSERT(false); - return 0; -} - - -KviKvsTreeNodeDataList * KviKvsParser::parseCommaSeparatedParameterList() -{ - KviKvsTreeNodeDataList * l = new KviKvsTreeNodeDataList(KVSP_curCharPointer); - - KVSP_skipChar; - - for(;;) - { - skipSpaces(); - switch(KVSP_curCharUnicode) - { - case 0: - error(KVSP_curCharPointer,__tr2qs("Unexpected end of script in parameter list")); - delete l; - return 0; - break; - case '\r': - case '\n': - error(KVSP_curCharPointer,__tr2qs("Unexpected end of line in parameter list")); - delete l; - return 0; - break; - /* - case ',': - KVSP_skipChar; - break; - case ')': - KVSP_skipChar; - return l; - break; - */ - default: - // anything else is a parameter - KviKvsTreeNodeData * p = parseCommaSeparatedParameter(); - if(!p) - { - // this is an error - delete l; - return 0; - } - l->addItem(p); - - switch(KVSP_curCharUnicode) - { - case ',': - KVSP_skipChar; - break; - case ')': - KVSP_skipChar; - return l; - break; - } - break; - } - } - - // never here - KVSP_ASSERT(false); - return 0; -} - - -#define LITERAL_PARAM_PARSING_FUNCTION_BEGIN(__funcname) \ -KviKvsTreeNodeConstantData * KviKvsParser::__funcname() \ -{ \ - QString szValue; \ -\ - const QChar * pStart = KVSP_curCharPointer; \ - const QChar * pBegin = KVSP_curCharPointer; \ - int iLen = 0; \ - int iNestedTerminators = 0; \ - \ - for(;;) \ - { \ - switch(KVSP_curCharUnicode) \ - { - -#define LITERAL_PARAM_PARSING_FUNCTION_WARN_NESTED_TERMINATOR \ - if(!_OUTPUT_MUTE) \ - warning(KVSP_curCharPointer,__tr2qs("Nested character %q corresponding to expected terminator, this might confuse me a bit: it is a good idea to enclose it in quotes"),KVSP_curCharPointer); \ - KVSP_skipChar; \ - iNestedTerminators++; \ - iLen++; \ - break; - -#define LITERAL_PARAM_PARSING_FUNCTION_END_WITH_EXPECTED_TERMINATOR \ - if(iNestedTerminators > 0) \ - { \ - if(!_OUTPUT_MUTE) \ - warning(KVSP_curCharPointer,__tr2qs("Skipping nested terminator character %q"),KVSP_curCharPointer); \ - KVSP_skipChar; \ - iNestedTerminators--; \ - iLen++; \ - } else { \ - if(iLen > 0)szValue.append(QString(pBegin,iLen)); \ - { \ - bool bOk; \ - kvs_int_t iVal = szValue.toLong(&bOk); \ - if(bOk)return new KviKvsTreeNodeConstantData(pBegin,new KviKvsVariant(iVal)); \ - kvs_real_t dVal = szValue.toDouble(&bOk); \ - if(bOk)return new KviKvsTreeNodeConstantData(pBegin,new KviKvsVariant(dVal)); \ - } \ - return new KviKvsTreeNodeConstantData(pBegin,new KviKvsVariant(szValue)); \ - } \ - break; - -#define LITERAL_PARAM_PARSING_FUNCTION_GENERIC_END \ - if(iLen > 0) szValue.append(QString(pBegin,iLen)); \ - return new KviKvsTreeNodeConstantData(pBegin,new KviKvsVariant(szValue)); \ - break; \ - case '\\': \ - if(iLen > 0)szValue.append(QString(pBegin,iLen)); \ - KVSP_skipChar; \ - switch(KVSP_curCharUnicode) \ - { \ - case 0: \ - warning(KVSP_curCharPointer - 1,__tr2qs("Stray backslash at the end of the script")); \ - iLen = 0; \ - break; \ - case '\r': \ - case '\n': \ - KVSP_skipChar; \ - pBegin = KVSP_curCharPointer; \ - iLen = 0; \ - break; \ - case 'r': \ - KVSP_skipChar; \ - pBegin = KVSP_curCharPointer; \ - szValue.append(QChar('\r')); \ - iLen = 0; \ - break; \ - case 'n': \ - KVSP_skipChar; \ - pBegin = KVSP_curCharPointer; \ - szValue.append(QChar('\n')); \ - iLen = 0; \ - break; \ - case 't': \ - KVSP_skipChar; \ - pBegin = KVSP_curCharPointer; \ - szValue.append(QChar('\t')); \ - iLen = 0; \ - break; \ - default: \ - pBegin = KVSP_curCharPointer; \ - KVSP_skipChar; \ - iLen = 1; \ - break; \ - } \ - break; \ - default: \ - KVSP_skipChar; \ - iLen++; \ - break; \ - } \ - } \ - KVSP_ASSERT(false); \ - return 0; \ -} - - -LITERAL_PARAM_PARSING_FUNCTION_BEGIN(parseCommandLiteralParameter) - case 0: - case '$': - case '%': - case '@': - case '\r': - case '\n': - case '"': - case ';': - case ' ': - case '\t': -LITERAL_PARAM_PARSING_FUNCTION_GENERIC_END - - -LITERAL_PARAM_PARSING_FUNCTION_BEGIN(parseStringLiteralParameter) - case 0: - case '$': - case '%': - case '@': - case '\r': - case '\n': - case '"': -LITERAL_PARAM_PARSING_FUNCTION_GENERIC_END - -/* -LITERAL_PARAM_PARSING_FUNCTION_BEGIN(parseArrayIndexLiteralParameter) - case '\t': - case ' ': - case ']': -LITERAL_PARAM_PARSING_FUNCTION_END -*/ - - -LITERAL_PARAM_PARSING_FUNCTION_BEGIN(parseHashKeyLiteralParameter) - case '{': -LITERAL_PARAM_PARSING_FUNCTION_WARN_NESTED_TERMINATOR - case '}': -LITERAL_PARAM_PARSING_FUNCTION_END_WITH_EXPECTED_TERMINATOR - case 0: - case '$': - case '%': - case '@': - case '\r': - case '\n': - case '"': - case '\t': - case ' ': -LITERAL_PARAM_PARSING_FUNCTION_GENERIC_END - - -LITERAL_PARAM_PARSING_FUNCTION_BEGIN(parseCommaSeparatedLiteralParameter) - case '(': -LITERAL_PARAM_PARSING_FUNCTION_WARN_NESTED_TERMINATOR - case ')': -LITERAL_PARAM_PARSING_FUNCTION_END_WITH_EXPECTED_TERMINATOR - case 0: - case '$': - case '%': - case '@': - case '\r': - case '\n': - case '"': - case ',': - case ' ': - case '\t': -LITERAL_PARAM_PARSING_FUNCTION_GENERIC_END - - -LITERAL_PARAM_PARSING_FUNCTION_BEGIN(parseSingleLiteralParameterInParenthesis) - case '(': -LITERAL_PARAM_PARSING_FUNCTION_WARN_NESTED_TERMINATOR - case ')': -LITERAL_PARAM_PARSING_FUNCTION_END_WITH_EXPECTED_TERMINATOR - case 0: - case '$': - case '%': - case '@': - case '\r': - case '\n': - case '"': - case ' ': - case '\t': -LITERAL_PARAM_PARSING_FUNCTION_GENERIC_END - -LITERAL_PARAM_PARSING_FUNCTION_BEGIN(parseBindingOperationLiteralParameter) - case 0: - case '$': - case '%': - case '@': - case '\r': - case '\n': - case '"': - case '/': -LITERAL_PARAM_PARSING_FUNCTION_GENERIC_END - - -/* -KviKvsTreeNodeData * KviKvsParser::parseArrayIndex() -{ - KviPointerList<KviKvsTreeNodeData> * l = new KviPointerList<KviKvsTreeNodeData>(); - l->setAutoDelete(true); - - const QChar * pBegin = KVSP_curCharPointer; - - //KVSP_skipChar; - - for(;;) - { - switch(KVSP_curCharUnicode) - { - case 0: - delete l; - warning(pBegin,__tr2qs("Unterminated array index")); - error(KVSP_curCharPointer,__tr2qs("Unexpected end of script in array index (missing ']' character ?)")); - return 0; - break; - case '\n': - delete l; - warning(pBegin,__tr2qs("Unterminated array index")); - error(KVSP_curCharPointer,__tr2qs("Unexpected end of line in array index (missing ']' character or unescaped newline)")); - return 0; - break; - case ' ': - case '\t': - skipSpaces(); - if(KVSP_curCharUnicode != ']') - { - delete l; - warning(pBegin,__tr2qs("Unterminated array index")); - switch(KVSP_curCharUnicode) - { - case 0: - error(KVSP_curCharPointer,__tr2qs("Unexpected end of script in array index (missing ']' character ?)")); - break; - case '\n': - error(KVSP_curCharPointer,__tr2qs("Unexpected end of line in array index (missing ']' character or unescaped newline)")); - break; - default: - error(KVSP_curCharPointer,__tr2qs("Unexpected character '%q' (unicode %x) in array index: it should be already terminated"),KVSP_curCharPointer,KVSP_curCharUnicode); - break; - } - return 0; - } - goto end_of_the_array_index; - break; - case '$': - case '%': - { - // this may be a data reference - KviKvsTreeNodeData * p = parseParameterPercentOrDollar(); - if(!p) - { - // this is an error - delete l; - return 0; - } - l->append(p); - } - break; - case ']': - { - // end of the array index - goto end_of_the_array_index; - } - break; - case '"': - { - // string (should we parse strings in array indexes anyway ?).. well "1"$count might be a valid one in the end - KviKvsTreeNodeData * p = parseStringParameter(); - if(!p) - { - // error - delete l; - return 0; - } - l->append(p); - } - break; - default: - { - // anything else is a literal - l->append(parseArrayIndexLiteralParameter()); - } - break; - } - } -end_of_the_array_index: - if(l->count() > 1) - { - // complex parameter needed - return new KviKvsTreeNodeCompositeData(l); - } else { - // a single parameter in the list - l->setAutoDelete(false); - KviKvsTreeNodeData * p = l->first(); - delete l; - return p; - } - -} -*/ - - - - - -KviKvsTreeNodeData * KviKvsParser::parseHashKey() -{ - KviPointerList<KviKvsTreeNodeData> * l = new KviPointerList<KviKvsTreeNodeData>(); - l->setAutoDelete(true); - - const QChar * pBegin = KVSP_curCharPointer; - - //KVSP_skipChar; - - for(;;) - { - switch(KVSP_curCharUnicode) - { - case 0: - delete l; - warning(pBegin,__tr2qs("Unterminated hash key")); - error(KVSP_curCharPointer,__tr2qs("Unexpected end of script in hash key (missing '}' character ?)")); - return 0; - break; - case '\r': - case '\n': - delete l; - warning(pBegin,__tr2qs("Unterminated hash key")); - error(KVSP_curCharPointer,__tr2qs("Unexpected end of line in hash key (missing '}' character or unescaped newline)")); - return 0; - break; - case ' ': - case '\t': - skipSpaces(); - if(KVSP_curCharUnicode != '}') - { - // separate by single spaces - l->append(new KviKvsTreeNodeConstantData(KVSP_curCharPointer,new KviKvsVariant(QString(" ")))); - } else { - goto end_of_the_hash_key; - } - break; - case '$': - case '%': - case '@': - { - // this may be a data reference - KviKvsTreeNodeData * p = parseParameterPercentOrDollar(); - if(!p) - { - // this is an error - delete l; - return 0; - } - l->append(p); - } - break; - case '}': - { - // end of the array index - goto end_of_the_hash_key; - } - break; - case '"': - { - // string - KviKvsTreeNodeData * p = parseStringParameter(); - if(!p) - { - // error - delete l; - return 0; - } - l->append(p); - } - break; - default: - { - // anything else is a literal - l->append(parseHashKeyLiteralParameter()); - } - break; - } - } -end_of_the_hash_key: - if(l->count() > 1) - { - // complex parameter needed - return new KviKvsTreeNodeCompositeData(pBegin,l); - } else { - // a single parameter in the list - l->setAutoDelete(false); - KviKvsTreeNodeData * p = l->first(); - delete l; - return p; - } - // never reached - return 0; -} - -/* -PARENTHESIS_PARAMETER_PARSING_FUNCTION_BEGIN(parseCommaSeparatedParameter) - case 0: - case ',': - case ')': - case '\n': -PARENTHESIS_PARAMETER_PARSING_FUNCTION_END() - -#define PARENTHESIS_PARAMETER_PARSING_FUNCTION_BEGIN(_name) \ -*/ - - - -KviKvsTreeNodeData * KviKvsParser::parseCommaSeparatedParameter() -{ - KviPointerList<KviKvsTreeNodeData> * l = new KviPointerList<KviKvsTreeNodeData>; - l->setAutoDelete(true); - - const QChar * pBegin = KVSP_curCharPointer; - - for(;;) - { - switch(KVSP_curCharUnicode) - { - case 0: - case ',': - case ')': - case '\r': - case '\n': - // not a part of a parameter - goto end_of_function_parameter; - break; - case '$': - case '%': - case '@': - { - // this may be a data reference - KviKvsTreeNodeData * p = parseParameterPercentOrDollar(); - if(!p) - { - // this is an error - delete l; - return 0; - } - l->append(p); - } - break; - case ' ': - case '\t': - skipSpaces(); - if((KVSP_curCharUnicode != ')') && (KVSP_curCharUnicode != ',')) - { - // separate by single spaces - l->append(new KviKvsTreeNodeConstantData(KVSP_curCharPointer,new KviKvsVariant(QString(" ")))); - } else { - goto end_of_function_parameter; - } - break; - case '"': - { - // this is a string - KviKvsTreeNodeData * p = parseStringParameter(); - if(!p) - { - // this is an error - delete l; - return 0; - } - l->append(p); - } - break; - default: - { - // anything else is a literal - l->append(parseCommaSeparatedLiteralParameter()); - } - break; - } - } -end_of_function_parameter: - if(l->count() > 1) - { - // complex parameter needed - KviKvsTreeNodeData * p = new KviKvsTreeNodeCompositeData(pBegin,l); - p->setEndingLocation(KVSP_curCharPointer); - return p; - } else { - // a single parameter in the list, or no params at all - l->setAutoDelete(false); - KviKvsTreeNodeData * p = l->first(); - delete l; - if(!p)p = new KviKvsTreeNodeConstantData(KVSP_curCharPointer,new KviKvsVariant()); - p->setEndingLocation(KVSP_curCharPointer); - return p; - } - // never reached - return 0; -} - - -KviKvsTreeNodeData * KviKvsParser::parseSingleParameterInParenthesis() -{ - KviPointerList<KviKvsTreeNodeData> * l = new KviPointerList<KviKvsTreeNodeData>; - l->setAutoDelete(true); - - const QChar * pBegin = KVSP_curCharPointer; - - for(;;) - { - switch(KVSP_curCharUnicode) - { - case ')': - // not a part of a parameter - KVSP_skipChar; - goto end_of_function_parameter; - break; - case 0: - case '\r': - case '\n': - // not a part of a parameter - goto end_of_function_parameter; - break; - case '$': - case '%': - case '@': - { - // this may be a data reference - KviKvsTreeNodeData * p = parseParameterPercentOrDollar(); - if(!p) - { - // this is an error - delete l; - return 0; - } - l->append(p); - } - break; - case ' ': - case '\t': - skipSpaces(); - if((KVSP_curCharUnicode != ')') && (KVSP_curCharUnicode != ',')) - { - // separate by single spaces - l->append(new KviKvsTreeNodeConstantData(KVSP_curCharPointer,new KviKvsVariant(QString(" ")))); - } else { - goto end_of_function_parameter; - } - break; - case '"': - { - // this is a string - KviKvsTreeNodeData * p = parseStringParameter(); - if(!p) - { - // this is an error - delete l; - return 0; - } - l->append(p); - } - break; - default: - { - // anything else is a literal - l->append(parseSingleLiteralParameterInParenthesis()); - } - break; - } - } -end_of_function_parameter: - if(l->count() > 1) - { - // complex parameter needed - KviKvsTreeNodeData * p = new KviKvsTreeNodeCompositeData(pBegin,l); - p->setEndingLocation(KVSP_curCharPointer); - return p; - } else { - // a single parameter in the list or list empty at all - l->setAutoDelete(false); - KviKvsTreeNodeData * p = l->first(); - if(p)p->setEndingLocation(KVSP_curCharPointer); - delete l; - return p; - } - // never reached - return 0; -} - - -KviKvsTreeNodeData * KviKvsParser::parseStringParameter() -{ - KVSP_ASSERT(KVSP_curCharUnicode == '"'); - - KviPointerList<KviKvsTreeNodeData> * l = new KviPointerList<KviKvsTreeNodeData>(); - l->setAutoDelete(true); - - const QChar * pBegin = KVSP_curCharPointer; - - KVSP_skipChar; - - for(;;) - { - switch(KVSP_curCharUnicode) - { - case 0: - delete l; - warning(pBegin,__tr2qs("Unterminated string constant")); - error(KVSP_curCharPointer,__tr2qs("Unexpected end of script in string constant (missing \" character ?)")); - return 0; - break; - case '\r': - case '\n': - delete l; - warning(pBegin,__tr2qs("Unterminated string constant")); - error(KVSP_curCharPointer,__tr2qs("Unexpected end of line in string constant (missing \" character or unescaped newline)")); - return 0; - break; - case '$': - case '%': - case '@': - { - // this may be a data reference - KviKvsTreeNodeData * p = parseParameterPercentOrDollar(); - if(!p) - { - // this is an error - delete l; - return 0; - } - l->append(p); - } - break; - case '"': - { - // end of the string - KVSP_skipChar; - goto end_of_the_string; - } - break; - default: - { - // anything else is a literal - l->append(parseStringLiteralParameter()); - } - break; - } - } -end_of_the_string: - if(l->count() > 1) - { - // complex parameter needed - // it is also an implicit string cast - return new KviKvsTreeNodeCompositeData(pBegin,l); - } else { - if(l->count() > 0) - { - // a single parameter in the list - // we need an explicit string cast here (it is the most common cast) - l->setAutoDelete(false); - KviKvsTreeNodeData * p = l->first(); - delete l; - return new KviKvsTreeNodeStringCast(pBegin,p); - } else { - // no parameters at all.. return straight empty string (no need to cast) - delete l; - return new KviKvsTreeNodeConstantData(pBegin,new KviKvsVariant(new QString())); - } - } - // never reached - return 0; -} - -KviKvsTreeNodeData * KviKvsParser::parseCommandParameter(bool bPreferNumeric) -{ - KviPointerList<KviKvsTreeNodeData> * l = new KviPointerList<KviKvsTreeNodeData>; - l->setAutoDelete(true); - - bool bGotLiteral = false; - - const QChar * pBegin = KVSP_curCharPointer; - - for(;;) - { - switch(KVSP_curCharUnicode) - { - case 0: - case ' ': - case '\t': - case '\r': - case '\n': - case ';': - // not a part of a parameter - goto jumpout; - break; - case '$': - case '%': - case '@': - { - // this may be a data reference - KviKvsTreeNodeData * p = parseParameterPercentOrDollar(); - if(!p) - { - // this is an error - delete l; - return 0; - } - l->append(p); - } - break; - case '"': - { - // this is a string - KviKvsTreeNodeData * p = parseStringParameter(); - if(!p) - { - // this is an error - delete l; - return 0; - } - l->append(p); - } - break; - default: - { - bGotLiteral = true; - // anything else is a literal - l->append(parseCommandLiteralParameter()); - } - break; - } - } -jumpout: - if(l->count() > 1) - { - // complex parameter needed - KviKvsTreeNodeData * p = new KviKvsTreeNodeCompositeData(pBegin,l); - p->setEndingLocation(KVSP_curCharPointer); - return p; - } else { - // a single parameter in the list or empty list at all - l->setAutoDelete(false); - KviKvsTreeNodeData * p = l->first(); - delete l; - if(p) - { - if(bGotLiteral) - { - // a single literal parameter - if(bPreferNumeric) - { - // attempt to convert to a numeric format if this is a constant data item - p->convertStringConstantToNumeric(); - } - } - p->setEndingLocation(KVSP_curCharPointer); - } - return p; - } - // never reached - return 0; -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_parser.h b/3.4.0/src/kvirc/kvs/kvi_kvs_parser.h deleted file mode 100644 index 3e3406d280..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_parser.h +++ /dev/null @@ -1,300 +0,0 @@ -#ifndef _KVI_KVS_PARSER_H_ -#define _KVI_KVS_PARSER_H_ -//============================================================================= -// -// File : kvi_kvs_parser.h -// Creation date : Thu 25 Sep 2003 05.12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_pointerlist.h" - -#include "kvi_pointerhashtable.h" - -class KviKvsTreeNode; - -class KviKvsTreeNodeInstruction; -class KviKvsTreeNodeInstructionBlock; -class KviKvsTreeNodeCommand; -class KviKvsTreeNodeDataList; -class KviKvsTreeNodeData; -class KviKvsTreeNodeVariable; -class KviKvsTreeNodeVariableReference; -class KviKvsTreeNodeConstantData; -class KviKvsTreeNodeSwitchList; -class KviKvsTreeNodeSpecialCommand; -class KviKvsTreeNodeExpression; -class KviKvsTreeNodeExpressionBinaryOperator; -class KviKvsTreeNodeFunctionCall; -class KviKvsTreeNodeOperation; -class KviKvsTreeNodeSpecialCommandDefpopupLabelPopup; - -class KviKvsScript; -class KviKvsKernel; -class KviWindow; - -// This is an ONE-TIME parser used by KviKvsScript - -class KVIRC_API KviKvsParser -{ - friend class KviKvsKernel; -public: - KviKvsParser(KviKvsScript * pScript,KviWindow * pOutputWindow); - ~KviKvsParser(); -private: - const QChar * m_pBuffer; // the local pointer to the beginning of the buffer - const QChar * m_ptr; // the parsing pointer - // parsing state - KviPointerHashTable<QString,QString> * m_pGlobals; // the dict of the vars declared with global in this script - int m_iFlags; // the current parsing flags - bool m_bError; // error(..) was called ? - // this stuff is used only for reporting errors and warnings - KviKvsScript * m_pScript; // parent script - KviWindow * m_pWindow; // output window -public: // public interface - enum Flags { AssumeLocals = 1, Pedantic = 2 }; - // was there an error ? - bool error() const { return m_bError; }; - // parses the buffer pointed by pBuffer and returns - // a syntax tree or 0 in case of failure - // if the parsing fails, the error code can be retrieved by calling error() - KviKvsTreeNodeInstruction * parse(const QChar * pBuffer,int iFlags = 0); - KviKvsTreeNodeInstruction * parseAsExpression(const QChar * pBuffer,int iFlags = 0); - KviKvsTreeNodeInstruction * parseAsParameter(const QChar * pBuffer,int iFlags = 0); -private: // parsing helpers - // generic - void skipSpaces(); // skips only spaces and tabs (eventually with \) - bool skipSpacesAndNewlines(); // skips space and newlines - void skipToNextLine(); // skips up to a new line - // dedicated - void skipToEndOfCStyleComment(); - // dedicated to parseSpecialCommandFor() : in kvi_kvs_parser_specialcommands.cpp - bool skipToEndOfForControlBlock(); - // error handlers - void error(const QChar * pLocation,const QString &szMsgFmt,...); - void warning(const QChar * pLocation,const QString &szMsgFmt,...); - void errorBadChar(const QChar * pLocation,char cExpected,const char * szCommandName); - -protected: - // this is called by KviKvsKernel to register the parsing routines - static void init(); -private: - // returns 0 only in case of error - // starts on the first char of a buffer - // stops at the first null char encountered - KviKvsTreeNodeInstruction * parseInstructionList(); - // may return 0 (empty instruction), check error() for error conditions - // starts on the first character of an instruction - // if the first char is ';' '\n' or null it just returns 0 without error - // stops after the ending char of the instruction - KviKvsTreeNodeInstruction * parseInstruction(); - // may return 0 (empty block), check error() for error conditions - // starts at the leading '{' of the block - // stops after the trailing '}' of the block - KviKvsTreeNodeInstruction * parseInstructionBlock(); - // returns 0 only in case of error - // starts on the first character of the parameters - // ends after the end of the command - KviKvsTreeNodeDataList * parseCommandParameterList(); - // returns 0 only in case of error - // starts on the leading '(' or a ',' in the middle of the list - // ends after the trailing ')' - // if started in the middle of the list returns only the remaining - // parameters. - KviKvsTreeNodeDataList * parseCommaSeparatedParameterList(); - KviPointerList<QString> * parseCommaSeparatedParameterListNoTree(); - // returns 0 in case of error or if it starts on a terminating character (null parameter) - // check error() to see if there was an error condition (unless you already know that - // there was a valid first character) - // start on the first character of the parameter - // ends after the first character not included in the param (';','\n','\0',' ') - // If bPreferNumeric is true then when a single literal parameter - // is extracted an attempt to convert it to a numeric format is made. - // This optimizes assignments, self-sums etc... - KviKvsTreeNodeData * parseCommandParameter(bool bPreferNumeric = false); - // returns 0 only in case of error - // start on the first character of the parameter - // ends after the first character not included in the param (')','\n','\0',',') - KviKvsTreeNodeData * parseCommaSeparatedParameter(); - // returns 0 only in case of error - // start on the first character of the parameter - // ends after the first character not included in the param (')','\n','\0') - KviKvsTreeNodeData * parseSingleParameterInParenthesis(); - // never returns 0 - KviKvsTreeNodeConstantData * parseCommandLiteralParameter(); - // never returns 0 - KviKvsTreeNodeConstantData * parseCommaSeparatedLiteralParameter(); - // never returns 0 - KviKvsTreeNodeConstantData * parseSingleLiteralParameterInParenthesis(); - // returns 0 only in case of error - // starts at the leading '"' - // ends after the trailing '"' - KviKvsTreeNodeData * parseStringParameter(); - // never returns 0 - KviKvsTreeNodeConstantData * parseStringLiteralParameter(); - // returns 0 in case of error or of an empty switch list (check the error code!) - // starts at the leading '-' of the first switch - // ends after the last switch - KviKvsTreeNodeSwitchList * parseCommandSwitchList(); - // returns 0 only in case of error - // starts at '%' or '$' - // and ends after the end of the data reference - // or just after the '%' or '$' if this was only a ConstandData (not a var or func) - KviKvsTreeNodeData * parseParameterPercentOrDollar(); - // returns 0 only in case of error - // starts at '%' or '$' - // ends after the end of the complete data reference (including scope operators!) - KviKvsTreeNodeData * parsePercentOrDollar(bool bInObjScope = false); - // returns 0 only in case of error - // starts at '%' - // ends after the end of the structured data - KviKvsTreeNodeVariable * parsePercent(bool bInObjectScope = false); - // returns 0 only in case of error - KviKvsTreeNodeData * parseHashKey(); - // never returns 0 - KviKvsTreeNodeConstantData * parseHashKeyLiteralParameter(); - - // - // kvi_kvs_parser_specialcommands.cpp - // - - // return 0 only in case of error - // starts at the leading '(' of the if command (after the switches) - // and stops after the end of the else block - // if the first character is not '(' then this function fails with an error - KviKvsTreeNodeCommand * parseSpecialCommandIf(); - // always returns 0 - // check error() for error conditions - // starts after the switches of the "global" keyword - // and stops at the end of the command - // if the first character is not '%' of a variable then this function fails with an error - KviKvsTreeNodeCommand * parseSpecialCommandGlobal(); - // returns 0 only in case of error - // starts at the leading '(' of the while command (after the switches) - // and stops after the end of the command block - // if the first character is not '(' then this function fails with an error - KviKvsTreeNodeCommand * parseSpecialCommandWhile(); - // returns 0 only in case of error - // starts at the leading '(' of the while command (after the switches) - // and stops after the end of the command block - // if the first character is not '(' then this function fails with an error - KviKvsTreeNodeCommand * parseSpecialCommandDo(); - // returns 0 only in case of error - // and stops after the end of the break command - KviKvsTreeNodeCommand * parseSpecialCommandBreak(); - // returns 0 only in case of error - // and stops after the end of the for command block - KviKvsTreeNodeCommand * parseSpecialCommandFor(); - // returns 0 only in case of error - // and stops after the end of the foreach command block - KviKvsTreeNodeCommand * parseSpecialCommandForeach(); - // returns 0 only in case of error - // and stops after the end of the switch command block - KviKvsTreeNodeCommand * parseSpecialCommandSwitch(); - // returns 0 only in case of error - // and stops after the end of the defpopup command block - KviKvsTreeNodeCommand * parseSpecialCommandUnset(); - // returns 0 only in case of error - // and stops after the end of the defpopup command block - KviKvsTreeNodeCommand * parseSpecialCommandDefpopup(); - KviKvsTreeNodeSpecialCommandDefpopupLabelPopup * parseSpecialCommandDefpopupLabelPopup(); - // returns 0 only in case of error - // stops after the class command block - KviKvsTreeNodeCommand * parseSpecialCommandClass(); - // returns 0 only in case of error - // stops after the perl.end statement - KviKvsTreeNodeCommand * parseSpecialCommandPerlBegin(); - // returns 0 only in case of error - // and stops after the end of the help command - KviKvsTreeNodeCommand * parseSpecialCommandHelp(); - - // - // kvi_kvs_parser_command.cpp - // - - // may return 0 (empty command), check error() for error conditions - // starts at the beginning of a command (can be non valid) - // ends after the ending char of the command - KviKvsTreeNodeCommand * parseCommand(); - - - // - // kvi_kvs_parser_comment.cpp - // - - // always returns 0, and it CAN be an error! - // starts at the beginning of a comment (must be '#' or '/') - // ends after the ending char of the comment - KviKvsTreeNode * parseComment(); - - - // - // kvi_kvs_parser_dollar.cpp - // - - // returns 0 only in case of error - // starts at '$' - // ends after the end of the function call - KviKvsTreeNodeData * parseDollar(bool bInObjScope = false); - - // returns 0 only in case of error - // starts at '@' - // ends after the end of the function call - KviKvsTreeNodeData * parseAt(bool bInObjScope = false); - - // - // kvi_kvs_parser_lside.cpp - // - - // returns 0 only in case of error - // returns after the command terminator - KviKvsTreeNodeInstruction * parseVoidFunctionCallOrOperation(); - // returns 0 only in case of error - // returns after the command terminator - KviKvsTreeNodeOperation * parseOperation(); - // returns 0 only in case of error - // returns after the command terminator - // If bPreferNumeric is propagated to parseCommandParameter() function - KviKvsTreeNodeData * parseOperationRightSide(bool bPreferNumeric = false); - // return 0 only in case of error - // returns after the command terminator - KviKvsTreeNodeOperation * parseBindingOperation(); - KviKvsTreeNodeConstantData * parseBindingOperationLiteralParameter(); - KviKvsTreeNodeData * parseBindingOperationParameter(); - - // - // kvi_kvs_parser_expression.cpp - // - - // returns 0 only in case of error - // starts AFTER the leading char of the expression - // ends afer the first terminator found - KviKvsTreeNodeExpression * parseExpression(char terminator); - KviKvsTreeNodeExpressionBinaryOperator * parseExpressionBinaryOperator(); - KviKvsTreeNodeExpression * parseExpressionOperand(char terminator); - KviKvsTreeNodeExpression * parseExpressionOperandCore(char terminator); - bool parseExpressionMightPointToOperator(); - - void report(bool bError,const QChar * pLocation,const QString &szMsgFmt,kvi_va_list va); -}; - -#endif //!_KVI_KVS_PARSER_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_parser_command.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_parser_command.cpp deleted file mode 100644 index 22dec29f6a..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_parser_command.cpp +++ /dev/null @@ -1,339 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_parser_command.cpp -// Creation date : Thu 03 Nov 2003 13.23 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - - -#include "kvi_kvs_parser.h" - -#include "kvi_kvs_treenode.h" - -#include "kvi_kvs_report.h" -#include "kvi_kvs_kernel.h" - -#include "kvi_kvs_parser_macros.h" - -#include "kvi_locale.h" - -#include "kvi_kvs_script.h" - -#include "kvi_cmdformatter.h" - - -KviKvsTreeNodeCommand * KviKvsParser::parseCommand() -{ - KVSP_ASSERT(KVSP_curCharIsLetter || (KVSP_curCharUnicode == '_')); - - - const QChar * pIdentifier = KVSP_curCharPointer; - - while(KVSP_curCharIsLetterOrNumber || (KVSP_curCharUnicode == '_'))KVSP_skipChar; - - int iIdentifierLen = KVSP_curCharPointer - pIdentifier; - - const QChar * pSecondPart = 0; - int iSecondPartLen = 0; - - bool bHasNamespaceSoMustBeAlias = false; - - if(KVSP_curCharUnicode == '.') - { - // a module command - KVSP_skipChar; - - pSecondPart = KVSP_curCharPointer; - - if(!KVSP_curCharIsLetter) - { - warning(KVSP_curCharPointer - 1,__tr2qs("Stray dot ('.') character or invalid following module command name")); - error(KVSP_curCharPointer,__tr2qs("Syntax error: malformed module command identifier")); - return 0; - } - - KVSP_skipChar; - while(KVSP_curCharIsLetterOrNumber || (KVSP_curCharUnicode == '_'))KVSP_skipChar; - - iSecondPartLen = KVSP_curCharPointer - pSecondPart; - } else while(KVSP_curCharUnicode == ':') - { - // an alias with namespace(s) ? - - // here we allow the syntax of the form - // <namespace>::{<namespace>::}<alias_name> - - bHasNamespaceSoMustBeAlias = true; - - KVSP_skipChar; - if(KVSP_curCharUnicode == ':') - { - KVSP_skipChar; - - if(!KVSP_curCharIsLetter) - { - warning(KVSP_curCharPointer - 1,__tr2qs("Stray '::' sequence or invalid following alias name")); - error(KVSP_curCharPointer,__tr2qs("Syntax error: malformed alias identifier")); - return 0; - } - - KVSP_skipChar; - while(KVSP_curCharIsLetterOrNumber || (KVSP_curCharUnicode == '_'))KVSP_skipChar; - } else { - warning(KVSP_curCharPointer - 1,__tr2qs("Stray ':' character: did you mean '...<namespace>::<alias_name>' ?")); - error(KVSP_curCharPointer,__tr2qs("Syntax error: malformed (alias?) command identifier")); - return 0; - } - - iIdentifierLen = KVSP_curCharPointer - pIdentifier; - } - - QString szIdentifier(pIdentifier,iIdentifierLen); - - skipSpaces(); - - KviKvsTreeNodeSwitchList * sw = 0; - KviKvsTreeNodeData * pRebindData; - - if(KVSP_curCharUnicode == '-') - { - // extract the switch - sw = parseCommandSwitchList(); - if(!sw) - { - if(error()) - return 0; - // else it might be a negative number or something that does not seem - // to be a switch anyway - pRebindData = 0; - } else { - pRebindData = sw->getStandardRebindingSwitch(); - } - } else { - pRebindData = 0; - } - - KviKvsTreeNodeCommand * cmd; - - if(!bHasNamespaceSoMustBeAlias) - { - // perl.begin has a *really* half special parsing routine - if(iIdentifierLen == 4) - { - if(pIdentifier->lower().unicode() == 'p') - { - if(KviQString::equalCI(szIdentifier,"perl")) - { - if(pSecondPart) - { - QString szSecondPart(pSecondPart,iSecondPartLen); - if(KviQString::equalCI(szSecondPart,"begin")) - { - // yep, that's perl.begin - cmd = parseSpecialCommandPerlBegin(); - if(!cmd) - { - // might be an error , but might be not... - // it is an error only if error() returns true - // but since the caller will take care of it - // we just return 0 - if(sw)delete sw; - if(pRebindData)delete pRebindData; - return 0; - } - cmd->setLocation(pIdentifier); - if(sw) - { - cmd->setSwitchList(sw); - // cmd becomes child of the rebinding switch - if(pRebindData)return new KviKvsTreeNodeRebindingSwitch(pRebindData->location(),pRebindData,cmd); - } - return cmd; - } - } - } - } - } - - if(!pSecondPart) - { - // is this a special command ? - - // Here theoretically we could also lookup special commands composed of two parts but we actually don't need it. - - // Looking up only the first part if there is a second part, instead, - // is dangerous since it may generate infinite loops (help.open vs help) - - KviKvsSpecialCommandParsingRoutine * ccpr = KviKvsKernel::instance()->findSpecialCommandParsingRoutine(szIdentifier); - - if(ccpr) - { - cmd = (this->*(ccpr->proc))(); - if(!cmd) - { - // might be an error , but might be not... - // it is an error only if error() returns true - // but since the caller will take care of it - // we just return 0 - if(sw)delete sw; - if(pRebindData)delete pRebindData; - return 0; - } - cmd->setLocation(pIdentifier); - if(sw) - { - cmd->setSwitchList(sw); - // cmd becomes child of the rebinding switch - if(pRebindData)return new KviKvsTreeNodeRebindingSwitch(pRebindData->location(),pRebindData,cmd); - } - return cmd; - } - } - - // is it a callback command ? - if(KVSP_curCharUnicode == '(') - { - // core callback command - // module callback command - KviKvsTreeNodeDataList * dl = parseCommaSeparatedParameterList(); - if(!dl) - { - if(sw)delete sw; - if(pRebindData)delete pRebindData; - return 0; - } - if(!skipSpacesAndNewlines()) - { - if(sw)delete sw; - if(pRebindData)delete pRebindData; - delete dl; - return 0; - } - - const QChar * pClbkBegin = KVSP_curCharPointer; - - KviKvsTreeNodeInstruction * ins = parseInstruction(); - if(!ins) - { - if(error()) - { - if(sw)delete sw; - if(pRebindData)delete pRebindData; - return 0; - } - // actually we need empty callbacks (for alias() at least) - // the single command implementations should take care of checking it - /*else { - - warning(pIdentifier,__tr2qs("Callback command called with an empty callback instruction")); - error(KVSP_curCharPointer,__tr2qs("Callback commands must have a callback instruction")); - if(sw)delete sw; - delete dl; - return 0; - - }*/ - } else { - delete ins; // in fact we don't need it, it will be reparsed the first time it is called - // Q: Couldn't we actually use the already parsed tree ? - // A: No: the tree must be reparsed in a new parser context - // since we're keeping track of global and local variables... - // The locals of this context are NOT the same as the locals - // of the other context. - } - - QString szCallbackName = szIdentifier; - szCallbackName += " callback"; - - QString szBlock(pClbkBegin,KVSP_curCharPointer - pClbkBegin); - KviCommandFormatter::bufferFromBlock(szBlock); - - KviKvsScript * clbk = new KviKvsScript(szCallbackName,szBlock); - - if(pSecondPart) - { - cmd = new KviKvsTreeNodeModuleCallbackCommand(pIdentifier,szIdentifier,QString(pSecondPart,iSecondPartLen),dl,clbk); - } else { - KviKvsCoreCallbackCommandExecRoutine * r = KviKvsKernel::instance()->findCoreCallbackCommandExecRoutine(szIdentifier); - if(r) - { - cmd = new KviKvsTreeNodeCoreCallbackCommand(pIdentifier,szIdentifier,dl,r,clbk); - } else { - error(KVSP_curCharPointer,__tr2qs("Unknown callback command \"%Q\""),&szIdentifier); - if(sw)delete sw; - if(pRebindData)delete pRebindData; - delete dl; - delete clbk; - return 0; - } - } - - if(sw) - { - cmd->setSwitchList(sw); - // cmd becomes child of the rebinding switch - if(pRebindData)return new KviKvsTreeNodeRebindingSwitch(pRebindData->location(),pRebindData,cmd); - } - - return cmd; - } - } - - // must be core simple command, module simple command or alias - KviKvsTreeNodeDataList * pl = parseCommandParameterList(); - if(!pl) - { - if(sw)delete sw; - if(pRebindData)delete pRebindData; - return 0; // this MUST be an error - } - - if(bHasNamespaceSoMustBeAlias) - { - // alias for sure, bind at runtime - cmd = new KviKvsTreeNodeAliasSimpleCommand(pIdentifier,szIdentifier,pl); - } else { - if(pSecondPart) - { - cmd = new KviKvsTreeNodeModuleSimpleCommand(pIdentifier,szIdentifier,QString(pSecondPart,iSecondPartLen),pl); - } else { - KviKvsCoreSimpleCommandExecRoutine * r = KviKvsKernel::instance()->findCoreSimpleCommandExecRoutine(szIdentifier); - if(r) - { - cmd = new KviKvsTreeNodeCoreSimpleCommand(pIdentifier,szIdentifier,pl,r); - } else { - // must be an alias in root namespace, bind at runtime - cmd = new KviKvsTreeNodeAliasSimpleCommand(pIdentifier,szIdentifier,pl); - } - } - } - - if(sw) - { - cmd->setSwitchList(sw); - // cmd becomes child of the rebinding switch - if(pRebindData)return new KviKvsTreeNodeRebindingSwitch(pRebindData->location(),pRebindData,cmd); - } - - return cmd; -} - - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_parser_comment.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_parser_comment.cpp deleted file mode 100644 index 1eb8fb5ea3..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_parser_comment.cpp +++ /dev/null @@ -1,101 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_parser_comment.cpp -// Creation date : Thu 03 Nov 2003 13.23 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - - -#include "kvi_kvs_parser.h" - -#include "kvi_kvs_treenode.h" - -#include "kvi_kvs_report.h" -#include "kvi_kvs_kernel.h" - -#include "kvi_kvs_parser_macros.h" - -#include "kvi_locale.h" - - - -KviKvsTreeNode * KviKvsParser::parseComment() -{ -#ifdef COMPILE_NEW_KVS - - KVSP_ASSERT((KVSP_curCharUnicode == '#') || (KVSP_curCharUnicode == '/')); - - switch(KVSP_curCharUnicode) - { - case '#': // bash style - skipToNextLine(); - break; - case '/': - KVSP_skipChar; - switch(KVSP_curCharUnicode) - { - case '/': - // c++ style - skipToNextLine(); - break; - case '*': - { - const QChar * pBegin = KVSP_curCharPointer; - // c style , multiline - KVSP_skipChar; - for(;;) - { - switch(KVSP_curCharUnicode) - { - case 0: - warning(pBegin,__tr2qs("Unterminated c-style multiline comment")); - error(KVSP_curCharPointer,__tr2qs("Unexpected end of script in multiline comment")); - return 0; - break; - case '*': - KVSP_skipChar; - if(KVSP_curCharUnicode == '/') - { - KVSP_skipChar; - return 0; - } - break; - } - KVSP_skipChar; - } - } - break; - default: - error(KVSP_curCharPointer,__tr2qs("Unexpected character '%q' (unicode %x) after a slash (it is a typo or a malformed comment begin ?)"),KVSP_curCharPointer,KVSP_curCharUnicode); - return 0; - break; - } - break; - default: - // shouldn't be here :/ - KVSP_ASSERT(false); - break; - } -#endif - return 0; -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_parser_dollar.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_parser_dollar.cpp deleted file mode 100644 index 8fae09e2bf..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_parser_dollar.cpp +++ /dev/null @@ -1,331 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_parser_dollar.cpp -// Creation date : Thu 5 Oct 2003 20.20 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - - -#include "kvi_kvs_parser.h" -#include "kvi_kvs_treenode.h" - -#include "kvi_kvs_report.h" -#include "kvi_kvs_kernel.h" - -#include "kvi_kvs_parser_macros.h" - -#include "kvi_locale.h" - - - - -KviKvsTreeNodeData * KviKvsParser::parseDollar(bool bInObjScope) -{ - KVSP_ASSERT(KVSP_curCharUnicode == '$'); - - const QChar * pDollarBegin = KVSP_curCharPointer; - const QChar * pBegin = KVSP_curCharPointer; - - KVSP_skipChar; - - if(!KVSP_curCharIsFunctionStart) - { - if(KVSP_curCharUnicode == 0)warning(KVSP_curCharPointer,__tr2qs("Unexpected end of script after '$' function call prefix")); - else warning(KVSP_curCharPointer,__tr2qs("Unexpected character %q (unicode %x) after '$' function call prefix"),KVSP_curCharPointer,KVSP_curCharUnicode); - error(KVSP_curCharPointer,__tr2qs("Syntax error after '$' function call prefix. If you want to use a plain '$' in the code you need to escape it")); - return 0; - } - - if(KVSP_curCharUnicode == '(') - { - // expression eval - if(bInObjScope) - { - error(KVSP_curCharPointer,__tr2qs("Invalid expression evaluation in object scope")); - return 0; - } - - KVSP_skipChar; - skipSpaces(); - - return parseExpression(')'); - } - - if(KVSP_curCharUnicode == '{') - { - // command block eval <--- senseless ??? - if(bInObjScope) - { - error(KVSP_curCharPointer,__tr2qs("Invalid command evaluation in object scope")); - return 0; - } - - KviKvsTreeNodeInstruction * i = parseInstructionBlock(); - if(!i) - { - if(error())return false; - // trigger an error anyway: this is abused syntax :D - error(KVSP_curCharPointer,__tr2qs("Empty instruction block for command evaluation")); - return false; - } - - return new KviKvsTreeNodeCommandEvaluation(pDollarBegin,i); - } - - if(KVSP_curCharIsNumber) - { - // this is a parameter identifier - // $1-4 $1- $3 - - if(bInObjScope) - { - error(KVSP_curCharPointer,__tr2qs("Parameter identifiers are forbidden in object scope (after the '->' operator)")); - return 0; - } - - pBegin = KVSP_curCharPointer; - - while(KVSP_curCharIsNumber) - KVSP_skipChar; - - QString szNum1(pBegin,KVSP_curCharPointer - pBegin); - bool bOk; - int iNum1 = szNum1.toInt(&bOk); - if(!bOk)debug("Ops... a non-number made by numbers ?"); - - if(KVSP_curCharUnicode != '-') - { - // end - return new KviKvsTreeNodeSingleParameterIdentifier(pDollarBegin,iNum1); - } - - // dash... make sure it's not $N->$something - KVSP_skipChar; - if(KVSP_curCharUnicode == '>') - { - // object scope operator in fact... - // go back to the - and return a single parameter identifier - KVSP_backChar; - return new KviKvsTreeNodeSingleParameterIdentifier(pDollarBegin,iNum1); - } - - if(!KVSP_curCharIsNumber) - { - // from iNum1 to the end - return new KviKvsTreeNodeMultipleParameterIdentifier(pDollarBegin,iNum1,-1); - } - - pBegin = KVSP_curCharPointer; - while(KVSP_curCharIsNumber) - KVSP_skipChar; - - QString szNum2(pBegin,KVSP_curCharPointer - pBegin); - int iNum2 = szNum2.toInt(&bOk); - if(!bOk)debug("Ops... a non-number made by numbers (2) ?"); - - if(iNum1 < iNum2)return new KviKvsTreeNodeMultipleParameterIdentifier(pDollarBegin,iNum1,iNum2); - else { - warning(pBegin,__tr2qs("Ending index of a multiple parameter identifier is lower or equal to the starting index. This will evaluate to a single parameter identifier.")); - return new KviKvsTreeNodeSingleParameterIdentifier(pDollarBegin,iNum1); - } - } - - pBegin = KVSP_curCharPointer; - - //KVSP_skipChar; - - bool bHasNamespaceNotInObjScopeSoMustBeAlias = false; // ;D - bool bIsThis = false; - - if(KVSP_curCharUnicode == '$') - { - if(bInObjScope) - { - error(KVSP_curCharPointer,__tr2qs("Syntax error: invalid $$ ($this) function call in object scope")); - return 0; - } - // handle $$ - KVSP_skipChar; - } else { - while((KVSP_curCharIsLetterOrNumber) || (KVSP_curCharUnicode == '_'))KVSP_skipChar; - if(!bInObjScope) - { - while(KVSP_curCharUnicode == ':') - { - // check for namespaces - - // here we allow the syntax of the form - // <namespace>::{<namespace>::}<alias_name> - - bHasNamespaceNotInObjScopeSoMustBeAlias = true; // ;D - - KVSP_skipChar; - if(KVSP_curCharUnicode == ':') - { - KVSP_skipChar; - - if(!KVSP_curCharIsLetter) - { - warning(KVSP_curCharPointer - 1,__tr2qs("Stray '::' sequence or invalid following alias name")); - error(KVSP_curCharPointer,__tr2qs("Syntax error: malformed alias function call identifier")); - return 0; - } - - KVSP_skipChar; - while(KVSP_curCharIsLetterOrNumber || (KVSP_curCharUnicode == '_'))KVSP_skipChar; - } else { - warning(KVSP_curCharPointer - 1,__tr2qs("Stray ':' character: did you mean '...<namespace>::<alias_name>' ?")); - error(KVSP_curCharPointer,__tr2qs("Syntax error: malformed (alias?) function call identifier")); - return 0; - } - } - } - } - - QString szIdentifier1(pBegin,KVSP_curCharPointer - pBegin); - - const QChar * pId2 = 0; - int iId2Len = 0; - bool bModuleFunctionCall = false; - - if(!bHasNamespaceNotInObjScopeSoMustBeAlias) - { - if(!bInObjScope) - { - if(KVSP_curCharUnicode == '.') - { - KVSP_skipChar; - if(KVSP_curCharIsLetter) - { - pId2 = KVSP_curCharPointer; - while((KVSP_curCharIsLetterOrNumber) || (KVSP_curCharUnicode == '_')) - KVSP_skipChar; - iId2Len = KVSP_curCharPointer - pId2; - bModuleFunctionCall = true; - } else { - KVSP_backChar; - } - } - } else { - // object scope, check for "class name" namespace - // the class name namespace has the format "<namespace>::<namespace>::..::<classname> - // so the last :: is the delimiter of the function name - const QChar * pOriginalEndOfId1 = KVSP_curCharPointer; - const QChar * pEndOfId1 = pOriginalEndOfId1; - - while(KVSP_curCharUnicode == ':') - { - const QChar * pEndOfId1 = KVSP_curCharPointer; - // base class function call ? - KVSP_skipChar; - if(KVSP_curCharUnicode == ':') - { - KVSP_skipChar; - if(KVSP_curCharIsLetter) - { - pId2 = KVSP_curCharPointer; - while((KVSP_curCharIsLetterOrNumber) || (KVSP_curCharUnicode == '_')) - KVSP_skipChar; - iId2Len = KVSP_curCharPointer - pId2; - } else { - KVSP_setCurCharPointer(pOriginalEndOfId1); - pId2 = 0; - iId2Len = 0; - break; - } - } else { - KVSP_setCurCharPointer(pOriginalEndOfId1); - pId2 = 0; - iId2Len = 0; - break; - } - } - if(pId2) - { - // yes, that's fine: reset it - szIdentifier1.setUnicode(pBegin,pEndOfId1 - pBegin); - } - } - } - - KviKvsTreeNodeDataList * l; - - if(KVSP_curCharUnicode != '(') - { - // no parameters passed - //KVSP_setCurCharPointer(pBegin); - // will get an empty data list - l = new KviKvsTreeNodeDataList(pDollarBegin); - } else { - // check for the special syntax () - KVSP_skipChar; - if(KVSP_curCharUnicode == ')') - { - // $call(), assume no parameters passed - l = new KviKvsTreeNodeDataList(pDollarBegin); - KVSP_skipChar; - } else { - KVSP_backChar; - l = parseCommaSeparatedParameterList(); - if(!l)return 0; // error - } - } - - if(bHasNamespaceNotInObjScopeSoMustBeAlias) - { - // namespace::alias function call - return new KviKvsTreeNodeAliasFunctionCall(pDollarBegin,szIdentifier1,l); - } else if(bModuleFunctionCall) - { - // module function call - return new KviKvsTreeNodeModuleFunctionCall(pDollarBegin,szIdentifier1,QString(pId2,iId2Len),l); - } else { - - if(bInObjScope) - { - // object function call (our parent will be a scope operator) - if(pId2) - { - // base class object function call - return new KviKvsTreeNodeBaseObjectFunctionCall(pDollarBegin,szIdentifier1,QString(pId2,iId2Len),l); - } else { - // plain object function call - return new KviKvsTreeNodeThisObjectFunctionCall(pDollarBegin,szIdentifier1,l); - } - } else { - // core or alias function call - KviKvsCoreFunctionExecRoutine * r = KviKvsKernel::instance()->findCoreFunctionExecRoutine(szIdentifier1); - if(r) - { - // core function call - return new KviKvsTreeNodeCoreFunctionCall(pDollarBegin,szIdentifier1,r,l); - } else { - // root namespace alias function call - return new KviKvsTreeNodeAliasFunctionCall(pDollarBegin,szIdentifier1,l); - } - } - } - - // not reached - KVSP_ASSERT(false); - return 0; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_parser_expression.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_parser_expression.cpp deleted file mode 100644 index 83d153228f..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_parser_expression.cpp +++ /dev/null @@ -1,636 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_parser_expression.cpp -// Creation date : Mon 6 Oct 2003 01.31 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - - -#include "kvi_kvs_parser.h" - -#include "kvi_kvs_treenode.h" - -#include "kvi_kvs_report.h" -#include "kvi_kvs_kernel.h" - -#include "kvi_kvs_parser_macros.h" - -#include "kvi_locale.h" - - -//#warning "FIXME: expression eval doc!" - - /* - @doc: expressioneval - @type: - language - @title: - Expression evaluation identifier - @syntax: - $(<expression>) - @keyterms: - expressions - @short: - Expression evaluation identifier - @description: - Evaluates <expression> and returns its result.[br] - If <expression> is a single string, array or hash, it is returned unmodified.[br] - In any other case the expression evaluation returns a numeric value, either real or integer.[br] - The expressions are really close to the C ones and have some minor extensions.[br] - The supported operators are +,-,*,/,|,&,^,||,&&,^^,>>,<<,<,>,<=,>=,==,!= and <> (synonim for !=).[br] - The following table describes their meaning.[br] - [table] - [tr][td][b]Operator[/b][/td][td][b]Description[/b][/td][/tr] - [tr][td]a + b[/td][td]Arithmetic sum: valid only for numeric operands[/td][/tr] - [tr][td]a - b[/td][td]Arithmetic subtraction: valid only for numeric operands[/td][/tr] - [tr][td]a / b[/td][td]Arithmetic division: valid only for numeric operands[/td][/tr] - [tr][td]a * b[/td][td]Arithmetic multiplication: valid only for numeric operands[/td][/tr] - [tr][td]a % b[/td][td]Arithmetic modulus: valid only for numeric operands[/td][/tr] - [tr][td]a || b[/td][td]Logical or: valid only for boolean operands[/td][/tr] - [tr][td]a && b[/td][td]Logical and: valid only for boolean operands[/td][/tr] - [tr][td]a ^^ b[/td][td]Logical xor: valid only for boolean operands[/td][/tr] - [tr][td]a >> b[/td][td]Bitwise shift right: valid only for integer operands[/td][/tr] - [tr][td]a << b[/td][td]Bitwise shift left: valid only for integer operands[/td][/tr] - [tr][td]a | b[/td][td]Bitwise or: valid only for integer operands[/td][/tr] - [tr][td]a & b[/td][td]Bitwise and: valid only for integer operands[/td][/tr] - [tr][td]a ^ b[/td][td]Bitwise xor: valid only for integer operands[/td][/tr] - [tr][td]a > b[/td][td]Greater than: valid for numeric or string operands. Case sensitive[/td][/tr] - [tr][td]a < b[/td][td]Lower than: valid for numeric or string operands. Case sensitive[/td][/tr] - [tr][td]a >= b[/td][td]Greater or equal to: valid for numeric or string operands. Case sensitive[/td][/tr] - [tr][td]a <= b[/td][td]Lower or equal to: valid for numeric or string operands. Case sensitive[/td][/tr] - [tr][td]a != b[/td][td]Not equal to: valid for numeric or string operands. Case sensitive[/td][/tr] - [tr][td]a == b[/td][td]Equal to: valid for numeric or string operands. Case sensitive[/td][/tr] - [/table] - The expressions can contain integer, real or string constants and variable operands.[br] - The integer constants can be also specified as hexadecimal numbers by prefixing them by '0x'.[br] - The string constants should be enclosed in quotes.[br] - @examples: - [example] - echo $(10 + 5 * 100) - echo $(10 / 3) - echo $(10 / 3.0) - echo $(10.0 + 5 * 100) - echo $(145 & 2) - echo $("hello" > "ciao") - echo $(10 == "10") - %a = 100 - %b = 50.3 - %c = "test" - echo $(%a + %b) - echo $("%a%b" + 1) - echo $(%a + %b > %c) - echo $(-(10 + 20) * 3) - echo $(1 ^ 2) - echo $(1 ^ 1) - echo $(0xffff == 65535) - ... - [/example] - */ - - - - -KviKvsTreeNodeExpressionBinaryOperator * KviKvsParser::parseExpressionBinaryOperator() -{ - switch(KVSP_curCharUnicode) - { - case '=': - KVSP_skipChar; - if(KVSP_curCharUnicode == '=') - { - KVSP_skipChar; - return new KviKvsTreeNodeExpressionBinaryOperatorEqualTo(KVSP_curCharPointer); - } else { - error(KVSP_curCharPointer,__tr2qs("Unknown binary operator '=%q': did you mean '==' ?"),KVSP_curCharPointer); - } - break; - case '!': - KVSP_skipChar; - if(KVSP_curCharUnicode == '=') - { - KVSP_skipChar; - return new KviKvsTreeNodeExpressionBinaryOperatorNotEqualTo(KVSP_curCharPointer); - } - break; - case '+': - KVSP_skipChar; - return new KviKvsTreeNodeExpressionBinaryOperatorSum(KVSP_curCharPointer); - break; - case '-': - KVSP_skipChar; - return new KviKvsTreeNodeExpressionBinaryOperatorSubtraction(KVSP_curCharPointer); - break; - case '/': - KVSP_skipChar; - return new KviKvsTreeNodeExpressionBinaryOperatorDivision(KVSP_curCharPointer); - break; - case '%': - KVSP_skipChar; - return new KviKvsTreeNodeExpressionBinaryOperatorModulus(KVSP_curCharPointer); - break; - case '*': - KVSP_skipChar; - return new KviKvsTreeNodeExpressionBinaryOperatorMultiplication(KVSP_curCharPointer); - break; - case '&': - KVSP_skipChar; - if(KVSP_curCharUnicode == '&') - { - KVSP_skipChar; - return new KviKvsTreeNodeExpressionBinaryOperatorAnd(KVSP_curCharPointer); - } - return new KviKvsTreeNodeExpressionBinaryOperatorBitwiseAnd(KVSP_curCharPointer); - break; - case '|': - KVSP_skipChar; - if(KVSP_curCharUnicode == '|') - { - KVSP_skipChar; - return new KviKvsTreeNodeExpressionBinaryOperatorOr(KVSP_curCharPointer); - } - return new KviKvsTreeNodeExpressionBinaryOperatorBitwiseOr(KVSP_curCharPointer); - break; - case '^': - KVSP_skipChar; - if(KVSP_curCharUnicode == '^') - { - KVSP_skipChar; - return new KviKvsTreeNodeExpressionBinaryOperatorXor(KVSP_curCharPointer); - } - return new KviKvsTreeNodeExpressionBinaryOperatorBitwiseXor(KVSP_curCharPointer); - break; - case '>': - KVSP_skipChar; - switch(KVSP_curCharUnicode) - { - case '>': - KVSP_skipChar; - return new KviKvsTreeNodeExpressionBinaryOperatorShiftRight(KVSP_curCharPointer); - break; - case '=': - KVSP_skipChar; - return new KviKvsTreeNodeExpressionBinaryOperatorGreaterOrEqualTo(KVSP_curCharPointer); - break; - default: - return new KviKvsTreeNodeExpressionBinaryOperatorGreaterThan(KVSP_curCharPointer); - break; - } - break; - case '<': - KVSP_skipChar; - switch(KVSP_curCharUnicode) - { - case '>': - KVSP_skipChar; - return new KviKvsTreeNodeExpressionBinaryOperatorNotEqualTo(KVSP_curCharPointer); - break; - case '<': - KVSP_skipChar; - return new KviKvsTreeNodeExpressionBinaryOperatorShiftLeft(KVSP_curCharPointer); - break; - case '=': - KVSP_skipChar; - return new KviKvsTreeNodeExpressionBinaryOperatorLowerOrEqualTo(KVSP_curCharPointer); - break; - default: - return new KviKvsTreeNodeExpressionBinaryOperatorLowerThan(KVSP_curCharPointer); - break; - } - break; - } - - error(KVSP_curCharPointer,__tr2qs("Unknown binary operator '%q'"),KVSP_curCharPointer); - return 0; -} - - -static unsigned char binary_operator_initial_char[256]= -{ - // 000 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 - // NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 - // DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 - // ! " # $ % & ' ( ) * + , - . / - 0 ,1 ,0 ,0 ,0 ,1 ,1 ,0 ,0 ,0 ,1 ,1 ,0 ,1 ,0 ,1 , - // 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 - // 0 1 2 3 4 5 6 7 8 9 : ; < = > ? - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,1 ,1 ,1 ,0 , - // 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079 - // @ A B C D E F G H I J K L M N O - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 080 081 082 083 084 085 086 087 088 089 090 091 092 093 094 095 - // P Q R S T U V W X Y Z [ \ ] ^ _ - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,1 ,0 , - // 096 097 098 099 100 101 102 103 104 105 106 107 108 109 110 111 - // ` a b c d e f g h i j k l m n o - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 - // p q r s t u v w x y z { | } ~  - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,1 ,0 ,0 ,0 , - // 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 - // - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 - // - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 - // - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 - // - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 - // � � � � � � � � � � � � � � � � - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 - // � � � � � � � � � � � � � � � � - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 - // � � � � � � � � � � � � � � � � - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - // 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 - // � � � � � � � � - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 -}; - - -bool KviKvsParser::parseExpressionMightPointToOperator() -{ - if(KVSP_curCharUnicode == '%') - { - KVSP_skipChar; - if(KVSP_curCharIsLetter || (KVSP_curCharUnicode == '_')) - { - // a variable, probably - KVSP_backChar; - return false; - } - KVSP_backChar; - return true; - } - if(KVSP_curCharUnicode > 255)return false; - return binary_operator_initial_char[KVSP_curCharUnicode] != 0; -} - - -KviKvsTreeNodeExpression * KviKvsParser::parseExpressionOperand(char terminator) -{ - switch(KVSP_curCharUnicode) - { - case 0: - case '\r': - case '\n': - error(KVSP_curCharPointer,__tr2qs("Unexpected end of script in expression")); - return 0; - break; - case '(': - KVSP_skipChar; - skipSpaces(); - return parseExpression(')'); // sub expression - break; - case '-': - { - KVSP_skipChar; - skipSpaces(); - KviKvsTreeNodeExpression * d = parseExpressionOperand(terminator); - if(!d)return 0; - return new KviKvsTreeNodeExpressionUnaryOperatorNegate(d->location(),d); - } - break; - case '!': - { - KVSP_skipChar; - skipSpaces(); - KviKvsTreeNodeExpression * d = parseExpressionOperand(terminator); - if(!d)return 0; - return new KviKvsTreeNodeExpressionUnaryOperatorLogicalNot(d->location(),d); - } - break; - case '~': - { - KVSP_skipChar; - skipSpaces(); - KviKvsTreeNodeExpression * d = parseExpressionOperand(terminator); - if(!d)return 0; - return new KviKvsTreeNodeExpressionUnaryOperatorBitwiseNot(d->location(),d); - } - break; - default: - // anything else at this point is an operand core - return parseExpressionOperandCore(terminator); - break; - } - - // not reached - KVSP_ASSERT(false); - return 0; -} - - - -KviKvsTreeNodeExpression * KviKvsParser::parseExpressionOperandCore(char terminator) -{ - KviPointerList<KviKvsTreeNodeData> * pDataList = new KviPointerList<KviKvsTreeNodeData>; - pDataList->setAutoDelete(true); - - static QString szStaticSingleSpace(" "); - - const QChar * pOperandBegin = KVSP_curCharPointer; - - bool bHaveVariable = false; - - for(;;) - { - switch(KVSP_curCharUnicode) - { - case 0: - case '\r': - case '\n': - error(KVSP_curCharPointer,__tr2qs("Unexpected end of script in expression")); - delete pDataList; - return 0; - break; - case ' ': - case '\t': - skipSpaces(); - if((KVSP_curCharUnicode == terminator) || parseExpressionMightPointToOperator())goto postprocess_operand; - // separate by single spaces - pDataList->append(new KviKvsTreeNodeConstantData(KVSP_curCharPointer,new KviKvsVariant(szStaticSingleSpace))); - break; - case '"': - { - // a string - bHaveVariable = true; - KviKvsTreeNodeData * d = parseStringParameter(); - if(!d) - { - delete pDataList; - return 0; - } - pDataList->append(d); - } - break; - case '%': - case '$': - case '@': - { - bHaveVariable = true; - KviKvsTreeNodeData * d = parseParameterPercentOrDollar(); - if(!d) - { - delete pDataList; - return 0; - } - pDataList->append(d); - } - break; - default: - // literal ? - if(KVSP_curCharIsLetterOrNumber || (KVSP_curCharUnicode == '.') || (KVSP_curCharUnicode == '_')) - { - const QChar * pBegin = KVSP_curCharPointer; - while(KVSP_curCharIsLetterOrNumber || (KVSP_curCharUnicode == '.') || (KVSP_curCharUnicode == '_'))KVSP_skipChar; - QString tmp(pBegin,KVSP_curCharPointer - pBegin); - bool bOk; - kvs_int_t iVal = tmp.toLong(&bOk); - if(bOk) - { - pDataList->append(new KviKvsTreeNodeConstantData(pBegin,new KviKvsVariant(iVal))); - } else { - // bOk is false - if(pBegin->unicode() == '0') - { - if(tmp.length() > 2) - { - if((tmp[1] == 'x') || (tmp[1] == 'X')) - { - // hexadecimal constant ? - QString hex = tmp.right(tmp.length() - 2); - iVal = hex.toLong(&bOk,16); - if(bOk) - { - pDataList->append(new KviKvsTreeNodeConstantData(pBegin,new KviKvsVariant(iVal))); - } - } - } - } - if(!bOk) - { - kvs_real_t dVal = tmp.toDouble(&bOk); - if(bOk) - { - pDataList->append(new KviKvsTreeNodeConstantData(pBegin,new KviKvsVariant(dVal))); - } else { - pDataList->append(new KviKvsTreeNodeConstantData(pBegin,new KviKvsVariant(tmp))); - } - } - } - } else { - error(KVSP_curCharPointer,__tr2qs("Unexpected character %q (unicode %h) in expression. If it meant to be a string use the quotes."),KVSP_curCharPointer,KVSP_curCharUnicode); - delete pDataList; - return 0; - } - break; - } - - if((KVSP_curCharUnicode == terminator) || parseExpressionMightPointToOperator())break; - } - -postprocess_operand: - - if(pDataList->count() == 0) - { - delete pDataList; - error(KVSP_curCharPointer,__tr2qs("Unexpected empty expression operand")); - return 0; - } - - if(pDataList->count() > 1) - return new KviKvsTreeNodeExpressionVariableOperand(pOperandBegin,new KviKvsTreeNodeCompositeData(pOperandBegin,pDataList)); - - KviKvsTreeNodeData * pUniqueData = pDataList->first(); - - if(bHaveVariable) - { - pDataList->setAutoDelete(false); - delete pDataList; - return new KviKvsTreeNodeExpressionVariableOperand(pOperandBegin,pUniqueData); - } - - // a single constant data element - KviKvsTreeNodeExpressionConstantOperand * op = new KviKvsTreeNodeExpressionConstantOperand(pOperandBegin,new KviKvsVariant(*(((KviKvsTreeNodeConstantData *)pUniqueData)->value()))); - delete pDataList; // auto delete is true - return op; -} - - -KviKvsTreeNodeExpression * KviKvsParser::parseExpression(char terminator) -{ - // we're inside the expression now - skipSpaces(); - - if(KVSP_curCharUnicode == terminator) - { - // empty expression - // constant 0 ? - KVSP_skipChar; - return new KviKvsTreeNodeExpressionConstantOperand(KVSP_curCharPointer,new KviKvsVariant((kvs_int_t)0)); - } - - KviKvsTreeNodeExpression * left = parseExpressionOperand(terminator); - if(!left)return 0; - QString sz; - left->contextDescription(sz); - - skipSpaces(); - - if(KVSP_curCharUnicode == terminator) - { - KVSP_skipChar; - return left; - } - - // not a terminator... must be an operator (or an error , eventually) - - KviKvsTreeNodeExpression * curTopOperator = parseExpressionBinaryOperator(); - if(!curTopOperator) - { - delete left; - return 0; // error - } - curTopOperator->contextDescription(sz); - - curTopOperator->setLeft(left); - - // ok.. parse the right side - - // Now curTopOperator has the left subtree (one node) set - // and it points to the TOP (=ROOT) node - // Evaluate the rest - - KviKvsTreeNodeExpression * operand; - KviKvsTreeNodeExpression * incompleteOperator = curTopOperator; - KviKvsTreeNodeExpression * auxOperator; - - for(;;) - { - skipSpaces(); - - operand = parseExpressionOperand(terminator); - if(!operand) - { - delete curTopOperator; - return 0; - } - operand->contextDescription(sz); - - skipSpaces(); - - if(KVSP_curCharUnicode == terminator) - { - KVSP_skipChar; - incompleteOperator->setRight(operand); - return curTopOperator; - } - - auxOperator = parseExpressionBinaryOperator(); - if(!auxOperator) - { - delete curTopOperator; - delete operand; - return 0; - } - - auxOperator->contextDescription(sz); - - - //now compare operators... - if(incompleteOperator->precedence() > auxOperator->precedence()) - { - // This in fact means that incomplete has LOWER precedence than - // aux and thus aux should be done first. - incompleteOperator->setRight(auxOperator); - auxOperator->setLeft(operand); - } else { - // incomplete has GREATER precedence than aux and thus aux should be done first - incompleteOperator->setRight(operand); //right tree complete - // go up until we find an operator with lower precedence than auxOperator (>=) - KviKvsTreeNodeExpression * tempOperator = incompleteOperator->parentWithPrecedenceLowerThan(auxOperator->precedence()); - if(tempOperator == 0) - { - auxOperator->setLeft(curTopOperator); - curTopOperator = auxOperator; - } else { - KVSP_ASSERT(tempOperator->right()); - auxOperator->setLeft(tempOperator->right()); - tempOperator->setRight(auxOperator); - } - } - incompleteOperator = auxOperator; - KVSP_ASSERT(incompleteOperator->right() == 0); - } - - KVSP_ASSERT(false); - - return 0; //newer here - -/* - - - KviKvsTreeNodeExpression * right = parseExpression(terminator); - if(!right) - { - delete op; - return 0; - } - - // left * a + b - - // * - // left + - // a b - -*/ -/* - // now.. the left side is a single operand for sure - // the right side might be a single operand or a sequence of operations - if(right->isOperator()) - { - // if the operator has lower precedence than op then - if(right->precedence() < op->precedence()) - { - right->attachHighPrecedenceOperator(op); - return right; - } - } -*/ -/* - // a single operand or a greater precedence operator - op->setRight(right); - - return op; - */ -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_parser_lside.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_parser_lside.cpp deleted file mode 100644 index 10e5e23b2f..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_parser_lside.cpp +++ /dev/null @@ -1,1196 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_parser_lside.cpp -// Creation date : Thu 03 Nov 2003 13.11 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - - -#include "kvi_kvs_parser.h" - -#include "kvi_kvs_treenode.h" - -#include "kvi_kvs_report.h" -#include "kvi_kvs_kernel.h" - -#include "kvi_kvs_parser_macros.h" - -#include "kvi_locale.h" - - -/* - @doc: operators - @title: - Operators - @keyterms: - operator,operators,assignment,assign - @type: - language - @short: - Variable operators , assignments & co. - @body: - Operator constructs are commands just like the other ones. - All the operators work on local or global variables and dictionaries.[br] - The generic operator syntax is:[br] - [br] - [b]<left_operand> <operator> [right_operand][/b][br] - [br] - where <left_operand> and [right_operand] depend on the <operator>.[br] - Some operators have no [right_operand] and these are called [b]unary operators[/b]: - they operate directly on <left_operand>.[br] - - [br] - [big]= (Assignment)[/big][br] - [br] - - The assignment is the "plainest" of the binary operators: it works just like in any other programming language.[br] - [br] - If the <left_operand> is a variable, then the <right_operand> is assigned to it; - if the variable doesn't exists yet , it is created.[br] - If <right_operand> evaluates to an empty value then the variable is unset.[br] - [example] - [comment]# Assigning a constant to the global variable %Tmp[/comment] - %Tmp = 1 - [comment]# Assigning a string constant to the global variable %Tmp[/comment] - %Tmp = some string - [comment]# Assigning a string constant to the local variable %tmp[/comment] - %tmp = "some string with whitespace         preserved" - [comment]# Assigning a variable to another variable copies its contents[/comment] - %tmp = %somevariable - [comment]# Assigning a variable string to the global variable %Z[/comment] - %Z = my eyes are %color - [comment]# Assigning a variable string (with a function call inside) to the local variable %x[/comment] - %x = the system os is [fnc]$system.osname[/fnc] - [comment]# Assigning an empty string to the local variable %y unsets %y[/comment] - %y = - [comment]# This is equivalent to the above[/comment] - %y = "" - [comment]# This is equivalent too, if $function evalutates to an empty string[/comment] - %y = $function() - [/example] - [br] - If the <left_operand> is a dictionary/array entry, then the <right_operand> is assigned to it; - if the dictionary/array entry doesn't exist (or the whole dictionary/array doesn't exists) it is created.[br] - If <right_operand> evaluates to an empty value then the dictionary/array entry (and eventually the whole - dictionary/array, if there are no other entries) is unset.[br] - [example] - [comment]# Assigning a variable string to a global dictionary entry[/comment] - %Dict[key] = [fnc]$system.osname[/fnc]\ian - [comment]# Unsetting a local dictionary entry[/comment] - %mydict[23] = "" - [/example] - [br] - If the <left_operand> is an array reference then the semantics depend on the <right_operand> type. - If <right_operand> is an array reference then its contents are copied to the <left_operand>.[br] - If <right_operand> is a dictionary (keys) reference then its values are copied to to <left_operand>.[br] - If <right_operand> is a scalar then the value is assigned to every entry of <left_operand>.[br] - This is an easy way of unsetting a whole array: just assign an empty string.[br] - If the <left_operand> is a dictionary reference then the semantics depend on the <right_operand> type. - If <right_operand> is a dictionary reference then its contents are copied to the <left_operand>.[br] - If <right_operand> is an array reference then its contents are copied to to <left_operand> using - the array indexes as keys.[br] - If <right_operand> is a dictionary key reference then the keys are copied to the <left_operand> - using numeric indexes starting from 0 as keys.[br] - If <right_operand> is a scalar then the value is assigned to every key of <left_operand>.[br] - This is an easy way of unsetting a whole dictionary: just assign an empty string to all its keys.[br] - (If you play with huge dictionaries/arrays it might be a good idea to unset them when no longer needed) - [example] - [comment]# Assigning a dictionary to another: %mydict[] becomes a copy of %anotherdict[][/comment] - %mydict[] = %anotherdict[] - [comment]# %mydict[] gets the values of the dict returned by $features[/comment] - %mydict[] = [fnc]$features[/fnc] - [comment]# Assigning a string to ALL the keys of %mydict[/comment] - %mydict[] = "some default value" - [comment]# Unsetting a whole dictionary[/comment] - %mydict[] = - %AnotherGlobalDict[] = "" - [/example] - - - [br] - [big]=~ (Binding operator)[/big][br] - [br] - - This operator is a really ugly, poor and clueless attempt to reach at least 1% of the - power of the perl =~ operator :D[br] - It allows some complex string operations to be performed efficently by operating directly - on the left operand (in fact this is a lot faster in KVIrc since at least one step of parsing is skipped).[br] - Its basic syntax is:[br] - [b]<left_operand> =~ <operation>[parameters][/b][br] - Where <operation> may be one of 't','s' and parameters depend on it.[br] - <left_operand> is the target of the <operation>.[br] - If <left_operand> is an array or dictionary, the <operation> is executed on each item they contain.[br] - Operation 't' is the transliteration.[br] - The complete syntax with parameters is:[br] - [b]<left_operand> =~ t/<search characters>/<replacement characters>/[/b][br] - where <search characters> is a string of characters that are replaced with the corresponding - characters in <replacement characters>.[br] - This operation can be also named 'y' or 'tr' (to preserve some compatibility with other languages).[br] - [example] - %A=This is a test string - echo %A - %A=~ tr/abcdefghi/ABCDEFGHI/ - echo %A - [/example] - Operation 's' is the substitution.[br] - The complete syntax with parameters is:[br] - [b]<left_operand> =~ s/<search pattern>/<replacement pattern>/[flags][/b][br] - where <search pattern> is an extended regular expression to be matched in the <left_operand> - and <replacement string> is a special pattern that will replace any occurence found.[br] - <search pattern> may contain parentheses to capture parts of the matched text. - <replacement string> can contain the escape sequences \\N where N is a number between 1 and 9 - to be replaced by the captured text.[br] - (We use \\N because KVIrc will first unquote the string when parsing...)[br] - \\0 is a special escape that will be replaced by the entire match (is always valid!).[br] - WARNING: the "capture-text" feature is not available if KVIrc has been compiled - with qt older than 3.0.0. You can find out if the feature is available by - looking for the string "Qt3" in the array returned by [fnc]$features[/fnc].[br] - [flags] may be a combination of the letters 'g','i' and 'w'.[br] - 'g' causes the search to be global and not stop after the first occurence of <search pattern>.[br] - 'i' causes the search to be case insensitive.[br] - 'w' causes the search pattern to be interpreted as a simple wildcard regular expression.[br] - 'm' causes the matching to be "minimal" instead of "greedy" (default). Greedy matches - find the longest possible match in the string while minimal (non-greedy) matches the shortest possible.[br] - [example] - %A=This is a test string - echo %A - %A=~ s/([a-z])i([a-z])/\\1I\\2/ - echo %A - %A=~ s/([a-z])i([a-z])/\\1@\\2/gi - echo %A - [/example] - - [br] - [big]X= (Arithmetic Self-operators)[/big][br] - [br] - - The general syntax is:[br] - [b]<left_operand> <operation> <right_operand>[/b][br] - Where <left_operand> and <right_operand> must evaluate to numbers.[br] - All these operators perform the operation on <left_operand> and <right_operand> and then - store the result in <left_operand> (which therefore must be a variable, an array entry or a dictionary entry).[br] - <operation> may be one of:[br] - += : sums the <right_operand> to <left_operand>[br] - -= : subtracts <right_operand> from <left_operand>[br] - *= : multiplies <left_operand> by <right_operand>[br] - %= : calculates <left_operand> modulus <right_operand>[br] - |= : calculates <left_operand> bitwise-or <right_operand>[br] - &= : calculates <left_operand> bitwise-and <right_operand>[br] - /= : divides <left_operand> by <right_operand>[br] - - [br] - [big]++ and -- (Increment and Decrement)[/big][br] - [br] - - These two operators work only on numeric operands.[br] - The general syntax is:[br] - [b]<left_operand> <operator>[/b][br] - There is no <right_operand>.[br] - ++ increments <left_operand> by one, -- decrements <left_operand> by one.[br] - These are equivalent to += 1 and -= 1.[br] - - [br] - [big].= , << , <+ , <, (String concatenation operators)[/big][br] - [br] - - All these operators work also on whole arrays and dictionaries.[br] - Operator [b].=[/b] : APPENDS the <right_operand> to the <left_operand>[br] - Operator [b]<+[/b] is a synonim for .= (backward compatibility)[br] - Operator [b]<<[/b] : appends <right_operand> to <left_operand> - separating the two strings by a single space if and only if <left_operand> and <right_operand> - are non-empty.[br] - Operator [b]<,[/b] : is similar to '<<' ; appends , separating with a single ',' with the same condition.[br] - - @examples: - First set the variable %var - [example] - %var = Ciao ciao - [/example] - Then append a nickname... - [example] - %var << Pragma - [/example] - %var now contains "Ciao ciao Pragma"[br] - Append a '!' character - [example] - %var <+ ! - [/example] - %var now contains "Ciao ciao Pragma!" - Now reset it. - [example] - %var = - [/example] - Now %var is unset.[br] - Reset it with a comma separated list of items - [example] - %var = Pragma,Diabl0,Arter|o - %var <, MalboroLi - [/example] - %var now contains "Pragma,Diabl0,Arter|o,MalboroLi"[br] - [br] - Now a longer example. - [example] - %var = l - [cmd]echo[/cmd] It's name starts with the letter %var! - %var <+ inux - [cmd]echo[/cmd] Yes , it is %var! - %var << OS - [cmd]echo[/cmd] Use %var! - %var <, Mac OS - [cmd]echo[/cmd] There are two items in this list : %var - %var = [fnc]$strlen[/fnc](%var) - [cmd]echo[/cmd] And it is %var characters long (including the comma) - %var-- - [cmd]echo[/cmd] Excluding the comma : %var - %var+=%var - [cmd]echo[/cmd] Now it is doubled : %var - %var = - [cmd]echo[/cmd] Now the var is unset (empty): (%var) ! - [/example] -*/ - - -KviKvsTreeNodeData * KviKvsParser::parseOperationRightSide(bool bPreferNumeric) -{ - KviPointerList<KviKvsTreeNodeData> * l = new KviPointerList<KviKvsTreeNodeData>(); - l->setAutoDelete(true); - - const QChar * pBegin = KVSP_curCharPointer; - - for(;;) - { - switch(KVSP_curCharUnicode) - { - case 0: - goto end_of_the_param; - break; - case '\n': - case '\r': - case ';': - KVSP_skipChar; - goto end_of_the_param; - break; - case ' ': - case '\t': - skipSpaces(); - if(KVSP_curCharIsEndOfCommand) - { - goto end_of_the_param; - } else { - // separate by single spaces - bPreferNumeric = false; // this can't be a number - l->append(new KviKvsTreeNodeConstantData(KVSP_curCharPointer,new KviKvsVariant(QString(" ")))); - } - break; - default: - // anything else is a parameter - KviKvsTreeNodeData * p = parseCommandParameter(bPreferNumeric); - if(!p) - { - // this is an error - delete l; - return 0; - } - l->append(p); - break; - } - } - -end_of_the_param: - if(l->count() > 1) - { - // complex parameter needed - return new KviKvsTreeNodeCompositeData(pBegin,l); - } else { - if(l->count() > 0) - { - // a single parameter in the list - l->setAutoDelete(false); - KviKvsTreeNodeData * p = l->first(); - delete l; - return p; - } else { - // empty (this should NEVER happen anyway) - delete l; - return new KviKvsTreeNodeConstantData(pBegin,new KviKvsVariant(QString(""))); - } - } - // never reached - return 0; -} - -/* - @doc: assignment - @title: - Assignment operation - @keyterms: - assignment - @type: - language - @short: - Assignment operation - @body: - The assignment is the "plainest" of the operators: it works just like in any other programming language.[br] - The syntax is:[br] - [br] - [b]<target> = <source>[/b] - [br] - <target> must be a variable, <source> can be any parameter.[br] - If the <target> variable doesn't exist, it is created. - If it already exists, it is eventually converted to the type of <souce> (scalar, hash or array).[br] - If <source> evaluates to an empty value then the <target> variable is unset.[br] - [example] - [comment]# Assigning a constant to the variable %Tmp[/comment] - %Tmp = 1 - [cmd]echo[/cmd] %Tmp - [comment]# Assigning a string constant to the variable %Tmp[/comment] - %Tmp = some string - [cmd]echo[/cmd] %Tmp - [comment]# Assigning a string constant to the variable %Tmp[/comment] - %Tmp = "some string with whitespace         preserved" - [cmd]echo[/cmd] %Tmp - [comment]# Assigning a variable to another variable copies its contents[/comment] - %Someothervariable = "Contents" - %Tmp = %Someothervariable - [cmd]echo[/cmd] %Tmp - [comment]# Assigning a variable string to the variable %z[/comment] - %color = blue - %z = my eyes are %color - [cmd]echo[/cmd] %z - [comment]# Assigning a variable string (with a function call inside) to the variable %x[/comment] - %x = the system os is [fnc]$system.osname[/fnc] - [cmd]echo[/cmd] %x - [comment]# Assigning an empty string to the local variable %y unsets %y[/comment] - %x = - [cmd]echo[/cmd] %y - [comment]# This is equivalent to the above[/comment] - %y = "" - [comment]# This is equivalent too, if $function evalutates to an empty string[/comment] - %y = $function() - [comment]# Assigning a variable string to a hash entry[/comment] - %Dict{key} = [fnc]$system.osname[/fnc]\ian - [comment]# Unsetting an array entry[/comment] - %mydict[23] = "" - [comment]# Assigning a hash to another: %mydict[] becomes a copy of %anotherdict[][/comment] - %anotherdict{"The key"} = "Some dummy value" - %mydict = %anotherdict - [cmd]echo[/cmd]%mydict{"The key"} - [comment]# This will convert %mydict to be a scalar variable (deleting all the %mydict contents!)[/comment] - %mydict = "some default value" - [comment]# Unsetting a whole hash[/comment] - %anotherdict = - [/example] - [/p] -*/ - - -/* - @doc: incrementdecrement - @title: - Increment and decrement operations - @keyterms: - increment, decrement - @type: - language - @short: - Increment and decrement operations - @body: - These two operators work only on numeric operands.[br] - The syntax is:[br] - [br] - [b]<target>++[/b][br] - [b]<target>--[/b][br] - [br] - ++ increments <target> by one, -- decrements <target> by one.[br] - These are equivalent to += 1 and -= 1.[br] - <target> must be an existing variable and contain an integer value.[br] - If <target> contains a real value then the real is truncated to the nearest - integer and then incremented or decremented.[br] - @examples: - [example] - %a=10 - [cmd]echo[/cmd] "Incrementing" - [cmd]while[/cmd](%a < 20) - { - [cmd]echo[/cmd] %a - [b]%a++[/b] - } - [cmd]echo[/cmd] "Decrementing" - [cmd]while[/cmd](%a > 10) - { - [cmd]echo[/cmd] %a - [b]%a--[/b] - } - [cmd]echo[/cmd] "Testing for loop" - [cmd]for[/cmd](%a=0;%a < 10;[b]%a++[/b]) - { - [cmd]echo[/cmd] %a - } - [example] - @seealso: - [doc:operators]Operators[/doc] -*/ - - -/* - @doc: selfarithmetic - @title: - Arithmetic self-operators - @type: - language - @short: - Arithmetic self-operators - @body: - These operators work only on numeric operands.[br] - The syntax is:[br] - [br] - [b]<target> += <right_operand>[/b][br] - [b]<target> -= <right_operand>[/b][br] - [b]<target> *= <right_operand>[/b][br] - [b]<target> /= <right_operand>[/b][br] - [b]<target> %= <right_operand>[/b][br] - [br] - <target> must be an existing variable and contain a numeric value. - <right_operand> must evaluate to a numeric value. - Note that if you want <right_operand> to be a result of an expression, you must - enclose it in the $(*) expression evaluation call.[br] - Operator += sums the <right_operand> value to the <target> value and stores the result in <target>.[br] - Operator -= subtracts <right_operand> from <target> and stores the result in <target>.[br] - Operator *= multiplies <target> by <right_operand> and stores the result in <target>.[br] - Operator /= divides <target> by <right_operand> and stores the result in <target>.[br] - Operator %= computes <target> modulus <right_operand> and stores the result in <target>.[br] - The division and modulus operators fail with an error if <right_operand> is 0.[br] - If both <target> and <right_operand> are integer values then the results of the division - and modulus are integers (truncated for the division).[br] - If <target> or <right_operand> or both are floating point values then the result is a floating point value.[br] - @examples: - [example] - %a=10 - [cmd]echo[/cmd] %a - %a+=20 - [cmd]echo[/cmd] %a - %a-=$(%a - 1) - [cmd]echo[/cmd] %a - %a *= 10 - [cmd]echo[/cmd] %a - %a /= 21 - [cmd]echo[/cmd] %a - %a *= 20 - [cmd]echo[/cmd] %a - %a /= 21.0 - [cmd]echo[/cmd] %a - %b = 10.0 - %a %= %b - [cmd]echo[/cmd] %a - %a = 10 - %b = 3 - [comment]# nice trick[/comment] - %a /= %b.0 - [cmd]echo[/cmd] %a - [example] - @seealso: - [doc:operators]Operators[/doc] -*/ - - -/* - @doc: selfbitwise - @title: - Bitwise self-operators - @type: - language - @short: - Bitwise self-operators - @body: - These operators work only on integer operands.[br] - The syntax is:[br] - [br] - [b]<target> |= <right_operand>[/b][br] - [b]<target> &= <right_operand>[/b][br] - [b]<target> ^= <right_operand>[/b][br] - [b]<target> >>= <right_operand>[/b][br] - [b]<target> <<= <right_operand>[/b][br] - [br] - <target> must be an existing variable and contain a numeric value. - <right_operand> must evaluate to a numeric value. - If <target> or <right_operand> are floating point values then they are truncated - and converted to integers.[br] - Note that if you want <right_operand> to be a result of an expression, you must - enclose it in the $(*) expression evaluation call.[br] - Operator |= computes <target> bitwise-or <right_operand> and stores the result in <target>.[br] - Operator &= computes <target> bitwise-and <right_operand> and stores the result in <target>.[br] - Operator ^= computes <target> bitwise-xor <right_operand> and stores the result in <target>.[br] - Operator >>= shifts <target> <right_operand> bits to the right and stores the result int <target>.[br] - Operator <<= shifts <target> <right_operand> bits to the left and stores the result int <target>.[br] - Note that "!=" is not available. You must use %a = $(!%b) to implement it.[br] - For operators >>= and <<= <right_operand> must be a positive integer.[br] - @examples: - [example] - %a = 1 - [cmd]echo[/cmd] %a - %a |= 2 - [cmd]echo[/cmd] %a - %a &= 2 - [cmd]echo[/cmd] %a - %a ^= 1 - [cmd]echo[/cmd] %a - %a >>= 2 - [cmd]echo[/cmd] %a - %a <<= 1 - [cmd]echo[/cmd] %a - [example] - @seealso: - [doc:operators]Operators[/doc] -*/ - - -/* - @doc: stringconcatenation - @title: - String concatenation operators - @type: - language - @short: - String concatenation operators - @body: - These operators concatenate strings. - The syntax is:[br] - [br] - [b]<target> .= <right_operand>[/b][br] - [b]<target> << <right_operand>[/b][br] - [b]<target> <, <right_operand>[/b][br] - [br] - Operator .= appends <right_operand> to <target>. - Operator << appends a space followed by <right_operand> to <target> if <target> is non empty, - otherwise sets <target> to <right_operand>. - Operator <, is similar to << but uses a comma to separate the two variable contents. - The last two operators are useful in creating space-separated or comma-separated lists. - @examples: - [example] - %a = "" - %a << free - [cmd]echo[/cmd] %a - %a .= bsd - [cmd]echo[/cmd] %a - %a << rox - [cmd]echo[/cmd] %a - %a <, but linux is better! - [cmd]echo[/cmd] %a - [example] - @seealso: - [doc:operators]Operators[/doc] -*/ - - -/* - @doc: arrayconcatenation - @title: - Array concatenation operator - @type: - language - @short: - Array concatenation operator - @body: - This operator concatenates arrays - The syntax is:[br] - [br] - [b]<target> <+ <right_operand>[/b][br] - [br] - If <target> is not an array, it is converted to one first. - After that, if <right_operand> is a scalar then it is appended - to the end of the <target> array. If <right_operand> is an array - then all of its items are appended to the end of the <target> array. - If <right_operand> is a hash then all of its value items - are appended to the end of the <target> array. - @seealso: - [doc:operators]Operators[/doc] -*/ - - - -/* - @doc: binding - @title: - Binding operator - @type: - language - @short: - Binding operator - @body: - This operator is a really ugly, poor and clueless attempt to reach at least 1% of the - power of the perl =~ operator :D[br] - It allows some complex string operations to be performed efficently by operating directly - on the left operand (in fact this is a lot faster in KVIrc since at least one step of parsing is skipped).[br] - Its basic syntax is:[br] - [b]<left_operand> =~ <operation>[parameters][/b][br] - Where <operation> may be one of 't','s' and parameters depend on it.[br] - <left_operand> is the target of the <operation>.[br] - If <left_operand> is an array or dictionary, the <operation> is executed on each item they contain.[br] - Operation 't' is the transliteration.[br] - The complete syntax with parameters is:[br] - [b]<left_operand> =~ t/<search characters>/<replacement characters>/[/b][br] - where <search characters> is a string of characters that are replaced with the corresponding - characters in <replacement characters>.[br] - This operation can be also named 'y' or 'tr' (to preserve some compatibility with other languages).[br] - [example] - %A=This is a test string - echo %A - %A=~ tr/abcdefghi/ABCDEFGHI/ - echo %A - [/example] - Operation 's' is the substitution.[br] - The complete syntax with parameters is:[br] - [b]<left_operand> =~ s/<search pattern>/<replacement pattern>/[flags][/b][br] - where <search pattern> is an extended regular expression to be matched in the <left_operand> - and <replacement string> is a special pattern that will replace any occurence found.[br] - <search pattern> may contain parentheses to capture parts of the matched text. - <replacement string> can contain the escape sequences \\N where N is a number between 1 and 9 - to be replaced by the captured text.[br] - (We use \\N because KVIrc will first unquote the string when parsing...)[br] - \\0 is a special escape that will be replaced by the entire match (is always valid!).[br] - [flags] may be a combination of the letters 'g','i' and 'w'.[br] - 'g' causes the search to be global and not stop after the first occurence of <search pattern>.[br] - 'i' causes the search to be case insensitive.[br] - 'w' causes the search pattern to be interpreted as a simple wildcard regular expression.[br] - [example] - %A=This is a test string - echo %A - %A=~ s/([a-z])i([a-z])/\\1I\\2/ - echo %A - %A=~ s/([a-z])i([a-z])/\\1@\\2/gi - echo %A - [/example] - @examples: - [example] - %a = "" - %a << free - [cmd]echo[/cmd] %a - %a .= bsd - [cmd]echo[/cmd] %a - %a << rox - [cmd]echo[/cmd] %a - %a <, but linux is better! - [cmd]echo[/cmd] %a - [example] - @seealso: - [doc:operators]Operators[/doc] -*/ - - - -/* - @doc: operators - @title: - Operators - @keyterms: - operator,operators,assignment - @type: - language - @short: - Variable operators , assignments & co. - @body: - [p] - Operator constructs are commands just like the other ones. - All the operators work on local or global variables.[br] - The generic operator syntax is:[br] - [br] -         [b]<left_operand> <operator> [right_operand][/b][br] - [br] - where <left_operand> is a variable and [right_operand] is a variable , a constant or a complex expression.[br] - Some operators do not use [right_operand] and do their job directly on <left_operand>[br] - [/p] - - [table] - [tr][td]Operator[/td][td]document[/td][/td] - [tr][td]=[/td][td][doc:assignment]assignment operator[/doc][/td][/tr] - [tr][td]++[/td][td][doc:incrementdecrement]Increment and decrement operators[/doc][/td][/tr] - [tr][td]--[/td][td][doc:incrementdecrement]Increment and decrement operators[/doc][/td][/tr] - [tr][td]+=[/td][td][doc:selfarithmetic]Arithmetic self-operators[/doc][/td][/tr] - [tr][td]-=[/td][td][doc:selfarithmetic]Arithmetic self-operators[/doc][/td][/tr] - [tr][td]*=[/td][td][doc:selfarithmetic]Arithmetic self-operators[/doc][/td][/tr] - [tr][td]/=[/td][td][doc:selfarithmetic]Arithmetic self-operators[/doc][/td][/tr] - [tr][td]%=[/td][td][doc:selfarithmetic]Arithmetic self-operators[/doc][/td][/tr] - [tr][td]|=[/td][td][doc:selfbitwise]Bitwise self-operators[/doc][/td][/tr] - [tr][td]&=[/td][td][doc:selfbitwise]Bitwise self-operators[/doc][/td][/tr] - [tr][td]^=[/td][td][doc:selfbitwise]Bitwise self-operators[/doc][/td][/tr] - [tr][td]<<=[/td][td][doc:selfbitwise]Bitwise self-operators[/doc][/td][/tr] - [tr][td]>>=[/td][td][doc:selfbitwise]Bitwise self-operators[/doc][/td][/tr] - [tr][td].=[/td][td][doc:stringconcatenation]String concatenation operators[/doc][/td][/tr] - [tr][td]<<[/td][td][doc:stringconcatenation]String concatenation operators[/doc][/td][/tr] - [tr][td]<,[/td][td][doc:stringconcatenation]String concatenation operators[/doc][/td][/tr] - [tr][td]<+[/td][td][doc:arrayconcatenation]Array concatenation[/doc][/td][/tr] - [tr][td]=~[/td][td][doc:binding]Binding operator[/doc][/td][/tr] - [/table] - */ - -KviKvsTreeNodeData * KviKvsParser::parseBindingOperationParameter() -{ - KviPointerList<KviKvsTreeNodeData> * l = new KviPointerList<KviKvsTreeNodeData>; - l->setAutoDelete(true); - - const QChar * pBegin = KVSP_curCharPointer; - - for(;;) - { - switch(KVSP_curCharUnicode) - { - case 0: - case '/': - case '\n': - case '\r': - // not a part of a parameter - goto end_of_function_parameter; - break; - case '$': - case '%': - { - // this may be a data reference - KviKvsTreeNodeData * p = parseParameterPercentOrDollar(); - if(!p) - { - // this is an error - delete l; - return 0; - } - l->append(p); - } - break; - case '"': - { - // this is a string - KviKvsTreeNodeData * p = parseStringParameter(); - if(!p) - { - // this is an error - delete l; - return 0; - } - l->append(p); - } - break; - default: - { - // anything else is a literal - l->append(parseBindingOperationLiteralParameter()); - } - break; - } - } -end_of_function_parameter: - if(l->count() > 1) - { - // complex parameter needed - return new KviKvsTreeNodeCompositeData(pBegin,l); - } else { - // a single parameter in the list or empty list at all - l->setAutoDelete(false); - KviKvsTreeNodeData * p = l->first(); - delete l; - if(!p)p = new KviKvsTreeNodeConstantData(KVSP_curCharPointer,new KviKvsVariant(QString(""))); - return p; - } - // never reached - return 0; -} - - - -KviKvsTreeNodeOperation * KviKvsParser::parseBindingOperation() -{ - // t or tr or y - // s - const QChar * pBegin = KVSP_curCharPointer; - - while(KVSP_curCharIsLetter)KVSP_skipChar; - - QString szOp = QString(pBegin,KVSP_curCharPointer - pBegin).lower(); - - skipSpaces(); - - if(KVSP_curCharUnicode != '/') - { - error(KVSP_curCharPointer,__tr2qs("Found character '%q' (unicode %x) where a slash '/' was expected"),KVSP_curCharPointer,KVSP_curCharUnicode); - return 0; - } - - KVSP_skipChar; - - KviKvsTreeNodeData * pFirst = parseBindingOperationParameter(); - if(!pFirst)return 0; - - if(KVSP_curCharIsEndOfCommand) - { - error(KVSP_curCharPointer,__tr2qs("Unexpected end of command in binding operation, at least two slashes are missing")); - delete pFirst; - return 0; - } - - if(KVSP_curCharUnicode != '/') - { - error(KVSP_curCharPointer,__tr2qs("Found character '%q' (unicode %x) where a slash '/' was expected"),KVSP_curCharPointer,KVSP_curCharUnicode); - delete pFirst; - return 0; - } - - KVSP_skipChar; - - KviKvsTreeNodeData * pSecond = parseBindingOperationParameter(); - if(!pSecond) - { - delete pFirst; - return 0; - } - - if(KVSP_curCharIsEndOfCommand) - { - error(KVSP_curCharPointer,__tr2qs("Unexpected end of command in binding operation, at least one slash is missing")); - delete pFirst; - return 0; - } - - if(KVSP_curCharUnicode != '/') - { - error(KVSP_curCharPointer,__tr2qs("Found character '%q' (unicode %x) where a slash '/' was expected"),KVSP_curCharPointer,KVSP_curCharUnicode); - delete pFirst; - return 0; - } - - KVSP_skipChar; - - KviKvsTreeNodeData * pThird = parseCommandParameter(); - if(!pThird) - { - if(error()) - { - delete pFirst; - delete pSecond; - return 0; - } - - pThird = new KviKvsTreeNodeConstantData(KVSP_curCharPointer,new KviKvsVariant(QString(""))); - } - - while(!KVSP_curCharIsEndOfCommand)KVSP_skipChar; - if(!KVSP_curCharIsEndOfBuffer)KVSP_skipChar; - - if((szOp == "t") || (szOp == "tr") || (szOp == "y")) - { - // transliteration tr/szFirst/szSecond/szFlags - return new KviKvsTreeNodeOperationStringTransliteration(pBegin,pFirst,pSecond,pThird); - } else if(szOp == "s") - { - // regexp substitution s/szFirst/szSecond/szFlags - return new KviKvsTreeNodeOperationStringSubstitution(pBegin,pFirst,pSecond,pThird); - } - - error(KVSP_curCharPointer,__tr2qs("Unknown binding operation '%Q'"),&szOp); - return 0; -} - - -KviKvsTreeNodeOperation * KviKvsParser::parseOperation() -{ - // find the operator - const QChar * pBegin = KVSP_curCharPointer; - - switch(KVSP_curCharUnicode) - { - case '=': - { - KVSP_skipChar; - if(KVSP_curCharUnicode == '~') - { - KVSP_skipChar; - skipSpaces(); - if(KVSP_curCharIsEndOfCommand) - { - error(KVSP_curCharPointer,__tr2qs("Missing right side operand for the binding operator '=~'")); - return 0; - } - return parseBindingOperation(); - } else { - skipSpaces(); - KviKvsTreeNodeData * d = parseOperationRightSide(true); - if(!d)return 0; // error - return new KviKvsTreeNodeOperationAssignment(pBegin,d); - } - } - break; - case '+': - KVSP_skipChar; - switch(KVSP_curCharUnicode) - { - case '+': - // operator ++ - KVSP_skipChar; - skipSpaces(); - if(!KVSP_curCharIsEndOfCommand) - { - warning(KVSP_curCharPointer,__tr2qs("Trailing garbage ignored after operator '++'")); - } - while(!KVSP_curCharIsEndOfCommand)KVSP_skipChar; - if(!KVSP_curCharIsEndOfBuffer)KVSP_skipChar; - return new KviKvsTreeNodeOperationIncrement(pBegin); - break; - case '=': - // operator += - KVSP_skipChar; - skipSpaces(); - if(KVSP_curCharIsEndOfCommand) - { - error(KVSP_curCharPointer,__tr2qs("Missing right operand for operator '+='")); - return 0; - } - KviKvsTreeNodeData * d = parseOperationRightSide(true); - if(!d)return 0; // error - return new KviKvsTreeNodeOperationSelfSum(pBegin,d); - break; - } - break; - case '-': - KVSP_skipChar; - switch(KVSP_curCharUnicode) - { - case '-': - KVSP_skipChar; - // operator -- - skipSpaces(); - if(!KVSP_curCharIsEndOfCommand) - { - warning(KVSP_curCharPointer,__tr2qs("Trailing garbage ignored after operator '--'")); - } - while(!KVSP_curCharIsEndOfCommand)KVSP_skipChar; - if(!KVSP_curCharIsEndOfBuffer)KVSP_skipChar; - return new KviKvsTreeNodeOperationDecrement(pBegin); - break; - case '>': - warning(KVSP_curCharPointer,__tr2qs("This looks a lot like an object handle dereferencing operator '->' but in fact it isn't. Maybe you forgot a '$' just after ?")); - break; - case '=': - // operator -= - KVSP_skipChar; - skipSpaces(); - if(KVSP_curCharIsEndOfCommand) - { - error(KVSP_curCharPointer,__tr2qs("Missing right operand for operator '-='")); - return 0; - } - KviKvsTreeNodeData * d = parseOperationRightSide(true); - if(!d)return 0; // error - return new KviKvsTreeNodeOperationSelfSubtraction(pBegin,d); - break; - } - break; - case '<': - KVSP_skipChar; - switch(KVSP_curCharUnicode) - { - case '<': - KVSP_skipChar; - if(KVSP_curCharUnicode == '=') - { - KVSP_skipChar; - skipSpaces(); - if(KVSP_curCharIsEndOfCommand) - { - error(KVSP_curCharPointer,__tr2qs("Missing right operand for operator '<<='")); - return 0; - } - KviKvsTreeNodeData * d = parseOperationRightSide(true); - if(!d)return 0; // error - return new KviKvsTreeNodeOperationSelfShl(pBegin,d); - } else { - skipSpaces(); - if(KVSP_curCharIsEndOfCommand) - { - error(KVSP_curCharPointer,__tr2qs("Missing right operand for operator '<<'")); - return 0; - } - KviKvsTreeNodeData * d = parseOperationRightSide(); - if(!d)return 0; // error - return new KviKvsTreeNodeOperationStringAppendWithSpace(pBegin,d); - } - break; - case ',': - { - KVSP_skipChar; - skipSpaces(); - if(KVSP_curCharIsEndOfCommand) - { - error(KVSP_curCharPointer,__tr2qs("Missing right operand for operator '<,'")); - return 0; - } - KviKvsTreeNodeData * d = parseOperationRightSide(); - if(!d)return 0; // error - return new KviKvsTreeNodeOperationStringAppendWithComma(pBegin,d); - } - break; - case '+': - { - KVSP_skipChar; - skipSpaces(); - if(KVSP_curCharIsEndOfCommand) - { - error(KVSP_curCharPointer,__tr2qs("Missing right operand for operator '<+'")); - return 0; - } - KviKvsTreeNodeData * d = parseOperationRightSide(); - if(!d)return 0; // error - return new KviKvsTreeNodeOperationArrayAppend(pBegin,d); - } - break; - } - break; - case '>': - KVSP_skipChar; - switch(KVSP_curCharUnicode) - { - case '>': - KVSP_skipChar; - if(KVSP_curCharUnicode == '=') - { - KVSP_skipChar; - skipSpaces(); - if(KVSP_curCharIsEndOfCommand) - { - error(KVSP_curCharPointer,__tr2qs("Missing right operand for operator '>>='")); - return 0; - } - KviKvsTreeNodeData * d = parseOperationRightSide(true); - if(!d)return 0; // error - return new KviKvsTreeNodeOperationSelfShr(pBegin,d); - } - break; - } - break; - case '.': - KVSP_skipChar; - switch(KVSP_curCharUnicode) - { - case '=': - KVSP_skipChar; - skipSpaces(); - if(KVSP_curCharIsEndOfCommand) - { - error(KVSP_curCharPointer,__tr2qs("Missing right operand for operator '.='")); - return 0; - } - KviKvsTreeNodeData * d = parseOperationRightSide(); - if(!d)return 0; // error - return new KviKvsTreeNodeOperationStringAppend(pBegin,d); - break; - } - break; -#define SELF_OPERATOR(__opchar,__opstr,__class) \ - case __opchar: \ - KVSP_skipChar; \ - switch(KVSP_curCharUnicode) \ - { \ - case '=': \ - KVSP_skipChar; \ - skipSpaces(); \ - if(KVSP_curCharIsEndOfCommand) \ - { \ - error(KVSP_curCharPointer,__tr2qs("Missing right operand for operator '" __opstr "='")); \ - return 0; \ - } \ - KviKvsTreeNodeData * d = parseOperationRightSide(true); \ - if(!d)return 0; \ - return new __class(pBegin,d); \ - break; \ - } \ - break; - SELF_OPERATOR('*',"*",KviKvsTreeNodeOperationSelfMultiplication) - SELF_OPERATOR('/',"/",KviKvsTreeNodeOperationSelfDivision) - SELF_OPERATOR('%',"%",KviKvsTreeNodeOperationSelfModulus) - SELF_OPERATOR('|',"|",KviKvsTreeNodeOperationSelfOr) - SELF_OPERATOR('&',"&",KviKvsTreeNodeOperationSelfAnd) - SELF_OPERATOR('^',"^",KviKvsTreeNodeOperationSelfXor) - } - - error(pBegin,__tr2qs("Unknown operator")); - return 0; -} - -KviKvsTreeNodeInstruction * KviKvsParser::parseVoidFunctionCallOrOperation() -{ - KVSP_ASSERT((KVSP_curCharUnicode == '$') || (KVSP_curCharUnicode == '%') || (KVSP_curCharUnicode == '@')); - - const QChar * pBegin = KVSP_curCharPointer; - - KviKvsTreeNodeData * r = parsePercentOrDollar(); - - if(!r) - { - // must be an error - return 0; - } - - skipSpaces(); - - if(KVSP_curCharIsEndOfCommand) - { - // the end of the command - if(!r->isFunctionCall()) - { - if(r->isReadOnly()) - { - warning(pBegin,__tr2qs("Unexpected (and senseless) read-only data evaluation")); - error(KVSP_curCharPointer,__tr2qs("Syntax error: confused by earlier errors: bailing out")); - } else { - error(KVSP_curCharPointer,__tr2qs("Unexpected end of script after a variable reference: expected operator")); - } - delete r; - return 0; - } else { - if(!KVSP_curCharIsEndOfBuffer)KVSP_skipChar; - return new KviKvsTreeNodeVoidFunctionCall(r->location(),(KviKvsTreeNodeFunctionCall *)r); - } - } - - // not the end of a command : an operation - if(r->isReadOnly()) - { - // must be followed by the end of a command - if(r->isFunctionCall()) - { - error(KVSP_curCharPointer,__tr2qs("Unexpected character '%q' (unicode %x) after a void function call: end of instruction expected"),KVSP_curCharPointer,KVSP_curCharUnicode); - } else { - warning(pBegin,__tr2qs("Unexpected (and senseless) read-only data evaluation")); - warning(pBegin,__tr2qs("Unexpected character '%q' (unicode %x)"),KVSP_curCharPointer,KVSP_curCharUnicode); - error(KVSP_curCharPointer,__tr2qs("Syntax error: confused by earlier errors: bailing out")); - } - delete r; - return 0; - } - - // ok.. parse the operation - KviKvsTreeNodeOperation * op = parseOperation(); - if(!op) - { - delete r; - return 0; - } - - op->setTargetVariableReference(r); - return op; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_parser_macros.h b/3.4.0/src/kvirc/kvs/kvi_kvs_parser_macros.h deleted file mode 100644 index fc5bf7159e..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_parser_macros.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _KVI_KVS_PARSER_MACROS_H_ -#define _KVI_KVS_PARSER_MACROS_H_ -//============================================================================= -// -// File : kvi_kvs_parser_macros.h -// Creation date : Sun 5 Ocr 2003 20.25 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 KVSP_skipChar m_ptr++ -#define KVSP_skipNChars(n) m_ptr += n -#define KVSP_backChar m_ptr-- -#define KVSP_backNChars(n) m_ptr -= n - -#define KVSP_curCharUnicode (m_ptr->unicode()) -#define KVSP_curCharPointer m_ptr - -#define KVSP_curCharIsLetter (m_ptr->isLetter()) -#define KVSP_curCharIsNumber (m_ptr->isNumber()) -#define KVSP_curCharIsLetterOrNumber (m_ptr->isLetterOrNumber()) -#define KVSP_curCharIsFunctionStart (m_ptr->isLetterOrNumber() || (m_ptr->unicode() == '(') || (m_ptr->unicode() == '{') || (m_ptr->unicode() == '$')) -#define KVSP_curCharIsEndOfCommand ((m_ptr->unicode() == ';') || (m_ptr->unicode() == 0) || (m_ptr->unicode() == '\n') || (m_ptr->unicode() == '\r')) -#define KVSP_curCharIsEndOfBuffer (m_ptr->unicode() == 0) - -#define KVSP_setCurCharPointer(_ptr) m_ptr = _ptr - -#define KVSP_ASSERT(_x) if(!(_x))debug("WARNING : ASSERT FAILED: (%s) IS FALSE AT %s:%d",#_x,__FILE__,__LINE__); - - -#endif //!_KVI_KVS_PARSER_MACROS_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_parser_specialcommands.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_parser_specialcommands.cpp deleted file mode 100644 index 756cd25f2a..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_parser_specialcommands.cpp +++ /dev/null @@ -1,1988 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_parser_specialcommands.cpp -// Creation date : Thu 06 Now 2003 14.14 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - - -#include "kvi_kvs_parser.h" - -#include "kvi_kvs_treenode.h" - -#include "kvi_kvs_report.h" -#include "kvi_kvs_kernel.h" - -#include "kvi_kvs_parser_macros.h" -#include "kvi_kvs_object_functionhandler.h" - -#include "kvi_locale.h" - -#include "kvi_cmdformatter.h" - - -KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandPerlBegin() -{ - // in fact this is not a fully special command - // it is special only in the sense of parsing. - // Once parsed, the command is routed to the perl module - // with the perl code as FIRST parameter and the other parameters - // of the command following. - // the help page for perl.begin is in the perl module - - // perl.begin(context) <perl code> perl.end - // - - const QChar * pBegin = KVSP_curCharPointer; - - skipSpaces(); - KviKvsTreeNodeDataList * dl; - if(KVSP_curCharUnicode == '(') - { - dl = parseCommaSeparatedParameterList(); - if(!dl)return 0; - } else { - dl = new KviKvsTreeNodeDataList(pBegin); - } - - //while(!KVSP_curCharIsEndOfCommand)KVSP_skipChar; - if(!KVSP_curCharIsEndOfBuffer)KVSP_skipChar; - - if(!skipSpacesAndNewlines()) - { - delete dl; - return 0; - } - - // allow a ';' after perl.begin - if(KVSP_curCharIsEndOfCommand && !KVSP_curCharIsEndOfBuffer) - { - KVSP_skipChar; - if(!skipSpacesAndNewlines()) - { - delete dl; - return 0; - } - } - - const QChar * pPerlBegin = KVSP_curCharPointer; - - // now look for perl.end[terminator] - static QString szPerlEnd("perl.end"); - const QChar * pPerlEnd; - for(;;) - { - while(KVSP_curCharUnicode && (KVSP_curCharUnicode != 'p') && (KVSP_curCharUnicode != 'P')) - KVSP_skipChar; - if(KVSP_curCharIsEndOfBuffer) - { - delete dl; - error(KVSP_curCharPointer,__tr2qs("Unexpected end of command buffer while looking for the \"perl.end\" statement")); - return 0; - } - pPerlEnd = KVSP_curCharPointer; - if(KviQString::equalCIN(szPerlEnd,KVSP_curCharPointer,8)) - { - KVSP_skipNChars(8); - if(KVSP_curCharIsEndOfCommand || (KVSP_curCharUnicode == ' ') || (KVSP_curCharUnicode == '\t')) - { - // yeah! - QString szPerl(pPerlBegin,pPerlEnd - pPerlBegin); - dl->prependItem(new KviKvsTreeNodeConstantData(pPerlBegin,new KviKvsVariant(szPerl))); - while(!KVSP_curCharIsEndOfCommand)KVSP_skipChar; - if(!KVSP_curCharIsEndOfBuffer)KVSP_skipChar; - break; - } else { - KVSP_backNChars(7); - } - } else { - KVSP_skipChar; - } - } - - return new KviKvsTreeNodeModuleSimpleCommand(pBegin,"perl","begin",dl); -} - -KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandBreak() -{ - /* - @doc: break - @type: - command - @title: - break - @syntax: - break - @short: - Interrupts an iteration loop - @description: - Interrupts an iteration loop like [cmd]while[/cmd].[br] - This command always jumps out of a single code block.[br] - If called outside an iteration loop , will act just like [cmd]halt[/cmd] - has been called but has no additional semantics for events.[br] - */ - const QChar * pBegin = KVSP_curCharPointer; // FIXME: this is not accurate at all : it may be even the end of the cmd - skipSpaces(); - if(!KVSP_curCharIsEndOfCommand) - { - warning(KVSP_curCharPointer,__tr2qs("Trailing garbage at the end of the break command: ignored")); - } - - while(!KVSP_curCharIsEndOfCommand)KVSP_skipChar; - if(!KVSP_curCharIsEndOfBuffer)KVSP_skipChar; - return new KviKvsTreeNodeSpecialCommandBreak(pBegin); -} - -KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandUnset() -{ - /* - @doc: unset - @type: - command - @title: - unset - @syntax: - unset <variable_list> - @keyterms: - unsetting variables - @short: - Unsets a set of variables - @description: - Unsets the specified list of comma separated variables. - It is equivalent to assigning the default empty value - to each variable on its own: just does it all at aonce. - Note that KVIrc automatically frees the local variable memory - when they go out of scope and the global variable memory - when KVIrc terminates. - @examples: - [example] - %a = pippo - %b = 1 - [cmd]echo[/cmd] %a %b - unset %a %b - [cmd]echo[/cmd] %a %b - [/example] - */ - - const QChar * pCmdBegin = KVSP_curCharPointer; - - KviPointerList<KviKvsTreeNodeVariable> * pVarList = new KviPointerList<KviKvsTreeNodeVariable>; - pVarList->setAutoDelete(true); - - while(KVSP_curCharUnicode == '%') - { - KviKvsTreeNodeVariable * d = parsePercent(); - if(!d)return 0; - - pVarList->append(d); - - skipSpaces(); - - if(KVSP_curCharUnicode == ',') - { - KVSP_skipChar; - skipSpaces(); - } - } - - if(!KVSP_curCharIsEndOfCommand) - { - warning(KVSP_curCharPointer,__tr2qs("The 'unset' command needs a variable list")); - error(KVSP_curCharPointer,__tr2qs("Found character %q (unicode %x) where a variable was expected"),KVSP_curCharPointer,KVSP_curCharUnicode); - return 0; - } - - if(!KVSP_curCharIsEndOfBuffer)KVSP_skipChar; - - if(pVarList->count() < 1) - { - delete pVarList; - warning(KVSP_curCharPointer,__tr2qs("'unset' command used without a variable list")); - return 0; // null unset ? - } - return new KviKvsTreeNodeSpecialCommandUnset(pCmdBegin,pVarList); -} - -KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandGlobal() -{ - /* - @doc: global - @type: - command - @title: - global - @syntax: - global <variable_list> - @keyterms: - explicitly declaring global variables - @short: - Explicitly declares global variables - @description: - Declares a list of global variables. - Once a variable has been declared as global - it refers to the global kvirc instance for the scope of the script. - Global variables are shared between scripts and keep their - value until they are explicitly unset or kvirc quits. - This command can be used to override the default behaviour of - declaring global variables by starting them with an uppercase letter - and declaring local variables by starting them with a lowercase one. - @examples: - global %a,%b,%c; - */ - while(KVSP_curCharUnicode == '%') - { - KVSP_skipChar; - const QChar * pBegin = KVSP_curCharPointer; - - - while((KVSP_curCharIsLetterOrNumber) || (KVSP_curCharUnicode == '_'))KVSP_skipChar; - - QString szIdentifier(pBegin,KVSP_curCharPointer - pBegin); - - if(!m_pGlobals) - { - m_pGlobals = new KviPointerHashTable<QString,QString>(17,false); - m_pGlobals->setAutoDelete(true); - } - m_pGlobals->replace(szIdentifier,new QString()); - - skipSpaces(); - - if(KVSP_curCharUnicode == ',') - { - KVSP_skipChar; - skipSpaces(); - } - } - - if(!KVSP_curCharIsEndOfCommand) - { - warning(KVSP_curCharPointer,__tr2qs("The 'global' command needs a variable list")); - error(KVSP_curCharPointer,__tr2qs("Found character %q (unicode %x) where a variable was expected"),KVSP_curCharPointer,KVSP_curCharUnicode); - return 0; - } - - if(!KVSP_curCharIsEndOfBuffer)KVSP_skipChar; - return 0; -} - -KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandClass() -{ - /* - @doc: class - @title: - class - @short: - Defines a new object class - @keyterms: - defining an object class - @type: - command - @syntax: - class(<classname:string>[,<base_class_name:string>]) - { - [internal] [function] <function_name>[([<parameter reminder>])] - { - <function body> - } - - ... - } - @description: - Defines a new implementation of the class <classname>. - If an implementation of that class was already existing - it is removed with all the derived classes (and all the instances of this class - and the derived ones are destroyed). - <base_class_name> is the name of the class that the - new class has to inherit from.[br] - If <base_class_name> is omitted, the new class inherits automatically - from [class:object]object[/class].[br] - Note:[br] - The keywords "function" and "event" that were used in KVIrc versions - previous to 3.0.0 have been removed since "useless".[br] - The function keyword, however, is still permitted. - The keyword "internal" is useful when you want to hide - certain function from the outside world. An internal function - cannot be called by anyone else but the object instance itself. Note that - this is different from the C++ "protected" or "private" keywords - that refer to the object's class instead of the object instance. - The <parameter reminder> part is an optional string - that can be used to sign the parameters that the function expects; - it acts as a programmer reminder or comment and it has no other - meaning in KVIrc scripting. The <parameter reminder> respects the syntax - of an expression, so it is terminated by a closed parenthesis. - It's rather dangerous to use this command inside an object - function handler: if the class definition <class> was already - existing and it is a parent of the object's class, you might - end up executing "inexisting" code.[br] - As a thumb rule, use this command only outside object function handlers.[br] - [br][br] - Only for the curious: implementing protected and private access - list on members would have a considerable runtime overhead because - of the strange nature of the KVS language. Object member calls - are resolved completly at runtime (and that permits a lot of funny tricks - like [cmd]privateimpl[/cmd]) but unfortunately this also forces us - to check access lists at runtime. Ok, this would be a relatively small footprint for the "private" - keyword where we need to run UP the called object inheritance hierarchy - but would have a significant performance footprint for the "protected" - keyword where we would need to traverse the WHOLE inheritance tree of the called and calling - objects... "internal" still allows hiding members in a lot of situations - and is really fast to verify at runtime: no inheritance tree traversal - is needed and only object pointers are compared. - @examples: - [example] - class(myclass,[class]object[/class]) - { - constructor - { - [cmd]echo[/cmd] Hey this is my constructor - [cmd]echo[/cmd] I have been just created - } - - destructor - { - [cmd]echo[/cmd] Ops...being destroyed - } - - sayHello(this function expects no parameters) - { - [cmd]echo[/cmd] Hello world! - } - } - [/example] - @seealso: - [cmd]privateimpl[/cmd], [cmd]killclass[/cmd], [cmd]clearobjects[/cmd], [fnc]$classDefined[/fnc](), - [doc:objects]Objects documentation[/doc] - */ - - if(KVSP_curCharUnicode != '(') - { - error(KVSP_curCharPointer,__tr2qs("Found character %q (unicode %x) where an open parenthesis was expected"),KVSP_curCharPointer,KVSP_curCharUnicode); - return 0; - } - - const QChar * pBegin = KVSP_curCharPointer; - - KviKvsTreeNodeDataList * l = parseCommaSeparatedParameterList(); - if(!l)return 0; - - KviKvsTreeNodeSpecialCommandClass * pClass = new KviKvsTreeNodeSpecialCommandClass(pBegin,l); - - if(!skipSpacesAndNewlines()) - { - delete pClass; - return 0; - } - - if(KVSP_curCharUnicode != '{') - { - errorBadChar(KVSP_curCharPointer,'{',"class"); - delete pClass; - return 0; - } - - KVSP_skipChar; - - if(!skipSpacesAndNewlines()) - { - delete pClass; - return 0; - } - - while(KVSP_curCharUnicode != '}') - { - if((KVSP_curCharUnicode == '#') || (KVSP_curCharUnicode == '/')) - { - parseComment(); - if(error()) - { - delete pClass; - return 0; - } - if(!skipSpacesAndNewlines()) - { - delete pClass; - return 0; - } - continue; - } - - const QChar * pLabelBegin = KVSP_curCharPointer; - - if(KVSP_curCharIsLetter) - { - KVSP_skipChar; - while(KVSP_curCharIsLetterOrNumber)KVSP_skipChar; - } - - if(KVSP_curCharIsEndOfBuffer) - { - error(KVSP_curCharPointer,__tr2qs("Unexpected end of buffer in class definition")); - delete pClass; - return 0; - } - - if(KVSP_curCharPointer == pLabelBegin) - { - error(KVSP_curCharPointer,__tr2qs("Found character %q (unicode %x) where a function name was expected"),KVSP_curCharPointer,KVSP_curCharUnicode); - delete pClass; - return 0; - } - - QString szLabel(pLabelBegin,KVSP_curCharPointer - pLabelBegin); - - unsigned int uHandlerFlags = 0; - - if(szLabel.lower() == "internal") - { - uHandlerFlags |= KviKvsObjectFunctionHandler::Internal; - skipSpaces(); - if(KVSP_curCharUnicode != '(') - { - pLabelBegin = KVSP_curCharPointer; - - while(KVSP_curCharIsLetterOrNumber)KVSP_skipChar; - - if(KVSP_curCharIsEndOfBuffer) - { - error(KVSP_curCharPointer,__tr2qs("Unexpected end of buffer in class definition")); - delete pClass; - return 0; - } - - if(KVSP_curCharPointer == pLabelBegin) - { - error(KVSP_curCharPointer,__tr2qs("Found character %q (unicode %x) where a function name was expected"),KVSP_curCharPointer,KVSP_curCharUnicode); - delete pClass; - return 0; - } - szLabel = QString(pLabelBegin,KVSP_curCharPointer - pLabelBegin); - } - } - - - if(szLabel.lower() == "function") - { - skipSpaces(); - if(KVSP_curCharUnicode != '(') - { - pLabelBegin = KVSP_curCharPointer; - - while(KVSP_curCharIsLetterOrNumber)KVSP_skipChar; - - if(KVSP_curCharIsEndOfBuffer) - { - error(KVSP_curCharPointer,__tr2qs("Unexpected end of buffer in class definition")); - delete pClass; - return 0; - } - - if(KVSP_curCharPointer == pLabelBegin) - { - error(KVSP_curCharPointer,__tr2qs("Found character %q (unicode %x) where a function name was expected"),KVSP_curCharPointer,KVSP_curCharUnicode); - delete pClass; - return 0; - } - szLabel = QString(pLabelBegin,KVSP_curCharPointer - pLabelBegin); - } - } - - if(!skipSpacesAndNewlines()) - { - delete pClass; - return 0; - } - - if(KVSP_curCharUnicode == '(') - { - while((!(KVSP_curCharIsEndOfBuffer)) && (KVSP_curCharUnicode != ')')) - KVSP_skipChar; - - if(KVSP_curCharIsEndOfBuffer) - { - error(KVSP_curCharPointer,__tr2qs("Unexpected end of buffer in function parameter list reminder")); - delete pClass; - return 0; - } - - KVSP_skipChar; - - if(!skipSpacesAndNewlines()) - { - delete pClass; - return 0; - } - } - - if(KVSP_curCharIsEndOfBuffer) - { - error(KVSP_curCharPointer,__tr2qs("Unexpected end of buffer in class definition")); - delete pClass; - return 0; - } - - if(KVSP_curCharUnicode != '{') - { - errorBadChar(KVSP_curCharPointer,'{',"class"); - delete pClass; - return 0; - } - - pBegin = KVSP_curCharPointer; - KviKvsTreeNodeInstruction * pInstruction = parseInstruction(); - if(!pInstruction) - { - // may be an empty instruction - if(error()) - { - delete pClass; - return 0; - } - } - delete pInstruction; - int iLen = KVSP_curCharPointer - pBegin; - QString szInstruction; - if(iLen > 0) - { - szInstruction = QString(pBegin,KVSP_curCharPointer - pBegin); - KviCommandFormatter::bufferFromBlock(szInstruction); - } - - pClass->addFunctionDefinition(new KviKvsTreeNodeSpecialCommandClassFunctionDefinition(pLabelBegin,szLabel,szInstruction,uHandlerFlags)); - - if(!skipSpacesAndNewlines()) - { - delete pClass; - return 0; - } - } - - KVSP_skipChar; - - return pClass; -} - - -KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandWhile() -{ - /* - @doc: while - @type: - command - @title: - while - @syntax: - while (<condition>) <command> - @keyterms: - iteration commands, flow control commands - @short: - Iteration command - @description: - Executes <command> while the <condition> evaluates - to true (non zero result).[br] - <command> may be either a single command or a block of commands.[br] - It can contain the [cmd]break[/cmd] command: in that case the - execution of the <command> will be immediately interrupted and the control - transferred to the command following this while block.[br] - It is valid for <command> to be an empty command terminated with a ';'. - <condition> is an expression as the ones evaluated by [doc:expressioneval]$(*)[/doc] - with the following extensions:[br] - If <condition> is a string, its length is evaluated: in this way a non-empty string - causes the <condition> to be true, an empty string causes it to be false.[br] - If <condition> is an array, its size is evaluated: in this way a non-empty array - causes the <condition> to be true, an empty array causes it to be false.[br] - If <condition> is a hash, the number of its entries is evaluated: in this way a non-empty hash - causes the <condition> to be true, an empty hash causes it to be false.[br] - @examples: - [example] - %i = 0; - while(%i < 100)%i++ - while(%i > 0) - { - %i -= 10 - if(%i < 20)break; - } - echo %i - [/example] - */ - - if(KVSP_curCharUnicode != '(') - { - warning(KVSP_curCharPointer,__tr2qs("The while command needs an expression enclosed in parenthesis")); - error(KVSP_curCharPointer,__tr2qs("Found character %q (unicode %x) where an open parenthesis was expected"),KVSP_curCharPointer,KVSP_curCharUnicode); - return 0; - } - - const QChar * pBegin = KVSP_curCharPointer; - - KVSP_skipChar; - - KviKvsTreeNodeExpression * e = parseExpression(')'); - if(!e) - { - // must be an error - return 0; - } - - if(!skipSpacesAndNewlines()) - { - delete e; - return 0; - } - - if(KVSP_curCharUnicode == 0) - { - warning(pBegin,__tr2qs("The last while command in the buffer has no conditional instructions: it's senseless")); - warning(KVSP_curCharPointer,__tr2qs("Unexpected end of script while looking for the instruction block of the while command")); - } - - KviKvsTreeNodeInstruction * i = parseInstruction(); - if(!i) - { - if(error()) - { - delete e; - return 0; - } - } // else , just an empty instruction - - return new KviKvsTreeNodeSpecialCommandWhile(pBegin,e,i); -} - -KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandDo() -{ - /* - @doc: do - @type: - command - @title: - do - @syntax: - do <command> while (<condition>) - @keyterms: - iteration commands, flow control commands - @short: - Iteration command - @description: - Executes <command> once then evaluates the <condition>. - If <condition> evaluates to true (non zero result) then repeats the execution again.[br] - <command> may be either a single command or a block of commands.[br] - It can contain the [cmd]break[/cmd] command: in that case the - execution of the <command> will be immediately interrupted and the control - transferred to the command following this while block.[br] - It is valid for <command> to be an empty command terminated with a ';'. - <condition> is an expression as the ones evaluated by [doc:expressioneval]$(*)[/doc] - with the following extensions:[br] - If <condition> is a string, its length is evaluated: in this way a non-empty string - causes the <condition> to be true, an empty string causes it to be false.[br] - If <condition> is an array, its size is evaluated: in this way a non-empty array - causes the <condition> to be true, an empty array causes it to be false.[br] - If <condition> is a hash, the number of its entries is evaluated: in this way a non-empty hash - causes the <condition> to be true, an empty hash causes it to be false.[br] - @examples: - [example] - %i = 0; - do %i++; while(%i < 100); - echo "After first execution: %i"; - %i = 10 - do { - echo "Executed!"; - %i++; - } while(%i < 1) - echo "After second execution: %i"; - [/example] - @seealso: - [cmd]while[/cmd] - */ - - const QChar * pBegin = KVSP_curCharPointer; - - KviKvsTreeNodeInstruction * i = parseInstruction(); - if(!i) - { - if(error())return 0; - } - - if(!skipSpacesAndNewlines()) - { - if(i)delete i; - return 0; - } - - static const unsigned short while_chars[10] = { 'W','w','H','h','I','i','L','l','E','e' }; - - for(int j=0;j<10;j++) - { - if(KVSP_curCharUnicode != while_chars[j]) - { - j++; - if(KVSP_curCharUnicode != while_chars[j]) - { - if(KVSP_curCharIsEndOfBuffer) - error(KVSP_curCharPointer,__tr2qs("Unexpected end of command after the 'do' command block: expected 'while' keyword")); - else - error(KVSP_curCharPointer,__tr2qs("Found character %q (unicode %x) where a 'while' keyword was expected"),KVSP_curCharPointer,KVSP_curCharUnicode); - if(i)delete i; - return 0; - } - } else j++; - KVSP_skipChar; - } - - if(!skipSpacesAndNewlines()) - { - if(i)delete i; - return 0; - } - - if(KVSP_curCharUnicode != '(') - { - warning(KVSP_curCharPointer,__tr2qs("The 'while' block of the 'do' command needs an expression enclosed in parenthesis")); - errorBadChar(KVSP_curCharPointer,'(',"do"); - if(i)delete i; - return 0; - } - - KVSP_skipChar; - - KviKvsTreeNodeExpression * e = parseExpression(')'); - if(!e) - { - // must be an error - if(i)delete i; - return 0; - } - - skipSpaces(); - - if(!KVSP_curCharIsEndOfCommand) - { - warning(KVSP_curCharPointer,__tr2qs("Garbage string after the expression in 'do' command: ignored")); - while(!KVSP_curCharIsEndOfCommand)KVSP_skipChar; - } - - if(!KVSP_curCharIsEndOfBuffer)KVSP_skipChar; - - return new KviKvsTreeNodeSpecialCommandDo(pBegin,e,i); -} - - - - -KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandIf() -{ - /* - @doc: if - @type: - command - @title: - if - @syntax: - if (<condition>) <command1> [else <command2>] - @keyterms: - conditional commands, flow control commands - @short: - Flow control command - @description: - Executes <command1> if the <condition> evaluates - to true (non zero result). - If the "else part" is given <command2> is executed - if the <condition> evaluates to false (result == '0') - <condition> is an expression as the ones evaluated by [doc:expressioneval]$(*)[/doc] - with the following extensions:[br] - If <condition> is a string, its length is evaluated: in this way a non-empty string - causes the <condition> to be true, an empty string causes it to be false.[br] - If <condition> is an array, its size is evaluated: in this way a non-empty array - causes the <condition> to be true, an empty array causes it to be false.[br] - If <condition> is a hash, the number of its entries is evaluated: in this way a non-empty hash - causes the <condition> to be true, an empty hash causes it to be false.[br] - @examples: - if(%a != 10)[cmd]echo[/cmd] \%a was != 10 - else [cmd]echo[/cmd] \%a was 10! - */ - - if(KVSP_curCharUnicode != '(') - { - warning(KVSP_curCharPointer,__tr2qs("The 'if' command needs an expression enclosed in parenthesis")); - errorBadChar(KVSP_curCharPointer,'(',"if"); - return 0; - } - - const QChar * pBegin = KVSP_curCharPointer; - - KVSP_skipChar; - - - KviKvsTreeNodeExpression * e = parseExpression(')'); - if(!e) - { - // must be an error - return 0; - } - - if(!skipSpacesAndNewlines()) - { - delete e; - return 0; - } - - if(KVSP_curCharUnicode == 0) - { - warning(pBegin,__tr2qs("The last if command in the buffer has no conditional instructions: it's senseless")); - warning(KVSP_curCharPointer,__tr2qs("Unexpected end of script while looking for the instruction block of the if command")); - } - - KviKvsTreeNodeInstruction * i = parseInstruction(); - if(!i) - { - if(error()) - { - delete e; - return 0; - } - } // else , just an empty instruction - - if(!skipSpacesAndNewlines()) - { - if(i)delete i; - return 0; - } - - const QChar * pElse = KVSP_curCharPointer; - - if((KVSP_curCharUnicode != 'e') && (KVSP_curCharUnicode != 'E')) - return new KviKvsTreeNodeSpecialCommandIf(pBegin,e,i,0); - KVSP_skipChar; - if((KVSP_curCharUnicode != 'l') && (KVSP_curCharUnicode != 'L')) - { - KVSP_setCurCharPointer(pElse); - return new KviKvsTreeNodeSpecialCommandIf(pBegin,e,i,0); - } - KVSP_skipChar; - if((KVSP_curCharUnicode != 's') && (KVSP_curCharUnicode != 'S')) - { - KVSP_setCurCharPointer(pElse); - return new KviKvsTreeNodeSpecialCommandIf(pBegin,e,i,0); - } - KVSP_skipChar; - if((KVSP_curCharUnicode != 'e') && (KVSP_curCharUnicode != 'E')) - { - KVSP_setCurCharPointer(pElse); - return new KviKvsTreeNodeSpecialCommandIf(pBegin,e,i,0); - } - KVSP_skipChar; - if(KVSP_curCharIsLetterOrNumber) - { - if((KVSP_curCharUnicode == 'i') || (KVSP_curCharUnicode == 'I')) - { - KVSP_skipChar; - if((KVSP_curCharUnicode == 'f') || (KVSP_curCharUnicode == 'F')) - { - KVSP_skipChar; - if(!KVSP_curCharIsLetterOrNumber) - { - // this is an "elseif" - KVSP_backChar; - KVSP_backChar; - // point to if - goto handle_else_instruction; - } - KVSP_backChar; - } - KVSP_backChar; - } - - KVSP_setCurCharPointer(pElse); - return new KviKvsTreeNodeSpecialCommandIf(pBegin,e,i,0); - } - -handle_else_instruction: - if(!skipSpacesAndNewlines()) - { - delete e; - if(i)delete i; - return 0; - } - - KviKvsTreeNodeInstruction * i2 = parseInstruction(); - if(!i2) - { - if(error()) - { - delete e; - if(i)delete i; - return 0; - } - } // else , just an empty instruction - - return new KviKvsTreeNodeSpecialCommandIf(pBegin,e,i,i2); -} - -bool KviKvsParser::skipToEndOfForControlBlock() -{ - bool bInString = false; - int iParLevel = 0; - - for(;;) - { - switch(KVSP_curCharUnicode) - { - case '"': - bInString = !bInString; - KVSP_skipChar; - break; - case '(': - if(!bInString)iParLevel++; - KVSP_skipChar; - break; - case ')': - if(!bInString) - { - if(iParLevel == 0)return true; - else iParLevel--; - } - KVSP_skipChar; - break; - case 0: - error(KVSP_curCharPointer,__tr2qs("Unexpected end of buffer while looking for the closing ')' in the 'for' command")); - return false; - break; - //case '\n': - // that's ok.. it may have a parenthesis on the next line - //KVSP_skipChar; - //break; - default: - KVSP_skipChar; - break; - } - } - // not reached - KVSP_ASSERT(false); - return false; -} - -KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandFor() -{ - /* - @doc: for - @type: - command - @title: - for - @syntax: - for (<initialization>;<condition>;<update>) <command> - @keyterms: - iterational control commands - @short: - Iteration control command - @description: - Executes <initialization> once then runs the following iteration loop: - if <condition> evaluates to true then <command> is executed followed - by the <update> command. The iteration is repeated until <condition> evaluates to false.[br] - <condition> is an expression as the ones evaluated by [doc:expressioneval]$(*)[/doc] - with the following extensions:[br] - If <condition> is a string, its length is evaluated: in this way a non-empty string - causes the <condition> to be true, an empty string causes it to be false.[br] - If <condition> is an array, its size is evaluated: in this way a non-empty array - causes the <condition> to be true, an empty array causes it to be false.[br] - If <condition> is a hash, the number of its entries is evaluated: in this way a non-empty hash - causes the <condition> to be true, an empty hash causes it to be false.[br] - @examples: - for(%a = 0;%a < 100;%a++)echo %a - */ - - if(KVSP_curCharUnicode != '(') - { - warning(KVSP_curCharPointer,__tr2qs("The 'for' command needs an expression enclosed in parenthesis")); - errorBadChar(KVSP_curCharPointer,'(',"for"); - return 0; - } - - const QChar * pForBegin = KVSP_curCharPointer; - - KVSP_skipChar; - - skipSpaces(); - - KviKvsTreeNodeInstruction * i1 = parseInstruction(); - if(!i1) - { - if(error())return 0; - } // else just empty instruction - - skipSpaces(); - - KviKvsTreeNodeExpression * e = parseExpression(';'); - if(!e) - { - if(error()) - { - if(i1)delete i1; - return 0; - } - } // else just empty expression : assume true - - skipSpaces(); - - // skip to the first non matching ')' that is not in a string - - const QChar * pBegin = KVSP_curCharPointer; - - if(!skipToEndOfForControlBlock()) - { - if(error()) // <-- that's always true - { - if(i1)delete i1; - if(e)delete e; - return 0; - } - } - - - // HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK - // KVSP_curCharPointer is const! - // we shouldn't be able to modify it - QChar cSave = *(KVSP_curCharPointer); - - QChar * pHack = (QChar *)KVSP_curCharPointer; - *pHack = QChar('\n'); - - KVSP_curCharPointer = pBegin; - - KviKvsTreeNodeInstruction * i2 = parseInstruction(); - *pHack = cSave; - - KVSP_setCurCharPointer(pHack); - // EOF HACK EOF HACK EOF HACK EOF HACK EOF HACK EOF HACK EOF HACK - - - if(!i2) - { - if(error()) - { - if(i1)delete i1; - if(e)delete e; - return 0; - } - } // else just empty instruction - - skipSpaces(); - - if(KVSP_curCharUnicode != ')') - { - error(KVSP_curCharPointer,__tr2qs("Found char %q (unicode %x) while looking for the terminating ')' in 'for' command"),KVSP_curCharPointer,KVSP_curCharUnicode); - if(i1)delete i1; - if(e)delete e; - if(i2)delete i2; - return 0; - } - - KVSP_skipChar; - - if(!skipSpacesAndNewlines()) - { - if(i1)delete i1; - if(e)delete e; - if(i2)delete i2; - return 0; - } - - KviKvsTreeNodeInstruction * loop = parseInstruction(); - if(!loop) - { - if(error()) - { - if(i1)delete i1; - if(e)delete e; - if(i2)delete i2; - return 0; - } - - if((!i1) && (!e) && (!i2)) - { - error(pForBegin,__tr2qs("Empty infinite 'for' loop: fix the script")); - if(i1)delete i1; - if(e)delete e; - if(i2)delete i2; - return 0; - } - } // else just an empty instruction - - return new KviKvsTreeNodeSpecialCommandFor(pForBegin,i1,e,i2,loop); -} - - - -KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandForeach() -{ - /* - @doc: foreach - @type: - command - @title: - foreach - @syntax: - foreach [-a] (<variable>,[<item>[,<item>[,<item>[...]]]) <command> - @keyterms: - iteration commands, flow control commands - @switches: - !sw: -a | --all - Include empty variables in the iteration loop. - @short: - Iteration command - @description: - Executed <command> while assigning to <variable> each <item>.[br] - <item> may be a constant , a variable , an array , a dictionary or a function returning - either a constant string an array reference or a dictionary reference.[br] - If <item> is an array , a dictionary or a function that returns a dictionary or array reference - the iteration is done through all the dictionary/array items.[br] - Please note that the iteration order of dictionary items is undefined.[br] - You can always break from the loop by using the [cmd]break[/cmd] command.[br] - foreach doesn't iterate over empty scalar variables (i.e. the ones set to [fnc]$nothing[/fnc]) - unless you use the -a switch. (Note that an array with *some* empty entries is NOT empty so - the iteration is in fact done). - @examples: - [example] - foreach(%i,1,2,3,4,5,6,7,8,9)[cmd]echo[/cmd] %i - foreach(%chan,[fnc]$window.list[/fnc](channel))[cmd]me[/cmd] -r=%chan This is a test! - [comment]# This will work too, and will do the same job[/comment] - %windows[] = [fnc]$window.list[/fnc](channel) - foreach(%chan,%windows[])[cmd]me[/cmd] -r=%chan This is a test! - [comment]# And this too[/comment] - %windows[] = [fnc]$window.list[/fnc](channel) - foreach(%key,[fnc]$keys[/fnc](%windows[]))[cmd]me[/cmd] -r=%windows[%key] This is a test! - [comment]# Another interesting example[/comment] - [cmd]alias[/cmd](test){ [cmd]return[/cmd] [fnc]$hash[/fnc](1,a,2,b,3,c,4,d); }; - foreach(%x,[fnc]$keys[/fnc]($test)){ [cmd]echo[/cmd] %x, $test{%x}; } - [/example] - */ - - if(KVSP_curCharUnicode != '(') - { - warning(KVSP_curCharPointer,__tr2qs("The 'foreach' command needs an expression enclosed in parenthesis")); - errorBadChar(KVSP_curCharPointer,'(',"foreach"); - return 0; - } - - const QChar * pForeachBegin = KVSP_curCharPointer; - - KVSP_skipChar; - - skipSpaces(); - - - if((KVSP_curCharUnicode != '%') && (KVSP_curCharUnicode != '$') && (KVSP_curCharUnicode != '@')) - { - warning(KVSP_curCharPointer,__tr2qs("The 'foreach' command expects a writeable iteration variable as first parameter")); - error(KVSP_curCharPointer,__tr2qs("Found character '%q' (unicode %x) where '%' or '$' was expected: see /help foreach for the command syntax"),KVSP_curCharPointer,KVSP_curCharUnicode); - return 0; - } - - KviKvsTreeNodeData * d = parsePercentOrDollar(); - if(!d)return 0; - - if(d->isFunctionCall() || d->isReadOnly()) - { - warning(KVSP_curCharPointer,__tr2qs("The 'foreach' command expects a writeable iteration variable as first parameter")); - if(d->isFunctionCall()) - error(KVSP_curCharPointer,__tr2qs("Unexpected function call as 'foreach' iteration variable")); - else - error(KVSP_curCharPointer,__tr2qs("Unexpected read-only variable as 'foreach' iteration variable")); - delete d; - return 0; - } - - skipSpaces(); - if(KVSP_curCharUnicode != ',') - { - if(KVSP_curCharUnicode == ')') - { - error(KVSP_curCharPointer,__tr2qs("Unexpected end of 'foreach' parameters: at least one iteration data argument must be given")); - delete d; - return 0; - } - warning(KVSP_curCharPointer,__tr2qs("The 'foreach' command expects a comma separated list of iteration data items after the first parameter")); - errorBadChar(KVSP_curCharPointer,',',"foreach"); - return 0; - } - - KviKvsTreeNodeDataList * l = parseCommaSeparatedParameterList(); - if(!l)return 0; - - if(!skipSpacesAndNewlines()) - { - delete d; - delete l; - return 0; - } - - const QChar * pLoopBegin = KVSP_curCharPointer; - - KviKvsTreeNodeInstruction * loop = parseInstruction(); - if(!loop) - { - if(error())return 0; - warning(pLoopBegin,__tr2qs("Found empty 'foreach' execution block: maybe you need to fix your script ?")); - loop = new KviKvsTreeNodeInstructionBlock(pLoopBegin); - } - - return new KviKvsTreeNodeSpecialCommandForeach(pForeachBegin,d,l,loop); -} - - -KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandSwitch() -{ - /* - @doc: switch - @type: - command - @title: - switch - @syntax: - switch(<expression>) - { - case(<value>)[:]<command> - [break] - case(<value>)[:]<command> - [break] - .... - match(<wildcard_expression>)[:]<command> - [break] - .... - regexp(<regular_expression>)[:]<command> - [break] - .... - case(<value>)[:]<command> - [break] - .... - default[:]<command> - [break] - } - @short: - Another flow control command - @description: - The switch command is based on the standard C 'switch' keyword. - It executes conditionally groups of commands choosen from - a larger set of command groups.[br] - First <expression> is evaluated (<expression> is any arithmetic or string expression).[br] - Then the 'match','regexp','case' and 'default' labels are evaluated sequentially - in the order of appearance.[br] - [b]case(<value>)[:]<command>[/b][br] - The <value> is evaluated and is compared against the result of <expression>. - The comparison is case insensitive (if the values are strings).[br] - If <value> is equal to <expression> then <command> is executed. - Please note that <command> must be either a single instruction or an instruction block [b]enclosed in braces[/b]. - If <command> contains a [cmd]break[/cmd] statement inside or if [cmd]break[/cmd] - is specified just after the <command> then the execution of the switch is terminated - otherwise the nex label is evaluated.[br] - [b]match(<value>)[:]<command>[/b][br] - The <value> is expected to be a wildcard expression (containing '*' and '?' wildcards) - that is matched against <expression>.[br] - If there is a match (a complete case insensitive match!) then the related <command> - is executed. [cmd]brea[/cmd] is treated just like in the case label.[br] - [b]regexp(<value>)[:]<command>[/b][br] - The <value> is expected to be a complete standard regular expression - that is matched agains <expression>.[br] - If there is a match (a complete case insensitive match!) then the related <command> - is executed. [cmd]brea[/cmd] is treated just like in the case label.[br] - [b]default[:]<command>[/b][br] - The default label is executed unconditionally (unless there was a previous label - that terminated the execution with break).[br] - @examples: - [comment]# Try to change the 1 below to 2 or 3 to see the results[/comment] - %tmp = 1 - switch(%tmp) - { - case(1): - echo \%tmp was 1! - break; - case(2) - echo \%tmp was 2! - break; - default: - echo \%tmp was not 1 nor 2: it was %tmp! - break; - } - [comment]# A complexier example: change the 1 in 2 or 3[/comment] - %tmp = 1 - switch(%tmp) - { - case(1): - echo \%tmp was 1! - case(2) - echo \%tmp was 2! - break; - default: - echo \%tmp was either 1 or something different from 2 (%tmp) - break; - } - [comment]# An example with strings[/comment] - %tmp = "This is a test" - %tmp2 = "This is not a test" - switch(%tmp) - { - case(%tmp2) - echo \%tmp == \%tmp2 - break; - case(%tmp) - { - # do not break here - echo "Yeah.. it's stupid.. \%tmp == \%tmp :D" - } - match("*TEST"): - echo "Matched *TEST" - regexp("[a-zA-Z ]*test"): - echo "Matched [a-zA-Z ]*text" - regexp("[a-zA-Z ]*not[a-zA-Z ]*"): - echo "Matched [a-zA-Z ]*not[a-zA-Z ]*" - default: - echo This is executed anyway (unless some break was called) - break; - } - */ - - if(KVSP_curCharUnicode != '(') - { - warning(KVSP_curCharPointer,__tr2qs("The 'switch' command needs an expression enclosed in parenthesis")); - errorBadChar(KVSP_curCharPointer,'(',"switch"); - return 0; - } - - const QChar * pBegin = KVSP_curCharPointer; - - KVSP_skipChar; - - KviKvsTreeNodeExpression * e = parseExpression(')'); - if(!e) - { - // must be an error - return 0; - } - - if(!skipSpacesAndNewlines()) - { - delete e; - return 0; - } - - if(KVSP_curCharUnicode != '{') - { - errorBadChar(KVSP_curCharPointer,'{',"switch"); - delete e; - return 0; - } - - KVSP_skipChar; - - if(!skipSpacesAndNewlines()) - { - delete e; - return 0; - } - - KviKvsTreeNodeSpecialCommandSwitch * pSwitch = new KviKvsTreeNodeSpecialCommandSwitch(pBegin,e); - - KviKvsTreeNodeSpecialCommandSwitchLabel * pLabel = 0; - - while(KVSP_curCharUnicode != '}') - { - // look for a 'case','match','default' or 'regexpr' label - - const QChar * pLabelBegin = KVSP_curCharPointer; - while(KVSP_curCharIsLetter)KVSP_skipChar; - - if(KVSP_curCharIsEndOfBuffer) - { - error(KVSP_curCharPointer,__tr2qs("Unexpected end of buffer in switch condition block")); - delete pSwitch; - return 0; - } - - if(KVSP_curCharPointer == pLabelBegin) - { - error(KVSP_curCharPointer,__tr2qs("Found character %q (unicode %x) where a 'case','match','regexp','default' or 'break' label was expected"),KVSP_curCharPointer,KVSP_curCharUnicode); - delete pSwitch; - return 0; - } - - QString szLabel(pLabelBegin,KVSP_curCharPointer - pLabelBegin); - QString szLabelLow = szLabel.lower(); - - bool bNeedParam = true; - - if(szLabelLow == "case") - { - pLabel = new KviKvsTreeNodeSpecialCommandSwitchLabelCase(pLabelBegin); - } else if(szLabelLow == "match") - { - pLabel = new KviKvsTreeNodeSpecialCommandSwitchLabelMatch(pLabelBegin); - } else if(szLabelLow == "regexp") - { - pLabel = new KviKvsTreeNodeSpecialCommandSwitchLabelRegexp(pLabelBegin); - } else if(szLabelLow == "default") - { - pLabel = new KviKvsTreeNodeSpecialCommandSwitchLabelDefault(pLabelBegin); - bNeedParam = false; - } else if(szLabelLow == "break") - { - if(pLabel) - { - pLabel->setTerminatingBreak(true); - skipSpaces(); - if(KVSP_curCharUnicode == ';')KVSP_skipChar; - if(!skipSpacesAndNewlines()) - { - delete pSwitch; - delete pLabel; - return 0; - } - continue; - } else { - error(pLabelBegin,__tr2qs("Found 'break' label where a 'case','match','regexp' or 'default' label was expected")); - delete pSwitch; - return 0; - } - } else { - error(pLabelBegin,__tr2qs("Found token '%Q' where a 'case','match','regexp','default' or 'break' label was expected"),&szLabel); - delete pSwitch; - return 0; - } - - if(bNeedParam) - { - skipSpaces(); - if(KVSP_curCharUnicode != '(') - { - errorBadChar(KVSP_curCharPointer,'(',"switch"); - delete pSwitch; - delete pLabel; - return 0; - } - KVSP_skipChar; - - KviKvsTreeNodeData * pParameter = parseSingleParameterInParenthesis(); - if(!pParameter) - { - delete pSwitch; - delete pLabel; - return 0; - } - - pLabel->setParameter(pParameter); - } - - skipSpaces(); - if(KVSP_curCharUnicode == ':')KVSP_skipChar; - if(!skipSpacesAndNewlines()) - { - delete pSwitch; - delete pLabel; - return 0; - } - - KviKvsTreeNodeInstruction * pInstruction = parseInstruction(); - if(!pInstruction) - { - // may be an empty instruction - if(error()) - { - delete pSwitch; - delete pLabel; - return 0; - } - } - - pLabel->setInstruction(pInstruction); - pSwitch->addLabel(pLabel); - - if(!skipSpacesAndNewlines()) - { - delete pSwitch; - return 0; - } - } - - KVSP_skipChar; - - if(pSwitch->isEmpty()) - { - error(pBegin,__tr2qs("Senseless empty switch command: fix the script")); - delete pSwitch; - return 0; - } - - return pSwitch; -} - -KviKvsTreeNodeSpecialCommandDefpopupLabelPopup * KviKvsParser::parseSpecialCommandDefpopupLabelPopup() -{ - if(KVSP_curCharUnicode != '{') - { - errorBadChar(KVSP_curCharPointer,'{',"defpopup"); - return 0; - } - - KviKvsTreeNodeSpecialCommandDefpopupLabelPopup * pPopup = new KviKvsTreeNodeSpecialCommandDefpopupLabelPopup(KVSP_curCharPointer); - - KVSP_skipChar; - - if(!skipSpacesAndNewlines()) - { - delete pPopup; - return 0; - } - - while(KVSP_curCharUnicode != '}') - { - // look for 'label', 'prologue', 'epilogue', 'popup', 'item', 'separator' or 'extpopup' label - const QChar * pLabelBegin = KVSP_curCharPointer; - while(KVSP_curCharIsLetter)KVSP_skipChar; - - if(KVSP_curCharIsEndOfBuffer) - { - error(KVSP_curCharPointer,__tr2qs("Unexpected end of buffer in defpopup block")); - delete pPopup; - return 0; - } - - if(KVSP_curCharPointer == pLabelBegin) - { - error(KVSP_curCharPointer,__tr2qs("Found character %q (unicode %x) where a 'prologue','separator','label','popup','item','extpopup' or 'epilogue' label was expected"),KVSP_curCharPointer,KVSP_curCharUnicode); - delete pPopup; - return 0; - } - - QString szLabel(pLabelBegin,KVSP_curCharPointer - pLabelBegin); - QString szLabelLow = szLabel.lower(); - - KviPointerList<QString> * pParameters = 0; - - QString szCondition; - - -#define EXTRACT_POPUP_LABEL_PARAMETERS \ - if(!skipSpacesAndNewlines()) \ - { \ - delete pPopup; \ - return 0; \ - } \ - if(KVSP_curCharUnicode != '(') \ - { \ - errorBadChar(KVSP_curCharPointer,'(',"defpopup"); \ - delete pPopup; \ - return 0; \ - } \ - pParameters = parseCommaSeparatedParameterListNoTree(); \ - if(!pParameters)return 0; - - -#define EXTRACT_POPUP_LABEL_CONDITION \ - if(!skipSpacesAndNewlines()) \ - { \ - delete pPopup; \ - return 0; \ - } \ - if(KVSP_curCharUnicode == '(') \ - { \ - const QChar * pBegin = KVSP_curCharPointer; \ - KVSP_skipChar; \ - KviKvsTreeNodeExpression * pExpression = parseExpression(')'); \ - if(!pExpression) \ - { \ - if(pParameters)delete pParameters; \ - delete pPopup; \ - return 0; \ - } \ - int cLen = (KVSP_curCharPointer - pBegin) - 2; \ - if(cLen > 0) \ - { \ - szCondition.setUnicode(pBegin + 1,cLen); \ - } \ - delete pExpression; \ - if(!skipSpacesAndNewlines()) \ - { \ - if(pParameters)delete pParameters; \ - delete pPopup; \ - return 0; \ - } \ - } - - - - if((szLabelLow == "prologue") || (szLabelLow == "epilogue")) - { - ///////////////////////////////////////////////////////////////////////////////////////////////// - bool bPrologue = (szLabelLow == "prologue"); - if(!skipSpacesAndNewlines()) - { - delete pPopup; - return 0; - } - - if(KVSP_curCharUnicode == '(') - { - EXTRACT_POPUP_LABEL_PARAMETERS - if(!skipSpacesAndNewlines()) - { - if(pParameters)delete pParameters; - delete pPopup; - return 0; - } - } - const QChar * pBegin = KVSP_curCharPointer; - KviKvsTreeNodeInstruction * pInstruction = parseInstruction(); - if(pInstruction) - { - // in fact we don't need it at all, we just need the code buffer... - delete pInstruction; - } else { - // may be an empty instruction - if(error()) - { - // error - if(pParameters)delete pParameters; - delete pPopup; - return 0; - } - // empty instruction - if(bPrologue) - warning(pBegin,__tr2qs("Found empty prologue block: maybe you need to fix the script?")); - else - warning(pBegin,__tr2qs("Found empty epilogue block: maybe you need to fix the script?")); - } - int iLen = KVSP_curCharPointer - pBegin; - if(iLen > 0) - { - QString szInstruction(pBegin,KVSP_curCharPointer - pBegin); - KviCommandFormatter::bufferFromBlock(szInstruction); - QString * pItemName = pParameters ? pParameters->first() : 0; - QString szItemName = pItemName ? *pItemName : QString::null; - if(bPrologue) - pPopup->addLabel(new KviKvsTreeNodeSpecialCommandDefpopupLabelPrologue(pLabelBegin,szInstruction,szItemName)); - else - pPopup->addLabel(new KviKvsTreeNodeSpecialCommandDefpopupLabelEpilogue(pLabelBegin,szInstruction,szItemName)); - } // else the instruction was empty anyway: we don't need it in fact - if(pParameters)delete pParameters; - } else if(szLabelLow == "separator") - { - // FIXME: Separators can't have labels here :((((( - ///////////////////////////////////////////////////////////////////////////////////////////////// - EXTRACT_POPUP_LABEL_CONDITION - if(KVSP_curCharUnicode == ';')KVSP_skipChar; - QString szItemName = "dummySeparator"; // <------- FIXME! - pPopup->addLabel(new KviKvsTreeNodeSpecialCommandDefpopupLabelSeparator(pLabelBegin,szCondition,szItemName)); - - } else if(szLabelLow == "label") - { - ///////////////////////////////////////////////////////////////////////////////////////////////// - EXTRACT_POPUP_LABEL_PARAMETERS - EXTRACT_POPUP_LABEL_CONDITION - - QString * pText = pParameters->first(); - if(!pText) - { - error(pLabelBegin,__tr2qs("Unexpected empty <text> field in label parameters. See /help defpopup for the syntax")); - delete pParameters; - delete pPopup; - return 0; - } - QString * pIcon = pParameters->next(); - if(KVSP_curCharUnicode == ';')KVSP_skipChar; - QString * pItemName = pParameters->next(); - pPopup->addLabel(new KviKvsTreeNodeSpecialCommandDefpopupLabelLabel(pLabelBegin,szCondition,*pText,pIcon ? *pIcon : QString::null,pItemName ? *pItemName : QString::null)); - delete pParameters; - } else if(szLabelLow == "popup") - { - ///////////////////////////////////////////////////////////////////////////////////////////////// - EXTRACT_POPUP_LABEL_PARAMETERS - EXTRACT_POPUP_LABEL_CONDITION - - QString * pText = pParameters->first(); - if(!pText) - { - error(pLabelBegin,__tr2qs("Unexpected empty <text> field in extpopup parameters. See /help defpopup for the syntax")); - delete pParameters; - delete pPopup; - return 0; - } - QString * pIcon = pParameters->next(); - QString * pItemName = pParameters->next(); - - KviKvsTreeNodeSpecialCommandDefpopupLabelPopup * pSubPopup = parseSpecialCommandDefpopupLabelPopup(); - if(!pSubPopup) - { - delete pParameters; - delete pPopup; - return 0; - } - - pSubPopup->setCondition(szCondition); - pSubPopup->setText(*pText); - pSubPopup->setItemName(pItemName ? *pItemName : QString::null); - if(pIcon)pSubPopup->setIcon(*pIcon); - pPopup->addLabel(pSubPopup); - delete pParameters; - } else if(szLabelLow == "item") - { - ///////////////////////////////////////////////////////////////////////////////////////////////// - EXTRACT_POPUP_LABEL_PARAMETERS - EXTRACT_POPUP_LABEL_CONDITION - - QString * pText = pParameters->first(); - if(!pText) - { - error(pLabelBegin,__tr2qs("Unexpected empty <text> field in extpopup parameters. See /help defpopup for the syntax")); - delete pParameters; - delete pPopup; - return 0; - } - QString * pIcon = pParameters->next(); - QString * pItemName = pParameters->next(); - - const QChar * pBegin = KVSP_curCharPointer; - KviKvsTreeNodeInstruction * pInstruction = parseInstruction(); - if(pInstruction) - { - // in fact we don't need it: we just need the code block - delete pInstruction; - } else { - // empty instruction or error ? - if(error()) - { - // error - delete pParameters; - delete pPopup; - return 0; - } - // empty instruction - warning(pBegin,__tr2qs("Found empty instruction for popup item: maybe you need to fix the script?")); - } - int iLen = KVSP_curCharPointer - pBegin; - if(iLen > 0) - { - QString szInstruction(pBegin,KVSP_curCharPointer - pBegin); - KviCommandFormatter::bufferFromBlock(szInstruction); - pPopup->addLabel(new KviKvsTreeNodeSpecialCommandDefpopupLabelItem(pLabelBegin,szCondition,*pText,pIcon ? *pIcon : QString::null,szInstruction,pItemName ? *pItemName : QString::null)); - } else { - // zero length instruction, but still add the item - QString szInstruction = ""; - KviCommandFormatter::bufferFromBlock(szInstruction); - pPopup->addLabel(new KviKvsTreeNodeSpecialCommandDefpopupLabelItem(pLabelBegin,szCondition,*pText,pIcon ? *pIcon : QString::null,szInstruction,pItemName ? *pItemName : QString::null)); - } - delete pParameters; - } else if(szLabelLow == "extpopup") - { - ///////////////////////////////////////////////////////////////////////////////////////////////// - EXTRACT_POPUP_LABEL_PARAMETERS - EXTRACT_POPUP_LABEL_CONDITION - - QString * pText = pParameters->first(); - if(!pText) - { - error(pLabelBegin,__tr2qs("Unexpected empty <text> field in extpopup parameters. See /help defpopup for the syntax")); - delete pParameters; - delete pPopup; - return 0; - } - QString * pName = pParameters->next(); - if(!pName) - { - error(pLabelBegin,__tr2qs("Unexpected empty <name> field in extpopup parameters. See /help defpopup for the syntax")); - delete pParameters; - delete pPopup; - return 0; - } - QString * pIcon = pParameters->next(); - QString * pItemName = pParameters->next(); - if(KVSP_curCharUnicode == ';')KVSP_skipChar; - pPopup->addLabel(new KviKvsTreeNodeSpecialCommandDefpopupLabelExtpopup(pLabelBegin,szCondition,*pText,pIcon ? *pIcon : QString::null,*pName,pItemName ? *pItemName : QString::null)); - delete pParameters; - } else { - ///////////////////////////////////////////////////////////////////////////////////////////////// - error(pLabelBegin,__tr2qs("Found token '%Q' where a 'prologue','separator','label','popup','item','extpopup' or 'epilogue' label was expected"),&szLabel); - delete pPopup; - return 0; - } - - if(!skipSpacesAndNewlines()) - { - delete pPopup; - return 0; - } - } - - KVSP_skipChar; - return pPopup; -} - - -KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandDefpopup() -{ - // FIXME: This SHOULD be renamed to popup.create (NOT popup.define!) - // and internally aliased to defpopup as backward compat - // There should be then also popup.destroy etc.. - - /* - @doc: defpopup - @type: - command - @title: - defpopup - @syntax: - defpopup [-m] (<popup_name>) - { - prologue[(<id>)] <prologue_command> - - epilogue[(<id>)] <epilogue_command> - - label(<text>[,<id>])[(<expression>)][;] - - item(<text>[,<icon>[,<id>]])[(<expression>)]<command> - - popup(<text>[,<icon>[,<id>]])[(<expression>)] - { - <popup body> - } - - extpopup(<text>,<name>[,<icon>[,<id>]])[(<expression>)][;] - - separator[(<expression>)][;] - ... - } - @short: - Defines a popup menu - @switches: - !sw: -m | --merge - Merges the new popup contents with an older popup version - @description: - Defines the popup menu <popup_name>. If the -m switch is NOT used - the previous contents of the popups are cleared, otherwise are preserved.[br] - The popup is generated 'on the fly' when the [cmd]popup[/cmd] command - is called.[br] - The 'item' keyword adds a menu item with visible <text> , - the optional <icon> and <command> as code to be executed when the item - is clicked. <text> is a string that is evaluated at [cmd]popup[/cmd] - call time and may contain identifiers and variables. If <expression> - is given, it is evaluated at [cmd]popup[/cmd] call time and if the result - is 0, the item is not shown in the physical popup.[br] - The 'popup' keyword adds a submenu with visible <text> , the optional - <icon> and a popup body that follows exactly the same syntax - as the defpopup body. The <expression> has the same meaning as with the - 'item' keyword.[br] - The 'extpopup' keyword adds a submenu with visible <text> , the optional - icon and a popup body that is defined by the popup menu <name>. This - basically allows to nest popup menus and define their parts separately. - <icon> and <expression> have the same meaning as with the 'item' keyword.[br] - The 'separator' keyword adds a straight line between items (separator).[br] - The 'label' keywork adds a descriptive label that acts like a separator.[br] - The 'prologue' keyword adds a <prologue_command> to be executed - just before the popup is filled at [cmd]popup[/cmd] command call.[br] - The 'epilogue' keyword adds an <epilogue_command> to be executed - just after the popup has been filled at [cmd]popup[/cmd] command call.[br] - There can be multiple prologue and epilogue commands: their execution order - is undefined.[br] - <icon> is always an [doc:image_id]image identifier[/doc].[br] - <id> is an unique identifier that can be used to remove single items - by the means of [cmd]delpopupitem[/cmd]. If <id> is omitted - then it is automatically generated. - Please note that using this command inside the prologue , epilogue - or item code of the modified popup menu is forbidden. - In other words: self modification of popup menus is NOT allowed.[br] - To remove a popup menu use this command with an empty body:[br] - [example] - defpopup(test){} - [/example] - This will remove the popup 'test' and free its memory. - Popups have a special kind of local variables that have an extended lifetime: - these are called "extended scope variables" and are described in the [doc:data_structures]Data structures documentation[/doc].[br] - The syntax for these variables is:[br] - [b]%:<variable name>[/b][br] - These variables are visible during all the "visible lifetime" of the popup: - from the [cmd]popup[/cmd] command call to the moment in that the user selects an item - and the corresponding code is executed (substantially from a [cmd]popup[/cmd] call to the next one).[br] - This allows you to pre-calculate data and conditions in the porologue of the popup - and then use it in the item handlers or item conditions.[br] - @seealso: - [cmd]popup[/cmd] - @examples: - */ - - if(KVSP_curCharUnicode != '(') - { - warning(KVSP_curCharPointer,__tr2qs("The 'defpopup' command needs an expression enclosed in parenthesis")); - errorBadChar(KVSP_curCharPointer,'(',"defpopup"); - return 0; - } - - const QChar * pBegin = KVSP_curCharPointer; - - KVSP_skipChar; - - KviKvsTreeNodeData * pPopupName = parseSingleParameterInParenthesis(); - if(!pPopupName)return 0; - - if(!skipSpacesAndNewlines()) - { - delete pPopupName; - return 0; - } - - KviKvsTreeNodeSpecialCommandDefpopupLabelPopup * pMainPopup = parseSpecialCommandDefpopupLabelPopup(); - if(!pMainPopup) - { - delete pPopupName; - return 0; - } - - return new KviKvsTreeNodeSpecialCommandDefpopup(pBegin,pPopupName,pMainPopup); -} - - -KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandHelp() -{ - // again not a fully special command: this routine just returns - // a CoreSimpleCommand but parses the parameters as constants - - // we handle a single big parameter, with whitespace stripped - // This is because we want the identifiers to be preserved - // as unevaluated (i.e $function). - - skipSpaces(); - - const QChar * pBegin = KVSP_curCharPointer; - while(!KVSP_curCharIsEndOfCommand)KVSP_skipChar; - - if(!KVSP_curCharIsEndOfBuffer)KVSP_skipChar; - - QString tmp(pBegin,KVSP_curCharPointer - pBegin); - tmp.stripWhiteSpace(); - - const QString szHelpName("help"); - - KviKvsCoreSimpleCommandExecRoutine * r = KviKvsKernel::instance()->findCoreSimpleCommandExecRoutine(szHelpName); - if(!r)return 0; // <--- internal error! - - KviKvsTreeNodeDataList * p = new KviKvsTreeNodeDataList(pBegin); - p->addItem(new KviKvsTreeNodeConstantData(pBegin,new KviKvsVariant(tmp))); - - return new KviKvsTreeNodeCoreSimpleCommand(pBegin,szHelpName,p,r); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_popupmanager.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_popupmanager.cpp deleted file mode 100644 index e04d9033cd..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_popupmanager.cpp +++ /dev/null @@ -1,117 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_popupmanager.cpp -// Created on Tue 7 Jan 2004 02:11:41 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_popupmanager.h" -#include "kvi_locale.h" -#include "kvi_config.h" - -KviKvsPopupManager * KviKvsPopupManager::m_pInstance = 0; - -KviKvsPopupManager::KviKvsPopupManager() -{ - m_pInstance = this; - m_pPopupDict = new KviPointerHashTable<QString,KviKvsPopupMenu>(17,false); - m_pPopupDict->setAutoDelete(true); -} - -KviKvsPopupManager::~KviKvsPopupManager() -{ - delete m_pPopupDict; -} - -void KviKvsPopupManager::init() -{ - if(KviKvsPopupManager::instance()) - { - debug("WARNING: Trying to create the KviKvsPopupManager twice!"); - return; - } - (void)new KviKvsPopupManager(); -} - -void KviKvsPopupManager::done() -{ - if(!KviKvsPopupManager::instance()) - { - debug("WARNING: Trying to destroy the KviKvsPopupManager twice!"); - return; - } - delete KviKvsPopupManager::instance(); -} - -KviKvsPopupMenu * KviKvsPopupManager::get(const QString &szPopupName) -{ - KviKvsPopupMenu * m = lookup(szPopupName); - if(!m) - { - m = new KviKvsPopupMenu(szPopupName); - add(szPopupName,m); - } - return m; -} - -void KviKvsPopupManager::load(const QString &szFileName) -{ - m_pPopupDict->clear(); - KviConfig cfg(szFileName,KviConfig::Read); - - KviConfigIterator it(*(cfg.dict())); - - KviPointerList<QString> l; - l.setAutoDelete(true); - - while(it.current()) - { - l.append(new QString(it.currentKey())); - ++it; - } - - for(QString * s = l.first();s;s = l.next()) - { - cfg.setGroup(*s); - KviKvsPopupMenu * m = new KviKvsPopupMenu(*s); - m->load("",&cfg); - m_pPopupDict->insert(*s,m); - //++it; - } -} - -void KviKvsPopupManager::save(const QString &szFileName) -{ - KviConfig cfg(szFileName,KviConfig::Write); - cfg.clear(); - - KviPointerHashTableIterator<QString,KviKvsPopupMenu> it(*m_pPopupDict); - while(it.current()) - { - cfg.setGroup(it.current()->popupName()); - it.current()->save("",&cfg); - ++it; - } -} - - - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_popupmanager.h b/3.4.0/src/kvirc/kvs/kvi_kvs_popupmanager.h deleted file mode 100644 index ae8aa514e0..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_popupmanager.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef _KVI_KVS_POPUPMANAGER_H_ -#define _KVI_KVS_POPUPMANAGER_H_ -//============================================================================= -// -// File : kvi_kvs_popupmanager.h -// Created on Tue 7 Jan 2004 02:11:41 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_popupmenu.h" - -class KVIRC_API KviKvsPopupManager -{ -protected: // can only be created by init/done - KviKvsPopupManager(); - ~KviKvsPopupManager(); -protected: - KviPointerHashTable<QString,KviKvsPopupMenu> * m_pPopupDict; - static KviKvsPopupManager * m_pInstance; -public: - static KviKvsPopupManager * instance(){ return m_pInstance; }; - static void init(); - static void done(); - int popupCount(){ return m_pPopupDict->count(); }; - - KviPointerHashTable<QString,KviKvsPopupMenu> * popupDict(){ return m_pPopupDict; }; - - KviKvsPopupMenu * lookup(const QString &szPopupName){ return m_pPopupDict->find(szPopupName); }; - KviKvsPopupMenu * get(const QString &szPopupName); - void add(const QString &szPopupName,KviKvsPopupMenu * pPopup){ m_pPopupDict->replace(szPopupName,pPopup); }; - void remove(const QString &szPopupName){ m_pPopupDict->remove(szPopupName); }; - void clear(){ m_pPopupDict->clear(); }; - - void save(const QString & filename); - void load(const QString & filename); -}; - - -#endif //!_KVI_KVS_POPUPMANAGER_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_popupmenu.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_popupmenu.cpp deleted file mode 100644 index 6c3daf8d92..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_popupmenu.cpp +++ /dev/null @@ -1,1234 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_popupmenu.cpp -// Created on Wed 07 Jan 2004 05:02:57 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_popupmenu.h" -#include "kvi_locale.h" -#include "kvi_iconmanager.h" -#include "kvi_out.h" -#include "kvi_app.h" -#include "kvi_kvs_popupmanager.h" -#include "kvi_console.h" -#include "kvi_config.h" -#include "kvi_cmdformatter.h" -#include "kvi_options.h" - -// popup names - -// rootname : the root popup -// rootname.anonymousmenuX : child popups with no name -// rootname.externalrootname : child popups copied from external menus -// rootname.itemX : child items -// rootname.separatorX : child separators -// rootname.labelX : child labels - - -KviKvsPopupMenuItem::KviKvsPopupMenuItem(Type t,const QString &szItemName,const QString &szCondition) -{ - m_szItemName = szItemName; - m_eType = t; - if(szCondition.isEmpty()) - { - // true by default - m_pKvsCondition = 0; - } else { - QString szName = "condition callback for "; - szName += szItemName; - m_pKvsCondition = new KviKvsScript(szName,szCondition,KviKvsScript::Expression); - } -} - -KviKvsPopupMenuItem::KviKvsPopupMenuItem(Type t,const QString &szItemName,const KviKvsScript * pCondition) -{ - m_szItemName = szItemName; - m_eType = t; - if(!pCondition) - { - // true by default - m_pKvsCondition = 0; - } else { - m_pKvsCondition = new KviKvsScript(*pCondition); - } -} - - -KviKvsPopupMenuItem::~KviKvsPopupMenuItem() -{ - if(m_pKvsCondition)delete m_pKvsCondition; -} - -void KviKvsPopupMenuItem::clear() -{ -} - -KviKvsScript * KviKvsPopupMenuItem::kvsIcon() -{ - return 0; -} - -KviKvsScript * KviKvsPopupMenuItem::kvsText() -{ - return 0; -} - -KviKvsScript * KviKvsPopupMenuItem::kvsCode() -{ - return 0; -} - -bool KviKvsPopupMenuItem::evaluateCondition(KviKvsPopupMenuTopLevelData * pData) -{ - if(!m_pKvsCondition)return true; - KviKvsVariant vRet; - - if(!m_pKvsCondition->run(pData->window(), - pData->parameters(), - &vRet, - KviKvsScript::PreserveParams, - pData->extendedRunTimeData())) - { - // broken condition - pData->window()->output(KVI_OUT_PARSERWARNING,__tr2qs("Broken condition in menu setup: assuming false")); - return false; - } - return vRet.asBoolean(); -} - - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -KviKvsPopupMenuItemSeparator::KviKvsPopupMenuItemSeparator(const QString &szItemName,const QString &szCondition) -: KviKvsPopupMenuItem(KviKvsPopupMenuItem::Separator,szItemName,szCondition) -{ -} - -KviKvsPopupMenuItemSeparator::KviKvsPopupMenuItemSeparator(const QString &szItemName,const KviKvsScript * pCondition) -: KviKvsPopupMenuItem(KviKvsPopupMenuItem::Separator,szItemName,pCondition) -{ -} - -KviKvsPopupMenuItemSeparator::~KviKvsPopupMenuItemSeparator() -{ -} - -void KviKvsPopupMenuItemSeparator::fill(KviKvsPopupMenu * pMenu,KviKvsPopupMenuTopLevelData * pData,int iIdx) -{ - if(!evaluateCondition(pData))return; - pMenu->insertSeparator(); -} - -KviKvsPopupMenuItem * KviKvsPopupMenuItemSeparator::clone() const -{ - return new KviKvsPopupMenuItemSeparator(m_szItemName,m_pKvsCondition); -} - - -///////////////////////////////////////////////////////////////////////////////////////////////////////// - - -KviKvsPopupMenuItemWithTextAndIcon::KviKvsPopupMenuItemWithTextAndIcon(KviKvsPopupMenuItem::Type t,const QString &szItemName,const QString &szText,const QString &szIcon,const QString &szCondition) -: KviKvsPopupMenuItem(t,szItemName,szCondition) -{ - QString szName = "text callback for "; - szName += szItemName; - m_pKvsText = new KviKvsScript(szName,szText,KviKvsScript::Parameter); - - if(szIcon.isEmpty()) - { - m_pKvsIcon = 0; - } else { - szName = "icon callback for "; - szName += szItemName; - m_pKvsIcon = new KviKvsScript(szName,szIcon,KviKvsScript::Parameter); - } -} - -KviKvsPopupMenuItemWithTextAndIcon::KviKvsPopupMenuItemWithTextAndIcon(KviKvsPopupMenuItem::Type t,const QString &szItemName,const KviKvsScript * pText,const KviKvsScript * pIcon,const KviKvsScript * pCondition) -: KviKvsPopupMenuItem(t,szItemName,pCondition) -{ - if(pText) - { - m_pKvsText = new KviKvsScript(*pText); - } else { - // hum.. this should never happen anyway - QString szName = "text callback for "; - szName += szItemName; - m_pKvsText = new KviKvsScript(szName,"",KviKvsScript::Parameter); - } - - if(!pIcon) - { - m_pKvsIcon = 0; - } else { - m_pKvsIcon = new KviKvsScript(*pIcon); - } -} - - -KviKvsPopupMenuItemWithTextAndIcon::~KviKvsPopupMenuItemWithTextAndIcon() -{ - delete m_pKvsText; - if(m_pKvsIcon)delete m_pKvsIcon; -} - - -KviKvsScript * KviKvsPopupMenuItemWithTextAndIcon::kvsIcon() -{ - return m_pKvsIcon; -} - -KviKvsScript * KviKvsPopupMenuItemWithTextAndIcon::kvsText() -{ - return m_pKvsText; -} - -QPixmap * KviKvsPopupMenuItemWithTextAndIcon::evaluateIcon(KviKvsPopupMenuTopLevelData * pData) -{ - if(KVI_OPTION_BOOL(KviOption_boolDisablePopupIcons))return 0; - if(!m_pKvsIcon)return 0; - - KviKvsVariant vRet; - if(!m_pKvsIcon->run(pData->window(), - pData->parameters(), - &vRet, - KviKvsScript::PreserveParams, - pData->extendedRunTimeData())) - { - // broken text - pData->window()->output(KVI_OUT_PARSERWARNING,__tr2qs("Broken icon parameter: ignoring")); - return 0; - } - - QString szRet; - vRet.asString(szRet); - - QPixmap * p = g_pIconManager->getImage(szRet); - if(!p)pData->window()->output(KVI_OUT_PARSERWARNING,__tr2qs("Can't find the icon \"%Q\": ignoring"),&szRet); - return p; -} - -QString KviKvsPopupMenuItemWithTextAndIcon::evaluateText(KviKvsPopupMenuTopLevelData *pData) -{ - QString szRet; - if(!m_pKvsText)return szRet; - KviKvsVariant vRet; - if(!m_pKvsText->run(pData->window(), - pData->parameters(), - &vRet, - KviKvsScript::PreserveParams, - pData->extendedRunTimeData())) - { - // broken text - pData->window()->output(KVI_OUT_PARSERWARNING,__tr2qs("Broken text parameter: assuming empty string")); - return szRet; - } - vRet.asString(szRet); - return szRet; -} - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - -KviKvsPopupMenuItemLabelHelper::KviKvsPopupMenuItemLabelHelper(KviKvsPopupMenuItemLabel * pItem) -: QObject() -{ - m_pItem = pItem; -} - -KviKvsPopupMenuItemLabelHelper::~KviKvsPopupMenuItemLabelHelper() -{ -} - -void KviKvsPopupMenuItemLabelHelper::labelDestroyed() -{ - m_pItem->labelDestroyed(); -} - -KviKvsPopupMenuItemLabel::KviKvsPopupMenuItemLabel(const QString &szItemName,const QString &szText,const QString &szIcon,const QString &szCondition) -: KviKvsPopupMenuItemWithTextAndIcon(KviKvsPopupMenuItem::Label,szItemName,szText,szIcon,szCondition) -{ - m_pLabel = 0; - m_pSignalRelay = new KviKvsPopupMenuItemLabelHelper(this); -} - -KviKvsPopupMenuItemLabel::KviKvsPopupMenuItemLabel(const QString &szItemName,const KviKvsScript * pText,const KviKvsScript * pIcon,const KviKvsScript * pCondition) -: KviKvsPopupMenuItemWithTextAndIcon(KviKvsPopupMenuItem::Label,szItemName,pText,pIcon,pCondition) -{ - m_pLabel = 0; - m_pSignalRelay = new KviKvsPopupMenuItemLabelHelper(this); -} - - -KviKvsPopupMenuItemLabel::~KviKvsPopupMenuItemLabel() -{ - if(m_pLabel) - { - QObject::disconnect(m_pLabel,SIGNAL(destroyed()),m_pSignalRelay,SLOT(labelDestroyed())); - delete m_pLabel; - } - delete m_pSignalRelay; -} - -void KviKvsPopupMenuItemLabel::labelDestroyed() -{ - m_pLabel = 0; // someone (maybe qt, maybe us) has destroyed the label -} - - -KviKvsPopupMenuItem * KviKvsPopupMenuItemLabel::clone() const -{ - return new KviKvsPopupMenuItemLabel(m_szItemName,m_pKvsText,m_pKvsIcon,m_pKvsCondition); -} - -void KviKvsPopupMenuItemLabel::clear() -{ - if(m_pLabel) - { - QObject::disconnect(m_pLabel,SIGNAL(destroyed()),m_pSignalRelay,SLOT(labelDestroyed())); - delete m_pLabel; - m_pLabel = 0; - } -} - -void KviKvsPopupMenuItemLabel::fill(KviKvsPopupMenu * pMenu,KviKvsPopupMenuTopLevelData * pData,int iIdx) -{ - if(!evaluateCondition(pData))return; - QString szText = evaluateText(pData); - QPixmap * pPix = evaluateIcon(pData); - if(m_pLabel) - { - QObject::disconnect(m_pLabel,SIGNAL(destroyed()),m_pSignalRelay,SLOT(labelDestroyed())); - delete m_pLabel; - } - m_pLabel = new QLabel(szText,pMenu); - QObject::connect(m_pLabel,SIGNAL(destroyed()),m_pSignalRelay,SLOT(labelDestroyed())); -#ifndef COMPILE_USE_QT4 - // FIXME: QT4 Seems to not allow widgets as QMenu items - pMenu->insertItem(m_pLabel); -#endif - m_pLabel->setFrameStyle(QFrame::StyledPanel | QFrame::Raised); - if(pPix)m_pLabel->setPixmap(*pPix); -} - - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -KviKvsPopupMenuItemItem::KviKvsPopupMenuItemItem(const QString &szItemName,const QString &szCode,const QString &szText,const QString &szIcon,const QString &szCondition) -: KviKvsPopupMenuItemWithTextAndIcon(KviKvsPopupMenuItem::Item,szItemName,szText,szIcon,szCondition) -{ - QString szName = "click callback for "; - szName += szItemName; - m_pKvsCode = new KviKvsScript(szName,szCode); -} - -KviKvsPopupMenuItemItem::KviKvsPopupMenuItemItem(const QString &szItemName,const KviKvsScript * pCode,const KviKvsScript * pText,const KviKvsScript * pIcon,const KviKvsScript * pCondition) -: KviKvsPopupMenuItemWithTextAndIcon(KviKvsPopupMenuItem::Item,szItemName,pText,pIcon,pCondition) -{ - m_pKvsCode = new KviKvsScript(*pCode); -} - - -KviKvsPopupMenuItemItem::~KviKvsPopupMenuItemItem() -{ - delete m_pKvsCode; -} - -void KviKvsPopupMenuItemItem::fill(KviKvsPopupMenu * pMenu,KviKvsPopupMenuTopLevelData * pData,int iIdx) -{ - if(!evaluateCondition(pData))return; - QString szText = evaluateText(pData); - QPixmap * pPix = evaluateIcon(pData); - int id; - if(pPix)id = pMenu->insertItem(*pPix,szText); - else id = pMenu->insertItem(szText); - pMenu->setItemParameter(id,iIdx); -} - -KviKvsPopupMenuItem * KviKvsPopupMenuItemItem::clone() const -{ - return new KviKvsPopupMenuItemItem(m_szItemName,m_pKvsCode,m_pKvsText,m_pKvsIcon,m_pKvsCondition); -} - -KviKvsScript * KviKvsPopupMenuItemItem::kvsCode() -{ - return m_pKvsCode; -} - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// - -KviKvsPopupMenuItemMenu::KviKvsPopupMenuItemMenu(const QString &szItemName,KviKvsPopupMenu * pMenu,const QString &szText,const QString &szIcon,const QString &szCondition) -: KviKvsPopupMenuItemWithTextAndIcon(KviKvsPopupMenuItem::Menu,szItemName,szText,szIcon,szCondition) -{ - m_pMenu = pMenu; -} - -KviKvsPopupMenuItemMenu::KviKvsPopupMenuItemMenu(const QString &szItemName,KviKvsPopupMenu * pMenu,const KviKvsScript * pText,const KviKvsScript * pIcon,const KviKvsScript * pCondition) -: KviKvsPopupMenuItemWithTextAndIcon(KviKvsPopupMenuItem::Menu,szItemName,pText,pIcon,pCondition) -{ - m_pMenu = pMenu; -} - - -KviKvsPopupMenuItemMenu::~KviKvsPopupMenuItemMenu() -{ - delete m_pMenu; -} - -KviKvsPopupMenuItem * KviKvsPopupMenuItemMenu::clone() const -{ - KviKvsPopupMenu * copy = new KviKvsPopupMenu(m_pMenu->name()); - copy->copyFrom(m_pMenu); - return new KviKvsPopupMenuItemMenu(m_szItemName,copy,m_pKvsText,m_pKvsIcon,m_pKvsCondition); -} - - -void KviKvsPopupMenuItemMenu::fill(KviKvsPopupMenu * pMenu,KviKvsPopupMenuTopLevelData * pData,int iIdx) -{ - if(!evaluateCondition(pData))return; - QString szText = evaluateText(pData); - QPixmap * pPix = evaluateIcon(pData); - int id; - m_pMenu->setParentPopup(pMenu); - if(pPix)id = pMenu->insertItem(*pPix,szText,m_pMenu); - else id = pMenu->insertItem(szText,m_pMenu); - pMenu->setItemParameter(id,iIdx); -} - -void KviKvsPopupMenuItemMenu::clear() -{ - m_pMenu->clearMenuContents(); -} - - - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - - -KviKvsPopupMenuItemExtMenu::KviKvsPopupMenuItemExtMenu(const QString &szItemName,const QString &szMenuName,const QString &szText,const QString &szIcon,const QString &szCondition) -: KviKvsPopupMenuItemWithTextAndIcon(KviKvsPopupMenuItem::ExtMenu,szItemName,szText,szIcon,szCondition) -{ - m_szMenuName = szMenuName; - if(m_szMenuName[0]=='"' && m_szMenuName[(int)(m_szMenuName.length()-1)]=='"') - { - m_szMenuName.remove(0,1); - m_szMenuName.remove(m_szMenuName.length()-1,1); - } - m_pMenu = 0; -} - -KviKvsPopupMenuItemExtMenu::KviKvsPopupMenuItemExtMenu(const QString &szItemName,const QString &szMenuName,const KviKvsScript * pText,const KviKvsScript * pIcon,const KviKvsScript * pCondition) -: KviKvsPopupMenuItemWithTextAndIcon(KviKvsPopupMenuItem::ExtMenu,szItemName,pText,pIcon,pCondition) -{ - m_szMenuName = szMenuName; - if(m_szMenuName[0]=='"' && m_szMenuName[(int)(m_szMenuName.length()-1)]=='"') - { - m_szMenuName.remove(0,1); - m_szMenuName.remove(m_szMenuName.length()-1,1); - } - m_pMenu = 0; -} - - -KviKvsPopupMenuItemExtMenu::~KviKvsPopupMenuItemExtMenu() -{ - if(m_pMenu)delete m_pMenu; -} - -void KviKvsPopupMenuItemExtMenu::clear() -{ - if(m_pMenu) - { - delete m_pMenu; - m_pMenu = 0; - } -} - -KviKvsPopupMenuItem * KviKvsPopupMenuItemExtMenu::clone() const -{ - return new KviKvsPopupMenuItemExtMenu(m_szItemName,m_szMenuName,m_pKvsText,m_pKvsIcon,m_pKvsCondition); -} - - -void KviKvsPopupMenuItemExtMenu::fill(KviKvsPopupMenu * pMenu,KviKvsPopupMenuTopLevelData * pData,int iIdx) -{ - if(!evaluateCondition(pData))return; - QString szText = evaluateText(pData); - QPixmap * pPix = evaluateIcon(pData); - - KviKvsPopupMenu * source = KviKvsPopupManager::instance()->lookup(m_szMenuName); - if(source) - { - if(source->isLocked()) - { - pData->window()->output(KVI_OUT_PARSERWARNING,__tr2qs("Recursive definition detected for popup '%Q': ignoring"),&(pMenu->popupName())); - return; - } - QString tmp; - KviQString::sprintf(tmp,"%Q.%Q",&(pMenu->popupName()),&m_szMenuName); - if(m_pMenu)delete m_pMenu; - m_pMenu = new KviKvsPopupMenu(tmp); - m_pMenu->copyFrom(source); - m_pMenu->setParentPopup(pMenu); - int id; - if(pPix)id = pMenu->insertItem(*pPix,szText,m_pMenu); - else id = pMenu->insertItem(szText,m_pMenu); - pMenu->setItemParameter(id,iIdx); - } else { - pData->window()->output(KVI_OUT_PARSERWARNING,__tr2qs("Can't find the external popup '%Q'; ignoring"),&m_szMenuName); - } -} - - - - - - -KviKvsPopupMenuTopLevelData::KviKvsPopupMenuTopLevelData(KviKvsVariantList * pParameters,KviWindow * pWindow) -{ - m_pExtendedRunTimeData = new KviKvsExtendedRunTimeData(new KviKvsHash(),TRUE); - m_pParameters = pParameters; - m_pWindow = pWindow; - m_bTestMode = false; - m_bLocked = false; -} - -KviKvsPopupMenuTopLevelData::~KviKvsPopupMenuTopLevelData() -{ - delete m_pExtendedRunTimeData; - delete m_pParameters; -} - - - - - - - -KviKvsPopupMenu::KviKvsPopupMenu(const QString &szName) -:KviTalPopupMenu(0,szName) -{ - m_szName = szName; - m_pItemList = new KviPointerList<KviKvsPopupMenuItem>; - m_pItemList->setAutoDelete(true); - m_pPrologues = new KviPointerList<KviKvsScript>; - m_pPrologues->setAutoDelete(true); - m_pEpilogues = new KviPointerList<KviKvsScript>; - m_pEpilogues->setAutoDelete(true); - m_pParentPopup = 0; - m_pTopLevelData = 0; - m_pTempTopLevelData = 0; - m_bSetupDone = false; - connect(this,SIGNAL(activated(int)),this,SLOT(itemClicked(int))); - connect(this,SIGNAL(aboutToShow()),this,SLOT(setupMenuContents())); -} - - -KviKvsPopupMenu::~KviKvsPopupMenu() -{ - clearMenuContents(); - delete m_pItemList; - delete m_pPrologues; - delete m_pEpilogues; - if(m_pTopLevelData)delete m_pTopLevelData; - if(m_pTempTopLevelData)delete m_pTempTopLevelData; -} - - -void KviKvsPopupMenu::copyFrom(const KviKvsPopupMenu * src) -{ - doClear(); - - for(KviKvsScript * se = src->m_pEpilogues->first();se;se = src->m_pEpilogues->next()) - { - m_pEpilogues->append(new KviKvsScript(*se)); - } - - for(KviKvsScript * sp = src->m_pPrologues->first();sp;sp = src->m_pPrologues->next()) - { - m_pPrologues->append(new KviKvsScript(*sp)); - } - - - for(const KviKvsPopupMenuItem * it = src->m_pItemList->first();it;it = src->m_pItemList->next()) - { - addItemInternal(it->clone()); - } -} - -void KviKvsPopupMenu::addPrologue(const QString &szItemName,const QString &szCode) -{ - // FIXME: translate this or not ? - QString szName = szItemName; - if(szName.isEmpty()) - KviQString::sprintf(szName,"prologue_%u_for_%Q",m_pPrologues->count(),&m_szName); - m_pPrologues->append(new KviKvsScript(szName,szCode)); -} - -void KviKvsPopupMenu::addEpilogue(const QString &szItemName,const QString &szCode) -{ - // FIXME: translate this or not ? - QString szName = szItemName; - if(szName.isEmpty()) - KviQString::sprintf(szName,"epilogue_%u_for_%Q",m_pPrologues->count(),&m_szName); - m_pEpilogues->append(new KviKvsScript(szName,szCode)); -} - -KviKvsPopupMenuTopLevelData * KviKvsPopupMenu::topLevelData() -{ - if(parentPopup())return parentPopup()->topLevelData(); - return m_pTopLevelData; -} - -bool KviKvsPopupMenu::removeItemByName(const QString &szItemName,bool bRecursive) -{ - KviKvsScript * se; - - for(se = m_pEpilogues->first();se;se = m_pEpilogues->next()) - { - if(KviQString::equalCI(szItemName,se->name())) - { - m_pEpilogues->removeRef(se); - return true; - } - } - - for(se = m_pPrologues->first();se;se = m_pPrologues->next()) - { - if(KviQString::equalCI(szItemName,se->name())) - { - m_pPrologues->removeRef(se); - return true; - } - } - - for(KviKvsPopupMenuItem * it = m_pItemList->first();it;it = m_pItemList->next()) - { - if(KviQString::equalCI(szItemName,it->name())) - { - m_pItemList->removeRef(it); // bye :) - return true; - } - } - - if(bRecursive) - { - for(KviKvsPopupMenuItem * ii = m_pItemList->first();ii;ii = m_pItemList->next()) - { - if(ii->isMenu()) - { - if(((KviKvsPopupMenuItemMenu *)ii)->menu()) - { - bool bRet = ((KviKvsPopupMenuItemMenu *)ii)->menu()->removeItemByName(szItemName,true); - if(bRet)return true; - } - } - } - } - - return false; -} - -bool KviKvsPopupMenu::isLocked() -{ - if(topLevelPopup()->isVisible())return true; - KviKvsPopupMenuTopLevelData * d = topLevelData(); - return d ? d->isLocked() : false; -} - - -KviKvsPopupMenu * KviKvsPopupMenu::topLevelPopup() -{ - if(parentPopup())return parentPopup(); - return this; -} - - -KviKvsPopupMenu * KviKvsPopupMenu::addPopup(const QString &szItemName,const QString &szText,const QString &szIcon,const QString &szCondition) -{ - QString szName = szItemName; - if(szName.isEmpty()) - KviQString::sprintf(szName,"%Q.subpopup%d",&m_szName,m_pItemList->count()); - KviKvsPopupMenu * pNew = new KviKvsPopupMenu(szName); - pNew->setParentPopup(this); - addItemInternal(new KviKvsPopupMenuItemMenu(szName,pNew,szText,szIcon,szCondition)); - return pNew; -} - -void KviKvsPopupMenu::addSeparator(const QString &szItemName,const QString &szCondition) -{ - QString szName = szItemName; - if(szName.isEmpty()) - KviQString::sprintf(szName,"%Q.separator%d",&m_szName,m_pItemList->count()); - addItemInternal(new KviKvsPopupMenuItemSeparator(szName,szCondition)); -} - -void KviKvsPopupMenu::addLabel(const QString &szItemName,const QString &szText,const QString &szIcon,const QString &szCondition) -{ - QString szName = szItemName; - if(szName.isEmpty()) - KviQString::sprintf(szName,"%Q.label%d",&m_szName,m_pItemList->count()); - addItemInternal(new KviKvsPopupMenuItemLabel(szName,szText,szIcon,szCondition)); -} - -void KviKvsPopupMenu::addItem(const QString &szItemName,const QString &szCode,const QString &szText,const QString &szIcon,const QString &szCondition) -{ - QString szName = szItemName; - if(szName.isEmpty()) - KviQString::sprintf(szName,"%Q.item%d",&m_szName,m_pItemList->count()); - addItemInternal(new KviKvsPopupMenuItemItem(szName,szCode,szText,szIcon,szCondition)); - -} - -void KviKvsPopupMenu::addExtPopup(const QString &szItemName,const QString &szPopupName,const QString szText,const QString &szIcon,const QString &szCondition) -{ - QString szName = szItemName; - if(szName.isEmpty()) - KviQString::sprintf(szName,"%Q.%Q",&m_szName,&szName); - addItemInternal(new KviKvsPopupMenuItemExtMenu(szName,szPopupName,szText,szIcon,szCondition)); - -} - -void KviKvsPopupMenu::addItemInternal(KviKvsPopupMenuItem * it) -{ - if(isLocked())debug("Ooops... KviKvsPopupMenu is locked in ::addItem()"); - m_pItemList->append(it); -} - -void KviKvsPopupMenu::doPopup(const QPoint & pnt,KviWindow * wnd,KviKvsVariantList * pParams,bool bTestMode) -{ - // This might be a compat problem later :((((( - // it is also an ugly trick - clearMenuContents(); - m_pTempTopLevelData = new KviKvsPopupMenuTopLevelData(pParams,wnd); - m_pTempTopLevelData->setTestMode(bTestMode); - KviTalPopupMenu::popup(pnt); -} - -void KviKvsPopupMenu::clearMenuContents() -{ - m_bSetupDone = false; - - clear(); - - for(KviKvsPopupMenuItem * it = m_pItemList->first();it;it = m_pItemList->next()) - { - it->clear(); - } - - if(m_pTopLevelData) - { - delete m_pTopLevelData; - m_pTopLevelData = 0; - } - if(m_pTempTopLevelData) - { - delete m_pTempTopLevelData; - m_pTempTopLevelData = 0; - } -} - -void KviKvsPopupMenu::doClear() -{ - clear(); - if(m_pTopLevelData) - { - delete m_pTopLevelData; - m_pTopLevelData = 0; - } - if(m_pTempTopLevelData) - { - delete m_pTempTopLevelData; - m_pTempTopLevelData = 0; - } - m_bSetupDone = false; - m_pItemList->clear(); - - m_pPrologues->clear(); - m_pEpilogues->clear(); -} - - -void KviKvsPopupMenu::lock(bool bLock) -{ - KviKvsPopupMenuTopLevelData * d = topLevelData(); - if(!d)return; - d->setLocked(bLock); -} - - -void KviKvsPopupMenu::setupMenuContents() -{ - // This might be a compat problem later :(((( - if(parentPopup() == 0) - { - if(m_pTempTopLevelData == 0) - { - // We have been called by a KviMenuBar! - // m_bSetupDone is not valid here - clearMenuContents(); - m_pTopLevelData = new KviKvsPopupMenuTopLevelData(new KviKvsVariantList(),g_pActiveWindow); - } else { - if(m_bSetupDone)return; - // we have been called by doPopup - // the menu contents have been already cleared - if(m_pTopLevelData)debug("Ops.. something got messed in KviKvsPopupMenu activation system"); - // Swap the top level data from temporary to the permanent - m_pTopLevelData = m_pTempTopLevelData; - m_pTempTopLevelData = 0; - } - } else { - if(m_bSetupDone)return; - } - - m_bSetupDone = true; - - - // HACK...this is to remove the separator inserted by Qt when popup() is called and the popup is empty - clear(); - - KviKvsPopupMenuTopLevelData * d = topLevelData(); - if(!d) - { - debug("Ops...menu contents changed behind my back!"); - return; - } - - - lock(true); - - - if(!g_pApp->windowExists(d->window()))d->setWindow(g_pApp->activeConsole()); - - if(!d->testMode()) - executePrologues(d); - - // Fill this menu contents - int idx = 0; - for(KviKvsPopupMenuItem * it = m_pItemList->first();it;it = m_pItemList->next()) - { - it->fill(this,d,idx); - ++idx; - } - - if(!d->testMode()) - executeEpilogues(d); - - lock(false); - -} - -void KviKvsPopupMenu::executePrologues(KviKvsPopupMenuTopLevelData * pData) -{ - for(KviKvsScript * s = m_pPrologues->first();s;s = m_pPrologues->next()) - { - if(!s->run(pData->window(), - pData->parameters(), - 0, - KviKvsScript::PreserveParams, - pData->extendedRunTimeData())) - { - pData->window()->output(KVI_OUT_PARSERWARNING,__tr2qs("Broken prologue in popup menu '%Q': ignoring"),&m_szName); - } - } -} - -void KviKvsPopupMenu::executeEpilogues(KviKvsPopupMenuTopLevelData * pData) -{ - for(KviKvsScript * s = m_pEpilogues->first();s;s = m_pEpilogues->next()) - { - if(!s->run(pData->window(), - pData->parameters(), - 0, - KviKvsScript::PreserveParams, - pData->extendedRunTimeData())) - { - pData->window()->output(KVI_OUT_PARSERWARNING,__tr2qs("Broken epilogue in popup menu '%Q': ignoring"),&m_szName); - } - } -} - - -void KviKvsPopupMenu::itemClicked(int itemId) -{ - int param = itemParameter(itemId); - KviKvsPopupMenuItem * it = m_pItemList->at(param); - KviKvsPopupMenuTopLevelData * d = topLevelData(); - if(it && d) - { - if(it->isItem()) - { - if(d->testMode()) - { - emit testModeItemClicked(it); - } else { - // rebind if window is lost - if(!g_pApp->windowExists(d->window()))d->setWindow(g_pApp->activeConsole()); - // FIXME: we could avoid locking since scripts can be shared now! - // see KviKvsTimerManager implementation - lock(true); - ((KviKvsPopupMenuItemItem *)it)->kvsCode()->run( - d->window(), - d->parameters(), - 0, - KviKvsScript::PreserveParams, - d->extendedRunTimeData()); - // FIXME: should we print somethng if run() returns false ? - lock(false); - } - } else debug("oops....clicked something that is not an item at position %d",param); - // FIXME: #warning "Maybe tell that the window has changed" - } else debug("oops....no menu item at position %d",param); - // UGLY Qt 3.0.0.... we can't clear menu contents here :( -//#if QT_VERSION < 300 -// topLevelPopup()->clearMenuContents(); -//#endif -} - - -void KviKvsPopupMenu::load(const QString &prefix,KviConfig * cfg) -{ - doClear(); - - int cnt; - int idx; - - QString tmp = prefix; - tmp.append("_PrologueCount"); - - cnt = cfg->readIntEntry(tmp,0); - - if(cnt > 0) - { - for(idx = 0;idx < cnt;idx++) - { - KviQString::sprintf(tmp,"%Q_Prologue%d",&(prefix),idx); - QString pr = cfg->readQStringEntry(tmp,""); - KviQString::sprintf(tmp,"%Q_PrologueId%d",&(prefix),idx); - QString itemName = cfg->readQStringEntry(tmp,""); - if(!pr.isEmpty())addPrologue(itemName,pr); - } - } else { - // Might be old version! - KviQString::sprintf(tmp,"%Q_Prologue",&(prefix)); - QString pr = cfg->readQStringEntry(tmp,""); - if(!pr.isEmpty())addPrologue(QString::null,pr); - } - - KviQString::sprintf(tmp,"%Q_EpilogueCount",&prefix); - cnt = cfg->readIntEntry(tmp,0); - - if(cnt > 0) - { - for(idx = 0;idx < cnt;idx++) - { - KviQString::sprintf(tmp,"%Q_Epilogue%d",&prefix,idx); - QString ep = cfg->readQStringEntry(tmp,""); - KviQString::sprintf(tmp,"%Q_PrologueId%d",&(prefix),idx); - QString itemName = cfg->readQStringEntry(tmp,""); - if(!ep.isEmpty())addEpilogue(itemName,ep); - } - } else { - // Might be old version! - KviQString::sprintf(tmp,"%Q_Epilogue",&prefix); - QString ep = cfg->readQStringEntry(tmp,""); - if(!ep.isEmpty())addEpilogue(QString::null,ep); - } - - - KviQString::sprintf(tmp,"%Q_Count",&prefix); - - cnt = cfg->readIntEntry(tmp,0); - - for(idx = 0;idx < cnt;idx++) - { - QString pre; - KviQString::sprintf(pre,"%Q_%d",&prefix,idx); - - KviQString::sprintf(tmp,"%Q_Id",&pre); - QString itemName = cfg->readQStringEntry(tmp,QString::null); - KviQString::sprintf(tmp,"%Q_Type",&pre); - - int type = cfg->readIntEntry(tmp,3); - switch(type) - { - case 0: // separator - { - QString expr; - KviQString::sprintf(tmp,"%Q_Expr",&pre); - expr = cfg->readQStringEntry(tmp,""); - addSeparator(itemName,expr); - } - break; - case 1: // item - { - QString text,icon,code,expr; - KviQString::sprintf(tmp,"%Q_Text",&pre); - text = cfg->readQStringEntry(tmp,"Unnamed"); - KviQString::sprintf(tmp,"%Q_Icon",&pre); - icon = cfg->readQStringEntry(tmp,""); - KviQString::sprintf(tmp,"%Q_Code",&pre); - code = cfg->readQStringEntry(tmp,""); - KviQString::sprintf(tmp,"%Q_Expr",&pre); - expr = cfg->readQStringEntry(tmp,""); - addItem(itemName,code,text,icon,expr); - } - break; - case 2: // menu - { - QString text,icon,expr; - KviQString::sprintf(tmp,"%Q_Text",&pre); - text = cfg->readQStringEntry(tmp,"Unnamed"); - KviQString::sprintf(tmp,"%Q_Icon",&pre); - icon = cfg->readQStringEntry(tmp,""); - KviQString::sprintf(tmp,"%Q_Expr",&pre); - expr = cfg->readQStringEntry(tmp,""); - KviKvsPopupMenu * pop = addPopup(itemName,text,icon,expr); - pop->load(pre,cfg); - } - break; - case 3: // label - { - QString text,icon,expr; - KviQString::sprintf(tmp,"%Q_Text",&pre); - text = cfg->readQStringEntry(tmp,"Unnamed"); - KviQString::sprintf(tmp,"%Q_Icon",&pre); - icon = cfg->readQStringEntry(tmp,""); - KviQString::sprintf(tmp,"%Q_Expr",&pre); - expr = cfg->readQStringEntry(tmp,""); - addLabel(itemName,text,icon,expr); - } - break; - case 4: // extmenu - { - QString text,icon,code,expr; - KviQString::sprintf(tmp,"%Q_Text",&pre); - text = cfg->readQStringEntry(tmp,"Unnamed"); - KviQString::sprintf(tmp,"%Q_Icon",&pre); - icon = cfg->readQStringEntry(tmp,""); - KviQString::sprintf(tmp,"%Q_ExtName",&pre); - code = cfg->readQStringEntry(tmp,""); - KviQString::sprintf(tmp,"%Q_Expr",&pre); - expr = cfg->readQStringEntry(tmp,""); - addExtPopup(itemName,code,text,icon,expr); - } - break; - default: // ignore - break; - } - } - -} - -// FIXME: #warning "NOBODY EDITS THE POPUPS IN THE CONFIG!...A binary config would be faster and work better for sure here" - -void KviKvsPopupMenu::save(const QString & prefix,KviConfig * cfg) -{ - int idx; - - KviKvsScript * s; - QString tmp; - - KviQString::sprintf(tmp,"%Q_PrologueCount",&prefix); - cfg->writeEntry(tmp,m_pPrologues->count()); - - idx = 0; - for(s = m_pPrologues->first();s;s = m_pPrologues->next()) - { - KviQString::sprintf(tmp,"%Q_Prologue%d",&prefix,idx); - cfg->writeEntry(tmp,s->code()); - KviQString::sprintf(tmp,"%Q_PrologueId%d",&prefix,idx); - cfg->writeEntry(tmp,s->name()); - idx++; - } - - KviQString::sprintf(tmp,"%Q_EpilogueCount",&prefix); - cfg->writeEntry(tmp,m_pEpilogues->count()); - - idx = 0; - for(s = m_pEpilogues->first();s;s = m_pEpilogues->next()) - { - KviQString::sprintf(tmp,"%Q_Epilogue%d",&prefix,idx); - cfg->writeEntry(tmp,s->code()); - KviQString::sprintf(tmp,"%Q_EpilogueId%d",&prefix,idx); - cfg->writeEntry(tmp,s->name()); - idx++; - } - - KviQString::sprintf(tmp,"%Q_Count",&prefix); - cfg->writeEntry(tmp,m_pItemList->count()); - idx = 0; - - - for(KviKvsPopupMenuItem * it = m_pItemList->first();it;it = m_pItemList->next()) - { - QString pre; - KviQString::sprintf(pre,"%Q_%d",&prefix,idx); - KviQString::sprintf(tmp,"%Q_Type",&pre); - int typeCode = 0; - switch(it->type()) - { - case KviKvsPopupMenuItem::Label: typeCode = 3; break; - case KviKvsPopupMenuItem::Separator: typeCode = 0; break; - case KviKvsPopupMenuItem::Menu: typeCode = 2; break; - case KviKvsPopupMenuItem::Item: typeCode = 1; break; - case KviKvsPopupMenuItem::ExtMenu: typeCode = 4; break; - } - - cfg->writeEntry(tmp,typeCode); - - KviQString::sprintf(tmp,"%Q_Id",&pre); - cfg->writeEntry(tmp,it->name()); - - s = it->kvsCondition(); - if(s) - { - KviQString::sprintf(tmp,"%Q_Expr",&pre); - cfg->writeEntry(tmp,s->code()); - } - - s = it->kvsIcon(); - if(s) - { - KviQString::sprintf(tmp,"%Q_Icon",&pre); - cfg->writeEntry(tmp,s->code()); - } - - s = it->kvsText(); - if(s) - { - KviQString::sprintf(tmp,"%Q_Text",&pre); - cfg->writeEntry(tmp,s->code()); - } - - s = it->kvsCode(); - if(s) - { - KviQString::sprintf(tmp,"%Q_Code",&pre); - cfg->writeEntry(tmp,s->code()); - } - - if(it->isMenu()) - { - ((KviKvsPopupMenuItemMenu *)it)->menu()->save(pre,cfg); - } else if(it->isExtMenu()) - { - KviQString::sprintf(tmp,"%Q_ExtName",&pre); - cfg->writeEntry(tmp,((KviKvsPopupMenuItemExtMenu *)it)->extName()); - } - - ++idx; - } -} - -void KviKvsPopupMenu::generateDefPopupCore(QString &buffer) -{ - - QString tmp; - - buffer = ""; - - KviKvsScript * s; - - for(s = m_pPrologues->first();s;s = m_pPrologues->next()) - { - buffer.append("prologue\n"); - tmp = s->code(); - tmp.stripWhiteSpace(); - KviCommandFormatter::blockFromBuffer(tmp); - buffer.append(tmp); - buffer.append('\n'); - } - - for(KviKvsPopupMenuItem * it = m_pItemList->first();it;it = m_pItemList->next()) - { - switch(it->type()) - { - case KviKvsPopupMenuItem::Item: - if(it->kvsIcon())KviQString::appendFormatted(buffer,"item(%Q,%Q)",&(it->kvsText()->code()),&(it->kvsIcon()->code())); - else KviQString::appendFormatted(buffer,"item(%Q)",&(it->kvsText()->code())); - if(it->kvsCondition())KviQString::appendFormatted(buffer," (%Q)",&(it->kvsCondition()->code())); - buffer.append("\n"); - tmp = it->kvsCode()->code(); - KviCommandFormatter::blockFromBuffer(tmp); - buffer.append(tmp); - buffer.append("\n"); - break; - case KviKvsPopupMenuItem::Menu: - if(it->kvsIcon())KviQString::appendFormatted(buffer,"popup(%Q,%Q)",&(it->kvsText()->code()),&(it->kvsIcon()->code())); - else KviQString::appendFormatted(buffer,"popup(%Q)",&(it->kvsText()->code())); - if(it->kvsCondition())KviQString::appendFormatted(buffer," (%Q)",&(it->kvsCondition()->code())); - buffer.append("\n"); - ((KviKvsPopupMenuItemMenu *)it)->menu()->generateDefPopupCore(tmp); - KviCommandFormatter::blockFromBuffer(tmp); - buffer.append(tmp); - buffer.append("\n"); - break; - case KviKvsPopupMenuItem::Separator: - if(it->kvsCondition())KviQString::appendFormatted(buffer,"separator(%Q)\n\n",&(it->kvsCondition()->code())); - else buffer.append("separator\n\n"); - break; - case KviKvsPopupMenuItem::Label: - if(it->kvsIcon())KviQString::appendFormatted(buffer,"label(%Q,%Q)",&(it->kvsText()->code()),&(it->kvsIcon()->code())); - else KviQString::appendFormatted(buffer,"label(%Q)",&(it->kvsText()->code())); - if(it->kvsCondition())KviQString::appendFormatted(buffer," (%Q)",&(it->kvsCondition()->code())); - buffer.append("\n\n"); - break; - case KviKvsPopupMenuItem::ExtMenu: - if(it->kvsIcon())KviQString::appendFormatted(buffer,"extpopup(%Q,%Q,%Q)",&(it->kvsText()->code()),&(((KviKvsPopupMenuItemExtMenu *)it)->extName()),&(it->kvsIcon()->code())); - else KviQString::appendFormatted(buffer,"extpopup(%Q)",&(it->kvsText()->code())); - if(it->kvsCondition())KviQString::appendFormatted(buffer," (%Q)",&(it->kvsCondition()->code())); - buffer.append("\n\n"); - break; - } - } - - for(s = m_pEpilogues->first();s;s = m_pEpilogues->next()) - { - buffer.append("epilogue\n"); - tmp = s->code(); - tmp.stripWhiteSpace(); - KviCommandFormatter::blockFromBuffer(tmp); - buffer.append(tmp); - buffer.append('\n'); - } - -} - -void KviKvsPopupMenu::generateDefPopup(QString &buffer) -{ - KviQString::sprintf(buffer,"defpopup(%s)\n",name()); - QString core; - - generateDefPopupCore(core); - KviCommandFormatter::blockFromBuffer(core); - buffer.append(core); -} - - - - - - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_popupmenu.h b/3.4.0/src/kvirc/kvs/kvi_kvs_popupmenu.h deleted file mode 100644 index 301b0f4647..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_popupmenu.h +++ /dev/null @@ -1,300 +0,0 @@ -#ifndef _KVI_KVS_POPUPMENU_H_ -#define _KVI_KVS_POPUPMENU_H_ -//============================================================================= -// -// File : kvi_kvs_popupmenu.h -// Created on Wed 07 Jan 2004 05:02:57 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_window.h" -#include "kvi_kvs_hash.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_script.h" -#include "kvi_kvs_runtimecontext.h" - -#include "kvi_tal_popupmenu.h" -#include <qlabel.h> -#include <qpixmap.h> - -class KviKvsPopupMenu; - -class KVIRC_API KviKvsPopupMenuTopLevelData -{ - friend class KviKvsPopupMenu; -public: - KviKvsPopupMenuTopLevelData(KviKvsVariantList * pParameters,KviWindow * pWindow); - ~KviKvsPopupMenuTopLevelData(); -protected: - KviKvsExtendedRunTimeData * m_pExtendedRunTimeData; - KviKvsVariantList * m_pParameters; - KviWindow * m_pWindow; - bool m_bLocked; - bool m_bTestMode; -public: - KviKvsExtendedRunTimeData * extendedRunTimeData(){ return m_pExtendedRunTimeData; }; - //KviKvsHash * extScopeVariables(){ return m_pExtScopeVariables; }; - KviKvsVariantList * parameters(){ return m_pParameters; }; - bool isLocked(){ return m_bLocked; }; - void setLocked(bool bLocked){ m_bLocked = bLocked; }; - KviWindow * window(){ return m_pWindow; }; - void setWindow(KviWindow * pWindow){ m_pWindow = pWindow; }; - bool testMode(){ return m_bTestMode; }; - void setTestMode(bool bTestMode){ m_bTestMode = bTestMode; }; -}; - - -class KVIRC_API KviKvsPopupMenuItem -{ - friend class KviKvsPopupMenu; -public: - enum Type { Item , Menu , Label , Separator , ExtMenu }; -protected: - KviKvsPopupMenuItem(Type t,const QString &szItemName,const QString &szCondition); - KviKvsPopupMenuItem(Type t,const QString &szItemName,const KviKvsScript * pCondition); -public: - virtual ~KviKvsPopupMenuItem(); -protected: - QString m_szItemName; - Type m_eType; - KviKvsScript * m_pKvsCondition; -public: - // this doesn't trigger errors, only warnings - bool evaluateCondition(KviKvsPopupMenuTopLevelData * pData); - - KviKvsPopupMenuItem::Type type(){ return m_eType; }; - - const QString & name(){ return m_szItemName; }; - - bool isItem(){ return m_eType == Item; }; - bool isSeparator(){ return m_eType == Separator; }; - bool isLabel(){ return m_eType == Label; }; - bool isExtMenu(){ return m_eType == ExtMenu; }; - bool isMenu(){ return m_eType == Menu; }; - - KviKvsScript * kvsCondition(){ return m_pKvsCondition; }; - virtual KviKvsScript * kvsIcon(); - virtual KviKvsScript * kvsText(); - virtual KviKvsScript * kvsCode(); - - - virtual void fill(KviKvsPopupMenu * pMenu,KviKvsPopupMenuTopLevelData * pData,int iIdx) = 0; - virtual void clear(); - virtual KviKvsPopupMenuItem * clone() const = 0; -}; - - -class KVIRC_API KviKvsPopupMenuItemSeparator : public KviKvsPopupMenuItem -{ - friend class KviKvsPopupMenu; -protected: - KviKvsPopupMenuItemSeparator(const QString &szItemName,const QString &szCondition); - KviKvsPopupMenuItemSeparator(const QString &szItemName,const KviKvsScript * pCondition); -public: - virtual ~KviKvsPopupMenuItemSeparator(); -public: - virtual void fill(KviKvsPopupMenu * pMenu,KviKvsPopupMenuTopLevelData * pData,int iIdx); - virtual KviKvsPopupMenuItem * clone() const; -}; - - -class KVIRC_API KviKvsPopupMenuItemWithTextAndIcon : public KviKvsPopupMenuItem -{ -protected: - KviKvsPopupMenuItemWithTextAndIcon(KviKvsPopupMenuItem::Type t,const QString &szItemName,const QString &szText,const QString &szIcon,const QString &szCondition); - KviKvsPopupMenuItemWithTextAndIcon(KviKvsPopupMenuItem::Type t,const QString &szItemName,const KviKvsScript * pText,const KviKvsScript * pIcon,const KviKvsScript * pCondition); -public: - virtual ~KviKvsPopupMenuItemWithTextAndIcon(); -protected: - KviKvsScript * m_pKvsText; - KviKvsScript * m_pKvsIcon; -public: - virtual KviKvsScript * kvsIcon(); - virtual KviKvsScript * kvsText(); - // this just returns a string , eventually empty - QString evaluateText(KviKvsPopupMenuTopLevelData * pData); - // this just returns the icon , eventually - QPixmap * evaluateIcon(KviKvsPopupMenuTopLevelData * pData); -}; - -class KviKvsPopupMenuItemLabel; - -// this acts as signal relay -class KVIRC_API KviKvsPopupMenuItemLabelHelper : public QObject -{ - Q_OBJECT - friend class KviKvsPopupMenuItemLabel; -protected: - KviKvsPopupMenuItemLabelHelper(KviKvsPopupMenuItemLabel * pItem); - ~KviKvsPopupMenuItemLabelHelper(); -protected: - KviKvsPopupMenuItemLabel * m_pItem; -protected slots: - void labelDestroyed(); -}; - -class KVIRC_API KviKvsPopupMenuItemLabel : public KviKvsPopupMenuItemWithTextAndIcon -{ - friend class KviKvsPopupMenuItemLabelHelper; - friend class KviKvsPopupMenu; -protected: - KviKvsPopupMenuItemLabel(const QString &szItemName,const QString &szText,const QString &szIcon,const QString &szCondition); - KviKvsPopupMenuItemLabel(const QString &szItemName,const KviKvsScript * pText,const KviKvsScript * pIcon,const KviKvsScript * pCondition); -public: - virtual ~KviKvsPopupMenuItemLabel(); -protected: - QLabel * m_pLabel; - KviKvsPopupMenuItemLabelHelper * m_pSignalRelay; -public: - virtual void fill(KviKvsPopupMenu * pMenu,KviKvsPopupMenuTopLevelData * pData,int iIdx); - virtual KviKvsPopupMenuItem * clone() const; - virtual void clear(); -protected: - void labelDestroyed(); -}; - - -class KVIRC_API KviKvsPopupMenuItemItem : public KviKvsPopupMenuItemWithTextAndIcon -{ - friend class KviKvsPopupMenu; -protected: - KviKvsPopupMenuItemItem(const QString &szItemName,const QString &szCode,const QString &szText,const QString &szIcon,const QString &szCondition); - KviKvsPopupMenuItemItem(const QString &szItemName,const KviKvsScript * pCode,const KviKvsScript * pText,const KviKvsScript * pIcon,const KviKvsScript * pCondition); -public: - virtual ~KviKvsPopupMenuItemItem(); -protected: - KviKvsScript * m_pKvsCode; -protected: - virtual KviKvsScript * kvsCode(); -public: - virtual void fill(KviKvsPopupMenu * pMenu,KviKvsPopupMenuTopLevelData * pData,int iIdx); - virtual KviKvsPopupMenuItem * clone() const; -}; - -class KVIRC_API KviKvsPopupMenuItemMenu : public KviKvsPopupMenuItemWithTextAndIcon -{ - friend class KviKvsPopupMenu; -protected: - KviKvsPopupMenuItemMenu(const QString &szItemName,KviKvsPopupMenu * pMenu,const QString &szText,const QString &szIcon,const QString &szCondition); - KviKvsPopupMenuItemMenu(const QString &szItemName,KviKvsPopupMenu * pMenu,const KviKvsScript * pText,const KviKvsScript * pIcon,const KviKvsScript * pCondition); -public: - virtual ~KviKvsPopupMenuItemMenu(); -protected: - KviKvsPopupMenu * m_pMenu; -public: - KviKvsPopupMenu * menu(){ return m_pMenu; }; - virtual void fill(KviKvsPopupMenu * pMenu,KviKvsPopupMenuTopLevelData * pData,int iIdx); - virtual void clear(); - virtual KviKvsPopupMenuItem * clone() const; -}; - -class KVIRC_API KviKvsPopupMenuItemExtMenu : public KviKvsPopupMenuItemWithTextAndIcon -{ - friend class KviKvsPopupMenu; -protected: - KviKvsPopupMenuItemExtMenu(const QString &szItemName,const QString &szMenuName,const QString &szText,const QString &szIcon,const QString &szCondition); - KviKvsPopupMenuItemExtMenu(const QString &szItemName,const QString &szMenuName,const KviKvsScript * pText,const KviKvsScript * pIcon,const KviKvsScript * pCondition); -public: - virtual ~KviKvsPopupMenuItemExtMenu(); -protected: - QString m_szMenuName; - KviKvsPopupMenu * m_pMenu; // owned! -public: - const QString & extName(){ return m_szMenuName; }; - virtual void fill(KviKvsPopupMenu * pMenu,KviKvsPopupMenuTopLevelData * pData,int iIdx); - virtual void clear(); - virtual KviKvsPopupMenuItem * clone() const; -}; - - - - - - - - - - - -class KVIRC_API KviKvsPopupMenu : public KviTalPopupMenu -{ - friend class KviKvsPopupMenuItemMenu; - friend class KviKvsPopupManager; - friend class KviSinglePopupEditor; - Q_OBJECT -public: - KviKvsPopupMenu(const QString &szName); - ~KviKvsPopupMenu(); -protected: - KviPointerList<KviKvsPopupMenuItem> * m_pItemList; -private: - QString m_szName; - KviKvsPopupMenu * m_pParentPopup; - KviPointerList<KviKvsScript> * m_pPrologues; - KviPointerList<KviKvsScript> * m_pEpilogues; - KviKvsPopupMenuTopLevelData * m_pTopLevelData; - // this is a temporary used to hack-in the activation from KviMenuBar - KviKvsPopupMenuTopLevelData * m_pTempTopLevelData; - bool m_bSetupDone; -public: - const QString & popupName(){ return m_szName; }; - void setPopupName(const QString &szName){ m_szName = szName; }; - void copyFrom(const KviKvsPopupMenu * src); - KviKvsPopupMenuTopLevelData * topLevelData(); - KviKvsPopupMenu * topLevelPopup(); - bool isLocked(); - void lock(bool bLock); - KviKvsPopupMenu * addPopup(const QString &szItemName,const QString &szText,const QString &szIcon,const QString &szCondition); - void addSeparator(const QString &szItemName,const QString &szCondition); - void addLabel(const QString &szItemName,const QString &szText,const QString &szIcon,const QString &szCondition); - void addItem(const QString &szItemName,const QString &szCode,const QString &szText,const QString &szIcon,const QString &szCondition); - void addExtPopup(const QString &szItemName,const QString &szPopupName,const QString szText,const QString &szIcon,const QString &szCondition); - void doPopup(const QPoint & pnt,KviWindow * wnd,KviKvsVariantList * pParams,bool bTestMode = false); - bool isEmpty(){ return m_pItemList->isEmpty() && m_pPrologues->isEmpty() && m_pEpilogues->isEmpty(); }; - void doClear(); - void addPrologue(const QString &szItemName,const QString &szCode); - void addEpilogue(const QString &szItemName,const QString &szCode); - bool removeItemByName(const QString &szItemName,bool bRecursive); - KviPointerList<KviKvsScript> * epilogues(){ return m_pEpilogues; }; - KviPointerList<KviKvsScript> * prologues(){ return m_pPrologues; }; - KviKvsPopupMenu * parentPopup(){ return m_pParentPopup; }; - void generateDefPopup(QString &buffer); - void setParentPopup(KviKvsPopupMenu * par){ m_pParentPopup = par; }; - void generateDefPopupCore(QString &buffer); -protected: - void addItemInternal(KviKvsPopupMenuItem * it); - void executePrologues(KviKvsPopupMenuTopLevelData * pData); - void executeEpilogues(KviKvsPopupMenuTopLevelData * pData); - void load(const QString &prefix,KviConfig * cfg); - void save(const QString &prefix,KviConfig * cfg); -private slots: - void setupMenuContents(); -protected: - void clearMenuContents(); -protected slots: - void itemClicked(int itemId); -signals: - void testModeItemClicked(KviKvsPopupMenuItem * it); -}; - - -#endif //!_KVI_KVS_POPUPMENU_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_processmanager.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_processmanager.cpp deleted file mode 100644 index e94c4b6e7c..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_processmanager.cpp +++ /dev/null @@ -1,376 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_processmanager.cpp -// Created on Wed 07 Apr 2004 03:03:52 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004-2007 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_processmanager.h" -#include "kvi_window.h" -#include "kvi_out.h" -#include "kvi_locale.h" -#include "kvi_parameterlist.h" -#include "kvi_app.h" -#include "kvi_console.h" -#include "kvi_kvs_script.h" -//#include <QSysInfo> - -KviKvsProcessAsyncOperation::KviKvsProcessAsyncOperation(KviKvsProcessDescriptorData * d) -: KviKvsAsyncOperation(d->pWnd) -{ - m_pData = d; - m_pProcess = 0; - m_pExtendedRunTimeData = new KviKvsExtendedRunTimeData(new KviKvsHash(),TRUE); - m_pPingTimer = 0; - m_pRunTimeTimer = 0; - m_bDeletePending = false; -} - -KviKvsProcessAsyncOperation::~KviKvsProcessAsyncOperation() -{ - if(m_pPingTimer)delete m_pPingTimer; - if(m_pRunTimeTimer)delete m_pRunTimeTimer; - if(m_pProcess) - { - QObject::disconnect(m_pProcess,0,this,0); - m_pProcess->kill(); - delete m_pProcess; - } - delete m_pExtendedRunTimeData; - if(m_pData->pCallback)delete m_pData->pCallback; - if(m_pData->pMagic)delete m_pData->pMagic; - delete m_pData; -} - -bool KviKvsProcessAsyncOperation::start() -{ - QStringList args; - - if(m_pData->iFlags & KVI_KVS_PROCESSDESCRIPTOR_NOSHELL) - { - args = QStringList::split(" ",m_pData->szCommandline); - } else { - QString szShell = m_pData->szShell; - if(szShell.isEmpty()) - { -#ifdef COMPILE_ON_WINDOWS - // [01:26:00] <PragmaOff> btw, what is qt_winunicode ? - // [01:26:12] <kode54> Qt export specific to win32 - // [01:26:27] <kode54> bool which indicates whether system is Unicode (NT) or not - // [01:26:58] <kode54> not sure if that's documented, but it is a public export - // - // [02:50:21] <kode54> if ( QApplication::winVersion() & Qt::WV_NT_based ) - // [02:50:41] <kode54> I see another implementation using that, maybe it is the official way of detecting that :[ -#ifdef COMPILE_USE_QT4 - szShell = !(QSysInfo::WindowsVersion & QSysInfo::WV_DOS_based) ? "cmd.exe /c" : "command.com /c"; -#else - szShell = "command.com /c"; -#endif - - // Thnx kode54 :) -#else - szShell = "sh -c"; -#endif - } - args = QStringList::split(" ",szShell); - args.append(m_pData->szCommandline); - } - - m_pProcess = new KviProcess(args); - int c = KviProcess::Stdin; - - if(m_pData->iFlags & KVI_KVS_PROCESSDESCRIPTOR_TRIGGERSTDOUT) - { - connect(m_pProcess,SIGNAL(readyReadStdout()),this,SLOT(readStdout())); - c |= KviProcess::Stdout; - } - - if(m_pData->iFlags & KVI_KVS_PROCESSDESCRIPTOR_TRIGGERSTDERR) - { - connect(m_pProcess,SIGNAL(readyReadStderr()),this,SLOT(readStderr())); - c |= KviProcess::Stderr; - } - - m_pProcess->setCommunication(c); - - connect(m_pProcess,SIGNAL(processExited()),this,SLOT(processExited())); - - if(!m_pProcess->start()) - { - return false; - } - - if(m_pData->iFlags & KVI_KVS_PROCESSDESCRIPTOR_TRIGGERSTARTED) - { - QString szPid; - szPid.setNum((int)(m_pProcess->processIdentifier())); - if(trigger(EventStarted,szPid)) - { - triggerSelfDelete(); - return true; - } - } - - if(m_pData->iMaxRunTime > 0) - { - m_pRunTimeTimer = new QTimer(this); - connect(m_pRunTimeTimer,SIGNAL(timeout()),this,SLOT(maxRunTimeExpired())); - m_pRunTimeTimer->start(m_pData->iMaxRunTime); - } - - if(m_pData->iPingTimeout > 0) - { - m_pPingTimer = new QTimer(this); - connect(m_pPingTimer,SIGNAL(timeout()),this,SLOT(ping())); - m_pPingTimer->start(m_pData->iPingTimeout); - } - - return true; -} - -void KviKvsProcessAsyncOperation::ping() -{ - if(trigger(EventPing,QString::null)) - { - triggerSelfDelete(); - } -} - -void KviKvsProcessAsyncOperation::triggerSelfDelete() -{ - if(m_bDeletePending)return; - m_bDeletePending = true; - QTimer::singleShot(m_pData->iMaxRunTime,this,SLOT(selfDelete())); -} - -void KviKvsProcessAsyncOperation::selfDelete() -{ - delete this; -} - -void KviKvsProcessAsyncOperation::maxRunTimeExpired() -{ - trigger(EventTerminated,"0"); - triggerSelfDelete(); -} - -bool KviKvsProcessAsyncOperation::trigger(CallbackEvent e,const QString &szData) -{ - if(m_bDeletePending)return false; - - if(!g_pApp->windowExists(m_pData->pWnd)) - { - if(m_pData->iFlags & KVI_KVS_PROCESSDESCRIPTOR_KILLIFNOWINDOW) - { - return true; - } - m_pData->pWnd = g_pApp->activeConsole(); - } - - if(m_pData->pCallback) - { - KviKvsVariantList params; - params.setAutoDelete(true); - - switch(e) - { - case EventStdout: - params.append(new KviKvsVariant(QString("stdout"))); - break; - case EventStderr: - params.append(new KviKvsVariant(QString("stderr"))); - break; - case EventTerminated: - params.append(new KviKvsVariant(QString("terminated"))); - break; - case EventStarted: - params.append(new KviKvsVariant(QString("started"))); - break; - case EventPing: - params.append(new KviKvsVariant(QString("ping"))); - break; - default: - debug("Ops... unknown trigger() CallbackEvent parameter in KviProcessDescriptor::trigger()"); - return false; - break; - } - - params.append(new KviKvsVariant(szData)); - if (m_pData->pMagic) params.append(m_pData->pMagic); - - KviKvsVariant retVal; - int iRet = m_pData->pCallback->run(m_pData->pWnd,¶ms,&retVal,KviKvsScript::PreserveParams,m_pExtendedRunTimeData); - if(!iRet) - { - m_pData->pWnd->output(KVI_OUT_PARSERERROR, - __tr2qs("Error triggered from process callback handler: killing process")); - return true; - } - - if(!retVal.isNothing()) - { - QString sz; - retVal.asString(sz); - m_pProcess->writeToStdin(sz); - } - - if(iRet & KviKvsScript::HaltEncountered) - { - // halt encountered: kill the process - return true; - } - } - - return false; -} - -void KviKvsProcessAsyncOperation::readStdout() -{ - if(m_bDeletePending)return; - if(m_pData->iFlags & KVI_KVS_PROCESSDESCRIPTOR_OUTPUTBYBLOCKS) - { - QByteArray a = m_pProcess->readStdout(); - if(a.size() > 0) - m_szStdoutBuffer += QString(a); - } else { - QString l = m_pProcess->readLineStdout(); - bool bBreak = false; - while((!l.isNull()) && (!bBreak)) - { - if(m_pData->iFlags & KVI_KVS_PROCESSDESCRIPTOR_TRIGGERSTDOUT) - { - if(trigger(EventStdout,l)) - { - bBreak = true; - triggerSelfDelete(); - } - } - - l = m_pProcess->readLineStdout(); - } - } -} - -void KviKvsProcessAsyncOperation::readStderr() -{ - if(m_bDeletePending)return; - if(m_pData->iFlags & KVI_KVS_PROCESSDESCRIPTOR_OUTPUTBYBLOCKS) - { - QByteArray a = m_pProcess->readStderr(); - if(a.size() > 0) - m_szStderrBuffer += QString(a); - } else { - QString l = m_pProcess->readLineStderr(); - bool bBreak = false; - while((!l.isNull()) && (!bBreak)) - { - if(m_pData->iFlags & KVI_KVS_PROCESSDESCRIPTOR_TRIGGERSTDERR) - { - if(trigger(EventStderr,l)) - { - bBreak = true; - triggerSelfDelete(); - } - } - - l = m_pProcess->readLineStderr(); - } - } -} - - -void KviKvsProcessAsyncOperation::processExited() -{ - if(m_bDeletePending)return; - - readStdout(); // just to make sure - readStderr(); // just to make sure - - if(m_pData->iFlags & KVI_KVS_PROCESSDESCRIPTOR_OUTPUTBYBLOCKS) - { - // trigger Stdout and Stderr once - if(m_pData->iFlags & KVI_KVS_PROCESSDESCRIPTOR_TRIGGERSTDOUT) - { - if(trigger(EventStdout,m_szStdoutBuffer)) - { - triggerSelfDelete(); - return; - } - } - - if(m_pData->iFlags & KVI_KVS_PROCESSDESCRIPTOR_TRIGGERSTDERR) - { - if(trigger(EventStdout,m_szStderrBuffer)) - { - triggerSelfDelete(); - return; - } - } - } - - if(m_pData->iFlags & KVI_KVS_PROCESSDESCRIPTOR_TRIGGERTERMINATED) - { - QString szRetVal; - szRetVal.setNum(m_pProcess->exitStatus()); - trigger(EventTerminated,szRetVal); - } - - triggerSelfDelete(); -} - - -/* - -KviKvsProcessManager::KviKvsProcessManager() -: QObject() -{ -} - -KviKvsProcessManager::~KviKvsProcessManager() -{ -} - -void KviKvsProcessManager::init() -{ - if(m_pInstance)return; - m_pInstance = new KviProcessManager(); -} - -void KviKvsProcessManager::done() -{ - if(!m_pInstance)return; - delete m_pInstance; - m_pInstance = 0; -} - -bool KviKvsProcessManager::execute(KviKvsProcessAsyncOperationData * d) -{ - KviKvsProcessAsyncOperation * pd = new KviKvsProcessAsyncOperation(d,this); - if(!pd->start()) - { - //delete d; <-- delete by KviKvsProcessAsyncOperation - delete pd; - return false; - } - return true; -} -*/ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_processmanager.h b/3.4.0/src/kvirc/kvs/kvi_kvs_processmanager.h deleted file mode 100644 index 5cfcbb7114..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_processmanager.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef _KVI_KVS_PROCESSMANAGER_H_ -#define _KVI_KVS_PROCESSMANAGER_H_ -//============================================================================= -// -// File : kvi_kvs_processmanager.h -// Created on Wed 07 Apr 2004 03:03:52 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004-2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_asyncoperation.h" -#include "kvi_qstring.h" -#include "kvi_window.h" -#include "kvi_kvs_variant.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_variant.h" - -#include "kvi_pointerhashtable.h" - -#ifdef Unsorted - #undef Unsorted -#endif - -#include "kvi_process.h" - -#include <qtimer.h> - -#define KVI_KVS_PROCESSDESCRIPTOR_TRIGGERSTDOUT 1 -#define KVI_KVS_PROCESSDESCRIPTOR_TRIGGERSTDERR 2 -#define KVI_KVS_PROCESSDESCRIPTOR_TRIGGERTERMINATED 4 -#define KVI_KVS_PROCESSDESCRIPTOR_OUTPUTBYBLOCKS 8 -#define KVI_KVS_PROCESSDESCRIPTOR_TRIGGERSTARTED 16 -#define KVI_KVS_PROCESSDESCRIPTOR_NOSHELL 32 -#define KVI_KVS_PROCESSDESCRIPTOR_KILLIFNOWINDOW 64 - - -class KviWindow; -class KviKvsScript; -class KviKvsVariant; - -typedef struct _KviKvsProcessDescriptorData -{ - QString szShell; - QString szCommandline; - KviKvsScript * pCallback; - KviKvsVariant * pMagic; - KviWindow * pWnd; - int iFlags; - int iMaxRunTime; // 0 for no timeout - int iPingTimeout; // 0 for no ping timeout -} KviKvsProcessDescriptorData; - -class KviKvsProcessManager; - -class KVIRC_API KviKvsProcessAsyncOperation : public KviKvsAsyncOperation -{ - friend class KviKvsProcessManager; - Q_OBJECT -public: - KviKvsProcessAsyncOperation(KviKvsProcessDescriptorData * d); - ~KviKvsProcessAsyncOperation(); -protected: - enum CallbackEvent { EventStarted,EventTerminated,EventStdout,EventStderr,EventPing }; -private: - KviProcess * m_pProcess; - KviKvsExtendedRunTimeData * m_pExtendedRunTimeData; - QString m_szStdoutBuffer; - QString m_szStderrBuffer; - KviKvsProcessDescriptorData * m_pData; - QTimer * m_pPingTimer; - QTimer * m_pRunTimeTimer; - bool m_bDeletePending; -public: - bool start(); -private slots: - void maxRunTimeExpired(); - void ping(); - void readStdout(); - void readStderr(); - void processExited(); - void selfDelete(); -private: - bool trigger(CallbackEvent e,const QString &szData); - void triggerSelfDelete(); -}; - - -#endif //!_KVI_KVS_PROCESSMANAGER_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_report.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_report.cpp deleted file mode 100644 index 1ba9db998d..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_report.cpp +++ /dev/null @@ -1,262 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_report.cpp -// Creation date : Thu 25 Sep 2003 05.12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_report.h" -#include "kvi_mirccntrl.h" -#include "kvi_window.h" -#include "kvi_out.h" -#include "kvi_app.h" -#include "kvi_locale.h" -#include "kvi_debugwindow.h" -#include "kvi_options.h" - -KviKvsReport::KviKvsReport(Type t,const QString &szContext,const QString &szMessage,const QString &szLocation,KviWindow * pWindow) -: m_eType(t), m_szContext(szContext), m_szMessage(szMessage), m_szLocation(szLocation), m_pWindow(pWindow) -{ -#ifdef COMPILE_NEW_KVS - m_pCallStack = 0; - m_pCodeListing = 0; -#endif -} - -KviKvsReport::~KviKvsReport() -{ -#ifdef COMPILE_NEW_KVS - if(m_pCallStack)delete m_pCallStack; - if(m_pCodeListing)delete m_pCodeListing; -#endif -} - -void KviKvsReport::findLineAndCol(const QChar * pBegin,const QChar * pPoint,int &iLine,int &iCol) -{ -#ifdef COMPILE_NEW_KVS - iLine = 1; - - const QChar * pBufferBegin = pBegin; - - const QChar * pPrevLine = 0; - const QChar * pLineBegin = pBegin; - - unsigned short us = pBegin->unicode(); - - while(us && (pBegin < pPoint)) - { - if(us == '\n') - { - pPrevLine = pLineBegin; - pBegin++; - pLineBegin = pBegin; - iLine++; - } else { - pBegin++; - } - us = pBegin->unicode(); - } - - iCol = (pBegin - pLineBegin) + 1; -#endif -} - - - -void KviKvsReport::findLineColAndListing(const QChar * pBegin,const QChar * pPoint,int &iLine,int &iCol,KviPointerList<QString> * pListing) -{ -#ifdef COMPILE_NEW_KVS - iLine = 1; - - const QChar * pBufferBegin = pBegin; - - const QChar * pPrevLine = 0; - const QChar * pLineBegin = pBegin; - - unsigned short us = pBegin->unicode(); - - while(us && (pBegin < pPoint)) - { - if(us == '\n') - { - pPrevLine = pLineBegin; - pBegin++; - pLineBegin = pBegin; - iLine++; - } else { - pBegin++; - } - us = pBegin->unicode(); - } - - iCol = (pBegin - pLineBegin) + 1; - - // previous line - if(pPrevLine) - { - // there would be yet another line before - if(pPrevLine > pBufferBegin) - { - QString * pListingStrZ = new QString(); - KviQString::sprintf(*pListingStrZ,"%d ...",iLine - 2); - pListing->append(pListingStrZ); - } - - QString * pListingStr = new QString(); - KviQString::sprintf(*pListingStr,"%d ",iLine - 1); - *pListingStr += QString(pPrevLine,pLineBegin - pPrevLine); - pListingStr->replace("\n",""); - pListing->append(pListingStr); - } - - // current line - pBegin = pLineBegin; - - us = pBegin->unicode(); - while(us && (us != '\n')) - { - pBegin++; - us = pBegin->unicode(); - } - if(us)pBegin++; - - { - QString * pListingStr = new QString(); - KviQString::sprintf(*pListingStr,"%c%d ",KVI_TEXT_BOLD,iLine); - *pListingStr += QString(pLineBegin,pBegin - pLineBegin); - pListingStr->replace("\n",""); - pListing->append(pListingStr); - } - - if(us) - { - // next line - pLineBegin = pBegin; - - us = pBegin->unicode(); - while(us && (us != '\n')) - { - pBegin++; - us = pBegin->unicode(); - } - if(us)pBegin++; - - { - QString * pListingStr = new QString(); - KviQString::sprintf(*pListingStr,"%d ",iLine + 1); - *pListingStr += QString(pLineBegin,pBegin - pLineBegin); - pListingStr->replace("\n",""); - pListing->append(pListingStr); - } - - // there would be yet another line - if(us) - { - QString * pListingStr = new QString(); - KviQString::sprintf(*pListingStr,"%d ...",iLine + 2); - pListing->append(pListingStr); - } - } -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -// ERROR REPORTING - -void KviKvsReport::report(KviKvsReport * r,KviWindow * pOutput) -{ -#ifdef COMPILE_NEW_KVS - if(!pOutput)return; // ? - if(!g_pApp->windowExists(pOutput)) - { - if(KVI_OPTION_BOOL(KviOption_boolScriptErrorsToDebugWindow)) - { - // rethrow to the debug window - report(r,KviDebugWindow::getInstance()); - } // else window lost: unrecoverable - return; - } - - // make sure that the output window still exists! - - int out; - - switch(r->type()) - { - case KviKvsReport::ParserWarning: - out = KVI_OUT_PARSERWARNING; - pOutput->output(out,__tr2qs("[KVS]%c Warning: %Q"),KVI_TEXT_BOLD,&(r->message())); - break; - case KviKvsReport::ParserError: - out = KVI_OUT_PARSERERROR; - pOutput->output(out,__tr2qs("[KVS]%c Compilation Error: %Q"),KVI_TEXT_BOLD,&(r->message())); - break; - case KviKvsReport::RunTimeWarning: - out = KVI_OUT_PARSERWARNING; - pOutput->output(out,__tr2qs("[KVS]%c Warning: %Q"),KVI_TEXT_BOLD,&(r->message())); - break; - case KviKvsReport::RunTimeError: - out = KVI_OUT_PARSERERROR; - pOutput->output(out,__tr2qs("[KVS]%c Runtime Error: %Q"),KVI_TEXT_BOLD,&(r->message())); - break; - } - - if(r->location().isEmpty()) - pOutput->output(out,__tr2qs("[KVS] in script context \"%Q\""),&(r->context())); - else - pOutput->output(out,__tr2qs("[KVS] in script context \"%Q\", %Q"),&(r->context()),&(r->location())); - - if(pOutput == KviDebugWindow::instance()) - { - KviPointerList<QString> * l; - if(l = r->codeListing()) - { - pOutput->outputNoFmt(out,__tr2qs("[KVS] Code listing:")); - for(QString * s = l->first();s;s = l->next()) - pOutput->output(out,"[KVS] %Q",s); - } - - pOutput->output(out,__tr2qs("[KVS] Window:")); - if(g_pApp->windowExists(r->window())) - pOutput->output(out,"[KVS] %Q [id: %u]",&(r->window()->windowName()),r->window()->numericId()); - else - pOutput->output(out,__tr2qs("[KVS] Destroyed window with pointer %x"),r->window()); - - if(l = r->callStack()) - { - pOutput->outputNoFmt(out,__tr2qs("[KVS] Call stack:")); - for(QString * s = l->first();s;s = l->next()) - pOutput->output(out,"[KVS] %Q",s); - } - - pOutput->outputNoFmt(out,"[KVS]"); - } else { - if(KVI_OPTION_BOOL(KviOption_boolScriptErrorsToDebugWindow)) - { - // rethrow to the debug window - if(pOutput != KviDebugWindow::getInstance()) - report(r,KviDebugWindow::getInstance()); - } - } -#endif -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_report.h b/3.4.0/src/kvirc/kvs/kvi_kvs_report.h deleted file mode 100644 index febf16dee2..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_report.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef _KVI_KVS_REPORT_H_ -#define _KVI_KVS_REPORT_H_ -//============================================================================= -// -// File : kvi_kvs_report.h -// Creation date : Thu 25 Sep 2003 05.12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_pointerlist.h" - -class KviWindow; - -class KVIRC_API KviKvsReport -{ -public: - enum Type { RunTimeError, RunTimeWarning, ParserError, ParserWarning }; -public: - KviKvsReport(Type t,const QString &szContext,const QString &szMessage,const QString &szLocation,KviWindow * pWindow); - ~KviKvsReport(); -protected: - Type m_eType; - - // mandatory - QString m_szContext; // context name (script name, usually) - QString m_szMessage; // report message, always present - QString m_szLocation; // line and col description (may be some thing like "at end of input") - - KviWindow * m_pWindow; // the window that the script was attacched to - - // optional - KviPointerList<QString> * m_pCodeListing; // code listing, if present, it is owned - KviPointerList<QString> * m_pCallStack; // call stack, if present, it is owned -public: - Type type() const { return m_eType; }; - - KviWindow * window(){ return m_pWindow; }; - const QString & context(){ return m_szContext; }; - const QString & message(){ return m_szMessage; }; - const QString & location(){ return m_szLocation; }; - KviPointerList<QString> * codeListing(){ return m_pCodeListing; }; - KviPointerList<QString> * callStack(){ return m_pCallStack; }; - - void setContext(const QString &szContext){ m_szContext = szContext; }; - void setMessage(const QString &szMessage){ m_szMessage = szMessage; }; - void setLocation(const QString &szLocation){ m_szLocation = szLocation; }; - void setCodeListing(KviPointerList<QString> * pListing){ m_pCodeListing = pListing; }; - void setCallStack(KviPointerList<QString> * pStack){ m_pCallStack = pStack; }; - - static void findLineAndCol(const QChar * pBegin,const QChar * pPoint,int &iLine,int &iCol); - static void findLineColAndListing(const QChar * pBegin,const QChar * pPoint,int &iLine,int &iCol,KviPointerList<QString> * pListing); - - static void report(KviKvsReport * r,KviWindow * pOutput); -}; - -#endif //!_KVI_KVS_REPORT_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_runtimecall.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_runtimecall.cpp deleted file mode 100644 index af7e5e18bf..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_runtimecall.cpp +++ /dev/null @@ -1,50 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_runtimecall.cpp -// Created on Sat 23 Apr 2005 18:19:38 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_runtimecall.h" - - -void KviKvsRunTimeCall::warning(const QString &szFmt,...) -{ - kvi_va_list va; - kvi_va_start_by_reference(va,szFmt); - m_pContext->report(false,m_pContext->defaultReportLocation(),szFmt,va); - kvi_va_end(va); -} - -bool KviKvsRunTimeCall::error(const QString &szFmt,...) -{ - kvi_va_list va; - kvi_va_start_by_reference(va,szFmt); - m_pContext->report(true,m_pContext->defaultReportLocation(),szFmt,va); - kvi_va_end(va); - return false; -} - -bool KviKvsRunTimeCall::getParameterCode(unsigned int /*uParamIdx*/,QString & /*szParamBuffer*/) -{ - return false; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_runtimecall.h b/3.4.0/src/kvirc/kvs/kvi_kvs_runtimecall.h deleted file mode 100644 index 581b13037b..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_runtimecall.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef _KVI_KVS_RUNTIMECALL_H_ -#define _KVI_KVS_RUNTIMECALL_H_ -//============================================================================= -// -// File : kvi_kvs_runtimecall.h -// Created on Sat 23 Apr 2005 18:19:38 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_variant.h" -#include "kvi_window.h" - - -class KVIRC_API KviKvsRunTimeCall -{ -protected: - KviKvsRunTimeContext * m_pContext; // shallow - KviKvsVariantList * m_pParams; // shallow -public: - KviKvsRunTimeCall(KviKvsRunTimeContext * pContext,KviKvsVariantList * pParams) - : m_pContext(pContext),m_pParams(pParams){}; - virtual ~KviKvsRunTimeCall(){}; -public: - // the script runtime context, never zero - KviKvsRunTimeContext * context(){ return m_pContext; }; - - KviWindow * window(){ return m_pContext->window(); }; - - // parameter list access & helpers.. almost unused - // because of the KVSM_PARAMETER macros - KviKvsVariantList * parameterList(){ return m_pParams; }; - KviKvsVariantList * params(){ return m_pParams; }; // the short version - unsigned int paramCount(){ return m_pParams->count(); }; - unsigned int parameterCount(){ return m_pParams->count(); }; - KviKvsVariant * firstParam(){ return m_pParams->first(); }; - KviKvsVariant * nextParam(){ return m_pParams->next(); }; - - // This is virtual and returns false by default - // only few derived classes allow the parameter code to be - // extracted. This is mainly useful in module callback commands - // where a special parsing routine can not be implemented - // but parameter code is needed for later evaluation. (see /addon.register for example) - // Returns false if the parameter code cannot be extracted and true otherwise. - virtual bool getParameterCode(unsigned int uParamIdx,QString &szParamBuffer); - - // forwarders from the context - // this MUST be called before any blocking call that might return to the main event loop - // and eventually quit kvirc or close the window that this command is associated to - // Actually this is a NO-OP but later may really do something that avoids kvirc to crash - void enterBlockingSection(){ m_pContext->enterBlockingSection(); }; - // this MUST be called after exiting the blocking section above - // if this function returns false your parsing code MUST "return false" immediately: - // it means that something rather critical happened and the script - // execution cannot continue - bool leaveBlockingSection(){ return m_pContext->leaveBlockingSection(); }; - - // forwarders for context: they ease the porting - void warning(const QString &szFmt,...); - bool error(const QString &szFmt,...); // this ALWAYS returns false -}; - -#endif //!_KVI_KVS_RUNTIMECALL_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_runtimecontext.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_runtimecontext.cpp deleted file mode 100644 index d5e2d27fc8..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_runtimecontext.cpp +++ /dev/null @@ -1,206 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_runtimecontext.cpp -// Created on Tue 07 Oct 2003 01:49:40 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_script.h" -#include "kvi_kvs_kernel.h" -#include "kvi_kvs_report.h" -#include "kvi_console.h" -#include "kvi_kvs_treenode_base.h" -#include "kvi_locale.h" -#include "kvi_app.h" -#include "kvi_kvs_object.h" - -KviKvsExtendedRunTimeData::~KviKvsExtendedRunTimeData() -{ - if(m_bAutoDelete) - { - if(m_pExtendedScopeVariables) delete m_pExtendedScopeVariables; - if(m_pAliasSwitchList) delete m_pAliasSwitchList; - if(m_pThisObject) delete m_pThisObject; - if(m_pScriptFilePath) delete m_pScriptFilePath; - } -} - -KviKvsRunTimeContext::KviKvsRunTimeContext(KviKvsScript * pScript,KviWindow * pWnd,KviKvsVariantList * pParams,KviKvsVariant * pRetVal,KviKvsExtendedRunTimeData * pExtData) -{ - m_bError = false; - m_pScript = pScript; - m_pParameterList = pParams; - m_pWindow = pWnd; - m_pLocalVariables = new KviKvsHash(); - m_pReturnValue = pRetVal; - m_uRunTimeFlags = 0; - m_pExtendedData = pExtData; - m_pDefaultReportLocation = 0; -} - -KviKvsRunTimeContext::~KviKvsRunTimeContext() -{ - delete m_pLocalVariables; -} - -KviKvsHash * KviKvsRunTimeContext::globalVariables() -{ - return KviKvsKernel::instance()->globalVariables(); -} - -void KviKvsRunTimeContext::enterBlockingSection() -{ - // actually a NO-OP -} - -bool KviKvsRunTimeContext::leaveBlockingSection() -{ - if(g_pApp->closingDown())return false; // application quitting - if(!g_pApp->windowExists(m_pWindow))return false; // window lost - return true; -} - -KviKvsVariant * KviKvsRunTimeContext::swapReturnValuePointer(KviKvsVariant * pNewPointer) -{ - KviKvsVariant * pAux = m_pReturnValue; - m_pReturnValue = pNewPointer; - return pAux; -} - -void KviKvsRunTimeContext::report(bool bError,KviKvsTreeNode * pNode,const QString &szMsgFmt,kvi_va_list va) -{ - QString szMsg; - KviQString::vsprintf(szMsg,szMsgFmt,va); - - KviPointerList<QString> * pCodeListing = 0; - KviPointerList<QString> * pCallStack = 0; - QString szLocation; - - if(pNode) - { - if(pNode->location() && m_pScript) - { - pCodeListing = new KviPointerList<QString>; - pCodeListing->setAutoDelete(true); - - int iLine,iCol; - - KviKvsReport::findLineColAndListing(m_pScript->buffer(),pNode->location(),iLine,iCol,pCodeListing); - - KviQString::sprintf(szLocation,__tr2qs("line %d, near character %d"),iLine,iCol); - } - - // create the call stack - int iFrame = 0; - - pCallStack = new KviPointerList<QString>; - pCallStack->setAutoDelete(true); - - while(pNode && (iFrame < 12)) - { - QString * pString = new QString(); - QString szTmp; - pNode->contextDescription(szTmp); - KviQString::sprintf(*pString,"#%d %Q",iFrame,&szTmp); - if(pNode->location()) - { - int iLine,iCol; - KviKvsReport::findLineAndCol(m_pScript->buffer(),pNode->location(),iLine,iCol); - QString tmpi; - KviQString::sprintf(tmpi," [line %d, near character %d]",iLine,iCol); - *pString += tmpi; - } - pCallStack->append(pString); - iFrame++; - pNode = pNode->parent(); - } - if(pNode) - pCallStack->append(new QString("#12 ...")); - } - - QString szContext = m_pScript ? m_pScript->name() : "kvirc core code"; - KviKvsReport rep(bError ? KviKvsReport::RunTimeError : KviKvsReport::RunTimeWarning,szContext,szMsg,szLocation,m_pWindow); - if(pCodeListing)rep.setCodeListing(pCodeListing); - if(pCallStack)rep.setCallStack(pCallStack); - - KviKvsReport::report(&rep,m_pWindow); -} - -void KviKvsRunTimeContext::error(KviKvsTreeNode * pNode,const QString &szMsgFmt,...) -{ - m_bError = true; - - kvi_va_list va; - kvi_va_start_by_reference(va,szMsgFmt); - report(true,pNode,szMsgFmt,va); - kvi_va_end(va); -} - -void KviKvsRunTimeContext::warning(KviKvsTreeNode * pNode,const QString &szMsgFmt,...) -{ - kvi_va_list va; - kvi_va_start_by_reference(va,szMsgFmt); - report(false,pNode,szMsgFmt,va); - kvi_va_end(va); -} - -void KviKvsRunTimeContext::error(const QString &szMsgFmt,...) -{ - m_bError = true; - - kvi_va_list va; - kvi_va_start_by_reference(va,szMsgFmt); - report(true,m_pDefaultReportLocation,szMsgFmt,va); - kvi_va_end(va); -} - -void KviKvsRunTimeContext::warning(const QString &szMsgFmt,...) -{ - kvi_va_list va; - kvi_va_start_by_reference(va,szMsgFmt); - report(false,m_pDefaultReportLocation,szMsgFmt,va); - kvi_va_end(va); -} - -bool KviKvsRunTimeContext::errorNoIrcContext() -{ - error(m_pDefaultReportLocation,__tr2qs("This command can be used only in windows bound to an IRC context")); - return false; -} - -bool KviKvsRunTimeContext::warningNoIrcConnection() -{ - warning(m_pDefaultReportLocation,__tr2qs("You're not connected to an IRC server")); - return true; -} - -bool KviKvsRunTimeContext::warningMissingParameter() -{ - warning(m_pDefaultReportLocation,__tr2qs("Missing parameter")); - return true; -} - -void KviKvsRunTimeContext::setDefaultReportLocation(KviKvsTreeNode * pNode) -{ - m_pDefaultReportLocation = pNode; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_runtimecontext.h b/3.4.0/src/kvirc/kvs/kvi_kvs_runtimecontext.h deleted file mode 100644 index 4f32691484..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_runtimecontext.h +++ /dev/null @@ -1,256 +0,0 @@ -#ifndef _KVI_KVS_RUNTIMECONTEXT_H_ -#define _KVI_KVS_RUNTIMECONTEXT_H_ -//============================================================================= -// -// File : kvi_kvs_runtimecontext.h -// Created on Tue 07 Oct 2003 01:49:40 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_window.h" - -#include "kvi_kvs_variant.h" -#include "kvi_kvs_hash.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_switchlist.h" - -class KviKvsScript; -class KviConsole; -class KviIrcContext; -class KviIrcConnection; -class KviKvsTreeNode; -class KviKvsObject; -class KviKvsReportHandler; - -class KVIRC_API KviKvsExtendedRunTimeData -{ - friend class KviKvsRunTimeContext; -protected: - KviKvsHash * m_pExtendedScopeVariables; // extended scope vars, shallow, may be 0 - KviKvsSwitchList * m_pAliasSwitchList; // switches for the aliases, shallow, may be 0 - KviKvsObject * m_pThisObject; // the current object for object function calls - QString * m_pScriptFilePath; // the current script file path, shallow, may be 0 - bool m_bAutoDelete; -public: - // all shallow data, all may be 0 - KviKvsExtendedRunTimeData() - : m_pExtendedScopeVariables(0), - m_pAliasSwitchList(0), - m_pThisObject(0), - m_pScriptFilePath(0), - m_bAutoDelete(FALSE) - {}; - KviKvsExtendedRunTimeData(KviKvsHash * pExtScopeVariables,bool autoDelete=FALSE) - : m_pExtendedScopeVariables(pExtScopeVariables), - m_pAliasSwitchList(0), - m_pThisObject(0), - m_pScriptFilePath(0), - m_bAutoDelete(autoDelete) - {}; - KviKvsExtendedRunTimeData(KviKvsSwitchList * pAliasSwitchList,bool autoDelete=FALSE) - : m_pExtendedScopeVariables(0), - m_pAliasSwitchList(pAliasSwitchList), - m_pThisObject(0), - m_pScriptFilePath(0), - m_bAutoDelete(autoDelete) - {}; - KviKvsExtendedRunTimeData(KviKvsObject * pThisObject,bool autoDelete=FALSE) - : m_pExtendedScopeVariables(0), - m_pAliasSwitchList(0), - m_pThisObject(pThisObject), - m_pScriptFilePath(0), - m_bAutoDelete(autoDelete) - {}; - KviKvsExtendedRunTimeData(QString * pScriptFilePath,bool autoDelete=FALSE) - : m_pExtendedScopeVariables(0), - m_pAliasSwitchList(0), - m_pThisObject(0), - m_pScriptFilePath(pScriptFilePath), - m_bAutoDelete(autoDelete) - {}; - ~KviKvsExtendedRunTimeData(); -public: - KviKvsHash * extendedScopeVariables(){ return m_pExtendedScopeVariables; }; - KviKvsSwitchList * aliasSwitchList(){ return m_pAliasSwitchList; }; - KviKvsObject * thisObject(){ return m_pThisObject; }; - QString * scriptFilePath(){ return m_pScriptFilePath; }; -}; - - -class KVIRC_API KviKvsRunTimeContext -{ - friend class KviKvsScript; - friend class KviKvsObject; - friend class KviKvsRunTimeCall; - friend class KviKvsEventManager; -protected: - // only KviKvsScript, KviKvsEventManager and KviKvsObject can instantiate this class - KviKvsRunTimeContext(KviKvsScript * pScript, - KviWindow * pWnd, - KviKvsVariantList * pParams, - KviKvsVariant * pRetVal, - KviKvsExtendedRunTimeData * pExtData = 0); -public: - ~KviKvsRunTimeContext(); -protected: - // stuff that is fixed in the whole script context - KviKvsScript * m_pScript; // shallow, may be 0! - KviKvsHash * m_pLocalVariables; // owned, never 0 - KviKvsVariantList * m_pParameterList; // shallow, never 0 - KviKvsVariant * m_pReturnValue; // shallow, never 0 - - // stuff that is generally global but sometimes may change - // during the execution of the script - KviWindow * m_pWindow; // shallow, never 0 - - enum RunTimeFlags { BreakPending = 1, HaltCalled = 2, DisableReporting = 4 }; - unsigned int m_uRunTimeFlags; // a combination of RunTimeFlags - - KviKvsExtendedRunTimeData * m_pExtendedData; // shallow, may be 0 - - // error handling - bool m_bError; // was error() ever called ? - KviKvsTreeNode * m_pDefaultReportLocation; // default report location for error() -public: - // the window that this script is bound to (it MAY change during the script parsing) - KviWindow * window() - { return m_pWindow; }; - // quick access to the irc context (it MAY be zero!) - KviIrcContext * context() - { return m_pWindow->context(); }; - // quick access to the console that this script is bound to (it MAY be zero, if there is no console) - KviConsole * console() - { return m_pWindow->console(); }; - // quick access to the connection: it MAY be zero! - KviIrcConnection * connection() - { return m_pWindow->connection(); }; - - // the local variables of this script - KviKvsHash * localVariables() - { return m_pLocalVariables; }; - // the global application-wide variables - KviKvsHash * globalVariables(); - // the parameters passed to this script - KviKvsVariantList * parameterList() - { return m_pParameterList; }; - - // parent script, may be 0! - KviKvsScript * script() - { return m_pScript; }; - - KviKvsVariant * returnValue() - { return m_pReturnValue; }; - - // this is the default error reporting location - // it is also used by rfc2812wrapper to find out the current command name! - KviKvsTreeNode * defaultReportLocation() - { return m_pDefaultReportLocation; }; - - // the extended stuff - KviKvsHash * extendedScopeVariables() - { return m_pExtendedData ? m_pExtendedData->extendedScopeVariables() : 0; }; - KviKvsSwitchList * aliasSwitchList() - { return m_pExtendedData ? m_pExtendedData->aliasSwitchList() : 0; }; - KviKvsObject * thisObject() - { return m_pExtendedData ? m_pExtendedData->thisObject() : 0; }; - QString * scriptFilePath() - { return m_pExtendedData ? m_pExtendedData->scriptFilePath() : 0; }; - - // this MUST be called before any blocking call that might return to the main event loop - // and eventually quit kvirc or close the window that this command is associated to - // Actually this is a NO-OP but later may really do something that avoids kvirc to crash - void enterBlockingSection(); - // this MUST be called after exiting the blocking section above - // if this function returns false your parsing code MUST "return false" immediately: - // it means that something rather critical happened and the script - // execution cannot continue - bool leaveBlockingSection(); - - // Error handling - - // was error(...) ever called ? - bool error() const { return m_bError; }; - - void error(KviKvsTreeNode * pNode,const QString &szMsgFmt,...); - void warning(KviKvsTreeNode * pNode,const QString &szMsgFmt,...); - void error(const QString &szMsgFmt,...); - void warning(const QString &szMsgFmt,...); - void setDefaultReportLocation(KviKvsTreeNode * pNode); - bool errorNoIrcContext(); - bool warningNoIrcConnection(); - bool warningMissingParameter(); - -//PRIVATE: - // tricky - // don't use it: it's only for the parser - void setWindow(KviWindow * pWnd) - { m_pWindow = pWnd; }; - - // returns the old pointer - KviKvsVariant * swapReturnValuePointer(KviKvsVariant * pNewPointer); - // the old pointer MUST be reset! - - // this is called by the parser when a break is encountered - // the parser calls setBreakPending() and returns false - // the contexts that can handle a break should check breakPending() - // after an internal evaluation returned false. - // if breakPending() they should handle it with handleBreak() and - // return true instead. - void setBreakPending() - { m_uRunTimeFlags |= BreakPending; }; - // this tells if a break command has been called - // it may return true if an execution() command has returned false - // (if breakPending() there should be no error() - bool breakPending() - { return (m_uRunTimeFlags & BreakPending); }; - // this is called by the commands that can handle a break - void handleBreak() - { m_uRunTimeFlags &= ~BreakPending; }; - - // this is called by the parser when a halt is encountered - // the parser then returns false and all the stack frames - // above should do the same - void setHaltCalled() - { m_uRunTimeFlags |= HaltCalled; }; - bool haltCalled() - { return (m_uRunTimeFlags & HaltCalled); }; - - // this is used by KviKvsScript to disable reporting when the Quiet flag is used - void disableReporting() - { m_uRunTimeFlags |= DisableReporting; }; - bool reportingDisabled() - { return (m_uRunTimeFlags & DisableReporting); }; - void enableReporting() - { m_uRunTimeFlags &= ~DisableReporting; }; - - // clears the error status on this context - // this is useful to continue execution after an error - // and probably used only in /eval - void clearError() - { m_bError = false; }; - protected: - - void report(bool bError,KviKvsTreeNode * pNode,const QString &szMsgFmt,kvi_va_list va); - -}; - -#endif //!_KVI_KVS_RUNTIMECONTEXT_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_rwevaluationresult.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_rwevaluationresult.cpp deleted file mode 100644 index a16b371288..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_rwevaluationresult.cpp +++ /dev/null @@ -1,66 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_rwevaluationresult.cpp -// Created on Thu 11 Dec 2003 22:51:46 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_rwevaluationresult.h" -#include "kvi_kvs_hash.h" -#include "kvi_kvs_array.h" - -KviKvsRWEvaluationResult::KviKvsRWEvaluationResult(KviKvsRWEvaluationResult *pParent,KviKvsVariant *pVariant) -{ - m_pParent = pParent; - m_pVariant = pVariant; -} - -KviKvsRWEvaluationResult::~KviKvsRWEvaluationResult() -{ -} - -KviKvsArrayElement::KviKvsArrayElement(KviKvsRWEvaluationResult *pParent,KviKvsVariant *pVariant,KviKvsArray *pArray,int iKey) -: KviKvsRWEvaluationResult(pParent,pVariant) -{ - m_pArray = pArray; - m_iKey = iKey; -} - -KviKvsArrayElement::~KviKvsArrayElement() -{ - if(m_pVariant->isEmpty())m_pArray->unset(m_iKey); - if(m_pParent)delete m_pParent; -} - -KviKvsHashElement::KviKvsHashElement(KviKvsRWEvaluationResult *pParent,KviKvsVariant *pVariant,KviKvsHash *pHash,const QString &szKey) -: KviKvsRWEvaluationResult(pParent,pVariant) -{ - m_pHash = pHash; - m_szKey = szKey; -} - -KviKvsHashElement::~KviKvsHashElement() -{ - if(m_pVariant->isEmpty())m_pHash->unset(m_szKey); - if(m_pParent)delete m_pParent; -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_rwevaluationresult.h b/3.4.0/src/kvirc/kvs/kvi_kvs_rwevaluationresult.h deleted file mode 100644 index eb041bb267..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_rwevaluationresult.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef _KVI_KVS_RWEVALUATIONRESULT_H_ -#define _KVI_KVS_RWEVALUATIONRESULT_H_ -//============================================================================= -// -// File : kvi_kvs_rwevaluationresult.h -// Created on Thu 11 Dec 2003 22:51:46 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_variant.h" - -class KVIRC_API KviKvsRWEvaluationResult -{ -public: - // this result becomes the owner of the parent result!!!! - KviKvsRWEvaluationResult(KviKvsRWEvaluationResult *pParent,KviKvsVariant *pVariant); - // the destructor must do (in order): - // check if variant is empty and if it is then remove it from the container (destroy it) - // delete the m_pParent result - virtual ~KviKvsRWEvaluationResult(); -protected: - KviKvsRWEvaluationResult * m_pParent; - KviKvsVariant * m_pVariant; -public: - KviKvsVariant * result(){ return m_pVariant; }; -}; - -class KviKvsArray; - -class KVIRC_API KviKvsArrayElement : public KviKvsRWEvaluationResult -{ -public: - KviKvsArrayElement(KviKvsRWEvaluationResult *pParent,KviKvsVariant *pVariant,KviKvsArray *pArray,int iKey); - ~KviKvsArrayElement(); -protected: - KviKvsArray * m_pArray; - int m_iKey; -}; - -class KviKvsHash; - -class KVIRC_API KviKvsHashElement : public KviKvsRWEvaluationResult -{ -public: - KviKvsHashElement(KviKvsRWEvaluationResult *pParent,KviKvsVariant *pVariant,KviKvsHash *pHash,const QString &szKey); - ~KviKvsHashElement(); -protected: - KviKvsHash * m_pHash; - QString m_szKey; -}; - -#endif //!_KVI_KVS_RWEVALUATIONRESULT_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_script.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_script.cpp deleted file mode 100644 index 6fcb9d8674..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_script.cpp +++ /dev/null @@ -1,356 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_script.cpp -// Creation date : Thu 25 Sep 2003 05.12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_script.h" -#include "kvi_kvs_parser.h" -#include "kvi_kvs_report.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_treenode_instruction.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_kernel.h" - -#include "kvi_locale.h" -#include "kvi_out.h" -#include "kvi_mirccntrl.h" -#include "kvi_window.h" -#include "kvi_app.h" - -class KVIRC_API KviKvsScriptData -{ - friend class KviKvsScript; -protected: - unsigned int m_uRefs; // Reference count for this structure - - QString m_szName; // script context name - QString m_szBuffer; // NEVER TOUCH THIS - const QChar * m_pBuffer; // this points to m_szBuffer: use it to extract string data - - KviKvsScript::ScriptType m_eType; // the type of the code in m_szBuffer - - KviKvsTreeNodeInstruction * m_pTree; // syntax tree - unsigned int m_uLock; // this is increased while the script is being executed -}; - -//#warning "THERE IS SOME MESS WITH m_szBuffer and m_pBuffer : with some script copying we may get errors with negative char indexes!" - -KviKvsScript::KviKvsScript(const QString &szName,const QString &szBuffer,ScriptType eType) -{ - m_pData = new KviKvsScriptData; - m_pData->m_uRefs = 1; - m_pData->m_szName = szName; - m_pData->m_eType = eType; - m_pData->m_szBuffer = szBuffer; - if(m_pData->m_szBuffer.isNull())m_pData->m_szBuffer = ""; - //KviQString::detach(*(m_pData->m_pszBuffer)); - m_pData->m_pBuffer = KviQString::nullTerminatedArray(m_pData->m_szBuffer); // never 0 - m_pData->m_uLock = 0; - m_pData->m_pTree = 0; -} - -KviKvsScript::KviKvsScript(const QString &szName,const QString &szBuffer,KviKvsTreeNodeInstruction * pPreparsedTree,ScriptType eType) -{ - m_pData = new KviKvsScriptData; - m_pData->m_uRefs = 1; - m_pData->m_szName = szName; - m_pData->m_szBuffer = szBuffer; - m_pData->m_eType = eType; - if(m_pData->m_szBuffer.isNull())m_pData->m_szBuffer = ""; - //KviQString::detach(*(m_pData->m_pszBuffer)); - m_pData->m_pBuffer = KviQString::nullTerminatedArray(m_pData->m_szBuffer); // never 0 - m_pData->m_uLock = 0; - m_pData->m_pTree = pPreparsedTree; -} - -KviKvsScript::KviKvsScript(const KviKvsScript &src) -{ - m_pData = src.m_pData; - m_pData->m_uRefs++; -} - -KviKvsScript::~KviKvsScript() -{ - if(m_pData->m_uRefs < 2) - { - if(m_pData->m_uLock)debug("WARNING: Destroying a locked KviKvsScript"); - if(m_pData->m_pTree)delete m_pData->m_pTree; - delete m_pData; - } else { - m_pData->m_uRefs--; - } -} - -void KviKvsScript::setName(const QString &szName) -{ - if(m_pData->m_uRefs > 1)detach(); - m_pData->m_szName = szName; -} - -const QString & KviKvsScript::name() const -{ - return m_pData->m_szName; -} - -const QString & KviKvsScript::code() const -{ - return m_pData->m_szBuffer; -} - -bool KviKvsScript::locked() const -{ - return m_pData->m_uLock > 0; -} - -void KviKvsScript::dump(const char * prefix) -{ - if(m_pData->m_pTree)m_pData->m_pTree->dump(prefix); - else debug("%s KviKvsScript : no tree to dump",prefix); -} - -void KviKvsScript::detach() -{ - if(m_pData->m_uRefs <= 1)return; - m_pData->m_uRefs--; - KviKvsScriptData * d = new KviKvsScriptData; - d->m_uRefs = 1; - d->m_eType = m_pData->m_eType; - d->m_szBuffer = m_pData->m_szBuffer; - if(d->m_szBuffer.isNull())d->m_szBuffer = ""; - KviQString::detach(d->m_szBuffer); - d->m_pBuffer = KviQString::nullTerminatedArray(d->m_szBuffer); // never 0 - d->m_uLock = 0; - d->m_pTree = 0; - m_pData = d; -} - -const QChar * KviKvsScript::buffer() const -{ - return m_pData->m_pBuffer; -} - -int KviKvsScript::run(const QString &szCode,KviWindow * pWindow,KviKvsVariantList * pParams,KviKvsVariant * pRetVal) -{ - // static helper - KviKvsScript s("kvirc::corecall(run)",szCode); - return s.run(pWindow,pParams,pRetVal,PreserveParams); -} - -int KviKvsScript::evaluate(const QString &szCode,KviWindow * pWindow,KviKvsVariantList * pParams,KviKvsVariant * pRetVal) -{ - // static helper - KviKvsScript s("kvirc::corecall(evalutate)",szCode,Parameter); - return s.run(pWindow,pParams,pRetVal,PreserveParams); -} - -int KviKvsScript::evaluateAsString(const QString &szCode,KviWindow * pWindow,KviKvsVariantList * pParams,QString &szRetVal) -{ - // static helper - KviKvsVariant ret; - KviKvsScript s("kvirc::corecall(evalutate)",szCode,Parameter); - int iRet = s.run(pWindow,pParams,&ret,PreserveParams); - ret.asString(szRetVal); - return iRet; -} - -int KviKvsScript::run(KviWindow * pWnd,KviKvsVariantList * pParams,QString &szRetVal,int iRunFlags,KviKvsExtendedRunTimeData * pExtData) -{ - KviKvsVariant retVal; - int iRet = run(pWnd,pParams,&retVal,iRunFlags,pExtData); - retVal.asString(szRetVal); - return iRet; -} - -//static long int g_iTreeCacheHits = 0; -//static long int g_iTreeCacheMisses = 0; - -int KviKvsScript::run(KviWindow * pWnd,KviKvsVariantList * pParams,KviKvsVariant * pRetVal,int iRunFlags,KviKvsExtendedRunTimeData * pExtData) -{ - if(!m_pData->m_pTree) - { - //g_iTreeCacheMisses++; - //debug("CREATING TREE FOR SCRIPT %s",name().latin1()); - //debug("TREE CACHE STATS: HITS=%d, MISSES=%d",g_iTreeCacheHits,g_iTreeCacheMisses); - if(!parse(pWnd,iRunFlags)) - { - if(pParams && !(iRunFlags & PreserveParams))delete pParams; - return Error; - } - } else { - //g_iTreeCacheHits++; - //debug("USING A CACHED TREE FOR SCRIPT %s",name().latin1()); - //debug("TREE CACHE STATS: HITS=%d, MISSES=%d",g_iTreeCacheHits,g_iTreeCacheMisses); - } - - return execute(pWnd,pParams,pRetVal,iRunFlags,pExtData); -} - -int KviKvsScript::run(KviKvsRunTimeContext * pContext,int iRunFlags) -{ - if(!m_pData->m_pTree) - { - //g_iTreeCacheMisses++; - //debug("CREATING TREE FOR SCRIPT %s",name().latin1()); - //debug("TREE CACHE STATS: HITS=%d, MISSES=%d",g_iTreeCacheHits,g_iTreeCacheMisses); - if(!parse(pContext->window(),iRunFlags)) - return Error; - } else { - //g_iTreeCacheHits++; - //debug("USING A CACHED TREE FOR SCRIPT %s",name().latin1()); - //debug("TREE CACHE STATS: HITS=%d, MISSES=%d",g_iTreeCacheHits,g_iTreeCacheMisses); - } - - int iRet; - - if(iRunFlags & Quiet) - { - bool bMustReEnable = !(pContext->reportingDisabled()); - pContext->disableReporting(); - iRet = executeInternal(pContext); - if(bMustReEnable)pContext->enableReporting(); - } else { - iRet = executeInternal(pContext); - } - - return iRet; -} - - -bool KviKvsScript::parse(KviWindow * pOutput,int iRunFlags) -{ - if(m_pData->m_pTree) - { - // there is already a tree - // if we have more than one ref, detach! - if(m_pData->m_uRefs > 1) - { - // mmmh.. more than one ref! .. detach - detach(); - } else { - // only a single ref: we're the owner of the tree - if(m_pData->m_uLock) - { - // ops... someone is locked in THIS script object - debug("WARNING: Trying to reparse a locked KviKvsScript!"); - return false; - } - if(m_pData->m_pTree)delete m_pData->m_pTree; - m_pData->m_pTree = 0; - } - } // else there is no tree at all, nobody can be locked inside - - KviKvsParser p(this,(iRunFlags & Quiet) ? 0 : pOutput); - // parse never blocks - - int iFlags = iRunFlags & AssumeLocals ? KviKvsParser::AssumeLocals : 0; - if(iRunFlags & Pedantic)iFlags |= KviKvsParser::Pedantic; - - switch(m_pData->m_eType) - { - case Expression: - m_pData->m_pTree = p.parseAsExpression(m_pData->m_pBuffer,iFlags); - break; - case Parameter: - m_pData->m_pTree = p.parseAsParameter(m_pData->m_pBuffer,iFlags); - break; - case InstructionList: - default: - m_pData->m_pTree = p.parse(m_pData->m_pBuffer,iFlags); - break; - } - - //debug("\n\nDUMPING SCRIPT"); - //dump(""); - //debug("END OF SCRIPT DUMP\n\n"); - - return !p.error(); -} - - -int KviKvsScript::executeInternal(KviKvsRunTimeContext * pContext) -{ - // lock this script - m_pData->m_uLock++; - - int iRunStatus = Success; - - if(!m_pData->m_pTree->execute(pContext)) - { - if(pContext->error())iRunStatus = Error; - else { - // else just a halt, return or sth like that - if(pContext->haltCalled()) - iRunStatus |= HaltEncountered; - } - } - - // we can't block any longer: unlock - m_pData->m_uLock--; - - return iRunStatus; -} - -int KviKvsScript::execute(KviWindow * pWnd,KviKvsVariantList * pParams,KviKvsVariant * pRetVal,int iRunFlags,KviKvsExtendedRunTimeData * pExtData) -{ - bool bDeleteParams = !(iRunFlags & PreserveParams); - - // do we have a parsed tree ? - if(!m_pData->m_pTree) - { - if(pParams && bDeleteParams)delete pParams; - // this is intended for developers only - pWnd->outputNoFmt(KVI_OUT_PARSERERROR,"[developer error]: you must succesfully call KviKvsScript::parse() before KviKvsScript::execute()"); - return Error; - } - // do we need to pass dummy params ? - if(!pParams) - { - pParams = KviKvsKernel::instance()->emptyParameterList(); - bDeleteParams = false; - } - - bool bDeleteRetVal = false; - - if(!pRetVal) - { - pRetVal = new KviKvsVariant(); - bDeleteRetVal = true; - } - - KviKvsRunTimeContext ctx(this,pWnd,pParams,pRetVal,pExtData); - - if(iRunFlags & Quiet) - ctx.disableReporting(); - - int iRunStatus = executeInternal(&ctx); - - // don't forget to delete the params - if(bDeleteParams)delete pParams; - if(bDeleteRetVal)delete pRetVal; - pParams = 0; pRetVal = 0; - return iRunStatus; -} - - - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_script.h b/3.4.0/src/kvirc/kvs/kvi_kvs_script.h deleted file mode 100644 index d2befedcbe..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_script.h +++ /dev/null @@ -1,155 +0,0 @@ -#ifndef _KVI_KVS_SCRIPT_H_ -#define _KVI_KVS_SCRIPT_H_ -//============================================================================= -// -// File : kvi_kvs_script.h -// Creation date : Thu 25 Sep 2003 05.12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_window.h" -#include "kvi_pointerlist.h" -#include "kvi_kvs_variant.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_heapobject.h" - -class KviKvsTreeNodeInstruction; -class KviKvsExtendedRunTimeData; -class KviKvsScriptData; -class KviKvsReport; -class KviKvsRunTimeContext; - -// X defines this stuff: ugly :/ -#ifdef Error - #undef Error -#endif -#ifdef Success - #undef Success -#endif - -class KVIRC_API KviKvsScript : public KviHeapObject -{ - friend class KviKvsObject; - friend class KviKvsParser; - friend class KviKvsRunTimeContext; -public: - enum RunStatus { - // the script returned an error - Error = 0, - // the script ran succesfully - Success = 1, - // the script ran succesfully and halt was encountered - HaltEncountered = 2 - }; - enum ScriptType { - // the most common script type: a sequence of instructions - InstructionList, - // an expression to be evaluated as in a $() call (pRetVal should be always set!) - Expression, - // a parameter to be evaluated (pRetVal should be always set!) - Parameter - }; -protected: - // the name parameter is the name of the script context! - KviKvsScript(const QString &szName,const QString &szBuffer,KviKvsTreeNodeInstruction * pPreparsedTree,ScriptType eType = InstructionList); -public: - // shallow copy of the script data - // useful when a script can be destroyed while running (like in timers) - KviKvsScript(const KviKvsScript &src); - KviKvsScript(const QString &szName,const QString &szBuffer,ScriptType eType=InstructionList); - ~KviKvsScript(); -private: - KviKvsScriptData * m_pData; -public: - const QString & name() const; - const QString & code() const; - bool locked() const; - - void setName(const QString &szName); - - enum RunFlags { - // do not delete the eventual parameters passed (only execute() and run()) - PreserveParams = 1, - // assume that the variables are local unless explicitly declared (flag used only for parse()) - AssumeLocals = 2, // FIXME: This should be a global option, eventually - // be more pedantic: spit more warnings and sometimes more errors - Pedantic = 4, // FIXME: This should be a global option, eventually - // don't print any errors - Quiet = 8 - }; - // returns 0 (KviKvsScript::RunFailure) on error - // returns a nonzero combination of RunStatus flags on success - int run(KviWindow * pWnd, // window that the command has to be bound to - KviKvsVariantList * pParams = 0, // parameter list (0 if you don't pass params) ownership transferred if PreserverParams is not used - KviKvsVariant * pRetVal = 0, // return value buffer (0 if you ignore it) - int iRunFlags = 0, // a combination of run flags (usually default) - KviKvsExtendedRunTimeData * pExtData = 0); // extended data (usually 0) (if you need to pass extended scope variables or alias switch lists...) - - // returns 0 (KviKvsScript::RunFailure) on error - // returns a nonzero combination of RunStatus flags on success - // this is probably used only in /eval - int run(KviKvsRunTimeContext * pContext,int iRunFlags = 0); - - // same as run above, but gets a QString parameter as return buffer - // this is probably useful only for evaluating InstructionList scripts - int run(KviWindow * pWnd, - KviKvsVariantList * pParams, - QString &szRetVal, - int iRunFlags = 0, - KviKvsExtendedRunTimeData * pExtData = 0); - - // static helpers for quick running - // returns a combination of RunStatus flags (nonzero on no error) - // does NOT take params ownership - static int run(const QString &szCode,KviWindow * pWindow,KviKvsVariantList * pParams = 0,KviKvsVariant * pRetVal = 0); - - // static helper for quick evaluating parameters - // returns a combination of RunStatus flags (nonzero on no error) - // does NOT take params ownership - // pRetVal CAN'T be zero here since we're evaluating stuff here - static int evaluate(const QString &szCode,KviWindow * pWindow,KviKvsVariantList * pParams,KviKvsVariant * pRetVal); - static int evaluateAsString(const QString &szCode,KviWindow * pWindow,KviKvsVariantList * pParams,QString &szRetVal); -public: - void dump(const char * prefix); -protected: - // returns true after a succesfull parsing - // pOutput is useful only for printing errors - // if 0 , no errors are printed - bool parse(KviWindow * pOutput = 0, - int iRunFlags = 0); - // returns 0 (KviKvsScript::RunFailure) on error - // returns a nonzero combination of RunStatus flags on success - int execute(KviWindow * pWnd, - KviKvsVariantList * pParams = 0, - KviKvsVariant * pRetVal = 0, - int iRunFlags = 0, - KviKvsExtendedRunTimeData * pExtData = 0); - // returns 0 (KviKvsScript::RunFailure) on error - // returns a nonzero combination of RunStatus flags on success - int executeInternal(KviKvsRunTimeContext * pContext); - const QChar * buffer() const; - // detaches this script from any other shallow copies - void detach(); -}; - - -#endif //!_KVI_KVS_SCRIPT_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_scriptaddonmanager.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_scriptaddonmanager.cpp deleted file mode 100644 index 2c2de54616..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_scriptaddonmanager.cpp +++ /dev/null @@ -1,386 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_scriptaddonmanager.cpp -// Created on Thu 31 Mar 2005 01:21:23 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_scriptaddonmanager.h" -#include "kvi_kvs_script.h" -#include "kvi_config.h" -#include "kvi_window.h" -#include "kvi_iconmanager.h" - -KviKvsScriptAddonManager * KviKvsScriptAddonManager::m_pInstance = 0; - - - - -KviKvsScriptAddon::KviKvsScriptAddon( - const QString &szName, - const QString &szVersion, - const QString &szVisibleNameCode, - const QString &szDescriptionCode, - const QString &szUninstallCallbackCode, - const QString &szIconId -) : KviHeapObject(), m_szName(szName), m_szVersion(szVersion), m_szIconId(szIconId) -{ - allocateScripts(szVisibleNameCode,szDescriptionCode,szUninstallCallbackCode); - m_pConfigureCallback = 0; - m_pHelpCallback = 0; -} - -KviKvsScriptAddon::KviKvsScriptAddon(const KviKvsScriptAddon &a) -: KviHeapObject() -{ - m_szName = a.m_szName; - m_szVersion = a.m_szVersion; - m_szIconId = a.m_szIconId; - allocateScripts(a.m_pVisibleNameScript->code(),a.m_pDescriptionScript->code(),a.m_pUninstallCallback ? a.m_pUninstallCallback->code() : QString::null); - m_pConfigureCallback = 0; - setConfigureCallback(a.m_pConfigureCallback ? a.m_pConfigureCallback->code() : QString::null); - m_pHelpCallback = 0; - setHelpCallback(a.m_pHelpCallback ? a.m_pHelpCallback->code() : QString::null); -} - -KviKvsScriptAddon::KviKvsScriptAddon() -: KviHeapObject() -{ - m_pVisibleNameScript = 0; - m_pDescriptionScript = 0; - m_pUninstallCallback = 0; - m_pConfigureCallback = 0; - m_pHelpCallback = 0; -} - -KviKvsScriptAddon::~KviKvsScriptAddon() -{ - if(m_pVisibleNameScript)delete m_pVisibleNameScript; - if(m_pDescriptionScript)delete m_pDescriptionScript; - if(m_pUninstallCallback)delete m_pUninstallCallback; - if(m_pConfigureCallback)delete m_pConfigureCallback; - if(m_pHelpCallback)delete m_pHelpCallback; -} - -QPixmap * KviKvsScriptAddon::icon() -{ - return g_pIconManager->getBigIcon(m_szIconId.isEmpty() ? QString(KVI_BIGICON_KVS) : m_szIconId); -} - -const QString & KviKvsScriptAddon::visibleName() -{ - if(!m_pVisibleNameScript)return m_szVisibleName; - if(!m_pVisibleNameScript->run(g_pActiveWindow,0,m_szVisibleName))m_szVisibleName = m_pVisibleNameScript->code(); - return m_szVisibleName; -} - -const QString & KviKvsScriptAddon::description() -{ - if(!m_pDescriptionScript)return m_szDescription; - if(!m_pDescriptionScript->run(g_pActiveWindow,0,m_szDescription))m_szDescription = m_pDescriptionScript->code(); - return m_szDescription; -} - -const QString & KviKvsScriptAddon::visibleNameCode() -{ - return m_pVisibleNameScript->code(); -} - -const QString & KviKvsScriptAddon::descriptionCode() -{ - return m_pDescriptionScript->code(); -} - -const QString & KviKvsScriptAddon::uninstallCallbackCode() -{ - return m_pUninstallCallback->code(); -} - -const QString & KviKvsScriptAddon::configureCallbackCode() -{ - if(m_pConfigureCallback)return m_pConfigureCallback->code(); - return KviQString::empty; -} - -const QString & KviKvsScriptAddon::helpCallbackCode() -{ - if(m_pHelpCallback)return m_pHelpCallback->code(); - return KviQString::empty; -} - -bool KviKvsScriptAddon::load(KviConfig * cfg,const QString &szName) -{ - m_szName = szName; - cfg->setGroup(m_szName); - m_szVersion = cfg->readQStringEntry("Version"); - m_szIconId = cfg->readQStringEntry("IconId"); - if(m_szVersion.isEmpty())return false; - QString tmp1,tmp2,tmp3; - tmp1 = cfg->readQStringEntry("VisibleNameCode"); - tmp2 = cfg->readQStringEntry("DescriptionCode"); - tmp3 = cfg->readQStringEntry("UninstallCallback"); - if(tmp1.isEmpty())return false; - allocateScripts(tmp1,tmp2,tmp3); - tmp1 = cfg->readQStringEntry("ConfigureCallback"); - if(!tmp1.isEmpty()) - setConfigureCallback(tmp1); - tmp1 = cfg->readQStringEntry("HelpCallback"); - if(!tmp1.isEmpty()) - setHelpCallback(tmp1); - return true; -} - -void KviKvsScriptAddon::setConfigureCallback(const QString &szConfigureCallbackCode) -{ - if(m_pConfigureCallback)delete m_pConfigureCallback; - if(szConfigureCallbackCode.isEmpty()) - { - m_pConfigureCallback = 0; - return; - } - - QString szKvsName = "addon::"; - szKvsName += m_szName; - - QString szTmp; - - szTmp = szKvsName; - szTmp += "::configure"; - m_pConfigureCallback = new KviKvsScript(szTmp,szConfigureCallbackCode,KviKvsScript::InstructionList); -} - -void KviKvsScriptAddon::setHelpCallback(const QString &szHelpCallbackCode) -{ - if(m_pHelpCallback)delete m_pHelpCallback; - if(szHelpCallbackCode.isEmpty()) - { - m_pHelpCallback = 0; - return; - } - - QString szKvsName = "addon::"; - szKvsName += m_szName; - - QString szTmp; - - szTmp = szKvsName; - szTmp += "::help"; - m_pHelpCallback = new KviKvsScript(szTmp,szHelpCallbackCode,KviKvsScript::InstructionList); -} - -void KviKvsScriptAddon::allocateScripts(const QString &szVisibleNameCode,const QString &szDescriptionCode,const QString &szUninstallCallbackCode) -{ - QString szKvsName = "addon::"; - szKvsName += m_szName; - - QString szTmp; - - szTmp = szKvsName; - szTmp += "::name"; - m_pVisibleNameScript = new KviKvsScript(szTmp,szVisibleNameCode,KviKvsScript::Parameter); - szTmp = szKvsName; - szTmp += "::description"; - m_pDescriptionScript = new KviKvsScript(szTmp,szDescriptionCode,KviKvsScript::Parameter); - szTmp = szKvsName; - szTmp += "::uninstall"; - m_pUninstallCallback = new KviKvsScript(szTmp,szUninstallCallbackCode,KviKvsScript::InstructionList); -} - -void KviKvsScriptAddon::save(KviConfig * cfg) -{ - cfg->setGroup(m_szName); - cfg->writeEntry("Version",m_szVersion); - cfg->writeEntry("VisibleNameCode",visibleNameCode()); - cfg->writeEntry("DescriptionCode",descriptionCode()); - cfg->writeEntry("UninstallCallback",uninstallCallbackCode()); - cfg->writeEntry("ConfigureCallback",configureCallbackCode()); - cfg->writeEntry("HelpCallback",helpCallbackCode()); - cfg->writeEntry("IconId",m_szIconId); -} - -void KviKvsScriptAddon::executeUninstallCallback(KviWindow * pWnd) -{ - if(!m_pUninstallCallback)return; - m_pUninstallCallback->run(pWnd); -} - -void KviKvsScriptAddon::executeConfigureCallback(KviWindow * pWnd) -{ - if(!m_pConfigureCallback)return; - m_pConfigureCallback->run(pWnd); -} - -void KviKvsScriptAddon::executeHelpCallback(KviWindow * pWnd) -{ - if(!m_pHelpCallback)return; - m_pHelpCallback->run(pWnd); -} - - - - - -KviKvsScriptAddonManager::KviKvsScriptAddonManager() -{ - m_pInstance = this; - m_bLoaded = false; - m_pAddonDict = new KviPointerHashTable<QString,KviKvsScriptAddon>(17,false); - m_pAddonDict->setAutoDelete(true); -} - -KviKvsScriptAddonManager::~KviKvsScriptAddonManager() -{ - delete m_pAddonDict; -} - -void KviKvsScriptAddonManager::init() -{ - if(KviKvsScriptAddonManager::instance()) - { - debug("WARNING: Trying to create the KviKvsScriptAddonManager twice!"); - return; - } - (void)new KviKvsScriptAddonManager(); -} - -void KviKvsScriptAddonManager::done() -{ - if(!KviKvsScriptAddonManager::instance()) - { - debug("WARNING: Trying to destroy the KviKvsScriptAddonManager twice!"); - return; - } - delete KviKvsScriptAddonManager::instance(); -} - -void KviKvsScriptAddonManager::load(const QString &szFileName) -{ - // in fact we implement delayed loading - // so this function only stores the filename - // from which we will load at the first request - m_szFileName = szFileName; - // this to make sure that we reload the addons - // if someone explicitly requests a load after we have already loaded - // (this does not happen in kvirc tough at the moment) - m_bLoaded = false; -} - -void KviKvsScriptAddonManager::save(const QString &szFileName) -{ - if(!m_bLoaded)return; // nothing to store anyway - // we're stored here from now on... - m_szFileName = szFileName; - - KviConfig cfg(szFileName,KviConfig::Write); - - cfg.clear(); - - KviPointerHashTableIterator<QString,KviKvsScriptAddon> it(*m_pAddonDict); - - while(KviKvsScriptAddon * a = it.current()) - { - cfg.setGroup(a->name()); - a->save(&cfg); - ++it; - } -} - -void KviKvsScriptAddonManager::delayedLoad() -{ - if(m_bLoaded)return; // already loaded - m_bLoaded = true; - // ::load() might be never called if we don't have - // a scriptaddons.kvc file on disk, KviApp checks that. - // So finally m_szFileName may be empty here - if(m_szFileName.isEmpty())return; - - KviConfig cfg(m_szFileName,KviConfig::Read); - - KviPointerHashTable<QString,KviConfigGroup> * d = cfg.dict(); - if(!d)return; - - KviPointerHashTableIterator<QString,KviConfigGroup> it(*d); - while(it.current()) - { - QString szName = it.currentKey(); - KviKvsScriptAddon * a = new KviKvsScriptAddon(); - if(a->load(&cfg,szName)) - m_pAddonDict->replace(szName,a); - else - delete a; - ++it; - } -} - -KviPointerHashTable<QString,KviKvsScriptAddon> * KviKvsScriptAddonManager::addonDict() -{ - if(!m_bLoaded)delayedLoad(); - return m_pAddonDict; -} - - - - - -bool KviKvsScriptAddonManager::registerAddon(KviKvsScriptAddonRegistrationData * d) -{ - if(findAddon(d->szName))return false; - KviKvsScriptAddon * a = new KviKvsScriptAddon( - d->szName, - d->szVersion, - d->szVisibleNameScript, - d->szDescriptionScript, - d->szUninstallCallbackScript, - d->szIconId); - m_pAddonDict->replace(d->szName,a); - return true; -} - -KviKvsScriptAddon * KviKvsScriptAddonManager::findAddon(const QString &szName) -{ - if(!m_bLoaded)delayedLoad(); - return m_pAddonDict->find(szName); -} - -bool KviKvsScriptAddonManager::unregisterAddon(const QString &szName,KviWindow * pWnd,bool bExecuteUninstallCallback) -{ - KviKvsScriptAddon * a = findAddon(szName); - if(!a)return false; - - // remove the addon before executing the uninstall callback - // so the user effectively can't call addon.unregister on itself in the uninstall callback code :D - m_pAddonDict->setAutoDelete(false); - m_pAddonDict->remove(szName); - m_pAddonDict->setAutoDelete(true); - - if(bExecuteUninstallCallback) - a->executeUninstallCallback(pWnd); - - delete a; - return true; -} - -void KviKvsScriptAddonManager::clear() -{ - if(!m_bLoaded)delayedLoad(); - m_pAddonDict->clear(); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_scriptaddonmanager.h b/3.4.0/src/kvirc/kvs/kvi_kvs_scriptaddonmanager.h deleted file mode 100644 index a1142369ae..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_scriptaddonmanager.h +++ /dev/null @@ -1,129 +0,0 @@ -#ifndef _KVI_KVS_SCRIPTADDONMANAGER_H_ -#define _KVI_KVS_SCRIPTADDONMANAGER_H_ -//============================================================================= -// -// File : kvi_kvs_scriptaddonmanager.h -// Created on Thu 31 Mar 2005 01:21:23 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_heapobject.h" -#include "kvi_qstring.h" -#include "kvi_pointerhashtable.h" - - -class KviConfig; -class KviKvsScript; -class KviWindow; -class QPixmap; - -class KVIRC_API KviKvsScriptAddon : public KviHeapObject -{ - friend class KviKvsScriptAddonManager; -protected: - KviKvsScriptAddon(); - KviKvsScriptAddon( - const QString &szName, - const QString &szVersion, - const QString &szVisibleNameCode, - const QString &szDescriptionCode, - const QString &szUninstallCallbackCode, - const QString &szIconId - ); -public: - KviKvsScriptAddon(const KviKvsScriptAddon &a); -public: // KviDict wants that... how to restrict the deletion to KviKvsScriptAddonManager only ? - ~KviKvsScriptAddon(); -protected: - QString m_szName; // the short name of the addon - QString m_szVersion; // x.y.z - KviKvsScript * m_pVisibleNameScript; // the visible name, possibly translated - KviKvsScript * m_pDescriptionScript; // the description, possibly translated - KviKvsScript * m_pUninstallCallback; // uninstall callback - KviKvsScript * m_pConfigureCallback; // configure callback - KviKvsScript * m_pHelpCallback; // help callback - QString m_szDescription; // parsed description - QString m_szVisibleName; // parsed visible name - QString m_szIconId; -public: - const QString &name() const { return m_szName; }; - const QString &version() const { return m_szVersion; }; - const QString &visibleName(); - const QString &description(); - const QString &visibleNameCode(); - const QString &descriptionCode(); - const QString &uninstallCallbackCode(); - const QString &configureCallbackCode(); - const QString &helpCallbackCode(); - const QString &iconId(){ return m_szIconId; }; - QPixmap * icon(); - void setConfigureCallback(const QString &szConfigureCallbackCode); - void setHelpCallback(const QString &szHelpCallbackCode); - void executeConfigureCallback(KviWindow * pWnd); - void executeHelpCallback(KviWindow * pWnd); -protected: - bool load(KviConfig * cfg,const QString &szName); - void save(KviConfig * cfg); - void executeUninstallCallback(KviWindow * pWnd); - // this assumes that the script pointers are clean (i.e. not needing to be freed!) - void allocateScripts(const QString &sVisibleNameCode,const QString &szDescriptionCode,const QString &szUninstallCallbackCode); -}; - -class KVIRC_API KviKvsScriptAddonRegistrationData -{ -public: - QString szName; // the addon name - QString szVersion; // the addon version in form x.y.z - QString szVisibleNameScript; // the code that evaluates to the visible name, possibly translated - QString szDescriptionScript; // the code that evaluates to the description, possibly translated - QString szUninstallCallbackScript; // the uninstall callback code, will be executed at uninstallation - QString szIconId; // the icon identifier (scaled to 32x32 atm) -}; - -class KVIRC_API KviKvsScriptAddonManager -{ -public: - KviKvsScriptAddonManager(); - ~KviKvsScriptAddonManager(); -protected: - static KviKvsScriptAddonManager * m_pInstance; - // this class implements delayed loading - QString m_szFileName; // the file name that we will load from - bool m_bLoaded; // have we loaded stuff from disk yet ? - KviPointerHashTable<QString,KviKvsScriptAddon> * m_pAddonDict; // all the registered addons -public: - static KviKvsScriptAddonManager * instance(){ return m_pInstance; }; - static void init(); // called by KviKvs::init() - static void done(); // called by KviKvs::done() - - bool registerAddon(KviKvsScriptAddonRegistrationData * d); - KviKvsScriptAddon * findAddon(const QString &szName); - bool unregisterAddon(const QString &szName,KviWindow * pWnd,bool bExecuteUninstallCallback = true); - KviPointerHashTable<QString,KviKvsScriptAddon> * addonDict(); - - void clear(); - void load(const QString &szFileName); // called in the KviKvs namespace - void save(const QString &szFileName); // called in the KViKvs namespace -protected: - void delayedLoad(); -}; - -#endif //!_KVI_KVS_SCRIPTADDONMANAGER_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_switchlist.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_switchlist.cpp deleted file mode 100644 index 050690256b..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_switchlist.cpp +++ /dev/null @@ -1,75 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_switchlist.cpp -// Created on Mon 27 Oct 2003 03:47:48 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_switchlist.h" - -KviKvsSwitchList::KviKvsSwitchList() -{ - m_pShortSwitchDict = 0; - m_pLongSwitchDict = 0; -} - - -KviKvsSwitchList::~KviKvsSwitchList() -{ - if(m_pShortSwitchDict)delete m_pShortSwitchDict; - if(m_pLongSwitchDict)delete m_pLongSwitchDict; -} - -void KviKvsSwitchList::clear() -{ - if(m_pShortSwitchDict) - { - delete m_pShortSwitchDict; - m_pShortSwitchDict = 0; - } - if(m_pLongSwitchDict) - { - delete m_pLongSwitchDict; - m_pLongSwitchDict = 0; - } -} - -void KviKvsSwitchList::addShort(unsigned short uShortKey,KviKvsVariant * pVariant) -{ - if(!m_pShortSwitchDict) - { - m_pShortSwitchDict = new KviPointerHashTable<unsigned short,KviKvsVariant>(11); - m_pShortSwitchDict->setAutoDelete(true); - } - m_pShortSwitchDict->replace(uShortKey,pVariant); -} - -void KviKvsSwitchList::addLong(const QString &szLongKey,KviKvsVariant * pVariant) -{ - if(!m_pLongSwitchDict) - { - m_pLongSwitchDict = new KviPointerHashTable<QString,KviKvsVariant>(11); - m_pLongSwitchDict->setAutoDelete(true); - } - m_pLongSwitchDict->replace(szLongKey,pVariant); -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_switchlist.h b/3.4.0/src/kvirc/kvs/kvi_kvs_switchlist.h deleted file mode 100644 index f8b2dfb88d..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_switchlist.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef _KVI_KVS_SWITCHLIST_H_ -#define _KVI_KVS_SWITCHLIST_H_ -//============================================================================= -// -// File : kvi_kvs_switchlist.h -// Created on Mon 27 Oct 2003 03:47:48 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_variant.h" - -#include "kvi_pointerhashtable.h" -#include "kvi_pointerhashtable.h" - -class KVIRC_API KviKvsSwitchList -{ -public: - KviKvsSwitchList(); - ~KviKvsSwitchList(); -protected: - KviPointerHashTable<unsigned short,KviKvsVariant> * m_pShortSwitchDict; - KviPointerHashTable<QString,KviKvsVariant> * m_pLongSwitchDict; -public: - void clear(); - void addShort(unsigned short uShortKey,KviKvsVariant * pVariant); - void addLong(const QString &szLongKey,KviKvsVariant * pVariant); - - bool isEmpty(){ return ((m_pShortSwitchDict == 0) && (m_pLongSwitchDict == 0)); }; - - KviKvsVariant * find(const QChar &c) - { - return m_pShortSwitchDict ? m_pShortSwitchDict->find(c.unicode()) : 0; - }; - - KviKvsVariant * find(unsigned short uShortKey) - { - return m_pShortSwitchDict ? m_pShortSwitchDict->find((int)uShortKey) : 0; - }; - - KviKvsVariant * find(const QString &szLongKey) - { - return m_pLongSwitchDict ? m_pLongSwitchDict->find(szLongKey) : 0; - }; - - KviKvsVariant * find(unsigned short uShortKey,const QString &szLongKey) - { - if(m_pLongSwitchDict) - { - KviKvsVariant * t; - t = m_pLongSwitchDict->find(szLongKey); - if(t)return t; - } - return m_pShortSwitchDict ? m_pShortSwitchDict->find((int)uShortKey) : 0; - }; - - bool getAsStringIfExisting(unsigned short uShortKey,const QString &szLongKey,QString &szBuffer) - { - KviKvsVariant * v = find(uShortKey,szLongKey); - if(v) - { - v->asString(szBuffer); - return true; - } - return false; - }; -}; - -#endif //!_KVI_KVS_SWITCHLIST_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_timermanager.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_timermanager.cpp deleted file mode 100644 index c4fcaf9a71..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_timermanager.cpp +++ /dev/null @@ -1,256 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_timermanager.cpp -// Created on Fri 19 Dec 2003 01:29:22 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_timermanager.h" - -#include "kvi_kvs_script.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_runtimecontext.h" - -#include "kvi_app.h" -#include "kvi_window.h" -#include "kvi_console.h" -#include "kvi_options.h" -#include "kvi_locale.h" -#include "kvi_out.h" - - -KviKvsTimer::KviKvsTimer(const QString &szName,Lifetime l,KviWindow * pWnd,int iDelay,int iId,KviKvsScript * pCallback,KviKvsVariantList * pParams) -{ - m_szName = szName; - m_eLifetime = l; - m_pWnd = pWnd; - m_iDelay = iDelay; - m_iId = iId; - m_pCallback = pCallback; - //m_pVariables = new KviKvsHash(); - m_pRunTimeData = new KviKvsExtendedRunTimeData(new KviKvsHash(),TRUE); - m_pParameterList = pParams; -} - -KviKvsTimer::~KviKvsTimer() -{ - delete m_pRunTimeData; - delete m_pParameterList; - delete m_pCallback; -} - - - - - - - -KviKvsTimerManager * KviKvsTimerManager::m_pInstance = 0; - - -KviKvsTimerManager::KviKvsTimerManager() -: QObject() -{ - m_pTimerDictById = new KviPointerHashTable<int,KviKvsTimer>(17); - m_pTimerDictById->setAutoDelete(false); - m_pTimerDictByName = new KviPointerHashTable<QString,KviKvsTimer>(17,false); - m_pTimerDictByName->setAutoDelete(false); - m_pKilledTimerList = 0; - m_iAssassinTimer = 0; - m_iCurrentTimer = 0; -} - -KviKvsTimerManager::~KviKvsTimerManager() -{ - delete m_pTimerDictById; - m_pTimerDictByName->setAutoDelete(true); - delete m_pTimerDictByName; - if(m_pKilledTimerList)delete m_pKilledTimerList; -} - -void KviKvsTimerManager::init() -{ - if(KviKvsTimerManager::m_pInstance) - { - debug("Trying to double init() the timer manager!"); - return; - } - KviKvsTimerManager::m_pInstance = new KviKvsTimerManager(); -} - -void KviKvsTimerManager::done() -{ - if(!KviKvsTimerManager::m_pInstance) - { - debug("Trying to call done() on a non existing timer manager!"); - return; - } - delete KviKvsTimerManager::m_pInstance; - KviKvsTimerManager::m_pInstance = 0; -} - -bool KviKvsTimerManager::addTimer(const QString &szName,KviKvsTimer::Lifetime l,KviWindow * pWnd,int iDelay,KviKvsScript * pCallback,KviKvsVariantList * pParams) -{ - int iId = startTimer(iDelay); - - if(iId <= 0) - { - delete pCallback; - pCallback = 0; - delete pParams; - pParams = 0; - return false; - } - - KviKvsTimer * t = new KviKvsTimer(szName,l,pWnd,iDelay,iId,pCallback,pParams); - KviKvsTimer * old = m_pTimerDictByName->find(szName); - if(old)deleteTimer(old->id()); - m_pTimerDictByName->insert(szName,t); - m_pTimerDictById->insert(t->id(),t); - return true; -} - -bool KviKvsTimerManager::deleteTimer(const QString &szName) -{ - KviKvsTimer * t = m_pTimerDictByName->find(szName); - if(!t)return false; - killTimer(t->id()); - m_pTimerDictById->remove(t->id()); - m_pTimerDictByName->remove(szName); - scheduleKill(t); - return true; -} - -bool KviKvsTimerManager::deleteTimer(int iId) -{ - KviKvsTimer * t = m_pTimerDictById->find(iId); - if(!t)return false; - killTimer(t->id()); - m_pTimerDictById->remove(t->id()); - m_pTimerDictByName->remove(t->name()); - scheduleKill(t); - return true; -} - -bool KviKvsTimerManager::deleteCurrentTimer() -{ - if(!m_iCurrentTimer)return false; - deleteTimer(m_iCurrentTimer); - m_iCurrentTimer = 0; - return true; -} - -void KviKvsTimerManager::deleteAllTimers() -{ - if(m_pTimerDictById->isEmpty())return; - KviPointerHashTableIterator<int,KviKvsTimer> it(*m_pTimerDictById); - KviPointerList<KviKvsTimer> tl; - tl.setAutoDelete(false); - while(KviKvsTimer * t = it.current()) - { - tl.append(t); - ++it; - } - for(KviKvsTimer * dying = tl.first();dying;dying = tl.next()) - { - deleteTimer(dying->id()); - } -} - -void KviKvsTimerManager::scheduleKill(KviKvsTimer *t) -{ - if(!m_pKilledTimerList) - { - m_pKilledTimerList = new KviPointerList<KviKvsTimer>; - m_pKilledTimerList->setAutoDelete(true); - } - m_pKilledTimerList->append(t); - - if(!m_iAssassinTimer)m_iAssassinTimer = startTimer(0); -} - - -void KviKvsTimerManager::timerEvent(QTimerEvent *e) -{ - int iId = e->timerId(); - - if(iId == m_iAssassinTimer) - { - if(!m_pKilledTimerList) - { - debug("ops.. assassing timer with no victims ?"); - } else { - m_pKilledTimerList->clear(); - } - killTimer(m_iAssassinTimer); - m_iAssassinTimer = 0; - return; - } - - KviKvsTimer * t = m_pTimerDictById->find(iId); - if(!t) - { - debug("Internal error: got an nonexistant timer event"); - return; // HUH ? - } - - if(!g_pApp->windowExists(t->window())) - { - if(t->lifetime() != KviKvsTimer::Persistent) - { - deleteTimer(t->id()); - return; - } - - // rebind to an existing console - t->setWindow(g_pApp->activeConsole()); - } - - KviKvsScript copy(*(t->callback())); - - m_iCurrentTimer = t->id(); - bool bRet = copy.run(t->window(), - t->parameterList(), - 0, - KviKvsScript::PreserveParams, - t->runTimeData()); - - m_iCurrentTimer = 0; - - if(!bRet) - { - // the timer may already have been scheduled for killing! - if(KVI_OPTION_BOOL(KviOption_boolKillBrokenTimers)) - { - t->window()->output(KVI_OUT_PARSERERROR,__tr2qs("Timer '%Q' has a broken callback handler: killing the timer"),&(t->name())); - deleteTimer(t->id()); - } - return; - } - - // the timer may already have been scheduled for killing! - - if(t->lifetime() == KviKvsTimer::SingleShot) - { - deleteTimer(t->id()); - } -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_timermanager.h b/3.4.0/src/kvirc/kvs/kvi_kvs_timermanager.h deleted file mode 100644 index e11891f9b9..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_timermanager.h +++ /dev/null @@ -1,123 +0,0 @@ -#ifndef _KVI_KVS_TIMERMANAGER_H_ -#define _KVI_KVS_TIMERMANAGER_H_ -//============================================================================= -// -// File : kvi_kvs_timermanager.h -// Created on Fri 19 Dec 2003 01:29:22 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" - -#include <qobject.h> -#include "kvi_pointerhashtable.h" -#include "kvi_pointerhashtable.h" -#include "kvi_pointerlist.h" - -class KviKvsTimerManager; -class KviKvsScript; -class KviKvsHash; -class KviKvsVariantList; -class KviKvsExtendedRunTimeData; - -class KviWindow; - -// FIXME: This stuff could be moved to a module -// called timer -// timer.start(){} -// timer.stop -// timer.exists -// timer.timeout -// timer.suspend -// etc... -// Then we could remap timer.start to the old /timer call -// by hardcoding it... - -class KVIRC_API KviKvsTimer -{ - friend class KviKvsTimerManager; -public: - enum Lifetime { SingleShot, WindowLifetime, Persistent }; -protected: - KviKvsTimer(const QString &szName,Lifetime l,KviWindow * pWnd,int iDelay,int iId,KviKvsScript * pCallback,KviKvsVariantList * pParams); -public: - ~KviKvsTimer(); -protected: - Lifetime m_eLifetime; // the type of this timer - KviWindow * m_pWnd; // the window that this timer is (currently) bound to - QString m_szName; // this timer name - KviKvsScript * m_pCallback; // callback to be executed at timer shots - int m_iDelay; // the timer delay in msecs - int m_iId; // the system id of this timer - KviKvsExtendedRunTimeData * m_pRunTimeData; // ext run time data for this timer object - KviKvsVariantList * m_pParameterList; // parameter list -public: - KviWindow * window(){ return m_pWnd; }; - const QString & name(){ return m_szName; }; - const KviKvsScript * callback(){ return m_pCallback; }; - Lifetime lifetime(){ return m_eLifetime; }; - int delay(){ return m_iDelay; }; - int id(){ return m_iId; }; - //KviKvsHash * variables(){ return m_pVariables; }; - KviKvsExtendedRunTimeData * runTimeData(){ return m_pRunTimeData; }; - KviKvsVariantList * parameterList(){ return m_pParameterList; }; -protected: - void setWindow(KviWindow * pWnd){ m_pWnd = pWnd; }; -}; - - -class KVIRC_API KviKvsTimerManager : public QObject -{ - Q_OBJECT -protected: // it only can be created and destroyed by KviKvsTimerManager::init()/done() - KviKvsTimerManager(); - ~KviKvsTimerManager(); -private: - KviPointerHashTable<int,KviKvsTimer> * m_pTimerDictById; // stored by id - KviPointerHashTable<QString,KviKvsTimer> * m_pTimerDictByName; // stored by name - static KviKvsTimerManager * m_pInstance; // the one and only timer manager instance - KviPointerList<KviKvsTimer> * m_pKilledTimerList; // list of timers for that killing has been scheduled - int m_iAssassinTimer; // assassin timer id - int m_iCurrentTimer; // the timer currently executed -public: - static KviKvsTimerManager * instance(){ return m_pInstance; }; - static void init(); - static void done(); - // the pCallback and pParams are owned by the timer: they WILL be deleted - bool addTimer(const QString &szName,KviKvsTimer::Lifetime l,KviWindow * pWnd,int iDelay,KviKvsScript * pCallback,KviKvsVariantList * pParams); - bool deleteTimer(const QString &szName); - bool deleteTimer(int iId); - // the timer manager does not trigger timers concurrently - // this means that if this is called from a timer handler - // the current timer will be unique - bool deleteCurrentTimer(); - void deleteAllTimers(); - bool timerExists(const QString &szName){ return m_pTimerDictByName->find(szName); }; - KviPointerHashTable<QString,KviKvsTimer> * timerDict() - { return m_pTimerDictByName; }; -protected: - void scheduleKill(KviKvsTimer * t); - virtual void timerEvent(QTimerEvent *e); -}; - - -#endif //!_KVI_KVS_TIMERMANAGER_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode.h deleted file mode 100644 index 1ca78fe04f..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode.h +++ /dev/null @@ -1,375 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_H_ -#define _KVI_KVS_TREENODE_H_ -//============================================================================= -// -// File : kvi_kvs_treenode.h -// Creation date : Thu 25 Sep 2003 05.12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_kvs_treenode_base.h" - -#include "kvi_kvs_treenode_aliasfunctioncall.h" -#include "kvi_kvs_treenode_aliassimplecommand.h" -#include "kvi_kvs_treenode_arraycount.h" -#include "kvi_kvs_treenode_arrayelement.h" -#include "kvi_kvs_treenode_arrayorhashelement.h" -#include "kvi_kvs_treenode_arrayreferenceassert.h" -#include "kvi_kvs_treenode_baseobjectfunctioncall.h" -#include "kvi_kvs_treenode_callbackcommand.h" -#include "kvi_kvs_treenode_command.h" -#include "kvi_kvs_treenode_commandevaluation.h" -#include "kvi_kvs_treenode_commandwithparameters.h" -#include "kvi_kvs_treenode_compositedata.h" -#include "kvi_kvs_treenode_constantdata.h" -#include "kvi_kvs_treenode_corecallbackcommand.h" -#include "kvi_kvs_treenode_corefunctioncall.h" -#include "kvi_kvs_treenode_coresimplecommand.h" -#include "kvi_kvs_treenode_data.h" -#include "kvi_kvs_treenode_datalist.h" -#include "kvi_kvs_treenode_expression.h" -#include "kvi_kvs_treenode_expressionreturn.h" -#include "kvi_kvs_treenode_extendedscopevariable.h" -#include "kvi_kvs_treenode_functioncall.h" -#include "kvi_kvs_treenode_globalvariable.h" -#include "kvi_kvs_treenode_hashcount.h" -#include "kvi_kvs_treenode_hashelement.h" -#include "kvi_kvs_treenode_hashreferenceassert.h" -#include "kvi_kvs_treenode_indirectdata.h" -#include "kvi_kvs_treenode_instruction.h" -#include "kvi_kvs_treenode_instructionblock.h" -#include "kvi_kvs_treenode_localvariable.h" -#include "kvi_kvs_treenode_modulecallbackcommand.h" -#include "kvi_kvs_treenode_modulefunctioncall.h" -#include "kvi_kvs_treenode_modulesimplecommand.h" -#include "kvi_kvs_treenode_multipleparameteridentifier.h" -#include "kvi_kvs_treenode_objectfield.h" -#include "kvi_kvs_treenode_objectfunctioncall.h" -#include "kvi_kvs_treenode_operation.h" -#include "kvi_kvs_treenode_parameterreturn.h" -#include "kvi_kvs_treenode_rebindingswitch.h" -#include "kvi_kvs_treenode_scopeoperator.h" -#include "kvi_kvs_treenode_simplecommand.h" -#include "kvi_kvs_treenode_singleparameteridentifier.h" -#include "kvi_kvs_treenode_specialcommand.h" -#include "kvi_kvs_treenode_specialcommandbreak.h" -#include "kvi_kvs_treenode_specialcommandclass.h" -#include "kvi_kvs_treenode_specialcommanddefpopup.h" -#include "kvi_kvs_treenode_specialcommanddo.h" -#include "kvi_kvs_treenode_specialcommandfor.h" -#include "kvi_kvs_treenode_specialcommandforeach.h" -#include "kvi_kvs_treenode_specialcommandif.h" -#include "kvi_kvs_treenode_specialcommandswitch.h" -#include "kvi_kvs_treenode_specialcommandunset.h" -#include "kvi_kvs_treenode_specialcommandwhile.h" -#include "kvi_kvs_treenode_stringcast.h" -#include "kvi_kvs_treenode_switchlist.h" -#include "kvi_kvs_treenode_thisobjectfunctioncall.h" -#include "kvi_kvs_treenode_variable.h" -#include "kvi_kvs_treenode_voidfunctioncall.h" - -// -// Hierarchy (the nodes that have some missing implementation have the leading '?' char) -// -// -// TreeNode(OK) (never instantiated) -// | -// +--Instruction(OK) (never instantiated) (used as interface by InstructionBlock) : instruction has bool execute() = 0; -// | | -// | +--InstructionBlock(OK) -// | | -// | +--ExpressionReturn(OK) -// | | -// | +--ParameterReturn(OK) -// | | -// | |--Command(OK) (never instantiated) -// | | | -// | | +--RebindingSwitch(OK) -// | | | -// | | +--CommandWithParameters(OK) (never instantiated) -// | | | | -// | | | +--SimpleCommand(OK) (never instantiated) -// | | | | | -// | | | | +--CoreSimpleCommand(OK) -// | | | | | -// | | | | +--ModuleSimpleCommand(OK) -// | | | | | -// | | | | +--AliasSimpleCommand(OK) -// | | | | -// | | | +--CallbackCommand(OK) (never instantiated) -// | | | | -// | | | +--CoreCallbackCommand(OK) -// | | | | -// | | | +--ModuleCallbackCommand(OK) -// | | | -// | | +--SpecialCommand(OK) (never instantiated) -// | | | -// | | +--SpecialCommandIf(OK) -// | | | -// | | +--SpecialCommandWhile(OK) -// | | | -// | | +--SpecialCommandDo(OK) -// | | | -// | | +--SpecialCommandForeach(OK) -// | | | -// | | +--SpecialCommandFor(OK) -// | | | -// | | +--SpecialCommandBreak(OK) -// | | | -// | | +--SpecialCommandSwitch(OK) -// | | | -// | | +--SpecialCommandDefpopup(OK) -// | | | -// | | +--SpecialCommandClass(OK) -// | | -// | +--VoidFunctionCall(OK) -// | | -// | +--Operation(OK) : has a m_pTargetData pointer (never instantiated) -// | | -// | +--OperationAssignment(OK) -// | | -// | +--OperationIncrement(OK) -// | | -// | +--OperationDecrement(OK) -// | | -// | +--OperationSelfSum(OK) -// | | -// | +--OperationSelfSubtraction(OK) -// | | -// | +--OperationSelfDivision(OK) -// | | -// | +--OperationSelfMultiplication(OK) -// | | -// | +--OperationSelfModulus(OK) -// | | -// | +--OperationSelfOr(OK) -// | | -// | +--OperationSelfAnd(OK) -// | | -// | +--OperationSelfXor(OK) -// | | -// | +--OperationSelfShl(OK) -// | | -// | +--OperationSelfShr(OK) -// | | -// | +--OperationStringAppend(OK) -// | | -// | +--OperationStringAppendWithComma(OK) -// | | -// | +--OperationStringAppendWithSpace(OK) -// | | -// | +--OperationStringTransliteration(OK) -// | | -// | +--OperationStringSubstitution(OK) -// | -// +--Data(OK) data has -// | | bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) <-- this MUST be implemented -// | | KviKvsVariant * evaluateReadWrite(KviKvsRunTimeContext * c) <-- this MUST be implemented if isReadOnly returns false -// | | -// | | This class is NEVER instantiated directly -// | | -// | | isReadOnly(); true by default -// | | canEvaluateToObjectReference(); false by default -// | | isFunctionCall(); false by default -// | | canEvaluateInObjectScope(); false by default -// | | (DEAD)canReleaseResult(); false by default (can the result be simply "taken" ?) -// | | -// | +--StringCast(OK) has some kind of data inside that is converted to string "on the fly" -// | | -// | +--ConstantData(OK) have real constant data -// | | everything inherited from data -// | | only evaluateReadOnly is implemented and it never fails -// | | -// | +--CompositeData(OK) have real data composed of constants, it is an implicit StringCast too (it isn't inherited from StringCast since it operates in a different way) -// | | everything inherited from data -// | | only evaluateReadOnly is implemented and it never fails -// | | -// | +--ScopeOperator( ) Has a left side that must evaluate to ob reference -// | | Has a right side that must be a variable reference or function call -// | | isReadOnly() depends on the right child -// | | canEvaluateToObjectReference() depends on last child -// | | isFunctionCall() depends on last child -// | | canEvaluateInObjectScope() depends on last child -// | | (DEAD)canReleaseResult() depends on last child -// | | -// | +--SingleParameterIdentifier(OK) this is $n -// | | canEvaluateToObjectReference() = true -// | | -// | +--MultipleParameterIdentifier(OK) this is $n-[n] -// | | -// | +--CommandEvaluation(OK) this is ${ ... } -// | | canEvaluateToObjectReference() = true -// | | -// | +--Variable(OK) this is something related to %xxx (never instantiated) -// | | | canEvaluateInObjectScope() = true -// | | | isReadOnly() = false -// | | | canEvaluateToObjectReference() = true -// | | | -// | | +--LocalVariable(OK) -// | | | -// | | +--GlobalVariable(OK) -// | | | -// | | +--ExtendedScopeVariable(OK) -// | | | -// | | +--ObjectField(OK) -// | | -// | +--IndirectData(OK) takes a Data as source (never instantiated) -// | | | canEvaluateInObjectScope() depends on the parameter data -// | | | -// | | +--ArrayOrHashElement(OK) isReadOnly() depends on the source data (never instantiated) -// | | | | canEvaluateToObjectReference() = true -// | | | | -// | | | +--ArrayElement(OK) the source Data must evaluate to an array or be writeable in order to convert it -// | | | | and an index that must evaluate to an integer (evaluate ok, result inherited ok) -// | | | | -// | | | +--HashElement(OK) the source Data must evaluate to a hash or be writeable in order to convert it -// | | | and an index that must evaluate to a non-empty hash key (evaluate ok, result inherited ok) -// | | | -// | | +--HashCount(OK) the source Data must evaluate to a hash or be writeable in order to convert it -// | | | -// | | +--ArrayCount(OK) the source Data must evaluate to an array or be writeable in order to convert it -// | | | -// | | +--HashReferenceAssert(OK) the source Data must evaluate to a hash or be writeable in order to convert it (otherwise asserts) -// | | | isReadOnly() depends on the parameter data -// | | | -// | | +--ArrayReferenceAssert(OK) the source Data must evaluate to an array or be writeable in order to convert it (otherwise asserts) -// | | isReadOnly() depends on the parameter data -// | | -// | +--Expression(OK) (never instantiated) -// | | | -// | | +--ExpressionVariableOperand(OK) (evaluate and result ok) -// | | | -// | | +--ExpressionConstantOperand(OK) (evaluate and result ok) -// | | | -// | | +--ExpressionOperator(OK) (never instantiated) -// | | | -// | | +--ExpressionBinaryOperator(OK) (never instantiated) -// | | | | -// | | | +--ExpressionBinaryOperatorSum(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorSubtraction(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorMultiplication(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorDivision(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorBitwiseAnd(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorBitwiseOr(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorBitwiseXor(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorShiftLeft(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorShiftRight(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorAnd(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorOr(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorXor(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorLowerThan(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorGreaterThan(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorLowerOrEqualTo(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorGreaterOrEqualTo(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorEqualTo(OK) (evaluate and result ok) -// | | | | -// | | | +--ExpressionBinaryOperatorNotEqualTo(OK) (evaluate and result ok) -// | | | -// | | +--ExpressionUnaryOperator(OK) (never instantiated) -// | | | -// | | +--ExpressionUnaryOperatorNegate(OK) (evaluate and result ok) -// | | | -// | | +--ExpressionUnaryOperatorBitwiseNot(OK) (evaluate and result ok) -// | | | -// | | +--ExpressionUnaryOperatorLogicalNot(OK) (evaluate and result ok) -// | | -// | +--FunctionCall(OK) this is something like $xxx and has a name. Can be called as a void instruction -// | | canEvaluateToObjectReference() = true -// | | isFunctionCall() = true -// | | -// | +--ModuleFunctionCall(OK) -// | | -// | +--AliasFunctionCall(OK) -// | | -// | +--CoreFunctionCall(OK) -// | | -// | +--ObjectFunctionCall( ) this is the only function call type appended to a scope operator -// | | canEvaluateInObjectScope() = true (never instantiated) -// | | -// | +--ThisObjectFunctionCall( ) -// | | -// | +--BaseObjectFunctionCall( ) -// | -// +--DataList(OK) -// | -// +--SwitchList(OK) -// | -// +--SpecialCommandSwitchLabel(Never instantiated) -// | | -// | +--SpecialCommandSwitchLabelCase(OK) -// | | -// | +--SpecialCommandSwitchLabelMatch(OK) -// | | -// | +--SpecialCommandSwitchLabelRegexp(OK) -// | | -// | +--SpecialCommandSwitchLabelDefault(OK) -// | -// +--SpecialCommandDefpopupLabel(Never instantiated) -// | -// +--SpecialCommandDefpopupLabelPrologue(OK) -// | -// +--SpecialCommandDefpopupLabelEpilogue(OK) -// | -// +--SpecialCommandDefpopupConditionalLabel(Never instantiated) -// | -// +--SpecialCommandDefpopupLabelSeparator(OK) -// | -// +--SpecialCommandDefpopupConditionalLabelWithTextAndIcon (Never instantiated) -// | -// +--SpecialCommandDefpopupLabelPopup(OK) -// | -// +--SpecialCommandDefpopupLabelExtpopup(OK) -// | -// +--SpecialCommandDefpopupLabelItem(OK) -// | -// +--SpecialCommandDefpopupLabelLabel(OK) -// -// -// - - -// -// Tree morphology -// -// InstructionBlock -// [Instruction] -// -// ScopeOperator -// [Data]->[Data] -// - - -#endif //!_KVI_KVS_TREENODE_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_aliasfunctioncall.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_aliasfunctioncall.cpp deleted file mode 100644 index c924651ccb..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_aliasfunctioncall.cpp +++ /dev/null @@ -1,84 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_aliasfunctioncall.cpp -// Created on Tue 07 Oct 2003 03:21:23 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_aliasfunctioncall.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_aliasmanager.h" -#include "kvi_locale.h" -#include "kvi_qstring.h" - -KviKvsTreeNodeAliasFunctionCall::KviKvsTreeNodeAliasFunctionCall(const QChar * pLocation,const QString &szAliasName,KviKvsTreeNodeDataList * pParams) -: KviKvsTreeNodeFunctionCall(pLocation,szAliasName,pParams) -{ - -} - -KviKvsTreeNodeAliasFunctionCall::~KviKvsTreeNodeAliasFunctionCall() -{ -} - -void KviKvsTreeNodeAliasFunctionCall::contextDescription(QString &szBuffer) -{ - KviQString::sprintf(szBuffer,"Alias Function Call \"%Q\"",&m_szFunctionName); -} - - - -void KviKvsTreeNodeAliasFunctionCall::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s AliasFunctionCall(%s)",prefix,m_szFunctionName.utf8().data()); - QString tmp = prefix; - tmp.append(" "); - m_pParams->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeAliasFunctionCall::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariantList l; - if(!m_pParams->evaluate(c,&l))return false; - - pBuffer->setNothing(); - - const KviKvsScript * s = KviKvsAliasManager::instance()->lookup(m_szFunctionName); - if(!s) - { - c->error(this,__tr2qs("Call to undefined function '%Q'"),&m_szFunctionName); - return false; - } - - KviKvsScript copy(*s); // quick reference - - if(!copy.run(c->window(),&l,pBuffer,KviKvsScript::PreserveParams)) - { - c->error(this,__tr2qs("Error in inner alias function call '%Q', called from this context"),&m_szFunctionName); - return false; - } -#endif - return true; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_aliasfunctioncall.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_aliasfunctioncall.h deleted file mode 100644 index da7f9c25f6..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_aliasfunctioncall.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_ALIASFUNCTIONCALL_H_ -#define _KVI_KVS_TREENODE_ALIASFUNCTIONCALL_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_aliasfunctioncall.h -// Created on Tue 07 Oct 2003 03:21:23 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_functioncall.h" -#include "kvi_kvs_treenode_datalist.h" - -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeAliasFunctionCall : public KviKvsTreeNodeFunctionCall -{ -public: - KviKvsTreeNodeAliasFunctionCall(const QChar * pLocation,const QString &szAliasName,KviKvsTreeNodeDataList * pParams); - ~KviKvsTreeNodeAliasFunctionCall(); -public: - virtual void dump(const char * prefix); - virtual void contextDescription(QString &szBuffer); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); -}; - -#endif //!_KVI_KVS_TREENODE_ALIASFUNCTIONCALL_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_aliassimplecommand.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_aliassimplecommand.cpp deleted file mode 100644 index 07e2fe4c13..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_aliassimplecommand.cpp +++ /dev/null @@ -1,120 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_aliassimplecommand.cpp -// Created on Thu 09 Oct 2003 02:16:42 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_aliassimplecommand.h" -#include "kvi_kvs_treenode_datalist.h" -#include "kvi_kvs_treenode_switchlist.h" -#include "kvi_kvs_aliasmanager.h" -#include "kvi_locale.h" -#include "kvi_options.h" -#include "kvi_irccontext.h" -#include "kvi_window.h" -#include "kvi_ircconnection.h" -#include "kvi_qcstring.h" -#include "kvi_out.h" - - -KviKvsTreeNodeAliasSimpleCommand::KviKvsTreeNodeAliasSimpleCommand(const QChar * pLocation,const QString &szCmdName,KviKvsTreeNodeDataList * params) -: KviKvsTreeNodeSimpleCommand(pLocation,szCmdName,params) -{ -} - - -KviKvsTreeNodeAliasSimpleCommand::~KviKvsTreeNodeAliasSimpleCommand() -{ -} - -void KviKvsTreeNodeAliasSimpleCommand::contextDescription(QString &szBuffer) -{ - KviQString::sprintf(szBuffer,"Alias Simple Command \"%Q\"",&m_szCmdName); -} - -void KviKvsTreeNodeAliasSimpleCommand::dump(const char * prefix) -{ - debug("%s AliasSimpleCommand(%s)",prefix,m_szCmdName.utf8().data()); - dumpSwitchList(prefix); - dumpParameterList(prefix); -} - -bool KviKvsTreeNodeAliasSimpleCommand::execute(KviKvsRunTimeContext * c) -{ - KviKvsVariantList l; - if(!m_pParams->evaluate(c,&l))return false; - - KviKvsSwitchList swl; - if(m_pSwitches) - { - if(!(m_pSwitches->evaluate(c,&swl)))return false; - } - - const KviKvsScript * s = KviKvsAliasManager::instance()->lookup(m_szCmdName); - if(!s) - { - if(KVI_OPTION_BOOL(KviOption_boolSendUnknownCommandsAsRaw)) - { - QString szAll; - l.allAsString(szAll); - - if(!szAll.isEmpty())szAll.prepend(" "); - szAll.prepend(m_szCmdName); - - KviQCString szData; - - if(!c->window()->context()) - goto no_way_to_send_as_raw; - if(!c->window()->connection()) - goto no_way_to_send_as_raw; - - szData = c->window()->connection()->encodeText(szAll); - if(!szData.data())szData = ""; - - if(!c->window()->connection()->sendData(szData.data())) - goto no_way_to_send_as_raw; - - c->window()->output(KVI_OUT_RAW,__tr2qs("[RAW]: %Q"),&szAll); - return true; -no_way_to_send_as_raw: - c->warning(this,__tr2qs("Failed to send an unknown command as /raw")); - c->error(this,__tr2qs("Call to undefined command '%Q'"),&m_szCmdName); - return false; - } else { - c->error(this,__tr2qs("Call to undefined command '%Q'"),&m_szCmdName); - return false; - } - } - - KviKvsScript copy(*s); // quick reference - // FIXME: the ExtRTData could be a member structure - // it would avoid the constructor call each time - KviKvsExtendedRunTimeData extData(&swl); - - if(!copy.run(c->window(),&l,0,KviKvsScript::PreserveParams,&extData)) - { - c->error(this,__tr2qs("Error in inner alias command call '%Q', called from this context"),&m_szCmdName); - return false; - } - return true; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_aliassimplecommand.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_aliassimplecommand.h deleted file mode 100644 index 7a707967af..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_aliassimplecommand.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_ALIASSIMPLECOMMAND_H_ -#define _KVI_KVS_TREENODE_ALIASSIMPLECOMMAND_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_aliassimplecommand.h -// Created on Thu 09 Oct 2003 02:16:42 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_simplecommand.h" - -class KviKvsTreeNodeDataList; -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeAliasSimpleCommand : public KviKvsTreeNodeSimpleCommand -{ -public: - KviKvsTreeNodeAliasSimpleCommand(const QChar * pLocation,const QString &szCmdName,KviKvsTreeNodeDataList * params); - ~KviKvsTreeNodeAliasSimpleCommand(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - - - -#endif //!_KVI_KVS_TREENODE_ALIASSIMPLECOMMAND_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arraycount.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arraycount.cpp deleted file mode 100644 index af9fa08401..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arraycount.cpp +++ /dev/null @@ -1,86 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_arraycount.cpp -// Created on Tue 07 Oct 2003 03:00:52 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_arraycount.h" -#include "kvi_kvs_variant.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_locale.h" -#include "kvi_kvs_object.h" - - -KviKvsTreeNodeArrayCount::KviKvsTreeNodeArrayCount(const QChar * pLocation,KviKvsTreeNodeData * pSource) -: KviKvsTreeNodeIndirectData(pLocation,pSource) -{ -} - -KviKvsTreeNodeArrayCount::~KviKvsTreeNodeArrayCount() -{ -} - -void KviKvsTreeNodeArrayCount::contextDescription(QString &szBuffer) -{ - szBuffer = "Array Count Operator"; -} - -void KviKvsTreeNodeArrayCount::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s ArrayCount",prefix); -#endif -} - -bool KviKvsTreeNodeArrayCount::evaluateReadOnlyInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant val; - if(o) - { - if(!m_pSource->evaluateReadOnlyInObjectScope(o,c,&val))return false; - } else { - if(!m_pSource->evaluateReadOnly(c,&val))return false; - } - - if(!val.isArray()) - { - if(!val.isNothing()) - { - QString szType; - val.getTypeName(szType); - c->warning(this,__tr2qs("The argument of the array count '#' operator didn't evaluate to an array: automatic conversion from type '%Q' supplied"),&szType); - } - pBuffer->setInteger(0); - return true; - } - - pBuffer->setInteger(val.array()->size()); -#endif - return true; -} - -bool KviKvsTreeNodeArrayCount::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - return evaluateReadOnlyInObjectScope(0,c,pBuffer); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arraycount.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arraycount.h deleted file mode 100644 index 2268603b2a..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arraycount.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_ARRAYCOUNT_H_ -#define _KVI_KVS_TREENODE_ARRAYCOUNT_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_arraycount.h -// Created on Tue 07 Oct 2003 03:00:52 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_indirectdata.h" - -class KviKvsRunTimeContext; -class KviKvsVariant; -class KviKvsObject; - -class KVIRC_API KviKvsTreeNodeArrayCount : public KviKvsTreeNodeIndirectData -{ -public: - KviKvsTreeNodeArrayCount(const QChar * pLocation,KviKvsTreeNodeData * pSource); - ~KviKvsTreeNodeArrayCount(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); - virtual bool evaluateReadOnlyInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); -}; - -#endif //!_KVI_KVS_TREENODE_ARRAYCOUNT_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayelement.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayelement.cpp deleted file mode 100644 index 675a8d0c3a..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayelement.cpp +++ /dev/null @@ -1,161 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_arrayelement.cpp -// Created on Tue 07 Oct 2003 02:58:41 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_arrayelement.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_locale.h" -#include "kvi_kvs_array.h" -#include "kvi_kvs_object.h" - -KviKvsTreeNodeArrayElement::KviKvsTreeNodeArrayElement(const QChar * pLocation,KviKvsTreeNodeData * pSource,KviKvsTreeNodeExpression * pIndex) -: KviKvsTreeNodeArrayOrHashElement(pLocation,pSource) -{ -#ifdef COMPILE_NEW_KVS - m_pIndex = pIndex; - m_pIndex->setParent(this); -#endif -} - - -KviKvsTreeNodeArrayElement::~KviKvsTreeNodeArrayElement() -{ -#ifdef COMPILE_NEW_KVS - delete m_pIndex; -#endif -} - -void KviKvsTreeNodeArrayElement::contextDescription(QString &szBuffer) -{ - szBuffer = "Array Element Evaluation"; -} - -void KviKvsTreeNodeArrayElement::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s ArrayElement",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pSource->dump(tmp.utf8().data()); - m_pIndex->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeArrayElement::evaluateIndex(KviKvsRunTimeContext *c,kvs_int_t &iVal) -{ - KviKvsVariant idx; - if(!m_pIndex->evaluateReadOnly(c,&idx))return false; - - if(!idx.asInteger(iVal)) - { - c->error(this,__tr2qs("Array index didn't evaluate to an integer")); - return false; - } - - if(iVal < 0) - { - c->error(this,__tr2qs("Array index evaluated to a negative integer (non negative integer expected)")); - return false; - } - return true; -} - - -bool KviKvsTreeNodeArrayElement::evaluateReadOnlyInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - kvs_int_t iVal; - if(!evaluateIndex(c,iVal))return false; - - KviKvsVariant val; - if(o) - { - if(!m_pSource->evaluateReadOnlyInObjectScope(o,c,&val))return false; - } else { - if(!m_pSource->evaluateReadOnly(c,&val))return false; - } - - if(!val.isArray()) - { - if(!val.isNothing()) - { - QString szType; - val.getTypeName(szType); - c->warning(this,__tr2qs("The argument of the [] subscript didn't evaluate to an array: automatic conversion from %Q supplied"),&szType); - } - pBuffer->setNothing(); - return true; - } - - KviKvsVariant * v = val.array()->at(iVal); - if(!v) - { - pBuffer->setNothing(); - return true; - } - - pBuffer->copyFrom(v); -#endif - return true; -} - -KviKvsRWEvaluationResult * KviKvsTreeNodeArrayElement::evaluateReadWriteInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - kvs_int_t iVal; - if(!evaluateIndex(c,iVal))return false; - - KviKvsRWEvaluationResult * result; - if(o)result = m_pSource->evaluateReadWriteInObjectScope(o,c); - else result = m_pSource->evaluateReadWrite(c); - if(!result)return 0; - - if(!result->result()->isArray()) - { - // convert to hash in some way - if(!result->result()->isNothing()) - { - QString szType; - result->result()->getTypeName(szType); - c->warning(this,__tr2qs("The argument of the [] subscript didn't evaluate to an array: automatic conversion from type '%Q' supplied"),&szType); - } - result->result()->setArray(new KviKvsArray()); - } - return new KviKvsArrayElement(result,result->result()->array()->getAt(iVal),result->result()->array(),iVal); -#else - return 0; -#endif -} - -bool KviKvsTreeNodeArrayElement::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - return evaluateReadOnlyInObjectScope(0,c,pBuffer); -} - -KviKvsRWEvaluationResult * KviKvsTreeNodeArrayElement::evaluateReadWrite(KviKvsRunTimeContext * c) -{ - return evaluateReadWriteInObjectScope(0,c); -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayelement.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayelement.h deleted file mode 100644 index bf0fbd4c22..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayelement.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_ARRAYELEMENT_H_ -#define _KVI_KVS_TREENODE_ARRAYELEMENT_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_arrayelement.h -// Created on Tue 07 Oct 2003 02:58:41 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_expression.h" -#include "kvi_kvs_treenode_arrayorhashelement.h" -#include "kvi_kvs_types.h" - -class KviKvsObject; -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeArrayElement : public KviKvsTreeNodeArrayOrHashElement -{ -public: - KviKvsTreeNodeArrayElement(const QChar * pLocation,KviKvsTreeNodeData * pSource,KviKvsTreeNodeExpression * pIndex); - ~KviKvsTreeNodeArrayElement(); -protected: - KviKvsTreeNodeExpression * m_pIndex; // can't be null -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); - virtual KviKvsRWEvaluationResult * evaluateReadWrite(KviKvsRunTimeContext * c); - virtual bool evaluateReadOnlyInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); - virtual KviKvsRWEvaluationResult * evaluateReadWriteInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c); -protected: - bool evaluateIndex(KviKvsRunTimeContext *c,kvs_int_t &iVal); -}; - -#endif //!_KVI_KVS_TREENODE_ARRAYELEMENT_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayorhashelement.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayorhashelement.cpp deleted file mode 100644 index d95b45d8a2..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayorhashelement.cpp +++ /dev/null @@ -1,45 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_arrayorhashelement.cpp -// Created on Thu 16 Oct 2003 22:56:48 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_arrayorhashelement.h" - -KviKvsTreeNodeArrayOrHashElement::KviKvsTreeNodeArrayOrHashElement(const QChar * pLocation,KviKvsTreeNodeData * pSource) -: KviKvsTreeNodeIndirectData(pLocation,pSource) -{ -} - -KviKvsTreeNodeArrayOrHashElement::~KviKvsTreeNodeArrayOrHashElement() -{ -} -bool KviKvsTreeNodeArrayOrHashElement::isReadOnly() -{ - return m_pSource->isReadOnly(); -} - -bool KviKvsTreeNodeArrayOrHashElement::canEvaluateToObjectReference() -{ - return true; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayorhashelement.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayorhashelement.h deleted file mode 100644 index c328e8a204..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayorhashelement.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_ARRAYORHASHELEMENT_H_ -#define _KVI_KVS_TREENODE_ARRAYORHASHELEMENT_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_arrayorhashelement.h -// Created on Thu 16 Oct 2003 22:56:48 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_indirectdata.h" -#include "kvi_kvs_variant.h" - -class KVIRC_API KviKvsTreeNodeArrayOrHashElement : public KviKvsTreeNodeIndirectData -{ -public: - KviKvsTreeNodeArrayOrHashElement(const QChar * pLocation,KviKvsTreeNodeData * pSource); - ~KviKvsTreeNodeArrayOrHashElement(); -public: - virtual bool isReadOnly(); - virtual bool canEvaluateToObjectReference(); -}; - -#endif //!_KVI_KVS_TREENODE_ARRAYORHASHELEMENT_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayreferenceassert.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayreferenceassert.cpp deleted file mode 100644 index 5c4e475f6e..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayreferenceassert.cpp +++ /dev/null @@ -1,107 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_arrayreferenceassert.cpp -// Created on Thu 16 Oct 2003 23:46:12 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_arrayreferenceassert.h" -#include "kvi_kvs_rwevaluationresult.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_variant.h" -#include "kvi_locale.h" -#include "kvi_kvs_object.h" - -KviKvsTreeNodeArrayReferenceAssert::KviKvsTreeNodeArrayReferenceAssert(const QChar * pLocation,KviKvsTreeNodeData * pSource) -: KviKvsTreeNodeIndirectData(pLocation,pSource) -{ -} - -KviKvsTreeNodeArrayReferenceAssert::~KviKvsTreeNodeArrayReferenceAssert() -{ -} - -bool KviKvsTreeNodeArrayReferenceAssert::isReadOnly() -{ - return m_pSource->isReadOnly(); -} - -void KviKvsTreeNodeArrayReferenceAssert::contextDescription(QString &szBuffer) -{ - szBuffer = "Array Reference Assert"; -} - - -void KviKvsTreeNodeArrayReferenceAssert::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s ArrayReferenceAssert",prefix); -#endif -} - -bool KviKvsTreeNodeArrayReferenceAssert::evaluateReadOnlyInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - if(o) - { - if(!m_pSource->evaluateReadOnlyInObjectScope(o,c,pBuffer))return false; - } else { - if(!m_pSource->evaluateReadOnly(c,pBuffer))return false; - } - - if(!pBuffer->isArray()) - { - if(!pBuffer->isNothing()) - { - QString szType; - pBuffer->getTypeName(szType); - c->error(this,__tr2qs("Array reference assert failed: the variable evaluated to type '%Q'"),&szType); - return false; - } - } -#endif - return true; -} - -KviKvsRWEvaluationResult * KviKvsTreeNodeArrayReferenceAssert::evaluateReadWriteInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsRWEvaluationResult * r; - if(o)r = m_pSource->evaluateReadWriteInObjectScope(o,c); - else r = m_pSource->evaluateReadWrite(c); - if(!r)return false; - - return r; -#else - return 0; -#endif -} - -bool KviKvsTreeNodeArrayReferenceAssert::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - return evaluateReadOnlyInObjectScope(0,c,pBuffer); -} - -KviKvsRWEvaluationResult * KviKvsTreeNodeArrayReferenceAssert::evaluateReadWrite(KviKvsRunTimeContext * c) -{ - return evaluateReadWriteInObjectScope(0,c); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayreferenceassert.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayreferenceassert.h deleted file mode 100644 index dbe0c91a20..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_arrayreferenceassert.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_ARRAYREFERENCEASSERT_H_ -#define _KVI_KVS_TREENODE_ARRAYREFERENCEASSERT_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_arrayreferenceassert.h -// Created on Thu 16 Oct 2003 23:46:12 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_indirectdata.h" - -class KviKvsRunTimeContext; -class KviKvsVariant; -class KviKvsRWEvaluationResult; -class KviKvsObject; - -class KVIRC_API KviKvsTreeNodeArrayReferenceAssert : public KviKvsTreeNodeIndirectData -{ -public: - KviKvsTreeNodeArrayReferenceAssert(const QChar * pLocation,KviKvsTreeNodeData * pSource); - ~KviKvsTreeNodeArrayReferenceAssert(); -protected: - -public: - virtual bool isReadOnly(); - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); - virtual KviKvsRWEvaluationResult * evaluateReadWrite(KviKvsRunTimeContext * c); - virtual bool evaluateReadOnlyInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); - virtual KviKvsRWEvaluationResult * evaluateReadWriteInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c); -}; - - -#endif //!_KVI_KVS_TREENODE_ARRAYREFERENCEASSERT_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_base.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_base.cpp deleted file mode 100644 index d37aa824c3..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_base.cpp +++ /dev/null @@ -1,37 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_base.cpp -// Created on Tue 07 Oct 2003 02:00:28 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_base.h" - -KviKvsTreeNode::KviKvsTreeNode(const QChar * pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pParent = 0; - m_pLocation = pLocation; -#endif -} - - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_base.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_base.h deleted file mode 100644 index b3f60902bf..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_base.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_BASE_H_ -#define _KVI_KVS_TREENODE_BASE_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_base.h -// Created on Tue 07 Oct 2003 02:00:28 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" - -class KVIRC_API KviKvsTreeNode -{ - friend class KviKvsParser; -public: - KviKvsTreeNode(const QChar * pLocation); - virtual ~KviKvsTreeNode(){}; -protected: - KviKvsTreeNode * m_pParent; - const QChar * m_pLocation; -public: - void setParent(KviKvsTreeNode * p){ m_pParent = p; }; -protected: - // this is called only by KviKvsParser - void setLocation(const QChar * pLocation){ m_pLocation = pLocation; }; -public: - KviKvsTreeNode * parent(){ return m_pParent; }; - const QChar * location(){ return m_pLocation; }; - virtual void dump(const char * prefix) = 0; - virtual void contextDescription(QString &szBuffer) = 0; -}; - -#endif //!_KVI_KVS_TREENODE_BASE_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_baseobjectfunctioncall.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_baseobjectfunctioncall.cpp deleted file mode 100644 index 9c4f861857..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_baseobjectfunctioncall.cpp +++ /dev/null @@ -1,72 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_baseobjectfunctioncall.cpp -// Created on Tue 07 Oct 2003 03:30:10 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_baseobjectfunctioncall.h" -#include "kvi_qstring.h" -#include "kvi_kvs_object.h" -#include "kvi_kvs_variant.h" - -KviKvsTreeNodeBaseObjectFunctionCall::KviKvsTreeNodeBaseObjectFunctionCall(const QChar * pLocation,const QString &szBaseClass,const QString &szFncName,KviKvsTreeNodeDataList * pParams) -: KviKvsTreeNodeObjectFunctionCall(pLocation,szFncName,pParams) -{ -#ifdef COMPILE_NEW_KVS - m_szBaseClass = szBaseClass; -#endif -} - -KviKvsTreeNodeBaseObjectFunctionCall::~KviKvsTreeNodeBaseObjectFunctionCall() -{ -} - -void KviKvsTreeNodeBaseObjectFunctionCall::contextDescription(QString &szBuffer) -{ - KviQString::sprintf(szBuffer,"Base Object Function Call \"%s::%s\"",&m_szBaseClass,&m_szFunctionName); -} - -void KviKvsTreeNodeBaseObjectFunctionCall::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s BaseObjectFunctionCall(%s::%s)",prefix,m_szBaseClass.utf8().data(),m_szFunctionName.utf8().data()); - QString tmp = prefix; - tmp.append(" "); - m_pParams->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeBaseObjectFunctionCall::evaluateReadOnlyInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariantList l; - if(!m_pParams->evaluate(c,&l))return false; - pBuffer->setNothing(); - c->setDefaultReportLocation(this); - return o->callFunction(c->thisObject(),m_szFunctionName,m_szBaseClass,c,pBuffer,&l); -#else - return false; -#endif -} - - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_baseobjectfunctioncall.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_baseobjectfunctioncall.h deleted file mode 100644 index 9685f824b0..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_baseobjectfunctioncall.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_BASEOBJECTFUNCTIONCALL_H_ -#define _KVI_KVS_TREENODE_BASEOBJECTFUNCTIONCALL_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_baseobjectfunctioncall.h -// Created on Tue 07 Oct 2003 03:30:10 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_datalist.h" -#include "kvi_kvs_treenode_objectfunctioncall.h" - -class KviKvsObject; -class KviKvsVariant; -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeBaseObjectFunctionCall : public KviKvsTreeNodeObjectFunctionCall -{ -public: - KviKvsTreeNodeBaseObjectFunctionCall(const QChar * pLocation,const QString &szBaseClass,const QString &szFncName,KviKvsTreeNodeDataList * pParams); - ~KviKvsTreeNodeBaseObjectFunctionCall(); -protected: - QString m_szBaseClass; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - - virtual bool evaluateReadOnlyInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); -}; - -#endif //!_KVI_KVS_TREENODE_BASEOBJECTFUNCTIONCALL_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_callbackcommand.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_callbackcommand.cpp deleted file mode 100644 index 6ac8e2374c..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_callbackcommand.cpp +++ /dev/null @@ -1,73 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_callbackcommand.cpp -// Created on Thu 09 Oct 2003 02:02:42 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - - -#include "kvi_kvs_treenode_callbackcommand.h" -#include "kvi_kvs_treenode_datalist.h" -#include "kvi_kvs_script.h" - - - -KviKvsTreeNodeCallbackCommand::KviKvsTreeNodeCallbackCommand(const QChar * pLocation,const QString &szCmdName,KviKvsTreeNodeDataList * params,KviKvsScript * pCallback) -: KviKvsTreeNodeCommandWithParameters(pLocation,szCmdName,params) -{ -#ifdef COMPILE_NEW_KVS - m_pCallback = pCallback; -#endif -} - - -KviKvsTreeNodeCallbackCommand::~KviKvsTreeNodeCallbackCommand() -{ -#ifdef COMPILE_NEW_KVS - delete m_pCallback; -#endif -} - -void KviKvsTreeNodeCallbackCommand::contextDescription(QString &szBuffer) -{ - KviQString::sprintf(szBuffer,"Callback Command \"%s\"",&m_szCmdName); -} - -void KviKvsTreeNodeCallbackCommand::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s CallbackCommand(%s)",prefix,m_szCmdName.utf8().data()); - dumpSwitchList(prefix); - dumpParameterList(prefix); - dumpCallback(prefix); -#endif -} - -void KviKvsTreeNodeCallbackCommand::dumpCallback(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - QString tmp = prefix; - tmp.append(" "); - m_pCallback->dump(tmp.utf8().data()); -#endif -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_callbackcommand.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_callbackcommand.h deleted file mode 100644 index 4465437c22..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_callbackcommand.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_CALLBACKCOMMAND_H_ -#define _KVI_KVS_TREENODE_CALLBACKCOMMAND_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_callbackcommand.h -// Created on Thu 09 Oct 2003 02:02:42 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_commandwithparameters.h" - -class KviKvsTreeNodeDataList; -class KviKvsScript; - -class KVIRC_API KviKvsTreeNodeCallbackCommand : public KviKvsTreeNodeCommandWithParameters -{ -public: - KviKvsTreeNodeCallbackCommand(const QChar * pLocation,const QString &szCmdName,KviKvsTreeNodeDataList * params,KviKvsScript * pCallback); - ~KviKvsTreeNodeCallbackCommand(); -protected: - KviKvsScript * m_pCallback; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - void dumpCallback(const char * prefix); -}; - - -#endif //!_KVI_KVS_TREENODE_CALLBACKCOMMAND_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_command.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_command.cpp deleted file mode 100644 index b92d7d50a7..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_command.cpp +++ /dev/null @@ -1,80 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_command.cpp -// Created on Thu 09 Oct 2003 01:49:40 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_command.h" -#include "kvi_kvs_treenode_switchlist.h" - -KviKvsTreeNodeCommand::KviKvsTreeNodeCommand(const QChar * pLocation,const QString &szCmdName) -: KviKvsTreeNodeInstruction(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_szCmdName = szCmdName; - m_pSwitches = 0; -#endif -} - -KviKvsTreeNodeCommand::~KviKvsTreeNodeCommand() -{ -#ifdef COMPILE_NEW_KVS - if(m_pSwitches)delete m_pSwitches; -#endif -} - -//#warning "All the dump() functions could be killed (or moved to print on the kvirc windows)" - -void KviKvsTreeNodeCommand::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - KviQString::sprintf(szBuffer,"Command \"%s\"",&m_szCmdName); -#endif -} - -void KviKvsTreeNodeCommand::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s Command(%s)",prefix,m_szCmdName.utf8().data()); - dumpSwitchList(prefix); -#endif -} - -void KviKvsTreeNodeCommand::dumpSwitchList(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - if(!m_pSwitches)return; - QString tmp = prefix; - tmp.append(" "); - m_pSwitches->dump(tmp.utf8().data()); -#endif -} - -void KviKvsTreeNodeCommand::setSwitchList(KviKvsTreeNodeSwitchList * sw) -{ -#ifdef COMPILE_NEW_KVS - m_pSwitches = sw; - m_pSwitches->setParent(this); -#endif -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_command.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_command.h deleted file mode 100644 index 62b5b531a0..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_command.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_COMMAND_H_ -#define _KVI_KVS_TREENODE_COMMAND_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_command.h -// Created on Thu 09 Oct 2003 01:49:40 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_instruction.h" - -class KviKvsParser; -class KviKvsTreeNodeSwitchList; - -class KVIRC_API KviKvsTreeNodeCommand : public KviKvsTreeNodeInstruction -{ - // never instantiated - friend class KviKvsParser; -public: - KviKvsTreeNodeCommand(const QChar * pLocation,const QString &szCmdName); - ~KviKvsTreeNodeCommand(); -protected: - QString m_szCmdName; // command visible name - KviKvsTreeNodeSwitchList * m_pSwitches; // MAY BE 0! -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - void dumpSwitchList(const char * prefix); - const QString & commandName(){ return m_szCmdName; }; -protected: - void setSwitchList(KviKvsTreeNodeSwitchList * sw); -}; - - -#endif //!_KVI_KVS_TREENODE_COMMAND_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_commandevaluation.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_commandevaluation.cpp deleted file mode 100644 index 557d4eb734..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_commandevaluation.cpp +++ /dev/null @@ -1,60 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_commandevaluation.cpp -// Created on Wed 05 Nov 2003 04:18:58 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_commandevaluation.h" - -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_variant.h" - -KviKvsTreeNodeCommandEvaluation::KviKvsTreeNodeCommandEvaluation(const QChar * pLocation,KviKvsTreeNodeInstruction * pInstruction) -: KviKvsTreeNodeData(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pInstruction = pInstruction; - m_pInstruction->setParent(this); -#endif -} - -KviKvsTreeNodeCommandEvaluation::~KviKvsTreeNodeCommandEvaluation() -{ -#ifdef COMPILE_NEW_KVS - delete m_pInstruction; -#endif -} - - -bool KviKvsTreeNodeCommandEvaluation::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant * pTmp = c->swapReturnValuePointer(pBuffer); - bool bRet = m_pInstruction->execute(c); - c->swapReturnValuePointer(pTmp); - return bRet; -#else - return false; -#endif -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_commandevaluation.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_commandevaluation.h deleted file mode 100644 index eb7be820e8..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_commandevaluation.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_COMMANDEVALUATION_H_ -#define _KVI_KVS_TREENODE_COMMANDEVALUATION_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_commandevaluation.h -// Created on Wed 05 Nov 2003 04:18:58 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_data.h" -#include "kvi_kvs_treenode_instruction.h" - -class KviKvsRunTimeContext; -class KviKvsVariant; - -class KviKvsTreeNodeCommandEvaluation : public KviKvsTreeNodeData -{ -public: - KviKvsTreeNodeCommandEvaluation(const QChar * pLocation,KviKvsTreeNodeInstruction * pInstruction); - ~KviKvsTreeNodeCommandEvaluation(); -protected: - KviKvsTreeNodeInstruction * m_pInstruction; // owned, never 0 -public: - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); -}; - -#endif //!_KVI_KVS_TREENODE_COMMANDEVALUATION_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_commandwithparameters.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_commandwithparameters.cpp deleted file mode 100644 index d1a2855179..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_commandwithparameters.cpp +++ /dev/null @@ -1,66 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_commandwithparameters.cpp -// Created on Thu 09 Oct 2003 01:57:10 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_commandwithparameters.h" -#include "kvi_kvs_treenode_datalist.h" - -KviKvsTreeNodeCommandWithParameters::KviKvsTreeNodeCommandWithParameters(const QChar * pLocation,const QString &szCmdName,KviKvsTreeNodeDataList * params) -: KviKvsTreeNodeCommand(pLocation,szCmdName) -{ - m_pParams = params; - m_pParams->setParent(this); -} - -KviKvsTreeNodeCommandWithParameters::~KviKvsTreeNodeCommandWithParameters() -{ - delete m_pParams; -} - -void KviKvsTreeNodeCommandWithParameters::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - KviQString::sprintf(szBuffer,"Command With Parameters \"%s\"",&m_szCmdName); -#endif -} - - -void KviKvsTreeNodeCommandWithParameters::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s CommandWithParameters(%s)",prefix,m_szCmdName.utf8().data()); - dumpSwitchList(prefix); - dumpParameterList(prefix); -#endif -} - -void KviKvsTreeNodeCommandWithParameters::dumpParameterList(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - QString tmp = prefix; - tmp.append(" "); - m_pParams->dump(tmp.utf8().data()); -#endif -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_commandwithparameters.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_commandwithparameters.h deleted file mode 100644 index 291bcb4a71..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_commandwithparameters.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_COMMANDWITHPARAMETERS_H_ -#define _KVI_KVS_TREENODE_COMMANDWITHPARAMETERS_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_commandwithparameters.h -// Created on Thu 09 Oct 2003 01:57:10 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_command.h" - -class KviKvsTreeNodeDataList; - -class KVIRC_API KviKvsTreeNodeCommandWithParameters : public KviKvsTreeNodeCommand -{ - // never instantiated -public: - // params can't be 0! - KviKvsTreeNodeCommandWithParameters(const QChar * pLocation,const QString &szCmdName,KviKvsTreeNodeDataList * params); - ~KviKvsTreeNodeCommandWithParameters(); -protected: - KviKvsTreeNodeDataList * m_pParams; // never 0 -public: - KviKvsTreeNodeDataList * params(){ return m_pParams; }; - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - void dumpParameterList(const char * prefix); -}; - -#endif //!_KVI_KVS_TREENODE_COMMANDWITHPARAMETERS_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_compositedata.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_compositedata.cpp deleted file mode 100644 index 187415fa87..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_compositedata.cpp +++ /dev/null @@ -1,86 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_compositedata.cpp -// Created on Tue 07 Oct 2003 02:24:33 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_compositedata.h" - -#include "kvi_qstring.h" - -#define DEBUGME - -KviKvsTreeNodeCompositeData::KviKvsTreeNodeCompositeData(const QChar * pLocation,KviPointerList<KviKvsTreeNodeData> * pSubData) -: KviKvsTreeNodeData(pLocation) -{ -#ifdef DEBUGME - if(pSubData->count() < 2)debug("KviKvsTreeNodeCompositeData constructor called with less than two children!"); -#endif - m_pSubData = pSubData; - m_pSubData->setAutoDelete(true); - for(KviKvsTreeNodeData * d = m_pSubData->first();d;d = m_pSubData->next()) - d->setParent(this); -} - - -KviKvsTreeNodeCompositeData::~KviKvsTreeNodeCompositeData() -{ - delete m_pSubData; -} - -bool KviKvsTreeNodeCompositeData::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - QString * pS = new QString(); - - pBuffer->setString(pS); - - KviKvsVariant res; - - // we need to use an iterator to accomodate recursion - KviPointerListIterator<KviKvsTreeNodeData> it(*m_pSubData); - - while(KviKvsTreeNodeData * d = it.current()) - { - if(!d->evaluateReadOnly(c,&res))return false; - res.appendAsString(*pS); - ++it; - } - return true; -} - -void KviKvsTreeNodeCompositeData::contextDescription(QString &szBuffer) -{ - szBuffer = "Composite Data Evaluation (Implicit String Cast)"; -} - -void KviKvsTreeNodeCompositeData::dump(const char * prefix) -{ - debug("%s CompositeData",prefix); - QString tmp = prefix; - tmp.append(" "); - for(KviKvsTreeNodeData * p = m_pSubData->first();p;p = m_pSubData->next()) - { - p->dump(tmp.utf8().data()); - } -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_compositedata.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_compositedata.h deleted file mode 100644 index 093c080c71..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_compositedata.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_COMPOSITEDATA_H_ -#define _KVI_KVS_TREENODE_COMPOSITEDATA_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_compositedata.h -// Created on Tue 07 Oct 2003 02:24:33 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_pointerlist.h" - -#include "kvi_kvs_treenode_data.h" - -class KVIRC_API KviKvsTreeNodeCompositeData : public KviKvsTreeNodeData -{ -public: - KviKvsTreeNodeCompositeData(const QChar * pLocation,KviPointerList<KviKvsTreeNodeData> * pSubData); - ~KviKvsTreeNodeCompositeData(); -protected: - KviPointerList<KviKvsTreeNodeData> * m_pSubData; -public: - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); - virtual void contextDescription(QString &szBuffer); - - virtual void dump(const char * prefix); -}; - - -#endif //!_KVI_KVS_TREENODE_COMPOSITEDATA_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_constantdata.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_constantdata.cpp deleted file mode 100644 index 054bce1c76..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_constantdata.cpp +++ /dev/null @@ -1,80 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_constantdata.cpp -// Created on Tue 07 Oct 2003 02:21:59 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_constantdata.h" - - -KviKvsTreeNodeConstantData::KviKvsTreeNodeConstantData(const QChar * pLocation,KviKvsVariant * v) -: KviKvsTreeNodeData(pLocation) -{ - m_pValue = v; -} - - -KviKvsTreeNodeConstantData::~KviKvsTreeNodeConstantData() -{ - delete m_pValue; -} - -void KviKvsTreeNodeConstantData::contextDescription(QString &szBuffer) -{ - szBuffer = "Constant Data Evaluation"; -} - -bool KviKvsTreeNodeConstantData::convertStringConstantToNumeric() -{ - if(m_pValue->isString()) - { - kvs_int_t iVal; - if(m_pValue->asInteger(iVal)) - { - m_pValue->setInteger(iVal); - return true; - } - - kvs_real_t dVal; - if(m_pValue->asReal(dVal)) - { - m_pValue->setReal(dVal); - return true; - } - } - return true; -} - -void KviKvsTreeNodeConstantData::dump(const char * prefix) -{ - debug("%s ConstantData",prefix); - QString tmp = prefix; - tmp.prepend(" "); - m_pValue->dump(tmp.utf8().data()); -} - -bool KviKvsTreeNodeConstantData::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - pBuffer->copyFrom(m_pValue); - return true; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_constantdata.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_constantdata.h deleted file mode 100644 index 400d2d0037..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_constantdata.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_CONSTANTDATA_H_ -#define _KVI_KVS_TREENODE_CONSTANTDATA_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_constantdata.h -// Created on Tue 07 Oct 2003 02:21:59 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_qstring.h" - -#include "kvi_kvs_treenode_data.h" - -class KVIRC_API KviKvsTreeNodeConstantData : public KviKvsTreeNodeData -{ -public: - KviKvsTreeNodeConstantData(const QChar * pLocation,KviKvsVariant * v); - ~KviKvsTreeNodeConstantData(); -protected: - KviKvsVariant * m_pValue; // literal value of the parameter -public: - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant *pBuffer); - virtual void contextDescription(QString &szBuffer); - - virtual void dump(const char * prefix); - - virtual bool convertStringConstantToNumeric(); - - KviKvsVariant * value(){ return m_pValue; }; -}; - - -#endif //!_KVI_KVS_TREENODE_CONSTANTDATA_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_corecallbackcommand.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_corecallbackcommand.cpp deleted file mode 100644 index 091a63086e..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_corecallbackcommand.cpp +++ /dev/null @@ -1,72 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_corecallbackcommand.cpp -// Created on Thu 09 Oct 2003 02:06:26 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_corecallbackcommand.h" -#include "kvi_kvs_treenode_datalist.h" -#include "kvi_kvs_treenode_switchlist.h" -#include "kvi_kvs_script.h" -#include "kvi_kvs_runtimecontext.h" - - -KviKvsTreeNodeCoreCallbackCommand::KviKvsTreeNodeCoreCallbackCommand(const QChar * pLocation,const QString &szCmdName,KviKvsTreeNodeDataList * params,KviKvsCoreCallbackCommandExecRoutine * r,KviKvsScript * pCallback) -: KviKvsTreeNodeCallbackCommand(pLocation,szCmdName,params,pCallback) -{ - m_pExecRoutine = r; -} - -KviKvsTreeNodeCoreCallbackCommand::~KviKvsTreeNodeCoreCallbackCommand() -{ -} - -void KviKvsTreeNodeCoreCallbackCommand::contextDescription(QString &szBuffer) -{ - KviQString::sprintf(szBuffer,"Core Callback Command \"%Q\"",&m_szCmdName); -} - -void KviKvsTreeNodeCoreCallbackCommand::dump(const char * prefix) -{ - debug("%s CoreCallbackCommand(%s)",prefix,m_szCmdName.utf8().data()); - dumpSwitchList(prefix); - dumpParameterList(prefix); - dumpCallback(prefix); -} - -bool KviKvsTreeNodeCoreCallbackCommand::execute(KviKvsRunTimeContext * c) -{ - KviKvsVariantList l; - l.setAutoDelete(true); - if(!(m_pParams->evaluate(c,&l)))return false; - - KviKvsSwitchList swl; - if(m_pSwitches) - { - if(!(m_pSwitches->evaluate(c,&swl)))return false; - } - - c->setDefaultReportLocation(this); - - return m_pExecRoutine->proc(c,&l,&swl,m_pCallback); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_corecallbackcommand.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_corecallbackcommand.h deleted file mode 100644 index 2efb90a8ad..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_corecallbackcommand.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_CORECALLBACKCOMMAND_H_ -#define _KVI_KVS_TREENODE_CORECALLBACKCOMMAND_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_corecallbackcommand.h -// Created on Thu 09 Oct 2003 02:06:26 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_callbackcommand.h" - -#include "kvi_kvs_kernel.h" - -class KviKvsTreeNodeDataList; -class KviKvsScript; -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeCoreCallbackCommand : public KviKvsTreeNodeCallbackCommand -{ -public: - KviKvsTreeNodeCoreCallbackCommand(const QChar * pLocation,const QString &szCmdName,KviKvsTreeNodeDataList * params,KviKvsCoreCallbackCommandExecRoutine * r,KviKvsScript * pCallback); - ~KviKvsTreeNodeCoreCallbackCommand(); -protected: - KviKvsCoreCallbackCommandExecRoutine * m_pExecRoutine; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - - -#endif //!_KVI_KVS_TREENODE_CORECALLBACKCOMMAND_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_corefunctioncall.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_corefunctioncall.cpp deleted file mode 100644 index 77a3770ef3..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_corefunctioncall.cpp +++ /dev/null @@ -1,62 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_corefunctioncall.cpp -// Created on Tue 07 Oct 2003 03:23:59 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_corefunctioncall.h" -#include "kvi_kvs_runtimecontext.h" - -KviKvsTreeNodeCoreFunctionCall::KviKvsTreeNodeCoreFunctionCall(const QChar * pLocation,const QString &szFncName,KviKvsCoreFunctionExecRoutine * r,KviKvsTreeNodeDataList * pParams) -: KviKvsTreeNodeFunctionCall(pLocation,szFncName,pParams) -{ - m_pExecRoutine = r; -} - -KviKvsTreeNodeCoreFunctionCall::~KviKvsTreeNodeCoreFunctionCall() -{ -} - -void KviKvsTreeNodeCoreFunctionCall::contextDescription(QString &szBuffer) -{ - KviQString::sprintf(szBuffer,"Core Function Call \"%Q\"",&m_szFunctionName); -} - - -void KviKvsTreeNodeCoreFunctionCall::dump(const char * prefix) -{ - debug("%s CoreFunctionCall(%s)",prefix,m_szFunctionName.utf8().data()); - QString tmp = prefix; - tmp.append(" "); - m_pParams->dump(tmp.utf8().data()); -} - -bool KviKvsTreeNodeCoreFunctionCall::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - KviKvsVariantList l; - if(!m_pParams->evaluate(c,&l))return false; - - pBuffer->setNothing(); - c->setDefaultReportLocation(this); - return m_pExecRoutine->proc(c,&l,pBuffer); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_corefunctioncall.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_corefunctioncall.h deleted file mode 100644 index b35479843c..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_corefunctioncall.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_COREFUNCTIONCALL_H_ -#define _KVI_KVS_TREENODE_COREFUNCTIONCALL_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_corefunctioncall.h -// Created on Tue 07 Oct 2003 03:23:59 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_kernel.h" -#include "kvi_kvs_treenode_datalist.h" -#include "kvi_kvs_treenode_functioncall.h" - -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeCoreFunctionCall : public KviKvsTreeNodeFunctionCall -{ -public: - KviKvsTreeNodeCoreFunctionCall(const QChar * pLocation,const QString &szFncName,KviKvsCoreFunctionExecRoutine * r,KviKvsTreeNodeDataList * pParams); - ~KviKvsTreeNodeCoreFunctionCall(); -protected: - KviKvsCoreFunctionExecRoutine * m_pExecRoutine; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); -}; - -#endif //!_KVI_KVS_TREENODE_COREFUNCTIONCALL_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_coresimplecommand.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_coresimplecommand.cpp deleted file mode 100644 index 18b46a9ae7..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_coresimplecommand.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_coresimplecommand.cpp -// Created on Thu 09 Oct 2003 02:14:34 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_coresimplecommand.h" -#include "kvi_kvs_treenode_datalist.h" -#include "kvi_kvs_treenode_switchlist.h" -#include "kvi_kvs_runtimecontext.h" - -KviKvsTreeNodeCoreSimpleCommand::KviKvsTreeNodeCoreSimpleCommand(const QChar * pLocation,const QString &szCmdName,KviKvsTreeNodeDataList * params,KviKvsCoreSimpleCommandExecRoutine * r) -: KviKvsTreeNodeSimpleCommand(pLocation,szCmdName,params) -{ - m_pExecRoutine = r; -} - - -KviKvsTreeNodeCoreSimpleCommand::~KviKvsTreeNodeCoreSimpleCommand() -{ -} - -void KviKvsTreeNodeCoreSimpleCommand::contextDescription(QString &szBuffer) -{ - KviQString::sprintf(szBuffer,"Core Simple Command \"%Q\"",&m_szCmdName); -} - -void KviKvsTreeNodeCoreSimpleCommand::dump(const char * prefix) -{ - debug("%s CoreSimpleCommand(%s)",prefix,m_szCmdName.utf8().data()); - dumpSwitchList(prefix); - dumpParameterList(prefix); -} - -bool KviKvsTreeNodeCoreSimpleCommand::execute(KviKvsRunTimeContext * c) -{ - KviKvsVariantList l; - l.setAutoDelete(true); - if(!(m_pParams->evaluate(c,&l)))return false; - - KviKvsSwitchList swl; - if(m_pSwitches) - { - if(!(m_pSwitches->evaluate(c,&swl)))return false; - } - - c->setDefaultReportLocation(this); - - return m_pExecRoutine->proc(c,&l,&swl); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_coresimplecommand.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_coresimplecommand.h deleted file mode 100644 index 4bd365c24f..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_coresimplecommand.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_CORESIMPLECOMMAND_H_ -#define _KVI_KVS_TREENODE_CORESIMPLECOMMAND_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_coresimplecommand.h -// Created on Thu 09 Oct 2003 02:14:34 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_simplecommand.h" -#include "kvi_kvs_kernel.h" - -class KviKvsTreeNodeDataList; -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeCoreSimpleCommand : public KviKvsTreeNodeSimpleCommand -{ -public: - KviKvsTreeNodeCoreSimpleCommand(const QChar * pLocation,const QString &szCmdName,KviKvsTreeNodeDataList * params,KviKvsCoreSimpleCommandExecRoutine * r); - ~KviKvsTreeNodeCoreSimpleCommand(); -private: - KviKvsCoreSimpleCommandExecRoutine * m_pExecRoutine; // shallow pointer! -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - - -#endif //!_KVI_KVS_TREENODE_CORESIMPLECOMMAND_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_data.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_data.cpp deleted file mode 100644 index 89a1a79503..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_data.cpp +++ /dev/null @@ -1,107 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_data.cpp -// Creation date : Sun 05 Oct 2003 21.52 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_data.h" -#include "kvi_locale.h" - - -KviKvsTreeNodeData::KviKvsTreeNodeData(const QChar * pLocation) -: KviKvsTreeNode(pLocation), m_pEndingLocation(0) -{ -} - - -KviKvsTreeNodeData::~KviKvsTreeNodeData() -{ -} - -void KviKvsTreeNodeData::contextDescription(QString &szBuffer) -{ - szBuffer = "Data Evaluation"; -} - -void KviKvsTreeNodeData::dump(const char * prefix) -{ - debug("%s Data",prefix); -} - -bool KviKvsTreeNodeData::isReadOnly() -{ - return true; -} - -bool KviKvsTreeNodeData::canEvaluateToObjectReference() -{ - return false; -} - -bool KviKvsTreeNodeData::canEvaluateInObjectScope() -{ - return false; -} - -bool KviKvsTreeNodeData::isFunctionCall() -{ - return false; -} - -bool KviKvsTreeNodeData::convertStringConstantToNumeric() -{ - return false; -} - -/* -bool KviKvsTreeNodeData::canReleaseResult() -{ - return false; -} -*/ - -bool KviKvsTreeNodeData::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - c->error(this,__tr2qs("Internal error: pure virtual evaluateReadOnly called")); - return false; -} - -KviKvsRWEvaluationResult * KviKvsTreeNodeData::evaluateReadWrite(KviKvsRunTimeContext * c) -{ - c->error(this,__tr2qs("Internal error: trying to evaluate as read-write a read-only data location")); - return 0; -} - - -bool KviKvsTreeNodeData::evaluateReadOnlyInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - c->error(this,__tr2qs("Internal error: pure virtual evaluateReadOnlyInObjectScope called")); - return false; -} - -KviKvsRWEvaluationResult * KviKvsTreeNodeData::evaluateReadWriteInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c) -{ - c->error(this,__tr2qs("Internal error: trying to evaluate as read-write a read-only data location")); - return 0; -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_data.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_data.h deleted file mode 100644 index 785368768d..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_data.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_DATA_H_ -#define _KVI_KVS_TREENODE_DATA_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_data.h -// Creation date : Sun 05 Oct 2003 21.42 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_kvs_treenode_base.h" -#include "kvi_kvs_variant.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_rwevaluationresult.h" - -class KviKvsObject; - -class KVIRC_API KviKvsTreeNodeData : public KviKvsTreeNode -{ -public: - KviKvsTreeNodeData(const QChar * pLocation); - ~KviKvsTreeNodeData(); -protected: - const QChar * m_pEndingLocation; // note that this MIGHT be not set (it's set for sure for anything parsed by parseCommaSeparatedParameter() -public: - void setEndingLocation(const QChar * pEndingLocation){ m_pEndingLocation = pEndingLocation; }; - const QChar * endingLocation(){ return m_pEndingLocation; }; - - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); - virtual KviKvsRWEvaluationResult * evaluateReadWrite(KviKvsRunTimeContext * c); // error by default - - virtual bool evaluateReadOnlyInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); // error by default - virtual KviKvsRWEvaluationResult * evaluateReadWriteInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c); // error by default - - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - - virtual bool isReadOnly(); // true by default - virtual bool canEvaluateToObjectReference(); // no by default - virtual bool isFunctionCall(); // no by default - virtual bool canEvaluateInObjectScope(); // no by default - - virtual bool convertStringConstantToNumeric(); // this does nothing by default and is reimplemented only by KviKvsTreeNodeConstantData -}; - - - - - -#endif //!_KVI_KVS_TREENODE_DATA_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_datalist.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_datalist.cpp deleted file mode 100644 index 8a20b396f8..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_datalist.cpp +++ /dev/null @@ -1,110 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_datalist.cpp -// Created on Tue 07 Oct 2003 02:03:41 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_datalist.h" -#include "kvi_kvs_runtimecontext.h" - -#include "kvi_qstring.h" - -KviKvsTreeNodeDataList::KviKvsTreeNodeDataList(const QChar * pLocation) -: KviKvsTreeNode(pLocation) -{ - m_pDataList = new KviPointerList<KviKvsTreeNodeData>(); - m_pDataList->setAutoDelete(true); -} - -KviKvsTreeNodeDataList::~KviKvsTreeNodeDataList() -{ - delete m_pDataList; -} - -KviKvsTreeNodeData * KviKvsTreeNodeDataList::releaseFirst() -{ - KviKvsTreeNodeData * d = m_pDataList->first(); - if(d) - { - m_pDataList->setAutoDelete(false); - m_pDataList->removeFirst(); - m_pDataList->setAutoDelete(true); - } - return d; -} - -KviKvsTreeNodeData * KviKvsTreeNodeDataList::item(unsigned int uIdx) -{ - if(uIdx >= m_pDataList->count())return 0; - return m_pDataList->at(uIdx); -} - - -void KviKvsTreeNodeDataList::contextDescription(QString &szBuffer) -{ - szBuffer = "Data List Evaluation"; -} - -void KviKvsTreeNodeDataList::dump(const char * prefix) -{ - debug("%s DataList",prefix); - QString tmp = prefix; - tmp.append(" "); - for(KviKvsTreeNodeData * t = m_pDataList->first();t;t = m_pDataList->next()) - { - t->dump(tmp.utf8().data()); - } -} - -bool KviKvsTreeNodeDataList::evaluate(KviKvsRunTimeContext * c,KviKvsVariantList * pBuffer) -{ - pBuffer->clear(); - - // we use an iterator to accomodate recursion - KviPointerListIterator<KviKvsTreeNodeData> it(*m_pDataList); - while(KviKvsTreeNodeData * t = it.current()) - { - KviKvsVariant * v = new KviKvsVariant(); - if(!t->evaluateReadOnly(c,v)) - { - delete v; - pBuffer->clear(); - return false; - } - pBuffer->append(v); - ++it; - } - return true; -} - -void KviKvsTreeNodeDataList::addItem(KviKvsTreeNodeData * p) -{ - m_pDataList->append(p); - p->setParent(this); -} - -void KviKvsTreeNodeDataList::prependItem(KviKvsTreeNodeData * p) -{ - m_pDataList->prepend(p); - p->setParent(this); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_datalist.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_datalist.h deleted file mode 100644 index a398ae943e..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_datalist.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_DATALIST_H_ -#define _KVI_KVS_TREENODE_DATALIST_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_datalist.h -// Created on Tue 07 Oct 2003 02:03:41 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_pointerlist.h" - -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_treenode_base.h" -#include "kvi_kvs_treenode_data.h" - -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeDataList : public KviKvsTreeNode -{ - friend class KviKvsParser; -public: - KviKvsTreeNodeDataList(const QChar * pLocation); - ~KviKvsTreeNodeDataList(); -protected: - KviPointerList<KviKvsTreeNodeData> * m_pDataList; -protected: - void addItem(KviKvsTreeNodeData * p); - void prependItem(KviKvsTreeNodeData * p); -public: - KviKvsTreeNodeData * item(unsigned int uIdx); - KviKvsTreeNodeData * releaseFirst(); - bool evaluate(KviKvsRunTimeContext * c,KviKvsVariantList * pBuffer); - virtual void contextDescription(QString &szBuffer); - - virtual void dump(const char * prefix); -}; - -#endif //!_KVI_KVS_TREENODE_DATALIST_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_expression.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_expression.cpp deleted file mode 100644 index 455580c965..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_expression.cpp +++ /dev/null @@ -1,776 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_expression.cpp -// Creation date : Mon 06 Oct 2003 01.35 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_expression.h" -#include "kvi_locale.h" - -#include <math.h> - -KviKvsTreeNodeExpression::KviKvsTreeNodeExpression(const QChar * pLocation) -: KviKvsTreeNodeData(pLocation) -{ - m_pParentExpression = 0; -} - -KviKvsTreeNodeExpression::~KviKvsTreeNodeExpression() -{ -} - - -void KviKvsTreeNodeExpression::contextDescription(QString &szBuffer) -{ - szBuffer = "Expression Evaluation"; -} - -void KviKvsTreeNodeExpression::dump(const char * prefix) -{ - debug("%s Expression",prefix); -} - -int KviKvsTreeNodeExpression::precedence() -{ - return PREC_MAXIMUM; -} - -KviKvsTreeNodeExpression * KviKvsTreeNodeExpression::left() -{ - debug("KviKvsTreeNodeExpression::left() : should never end up here!"); - return 0; -} - -KviKvsTreeNodeExpression * KviKvsTreeNodeExpression::right() -{ - debug("KviKvsTreeNodeExpression::right() : should never end up here!"); - return 0; -} - -void KviKvsTreeNodeExpression::setLeft(KviKvsTreeNodeExpression *) -{ - debug("KviKvsTreeNodeExpression::setLeft() : should never end up here!"); -} - -void KviKvsTreeNodeExpression::setRight(KviKvsTreeNodeExpression *) -{ - debug("KviKvsTreeNodeExpression::setRight() : should never end up here!"); -} - -KviKvsTreeNodeExpression * KviKvsTreeNodeExpression::parentWithPrecedenceLowerThan(int iPrec) -{ - if(precedence() > iPrec)return this; - if(!parentExpression())return 0; - return parentExpression()->parentWithPrecedenceLowerThan(iPrec); -} - -int KviKvsTreeNodeExpression::firstBinaryOperator() -{ - if(!left())return precedence(); - return left()->firstBinaryOperator(); -} - -/////////////////////////////////////////////////////////////////////////////// - - -KviKvsTreeNodeExpressionVariableOperand::KviKvsTreeNodeExpressionVariableOperand(const QChar * pLocation,KviKvsTreeNodeData * pData) -: KviKvsTreeNodeExpression(pLocation) -{ - m_pData = pData; - m_pData->setParent(this); -} - -KviKvsTreeNodeExpressionVariableOperand::~KviKvsTreeNodeExpressionVariableOperand() -{ - delete m_pData; -} - -void KviKvsTreeNodeExpressionVariableOperand::contextDescription(QString &szBuffer) -{ - szBuffer = "Expression Variable Operand Evaluation"; -} - -void KviKvsTreeNodeExpressionVariableOperand::dump(const char * prefix) -{ - debug("%s ExpressionVariableOperand",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pData->dump(tmp.utf8().data()); -} - -bool KviKvsTreeNodeExpressionVariableOperand::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - return m_pData->evaluateReadOnly(c,pBuffer); -} - - -/////////////////////////////////////////////////////////////////////////////// - -KviKvsTreeNodeExpressionConstantOperand::KviKvsTreeNodeExpressionConstantOperand(const QChar * pLocation,KviKvsVariant * pConstant) -: KviKvsTreeNodeExpression(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pConstant = pConstant; -#endif -} - -KviKvsTreeNodeExpressionConstantOperand::~KviKvsTreeNodeExpressionConstantOperand() -{ -#ifdef COMPILE_NEW_KVS - delete m_pConstant; -#endif -} - -void KviKvsTreeNodeExpressionConstantOperand::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Expression Constant Operand Evaluation"; -#endif -} - - -void KviKvsTreeNodeExpressionConstantOperand::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s ExpressionConstantOperand",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pConstant->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeExpressionConstantOperand::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - pBuffer->copyFrom(m_pConstant); -#endif - return true; -} - -/////////////////////////////////////////////////////////////////////////////// - - -KviKvsTreeNodeExpressionOperator::KviKvsTreeNodeExpressionOperator(const QChar * pLocation) -: KviKvsTreeNodeExpression(pLocation) -{ -} - -KviKvsTreeNodeExpressionOperator::~KviKvsTreeNodeExpressionOperator() -{ -} - -void KviKvsTreeNodeExpressionOperator::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Expression Operator Evaluation"; -#endif -} - - -void KviKvsTreeNodeExpressionOperator::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s ExpressionOperator",prefix); -#endif -} - - - -/////////////////////////////////////////////////////////////////////////////// - - -KviKvsTreeNodeExpressionUnaryOperator::KviKvsTreeNodeExpressionUnaryOperator(const QChar * pLocation,KviKvsTreeNodeExpression * pData) -: KviKvsTreeNodeExpressionOperator(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pData = pData; - m_pData->setParent(this); - m_pData->setParentExpression(this); -#endif -} - -KviKvsTreeNodeExpressionUnaryOperator::~KviKvsTreeNodeExpressionUnaryOperator() -{ -#ifdef COMPILE_NEW_KVS - delete m_pData; -#endif -} - -void KviKvsTreeNodeExpressionUnaryOperator::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Expression Unary Operator Evaluation"; -#endif -} - - - - -void KviKvsTreeNodeExpressionUnaryOperator::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s ExpressionUnaryOperator",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pData->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeExpressionUnaryOperator::evaluateOperand(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant v; - if(!m_pData->evaluateReadOnly(c,&v))return false; - - if(!v.asNumber(m_nData)) - { - c->error(this,__tr2qs("Operand of unary operator didn't evaluate to a number")); - return false; - } -#endif - return true; -} - -/////////////////////////////////////////////////////////////////////////////// - - -KviKvsTreeNodeExpressionUnaryOperatorNegate::KviKvsTreeNodeExpressionUnaryOperatorNegate(const QChar * pLocation,KviKvsTreeNodeExpression * pData) -: KviKvsTreeNodeExpressionUnaryOperator(pLocation,pData) -{ -} - -KviKvsTreeNodeExpressionUnaryOperatorNegate::~KviKvsTreeNodeExpressionUnaryOperatorNegate() -{ -} - - -void KviKvsTreeNodeExpressionUnaryOperatorNegate::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Expression Unary Operator Negate"; -#endif -} - - -void KviKvsTreeNodeExpressionUnaryOperatorNegate::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s ExpressionUnaryOperatorNegate",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pData->dump(tmp.utf8().data()); -#endif -} - -int KviKvsTreeNodeExpressionUnaryOperatorNegate::precedence() -{ - return PREC_OP_NEGATE; -} - -bool KviKvsTreeNodeExpressionUnaryOperatorNegate::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - if(!evaluateOperand(c))return false; - if(m_nData.isReal())pBuffer->setReal(-m_nData.real()); - else pBuffer->setInteger(-m_nData.integer()); -#endif - return true; -} - - -/////////////////////////////////////////////////////////////////////////////// - - -KviKvsTreeNodeExpressionUnaryOperatorBitwiseNot::KviKvsTreeNodeExpressionUnaryOperatorBitwiseNot(const QChar * pLocation,KviKvsTreeNodeExpression * pData) -: KviKvsTreeNodeExpressionUnaryOperator(pLocation,pData) -{ -} - -KviKvsTreeNodeExpressionUnaryOperatorBitwiseNot::~KviKvsTreeNodeExpressionUnaryOperatorBitwiseNot() -{ -} - -void KviKvsTreeNodeExpressionUnaryOperatorBitwiseNot::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Expression Unary Operator Bitwise Not"; -#endif -} - -void KviKvsTreeNodeExpressionUnaryOperatorBitwiseNot::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s ExpressionUnaryOperatorBitwiseNot",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pData->dump(tmp.utf8().data()); -#endif -} - -int KviKvsTreeNodeExpressionUnaryOperatorBitwiseNot::precedence() -{ - return PREC_OP_BITWISENOT; -} - -bool KviKvsTreeNodeExpressionUnaryOperatorBitwiseNot::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - if(!evaluateOperand(c))return false; - if(m_nData.isReal())pBuffer->setInteger(~(int)(m_nData.real())); - else pBuffer->setInteger(~m_nData.integer()); -#endif - return true; -} - - -/////////////////////////////////////////////////////////////////////////////// - - -KviKvsTreeNodeExpressionUnaryOperatorLogicalNot::KviKvsTreeNodeExpressionUnaryOperatorLogicalNot(const QChar * pLocation,KviKvsTreeNodeExpression * pData) -: KviKvsTreeNodeExpressionUnaryOperator(pLocation,pData) -{ -} - -KviKvsTreeNodeExpressionUnaryOperatorLogicalNot::~KviKvsTreeNodeExpressionUnaryOperatorLogicalNot() -{ -} - -void KviKvsTreeNodeExpressionUnaryOperatorLogicalNot::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Expression Unary Operator Logical Not"; -#endif -} - -void KviKvsTreeNodeExpressionUnaryOperatorLogicalNot::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s ExpressionUnaryOperatorLogicalNot",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pData->dump(tmp.utf8().data()); -#endif -} - -int KviKvsTreeNodeExpressionUnaryOperatorLogicalNot::precedence() -{ - return PREC_OP_LOGICALNOT; -} - -bool KviKvsTreeNodeExpressionUnaryOperatorLogicalNot::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant v; - if(!m_pData->evaluateReadOnly(c,&v))return false; -//#warning "FIXME: We could use setNothing() for false and setInteger(1) for true: this would save memory allocations for false conditions" - pBuffer->setBoolean(!v.asBoolean()); -#endif - return true; -} - - - -/////////////////////////////////////////////////////////////////////////////// - - -KviKvsTreeNodeExpressionBinaryOperator::KviKvsTreeNodeExpressionBinaryOperator(const QChar * pLocation) -: KviKvsTreeNodeExpressionOperator(pLocation) -{ - m_pLeft = 0; - m_pRight = 0; -} - -KviKvsTreeNodeExpressionBinaryOperator::~KviKvsTreeNodeExpressionBinaryOperator() -{ - if(m_pLeft)delete m_pLeft; - if(m_pRight)delete m_pRight; -} - -bool KviKvsTreeNodeExpressionBinaryOperator::evaluateOperands(KviKvsRunTimeContext * c) -{ - KviKvsVariant v1; - if(!m_pLeft->evaluateReadOnly(c,&v1))return false; - if(!v1.asNumber(m_nLeft)) - { - c->error(this,__tr2qs("Left operand didn't evaluate to a number")); - return false; - } - KviKvsVariant v2; - if(!m_pRight->evaluateReadOnly(c,&v2))return false; - if(!v2.asNumber(m_nRight)) - { - c->error(this,__tr2qs("Right operand didn't evaluate to a number")); - return false; - } - return true; -} - -KviKvsTreeNodeExpression * KviKvsTreeNodeExpressionBinaryOperator::left() -{ - return m_pLeft; -} - -KviKvsTreeNodeExpression * KviKvsTreeNodeExpressionBinaryOperator::right() -{ - return m_pRight; -} - -int KviKvsTreeNodeExpressionBinaryOperator::firstBinaryOperator() -{ - return precedence(); -} - -void KviKvsTreeNodeExpressionBinaryOperator::setLeft(KviKvsTreeNodeExpression * pLeft) -{ - m_pLeft = pLeft; - m_pLeft->setParent(this); - m_pLeft->setParentExpression(this); -} - -void KviKvsTreeNodeExpressionBinaryOperator::setRight(KviKvsTreeNodeExpression * pRight) -{ - m_pRight = pRight; - m_pRight->setParent(this); - m_pRight->setParentExpression(this); -} - - -void KviKvsTreeNodeExpressionBinaryOperator::dumpOperands(const char * prefix) -{ - QString tmp = prefix; - tmp.append(" "); - if(m_pLeft)m_pLeft->dump(tmp.utf8().data()); - if(m_pRight)m_pRight->dump(tmp.utf8().data()); -} - -void KviKvsTreeNodeExpressionBinaryOperator::contextDescription(QString &szBuffer) -{ - szBuffer = "Expression Binary Operator"; -} - -void KviKvsTreeNodeExpressionBinaryOperator::dump(const char * prefix) -{ - debug("%s ExpressionBinaryOperator",prefix); - dumpOperands(prefix); -} - -//////////////////////////////////////////////////////////////////////////////// - - -#define PREIMPLEMENT_BINARY_OPERATOR(__name,__stringname,__contextdescription,__precedence) \ - __name::__name(const QChar * pLocation) \ - : KviKvsTreeNodeExpressionBinaryOperator(pLocation){} \ - __name::~__name(){} \ - void __name::dump(const char * prefix){ debug("%s " __stringname,prefix); dumpOperands(prefix); } \ - void __name::contextDescription(QString &szBuffer){ szBuffer = __contextdescription; } \ - int __name::precedence(){ return __precedence; }; - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorSum,"ExpressionBinaryOperatorSum","Expression Binary Operator \"+\"",PREC_OP_SUM) - -bool KviKvsTreeNodeExpressionBinaryOperatorSum::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - if(!evaluateOperands(c))return false; - if(m_nLeft.isInteger()) - { - if(m_nRight.isInteger())pBuffer->setInteger(m_nLeft.integer() + m_nRight.integer()); - else pBuffer->setReal(m_nLeft.integer() + m_nRight.real()); - } else { - if(m_nRight.isInteger())pBuffer->setReal(m_nLeft.real() + m_nRight.integer()); - else pBuffer->setReal(m_nLeft.real() + m_nRight.real()); - } - return true; -} - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorSubtraction,"ExpressionBinaryOperatorSubtraction","Expression Binary Operator \"-\"",PREC_OP_SUBTRACTION) - -bool KviKvsTreeNodeExpressionBinaryOperatorSubtraction::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - if(!evaluateOperands(c))return false; - if(m_nLeft.isInteger()) - { - if(m_nRight.isInteger())pBuffer->setInteger(m_nLeft.integer() - m_nRight.integer()); - else pBuffer->setReal(((kvs_real_t)(m_nLeft.integer())) - m_nRight.real()); - } else { - if(m_nRight.isInteger())pBuffer->setReal(m_nLeft.real() - ((kvs_real_t)(m_nRight.integer()))); - else pBuffer->setReal(m_nLeft.real() - m_nRight.real()); - } - return true; -} - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorMultiplication,"ExpressionBinaryOperatorMultiplication","Expression Binary Operator \"*\"",PREC_OP_MULTIPLICATION) - -bool KviKvsTreeNodeExpressionBinaryOperatorMultiplication::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - if(!evaluateOperands(c))return false; - if(m_nLeft.isInteger()) - { - if(m_nRight.isInteger())pBuffer->setInteger(m_nLeft.integer() * m_nRight.integer()); - else pBuffer->setReal(((kvs_real_t)(m_nLeft.integer())) * m_nRight.real()); - } else { - if(m_nRight.isInteger())pBuffer->setReal(m_nLeft.real() * ((kvs_real_t)(m_nRight.integer()))); - else pBuffer->setReal(m_nLeft.real() * m_nRight.real()); - } - return true; -} - - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorDivision,"ExpressionBinaryOperatorDivision","Expression Binary Operator \"/\"",PREC_OP_DIVISION) - -bool KviKvsTreeNodeExpressionBinaryOperatorDivision::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - if(!evaluateOperands(c))return false; - - if(m_nRight.isInteger()) - { - if(m_nRight.integer() == 0) - { - c->error(this,__tr2qs("Division by zero")); - return false; - } - if(m_nLeft.isInteger())pBuffer->setInteger(m_nLeft.integer() / m_nRight.integer()); - else pBuffer->setReal(m_nLeft.real() / ((kvs_real_t)(m_nRight.integer()))); - } else { - if(m_nRight.real() == 0.0) - { - c->error(this,__tr2qs("Division by zero")); - return false; - } - if(m_nLeft.isInteger())pBuffer->setReal(((kvs_real_t)(m_nLeft.integer())) / m_nRight.real()); - else pBuffer->setReal(m_nLeft.real() / m_nRight.real()); - } - return true; -} - - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorModulus,"ExpressionBinaryOperatorModulus","Expression Binary Operator \"modulus\"",PREC_OP_MODULUS) - -bool KviKvsTreeNodeExpressionBinaryOperatorModulus::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - if(!evaluateOperands(c))return false; - - if(m_nRight.isInteger()) - { - if(m_nRight.integer() == 0) - { - c->error(this,__tr2qs("Division by zero")); - return false; - } - if(m_nLeft.isInteger())pBuffer->setInteger(m_nLeft.integer() % m_nRight.integer()); - else pBuffer->setReal(fmod(m_nLeft.real(),((kvs_real_t)(m_nRight.integer())))); - } else { - if(m_nRight.real() == 0.0) - { - c->error(this,__tr2qs("Division by zero")); - return false; - } - if(m_nLeft.isInteger())pBuffer->setReal(fmod(((kvs_real_t)(m_nLeft.integer())),m_nRight.real())); - else pBuffer->setReal(fmod(m_nLeft.real(),m_nRight.real())); - } - return true; -} - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorBitwiseAnd,"ExpressionBinaryOperatorBitwiseAnd","Expression Binary Operator \"&\"",PREC_OP_BITWISEAND) - -bool KviKvsTreeNodeExpressionBinaryOperatorBitwiseAnd::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - if(!evaluateOperands(c))return false; - int iLeft = m_nLeft.isInteger() ? m_nLeft.integer() : (kvs_int_t)m_nLeft.real(); - int iRight = m_nRight.isInteger() ? m_nRight.integer() : (kvs_int_t)m_nRight.real(); - pBuffer->setInteger(iLeft & iRight); - return true; -} - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorBitwiseOr,"ExpressionBinaryOperatorBitwiseOr","Expression Binary Operator \"|\"",PREC_OP_BITWISEOR) - -bool KviKvsTreeNodeExpressionBinaryOperatorBitwiseOr::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - if(!evaluateOperands(c))return false; - int iLeft = m_nLeft.isInteger() ? m_nLeft.integer() : (kvs_int_t)m_nLeft.real(); - int iRight = m_nRight.isInteger() ? m_nRight.integer() : (kvs_int_t)m_nRight.real(); - pBuffer->setInteger(iLeft | iRight); - return true; -} - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorBitwiseXor,"ExpressionBinaryOperatorBitwiseXor","Expression Binary Operator \"^\"",PREC_OP_BITWISEXOR) - -bool KviKvsTreeNodeExpressionBinaryOperatorBitwiseXor::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - if(!evaluateOperands(c))return false; - int iLeft = m_nLeft.isInteger() ? m_nLeft.integer() : (kvs_int_t)m_nLeft.real(); - int iRight = m_nRight.isInteger() ? m_nRight.integer() : (kvs_int_t)m_nRight.real(); - pBuffer->setInteger(iLeft ^ iRight); - return true; -} - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorShiftLeft,"ExpressionBinaryOperatorShiftLeft","Expression Binary Operator \"<<\"",PREC_OP_SHIFTLEFT) - -bool KviKvsTreeNodeExpressionBinaryOperatorShiftLeft::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - if(!evaluateOperands(c))return false; - int iLeft = m_nLeft.isInteger() ? m_nLeft.integer() : (kvs_int_t)(m_nLeft.real()); - int iRight = m_nRight.isInteger() ? m_nRight.integer() : (kvs_int_t)(m_nRight.real()); - pBuffer->setInteger(iLeft << iRight); - return true; -} - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorShiftRight,"ExpressionBinaryOperatorShiftRight","Expression Binary Operator \">>\"",PREC_OP_SHIFTRIGHT) - -bool KviKvsTreeNodeExpressionBinaryOperatorShiftRight::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - if(!evaluateOperands(c))return false; - int iLeft = m_nLeft.isInteger() ? m_nLeft.integer() : (kvs_int_t)(m_nLeft.real()); - int iRight = m_nRight.isInteger() ? m_nRight.integer() : (kvs_int_t)(m_nRight.real()); - pBuffer->setInteger(iLeft >> iRight); - return true; -} - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorAnd,"ExpressionBinaryOperatorAnd","Expression Binary Operator \"&&\"",PREC_OP_AND) - -bool KviKvsTreeNodeExpressionBinaryOperatorAnd::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - KviKvsVariant v1; - KviKvsVariant v2; - if(!m_pLeft->evaluateReadOnly(c,&v1))return false; - //#warning "FIXME: We could use setNothing() as false: this would save memory allocations (and thus time)" - if(!v1.asBoolean()) - { - pBuffer->setBoolean(false); - return true; - } - if(!m_pRight->evaluateReadOnly(c,&v2))return false; - pBuffer->setBoolean(v2.asBoolean()); - return true; -} - - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorOr,"ExpressionBinaryOperatorOr","Expression Binary Operator \"||\"",PREC_OP_OR) - -bool KviKvsTreeNodeExpressionBinaryOperatorOr::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - KviKvsVariant v1; - KviKvsVariant v2; - if(!m_pLeft->evaluateReadOnly(c,&v1))return false; - //#warning "FIXME: We could use setNothing() as false: this would save memory allocations (and thus time)" - if(v1.asBoolean()) - { - pBuffer->setBoolean(true); - return true; - } - if(!m_pRight->evaluateReadOnly(c,&v2))return false; - pBuffer->setBoolean(v2.asBoolean()); - return true; -} - - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorXor,"ExpressionBinaryOperatorXor","Expression Binary Operator \"^^\"",PREC_OP_XOR) - -bool KviKvsTreeNodeExpressionBinaryOperatorXor::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - KviKvsVariant v1; - KviKvsVariant v2; - if(!m_pLeft->evaluateReadOnly(c,&v1))return false; - if(!m_pRight->evaluateReadOnly(c,&v2))return false; - //#warning "FIXME: We could use setNothing() as false: this would save memory allocations (and thus time)" - if(v1.asBoolean()) - pBuffer->setBoolean(!v2.asBoolean()); - else { - if(v2.asBoolean()) - pBuffer->setBoolean(!v1.asBoolean()); - else - pBuffer->setBoolean(false); - } - return true; -} - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorLowerThan,"ExpressionBinaryOperatorLowerThan","Expression Binary Operator \"<\"",PREC_OP_LOWERTHAN) - -bool KviKvsTreeNodeExpressionBinaryOperatorLowerThan::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - KviKvsVariant v1; - KviKvsVariant v2; - if(!m_pLeft->evaluateReadOnly(c,&v1))return false; - if(!m_pRight->evaluateReadOnly(c,&v2))return false; - pBuffer->setBoolean(v1.compare(&v2,true) > 0); - return true; -} - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorGreaterThan,"ExpressionBinaryOperatorGreaterThan","Expression Binary Operator \">\"",PREC_OP_GREATERTHAN) - -bool KviKvsTreeNodeExpressionBinaryOperatorGreaterThan::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - KviKvsVariant v1; - KviKvsVariant v2; - if(!m_pLeft->evaluateReadOnly(c,&v1))return false; - if(!m_pRight->evaluateReadOnly(c,&v2))return false; - pBuffer->setBoolean(v1.compare(&v2,true) < 0); - return true; -} - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorLowerOrEqualTo,"ExpressionBinaryOperatorLowerOrEqualTo","Expression Binary Operator \"<=\"",PREC_OP_LOWEROREQUALTO) - -bool KviKvsTreeNodeExpressionBinaryOperatorLowerOrEqualTo::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - KviKvsVariant v1; - KviKvsVariant v2; - if(!m_pLeft->evaluateReadOnly(c,&v1))return false; - if(!m_pRight->evaluateReadOnly(c,&v2))return false; - pBuffer->setBoolean(v1.compare(&v2,true) >= 0); - return true; -} - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorGreaterOrEqualTo,"ExpressionBinaryOperatorGreaterOrEqualTo","Expression Binary Operator \">=\"",PREC_OP_GREATEROREQUALTO) - -bool KviKvsTreeNodeExpressionBinaryOperatorGreaterOrEqualTo::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - KviKvsVariant v1; - KviKvsVariant v2; - if(!m_pLeft->evaluateReadOnly(c,&v1))return false; - if(!m_pRight->evaluateReadOnly(c,&v2))return false; - pBuffer->setBoolean(v1.compare(&v2,true) <= 0); - return true; -} - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorEqualTo,"ExpressionBinaryOperatorEqualTo","Expression Binary Operator \"==\"",PREC_OP_EQUALTO) - -bool KviKvsTreeNodeExpressionBinaryOperatorEqualTo::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - KviKvsVariant v1; - KviKvsVariant v2; - if(!m_pLeft->evaluateReadOnly(c,&v1))return false; - if(!m_pRight->evaluateReadOnly(c,&v2))return false; - pBuffer->setBoolean(v1.compare(&v2,true) == 0); - return true; -} - - -PREIMPLEMENT_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorNotEqualTo,"ExpressionBinaryOperatorNotEqualTo","Expression Binary Operator \"!=\"",PREC_OP_NOTEQUALTO) - -bool KviKvsTreeNodeExpressionBinaryOperatorNotEqualTo::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - KviKvsVariant v1; - KviKvsVariant v2; - if(!m_pLeft->evaluateReadOnly(c,&v1))return false; - if(!m_pRight->evaluateReadOnly(c,&v2))return false; - pBuffer->setBoolean(v1.compare(&v2,true) != 0); - return true; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_expression.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_expression.h deleted file mode 100644 index 2abf88501c..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_expression.h +++ /dev/null @@ -1,249 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_EXPRESSION_H_ -#define _KVI_KVS_TREENODE_EXPRESSION_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_expression.h -// Creation date : Mon 06 Oct 2003 01.33 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_qstring.h" -#include "kvi_kvs_variant.h" -#include "kvi_kvs_treenode_data.h" - - -// absolute precedence (~operand part) -#define PREC_MAXIMUM -10 - - -#define PREC_OP_LOGICALNOT -3 /* ! */ -#define PREC_OP_BITWISENOT -2 /* ~ */ -#define PREC_OP_NEGATE -1 /* - */ -// high precedence -#define PREC_OP_BITWISEAND 0 /* & */ -#define PREC_OP_BITWISEOR 1 /* | */ -#define PREC_OP_BITWISEXOR 2 /* ^ */ - -#define PREC_OP_SHIFTRIGHT 3 /* >> */ -#define PREC_OP_SHIFTLEFT 3 /* << */ - -#define PREC_OP_MULTIPLICATION 5 /* * */ -#define PREC_OP_DIVISION 5 /* / */ -#define PREC_OP_MODULUS 5 /* % */ - -#define PREC_OP_SUM 8 /* + */ -#define PREC_OP_SUBTRACTION 8 /* - */ - -#define PREC_OP_GREATERTHAN 11 /* > */ /* Case sensitive (normal for numbers) */ -#define PREC_OP_LOWERTHAN 11 /* < */ /* Case sensitive (normal for numbers) */ - -#define PREC_OP_EQUALTO 12 /* == */ /* Case sensitive comparison for strings or normal comp.fr numbers */ - -#define PREC_OP_GREATEROREQUALTO 14 /* >= */ /* Case sensitive (normal for numbers) */ -#define PREC_OP_LOWEROREQUALTO 14 /* <= */ /* Case sensitive (normal for numbers) */ - -#define PREC_OP_NOTEQUALTO 15 /* != */ /* Case sensitive (normal for numbers) */ - -#define PREC_OP_AND 16 /* && */ -#define PREC_OP_OR 17 /* || */ -#define PREC_OP_XOR 18 /* ^^ */ -// low precedence - - -class KVIRC_API KviKvsTreeNodeExpression : public KviKvsTreeNodeData -{ - // this class is never instantiated -public: - KviKvsTreeNodeExpression(const QChar * pLocation); - ~KviKvsTreeNodeExpression(); -protected: - KviKvsTreeNodeExpression * m_pParentExpression; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual int precedence(); - virtual KviKvsTreeNodeExpression * left(); - virtual KviKvsTreeNodeExpression * right(); - virtual void setLeft(KviKvsTreeNodeExpression * pLeft); - virtual void setRight(KviKvsTreeNodeExpression * pRight); - virtual int firstBinaryOperator(); - KviKvsTreeNodeExpression * parentExpression(){ return m_pParentExpression; }; - void setParentExpression(KviKvsTreeNodeExpression * pParent){ m_pParentExpression = pParent; }; - virtual KviKvsTreeNodeExpression * parentWithPrecedenceLowerThan(int iPrec); -}; - - -class KVIRC_API KviKvsTreeNodeExpressionVariableOperand : public KviKvsTreeNodeExpression -{ -public: - KviKvsTreeNodeExpressionVariableOperand(const QChar * pLocation,KviKvsTreeNodeData * pData); - ~KviKvsTreeNodeExpressionVariableOperand(); -protected: - KviKvsTreeNodeData * m_pData; // can't be null -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pResult); -}; - - -class KVIRC_API KviKvsTreeNodeExpressionConstantOperand : public KviKvsTreeNodeExpression -{ -public: - KviKvsTreeNodeExpressionConstantOperand(const QChar * pLocation,KviKvsVariant * pConstant); - ~KviKvsTreeNodeExpressionConstantOperand(); -public: - KviKvsVariant * m_pConstant; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pResult); -}; - - - - - - - - - - - - - -class KVIRC_API KviKvsTreeNodeExpressionOperator : public KviKvsTreeNodeExpression -{ -public: - KviKvsTreeNodeExpressionOperator(const QChar * pLocation); - ~KviKvsTreeNodeExpressionOperator(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); -}; - -class KVIRC_API KviKvsTreeNodeExpressionUnaryOperator : public KviKvsTreeNodeExpressionOperator -{ -public: - KviKvsTreeNodeExpressionUnaryOperator(const QChar * pLocation,KviKvsTreeNodeExpression * pData); - ~KviKvsTreeNodeExpressionUnaryOperator(); -protected: - KviKvsTreeNodeExpression * m_pData; // can't be null! - KviKvsNumber m_nData; // result of the number evaluation -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - bool evaluateOperand(KviKvsRunTimeContext * c); -}; - -class KVIRC_API KviKvsTreeNodeExpressionUnaryOperatorNegate : public KviKvsTreeNodeExpressionUnaryOperator -{ -public: - KviKvsTreeNodeExpressionUnaryOperatorNegate(const QChar * pLocation,KviKvsTreeNodeExpression * pData); - ~KviKvsTreeNodeExpressionUnaryOperatorNegate(); -public: - virtual int precedence(); - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pResult); -}; - -class KVIRC_API KviKvsTreeNodeExpressionUnaryOperatorBitwiseNot : public KviKvsTreeNodeExpressionUnaryOperator -{ -public: - KviKvsTreeNodeExpressionUnaryOperatorBitwiseNot(const QChar * pLocation,KviKvsTreeNodeExpression * pData); - ~KviKvsTreeNodeExpressionUnaryOperatorBitwiseNot(); -public: - virtual int precedence(); - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pResult); -}; - -class KVIRC_API KviKvsTreeNodeExpressionUnaryOperatorLogicalNot : public KviKvsTreeNodeExpressionUnaryOperator -{ -public: - KviKvsTreeNodeExpressionUnaryOperatorLogicalNot(const QChar * pLocation,KviKvsTreeNodeExpression * pData); - ~KviKvsTreeNodeExpressionUnaryOperatorLogicalNot(); -public: - virtual int precedence(); - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pResult); -}; - -class KVIRC_API KviKvsTreeNodeExpressionBinaryOperator : public KviKvsTreeNodeExpressionOperator -{ -public: - KviKvsTreeNodeExpressionBinaryOperator(const QChar * pLocation); - ~KviKvsTreeNodeExpressionBinaryOperator(); -protected: - KviKvsTreeNodeExpression * m_pLeft; // can be zero only during parsing (and thus when deleting) - KviKvsTreeNodeExpression * m_pRight; // can be zero only during parsing (and thus when deleting) - KviKvsNumber m_nLeft; // buffer used to evaluate numeric operands - KviKvsNumber m_nRight; // buffer used to evaluate numeric operands -public: - virtual KviKvsTreeNodeExpression * left(); - virtual KviKvsTreeNodeExpression * right(); - void setLeft(KviKvsTreeNodeExpression * pLeft); - void setRight(KviKvsTreeNodeExpression * pRight); - virtual int firstBinaryOperator(); -public: - void dumpOperands(const char * prefix); - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); -protected: - bool evaluateOperands(KviKvsRunTimeContext * c); -}; - -#define DECLARE_BINARY_OPERATOR(__name) \ - class KVIRC_API __name : public KviKvsTreeNodeExpressionBinaryOperator \ - { \ - public: \ - __name(const QChar * pLocation); \ - ~__name(); \ - public: \ - virtual void contextDescription(QString &szBuffer); \ - virtual void dump(const char * prefix); \ - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pResult); \ - virtual int precedence(); \ - } - -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorSum); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorMultiplication); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorSubtraction); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorDivision); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorModulus); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorBitwiseAnd); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorBitwiseOr); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorBitwiseXor); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorShiftLeft); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorShiftRight); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorAnd); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorOr); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorXor); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorGreaterThan); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorLowerThan); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorGreaterOrEqualTo); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorLowerOrEqualTo); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorEqualTo); -DECLARE_BINARY_OPERATOR(KviKvsTreeNodeExpressionBinaryOperatorNotEqualTo); - -#endif //!_KVI_KVS_TREENODE_EXPRESSION_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_expressionreturn.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_expressionreturn.cpp deleted file mode 100644 index fdcde2244d..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_expressionreturn.cpp +++ /dev/null @@ -1,68 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_expressionreturn.cpp -// Created on Fri 30 Jan 2004 01:27:09 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_kvs_treenode_expressionreturn.h" -#include "kvi_kvs_treenode_expression.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_locale.h" - -KviKvsTreeNodeExpressionReturn::KviKvsTreeNodeExpressionReturn(const QChar * pLocation,KviKvsTreeNodeExpression * pExpression) -: KviKvsTreeNodeInstruction(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pExpression = pExpression; - m_pExpression->setParent(this); -#endif -} - -KviKvsTreeNodeExpressionReturn::~KviKvsTreeNodeExpressionReturn() -{ -#ifdef COMPILE_NEW_KVS - delete m_pExpression; -#endif -} - - -void KviKvsTreeNodeExpressionReturn::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Expression Return Evaluation"; -#endif -} - -void KviKvsTreeNodeExpressionReturn::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s ExpressionReturn",prefix); - QString tmp = prefix; - tmp += " "; - m_pExpression->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeExpressionReturn::execute(KviKvsRunTimeContext * c) -{ - return m_pExpression->evaluateReadOnly(c,c->returnValue()); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_expressionreturn.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_expressionreturn.h deleted file mode 100644 index 2ceb1caca7..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_expressionreturn.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_EXPRESSIONRETURN_H_ -#define _KVI_KVS_TREENODE_EXPRESSIONRETURN_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_expressionreturn.h -// Created on Fri 30 Jan 2004 01:27:09 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_treenode_instruction.h" - -class KviKvsTreeNodeExpression; - -class KVIRC_API KviKvsTreeNodeExpressionReturn : public KviKvsTreeNodeInstruction -{ -public: - KviKvsTreeNodeExpressionReturn(const QChar * pLocation,KviKvsTreeNodeExpression * pExpression); - ~KviKvsTreeNodeExpressionReturn(); -protected: - KviKvsTreeNodeExpression * m_pExpression; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -#endif //!_KVI_KVS_TREENODE_EXPRESSIONRETURN_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_extendedscopevariable.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_extendedscopevariable.cpp deleted file mode 100644 index f2d444c402..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_extendedscopevariable.cpp +++ /dev/null @@ -1,79 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_extendedscopevariable.cpp -// Created on Thu 16 Oct 2003 22:41:20 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_extendedscopevariable.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_locale.h" - -KviKvsTreeNodeExtendedScopeVariable::KviKvsTreeNodeExtendedScopeVariable(const QChar * pLocation,const QString &szIdentifier) -: KviKvsTreeNodeVariable(pLocation,szIdentifier) -{ -} - -KviKvsTreeNodeExtendedScopeVariable::~KviKvsTreeNodeExtendedScopeVariable() -{ -} - -void KviKvsTreeNodeExtendedScopeVariable::contextDescription(QString &szBuffer) -{ - szBuffer = "Extended Scope Variable \""; - szBuffer += m_szIdentifier; - szBuffer += "\""; -} - -void KviKvsTreeNodeExtendedScopeVariable::dump(const char * prefix) -{ - debug("%s ExtendedScopeVariable(%s)",prefix,m_szIdentifier.utf8().data()); -} - -bool KviKvsTreeNodeExtendedScopeVariable::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - if(!c->extendedScopeVariables()) - { - c->error(this,__tr2qs("There are no extended scope variables in this scope")); - return false; - } - - KviKvsVariant * v = c->extendedScopeVariables()->find(m_szIdentifier); - if(v) - { - pBuffer->copyFrom(v); - } else { - pBuffer->setNothing(); - } - return true; -} - -KviKvsRWEvaluationResult * KviKvsTreeNodeExtendedScopeVariable::evaluateReadWrite(KviKvsRunTimeContext * c) -{ - if(!c->extendedScopeVariables()) - { - c->error(this,__tr2qs("There are no extended scope variables in this scope")); - return false; - } - - return new KviKvsHashElement(0,c->extendedScopeVariables()->get(m_szIdentifier),c->extendedScopeVariables(),m_szIdentifier); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_extendedscopevariable.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_extendedscopevariable.h deleted file mode 100644 index ba305ac440..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_extendedscopevariable.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_EXTENDEDSCOPEVARIABLE_H_ -#define _KVI_KVS_TREENODE_EXTENDEDSCOPEVARIABLE_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_extendedscopevariable.h -// Created on Thu 16 Oct 2003 22:41:20 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_variable.h" - -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeExtendedScopeVariable : public KviKvsTreeNodeVariable -{ -public: - KviKvsTreeNodeExtendedScopeVariable(const QChar * pLocation,const QString &szIdentifier); - ~KviKvsTreeNodeExtendedScopeVariable(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pResult); - virtual KviKvsRWEvaluationResult * evaluateReadWrite(KviKvsRunTimeContext * c); -}; - -#endif //!_KVI_KVS_TREENODE_EXTENDEDSCOPEVARIABLE_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_functioncall.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_functioncall.cpp deleted file mode 100644 index 55f4acacd9..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_functioncall.cpp +++ /dev/null @@ -1,62 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_functioncall.cpp -// Created on Tue 07 Oct 2003 03:14:44 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_functioncall.h" - - -KviKvsTreeNodeFunctionCall::KviKvsTreeNodeFunctionCall(const QChar * pLocation,const QString &szFunctionName,KviKvsTreeNodeDataList * pParams) -: KviKvsTreeNodeData(pLocation) -{ - m_szFunctionName = szFunctionName; - m_pParams = pParams; - m_pParams->setParent(this); -} - -KviKvsTreeNodeFunctionCall::~KviKvsTreeNodeFunctionCall() -{ - delete m_pParams; -} - -void KviKvsTreeNodeFunctionCall::contextDescription(QString &szBuffer) -{ - szBuffer = "Function Call"; -} - -void KviKvsTreeNodeFunctionCall::dump(const char * prefix) -{ - debug("%s FunctionCall",prefix); -} - -bool KviKvsTreeNodeFunctionCall::canEvaluateToObjectReference() -{ - return true; -} - -bool KviKvsTreeNodeFunctionCall::isFunctionCall() -{ - return true; -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_functioncall.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_functioncall.h deleted file mode 100644 index 870a47f9ac..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_functioncall.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_FUNCTIONCALL_H_ -#define _KVI_KVS_TREENODE_FUNCTIONCALL_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_functioncall.h -// Created on Tue 07 Oct 2003 03:14:44 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_treenode_data.h" -#include "kvi_kvs_treenode_datalist.h" - -class KVIRC_API KviKvsTreeNodeFunctionCall : public KviKvsTreeNodeData -{ -public: - KviKvsTreeNodeFunctionCall(const QChar * pLocation,const QString &szFunctionName,KviKvsTreeNodeDataList * pParams); - ~KviKvsTreeNodeFunctionCall(); -protected: - QString m_szFunctionName; - KviKvsTreeNodeDataList * m_pParams; // never 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool canEvaluateToObjectReference(); // yes - virtual bool isFunctionCall(); // yes -}; - - -#endif //!_KVI_KVS_TREENODE_FUNCTIONCALL_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_globalvariable.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_globalvariable.cpp deleted file mode 100644 index ad4fa131f8..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_globalvariable.cpp +++ /dev/null @@ -1,63 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_globalvariable.cpp -// Created on Thu 16 Oct 2003 22:45:01 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_globalvariable.h" -#include "kvi_kvs_runtimecontext.h" - -KviKvsTreeNodeGlobalVariable::KviKvsTreeNodeGlobalVariable(const QChar * pLocation,const QString &szIdentifier) -: KviKvsTreeNodeVariable(pLocation,szIdentifier) -{ -} - -KviKvsTreeNodeGlobalVariable::~KviKvsTreeNodeGlobalVariable() -{ -} - -void KviKvsTreeNodeGlobalVariable::contextDescription(QString &szBuffer) -{ - szBuffer = "Global Variable \""; - szBuffer += m_szIdentifier; - szBuffer += "\""; -} - -void KviKvsTreeNodeGlobalVariable::dump(const char * prefix) -{ - debug("%s GlobalVariable(%s)",prefix,m_szIdentifier.utf8().data()); -} - - -bool KviKvsTreeNodeGlobalVariable::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - KviKvsVariant * v = c->globalVariables()->find(m_szIdentifier); - if(v)pBuffer->copyFrom(v); - else pBuffer->setNothing(); - return true; -} - -KviKvsRWEvaluationResult * KviKvsTreeNodeGlobalVariable::evaluateReadWrite(KviKvsRunTimeContext * c) -{ - return new KviKvsHashElement(0,c->globalVariables()->get(m_szIdentifier),c->globalVariables(),m_szIdentifier); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_globalvariable.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_globalvariable.h deleted file mode 100644 index 7e95d26ebf..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_globalvariable.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_GLOBALVARIABLE_H_ -#define _KVI_KVS_TREENODE_GLOBALVARIABLE_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_globalvariable.h -// Created on Thu 16 Oct 2003 22:45:01 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_variable.h" - -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeGlobalVariable : public KviKvsTreeNodeVariable -{ -public: - KviKvsTreeNodeGlobalVariable(const QChar * pLocation,const QString &szIdentifier); - ~KviKvsTreeNodeGlobalVariable(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pResult); - virtual KviKvsRWEvaluationResult * evaluateReadWrite(KviKvsRunTimeContext * c); -}; - -#endif //!_KVI_KVS_TREENODE_GLOBALVARIABLE_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashcount.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashcount.cpp deleted file mode 100644 index bb1fe19c79..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashcount.cpp +++ /dev/null @@ -1,88 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_hashcount.cpp -// Created on Tue 07 Oct 2003 03:05:30 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_hashcount.h" -#include "kvi_kvs_variant.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_object.h" -#include "kvi_locale.h" - - -KviKvsTreeNodeHashCount::KviKvsTreeNodeHashCount(const QChar * pLocation,KviKvsTreeNodeData * pSource) -: KviKvsTreeNodeIndirectData(pLocation,pSource) -{ -} - -KviKvsTreeNodeHashCount::~KviKvsTreeNodeHashCount() -{ -} - -void KviKvsTreeNodeHashCount::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Hash Count Operator"; -#endif -} - -void KviKvsTreeNodeHashCount::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s HashCount",prefix); -#endif -} - -bool KviKvsTreeNodeHashCount::evaluateReadOnlyInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant val; - if(o) - { - if(!m_pSource->evaluateReadOnlyInObjectScope(o,c,&val))return false; - } else { - if(!m_pSource->evaluateReadOnly(c,&val))return false; - } - - if(!val.isHash()) - { - if(!val.isNothing()) - { - QString szType; - val.getTypeName(szType); - c->warning(this,__tr2qs("The argument of the hash count '#' operator didn't evaluate to a hash: automatic conversion from type '%Q' supplied"),&szType); - } - pBuffer->setInteger(0); - return true; - } - - pBuffer->setInteger(val.hash()->size()); -#endif - return true; -} -bool KviKvsTreeNodeHashCount::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - return evaluateReadOnlyInObjectScope(0,c,pBuffer); -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashcount.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashcount.h deleted file mode 100644 index 7daf4450fb..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashcount.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_HASHCOUNT_H_ -#define _KVI_KVS_TREENODE_HASHCOUNT_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_hashcount.h -// Created on Tue 07 Oct 2003 03:05:30 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_indirectdata.h" - -class KviKvsRunTimeContext; -class KviKvsVariant; -class KviKvsObject; - -class KVIRC_API KviKvsTreeNodeHashCount : public KviKvsTreeNodeIndirectData -{ -public: - KviKvsTreeNodeHashCount(const QChar * pLocation,KviKvsTreeNodeData * pSource); - ~KviKvsTreeNodeHashCount(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); - virtual bool evaluateReadOnlyInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); -}; - -#endif //!_KVI_KVS_TREENODE_HASHCOUNT_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashelement.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashelement.cpp deleted file mode 100644 index ac8bd2b9ee..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashelement.cpp +++ /dev/null @@ -1,164 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_hashelement.cpp -// Created on Tue 07 Oct 2003 03:04:18 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_hashelement.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_locale.h" -#include "kvi_kvs_hash.h" -#include "kvi_kvs_object.h" - -KviKvsTreeNodeHashElement::KviKvsTreeNodeHashElement(const QChar * pLocation,KviKvsTreeNodeData * pSource,KviKvsTreeNodeData * pKey) -: KviKvsTreeNodeArrayOrHashElement(pLocation,pSource) -{ -#ifdef COMPILE_NEW_KVS - m_pKey = pKey; - m_pKey->setParent(this); -#endif -} - - -KviKvsTreeNodeHashElement::~KviKvsTreeNodeHashElement() -{ -#ifdef COMPILE_NEW_KVS - delete m_pKey; -#endif -} - -void KviKvsTreeNodeHashElement::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Hash Element Evaluation"; -#endif -} - -void KviKvsTreeNodeHashElement::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s HashElement",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pSource->dump(tmp.utf8().data()); - m_pKey->dump(tmp.utf8().data()); -#endif -} - - -bool KviKvsTreeNodeHashElement::evaluateReadOnlyInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant key; - if(!m_pKey->evaluateReadOnly(c,&key))return false; - - QString szKey; - key.asString(szKey); - - if(szKey.isEmpty()) - { - c->warning(this,__tr2qs("Hash key evaluated to empty string: fix the script")); - pBuffer->setNothing(); - return true; - } - - KviKvsVariant val; - if(o) - { - if(!m_pSource->evaluateReadOnlyInObjectScope(o,c,&val))return false; - } else { - if(!m_pSource->evaluateReadOnly(c,&val))return false; - } - - if(!val.isHash()) - { - if(!val.isNothing()) - { - QString szType; - val.getTypeName(szType); - c->warning(this,__tr2qs("The argument of the {} subscript didn't evaluate to a hash: automatic conversion from type '%Q' supplied"),&szType); - } - pBuffer->setNothing(); - return true; - } - - KviKvsVariant * v = val.hash()->find(szKey); - if(!v) - { - pBuffer->setNothing(); - return true; - } - - pBuffer->copyFrom(v); -#endif - return true; -} - -KviKvsRWEvaluationResult * KviKvsTreeNodeHashElement::evaluateReadWriteInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant key; - if(!m_pKey->evaluateReadOnly(c,&key))return 0; - - QString szKey; - key.asString(szKey); - - if(szKey.isEmpty()) - { - c->warning(this,__tr2qs("Hash key evaluated to empty string: fix the script")); - } - - KviKvsRWEvaluationResult * result; - if(o)result = m_pSource->evaluateReadWriteInObjectScope(o,c); - else result = m_pSource->evaluateReadWrite(c); - if(!result)return 0; - - if(!result->result()->isHash()) - { - // convert to hash in some way -//#warning "Supply a *real* conversion from other types to array ?" - if(!result->result()->isNothing()) - { - QString szType; - result->result()->getTypeName(szType); - c->warning(this,__tr2qs("The argument of the {} subscript didn't evaluate to a hash automatic conversion from %Q supplied"),&szType); - } - result->result()->setHash(new KviKvsHash()); - } - - return new KviKvsHashElement(result,result->result()->hash()->get(szKey),result->result()->hash(),szKey); -#else - return 0; -#endif -} - - -bool KviKvsTreeNodeHashElement::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - return evaluateReadOnlyInObjectScope(0,c,pBuffer); -} - -KviKvsRWEvaluationResult * KviKvsTreeNodeHashElement::evaluateReadWrite(KviKvsRunTimeContext * c) -{ - return evaluateReadWriteInObjectScope(0,c); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashelement.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashelement.h deleted file mode 100644 index a4b899b82f..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashelement.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_HASHELEMENT_H_ -#define _KVI_KVS_TREENODE_HASHELEMENT_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_hashelement.h -// Created on Tue 07 Oct 2003 03:04:18 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_data.h" -#include "kvi_kvs_treenode_arrayorhashelement.h" - -class KviKvsRunTimeContext; -class KviKvsObject; - -class KVIRC_API KviKvsTreeNodeHashElement : public KviKvsTreeNodeArrayOrHashElement -{ -public: - KviKvsTreeNodeHashElement(const QChar * pLocation,KviKvsTreeNodeData * pSource,KviKvsTreeNodeData * pIndex); - ~KviKvsTreeNodeHashElement(); -protected: - KviKvsTreeNodeData * m_pKey; // can't be null -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); - virtual KviKvsRWEvaluationResult * evaluateReadWrite(KviKvsRunTimeContext * c); - virtual bool evaluateReadOnlyInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); - virtual KviKvsRWEvaluationResult * evaluateReadWriteInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c); -}; - - -#endif //!_KVI_KVS_TREENODE_HASHELEMENT_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashreferenceassert.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashreferenceassert.cpp deleted file mode 100644 index a31a864951..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashreferenceassert.cpp +++ /dev/null @@ -1,107 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_hashreferenceassert.cpp -// Created on Thu 16 Oct 2003 23:43:06 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_hashreferenceassert.h" -#include "kvi_kvs_rwevaluationresult.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_variant.h" -#include "kvi_locale.h" - -KviKvsTreeNodeHashReferenceAssert::KviKvsTreeNodeHashReferenceAssert(const QChar * pLocation,KviKvsTreeNodeData * pSource) -: KviKvsTreeNodeIndirectData(pLocation,pSource) -{ -} - -KviKvsTreeNodeHashReferenceAssert::~KviKvsTreeNodeHashReferenceAssert() -{ -} - -bool KviKvsTreeNodeHashReferenceAssert::isReadOnly() -{ - return m_pSource->isReadOnly(); -} - -void KviKvsTreeNodeHashReferenceAssert::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Hash Reference Assert"; -#endif -} - -void KviKvsTreeNodeHashReferenceAssert::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s HashReferenceAssert",prefix); -#endif -} - -bool KviKvsTreeNodeHashReferenceAssert::evaluateReadOnlyInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - if(o) - { - if(!m_pSource->evaluateReadOnlyInObjectScope(o,c,pBuffer))return false; - } else { - if(!m_pSource->evaluateReadOnly(c,pBuffer))return false; - } - - if(!pBuffer->isHash()) - { - if(!pBuffer->isNothing()) - { - QString szType; - pBuffer->getTypeName(szType); - c->error(this,__tr2qs("Hash reference assert failed: the variable evaluated to type '%Q'"),&szType); - return false; - } - } -#endif - return true; -} - -KviKvsRWEvaluationResult * KviKvsTreeNodeHashReferenceAssert::evaluateReadWriteInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsRWEvaluationResult * r; - if(o)r = m_pSource->evaluateReadWriteInObjectScope(o,c); - else r = m_pSource->evaluateReadWrite(c); - if(!r)return false; - - return r; -#else - return 0; -#endif -} - -bool KviKvsTreeNodeHashReferenceAssert::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - return evaluateReadOnlyInObjectScope(0,c,pBuffer); -} - -KviKvsRWEvaluationResult * KviKvsTreeNodeHashReferenceAssert::evaluateReadWrite(KviKvsRunTimeContext * c) -{ - return evaluateReadWriteInObjectScope(0,c); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashreferenceassert.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashreferenceassert.h deleted file mode 100644 index 4cd5bcaac4..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_hashreferenceassert.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_HASHREFERENCEASSERT_H_ -#define _KVI_KVS_TREENODE_HASHREFERENCEASSERT_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_hashreferenceassert.h -// Created on Thu 16 Oct 2003 23:43:06 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_indirectdata.h" - -class KviKvsRunTimeContext; -class KviKvsVariant; -class KviKvsRWEvaluationResult; -class KviKvsObject; - -class KVIRC_API KviKvsTreeNodeHashReferenceAssert : public KviKvsTreeNodeIndirectData -{ -public: - KviKvsTreeNodeHashReferenceAssert(const QChar * pLocation,KviKvsTreeNodeData * pSource); - ~KviKvsTreeNodeHashReferenceAssert(); -protected: - -public: - virtual bool isReadOnly(); - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); - virtual KviKvsRWEvaluationResult * evaluateReadWrite(KviKvsRunTimeContext * c); - virtual bool evaluateReadOnlyInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); - virtual KviKvsRWEvaluationResult * evaluateReadWriteInObjectScope(KviKvsObject *o,KviKvsRunTimeContext * c); -}; - -#endif //!_KVI_KVS_TREENODE_HASHREFERENCEASSERT_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_indirectdata.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_indirectdata.cpp deleted file mode 100644 index 4b235dd866..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_indirectdata.cpp +++ /dev/null @@ -1,46 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_indirectdata.cpp -// Created on Thu 16 Oct 2003 22:49:46 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_indirectdata.h" - -KviKvsTreeNodeIndirectData::KviKvsTreeNodeIndirectData(const QChar * pLocation,KviKvsTreeNodeData * pSource) -: KviKvsTreeNodeData(pLocation) -{ - m_pSource = pSource; - m_pSource->setParent(this); -} - -KviKvsTreeNodeIndirectData::~KviKvsTreeNodeIndirectData() -{ - delete m_pSource; -} - - -bool KviKvsTreeNodeIndirectData::canEvaluateInObjectScope() -{ - return m_pSource->canEvaluateInObjectScope(); -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_indirectdata.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_indirectdata.h deleted file mode 100644 index a19c1b29bc..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_indirectdata.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_INDIRECTDATA_H_ -#define _KVI_KVS_TREENODE_INDIRECTDATA_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_indirectdata.h -// Created on Thu 16 Oct 2003 22:49:46 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_data.h" - -class KVIRC_API KviKvsTreeNodeIndirectData : public KviKvsTreeNodeData -{ -public: - KviKvsTreeNodeIndirectData(const QChar * pLocation,KviKvsTreeNodeData * pSource); - ~KviKvsTreeNodeIndirectData(); -protected: - KviKvsTreeNodeData * m_pSource; // can't be null! -public: - virtual bool canEvaluateInObjectScope(); -}; - -#endif //!_KVI_KVS_TREENODE_INDIRECTDATA_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_instruction.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_instruction.cpp deleted file mode 100644 index bb2925cf49..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_instruction.cpp +++ /dev/null @@ -1,43 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_instruction.cpp -// Creation date : Mon 06 Sep 2003 03.47 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_instruction.h" - -void KviKvsTreeNodeInstruction::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Instruction"; -#endif -} - -void KviKvsTreeNodeInstruction::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s Instruction",prefix); -#endif -} - - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_instruction.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_instruction.h deleted file mode 100644 index 111e5d3d65..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_instruction.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_INSTRUCTION_H_ -#define _KVI_KVS_TREENODE_INSTRUCTION_H_ -//============================================================================= -// -// File : kvi_kvs_treenode.h -// Creation date : Mon 06 Oct 2003 03.46 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_qstring.h" -#include "kvi_kvs_treenode_base.h" - -class KviKvsRunTimeContext; - - -class KVIRC_API KviKvsTreeNodeInstruction : public KviKvsTreeNode -{ -public: - KviKvsTreeNodeInstruction(const QChar * pLocation) - : KviKvsTreeNode(pLocation){}; - ~KviKvsTreeNodeInstruction(){}; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - - // execute() is the main entry point to the tree visit - // execute() returns false when the tree visiting has - // to be stopped and returns true when it has been - // succesfully completed. A false return value may - // signal an error but is also used by break, halt, return - // and similar. The error condition is signaled by - // KviKvsRunTimeContext::error(). - virtual bool execute(KviKvsRunTimeContext * c) = 0; -}; - - -#endif //!_KVI_KVS_TREENODE_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_instructionblock.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_instructionblock.cpp deleted file mode 100644 index 97e71aaf18..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_instructionblock.cpp +++ /dev/null @@ -1,88 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_instructionblock.cpp -// Created on Thu 09 Oct 2003 01:44:31 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - - -#include "kvi_kvs_treenode_instructionblock.h" -#include "kvi_kvs_runtimecontext.h" - -KviKvsTreeNodeInstructionBlock::KviKvsTreeNodeInstructionBlock(const QChar * pLocation) -: KviKvsTreeNodeInstruction(pLocation) -{ - m_pInstructionList = new KviPointerList<KviKvsTreeNodeInstruction>; - m_pInstructionList->setAutoDelete(true); -} - -KviKvsTreeNodeInstructionBlock::~KviKvsTreeNodeInstructionBlock() -{ - delete m_pInstructionList; -} - -void KviKvsTreeNodeInstructionBlock::contextDescription(QString &szBuffer) -{ - szBuffer = "Instruction Block"; -} - -void KviKvsTreeNodeInstructionBlock::dump(const char * prefix) -{ - debug("%s InstructionBlock",prefix); - QString tmp = prefix; - tmp.append(" "); - for(KviKvsTreeNodeInstruction * i = m_pInstructionList->first();i;i = m_pInstructionList->next()) - { - i->dump(tmp.utf8().data()); - } -} - -KviKvsTreeNodeInstruction * KviKvsTreeNodeInstructionBlock::releaseFirst() -{ - m_pInstructionList->setAutoDelete(false); - KviKvsTreeNodeInstruction * i = m_pInstructionList->first(); - if(i) - { - i->setParent(0); - m_pInstructionList->removeFirst(); - } - m_pInstructionList->setAutoDelete(true); - return i; -} - -void KviKvsTreeNodeInstructionBlock::addInstruction(KviKvsTreeNodeInstruction * i) -{ - m_pInstructionList->append(i); - i->setParent(this); -} - -bool KviKvsTreeNodeInstructionBlock::execute(KviKvsRunTimeContext * c) -{ - // to accomodate recursion we need to use an iterator here - KviPointerListIterator<KviKvsTreeNodeInstruction> it(*m_pInstructionList); - while(KviKvsTreeNodeInstruction * i = it.current()) - { - if(!i->execute(c))return false; - ++it; - } - return true; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_instructionblock.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_instructionblock.h deleted file mode 100644 index 78f1805ad0..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_instructionblock.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_INSTRUCTIONBLOCK_H_ -#define _KVI_KVS_TREENODE_INSTRUCTIONBLOCK_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_instructionblock.h -// Created on Thu 09 Oct 2003 01:44:31 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_pointerlist.h" - -#include "kvi_kvs_treenode_instruction.h" - -class KviKvsRunTimeContext; - - -class KVIRC_API KviKvsTreeNodeInstructionBlock : public KviKvsTreeNodeInstruction -{ -public: - KviKvsTreeNodeInstructionBlock(const QChar * pLocation); - ~KviKvsTreeNodeInstructionBlock(); -protected: - KviPointerList<KviKvsTreeNodeInstruction> * m_pInstructionList; -public: - unsigned int instructionCount(){ return m_pInstructionList->count(); }; - void addInstruction(KviKvsTreeNodeInstruction * i); - KviKvsTreeNodeInstruction * releaseFirst(); - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - - virtual bool execute(KviKvsRunTimeContext * c); - -}; - - -#endif //!_KVI_KVS_TREENODE_INSTRUCTIONBLOCK_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_localvariable.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_localvariable.cpp deleted file mode 100644 index f0d2300c3e..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_localvariable.cpp +++ /dev/null @@ -1,76 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_localvariable.cpp -// Created on Thu 16 Oct 2003 22:41:20 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_localvariable.h" -#include "kvi_kvs_runtimecontext.h" - -KviKvsTreeNodeLocalVariable::KviKvsTreeNodeLocalVariable(const QChar * pLocation,const QString &szIdentifier) -: KviKvsTreeNodeVariable(pLocation,szIdentifier) -{ -} - -KviKvsTreeNodeLocalVariable::~KviKvsTreeNodeLocalVariable() -{ -} - -void KviKvsTreeNodeLocalVariable::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Local Variable \""; - szBuffer += m_szIdentifier; - szBuffer += "\""; -#endif -} - -void KviKvsTreeNodeLocalVariable::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s LocalVariable(%s)",prefix,m_szIdentifier.utf8().data()); -#endif -} - -bool KviKvsTreeNodeLocalVariable::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant * v = c->localVariables()->find(m_szIdentifier); - if(v) - { - pBuffer->copyFrom(v); - } else { - pBuffer->setNothing(); - } -#endif - return true; -} - -KviKvsRWEvaluationResult * KviKvsTreeNodeLocalVariable::evaluateReadWrite(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - return new KviKvsHashElement(0,c->localVariables()->get(m_szIdentifier),c->localVariables(),m_szIdentifier); -#else - return 0; -#endif -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_localvariable.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_localvariable.h deleted file mode 100644 index 0f3b487543..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_localvariable.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_LOCALVARIABLE_H_ -#define _KVI_KVS_TREENODE_LOCALVARIABLE_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_localvariable.h -// Created on Thu 16 Oct 2003 22:41:20 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_variable.h" - -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeLocalVariable : public KviKvsTreeNodeVariable -{ -public: - KviKvsTreeNodeLocalVariable(const QChar * pLocation,const QString &szIdentifier); - ~KviKvsTreeNodeLocalVariable(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pResult); - virtual KviKvsRWEvaluationResult * evaluateReadWrite(KviKvsRunTimeContext * c); -}; - -#endif //!_KVI_KVS_TREENODE_LOCALVARIABLE_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulecallbackcommand.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulecallbackcommand.cpp deleted file mode 100644 index ad5ece1cd6..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulecallbackcommand.cpp +++ /dev/null @@ -1,97 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_modulecallbackcommand.cpp -// Created on Thu 09 Oct 2003 02:09:10 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_modulecallbackcommand.h" -#include "kvi_kvs_treenode_datalist.h" -#include "kvi_kvs_treenode_switchlist.h" - -#include "kvi_modulemanager.h" -#include "kvi_locale.h" -#include "kvi_kvs_moduleinterface.h" -#include "kvi_kvs_runtimecontext.h" - -KviKvsTreeNodeModuleCallbackCommand::KviKvsTreeNodeModuleCallbackCommand(const QChar * pLocation,const QString &szModuleName,const QString &szCmdName,KviKvsTreeNodeDataList * params,KviKvsScript * pCallback) -: KviKvsTreeNodeCallbackCommand(pLocation,szCmdName,params,pCallback) -{ - m_szModuleName = szModuleName; -} - - -KviKvsTreeNodeModuleCallbackCommand::~KviKvsTreeNodeModuleCallbackCommand() -{ -} - -void KviKvsTreeNodeModuleCallbackCommand::contextDescription(QString &szBuffer) -{ - szBuffer = "Module Callback Command \""; - szBuffer += m_szModuleName; - szBuffer += "."; - szBuffer += m_szCmdName; - szBuffer += "\""; -} - -void KviKvsTreeNodeModuleCallbackCommand::dump(const char * prefix) -{ - debug("%s ModuleCallbackCommand(%s.%s)",prefix,m_szModuleName.utf8().data(),m_szCmdName.utf8().data()); - dumpSwitchList(prefix); - dumpParameterList(prefix); - dumpCallback(prefix); -} - -bool KviKvsTreeNodeModuleCallbackCommand::execute(KviKvsRunTimeContext * c) -{ -//#warning "FIXME: module names should be UNICODE!" - KviModule * m = g_pModuleManager->getModule(m_szModuleName.utf8().data()); - if(!m) - { - QString szErr = g_pModuleManager->lastError().ptr(); // <-- fixme! - c->error(this,__tr2qs("Module command call failed: can't load the module '%Q': %Q"),&m_szModuleName,&szErr); - return false; - } - - KviKvsModuleCallbackCommandExecRoutine * proc = m->kvsFindCallbackCommand(m_szCmdName); - if(!proc) - { - c->error(this,__tr2qs("Module command call failed: the module '%Q' doesn't export a callback command named '%Q'"),&m_szModuleName,&m_szCmdName); - return false; - } - - KviKvsVariantList l; - l.setAutoDelete(true); - if(!(m_pParams->evaluate(c,&l)))return false; - - KviKvsSwitchList swl; - if(m_pSwitches) - { - if(!(m_pSwitches->evaluate(c,&swl)))return false; - } - - c->setDefaultReportLocation(this); - - KviKvsModuleCallbackCommandCall call(m,c,&l,&swl,m_pCallback,m_pParams); - - return (*proc)(&call); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulecallbackcommand.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulecallbackcommand.h deleted file mode 100644 index b5cc1390ee..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulecallbackcommand.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_MODULECALLBACKCOMMAND_H_ -#define _KVI_KVS_TREENODE_MODULECALLBACKCOMMAND_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_modulecallbackcommand.h -// Created on Thu 09 Oct 2003 02:09:10 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_callbackcommand.h" - -class KviKvsTreeNodeDataList; -class KviKvsScript; -class KviKvsRunTimeContext; - - -class KVIRC_API KviKvsTreeNodeModuleCallbackCommand : public KviKvsTreeNodeCallbackCommand -{ -public: - KviKvsTreeNodeModuleCallbackCommand(const QChar * pLocation,const QString &szModuleName,const QString &szCmdName,KviKvsTreeNodeDataList * params,KviKvsScript * pCallback); - ~KviKvsTreeNodeModuleCallbackCommand(); -protected: - QString m_szModuleName; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - bool execute(KviKvsRunTimeContext* c); -}; - - -#endif //!_KVI_KVS_TREENODE_MODULECALLBACKCOMMAND_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulefunctioncall.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulefunctioncall.cpp deleted file mode 100644 index 79a581c587..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulefunctioncall.cpp +++ /dev/null @@ -1,90 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_modulefunctioncall.cpp -// Created on Tue 07 Oct 2003 03:19:28 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_modulefunctioncall.h" -#include "kvi_kvs_treenode_datalist.h" - -#include "kvi_modulemanager.h" -#include "kvi_locale.h" -#include "kvi_kvs_moduleinterface.h" -#include "kvi_kvs_runtimecontext.h" - - -KviKvsTreeNodeModuleFunctionCall::KviKvsTreeNodeModuleFunctionCall(const QChar * pLocation,const QString &szModuleName,const QString &szFncName,KviKvsTreeNodeDataList * pParams) -: KviKvsTreeNodeFunctionCall(pLocation,szFncName,pParams) -{ - m_szModuleName = szModuleName; -} - -KviKvsTreeNodeModuleFunctionCall::~KviKvsTreeNodeModuleFunctionCall() -{ -} - -void KviKvsTreeNodeModuleFunctionCall::contextDescription(QString &szBuffer) -{ - szBuffer = "Module Function Call \""; - szBuffer += m_szModuleName; - szBuffer += "."; - szBuffer += m_szFunctionName; - szBuffer += "\""; -} - -void KviKvsTreeNodeModuleFunctionCall::dump(const char * prefix) -{ - debug("%s ModuleFunctionCall(%s.%s)",prefix,m_szModuleName.utf8().data(),m_szFunctionName.utf8().data()); - QString tmp = prefix; - tmp.append(" "); - m_pParams->dump(tmp.utf8().data()); -} - -bool KviKvsTreeNodeModuleFunctionCall::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -//#warning "FIXME: module names should be UNICODE!" - KviModule * m = g_pModuleManager->getModule(m_szModuleName.utf8().data()); - if(!m) - { - QString szErr = g_pModuleManager->lastError().ptr(); // <-- fixme! - c->error(this,__tr2qs("Module function call failed: can't load the module '%Q': %Q"),&m_szModuleName,&szErr); - return false; - } - - KviKvsModuleFunctionExecRoutine * proc = m->kvsFindFunction(m_szFunctionName); - if(!proc) - { - c->error(this,__tr2qs("Module function call failed: the module '%Q' doesn't export a function named '%Q'"),&m_szModuleName,&m_szFunctionName); - return false; - } - - KviKvsVariantList l; - if(!m_pParams->evaluate(c,&l))return false; - - pBuffer->setNothing(); - c->setDefaultReportLocation(this); - KviKvsModuleFunctionCall call(m,c,&l,pBuffer); - - return (*proc)(&call); -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulefunctioncall.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulefunctioncall.h deleted file mode 100644 index 9968f113a4..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulefunctioncall.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_MODULEFUNCTIONCALL_H_ -#define _KVI_KVS_TREENODE_MODULEFUNCTIONCALL_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_modulefunctioncall.h -// Created on Tue 07 Oct 2003 03:19:28 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_datalist.h" -#include "kvi_kvs_treenode_functioncall.h" - -class KviKvsRunTimeContext; -class KviKvsVariant; - -class KVIRC_API KviKvsTreeNodeModuleFunctionCall : public KviKvsTreeNodeFunctionCall -{ -public: - KviKvsTreeNodeModuleFunctionCall(const QChar * pLocation,const QString &szModuleName,const QString &szFncName,KviKvsTreeNodeDataList * pParams); - ~KviKvsTreeNodeModuleFunctionCall(); -protected: - QString m_szModuleName; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); -}; - -#endif //!_KVI_KVS_TREENODE_MODULEFUNCTIONCALL_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulesimplecommand.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulesimplecommand.cpp deleted file mode 100644 index 4b826d37e2..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulesimplecommand.cpp +++ /dev/null @@ -1,97 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_modulesimplecommand.cpp -// Created on Thu 09 Oct 2003 02:18:27 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_modulesimplecommand.h" -#include "kvi_kvs_treenode_datalist.h" -#include "kvi_kvs_treenode_switchlist.h" - -#include "kvi_modulemanager.h" -#include "kvi_locale.h" -#include "kvi_kvs_moduleinterface.h" -#include "kvi_kvs_runtimecontext.h" - -KviKvsTreeNodeModuleSimpleCommand::KviKvsTreeNodeModuleSimpleCommand(const QChar * pLocation,const QString &szModuleName,const QString &szCmdName,KviKvsTreeNodeDataList * params) -: KviKvsTreeNodeSimpleCommand(pLocation,szCmdName,params) -{ - m_szModuleName = szModuleName; -} - - -KviKvsTreeNodeModuleSimpleCommand::~KviKvsTreeNodeModuleSimpleCommand() -{ -} - -void KviKvsTreeNodeModuleSimpleCommand::contextDescription(QString &szBuffer) -{ - szBuffer = "Module Callback Command \""; - szBuffer += m_szModuleName; - szBuffer += "."; - szBuffer += m_szCmdName; - szBuffer += "\""; -} - -void KviKvsTreeNodeModuleSimpleCommand::dump(const char * prefix) -{ - debug("%s ModuleSimpleCommand(%s.%s)",prefix,m_szModuleName.utf8().data(),m_szCmdName.utf8().data()); - dumpSwitchList(prefix); - dumpParameterList(prefix); -} - -bool KviKvsTreeNodeModuleSimpleCommand::execute(KviKvsRunTimeContext * c) -{ - //#warning "FIXME: module names should be UNICODE!" - KviModule * m = g_pModuleManager->getModule(m_szModuleName.utf8().data()); - if(!m) - { - QString szErr = g_pModuleManager->lastError().ptr(); // <-- fixme! - c->error(this,__tr2qs("Module command call failed: can't load the module '%Q': %Q"),&m_szModuleName,&szErr); - return false; - } - - KviKvsModuleSimpleCommandExecRoutine * proc = m->kvsFindSimpleCommand(m_szCmdName); - if(!proc) - { - c->error(this,__tr2qs("Module command call failed: the module '%Q' doesn't export a command named '%Q'"),&m_szModuleName,&m_szCmdName); - return false; - } - - KviKvsVariantList l; - l.setAutoDelete(true); - - if(!(m_pParams->evaluate(c,&l)))return false; - KviKvsSwitchList swl; - if(m_pSwitches) - { - if(!(m_pSwitches->evaluate(c,&swl)))return false; - } - - c->setDefaultReportLocation(this); - - KviKvsModuleCommandCall call(m,c,&l,&swl); - - return (*proc)(&call); -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulesimplecommand.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulesimplecommand.h deleted file mode 100644 index 679fb812b7..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_modulesimplecommand.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_MODULESIMPLECOMMAND_H_ -#define _KVI_KVS_TREENODE_MODULESIMPLECOMMAND_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_modulesimplecommand.h -// Created on Thu 09 Oct 2003 02:18:27 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_simplecommand.h" - -class KviKvsTreeNodeDataList; -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeModuleSimpleCommand : public KviKvsTreeNodeSimpleCommand -{ -public: - KviKvsTreeNodeModuleSimpleCommand(const QChar * pLocation,const QString &szModuleName,const QString &szCmdName,KviKvsTreeNodeDataList * params); - ~KviKvsTreeNodeModuleSimpleCommand(); -protected: - QString m_szModuleName; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - - -#endif //!_KVI_KVS_TREENODE_MODULESIMPLECOMMAND_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_multipleparameteridentifier.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_multipleparameteridentifier.cpp deleted file mode 100644 index aeb9406f9a..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_multipleparameteridentifier.cpp +++ /dev/null @@ -1,89 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_multipleparameteridentifier.cpp -// Created on Tue 07 Oct 2003 03:49:31 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_multipleparameteridentifier.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_variant.h" - - -KviKvsTreeNodeMultipleParameterIdentifier::KviKvsTreeNodeMultipleParameterIdentifier(const QChar * pLocation,int iStart,int iEnd) -: KviKvsTreeNodeData(pLocation) -{ - m_iStart = iStart; - m_iEnd = iEnd; -} - -KviKvsTreeNodeMultipleParameterIdentifier::~KviKvsTreeNodeMultipleParameterIdentifier() -{ -} - -void KviKvsTreeNodeMultipleParameterIdentifier::contextDescription(QString &szBuffer) -{ - szBuffer = "Multiple Parameter Identifier \"$"; - if(m_iEnd < m_iStart)KviQString::appendFormatted(szBuffer,"%d-",m_iStart); - else KviQString::appendFormatted(szBuffer,"%d-%d",m_iStart,m_iEnd); - szBuffer += "\""; -} - -void KviKvsTreeNodeMultipleParameterIdentifier::dump(const char * prefix) -{ - if(m_iEnd < m_iStart)debug("%s MultipleParameterIdentifier(%d-)",prefix,m_iStart); - else debug("%s MultipleParameterIdentifier(%d-%d)",prefix,m_iStart,m_iEnd); -} - -bool KviKvsTreeNodeMultipleParameterIdentifier::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - KviKvsVariant * v = c->parameterList()->at(m_iStart); - if(!v) - { - pBuffer->setNothing(); - return true; - } - - QString sz; - v->asString(sz); - - if(m_iEnd >= m_iStart) - { - // only up to m_iEnd - int idx = m_iStart; - for(v = c->parameterList()->next();v && (idx < m_iEnd);v = c->parameterList()->next()) - { - sz += QChar(' '); - v->appendAsString(sz); - idx++; - } - } else { - // all up to the end of the list - for(v = c->parameterList()->next();v;v = c->parameterList()->next()) - { - sz += QChar(' '); - v->appendAsString(sz); - } - } - pBuffer->setString(sz); - return true; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_multipleparameteridentifier.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_multipleparameteridentifier.h deleted file mode 100644 index 97b6103a7f..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_multipleparameteridentifier.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_MULTIPLEPARAMETERIDENTIFIER_H_ -#define _KVI_KVS_TREENODE_MULTIPLEPARAMETERIDENTIFIER_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_multipleparameteridentifier.h -// Created on Tue 07 Oct 2003 03:49:31 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_data.h" - -class KviKvsRunTimeContext; -class KviKvsVariant; - -class KVIRC_API KviKvsTreeNodeMultipleParameterIdentifier : public KviKvsTreeNodeData -{ -public: - KviKvsTreeNodeMultipleParameterIdentifier(const QChar * pLocation,int iStart,int iEnd); - ~KviKvsTreeNodeMultipleParameterIdentifier(); -protected: - int m_iStart; - int m_iEnd; // the index of the last parameter wanted (may be -1: in that case all up to the end) -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); -}; - - -#endif //!_KVI_KVS_TREENODE_MULTIPLEPARAMETERIDENTIFIER_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_objectfield.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_objectfield.cpp deleted file mode 100644 index 17edb21930..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_objectfield.cpp +++ /dev/null @@ -1,80 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_objectfield.cpp -// Created on Thu 28 Apr 2005 17:12:14 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_objectfield.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_object.h" -#include "kvi_kvs_hash.h" - -KviKvsTreeNodeObjectField::KviKvsTreeNodeObjectField(const QChar * pLocation,const QString &szIdentifier) -: KviKvsTreeNodeVariable(pLocation,szIdentifier) -{ -} - -KviKvsTreeNodeObjectField::~KviKvsTreeNodeObjectField() -{ -} - -void KviKvsTreeNodeObjectField::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Object Field \""; - szBuffer += m_szIdentifier; - szBuffer += "\""; -#endif -} - -void KviKvsTreeNodeObjectField::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s ObjectField(%s)",prefix,m_szIdentifier.utf8().data()); -#endif -} - -bool KviKvsTreeNodeObjectField::canEvaluateInObjectScope() -{ - return true; -} - -bool KviKvsTreeNodeObjectField::evaluateReadOnlyInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant * v = o->dataContainer()->find(m_szIdentifier); - if(v)pBuffer->copyFrom(v); - else pBuffer->setNothing(); -#endif - return true; -} - -KviKvsRWEvaluationResult * KviKvsTreeNodeObjectField::evaluateReadWriteInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - return new KviKvsHashElement(0,o->dataContainer()->get(m_szIdentifier),o->dataContainer(),m_szIdentifier); -#else - return 0; -#endif -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_objectfield.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_objectfield.h deleted file mode 100644 index e57a214eeb..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_objectfield.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_OBJECTFIELD_H_ -#define _KVI_KVS_TREENODE_OBJECTFIELD_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_objectfield.h -// Created on Thu 28 Apr 2005 17:12:14 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_variable.h" - -class KviKvsRunTimeContext; -class KviKvsObject; - -class KVIRC_API KviKvsTreeNodeObjectField : public KviKvsTreeNodeVariable -{ -public: - KviKvsTreeNodeObjectField(const QChar * pLocation,const QString &szIdentifier); - ~KviKvsTreeNodeObjectField(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool canEvaluateInObjectScope(); - virtual bool evaluateReadOnlyInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c,KviKvsVariant * pResult); - virtual KviKvsRWEvaluationResult * evaluateReadWriteInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c); -}; - -#endif //!_KVI_KVS_TREENODE_OBJECTFIELD_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_objectfunctioncall.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_objectfunctioncall.cpp deleted file mode 100644 index d2fbf3ae2b..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_objectfunctioncall.cpp +++ /dev/null @@ -1,60 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_objectfunctioncall.cpp -// Created on Tue 07 Oct 2003 03:26:07 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_objectfunctioncall.h" - -KviKvsTreeNodeObjectFunctionCall::KviKvsTreeNodeObjectFunctionCall(const QChar * pLocation,const QString &szFncName,KviKvsTreeNodeDataList * pParams) -: KviKvsTreeNodeFunctionCall(pLocation,szFncName,pParams) -{ -} - -KviKvsTreeNodeObjectFunctionCall::~KviKvsTreeNodeObjectFunctionCall() -{ -} - -void KviKvsTreeNodeObjectFunctionCall::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Object Function Call \""; - szBuffer += m_szFunctionName; - szBuffer += "\""; -#endif -} - -void KviKvsTreeNodeObjectFunctionCall::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s ObjectFunctionCall(%s)",prefix,m_szFunctionName.utf8().data()); - QString tmp = prefix; - tmp.append(" "); - m_pParams->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeObjectFunctionCall::canEvaluateInObjectScope() -{ - return true; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_objectfunctioncall.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_objectfunctioncall.h deleted file mode 100644 index 35aa54e0c1..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_objectfunctioncall.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_OBJECTFUNCTIONCALL_H_ -#define _KVI_KVS_TREENODE_OBJECTFUNCTIONCALL_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_objectfunctioncall.h -// Created on Tue 07 Oct 2003 03:26:07 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_datalist.h" -#include "kvi_kvs_treenode_functioncall.h" - - -class KVIRC_API KviKvsTreeNodeObjectFunctionCall : public KviKvsTreeNodeFunctionCall -{ -public: - KviKvsTreeNodeObjectFunctionCall(const QChar * pLocation,const QString &szFncName,KviKvsTreeNodeDataList * pParams); - ~KviKvsTreeNodeObjectFunctionCall(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool canEvaluateInObjectScope(); -}; - - -#endif //!_KVI_KVS_TREENODE_OBJECTFUNCTIONCALL_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_operation.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_operation.cpp deleted file mode 100644 index a3268ce8e5..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_operation.cpp +++ /dev/null @@ -1,1497 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_operation.cpp -// Created on Thu 18 Dec 2003 22:36:00 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_operation.h" -#include "kvi_kvs_treenode_data.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_locale.h" - -#include <qregexp.h> - -#include <math.h> - - -KviKvsTreeNodeOperation::KviKvsTreeNodeOperation(const QChar * pLocation) -: KviKvsTreeNodeInstruction(pLocation) -{ - //m_pTargetData = 0; no need to set it -} - -KviKvsTreeNodeOperation::~KviKvsTreeNodeOperation() -{ - delete m_pTargetData; -} - -void KviKvsTreeNodeOperation::setTargetVariableReference(KviKvsTreeNodeData * r) -{ - m_pTargetData = r; - m_pTargetData->setParent(this); -} - -void KviKvsTreeNodeOperation::contextDescription(QString &szBuffer) -{ - szBuffer = "Operation"; -} - -void KviKvsTreeNodeOperation::dump(const char * prefix) -{ - debug("%s Operation",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); -} - - - - - -KviKvsTreeNodeOperationAssignment::KviKvsTreeNodeOperationAssignment(const QChar * pLocation,KviKvsTreeNodeData * pRightSide) -: KviKvsTreeNodeOperation(pLocation) -{ - m_pRightSide = pRightSide; - m_pRightSide->setParent(this); -} - -KviKvsTreeNodeOperationAssignment::~KviKvsTreeNodeOperationAssignment() -{ - delete m_pRightSide; -} - -void KviKvsTreeNodeOperationAssignment::contextDescription(QString &szBuffer) -{ - szBuffer = "Assignment"; -} - - -void KviKvsTreeNodeOperationAssignment::dump(const char * prefix) -{ - debug("%s OperationAssignment",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); - m_pRightSide->dump(tmp.utf8().data()); -} - -bool KviKvsTreeNodeOperationAssignment::execute(KviKvsRunTimeContext * c) -{ - KviKvsVariant v; - if(!m_pRightSide->evaluateReadOnly(c,&v))return false; - - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - target->result()->takeFrom(v); - delete target; - return true; -} - - - - - - -KviKvsTreeNodeOperationDecrement::KviKvsTreeNodeOperationDecrement(const QChar * pLocation) -: KviKvsTreeNodeOperation(pLocation) -{ -} - -KviKvsTreeNodeOperationDecrement::~KviKvsTreeNodeOperationDecrement() -{ -} - -void KviKvsTreeNodeOperationDecrement::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Operator \"--\""; -#endif -} - - -void KviKvsTreeNodeOperationDecrement::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s OperationDecrement",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeOperationDecrement::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsRWEvaluationResult * v = m_pTargetData->evaluateReadWrite(c); - if(!v)return false; - - kvs_int_t iVal; - if(v->result()->asInteger(iVal)) - { - v->result()->setInteger(iVal - 1); - delete v; - v = 0; - return true; - } - - kvs_real_t dVal; - if(v->result()->asReal(dVal)) - { - v->result()->setReal(dVal - 1.0); - delete v; - v = 0; - return true; - } - - c->error(this,__tr2qs("The target variable didn't evaluate to an integer or real value")); - delete v; -#endif - return false; -} - - - - - - - -KviKvsTreeNodeOperationIncrement::KviKvsTreeNodeOperationIncrement(const QChar * pLocation) -: KviKvsTreeNodeOperation(pLocation) -{ -} - -KviKvsTreeNodeOperationIncrement::~KviKvsTreeNodeOperationIncrement() -{ -} - -void KviKvsTreeNodeOperationIncrement::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Operator \"++\""; -#endif -} - - -void KviKvsTreeNodeOperationIncrement::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s OperationIncrement",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeOperationIncrement::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsRWEvaluationResult * v = m_pTargetData->evaluateReadWrite(c); - if(!v)return false; - - kvs_int_t iVal; - if(v->result()->asInteger(iVal)) - { - v->result()->setInteger(iVal + 1); - delete v; - v = 0; - return true; - } - - kvs_real_t dVal; - if(v->result()->asReal(dVal)) - { - v->result()->setReal(dVal + 1.0); - delete v; - v = 0; - return true; - } - c->error(this,__tr2qs("The target variable didn't evaluate to an integer or real value")); - delete v; -#endif - return false; -} - - - - -KviKvsTreeNodeOperationSelfAnd::KviKvsTreeNodeOperationSelfAnd(const QChar * pLocation,KviKvsTreeNodeData * pRightSide) -: KviKvsTreeNodeOperation(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pRightSide = pRightSide; - m_pRightSide->setParent(this); -#endif -} - -KviKvsTreeNodeOperationSelfAnd::~KviKvsTreeNodeOperationSelfAnd() -{ -#ifdef COMPILE_NEW_KVS - delete m_pRightSide; -#endif -} - -void KviKvsTreeNodeOperationSelfAnd::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Operator \"&=\""; -#endif -} - - -void KviKvsTreeNodeOperationSelfAnd::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s OperationSelfAnd",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); - m_pRightSide->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeOperationSelfAnd::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant v; - if(!m_pRightSide->evaluateReadOnly(c,&v))return false; - - kvs_int_t iRVal; - - if(!v.asInteger(iRVal)) - { - c->error(this,__tr2qs("The right side of operator '&=' didn't evaluate to an integer")); - return false; - } - - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - kvs_int_t iLVal; - - if(!target->result()->asInteger(iLVal)) - { - c->error(this,__tr2qs("The left side of operator '&=' didn't evaluate to an integer")); - delete target; - target = 0; - return false; - } - - target->result()->setInteger(iLVal & iRVal); - delete target; -#endif - return true; -} - - - -KviKvsTreeNodeOperationSelfDivision::KviKvsTreeNodeOperationSelfDivision(const QChar * pLocation,KviKvsTreeNodeData * pRightSide) -: KviKvsTreeNodeOperation(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pRightSide = pRightSide; - m_pRightSide->setParent(this); -#endif -} - -KviKvsTreeNodeOperationSelfDivision::~KviKvsTreeNodeOperationSelfDivision() -{ -#ifdef COMPILE_NEW_KVS - delete m_pRightSide; -#endif -} - -void KviKvsTreeNodeOperationSelfDivision::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Operator \"/=\""; -#endif -} - - -void KviKvsTreeNodeOperationSelfDivision::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s OperationSelfDivision",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); - m_pRightSide->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeOperationSelfDivision::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant v; - if(!m_pRightSide->evaluateReadOnly(c,&v))return false; - - KviKvsNumber rnum; - - if(!v.asNumber(rnum)) - { - c->error(this,__tr2qs("The right side of operator '/=' didn't evaluate to a number")); - return false; - } - - KviKvsNumber lnum; - - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - if(!target->result()->asNumber(lnum)) - { - c->error(this,__tr2qs("The left side of operator '/=' didn't evaluate to a number")); - delete target; - target = 0; - return false; - } - - if(rnum.isInteger()) - { - if(rnum.integer() == 0) - { - c->error(this,__tr2qs("Division by zero")); - delete target; - target = 0; - return false; - } - if(lnum.isInteger()) - target->result()->setInteger(lnum.integer() / rnum.integer()); - else - target->result()->setReal(lnum.real() / (kvs_real_t)(rnum.integer())); - } else { - if(rnum.real() == 0.0) - { - c->error(this,__tr2qs("Division by zero")); - delete target; - target = 0; - return false; - } - if(lnum.isInteger()) - target->result()->setReal(((kvs_real_t)(lnum.integer())) / rnum.real()); - else - target->result()->setReal(lnum.real() / rnum.real()); - } - - delete target; -#endif - return true; -} - -KviKvsTreeNodeOperationSelfModulus::KviKvsTreeNodeOperationSelfModulus(const QChar * pLocation,KviKvsTreeNodeData * pRightSide) -: KviKvsTreeNodeOperation(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pRightSide = pRightSide; - m_pRightSide->setParent(this); -#endif -} - -KviKvsTreeNodeOperationSelfModulus::~KviKvsTreeNodeOperationSelfModulus() -{ -#ifdef COMPILE_NEW_KVS - delete m_pRightSide; -#endif -} - -void KviKvsTreeNodeOperationSelfModulus::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Operator \"Self Modulo\""; -#endif -} - - -void KviKvsTreeNodeOperationSelfModulus::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s OperationSelfModulus",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); - m_pRightSide->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeOperationSelfModulus::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant v; - if(!m_pRightSide->evaluateReadOnly(c,&v))return false; - KviKvsNumber rnum; - - if(!v.asNumber(rnum)) - { - c->error(this,__tr2qs("The right side of operator '%=' didn't evaluate to a number")); - return false; - } - - KviKvsNumber lnum; - - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - if(!target->result()->asNumber(lnum)) - { - c->error(this,__tr2qs("The left side of operator '%=' didn't evaluate to a number")); - delete target; - target = 0; - return false; - } - - if(rnum.isInteger()) - { - if(rnum.integer() == 0) - { - c->error(this,__tr2qs("Division by zero")); - delete target; - target = 0; - return false; - } - if(lnum.isInteger()) - target->result()->setInteger(lnum.integer() % rnum.integer()); - else - target->result()->setReal(fmod(lnum.real(),(kvs_real_t)(rnum.integer()))); - } else { - if(rnum.real() == 0.0) - { - c->error(this,__tr2qs("Division by zero")); - delete target; - target = 0; - return false; - } - if(lnum.isInteger()) - target->result()->setReal(fmod(((kvs_real_t)(lnum.integer())),rnum.real())); - else - target->result()->setReal(fmod(lnum.real(),rnum.real())); - } -#endif - return true; -} - - - - - -KviKvsTreeNodeOperationSelfMultiplication::KviKvsTreeNodeOperationSelfMultiplication(const QChar * pLocation,KviKvsTreeNodeData * pRightSide) -: KviKvsTreeNodeOperation(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pRightSide = pRightSide; - m_pRightSide->setParent(this); -#endif -} - -KviKvsTreeNodeOperationSelfMultiplication::~KviKvsTreeNodeOperationSelfMultiplication() -{ -#ifdef COMPILE_NEW_KVS - delete m_pRightSide; -#endif -} - -void KviKvsTreeNodeOperationSelfMultiplication::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Operator \"*=\""; -#endif -} - - -void KviKvsTreeNodeOperationSelfMultiplication::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s OperationSelfMultiplication",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); - m_pRightSide->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeOperationSelfMultiplication::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant v; - if(!m_pRightSide->evaluateReadOnly(c,&v))return false; - KviKvsNumber rnum; - - if(!v.asNumber(rnum)) - { - c->error(this,__tr2qs("The right side of operator '*=' didn't evaluate to a number")); - return false; - } - - KviKvsNumber lnum; - - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - if(!target->result()->asNumber(lnum)) - { - c->error(this,__tr2qs("The left side of operator '*=' didn't evaluate to a number")); - delete target; - return false; - } - - if(rnum.isInteger()) - { - if(lnum.isInteger()) - target->result()->setInteger(lnum.integer() * rnum.integer()); - else - target->result()->setReal(lnum.real() * (kvs_real_t)(rnum.integer())); - } else { - if(lnum.isInteger()) - target->result()->setReal(((kvs_real_t)(lnum.integer())) * rnum.real()); - else - target->result()->setReal(lnum.real() * rnum.real()); - } -#endif - return true; -} - - - - -KviKvsTreeNodeOperationSelfOr::KviKvsTreeNodeOperationSelfOr(const QChar * pLocation,KviKvsTreeNodeData * pRightSide) -: KviKvsTreeNodeOperation(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pRightSide = pRightSide; - m_pRightSide->setParent(this); -#endif -} - -KviKvsTreeNodeOperationSelfOr::~KviKvsTreeNodeOperationSelfOr() -{ -#ifdef COMPILE_NEW_KVS - delete m_pRightSide; -#endif -} - -void KviKvsTreeNodeOperationSelfOr::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Operator \"|=\""; -#endif -} - - -void KviKvsTreeNodeOperationSelfOr::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s OperationSelfOr",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); - m_pRightSide->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeOperationSelfOr::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant v; - if(!m_pRightSide->evaluateReadOnly(c,&v))return false; - - kvs_int_t iRVal; - if(!v.asInteger(iRVal)) - { - c->error(this,__tr2qs("The right side of operator '|=' didn't evaluate to an integer")); - return false; - } - - kvs_int_t iLVal; - - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - if(!target->result()->asInteger(iLVal)) - { - c->error(this,__tr2qs("The left side of operator '|=' didn't evaluate to an integer")); - delete target; - target = 0; - return false; - } - - target->result()->setInteger(iLVal | iRVal); - delete target; -#endif - return true; -} - - - - -KviKvsTreeNodeOperationSelfShl::KviKvsTreeNodeOperationSelfShl(const QChar * pLocation,KviKvsTreeNodeData * pRightSide) -: KviKvsTreeNodeOperation(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pRightSide = pRightSide; - m_pRightSide->setParent(this); -#endif -} - -KviKvsTreeNodeOperationSelfShl::~KviKvsTreeNodeOperationSelfShl() -{ -#ifdef COMPILE_NEW_KVS - delete m_pRightSide; -#endif -} - -void KviKvsTreeNodeOperationSelfShl::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Operator \"<<=\""; -#endif -} - - -void KviKvsTreeNodeOperationSelfShl::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s OperationSelfShl",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); - m_pRightSide->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeOperationSelfShl::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant v; - if(!m_pRightSide->evaluateReadOnly(c,&v))return false; - - kvs_int_t iRVal; - - if(!v.asInteger(iRVal)) - { - c->error(this,__tr2qs("The right side of operator '<<=' didn't evaluate to an integer")); - return false; - } - - kvs_int_t iLVal; - - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - if(!target->result()->asInteger(iLVal)) - { - c->error(this,__tr2qs("The left side of operator '<<=' didn't evaluate to an integer")); - delete target; - target = 0; - return false; - } - - target->result()->setInteger(iLVal << iRVal); - delete target; -#endif - return true; -} - - - - - -KviKvsTreeNodeOperationSelfShr::KviKvsTreeNodeOperationSelfShr(const QChar * pLocation,KviKvsTreeNodeData * pRightSide) -: KviKvsTreeNodeOperation(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pRightSide = pRightSide; - m_pRightSide->setParent(this); -#endif -} - -KviKvsTreeNodeOperationSelfShr::~KviKvsTreeNodeOperationSelfShr() -{ -#ifdef COMPILE_NEW_KVS - delete m_pRightSide; -#endif -} - -void KviKvsTreeNodeOperationSelfShr::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Operator \">>=\""; -#endif -} - - -void KviKvsTreeNodeOperationSelfShr::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s OperationSelfShr",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); - m_pRightSide->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeOperationSelfShr::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant v; - if(!m_pRightSide->evaluateReadOnly(c,&v))return false; - - kvs_int_t iRVal; - - if(!v.asInteger(iRVal)) - { - c->error(this,__tr2qs("The right side of operator '>>=' didn't evaluate to an integer")); - return false; - } - - kvs_int_t iLVal; - - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - if(!target->result()->asInteger(iLVal)) - { - c->error(this,__tr2qs("The left side of operator '>>=' didn't evaluate to an integer")); - delete target; - target = 0; - return false; - } - - target->result()->setInteger(iLVal >> iRVal); - delete target; -#endif - return true; -} - - - - - - - - - - - -KviKvsTreeNodeOperationSelfSubtraction::KviKvsTreeNodeOperationSelfSubtraction(const QChar * pLocation,KviKvsTreeNodeData * pRightSide) -: KviKvsTreeNodeOperation(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pRightSide = pRightSide; - m_pRightSide->setParent(this); -#endif -} - -KviKvsTreeNodeOperationSelfSubtraction::~KviKvsTreeNodeOperationSelfSubtraction() -{ -#ifdef COMPILE_NEW_KVS - delete m_pRightSide; -#endif -} - -void KviKvsTreeNodeOperationSelfSubtraction::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Operator \"-=\""; -#endif -} - - -void KviKvsTreeNodeOperationSelfSubtraction::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s OperationSelfSubtraction",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); - m_pRightSide->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeOperationSelfSubtraction::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant v; - if(!m_pRightSide->evaluateReadOnly(c,&v))return false; - KviKvsNumber rnum; - - if(!v.asNumber(rnum)) - { - c->error(this,__tr2qs("The right side of operator '-=' didn't evaluate to a number")); - return false; - } - - KviKvsNumber lnum; - - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - if(!target->result()->asNumber(lnum)) - { - c->error(this,__tr2qs("The left side of operator '-=' didn't evaluate to a number")); - delete target; - target = 0; - return false; - } - - if(rnum.isInteger()) - { - if(lnum.isInteger()) - target->result()->setInteger(lnum.integer() - rnum.integer()); - else - target->result()->setReal(lnum.real() - (kvs_real_t)(rnum.integer())); - } else { - if(lnum.isInteger()) - target->result()->setReal(((kvs_real_t)(lnum.integer())) - rnum.real()); - else - target->result()->setReal(lnum.real() - rnum.real()); - } - - delete target; -#endif - return true; -} - - - - - -KviKvsTreeNodeOperationSelfSum::KviKvsTreeNodeOperationSelfSum(const QChar * pLocation,KviKvsTreeNodeData * pRightSide) -: KviKvsTreeNodeOperation(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pRightSide = pRightSide; - m_pRightSide->setParent(this); -#endif -} - -KviKvsTreeNodeOperationSelfSum::~KviKvsTreeNodeOperationSelfSum() -{ -#ifdef COMPILE_NEW_KVS - delete m_pRightSide; -#endif -} - -void KviKvsTreeNodeOperationSelfSum::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Operator \"+=\""; -#endif -} - - -void KviKvsTreeNodeOperationSelfSum::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s OperationSelfSum",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); - m_pRightSide->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeOperationSelfSum::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant v; - if(!m_pRightSide->evaluateReadOnly(c,&v))return false; - KviKvsNumber rnum; - - if(!v.asNumber(rnum)) - { - c->error(this,__tr2qs("The right side of operator '+=' didn't evaluate to a number")); - return false; - } - - KviKvsNumber lnum; - - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - if(!target->result()->asNumber(lnum)) - { - c->error(this,__tr2qs("The left side of operator '+=' didn't evaluate to a number")); - delete target; - target = 0; - return false; - } - - if(rnum.isInteger()) - { - if(lnum.isInteger()) - target->result()->setInteger(lnum.integer() + rnum.integer()); - else - target->result()->setReal(lnum.real() + (kvs_real_t)(rnum.integer())); - } else { - if(lnum.isInteger()) - target->result()->setReal(((kvs_real_t)(lnum.integer())) + rnum.real()); - else - target->result()->setReal(lnum.real() + rnum.real()); - } - - delete target; -#endif - return true; -} - - - - - - - -KviKvsTreeNodeOperationSelfXor::KviKvsTreeNodeOperationSelfXor(const QChar * pLocation,KviKvsTreeNodeData * pRightSide) -: KviKvsTreeNodeOperation(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pRightSide = pRightSide; - m_pRightSide->setParent(this); -#endif -} - -KviKvsTreeNodeOperationSelfXor::~KviKvsTreeNodeOperationSelfXor() -{ -#ifdef COMPILE_NEW_KVS - delete m_pRightSide; -#endif -} - -void KviKvsTreeNodeOperationSelfXor::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Operator \"^=\""; -#endif -} - - -void KviKvsTreeNodeOperationSelfXor::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s OperationSelfXor",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); - m_pRightSide->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeOperationSelfXor::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant v; - if(!m_pRightSide->evaluateReadOnly(c,&v))return false; - - kvs_int_t iRVal; - - if(!v.asInteger(iRVal)) - { - c->error(this,__tr2qs("The right side of operator '^=' didn't evaluate to an integer")); - return false; - } - - kvs_int_t iLVal; - - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - if(!target->result()->asInteger(iLVal)) - { - c->error(this,__tr2qs("The left side of operator '^=' didn't evaluate to an integer")); - delete target; - target = 0; - return false; - } - - target->result()->setInteger(iLVal ^ iRVal); - delete target; -#endif - return true; -} - - - - - - - -KviKvsTreeNodeOperationStringAppend::KviKvsTreeNodeOperationStringAppend(const QChar * pLocation,KviKvsTreeNodeData * pRightSide) -: KviKvsTreeNodeOperation(pLocation) -{ - m_pRightSide = pRightSide; - m_pRightSide->setParent(this); -} - -KviKvsTreeNodeOperationStringAppend::~KviKvsTreeNodeOperationStringAppend() -{ - delete m_pRightSide; -} - -void KviKvsTreeNodeOperationStringAppend::contextDescription(QString &szBuffer) -{ - szBuffer = "Operator \"<<\""; -} - - -void KviKvsTreeNodeOperationStringAppend::dump(const char * prefix) -{ - debug("%s OperationStringAppend",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); - m_pRightSide->dump(tmp.utf8().data()); -} - -bool KviKvsTreeNodeOperationStringAppend::execute(KviKvsRunTimeContext * c) -{ - KviKvsVariant v; - if(!m_pRightSide->evaluateReadOnly(c,&v))return false; - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - QString sz1; - target->result()->asString(sz1); - v.appendAsString(sz1); - target->result()->setString(sz1); - delete target; - return true; -} - - - - - - -KviKvsTreeNodeOperationArrayAppend::KviKvsTreeNodeOperationArrayAppend(const QChar * pLocation,KviKvsTreeNodeData * pRightSide) -: KviKvsTreeNodeOperation(pLocation) -{ - m_pRightSide = pRightSide; - m_pRightSide->setParent(this); -} - -KviKvsTreeNodeOperationArrayAppend::~KviKvsTreeNodeOperationArrayAppend() -{ - delete m_pRightSide; -} - -void KviKvsTreeNodeOperationArrayAppend::contextDescription(QString &szBuffer) -{ - szBuffer = "Operator \"<+\""; -} - - -void KviKvsTreeNodeOperationArrayAppend::dump(const char * prefix) -{ - debug("%s OperationArrayAppend",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); - m_pRightSide->dump(tmp.utf8().data()); -} - -bool KviKvsTreeNodeOperationArrayAppend::execute(KviKvsRunTimeContext * c) -{ - KviKvsVariant v; - if(!m_pRightSide->evaluateReadOnly(c,&v))return false; - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - target->result()->convertToArray(); - KviKvsArray * a = target->result()->array(); - - switch(v.type()) - { - case KviKvsVariantData::Nothing: - // do nothing - break; - case KviKvsVariantData::Array: - { - KviKvsArray * s = v.array(); - unsigned int uIdx = 0; - unsigned int uSize = s->size(); - while(uIdx < uSize) - { - KviKvsVariant * pInternal = s->at(uIdx); - if(pInternal) - a->set(a->size(),new KviKvsVariant(*pInternal)); - // else - // leave an empty entry - uIdx++; - } - } - break; - case KviKvsVariantData::Hash: - { - KviKvsHashIterator it(*(v.hash()->dict())); - while(KviKvsVariant * pInternal = it.current()) - { - a->set(a->size(),new KviKvsVariant(*pInternal)); - ++it; - } - } - break; - default: - a->set(a->size(),new KviKvsVariant(v)); - break; - } - delete target; - - return true; -} - - - - - - - -KviKvsTreeNodeOperationStringAppendWithComma::KviKvsTreeNodeOperationStringAppendWithComma(const QChar * pLocation,KviKvsTreeNodeData * pRightSide) -: KviKvsTreeNodeOperation(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pRightSide = pRightSide; - m_pRightSide->setParent(this); -#endif -} - -KviKvsTreeNodeOperationStringAppendWithComma::~KviKvsTreeNodeOperationStringAppendWithComma() -{ -#ifdef COMPILE_NEW_KVS - delete m_pRightSide; -#endif -} - -void KviKvsTreeNodeOperationStringAppendWithComma::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Operator \"<,\""; -#endif -} - - -void KviKvsTreeNodeOperationStringAppendWithComma::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s OperationStringAppendWithComma",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); - m_pRightSide->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeOperationStringAppendWithComma::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant v; - if(!m_pRightSide->evaluateReadOnly(c,&v))return false; - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - QString sz1; - target->result()->asString(sz1); - if(sz1.isEmpty()) - { - v.asString(sz1); - } else { - QString sz2; - v.asString(sz2); - sz1 += QChar(','); - sz1 += sz2; - } - target->result()->setString(sz1); - delete target; -#endif - return true; -} - - - - - - -KviKvsTreeNodeOperationStringAppendWithSpace::KviKvsTreeNodeOperationStringAppendWithSpace(const QChar * pLocation,KviKvsTreeNodeData * pRightSide) -: KviKvsTreeNodeOperation(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pRightSide = pRightSide; - m_pRightSide->setParent(this); -#endif -} - -KviKvsTreeNodeOperationStringAppendWithSpace::~KviKvsTreeNodeOperationStringAppendWithSpace() -{ -#ifdef COMPILE_NEW_KVS - delete m_pRightSide; -#endif -} - -void KviKvsTreeNodeOperationStringAppendWithSpace::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Operator \"<+\""; -#endif -} - - -void KviKvsTreeNodeOperationStringAppendWithSpace::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s OperationStringAppendWithSpace",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pTargetData->dump(tmp.utf8().data()); - m_pRightSide->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeOperationStringAppendWithSpace::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant v; - if(!m_pRightSide->evaluateReadOnly(c,&v))return false; - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - QString sz1; - target->result()->asString(sz1); - if(sz1.isEmpty()) - { - v.asString(sz1); - } else { - QString sz2; - v.asString(sz2); - sz1 += QChar(' '); - sz1 += sz2; - } - target->result()->setString(sz1); - delete target; -#endif - return true; -} - - - - - - - - - -KviKvsTreeNodeOperationStringTransliteration::KviKvsTreeNodeOperationStringTransliteration(const QChar * pLocation,KviKvsTreeNodeData * pLeft,KviKvsTreeNodeData * pRight,KviKvsTreeNodeData * pFlags) -: KviKvsTreeNodeOperation(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pLeft = pLeft; - m_pLeft->setParent(this); - m_pRight = pRight; - m_pRight->setParent(this); - m_pFlags = pFlags; - m_pFlags->setParent(this); -#endif -} - -KviKvsTreeNodeOperationStringTransliteration::~KviKvsTreeNodeOperationStringTransliteration() -{ -#ifdef COMPILE_NEW_KVS - delete m_pLeft; - delete m_pRight; - delete m_pFlags; -#endif -} - - -void KviKvsTreeNodeOperationStringTransliteration::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Binding Operator tr///"; -#endif -} - - -void KviKvsTreeNodeOperationStringTransliteration::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s OperationStringTransliteration",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pLeft->dump(tmp.utf8().data()); - m_pRight->dump(tmp.utf8().data()); - m_pFlags->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeOperationStringTransliteration::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant vl; - if(!m_pLeft->evaluateReadOnly(c,&vl))return false; - KviKvsVariant vr; - if(!m_pRight->evaluateReadOnly(c,&vr))return false; - - // for now we don't use the flags at all here... - //KviKvsVariant vf; - //if(!m_pFlags->evaluateReadOnly(c,&vf))return false; - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - QString szL,szR,szF; - - vl.asString(szL); - vr.asString(szR); - //vf.asString(szF); - - QString sz1; - target->result()->asString(sz1); - KviQString::transliterate(sz1,szL,szR); - target->result()->setString(sz1); - delete target; -#endif - return true; -} - - - - - - - - - - -KviKvsTreeNodeOperationStringSubstitution::KviKvsTreeNodeOperationStringSubstitution(const QChar * pLocation,KviKvsTreeNodeData * pLeft,KviKvsTreeNodeData * pRight,KviKvsTreeNodeData * pFlags) -: KviKvsTreeNodeOperation(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pLeft = pLeft; - m_pLeft->setParent(this); - m_pRight = pRight; - m_pRight->setParent(this); - m_pFlags = pFlags; - m_pFlags->setParent(this); -#endif -} - -KviKvsTreeNodeOperationStringSubstitution::~KviKvsTreeNodeOperationStringSubstitution() -{ -#ifdef COMPILE_NEW_KVS - delete m_pLeft; - delete m_pRight; - delete m_pFlags; -#endif -} - - -void KviKvsTreeNodeOperationStringSubstitution::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Binding Operator s///"; -#endif -} - - -void KviKvsTreeNodeOperationStringSubstitution::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s OperationStringSubstitution",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pLeft->dump(tmp.utf8().data()); - m_pRight->dump(tmp.utf8().data()); - m_pFlags->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeOperationStringSubstitution::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant vl; - if(!m_pLeft->evaluateReadOnly(c,&vl))return false; - KviKvsVariant vr; - if(!m_pRight->evaluateReadOnly(c,&vr))return false; - KviKvsVariant vf; - if(!m_pFlags->evaluateReadOnly(c,&vf))return false; - KviKvsRWEvaluationResult * target = m_pTargetData->evaluateReadWrite(c); - if(!target)return false; - - QString szL,szR,szF; - - vl.asString(szL); - vr.asString(szR); - vf.asString(szF); - - QString str; - target->result()->asString(str); - - bool bGlobal = szF.find('g',false) != -1; - - QRegExp re(szL,szF.find('i',false) == -1,szF.find('w',false) != -1); - re.setMinimal(szF.find('m',false) != -1); // greedy or minimal ? - - int idx = 0; - - while((!str.isEmpty()) && (idx != -1)) - { - int len; - idx = re.search(str,idx); - if(idx != -1) - { - len = re.matchedLength(); - if(len == 0) - { - c->warning(this,__tr2qs("The regular expression matched a zero-length substring: this is not valid in the s/// operator, skipping")); - goto end_of_this_stuff; - } - str.remove(idx,len); - - QString szReplaced; - const QChar * p2 = KviQString::nullTerminatedArray(szR); - const QChar * begin = p2; - while(p2->unicode()) - { - if(p2->unicode() == '\\') - { - p2++; - if(p2->unicode() >= '0' && p2->unicode() <= '9') - { - szReplaced.append(QString(begin,(p2 - begin) - 1)); - szReplaced.append(re.cap(p2->unicode() - '0')); - p2++; - begin = p2; - } else if(p2->unicode())p2++; - } else p2++; - } - if(begin != p2)szReplaced.append(QString(begin,p2 - begin)); - str.insert(idx,szReplaced); - idx += szReplaced.length(); - - if(!bGlobal)goto end_of_this_stuff; - } - } -end_of_this_stuff: - target->result()->setString(str); - delete target; -#endif - return true; -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_operation.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_operation.h deleted file mode 100644 index e7da2d548c..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_operation.h +++ /dev/null @@ -1,296 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_OPERATION_H_ -#define _KVI_KVS_TREENODE_OPERATION_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_operation.h -// Created on Thu 18 Dec 2003 22:36:00 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_instruction.h" - -class KviKvsTreeNodeData; -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeOperation : public KviKvsTreeNodeInstruction -{ -public: - KviKvsTreeNodeOperation(const QChar * pLocation); - ~KviKvsTreeNodeOperation(); -protected: - KviKvsTreeNodeData * m_pTargetData; // can't be null -public: - void setTargetVariableReference(KviKvsTreeNodeData * r); - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); -}; - -class KviKvsTreeNodeOperationAssignment : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationAssignment(const QChar * pLocation,KviKvsTreeNodeData * pRightSide); - ~KviKvsTreeNodeOperationAssignment(); -protected: - KviKvsTreeNodeData * m_pRightSide; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationDecrement : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationDecrement(const QChar * pLocation); - ~KviKvsTreeNodeOperationDecrement(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationIncrement : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationIncrement(const QChar * pLocation); - ~KviKvsTreeNodeOperationIncrement(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationSelfAnd : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationSelfAnd(const QChar * pLocation,KviKvsTreeNodeData * pRightSide); - ~KviKvsTreeNodeOperationSelfAnd(); -protected: - KviKvsTreeNodeData * m_pRightSide; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationSelfDivision : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationSelfDivision(const QChar * pLocation,KviKvsTreeNodeData * pRightSide); - ~KviKvsTreeNodeOperationSelfDivision(); -protected: - KviKvsTreeNodeData * m_pRightSide; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationSelfModulus : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationSelfModulus(const QChar * pLocation,KviKvsTreeNodeData * pRightSide); - ~KviKvsTreeNodeOperationSelfModulus(); -protected: - KviKvsTreeNodeData * m_pRightSide; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationSelfMultiplication : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationSelfMultiplication(const QChar * pLocation,KviKvsTreeNodeData * pRightSide); - ~KviKvsTreeNodeOperationSelfMultiplication(); -protected: - KviKvsTreeNodeData * m_pRightSide; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationSelfOr : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationSelfOr(const QChar * pLocation,KviKvsTreeNodeData * pRightSide); - ~KviKvsTreeNodeOperationSelfOr(); -protected: - KviKvsTreeNodeData * m_pRightSide; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationSelfShl : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationSelfShl(const QChar * pLocation,KviKvsTreeNodeData * pRightSide); - ~KviKvsTreeNodeOperationSelfShl(); -protected: - KviKvsTreeNodeData * m_pRightSide; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationSelfShr : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationSelfShr(const QChar * pLocation,KviKvsTreeNodeData * pRightSide); - ~KviKvsTreeNodeOperationSelfShr(); -protected: - KviKvsTreeNodeData * m_pRightSide; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationSelfSubtraction : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationSelfSubtraction(const QChar * pLocation,KviKvsTreeNodeData * pRightSide); - ~KviKvsTreeNodeOperationSelfSubtraction(); -protected: - KviKvsTreeNodeData * m_pRightSide; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationSelfSum : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationSelfSum(const QChar * pLocation,KviKvsTreeNodeData * pRightSide); - ~KviKvsTreeNodeOperationSelfSum(); -protected: - KviKvsTreeNodeData * m_pRightSide; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationSelfXor : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationSelfXor(const QChar * pLocation,KviKvsTreeNodeData * pRightSide); - ~KviKvsTreeNodeOperationSelfXor(); -protected: - KviKvsTreeNodeData * m_pRightSide; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationStringAppend : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationStringAppend(const QChar * pLocation,KviKvsTreeNodeData * pRightSide); - ~KviKvsTreeNodeOperationStringAppend(); -protected: - KviKvsTreeNodeData * m_pRightSide; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationArrayAppend : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationArrayAppend(const QChar * pLocation,KviKvsTreeNodeData * pRightSide); - ~KviKvsTreeNodeOperationArrayAppend(); -protected: - KviKvsTreeNodeData * m_pRightSide; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationStringAppendWithComma : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationStringAppendWithComma(const QChar * pLocation,KviKvsTreeNodeData * pRightSide); - ~KviKvsTreeNodeOperationStringAppendWithComma(); -protected: - KviKvsTreeNodeData * m_pRightSide; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationStringAppendWithSpace : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationStringAppendWithSpace(const QChar * pLocation,KviKvsTreeNodeData * pRightSide); - ~KviKvsTreeNodeOperationStringAppendWithSpace(); -protected: - KviKvsTreeNodeData * m_pRightSide; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationStringTransliteration : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationStringTransliteration(const QChar * pLocation,KviKvsTreeNodeData * pLeft,KviKvsTreeNodeData * pRight,KviKvsTreeNodeData * pFlags); - ~KviKvsTreeNodeOperationStringTransliteration(); -protected: - KviKvsTreeNodeData * m_pLeft; // can't be 0 - KviKvsTreeNodeData * m_pRight; // can't be 0 - KviKvsTreeNodeData * m_pFlags; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -class KviKvsTreeNodeOperationStringSubstitution : public KviKvsTreeNodeOperation -{ -public: - KviKvsTreeNodeOperationStringSubstitution(const QChar * pLocation,KviKvsTreeNodeData * pLeft,KviKvsTreeNodeData * pRight,KviKvsTreeNodeData * pFlags); - ~KviKvsTreeNodeOperationStringSubstitution(); -protected: - KviKvsTreeNodeData * m_pLeft; // can't be 0 - KviKvsTreeNodeData * m_pRight; // can't be 0 - KviKvsTreeNodeData * m_pFlags; // can't be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - - -#endif //!_KVI_KVS_TREENODE_OPERATION_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_parameterreturn.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_parameterreturn.cpp deleted file mode 100644 index c6267d0ebe..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_parameterreturn.cpp +++ /dev/null @@ -1,88 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_parameterreturn.cpp -// Created on Fri 30 Jan 2004 01:31:01 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_kvs_treenode_parameterreturn.h" -#include "kvi_kvs_treenode_datalist.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_locale.h" - -KviKvsTreeNodeParameterReturn::KviKvsTreeNodeParameterReturn(const QChar * pLocation,KviKvsTreeNodeDataList * pDataList) -: KviKvsTreeNodeInstruction(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pDataList = pDataList; - m_pDataList->setParent(this); -#endif -} - -KviKvsTreeNodeParameterReturn::~KviKvsTreeNodeParameterReturn() -{ -#ifdef COMPILE_NEW_KVS - delete m_pDataList; -#endif -} - -void KviKvsTreeNodeParameterReturn::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Parameter Return Evaluation"; -#endif -} - - -void KviKvsTreeNodeParameterReturn::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s ParameterReturn",prefix); - QString tmp = prefix; - tmp += " "; - m_pDataList->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeParameterReturn::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariantList lBuffer; - if(!m_pDataList->evaluate(c,&lBuffer))return false; - if(lBuffer.count() == 0) - { - c->returnValue()->setNothing(); - return true; - } - if(lBuffer.count() == 1) - { - c->returnValue()->copyFrom(*(lBuffer.first())); - return true; - } - - QString all; - lBuffer.allAsString(all); - c->returnValue()->setString(all); -#endif - return true; -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_parameterreturn.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_parameterreturn.h deleted file mode 100644 index a6804c4daa..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_parameterreturn.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_PARAMETERRETURN_H_ -#define _KVI_KVS_TREENODE_PARAMETERRETURN_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_parameterreturn.h -// Created on Fri 30 Jan 2004 01:31:01 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_treenode_instruction.h" - -class KviKvsTreeNodeDataList; - -class KVIRC_API KviKvsTreeNodeParameterReturn : public KviKvsTreeNodeInstruction -{ -public: - KviKvsTreeNodeParameterReturn(const QChar * pLocation,KviKvsTreeNodeDataList * pDataList); - ~KviKvsTreeNodeParameterReturn(); -protected: - KviKvsTreeNodeDataList * m_pDataList; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -#endif //!_KVI_KVS_TREENODE_PARAMETERRETURN_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_rebindingswitch.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_rebindingswitch.cpp deleted file mode 100644 index 4706fa0537..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_rebindingswitch.cpp +++ /dev/null @@ -1,96 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_rebindingswitch.cpp -// Created on Mon 15 Aug 2005 13:32:31 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_rebindingswitch.h" -#include "kvi_kvs_treenode_data.h" -#include "kvi_window.h" -#include "kvi_app.h" -#include "kvi_locale.h" -#include "kvi_kvs_runtimecontext.h" - -KviKvsTreeNodeRebindingSwitch::KviKvsTreeNodeRebindingSwitch(const QChar * pLocation,KviKvsTreeNodeData * pTargetWindow,KviKvsTreeNodeCommand * pChildCommand) -: KviKvsTreeNodeCommand(pLocation,pChildCommand->commandName()) -{ - m_pTargetWindow = pTargetWindow; - m_pTargetWindow->setParent(this); - m_pChildCommand = pChildCommand; - m_pChildCommand->setParent(this); -} - -KviKvsTreeNodeRebindingSwitch::~KviKvsTreeNodeRebindingSwitch() -{ - delete m_pTargetWindow; - delete m_pChildCommand; -} - - -void KviKvsTreeNodeRebindingSwitch::contextDescription(QString &szBuffer) -{ - szBuffer = "Window Rebinding Switch"; -} - -void KviKvsTreeNodeRebindingSwitch::dump(const char * prefix) -{ - debug("%sRebindingSwitch",prefix); - QString tmp = prefix; - tmp += " "; - m_pTargetWindow->dump(tmp.utf8().data()); - m_pChildCommand->dump(tmp.utf8().data()); -} - -const QString & KviKvsTreeNodeRebindingSwitch::commandName() -{ - return m_pChildCommand->commandName(); -} - -bool KviKvsTreeNodeRebindingSwitch::execute(KviKvsRunTimeContext * c) -{ - KviKvsVariant vWindow; - if(!m_pTargetWindow->evaluateReadOnly(c,&vWindow))return false; - - KviWindow * pNewWindow; - - QString szWinId; - vWindow.asString(szWinId); - if(szWinId.isEmpty()) - { - c->warning(this,__tr2qs("Empty window identifier specified in the standard rebinding switch: no rebinding performed")); - pNewWindow = 0; - } else { - pNewWindow = g_pApp->findWindow(szWinId.utf8().data()); - } - - pNewWindow = g_pApp->findWindow(szWinId.utf8().data()); - KviWindow * pOldWindow = c->window(); - if(pNewWindow) - c->setWindow(pNewWindow); - else - c->warning(this,__tr2qs("Invalid window specified in the standard rebinding switch: no rebinding performed")); - bool bRet = m_pChildCommand->execute(c); - c->setWindow(pOldWindow); - return bRet; -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_rebindingswitch.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_rebindingswitch.h deleted file mode 100644 index d36d5e3c5f..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_rebindingswitch.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_REBINDINGSWITCH_H_ -#define _KVI_KVS_TREENODE_REBINDINGSWITCH_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_rebindingswitch.h -// Created on Mon 15 Aug 2005 13:32:31 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_treenode_command.h" -#include "kvi_qstring.h" - -class KviKvsTreeNodeData; -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeRebindingSwitch : public KviKvsTreeNodeCommand -{ -public: - KviKvsTreeNodeRebindingSwitch(const QChar * pLocation,KviKvsTreeNodeData * pTargetWindow,KviKvsTreeNodeCommand * pChildCommand); - ~KviKvsTreeNodeRebindingSwitch(); -protected: - KviKvsTreeNodeData * m_pTargetWindow; - KviKvsTreeNodeCommand * m_pChildCommand; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - const QString & commandName(); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -#endif //!_KVI_KVS_TREENODE_REBINDINGSWITCH_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_scopeoperator.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_scopeoperator.cpp deleted file mode 100644 index e6f0493b2b..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_scopeoperator.cpp +++ /dev/null @@ -1,148 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_scopeoperator.cpp -// Created on Tue 07 Oct 2003 02:33:01 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_scopeoperator.h" - -#include "kvi_qstring.h" - -#include "kvi_kvs_variant.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_kernel.h" -#include "kvi_kvs_object.h" -#include "kvi_kvs_object_controller.h" - -#include "kvi_locale.h" - -KviKvsTreeNodeScopeOperator::KviKvsTreeNodeScopeOperator(const QChar * pLocation,KviKvsTreeNodeData * pObject,KviKvsTreeNodeData * pData) -: KviKvsTreeNodeData(pLocation) -{ - m_pObjectReference = pObject; - m_pObjectReference->setParent(this); - m_pRightSide = pData; - m_pRightSide->setParent(this); -} - -KviKvsTreeNodeScopeOperator::~KviKvsTreeNodeScopeOperator() -{ - delete m_pObjectReference; - delete m_pRightSide; -} - -void KviKvsTreeNodeScopeOperator::contextDescription(QString &szBuffer) -{ - szBuffer = "Scope Operator"; -} - - -void KviKvsTreeNodeScopeOperator::dump(const char * prefix) -{ - debug("%s ScopeOperator",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pObjectReference->dump(tmp.utf8().data()); - m_pRightSide->dump(tmp.utf8().data()); -} - -bool KviKvsTreeNodeScopeOperator::isReadOnly() -{ - return m_pRightSide->isReadOnly(); -} - -bool KviKvsTreeNodeScopeOperator::canEvaluateToObjectReference() -{ - return m_pRightSide->canEvaluateToObjectReference(); -} - -bool KviKvsTreeNodeScopeOperator::isFunctionCall() -{ - return m_pRightSide->isFunctionCall(); -} - -bool KviKvsTreeNodeScopeOperator::canEvaluateInObjectScope() -{ - return m_pObjectReference->canEvaluateInObjectScope(); -} - -KviKvsObject * KviKvsTreeNodeScopeOperator::objectFromVariant(KviKvsRunTimeContext * c,KviKvsVariant * v) -{ - kvs_hobject_t hObject; - if(!v->asHObject(hObject)) - { - c->error(this,__tr2qs("The left side of the scope operator didn't evaluate as an object reference")); - return 0; - } - - if(hObject == (kvs_hobject_t)0) - { - c->error(this,__tr2qs("The left side of the scope operator evaluated to a null object reference")); - return 0; - } - - KviKvsObject * o = KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if(!o) - { - c->error(this,__tr2qs("The left side of the scope operator evaluated to an invalid object reference (object doesn't exist)")); - return 0; - } - return o; -} - -bool KviKvsTreeNodeScopeOperator::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - KviKvsVariant ret; - if(!m_pObjectReference->evaluateReadOnly(c,&ret))return false; - KviKvsObject * o = objectFromVariant(c,&ret); - if(!o)return false; - return m_pRightSide->evaluateReadOnlyInObjectScope(o,c,pBuffer); -} - -KviKvsRWEvaluationResult * KviKvsTreeNodeScopeOperator::evaluateReadWrite(KviKvsRunTimeContext * c) -{ - KviKvsVariant ret; - if(!m_pObjectReference->evaluateReadOnly(c,&ret))return 0; - KviKvsObject * o = objectFromVariant(c,&ret); - if(!o)return 0; - return m_pRightSide->evaluateReadWriteInObjectScope(o,c); -} - -bool KviKvsTreeNodeScopeOperator::evaluateReadOnlyInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - KviKvsVariant ret; - if(!m_pObjectReference->evaluateReadOnlyInObjectScope(o,c,&ret))return false; - KviKvsObject * pObject = objectFromVariant(c,&ret); - if(!pObject)return false; - return m_pRightSide->evaluateReadOnlyInObjectScope(pObject,c,pBuffer); -} - -KviKvsRWEvaluationResult * KviKvsTreeNodeScopeOperator::evaluateReadWriteInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c) -{ - KviKvsVariant ret; - if(!m_pObjectReference->evaluateReadOnlyInObjectScope(o,c,&ret))return 0; - KviKvsObject * pObject = objectFromVariant(c,&ret); - if(!pObject)return 0; - return m_pRightSide->evaluateReadWriteInObjectScope(pObject,c); -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_scopeoperator.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_scopeoperator.h deleted file mode 100644 index b9244dd25b..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_scopeoperator.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_SCOPEOPERATOR_H_ -#define _KVI_KVS_TREENODE_SCOPEOPERATOR_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_scopeoperator.h -// Created on Tue 07 Oct 2003 02:33:01 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_treenode_data.h" - -class KviKvsObject; - -class KVIRC_API KviKvsTreeNodeScopeOperator : public KviKvsTreeNodeData -{ -public: - KviKvsTreeNodeScopeOperator(const QChar * pLocation,KviKvsTreeNodeData * pObject,KviKvsTreeNodeData * pData); - ~KviKvsTreeNodeScopeOperator(); -public: - KviKvsTreeNodeData * m_pObjectReference; // can't be null - KviKvsTreeNodeData * m_pRightSide; // can't be null -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool isReadOnly(); // gets the m_pRightSide read only state - virtual bool canEvaluateToObjectReference(); // gets the m_pRightSide result - virtual bool isFunctionCall(); // gets the m_pRightSide result - virtual bool canEvaluateInObjectScope(); // gets the m_pObjectReference result - //virtual bool canReleaseResult(); // gets the m_pRightSide result - - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); - virtual KviKvsRWEvaluationResult * evaluateReadWrite(KviKvsRunTimeContext * c); - virtual bool evaluateReadOnlyInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); - virtual KviKvsRWEvaluationResult * evaluateReadWriteInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c); -protected: - KviKvsObject * objectFromVariant(KviKvsRunTimeContext * c,KviKvsVariant * v); -}; - - -#endif //!_KVI_KVS_TREENODE_SCOPEOPERATOR_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_simplecommand.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_simplecommand.cpp deleted file mode 100644 index b41d5d0091..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_simplecommand.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_simplecommand.cpp -// Created on Thu 09 Oct 2003 02:12:18 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_simplecommand.h" -#include "kvi_kvs_treenode_datalist.h" - -KviKvsTreeNodeSimpleCommand::KviKvsTreeNodeSimpleCommand(const QChar * pLocation,const QString &szCmdName,KviKvsTreeNodeDataList * params) -: KviKvsTreeNodeCommandWithParameters(pLocation,szCmdName,params) -{ -} - -KviKvsTreeNodeSimpleCommand::~KviKvsTreeNodeSimpleCommand() -{ -} - -void KviKvsTreeNodeSimpleCommand::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Simple Command \""; - szBuffer += m_szCmdName; - szBuffer += "\""; -#endif -} - - -void KviKvsTreeNodeSimpleCommand::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s SimpleCommand(%s)",prefix,m_szCmdName.utf8().data()); - dumpSwitchList(prefix); - dumpParameterList(prefix); -#endif -} - - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_simplecommand.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_simplecommand.h deleted file mode 100644 index 6927071b44..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_simplecommand.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_SIMPLECOMMAND_H_ -#define _KVI_KVS_TREENODE_SIMPLECOMMAND_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_simplecommand.h -// Created on Thu 09 Oct 2003 02:12:18 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_treenode_commandwithparameters.h" - -class KviKvsTreeNodeDataList; - -class KVIRC_API KviKvsTreeNodeSimpleCommand : public KviKvsTreeNodeCommandWithParameters -{ -public: - KviKvsTreeNodeSimpleCommand(const QChar * pLocation,const QString &szCmdName,KviKvsTreeNodeDataList * params); - ~KviKvsTreeNodeSimpleCommand(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); -}; - - -#endif //!_KVI_KVS_TREENODE_SIMPLECOMMAND_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_singleparameteridentifier.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_singleparameteridentifier.cpp deleted file mode 100644 index f4274a24bc..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_singleparameteridentifier.cpp +++ /dev/null @@ -1,74 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_singleparameteridentifier.cpp -// Created on Tue 07 Oct 2003 03:47:11 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_singleparameteridentifier.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_variant.h" - -KviKvsTreeNodeSingleParameterIdentifier::KviKvsTreeNodeSingleParameterIdentifier(const QChar * pLocation,int iStart) -: KviKvsTreeNodeData(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_iStart = iStart; -#endif -} - -KviKvsTreeNodeSingleParameterIdentifier::~KviKvsTreeNodeSingleParameterIdentifier() -{ -} - -void KviKvsTreeNodeSingleParameterIdentifier::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Single Parameter Identifier \"$"; - KviQString::appendFormatted(szBuffer,"%d",m_iStart); - szBuffer += "\""; -#endif -} - - -void KviKvsTreeNodeSingleParameterIdentifier::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s SingleParameterIdentifier(%d)",prefix,m_iStart); -#endif -} - -bool KviKvsTreeNodeSingleParameterIdentifier::canEvaluateToObjectReference() -{ - return true; -} - -bool KviKvsTreeNodeSingleParameterIdentifier::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant * v = c->parameterList()->at(m_iStart); - if(!v)pBuffer->setNothing(); - else pBuffer->copyFrom(v); -#endif - return true; -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_singleparameteridentifier.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_singleparameteridentifier.h deleted file mode 100644 index 861b6dec84..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_singleparameteridentifier.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_SINGLEPARAMETERIDENTIFIER_H_ -#define _KVI_KVS_TREENODE_SINGLEPARAMETERIDENTIFIER_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_singleparameteridentifier.h -// Created on Tue 07 Oct 2003 03:47:11 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_treenode_data.h" - - -class KviKvsRunTimeContext; -class KviKvsVariant; - -class KVIRC_API KviKvsTreeNodeSingleParameterIdentifier : public KviKvsTreeNodeData -{ -public: - KviKvsTreeNodeSingleParameterIdentifier(const QChar * pLocation,int iStart); - ~KviKvsTreeNodeSingleParameterIdentifier(); -protected: - int m_iStart; // the index of the parameter wanted (always >= 0) -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - - virtual bool canEvaluateToObjectReference(); - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); -}; - - -#endif //!_KVI_KVS_TREENODE_SINGLEPARAMETERIDENTIFIER_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommand.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommand.cpp deleted file mode 100644 index 22629b145c..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommand.cpp +++ /dev/null @@ -1,54 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommand.cpp -// Created on Thu 09 Oct 2003 02:20:12 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_specialcommand.h" - -KviKvsTreeNodeSpecialCommand::KviKvsTreeNodeSpecialCommand(const QChar * pLocation,const QString &szCmdName) -: KviKvsTreeNodeCommand(pLocation,szCmdName) -{ -} - -KviKvsTreeNodeSpecialCommand::~KviKvsTreeNodeSpecialCommand() -{ -} - -void KviKvsTreeNodeSpecialCommand::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Special Command \""; - szBuffer += m_szCmdName; - szBuffer += "\""; -#endif -} - - -void KviKvsTreeNodeSpecialCommand::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s SpecialCommand(%s)",prefix,m_szCmdName.utf8().data()); - dumpSwitchList(prefix); -#endif -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommand.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommand.h deleted file mode 100644 index dc23b09ee4..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommand.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_SPECIALCOMMAND_H_ -#define _KVI_KVS_TREENODE_SPECIALCOMMAND_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommand.h -// Created on Thu 09 Oct 2003 02:20:12 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_command.h" - -class KVIRC_API KviKvsTreeNodeSpecialCommand : public KviKvsTreeNodeCommand -{ -public: - KviKvsTreeNodeSpecialCommand(const QChar * pLocation,const QString &szCmdName); - ~KviKvsTreeNodeSpecialCommand(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); -}; - -#endif //!_KVI_KVS_TREENODE_SPECIALCOMMAND_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandbreak.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandbreak.cpp deleted file mode 100644 index 16bfc8ed1a..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandbreak.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommandbreak.cpp -// Created on Thu 06 Nov 2003 12:15:00 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_specialcommandbreak.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_locale.h" - -KviKvsTreeNodeSpecialCommandBreak::KviKvsTreeNodeSpecialCommandBreak(const QChar * pLocation) -: KviKvsTreeNodeSpecialCommand(pLocation,"break") -{ -} - -KviKvsTreeNodeSpecialCommandBreak::~KviKvsTreeNodeSpecialCommandBreak() -{ -} - -void KviKvsTreeNodeSpecialCommandBreak::contextDescription(QString &szBuffer) -{ - szBuffer = "Special Command \"break\""; -} - - -void KviKvsTreeNodeSpecialCommandBreak::dump(const char * prefix) -{ - debug("%s SpecialCommandBreak",prefix); -} - -bool KviKvsTreeNodeSpecialCommandBreak::execute(KviKvsRunTimeContext * c) -{ - c->setBreakPending(); - return false; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandbreak.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandbreak.h deleted file mode 100644 index 78fa7a880c..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandbreak.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_SPECIALCOMMANDBREAK_H_ -#define _KVI_KVS_TREENODE_SPECIALCOMMANDBREAK_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommandbreak.h -// Created on Thu 06 Nov 2003 12:15:00 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_specialcommand.h" - -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeSpecialCommandBreak : public KviKvsTreeNodeSpecialCommand -{ -public: - KviKvsTreeNodeSpecialCommandBreak(const QChar * pLocation); - ~KviKvsTreeNodeSpecialCommandBreak(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -#endif //!_KVI_KVS_TREENODE_SPECIALCOMMANDBREAK_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandclass.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandclass.cpp deleted file mode 100644 index 536fc4472c..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandclass.cpp +++ /dev/null @@ -1,157 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommandclass.cpp -// Created on Fri 12 Aug 2005 03:23:31 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_locale.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_variant.h" -#include "kvi_kvs_treenode_specialcommandclass.h" -#include "kvi_kvs_kernel.h" -#include "kvi_kvs_object_controller.h" -#include "kvi_kvs_object_class.h" - -KviKvsTreeNodeSpecialCommandClassFunctionDefinition::KviKvsTreeNodeSpecialCommandClassFunctionDefinition(const QChar * pLocation,const QString &szName,const QString &szBuffer,unsigned int uHandlerFlags) -: KviKvsTreeNode(pLocation) -{ - m_uHandlerFlags = uHandlerFlags; - m_szName = szName; - m_szBuffer = szBuffer; -} - -void KviKvsTreeNodeSpecialCommandClassFunctionDefinition::dump(const char * prefix) -{ - debug("%s SpecialCommandClassFunctionDefinition(%s)",prefix,m_szName.utf8().data()); - debug("%s (command buffer with %d characters)",prefix,m_szBuffer.length()); -} - -void KviKvsTreeNodeSpecialCommandClassFunctionDefinition::contextDescription(QString &szBuffer) -{ - KviQString::sprintf(szBuffer,"Object Member Function Definition \"%Q\"",&m_szName); -} - -KviKvsTreeNodeSpecialCommandClass::KviKvsTreeNodeSpecialCommandClass(const QChar * pLocation,KviKvsTreeNodeDataList * pParams) -: KviKvsTreeNodeSpecialCommand(pLocation,"class") -{ - m_pParams = pParams; - m_pParams->setParent(this); - m_pFunctions = new KviPointerList<KviKvsTreeNodeSpecialCommandClassFunctionDefinition>; - m_pFunctions->setAutoDelete(true); -} - -KviKvsTreeNodeSpecialCommandClass::~KviKvsTreeNodeSpecialCommandClass() -{ - delete m_pParams; - delete m_pFunctions; -} - -void KviKvsTreeNodeSpecialCommandClass::addFunctionDefinition(KviKvsTreeNodeSpecialCommandClassFunctionDefinition * pDef) -{ - pDef->setParent(this); - m_pFunctions->append(pDef); -} - - -void KviKvsTreeNodeSpecialCommandClass::contextDescription(QString &szBuffer) -{ - szBuffer = "Special Command \"class\""; -} - -void KviKvsTreeNodeSpecialCommandClass::dump(const char * prefix) -{ - debug("%s SpecialCommandClass",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pParams->dump(tmp.utf8().data()); - for(KviKvsTreeNodeSpecialCommandClassFunctionDefinition * d = m_pFunctions->first();d;d = m_pFunctions->next()) - d->dump(tmp.utf8().data()); -} - -bool KviKvsTreeNodeSpecialCommandClass::execute(KviKvsRunTimeContext * c) -{ - KviKvsVariantList l; - if(!m_pParams->evaluate(c,&l))return false; - - KviKvsVariant * pClassName = l.first(); - if(!pClassName) - { - c->error(this,__tr2qs("Missing class name")); - return false; - } - KviKvsVariant * pBaseClassName = l.next(); - - QString szClassName; - QString szBaseClassName; - pClassName->asString(szClassName); - if(pBaseClassName) - pBaseClassName->asString(szBaseClassName); - - if(szClassName.isEmpty()) - { - c->error(this,__tr2qs("Missing class name")); - return false; - } - - if(szBaseClassName.isEmpty())szBaseClassName = "object"; - - // avoid infinite recursion in loading the base class - if(KviQString::equalCI(szBaseClassName,szClassName)) - { - c->error(__tr2qs("A class can't be a subclass of itself")); - return false; - } - - KviKvsObjectClass * pBaseClass = KviKvsKernel::instance()->objectController()->lookupClass(szBaseClassName); - if(!pBaseClass) - { - c->error(this,__tr2qs("Couln't find base class named \"%Q\""),&szBaseClassName); - return false; - } - - // walk the inheritance tree of the base class in order to detect loops - KviKvsObjectClass * pClass = pBaseClass; - while(pClass) - { - if(KviQString::equalCI(pClass->name(),szClassName)) - { - c->error(this,__tr2qs("Detected a loop in the inheritance tree of the base class \"%Q\": redefine that class first"),&szBaseClassName); - return false; - } - pClass = pClass->parentClass(); - } - - KviKvsObjectClass * pActualClass = KviKvsKernel::instance()->objectController()->lookupClass(szClassName,true); - if(pActualClass) - { - c->error(this,__tr2qs("Can't override the builtin class \"%Q\""),&szClassName); - return false; - } - pActualClass = new KviKvsObjectClass(pBaseClass,szClassName,0,false); - - for(KviKvsTreeNodeSpecialCommandClassFunctionDefinition * d = m_pFunctions->first();d;d = m_pFunctions->next()) - { - pActualClass->registerFunctionHandler(d->name(),d->buffer(),d->handlerFlags()); - } - return true; -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandclass.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandclass.h deleted file mode 100644 index cee749f556..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandclass.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_SPECIALCOMMANDCLASS_H_ -#define _KVI_KVS_TREENODE_SPECIALCOMMANDCLASS_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommandclass.h -// Created on Fri 12 Aug 2005 03:23:31 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_specialcommand.h" -#include "kvi_kvs_treenode_base.h" -#include "kvi_kvs_treenode_datalist.h" - -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeSpecialCommandClassFunctionDefinition : public KviKvsTreeNode -{ -public: - KviKvsTreeNodeSpecialCommandClassFunctionDefinition(const QChar * pLocation,const QString &szName,const QString &szBuffer,unsigned int uHandlerFlags); - virtual ~KviKvsTreeNodeSpecialCommandClassFunctionDefinition(){}; -protected: - QString m_szName; - QString m_szBuffer; - unsigned int m_uHandlerFlags; -public: - unsigned int handlerFlags(){ return m_uHandlerFlags; }; - const QString & name(){ return m_szName; }; - const QString & buffer(){ return m_szBuffer; }; - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); -}; - - - -class KVIRC_API KviKvsTreeNodeSpecialCommandClass : public KviKvsTreeNodeSpecialCommand -{ -public: - KviKvsTreeNodeSpecialCommandClass(const QChar * pLocation,KviKvsTreeNodeDataList * pParams); - virtual ~KviKvsTreeNodeSpecialCommandClass(); -protected: - KviKvsTreeNodeDataList * m_pParams; - KviPointerList<KviKvsTreeNodeSpecialCommandClassFunctionDefinition> * m_pFunctions; -public: - void addFunctionDefinition(KviKvsTreeNodeSpecialCommandClassFunctionDefinition * pDef); - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -#endif //!_KVI_KVS_TREENODE_SPECIALCOMMANDCLASS_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommanddefpopup.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommanddefpopup.cpp deleted file mode 100644 index 782aa56699..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommanddefpopup.cpp +++ /dev/null @@ -1,424 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommanddefpopup.cpp -// Created on Fri 02 Jan 2004 14:09:00 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_specialcommanddefpopup.h" -#include "kvi_kvs_treenode_expression.h" -#include "kvi_kvs_treenode_instruction.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_locale.h" -#include "kvi_kvs_popupmanager.h" -#include "kvi_kvs_popupmenu.h" -#include "kvi_kvs_script.h" - -void KviKvsTreeNodeSpecialCommandDefpopupLabelExtpopup::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Label \"extpopup\" For Special Command \"defpopup\""; -#endif -} - -void KviKvsTreeNodeSpecialCommandDefpopupLabelExtpopup::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s SpecialCommandDefpopupLabelExtpopup",prefix); - QString tmp = prefix; - tmp.append(" "); - QString x = tmp; - x += "CONDITION: "; - x += m_szCondition; - debug("%s",x.utf8().data()); - x = tmp; - x += "TEXT: "; - x += m_szText; - debug("%s",x.utf8().data()); - x = tmp; - x += "NAME: "; - x += m_szName; - debug("%s",x.utf8().data()); - x = tmp; - x += "ICON: "; - x += m_szIcon; - debug("%s",x.utf8().data()); -#endif -} - -bool KviKvsTreeNodeSpecialCommandDefpopupLabelExtpopup::execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p) -{ -#ifdef COMPILE_NEW_KVS - p->addExtPopup(m_szItemName,m_szName,m_szText,m_szIcon,m_szCondition); -#endif - return true; -} - - -void KviKvsTreeNodeSpecialCommandDefpopupLabelItem::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Label \"item\" For Special Command \"defpopup\""; -#endif -} - - -void KviKvsTreeNodeSpecialCommandDefpopupLabelItem::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s SpecialCommandDefpopupLabelItem",prefix); - QString tmp = prefix; - tmp.append(" "); - QString x = tmp; - x += "CONDITION: "; - x += m_szCondition; - debug("%s",x.utf8().data()); - x = tmp; - x += "TEXT: "; - x += m_szText; - debug("%s",x.utf8().data()); - x = tmp; - x += "ICON: "; - x += m_szIcon; - debug("%s",x.utf8().data()); - x = tmp; - x += "INSTRUCTION: "; - x += m_szInstruction; - debug("%s",x.utf8().data()); -#endif -} - -bool KviKvsTreeNodeSpecialCommandDefpopupLabelItem::execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p) -{ -#ifdef COMPILE_NEW_KVS - p->addItem(m_szItemName,m_szInstruction,m_szText,m_szIcon,m_szCondition); -#endif - return true; -} - -void KviKvsTreeNodeSpecialCommandDefpopupLabelLabel::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Label \"label\" For Special Command \"defpopup\""; -#endif -} - - -void KviKvsTreeNodeSpecialCommandDefpopupLabelLabel::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s SpecialCommandDefpopupLabelLabel",prefix); - QString tmp = prefix; - tmp.append(" "); - QString x = tmp; - x += "CONDITION: "; - x += m_szCondition; - debug("%s",x.utf8().data()); - x = tmp; - x += "TEXT: "; - x += m_szText; - debug("%s",x.utf8().data()); - x = tmp; - x += "ICON: "; - x += m_szIcon; - debug("%s",x.utf8().data()); -#endif -} - -bool KviKvsTreeNodeSpecialCommandDefpopupLabelLabel::execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p) -{ -#ifdef COMPILE_NEW_KVS - p->addLabel(m_szItemName,m_szText,m_szIcon,m_szCondition); -#endif - return true; -} - - - - -void KviKvsTreeNodeSpecialCommandDefpopupLabelSeparator::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Label \"separator\" For Special Command \"defpopup\""; -#endif -} - - -void KviKvsTreeNodeSpecialCommandDefpopupLabelSeparator::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s SpecialCommandDefpopupLabelSeparator",prefix); - QString tmp = prefix; - tmp.append(" CONDITION:"); - tmp.append(m_szCondition); - debug("%s",tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeSpecialCommandDefpopupLabelSeparator::execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p) -{ -#ifdef COMPILE_NEW_KVS - p->addSeparator(m_szItemName,m_szCondition); -#endif - return true; -} - - - -void KviKvsTreeNodeSpecialCommandDefpopupLabelEpilogue::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Label \"epilogue\" For Special Command \"defpopup\""; -#endif -} - - -void KviKvsTreeNodeSpecialCommandDefpopupLabelEpilogue::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s SpecialCommandDefpopupLabelEpilogue",prefix); - QString tmp = prefix; - tmp.append(" INSTRUCTION: "); - tmp += m_szInstruction; - debug("%s",tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeSpecialCommandDefpopupLabelEpilogue::execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p) -{ -#ifdef COMPILE_NEW_KVS - p->addEpilogue(m_szItemName,m_szInstruction); -#endif - return true; -} - - -void KviKvsTreeNodeSpecialCommandDefpopupLabelPrologue::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Label \"prologue\" For Special Command \"defpopup\""; -#endif -} - - - -void KviKvsTreeNodeSpecialCommandDefpopupLabelPrologue::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s SpecialCommandDefpopupLabelPrologue",prefix); - QString tmp = prefix; - tmp.append(" INSTRUCTION: "); - tmp += m_szInstruction; - debug("%s",tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeSpecialCommandDefpopupLabelPrologue::execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p) -{ -#ifdef COMPILE_NEW_KVS - p->addPrologue(m_szItemName,m_szInstruction); -#endif - return true; -} - - - - - - - - - -KviKvsTreeNodeSpecialCommandDefpopupLabelPopup::KviKvsTreeNodeSpecialCommandDefpopupLabelPopup(const QChar * pLocation) -: KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon(pLocation,QString::null,QString::null,QString::null,QString::null) -{ -#ifdef COMPILE_NEW_KVS - m_pLabels = new KviPointerList<KviKvsTreeNodeSpecialCommandDefpopupLabel>; - m_pLabels->setAutoDelete(true); -#endif -} - -KviKvsTreeNodeSpecialCommandDefpopupLabelPopup::~KviKvsTreeNodeSpecialCommandDefpopupLabelPopup() -{ -#ifdef COMPILE_NEW_KVS - delete m_pLabels; -#endif -} - -void KviKvsTreeNodeSpecialCommandDefpopupLabelPopup::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Label \"popup\" For Special Command \"defpopup\""; -#endif -} - - -void KviKvsTreeNodeSpecialCommandDefpopupLabelPopup::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s SpecialCommandDefpopupLabelPopup",prefix); - QString tmp = prefix; - tmp.append(" "); - QString x = tmp; - x += "CONDITION: "; - x += m_szCondition; - debug(x.utf8().data()); - x = tmp; - x += "TEXT: "; - x += m_szText; - debug(x.utf8().data()); - x = tmp; - x += "ICON: "; - x += m_szIcon; - debug(x.utf8().data()); - for(KviKvsTreeNodeSpecialCommandDefpopupLabel * l = m_pLabels->first();l;l = m_pLabels->next()) - l->dump(tmp.utf8().data()); -#endif -} - -void KviKvsTreeNodeSpecialCommandDefpopupLabelPopup::addLabel(KviKvsTreeNodeSpecialCommandDefpopupLabel * pLabel) -{ -#ifdef COMPILE_NEW_KVS - pLabel->setParent(this); - m_pLabels->append(pLabel); -#endif -} - -bool KviKvsTreeNodeSpecialCommandDefpopupLabelPopup::execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p) -{ -#ifdef COMPILE_NEW_KVS - // the name will be reset anyway - KviKvsPopupMenu * pNew = p->addPopup(m_szItemName,m_szText,m_szIcon,m_szCondition); - return fill(c,pNew); -#else - return false; -#endif -} - -bool KviKvsTreeNodeSpecialCommandDefpopupLabelPopup::fill(KviKvsRunTimeContext* c,KviKvsPopupMenu * p) -{ -#ifdef COMPILE_NEW_KVS - for(KviKvsTreeNodeSpecialCommandDefpopupLabel * l = m_pLabels->first();l;l = m_pLabels->next()) - { - if(!l->execute(c,p))return false; - } -#endif - return true; -} - - - - - - - - -KviKvsTreeNodeSpecialCommandDefpopup::KviKvsTreeNodeSpecialCommandDefpopup(const QChar * pLocation,KviKvsTreeNodeData * pPopupName,KviKvsTreeNodeSpecialCommandDefpopupLabelPopup * pMainPopup) -: KviKvsTreeNodeSpecialCommand(pLocation,"defpopup") -{ -#ifdef COMPILE_NEW_KVS - m_pPopupName = pPopupName; - m_pPopupName->setParent(this); - m_pMainPopup = pMainPopup; - m_pMainPopup->setParent(this); -#endif -} - -KviKvsTreeNodeSpecialCommandDefpopup::~KviKvsTreeNodeSpecialCommandDefpopup() -{ -#ifdef COMPILE_NEW_KVS - delete m_pPopupName; - delete m_pMainPopup; -#endif -} - -void KviKvsTreeNodeSpecialCommandDefpopup::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Special Command \"defpopup\""; -#endif -} - - -void KviKvsTreeNodeSpecialCommandDefpopup::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s SpecialCommandDefpopup",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pPopupName->dump(tmp.utf8().data()); - m_pMainPopup->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeSpecialCommandDefpopup::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant v; - if(!m_pPopupName->evaluateReadOnly(c,&v))return false; - QString szName; - v.asString(szName); - - KviKvsSwitchList swl; - if(m_pSwitches) - { - if(!(m_pSwitches->evaluate(c,&swl)))return false; - } - - KviKvsPopupMenu * pPopup = KviKvsPopupManager::instance()->lookup(szName); - bool bWasAlreadyThere; - if(!pPopup) - { - if(m_pMainPopup->isEmpty())return true; // we wanted to remove it anyway: exit silently - // we want to create it - pPopup = new KviKvsPopupMenu(szName); - KviKvsPopupManager::instance()->add(szName,pPopup); - bWasAlreadyThere = false; - } else { - bWasAlreadyThere = true; - - if(pPopup->isLocked()) - { - c->error(__tr2qs("The popup '%s' is actually locked: 'self-modifications' are not allowed"),&szName); - return false; - } - - if(m_pMainPopup->isEmpty()) - { - // we want to remove it - KviKvsPopupManager::instance()->remove(szName); - return true; - } - // we want to (re)create it - - if(!swl.find('m',"--merge"))pPopup->doClear(); - } - - - if(!m_pMainPopup->fill(c,pPopup)) - { - if(!bWasAlreadyThere)KviKvsPopupManager::instance()->remove(szName); - return false; - } -#endif - return true; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommanddefpopup.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommanddefpopup.h deleted file mode 100644 index f251d44e37..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommanddefpopup.h +++ /dev/null @@ -1,193 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_SPECIALCOMMANDDEFPOPUP_H_ -#define _KVI_KVS_TREENODE_SPECIALCOMMANDDEFPOPUP_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommanddefpopup.h -// Created on Fri 02 Jan 2004 13:54:00 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode.h" -#include "kvi_kvs_treenode_specialcommand.h" - -class KviKvsTreeNodeExpression; -class KviKvsTreeNodeInstruction; -class KviKvsRunTimeContext; -class KviKvsVariant; -class KviKvsPopupMenu; - - -class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupLabel : public KviKvsTreeNode -{ -public: - QString m_szItemName; -public: - KviKvsTreeNodeSpecialCommandDefpopupLabel(const QChar * pLocation,const QString &szItemName) - : KviKvsTreeNode(pLocation), m_szItemName(szItemName) {}; - ~KviKvsTreeNodeSpecialCommandDefpopupLabel(){}; -public: - void setItemName(const QString &szItemName){ m_szItemName = szItemName; }; - virtual bool execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p) = 0; -}; - -class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel : public KviKvsTreeNodeSpecialCommandDefpopupLabel -{ -protected: - QString m_szCondition; // may be null! -public: - KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel(const QChar * pLocation,const QString &szCondition,const QString &szItemName) - : KviKvsTreeNodeSpecialCommandDefpopupLabel(pLocation,szItemName), m_szCondition(szCondition) {}; - ~KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel(){}; -public: - void setCondition(const QString &szCondition){ m_szCondition = szCondition; }; -}; - -class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupLabelSeparator : public KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel -{ -public: - KviKvsTreeNodeSpecialCommandDefpopupLabelSeparator(const QChar * pLocation,const QString &szCondition,const QString &szItemName) - : KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel(pLocation,szCondition,szItemName){}; - ~KviKvsTreeNodeSpecialCommandDefpopupLabelSeparator(){}; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p); -}; - -class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon : public KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel -{ -protected: - QString m_szText; - QString m_szIcon; -public: - KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon(const QChar * pLocation,const QString &szCondition,const QString &szText,const QString &szIcon,const QString &szItemName) - : KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel(pLocation,szCondition,szItemName), m_szText(szText), m_szIcon(szIcon){}; - ~KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon(){}; -public: - void setText(const QString &szText){ m_szText = szText; }; - void setIcon(const QString &szIcon){ m_szIcon = szIcon; }; -}; - -class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupLabelExtpopup : public KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon -{ -protected: - QString m_szName; -public: - KviKvsTreeNodeSpecialCommandDefpopupLabelExtpopup(const QChar * pLocation,const QString &szCondition,const QString &szText,const QString &szIcon,const QString &szName,const QString &szItemName) - : KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon(pLocation,szCondition,szText,szIcon,szItemName), m_szName(szName){}; - ~KviKvsTreeNodeSpecialCommandDefpopupLabelExtpopup(){}; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p); -}; - -class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupLabelItem : public KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon -{ -protected: - QString m_szInstruction; -public: - KviKvsTreeNodeSpecialCommandDefpopupLabelItem(const QChar * pLocation,const QString &szCondition,const QString &szText,const QString &szIcon,const QString &szInstruction,const QString &szItemName) - : KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon(pLocation,szCondition,szText,szIcon,szItemName), m_szInstruction(szInstruction) {}; - ~KviKvsTreeNodeSpecialCommandDefpopupLabelItem(){}; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p); -}; - - -class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupLabelLabel : public KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon -{ -public: - KviKvsTreeNodeSpecialCommandDefpopupLabelLabel(const QChar * pLocation,const QString &szCondition,const QString &szText,const QString &szIcon,const QString &szItemName) - : KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon(pLocation,szCondition,szText,szIcon,szItemName){}; - ~KviKvsTreeNodeSpecialCommandDefpopupLabelLabel(){}; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p); -}; - - - -class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupLabelPrologue : public KviKvsTreeNodeSpecialCommandDefpopupLabel -{ -protected: - QString m_szInstruction; -public: - KviKvsTreeNodeSpecialCommandDefpopupLabelPrologue(const QChar * pLocation,const QString &szInstruction,const QString &szItemName) - : KviKvsTreeNodeSpecialCommandDefpopupLabel(pLocation,szItemName), m_szInstruction(szInstruction){}; - ~KviKvsTreeNodeSpecialCommandDefpopupLabelPrologue(){}; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p); -}; - -class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupLabelEpilogue : public KviKvsTreeNodeSpecialCommandDefpopupLabel -{ -protected: - QString m_szInstruction; -public: - KviKvsTreeNodeSpecialCommandDefpopupLabelEpilogue(const QChar * pLocation,const QString &szInstruction,const QString &szItemName) - : KviKvsTreeNodeSpecialCommandDefpopupLabel(pLocation,szItemName), m_szInstruction(szInstruction){}; - ~KviKvsTreeNodeSpecialCommandDefpopupLabelEpilogue(){}; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p); -}; - - -class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupLabelPopup : public KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon -{ -public: - KviKvsTreeNodeSpecialCommandDefpopupLabelPopup(const QChar * pLocation); - ~KviKvsTreeNodeSpecialCommandDefpopupLabelPopup(); -protected: - KviPointerList<KviKvsTreeNodeSpecialCommandDefpopupLabel> * m_pLabels; -public: - bool isEmpty(){ return m_pLabels->isEmpty(); }; - void addLabel(KviKvsTreeNodeSpecialCommandDefpopupLabel * pLabel); - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p); - bool fill(KviKvsRunTimeContext * c,KviKvsPopupMenu * p); -}; - - -class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopup : public KviKvsTreeNodeSpecialCommand -{ -public: - KviKvsTreeNodeSpecialCommandDefpopup(const QChar * pLocation,KviKvsTreeNodeData * pPopupName,KviKvsTreeNodeSpecialCommandDefpopupLabelPopup * pMainPopup); - ~KviKvsTreeNodeSpecialCommandDefpopup(); -private: - KviKvsTreeNodeData * m_pPopupName; // can't be zero - KviKvsTreeNodeSpecialCommandDefpopupLabelPopup * m_pMainPopup; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -#endif //!_KVI_KVS_TREENODE_SPECIALCOMMANDDEFPOPUP_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommanddo.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommanddo.cpp deleted file mode 100644 index ef2c7402cc..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommanddo.cpp +++ /dev/null @@ -1,87 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommanddo.cpp -// Created on Thu 06 Nov 2003 14:09:53 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_specialcommanddo.h" -#include "kvi_kvs_treenode_expression.h" -#include "kvi_kvs_treenode_instruction.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_locale.h" - -KviKvsTreeNodeSpecialCommandDo::KviKvsTreeNodeSpecialCommandDo(const QChar * pLocation,KviKvsTreeNodeExpression * e,KviKvsTreeNodeInstruction * i) -: KviKvsTreeNodeSpecialCommand(pLocation,"do") -{ - m_pExpression = e; - m_pExpression->setParent(this); - m_pInstruction = i; - if(i)m_pInstruction->setParent(this); -} - -KviKvsTreeNodeSpecialCommandDo::~KviKvsTreeNodeSpecialCommandDo() -{ - delete m_pExpression; - if(m_pInstruction)delete m_pInstruction; -} - -void KviKvsTreeNodeSpecialCommandDo::contextDescription(QString &szBuffer) -{ - szBuffer = "Special Command \"do\""; -} - -void KviKvsTreeNodeSpecialCommandDo::dump(const char * prefix) -{ - debug("%s SpecialCommandDo",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pExpression->dump(tmp); - if(m_pInstruction)m_pInstruction->dump(tmp); -} - -bool KviKvsTreeNodeSpecialCommandDo::execute(KviKvsRunTimeContext * c) -{ - for(;;) - { - if(m_pInstruction) - { - if(!m_pInstruction->execute(c)) - { - if(c->error())return false; - - if(c->breakPending()) - { - c->handleBreak(); - return true; - } - return false; - } - } - - KviKvsVariant v; - if(!m_pExpression->evaluateReadOnly(c,&v))return false; - if(!v.asBoolean())break; - } - return true; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommanddo.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommanddo.h deleted file mode 100644 index b4fd266eb8..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommanddo.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_SPECIALCOMMANDDO_H_ -#define _KVI_KVS_TREENODE_SPECIALCOMMANDDO_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommanddo.h -// Created on Thu 06 Nov 2003 14:09:53 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_specialcommand.h" - -class KviKvsTreeNodeExpression; -class KviKvsTreeNodeInstruction; -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeSpecialCommandDo : public KviKvsTreeNodeSpecialCommand -{ -public: - KviKvsTreeNodeSpecialCommandDo(const QChar * pLocation,KviKvsTreeNodeExpression * e,KviKvsTreeNodeInstruction * i); - ~KviKvsTreeNodeSpecialCommandDo(); -private: - KviKvsTreeNodeExpression * m_pExpression; // can't be 0 - KviKvsTreeNodeInstruction * m_pInstruction; // may be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - - -#endif //!_KVI_KVS_TREENODE_SPECIALCOMMANDDO_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandfor.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandfor.cpp deleted file mode 100644 index 343ce1029c..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandfor.cpp +++ /dev/null @@ -1,133 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommandfor.cpp -// Created on Fri 07 Nov 2003 11:48:11 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_specialcommandfor.h" -#include "kvi_kvs_treenode_expression.h" -#include "kvi_kvs_treenode_instruction.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_locale.h" - -KviKvsTreeNodeSpecialCommandFor::KviKvsTreeNodeSpecialCommandFor(const QChar * pLocation,KviKvsTreeNodeInstruction * pInit,KviKvsTreeNodeExpression * pCond,KviKvsTreeNodeInstruction * pUpd,KviKvsTreeNodeInstruction * pLoop) -: KviKvsTreeNodeSpecialCommand(pLocation,"for") -{ - m_pInitialization = pInit; - if(m_pInitialization)m_pInitialization->setParent(this); - m_pCondition = pCond; - if(m_pCondition)m_pCondition->setParent(this); - m_pUpdate = pUpd; - if(m_pUpdate)m_pUpdate->setParent(this); - m_pLoop = pLoop; - if(m_pLoop)m_pLoop->setParent(this); -} - -KviKvsTreeNodeSpecialCommandFor::~KviKvsTreeNodeSpecialCommandFor() -{ - if(m_pInitialization)delete m_pInitialization; - if(m_pCondition)delete m_pCondition; - if(m_pUpdate)delete m_pUpdate; - if(m_pLoop)delete m_pLoop; -} - -void KviKvsTreeNodeSpecialCommandFor::contextDescription(QString &szBuffer) -{ - szBuffer = "Special Command \"for\""; -} - -void KviKvsTreeNodeSpecialCommandFor::dump(const char * prefix) -{ - debug("%s SpecialCommandFor",prefix); - QString tmp = prefix; - tmp.append(" "); - if(m_pInitialization)m_pInitialization->dump(tmp.utf8().data()); - if(m_pCondition)m_pCondition->dump(tmp.utf8().data()); - if(m_pUpdate)m_pUpdate->dump(tmp.utf8().data()); - if(m_pLoop)m_pLoop->dump(tmp.utf8().data()); -} - -bool KviKvsTreeNodeSpecialCommandFor::execute(KviKvsRunTimeContext * c) -{ - if(m_pInitialization) - { - if(!m_pInitialization->execute(c)) - { - // break allowed also here - if(c->error())return false; - - if(c->breakPending()) - { - c->handleBreak(); - return true; - } - - return false; // propagate false ret value - } - } - - for(;;) - { - if(m_pCondition) - { - KviKvsVariant v; - if(!m_pCondition->evaluateReadOnly(c,&v))return false; - if(!v.asBoolean())return true; - } - - if(m_pLoop) - { - if(!m_pLoop->execute(c)) - { - if(c->error())return false; - - if(c->breakPending()) - { - c->handleBreak(); - return true; - } - - return false; // propagate false ret value - } - } - - if(m_pUpdate) - { - if(!m_pUpdate->execute(c)) - { - // break allowed also here - if(c->error())return false; - - if(c->breakPending()) - { - c->handleBreak(); - return true; - } - - return false; // propagate false ret value - } - } - } - // not reached - return false; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandfor.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandfor.h deleted file mode 100644 index 0b0969a884..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandfor.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_SPECIALCOMMANDFOR_H_ -#define _KVI_KVS_TREENODE_SPECIALCOMMANDFOR_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommandfor.h -// Created on Fri 07 Nov 2003 11:48:11 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_specialcommand.h" - -class KviKvsTreeNodeExpression; -class KviKvsTreeNodeInstruction; -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeSpecialCommandFor : public KviKvsTreeNodeSpecialCommand -{ -public: - KviKvsTreeNodeSpecialCommandFor(const QChar * pLocation,KviKvsTreeNodeInstruction * pInit,KviKvsTreeNodeExpression * pCond,KviKvsTreeNodeInstruction * pUpd,KviKvsTreeNodeInstruction * pLoop); - ~KviKvsTreeNodeSpecialCommandFor(); -private: - KviKvsTreeNodeInstruction * m_pInitialization; // can be 0 - KviKvsTreeNodeExpression * m_pCondition; // can be 0 - KviKvsTreeNodeInstruction * m_pUpdate; // can be 0 - KviKvsTreeNodeInstruction * m_pLoop; // can be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - - -#endif //!_KVI_KVS_TREENODE_SPECIALCOMMANDFOR_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandforeach.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandforeach.cpp deleted file mode 100644 index eb06a9abac..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandforeach.cpp +++ /dev/null @@ -1,191 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommandforeach.cpp -// Created on Fri 07 Nov 2003 11:48:11 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_specialcommandforeach.h" -#include "kvi_kvs_treenode_data.h" -#include "kvi_kvs_treenode_datalist.h" -#include "kvi_kvs_treenode_instruction.h" -#include "kvi_kvs_treenode_switchlist.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_locale.h" - -KviKvsTreeNodeSpecialCommandForeach::KviKvsTreeNodeSpecialCommandForeach(const QChar * pLocation,KviKvsTreeNodeData * pVar,KviKvsTreeNodeDataList * pArgs,KviKvsTreeNodeInstruction * pLoop) -: KviKvsTreeNodeSpecialCommand(pLocation,"foreach") -{ - m_pIterationVariable = pVar; - m_pIterationVariable->setParent(this); - m_pIterationData = pArgs; - m_pIterationData->setParent(this); - m_pLoop = pLoop; - m_pLoop->setParent(this); -} - -KviKvsTreeNodeSpecialCommandForeach::~KviKvsTreeNodeSpecialCommandForeach() -{ - delete m_pIterationVariable; - delete m_pIterationData; - delete m_pLoop; -} - -void KviKvsTreeNodeSpecialCommandForeach::contextDescription(QString &szBuffer) -{ - szBuffer = "Special Command \"foreach\""; -} - -void KviKvsTreeNodeSpecialCommandForeach::dump(const char * prefix) -{ - debug("%s SpecialCommandForeach",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pIterationVariable->dump(tmp.utf8().data()); - m_pIterationData->dump(tmp.utf8().data()); - m_pLoop->dump(tmp.utf8().data()); -} - -bool KviKvsTreeNodeSpecialCommandForeach::execute(KviKvsRunTimeContext * c) -{ - KviKvsRWEvaluationResult * v = m_pIterationVariable->evaluateReadWrite(c); - if(!v)return false; - - KviKvsVariantList l; - l.setAutoDelete(true); - if(!m_pIterationData->evaluate(c,&l)) - { - delete v; - return false; - } - - KviKvsSwitchList swl; - if(m_pSwitches) - { - if(!(m_pSwitches->evaluate(c,&swl)))return false; - } - - bool bIncludeEmptyScalars = swl.find('a',"all") != 0; - - for(KviKvsVariant * pArg = l.first();pArg;pArg = l.next()) - { - switch(pArg->type()) - { - case KviKvsVariantData::Array: - { - unsigned int uCnt = pArg->array()->size(); - unsigned int idx = 0; - while(idx < uCnt) - { - KviKvsVariant * pOne = pArg->array()->at(idx); - if(pOne) - { - v->result()->copyFrom(*pOne); - } else { - v->result()->setNothing(); - } - - if(!m_pLoop->execute(c)) - { - // break allowed! - - if(c->error()) - { - delete v; - return false; - } - // break allowed! - if(c->breakPending()) - { - c->handleBreak(); - delete v; - return true; - } - delete v; - return false; // propagate the false return value - } - - idx++; - } - } - break; - case KviKvsVariantData::Hash: - { - KviKvsHashIterator it(*(pArg->hash()->dict())); - while(KviKvsVariant * pOne = it.current()) - { - v->result()->copyFrom(*pOne); - - if(!m_pLoop->execute(c)) - { - // break allowed! - - if(c->error()) - { - delete v; - return false; - } - // break allowed! - if(c->breakPending()) - { - c->handleBreak(); - delete v; - return true; - } - delete v; - return false; // propagate the false return value - } - - ++it; - } - } - break; - default: - if(bIncludeEmptyScalars || (!pArg->isNothing())) - { - v->result()->copyFrom(*pArg); - if(!m_pLoop->execute(c)) - { - // break allowed! - - if(c->error()) - { - delete v; - return false; - } - // break allowed! - if(c->breakPending()) - { - c->handleBreak(); - delete v; - return true; - } - delete v; - return false; // propagate the false return value - } - } - break; - } - } - delete v; - return true; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandforeach.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandforeach.h deleted file mode 100644 index 073b57f6ed..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandforeach.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_SPECIALCOMMANDFOREACH_H_ -#define _KVI_KVS_TREENODE_SPECIALCOMMANDFOREACH_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommandforeach.h -// Created on Fri 07 Nov 2003 11:48:11 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_specialcommand.h" - -class KviKvsTreeNodeData; -class KviKvsTreeNodeDataList; -class KviKvsTreeNodeInstruction; -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeSpecialCommandForeach : public KviKvsTreeNodeSpecialCommand -{ -public: - KviKvsTreeNodeSpecialCommandForeach(const QChar * pLocation,KviKvsTreeNodeData * pVar,KviKvsTreeNodeDataList * pArgs,KviKvsTreeNodeInstruction * pLoop); - ~KviKvsTreeNodeSpecialCommandForeach(); -private: - KviKvsTreeNodeData * m_pIterationVariable; // can't be zero! - KviKvsTreeNodeDataList * m_pIterationData; // can't be zero! - KviKvsTreeNodeInstruction * m_pLoop; // can't be zero! -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - - -#endif //!_KVI_KVS_TREENODE_SPECIALCOMMANDFOREACH_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandif.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandif.cpp deleted file mode 100644 index a6ff140b35..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandif.cpp +++ /dev/null @@ -1,94 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommandif.cpp -// Created on Thu 09 Oct 2003 02:40:00 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_specialcommandif.h" -#include "kvi_kvs_treenode_expression.h" -#include "kvi_kvs_treenode_instruction.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_locale.h" - -KviKvsTreeNodeSpecialCommandIf::KviKvsTreeNodeSpecialCommandIf(const QChar * pLocation,KviKvsTreeNodeExpression * e,KviKvsTreeNodeInstruction * pIf,KviKvsTreeNodeInstruction * pElse) -: KviKvsTreeNodeSpecialCommand(pLocation,"if") -{ -#ifdef COMPILE_NEW_KVS - m_pExpression = e; - m_pExpression->setParent(this); - m_pIfInstruction = pIf; - if(pIf)m_pIfInstruction->setParent(this); - m_pElseInstruction = pElse; - if(pElse)m_pElseInstruction->setParent(this); -#endif -} - -KviKvsTreeNodeSpecialCommandIf::~KviKvsTreeNodeSpecialCommandIf() -{ -#ifdef COMPILE_NEW_KVS - delete m_pExpression; - if(m_pIfInstruction)delete m_pIfInstruction; - if(m_pElseInstruction)delete m_pElseInstruction; -#endif -} - -void KviKvsTreeNodeSpecialCommandIf::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Special Command \"if\""; -#endif -} - -void KviKvsTreeNodeSpecialCommandIf::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s SpecialCommandIf",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pExpression->dump(tmp); - if(m_pIfInstruction)m_pIfInstruction->dump(tmp); - if(m_pElseInstruction)m_pElseInstruction->dump(tmp); -#endif -} - -bool KviKvsTreeNodeSpecialCommandIf::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariant v; - if(!m_pExpression->evaluateReadOnly(c,&v))return false; - - if(v.asBoolean()) - { - if(m_pIfInstruction) - { - return m_pIfInstruction->execute(c); - } - } else { - if(m_pElseInstruction) - { - return m_pElseInstruction->execute(c); - } - } -#endif - return true; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandif.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandif.h deleted file mode 100644 index da41138707..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandif.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_SPECIALCOMMANDIF_H_ -#define _KVI_KVS_TREENODE_SPECIALCOMMANDIF_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommandif.h -// Created on Thu 09 Oct 2003 02:40:00 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_specialcommand.h" - -class KviKvsTreeNodeExpression; -class KviKvsTreeNodeInstruction; -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeSpecialCommandIf : public KviKvsTreeNodeSpecialCommand -{ -public: - KviKvsTreeNodeSpecialCommandIf(const QChar * pLocation,KviKvsTreeNodeExpression * e,KviKvsTreeNodeInstruction * pIf,KviKvsTreeNodeInstruction * pElse); - ~KviKvsTreeNodeSpecialCommandIf(); -private: - KviKvsTreeNodeExpression * m_pExpression; // can't be 0 - KviKvsTreeNodeInstruction * m_pIfInstruction; // may be 0 - KviKvsTreeNodeInstruction * m_pElseInstruction; // may be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -#endif //!_KVI_KVS_TREENODE_SPECIALCOMMANDIF_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandswitch.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandswitch.cpp deleted file mode 100644 index 169a67c332..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandswitch.cpp +++ /dev/null @@ -1,349 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommandswitch.cpp -// Created on Fri 02 Jan 2004 14:09:00 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_specialcommandswitch.h" -#include "kvi_kvs_treenode_expression.h" -#include "kvi_kvs_treenode_instruction.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_locale.h" - -#include <qregexp.h> - -KviKvsTreeNodeSpecialCommandSwitchLabel::KviKvsTreeNodeSpecialCommandSwitchLabel(const QChar * pLocation) -: KviKvsTreeNode(pLocation) -{ - m_pParameter = 0; - m_pInstruction = 0; - m_bHasTerminatingBreak = false; -} - -KviKvsTreeNodeSpecialCommandSwitchLabel::~KviKvsTreeNodeSpecialCommandSwitchLabel() -{ - if(m_pParameter)delete m_pParameter; - if(m_pInstruction)delete m_pInstruction; -} - -void KviKvsTreeNodeSpecialCommandSwitchLabel::setParameter(KviKvsTreeNodeData * pParameter) -{ - if(m_pParameter)delete m_pParameter; - m_pParameter = pParameter; - if(m_pParameter)m_pParameter->setParent(this); -} - -void KviKvsTreeNodeSpecialCommandSwitchLabel::setInstruction(KviKvsTreeNodeInstruction * pInstruction) -{ - if(m_pInstruction)delete m_pInstruction; - m_pInstruction = pInstruction; - if(m_pInstruction)m_pInstruction->setParent(this); -} - - - - - -KviKvsTreeNodeSpecialCommandSwitchLabelCase::KviKvsTreeNodeSpecialCommandSwitchLabelCase(const QChar * pLocation) -: KviKvsTreeNodeSpecialCommandSwitchLabel(pLocation) -{ -} - -KviKvsTreeNodeSpecialCommandSwitchLabelCase::~KviKvsTreeNodeSpecialCommandSwitchLabelCase() -{ -} - -void KviKvsTreeNodeSpecialCommandSwitchLabelCase::contextDescription(QString &szBuffer) -{ - szBuffer = "Label \"case\" For Special Command \"switch\""; -} - -void KviKvsTreeNodeSpecialCommandSwitchLabelCase::dump(const char * prefix) -{ - debug("%s SpecialCommandSwitchLabelCase",prefix); - QString tmp = prefix; - tmp.append(" "); - if(m_pParameter)m_pParameter->dump(tmp.utf8().data()); - if(m_pInstruction)m_pInstruction->dump(tmp.utf8().data()); -} - -bool KviKvsTreeNodeSpecialCommandSwitchLabelCase::execute(KviKvsRunTimeContext * c,KviKvsVariant * pRealParameter) -{ - KviKvsVariant v; - if(!m_pParameter->evaluateReadOnly(c,&v))return false; - - KviKvsNumber num; - if(pRealParameter->asNumber(num)) - { - KviKvsNumber num2; - if(!v.asNumber(num2))return true; // a number an a non number can't match - if(num.isInteger()) - { - if(num2.isInteger()) - { - if(num.integer() != num2.integer())return true; - } else { - if(((double)(num.integer())) != num2.real())return true; - } - } else { - if(num2.isInteger()) - { - if(num.real() != ((double)(num2.integer())))return true; - } else { - if(num.real() != num2.real())return true; - } - } - } else { - // string comparision, case insensitive - QString reg; - v.asString(reg); - - QString val; - pRealParameter->asString(val); - - if(reg.lower() != val.lower())return true; - } - - if(m_pInstruction) - { - if(!m_pInstruction->execute(c))return false; // might be a break too - } - if(m_bHasTerminatingBreak) - { - c->setBreakPending(); - return false; - } - return true; -} - - - - -KviKvsTreeNodeSpecialCommandSwitchLabelMatch::KviKvsTreeNodeSpecialCommandSwitchLabelMatch(const QChar * pLocation) -: KviKvsTreeNodeSpecialCommandSwitchLabel(pLocation) -{ -} - -KviKvsTreeNodeSpecialCommandSwitchLabelMatch::~KviKvsTreeNodeSpecialCommandSwitchLabelMatch() -{ -} - -void KviKvsTreeNodeSpecialCommandSwitchLabelMatch::contextDescription(QString &szBuffer) -{ - szBuffer = "Label \"match\" For Special Command \"switch\""; -} - - -void KviKvsTreeNodeSpecialCommandSwitchLabelMatch::dump(const char * prefix) -{ - debug("%s SpecialCommandSwitchLabelMatch",prefix); - QString tmp = prefix; - tmp.append(" "); - if(m_pParameter)m_pParameter->dump(tmp.utf8().data()); - if(m_pInstruction)m_pInstruction->dump(tmp.utf8().data()); -} - -bool KviKvsTreeNodeSpecialCommandSwitchLabelMatch::execute(KviKvsRunTimeContext * c,KviKvsVariant * pRealParameter) -{ - KviKvsVariant v; - if(!m_pParameter->evaluateReadOnly(c,&v))return false; - - QString reg; - v.asString(reg); - - QRegExp rx(reg,false,true); - - QString val; - pRealParameter->asString(val); - - if(!rx.exactMatch(val))return true; // no match - - if(m_pInstruction) - { - if(!m_pInstruction->execute(c))return false; // might be a break too - } - if(m_bHasTerminatingBreak) - { - c->setBreakPending(); - return false; - } - return true; -} - - - - -KviKvsTreeNodeSpecialCommandSwitchLabelRegexp::KviKvsTreeNodeSpecialCommandSwitchLabelRegexp(const QChar * pLocation) -: KviKvsTreeNodeSpecialCommandSwitchLabel(pLocation) -{ -} - -KviKvsTreeNodeSpecialCommandSwitchLabelRegexp::~KviKvsTreeNodeSpecialCommandSwitchLabelRegexp() -{ -} - -void KviKvsTreeNodeSpecialCommandSwitchLabelRegexp::contextDescription(QString &szBuffer) -{ - szBuffer = "Label \"regexp\" For Special Command \"switch\""; -} - - -void KviKvsTreeNodeSpecialCommandSwitchLabelRegexp::dump(const char * prefix) -{ - debug("%s SpecialCommandSwitchLabelRegexp",prefix); - QString tmp = prefix; - tmp.append(" "); - if(m_pParameter)m_pParameter->dump(tmp.utf8().data()); - if(m_pInstruction)m_pInstruction->dump(tmp.utf8().data()); -} - -bool KviKvsTreeNodeSpecialCommandSwitchLabelRegexp::execute(KviKvsRunTimeContext * c,KviKvsVariant * pRealParameter) -{ - KviKvsVariant v; - if(!m_pParameter->evaluateReadOnly(c,&v))return false; - - QString reg; - v.asString(reg); - - QRegExp rx(reg,false,false); - - QString val; - pRealParameter->asString(val); - - if(!rx.exactMatch(val))return true; // no match - - if(m_pInstruction) - { - if(!m_pInstruction->execute(c))return false; // might be a break too - } - if(m_bHasTerminatingBreak) - { - c->setBreakPending(); - return false; - } - return true; -} - - - - - - -KviKvsTreeNodeSpecialCommandSwitchLabelDefault::KviKvsTreeNodeSpecialCommandSwitchLabelDefault(const QChar * pLocation) -: KviKvsTreeNodeSpecialCommandSwitchLabel(pLocation) -{ -} - -KviKvsTreeNodeSpecialCommandSwitchLabelDefault::~KviKvsTreeNodeSpecialCommandSwitchLabelDefault() -{ -} - -void KviKvsTreeNodeSpecialCommandSwitchLabelDefault::contextDescription(QString &szBuffer) -{ - szBuffer = "Label \"default\" For Special Command \"switch\""; -} - - -void KviKvsTreeNodeSpecialCommandSwitchLabelDefault::dump(const char * prefix) -{ - debug("%s SpecialCommandSwitchLabelDefault",prefix); - QString tmp = prefix; - tmp.append(" "); - if(m_pInstruction)m_pInstruction->dump(tmp.utf8().data()); -} - -bool KviKvsTreeNodeSpecialCommandSwitchLabelDefault::execute(KviKvsRunTimeContext * c,KviKvsVariant * pRealParameter) -{ - if(m_pInstruction) - { - if(!m_pInstruction->execute(c))return false; // might be a break too - } - if(m_bHasTerminatingBreak) - { - c->setBreakPending(); - return false; - } - return true; -} - - - - -KviKvsTreeNodeSpecialCommandSwitch::KviKvsTreeNodeSpecialCommandSwitch(const QChar * pLocation,KviKvsTreeNodeExpression * e) -: KviKvsTreeNodeSpecialCommand(pLocation,"switch") -{ - m_pExpression = e; - m_pExpression->setParent(this); - m_pLabels = new KviPointerList<KviKvsTreeNodeSpecialCommandSwitchLabel>; - m_pLabels->setAutoDelete(true); -} - -KviKvsTreeNodeSpecialCommandSwitch::~KviKvsTreeNodeSpecialCommandSwitch() -{ - delete m_pExpression; - delete m_pLabels; -} - -void KviKvsTreeNodeSpecialCommandSwitch::addLabel(KviKvsTreeNodeSpecialCommandSwitchLabel * l) -{ - m_pLabels->append(l); - l->setParent(this); -} - -void KviKvsTreeNodeSpecialCommandSwitch::contextDescription(QString &szBuffer) -{ - szBuffer = "Special Command \"switch\""; -} - - -void KviKvsTreeNodeSpecialCommandSwitch::dump(const char * prefix) -{ - debug("%s SpecialCommandSwitch",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pExpression->dump(tmp.utf8().data()); - for(KviKvsTreeNodeSpecialCommandSwitchLabel * l = m_pLabels->first();l;l = m_pLabels->next()) - l->dump(tmp.utf8().data()); -} - -bool KviKvsTreeNodeSpecialCommandSwitch::execute(KviKvsRunTimeContext * c) -{ - KviKvsVariant v; - if(!m_pExpression->evaluateReadOnly(c,&v))return false; - - for(KviKvsTreeNodeSpecialCommandSwitchLabel * l = m_pLabels->first();l;l = m_pLabels->next()) - { - if(!l->execute(c,&v)) - { - if(c->error())return false; - // break ? - if(c->breakPending()) - { - c->handleBreak(); - return true; - } - return false; - } - } - return true; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandswitch.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandswitch.h deleted file mode 100644 index bc1e58b4af..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandswitch.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_SPECIALCOMMANDSWITCH_H_ -#define _KVI_KVS_TREENODE_SPECIALCOMMANDSWITCH_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommandswitch.h -// Created on Fri 02 Jan 2004 13:54:00 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode.h" -#include "kvi_kvs_treenode_specialcommand.h" - -class KviKvsTreeNodeExpression; -class KviKvsTreeNodeInstruction; -class KviKvsRunTimeContext; -class KviKvsVariant; - -class KVIRC_API KviKvsTreeNodeSpecialCommandSwitchLabel : public KviKvsTreeNode -{ -public: - KviKvsTreeNodeSpecialCommandSwitchLabel(const QChar * pLocation); - ~KviKvsTreeNodeSpecialCommandSwitchLabel(); -protected: - KviKvsTreeNodeData * m_pParameter; - KviKvsTreeNodeInstruction * m_pInstruction; - bool m_bHasTerminatingBreak; -public: - void setParameter(KviKvsTreeNodeData * pParameter); - void setInstruction(KviKvsTreeNodeInstruction * pInstruction); - void setTerminatingBreak(bool b){ m_bHasTerminatingBreak = b; }; - virtual bool execute(KviKvsRunTimeContext * c,KviKvsVariant * pRealParameter) = 0; -}; - - -class KVIRC_API KviKvsTreeNodeSpecialCommandSwitchLabelCase : public KviKvsTreeNodeSpecialCommandSwitchLabel -{ -public: - KviKvsTreeNodeSpecialCommandSwitchLabelCase(const QChar * pLocation); - ~KviKvsTreeNodeSpecialCommandSwitchLabelCase(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c,KviKvsVariant * pRealParameter); -}; - - -class KVIRC_API KviKvsTreeNodeSpecialCommandSwitchLabelMatch : public KviKvsTreeNodeSpecialCommandSwitchLabel -{ -public: - KviKvsTreeNodeSpecialCommandSwitchLabelMatch(const QChar * pLocation); - ~KviKvsTreeNodeSpecialCommandSwitchLabelMatch(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c,KviKvsVariant * pRealParameter); -}; - -class KVIRC_API KviKvsTreeNodeSpecialCommandSwitchLabelRegexp : public KviKvsTreeNodeSpecialCommandSwitchLabel -{ -public: - KviKvsTreeNodeSpecialCommandSwitchLabelRegexp(const QChar * pLocation); - ~KviKvsTreeNodeSpecialCommandSwitchLabelRegexp(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c,KviKvsVariant * pRealParameter); -}; - -class KVIRC_API KviKvsTreeNodeSpecialCommandSwitchLabelDefault : public KviKvsTreeNodeSpecialCommandSwitchLabel -{ -public: - KviKvsTreeNodeSpecialCommandSwitchLabelDefault(const QChar * pLocation); - ~KviKvsTreeNodeSpecialCommandSwitchLabelDefault(); -public: - virtual void dump(const char * prefix); - virtual void contextDescription(QString &szBuffer); - virtual bool execute(KviKvsRunTimeContext * c,KviKvsVariant * pRealParameter); -}; - - - -class KVIRC_API KviKvsTreeNodeSpecialCommandSwitch : public KviKvsTreeNodeSpecialCommand -{ -public: - KviKvsTreeNodeSpecialCommandSwitch(const QChar * pLocation,KviKvsTreeNodeExpression * e); - ~KviKvsTreeNodeSpecialCommandSwitch(); -private: - KviKvsTreeNodeExpression * m_pExpression; // can't be 0 - KviPointerList<KviKvsTreeNodeSpecialCommandSwitchLabel> * m_pLabels; //can't be 0 -public: - void addLabel(KviKvsTreeNodeSpecialCommandSwitchLabel * l); - bool isEmpty(){ return m_pLabels->isEmpty(); }; - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -#endif //!_KVI_KVS_TREENODE_SPECIALCOMMANDSWITCH_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandunset.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandunset.cpp deleted file mode 100644 index 862b1ac169..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandunset.cpp +++ /dev/null @@ -1,74 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommandunset.cpp -// Created on Thu 14 Apr 2005 02:44:00 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_specialcommandunset.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_kvs_rwevaluationresult.h" -#include "kvi_locale.h" - -KviKvsTreeNodeSpecialCommandUnset::KviKvsTreeNodeSpecialCommandUnset(const QChar * pLocation,KviPointerList<KviKvsTreeNodeVariable> * pVariableList) -: KviKvsTreeNodeSpecialCommand(pLocation,"unset") -{ - m_pVariableList = pVariableList; - for(KviKvsTreeNodeVariable * pVar = m_pVariableList->first();pVar;pVar = m_pVariableList->next()) - { - pVar->setParent(this); - } -} - -KviKvsTreeNodeSpecialCommandUnset::~KviKvsTreeNodeSpecialCommandUnset() -{ - delete m_pVariableList; -} - -void KviKvsTreeNodeSpecialCommandUnset::contextDescription(QString &szBuffer) -{ - szBuffer = "Special Command \"unset\""; -} - -void KviKvsTreeNodeSpecialCommandUnset::dump(const char * prefix) -{ - debug("%s SpecialCommandUnset",prefix); - QString tmp = prefix; - tmp.append(" "); - for(KviKvsTreeNodeVariable * pVar = m_pVariableList->first();pVar;pVar = m_pVariableList->next()) - { - pVar->dump(tmp.utf8().data()); - } -} - -bool KviKvsTreeNodeSpecialCommandUnset::execute(KviKvsRunTimeContext * c) -{ - for(KviKvsTreeNodeVariable * pVar = m_pVariableList->first();pVar;pVar = m_pVariableList->next()) - { - KviKvsRWEvaluationResult * r = pVar->evaluateReadWrite(c); - if(!r)return false; - r->result()->setNothing(); - delete r; // this will remove the data from its container - } - return true; -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandunset.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandunset.h deleted file mode 100644 index 858f2d780f..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandunset.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_SPECIALCOMMANDUNSET_H_ -#define _KVI_KVS_TREENODE_SPECIALCOMMANDUNSET_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommandunset.h -// Created on Thu 14 Apr 2005 02:44:00 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2005 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_specialcommand.h" -#include "kvi_kvs_treenode_variable.h" - -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeSpecialCommandUnset : public KviKvsTreeNodeSpecialCommand -{ -public: - KviKvsTreeNodeSpecialCommandUnset(const QChar * pLocation,KviPointerList<KviKvsTreeNodeVariable> * pVarList); - ~KviKvsTreeNodeSpecialCommandUnset(); -private: - KviPointerList<KviKvsTreeNodeVariable> * m_pVariableList; -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -#endif //!_KVI_KVS_TREENODE_SPECIALCOMMANDUNSET_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandwhile.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandwhile.cpp deleted file mode 100644 index 43dba5b640..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandwhile.cpp +++ /dev/null @@ -1,97 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommandwhile.cpp -// Created on Thu 06 Nov 2003 11:58:43 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_specialcommandwhile.h" -#include "kvi_kvs_treenode_expression.h" -#include "kvi_kvs_treenode_instruction.h" -#include "kvi_kvs_runtimecontext.h" -#include "kvi_locale.h" - -KviKvsTreeNodeSpecialCommandWhile::KviKvsTreeNodeSpecialCommandWhile(const QChar * pLocation,KviKvsTreeNodeExpression * e,KviKvsTreeNodeInstruction * i) -: KviKvsTreeNodeSpecialCommand(pLocation,"while") -{ -#ifdef COMPILE_NEW_KVS - m_pExpression = e; - m_pExpression->setParent(this); - m_pInstruction = i; - if(i)m_pInstruction->setParent(this); -#endif -} - -KviKvsTreeNodeSpecialCommandWhile::~KviKvsTreeNodeSpecialCommandWhile() -{ -#ifdef COMPILE_NEW_KVS - delete m_pExpression; - if(m_pInstruction)delete m_pInstruction; -#endif -} - -void KviKvsTreeNodeSpecialCommandWhile::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Special Command \"while\""; -#endif -} - -void KviKvsTreeNodeSpecialCommandWhile::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s SpecialCommandWhile",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pExpression->dump(tmp); - if(m_pInstruction)m_pInstruction->dump(tmp); -#endif -} - -bool KviKvsTreeNodeSpecialCommandWhile::execute(KviKvsRunTimeContext * c) -{ -#ifdef COMPILE_NEW_KVS - for(;;) - { - KviKvsVariant v; - if(!m_pExpression->evaluateReadOnly(c,&v))return false; - - if(!v.asBoolean())break; - - if(m_pInstruction) - { - if(!m_pInstruction->execute(c)) - { - if(c->error())return false; - - if(c->breakPending()) - { - c->handleBreak(); - return true; - } - return false; - } - } - } -#endif - return true; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandwhile.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandwhile.h deleted file mode 100644 index 6e2457bfa7..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_specialcommandwhile.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_SPECIALCOMMANDWHILE_H_ -#define _KVI_KVS_TREENODE_SPECIALCOMMANDWHILE_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_specialcommandwhile.h -// Created on Thu 06 Nov 2003 11:58:43 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_specialcommand.h" - -class KviKvsTreeNodeExpression; -class KviKvsTreeNodeInstruction; -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeSpecialCommandWhile : public KviKvsTreeNodeSpecialCommand -{ -public: - KviKvsTreeNodeSpecialCommandWhile(const QChar * pLocation,KviKvsTreeNodeExpression * e,KviKvsTreeNodeInstruction * i); - ~KviKvsTreeNodeSpecialCommandWhile(); -private: - KviKvsTreeNodeExpression * m_pExpression; // can't be 0 - KviKvsTreeNodeInstruction * m_pInstruction; // may be 0 -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - - -#endif //!_KVI_KVS_TREENODE_SPECIALCOMMANDWHILE_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_stringcast.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_stringcast.cpp deleted file mode 100644 index f2b330522a..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_stringcast.cpp +++ /dev/null @@ -1,67 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_stringcast.cpp -// Created on Mon 26 Jun 2006 15:17:33 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2006 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_stringcast.h" -#include "kvi_qstring.h" - -KviKvsTreeNodeStringCast::KviKvsTreeNodeStringCast(const QChar * pLocation,KviKvsTreeNodeData * pChildData) -: KviKvsTreeNodeData(pLocation) -{ - m_pChildData = pChildData; - m_pChildData->setParent(this); -} - - -KviKvsTreeNodeStringCast::~KviKvsTreeNodeStringCast() -{ - delete m_pChildData; -} - -bool KviKvsTreeNodeStringCast::evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ - if(!m_pChildData->evaluateReadOnly(c,pBuffer))return false; - if(!pBuffer->isString()) - { - QString tmp; - pBuffer->asString(tmp); - pBuffer->setString(tmp); - } - return true; -} - -void KviKvsTreeNodeStringCast::contextDescription(QString &szBuffer) -{ - szBuffer = "String Cast"; -} - -void KviKvsTreeNodeStringCast::dump(const char * prefix) -{ - debug("%s StringCast",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pChildData->dump(tmp.utf8().data()); -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_stringcast.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_stringcast.h deleted file mode 100644 index 5b729cc012..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_stringcast.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_STRINGCAST_H_ -#define _KVI_KVS_TREENODE_STRINGCAST_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_stringcast.h -// Created on Mon 26 Jun 2006 15:17:33 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2006 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_treenode_data.h" - -class KVIRC_API KviKvsTreeNodeStringCast : public KviKvsTreeNodeData -{ -public: - KviKvsTreeNodeStringCast(const QChar * pLocation,KviKvsTreeNodeData * pChildData); - ~KviKvsTreeNodeStringCast(); -protected: - KviKvsTreeNodeData * m_pChildData; -public: - virtual bool evaluateReadOnly(KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); - virtual void contextDescription(QString &szBuffer); - - virtual void dump(const char * prefix); -}; - - -#endif //!_KVI_KVS_TREENODE_STRINGCAST_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_switchlist.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_switchlist.cpp deleted file mode 100644 index e9acf77c89..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_switchlist.cpp +++ /dev/null @@ -1,170 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_switchlist.cpp -// Created on Tue 07 Oct 2003 02:06:53 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_switchlist.h" -#include "kvi_kvs_runtimecontext.h" - -KviKvsTreeNodeSwitchList::KviKvsTreeNodeSwitchList(const QChar * pLocation) -: KviKvsTreeNode(pLocation) -{ - m_pShortSwitchDict = 0; - m_pLongSwitchDict = 0; -} - -KviKvsTreeNodeSwitchList::~KviKvsTreeNodeSwitchList() -{ - if(m_pShortSwitchDict)delete m_pShortSwitchDict; - if(m_pLongSwitchDict)delete m_pLongSwitchDict; -} - -void KviKvsTreeNodeSwitchList::contextDescription(QString &szBuffer) -{ - szBuffer = "Switch List Evaluation"; -} - - -void KviKvsTreeNodeSwitchList::dump(const char * prefix) -{ - debug("%s SwitchList",prefix); - if(m_pShortSwitchDict) - { - KviPointerHashTableIterator<int,KviKvsTreeNodeData> it(*m_pShortSwitchDict); - while(it.current()) - { - QString tmp = prefix; - tmp.append(" Sw("); - QChar c((unsigned short)it.currentKey()); - tmp.append(c); - tmp.append("): "); - it.current()->dump(tmp.utf8().data()); - ++it; - } - } - if(m_pLongSwitchDict) - { - KviPointerHashTableIterator<QString,KviKvsTreeNodeData> it(*m_pLongSwitchDict); - while(it.current()) - { - QString tmp = prefix; - tmp.append(" Sw("); - tmp.append(it.currentKey()); - tmp.append("): "); - it.current()->dump(tmp.utf8().data()); - ++it; - } - } -} - -void KviKvsTreeNodeSwitchList::addShort(int iShortKey,KviKvsTreeNodeData * p) -{ - if(!m_pShortSwitchDict) - { - m_pShortSwitchDict = new KviPointerHashTable<int,KviKvsTreeNodeData>(11); - m_pShortSwitchDict->setAutoDelete(true); - } - - m_pShortSwitchDict->replace(iShortKey,p); - p->setParent(this); -} - -void KviKvsTreeNodeSwitchList::addLong(const QString &szLongKey,KviKvsTreeNodeData * p) -{ - if(!m_pLongSwitchDict) - { - m_pLongSwitchDict = new KviPointerHashTable<QString,KviKvsTreeNodeData>(11); - m_pLongSwitchDict->setAutoDelete(true); - } - - m_pLongSwitchDict->replace(szLongKey,p); - p->setParent(this); -} - - -bool KviKvsTreeNodeSwitchList::evaluate(KviKvsRunTimeContext * c,KviKvsSwitchList * pSwList) -{ - pSwList->clear(); - - if(m_pShortSwitchDict) - { - KviPointerHashTableIterator<int,KviKvsTreeNodeData> it(*m_pShortSwitchDict); - while(KviKvsTreeNodeData * d = it.current()) - { - KviKvsVariant * v = new KviKvsVariant(); - if(!d->evaluateReadOnly(c,v)) - { - delete v; - return false; - } - pSwList->addShort(it.currentKey(),v); - ++it; - } - } - if(m_pLongSwitchDict) - { - KviPointerHashTableIterator<QString,KviKvsTreeNodeData> it(*m_pLongSwitchDict); - while(KviKvsTreeNodeData * d = it.current()) - { - KviKvsVariant * v = new KviKvsVariant(); - if(!d->evaluateReadOnly(c,v)) - { - delete v; - return false; - } - pSwList->addLong(it.currentKey(),v); - ++it; - } - } - return true; -} - -KviKvsTreeNodeData * KviKvsTreeNodeSwitchList::getStandardRebindingSwitch() -{ - KviKvsTreeNodeData * d; - if(m_pShortSwitchDict) - { - d = m_pShortSwitchDict->find('r'); - if(d) - { - m_pShortSwitchDict->setAutoDelete(false); - m_pShortSwitchDict->remove('r'); - m_pShortSwitchDict->setAutoDelete(true); - return d; - } - } - if(m_pLongSwitchDict) - { - d = m_pLongSwitchDict->find("rebind"); - if(d) - { - m_pLongSwitchDict->setAutoDelete(false); - m_pLongSwitchDict->remove("rebind"); - m_pLongSwitchDict->setAutoDelete(true); - return d; - } - } - return 0; -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_switchlist.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_switchlist.h deleted file mode 100644 index 88ea02df0b..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_switchlist.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_SWITCHLIST_H_ -#define _KVI_KVS_TREENODE_SWITCHLIST_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_switchlist.h -// Created on Tue 07 Oct 2003 02:06:53 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" - -#include "kvi_pointerhashtable.h" -#include "kvi_pointerhashtable.h" - -#include "kvi_kvs_treenode_base.h" -#include "kvi_kvs_treenode_data.h" -#include "kvi_kvs_switchlist.h" - -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeSwitchList : public KviKvsTreeNode -{ -public: - KviKvsTreeNodeSwitchList(const QChar * pLocation); - ~KviKvsTreeNodeSwitchList(); -public: - KviPointerHashTable<int,KviKvsTreeNodeData> * m_pShortSwitchDict; - KviPointerHashTable<QString,KviKvsTreeNodeData> *m_pLongSwitchDict; -public: - void addShort(int iShortKey,KviKvsTreeNodeData * p); - void addLong(const QString &szLongKey,KviKvsTreeNodeData * p); - bool isEmpty(){ return (m_pShortSwitchDict == 0) && (m_pLongSwitchDict == 0); }; - virtual void dump(const char * prefix); - virtual void contextDescription(QString &szBuffer); - - KviKvsTreeNodeData * getStandardRebindingSwitch(); - - bool evaluate(KviKvsRunTimeContext * c,KviKvsSwitchList * pSwList); -}; - - - -#endif //!_KVI_KVS_TREENODE_SWITCHLIST_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_thisobjectfunctioncall.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_thisobjectfunctioncall.cpp deleted file mode 100644 index 1150708948..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_thisobjectfunctioncall.cpp +++ /dev/null @@ -1,73 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_thisobjectfunctioncall.cpp -// Created on Tue 07 Oct 2003 03:28:10 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_thisobjectfunctioncall.h" -#include "kvi_kvs_object.h" - - -KviKvsTreeNodeThisObjectFunctionCall::KviKvsTreeNodeThisObjectFunctionCall(const QChar * pLocation,const QString &szFncName,KviKvsTreeNodeDataList * pParams) -: KviKvsTreeNodeObjectFunctionCall(pLocation,szFncName,pParams) -{ -} - -KviKvsTreeNodeThisObjectFunctionCall::~KviKvsTreeNodeThisObjectFunctionCall() -{ -} - -void KviKvsTreeNodeThisObjectFunctionCall::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "\"This\" Object Function Call \""; - szBuffer += m_szFunctionName; - szBuffer += "\""; -#endif -} - -void KviKvsTreeNodeThisObjectFunctionCall::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s ThisObjectFunctionCall(%s)",prefix,m_szFunctionName.utf8().data()); - QString tmp = prefix; - tmp.append(" "); - m_pParams->dump(tmp.utf8().data()); -#endif -} - - -bool KviKvsTreeNodeThisObjectFunctionCall::evaluateReadOnlyInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer) -{ -#ifdef COMPILE_NEW_KVS - KviKvsVariantList l; - if(!m_pParams->evaluate(c,&l))return false; - pBuffer->setNothing(); - c->setDefaultReportLocation(this); - return o->callFunction(c->thisObject(),m_szFunctionName,QString::null,c,pBuffer,&l); -#else - return false; -#endif -} - - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_thisobjectfunctioncall.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_thisobjectfunctioncall.h deleted file mode 100644 index 9b2e736dd2..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_thisobjectfunctioncall.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_THISOBJECTFUNCTIONCALL_H_ -#define _KVI_KVS_TREENODE_THISOBJECTFUNCTIONCALL_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_thisobjectfunctioncall.h -// Created on Tue 07 Oct 2003 03:28:10 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_datalist.h" -#include "kvi_kvs_treenode_objectfunctioncall.h" - - -class KviKvsObject; -class KviKvsRunTimeContext; -class KviKvsVariant; - -class KVIRC_API KviKvsTreeNodeThisObjectFunctionCall : public KviKvsTreeNodeObjectFunctionCall -{ -public: - KviKvsTreeNodeThisObjectFunctionCall(const QChar * pLocation,const QString &szFncName,KviKvsTreeNodeDataList * pParams); - ~KviKvsTreeNodeThisObjectFunctionCall(); -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool evaluateReadOnlyInObjectScope(KviKvsObject * o,KviKvsRunTimeContext * c,KviKvsVariant * pBuffer); -}; - - -#endif //!_KVI_KVS_TREENODE_THISOBJECTFUNCTIONCALL_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_variable.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_variable.cpp deleted file mode 100644 index 17ea817223..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_variable.cpp +++ /dev/null @@ -1,54 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_variable.cpp -// Created on Thu 16 Oct 2003 22:34:59 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_variable.h" - -KviKvsTreeNodeVariable::KviKvsTreeNodeVariable(const QChar * pLocation,const QString &szIdentifier) -: KviKvsTreeNodeData(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_szIdentifier = szIdentifier; -#endif -} - -KviKvsTreeNodeVariable::~KviKvsTreeNodeVariable() -{ -} - -bool KviKvsTreeNodeVariable::isReadOnly() -{ - return false; -} - -bool KviKvsTreeNodeVariable::canEvaluateInObjectScope() -{ - return false; -} - -bool KviKvsTreeNodeVariable::canEvaluateToObjectReference() -{ - return true; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_variable.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_variable.h deleted file mode 100644 index 36fc2a64b8..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_variable.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_VARIABLE_H_ -#define _KVI_KVS_TREENODE_VARIABLE_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_variable.h -// Created on Thu 16 Oct 2003 22:34:59 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_kvs_treenode_data.h" -#include "kvi_kvs_variant.h" - -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeVariable : public KviKvsTreeNodeData -{ -public: - KviKvsTreeNodeVariable(const QChar * pLocation,const QString &szIdentifier); - ~KviKvsTreeNodeVariable(); -protected: - QString m_szIdentifier; -protected: - virtual bool isReadOnly(); - virtual bool canEvaluateInObjectScope(); - virtual bool canEvaluateToObjectReference(); -}; - -#endif //!_KVI_KVS_TREENODE_VARIABLE_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_voidfunctioncall.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_voidfunctioncall.cpp deleted file mode 100644 index ccd59b1cac..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_voidfunctioncall.cpp +++ /dev/null @@ -1,66 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_treenode_voidfunctioncall.cpp -// Created on Thu 09 Oct 2003 01:47:16 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_treenode_voidfunctioncall.h" -#include "kvi_kvs_runtimecontext.h" - -KviKvsTreeNodeVoidFunctionCall::KviKvsTreeNodeVoidFunctionCall(const QChar * pLocation,KviKvsTreeNodeFunctionCall * r) -: KviKvsTreeNodeInstruction(pLocation) -{ -#ifdef COMPILE_NEW_KVS - m_pFunctionCall = r; -#endif -} - -KviKvsTreeNodeVoidFunctionCall::~KviKvsTreeNodeVoidFunctionCall() -{ -#ifdef COMPILE_NEW_KVS - delete m_pFunctionCall; -#endif -} - -void KviKvsTreeNodeVoidFunctionCall::contextDescription(QString &szBuffer) -{ -#ifdef COMPILE_NEW_KVS - szBuffer = "Void Function Call"; -#endif -} - -void KviKvsTreeNodeVoidFunctionCall::dump(const char * prefix) -{ -#ifdef COMPILE_NEW_KVS - debug("%s VoidFunctionCall",prefix); - QString tmp = prefix; - tmp.append(" "); - m_pFunctionCall->dump(tmp.utf8().data()); -#endif -} - -bool KviKvsTreeNodeVoidFunctionCall::execute(KviKvsRunTimeContext * c) -{ - KviKvsVariant v; - return m_pFunctionCall->evaluateReadOnly(c,&v); -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_voidfunctioncall.h b/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_voidfunctioncall.h deleted file mode 100644 index 68b5e9f411..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_treenode_voidfunctioncall.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _KVI_KVS_TREENODE_VOIDFUNCTIONCALL_H_ -#define _KVI_KVS_TREENODE_VOIDFUNCTIONCALL_H_ -//============================================================================= -// -// File : kvi_kvs_treenode_voidfunctioncall.h -// Created on Thu 09 Oct 2003 01:47:16 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_kvs_treenode_instruction.h" -#include "kvi_kvs_treenode_functioncall.h" - -class KviKvsRunTimeContext; - -class KVIRC_API KviKvsTreeNodeVoidFunctionCall : public KviKvsTreeNodeInstruction -{ -public: - KviKvsTreeNodeVoidFunctionCall(const QChar * pLocation,KviKvsTreeNodeFunctionCall * r); - ~KviKvsTreeNodeVoidFunctionCall(); -protected: - KviKvsTreeNodeFunctionCall * m_pFunctionCall; // may be scope operator or direct function call -public: - virtual void contextDescription(QString &szBuffer); - virtual void dump(const char * prefix); - virtual bool execute(KviKvsRunTimeContext * c); -}; - -#endif //!_KVI_KVS_TREENODE_VOIDFUNCTIONCALL_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_types.h b/3.4.0/src/kvirc/kvs/kvi_kvs_types.h deleted file mode 100644 index e635f597f5..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_types.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef _KVI_KVS_TYPES_H_ -#define _KVI_KVS_TYPES_H_ -//============================================================================= -// -// File : kvi_kvs_types.h -// Creation date : Sun 29 May 2005 05.25 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2005 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_inttypes.h" - -// we want to have 64 bit arithmetics, if possible... - -typedef void * kvs_hobject_t; -typedef kvi_i64_t kvs_int_t; -typedef kvi_u64_t kvs_uint_t; -typedef double kvs_real_t; - - -#endif //!_KVI_KVS_TYPES_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_useraction.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_useraction.cpp deleted file mode 100644 index eb756d2927..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_useraction.cpp +++ /dev/null @@ -1,277 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_useraction.cpp -// Created on Tue 07 Dec 2004 02:00:24 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_useraction.h" -#include "kvi_kvs_script.h" -#include "kvi_config.h" -#include "kvi_iconmanager.h" -#include "kvi_actionmanager.h" -#include "kvi_kvs_script.h" -#include "kvi_window.h" -#include "kvi_cmdformatter.h" - -KviKvsUserAction::KviKvsUserAction(QObject * pParent, - const QString &szName, - const QString &szScriptCode, - const QString &szVisibleNameCode, - const QString &szDescriptionCode, - const QString &szCategory, - const QString &szBigIcon, - const QString &szSmallIcon, - unsigned int uFlags, - const QString &szKeySequence) - : KviKvsAction(pParent,szName,szScriptCode,szVisibleNameCode,szDescriptionCode,0,szBigIcon,0,uFlags,szKeySequence) -{ - m_szSmallIcon = szSmallIcon; - - QString szKvsName = "action::"; - szKvsName += szName; - - QString szTmp = szKvsName; - szTmp += "::description"; - m_pDescriptionScript = new KviKvsScript(szTmp,szDescriptionCode,KviKvsScript::Parameter); - - szTmp = szKvsName; - szTmp += "::label"; - m_pVisibleNameScript = new KviKvsScript(szTmp,szVisibleNameCode,KviKvsScript::Parameter); - - m_szCategory = szCategory; - m_pCategory = KviActionManager::instance()->category(szCategory); -} - - -KviKvsUserAction::KviKvsUserAction(QObject * pParent) - : KviKvsAction(pParent,QString::null,QString::null,QString::null,QString::null) -{ - // needs loading! - m_pDescriptionScript = 0; - m_pVisibleNameScript = 0; -} - -KviKvsUserAction::~KviKvsUserAction() -{ - if(m_pDescriptionScript)delete m_pDescriptionScript; - if(m_pVisibleNameScript)delete m_pVisibleNameScript; -} - -KviKvsUserAction * KviKvsUserAction::createInstance(QObject * pParent, - const QString &szName, - const QString &szScriptCode, - const QString &szVisibleNameCode, - const QString &szDescriptionCode, - const QString &szCategory, - const QString &szBigIcon, - const QString &szSmallIcon, - unsigned int uFlags, - const QString &szKeySequence) -{ - return new KviKvsUserAction(pParent,szName,szScriptCode,szVisibleNameCode,szDescriptionCode,szCategory,szBigIcon,szSmallIcon,uFlags,szKeySequence); -} - - -void KviKvsUserAction::exportToKvs(QString &szBuffer) -{ - exportToKvs(szBuffer,m_szName,scriptCode(),visibleNameCode(),descriptionCode(),m_szCategory,m_szBigIcon,m_szSmallIcon,m_uFlags,m_szKeySequence); -} - -void KviKvsUserAction::exportToKvs(QString &szBuffer, - const QString &szName, - const QString &szScriptCode, - const QString &szVisibleName, - const QString &szDescription, - const QString &szCategory, - const QString &szBigIcon, - const QString &szSmallIcon, - unsigned int uFlags, - const QString &szKeySequence) -{ - szBuffer += "action.create"; - if(uFlags & NeedsContext) - { - szBuffer += " -i"; - if(uFlags & NeedsConnection) - { - szBuffer += " -c"; - if(uFlags & EnableAtLogin)szBuffer += " -l"; - } - } - if(uFlags & InternalWindowMask) - { - QString szWins; - if(uFlags & WindowConsole)szWins += "x"; - if(uFlags & WindowChannel)szWins += "c"; - if(uFlags & WindowQuery)szWins += "q"; - if(uFlags & WindowDccChat)szWins += "d"; - szBuffer += " -w="; - szBuffer += szWins; - if(uFlags & (WindowConsole | WindowChannel | WindowQuery)) - { - if(uFlags & WindowOnlyIfUsersSelected) - szBuffer += " -s"; - } - } - if(!szCategory.isEmpty()) - { - szBuffer += " -t="; - szBuffer += szCategory; - } - if(!szKeySequence.isEmpty()) - { - szBuffer += " -k=\""; - szBuffer += szKeySequence; - szBuffer += "\""; - } - szBuffer += " (\""; - szBuffer += szName; - szBuffer += "\","; - QString tmp = szVisibleName; - if(tmp.contains('$')) - { - szBuffer += tmp; - szBuffer += ","; - } else { - tmp.replace("\"","\\\""); - szBuffer += "\""; - szBuffer += tmp; - szBuffer += "\","; - } - tmp = szDescription; - if(tmp.contains('$')) - { - szBuffer += tmp; - szBuffer += ",\""; - } else { - tmp.replace("\"","\\\""); - szBuffer += "\""; - szBuffer += tmp; - szBuffer += "\",\""; - } - szBuffer += szBigIcon; - szBuffer += "\",\""; - szBuffer += szSmallIcon; - szBuffer += "\")\n"; - tmp = szScriptCode; - KviCommandFormatter::blockFromBuffer(tmp); - szBuffer += tmp; - szBuffer += "\n"; -} - - -// FIXME: Cache this stuff ?? - -const QString & KviKvsUserAction::visibleName() -{ - if(!m_pVisibleNameScript)return m_szVisibleName; - if(!m_pVisibleNameScript->run(g_pActiveWindow,0,m_szVisibleName))m_szVisibleName = m_pVisibleNameScript->code(); - return m_szVisibleName; -} - -const QString & KviKvsUserAction::description() -{ - if(!m_pDescriptionScript)return m_szDescription; - if(!m_pDescriptionScript->run(g_pActiveWindow,0,m_szDescription))m_szDescription = m_pDescriptionScript->code(); - return m_szDescription; -} - -const QString & KviKvsUserAction::visibleNameCode() -{ - if(!m_pVisibleNameScript)return m_szVisibleName; - return m_pVisibleNameScript->code(); -} - -const QString & KviKvsUserAction::descriptionCode() -{ - if(!m_pDescriptionScript)return m_szDescription; - return m_pDescriptionScript->code(); -} - -QPixmap * KviKvsUserAction::smallIcon() -{ - return g_pIconManager->getImage(m_szSmallIcon.utf8().data()); -} - -bool KviKvsUserAction::isKviUserActionNeverOverrideThis() -{ - return true; -} - -bool KviKvsUserAction::load(KviConfig * cfg) -{ - m_szName = cfg->group(); - if(m_szName.isEmpty())return false; - m_szVisibleName = cfg->readQStringEntry("VisibleName"); - if(m_szVisibleName.isEmpty())return false; - QString szKvsName = "action::"; - szKvsName += m_szName; - QString szTmp = szKvsName; - szTmp += "::label"; - - if(m_pVisibleNameScript)delete m_pVisibleNameScript; - m_pVisibleNameScript = new KviKvsScript(szTmp,m_szVisibleName,KviKvsScript::Parameter); - - if(m_szVisibleName.isEmpty())return false; - m_szDescription = cfg->readQStringEntry("Description"); - szTmp = szKvsName; - szTmp += "::description"; - - if(m_pDescriptionScript)delete m_pDescriptionScript; - m_pDescriptionScript = new KviKvsScript(szTmp,m_szDescription,KviKvsScript::Parameter); - - - m_szBigIcon = cfg->readQStringEntry("BigIcon"); - m_szSmallIcon = cfg->readQStringEntry("SmallIcon"); - m_szKeySequence = cfg->readQStringEntry("KeySequence"); - m_szCategory = cfg->readQStringEntry("Category"); - m_pCategory = KviActionManager::instance()->category(m_szCategory); - m_uFlags = cfg->readUIntEntry("Flags",0); - - QString szCode = cfg->readQStringEntry("Code"); - if(szCode.isEmpty())return false; - - if(m_pScript)delete m_pScript; - QString tmp = KVI_KVS_ACTION_SCRIPT_NAME_PREFIX; - tmp += m_szName; - m_pScript = new KviKvsScript(tmp,szCode); - - return true; -} - -void KviKvsUserAction::save(KviConfig * cfg) -{ - cfg->setGroup(m_szName); - if(m_pVisibleNameScript)cfg->writeEntry("VisibleName",m_pVisibleNameScript->code()); - if(m_pDescriptionScript) - { - if(!m_pDescriptionScript->code().isEmpty())cfg->writeEntry("Description",m_pDescriptionScript->code()); - } - if(!m_szBigIcon.isEmpty())cfg->writeEntry("BigIcon",m_szBigIcon); - if(!m_szSmallIcon.isEmpty())cfg->writeEntry("SmallIcon",m_szSmallIcon); - if(!m_szCategory.isEmpty())cfg->writeEntry("Category",m_szCategory); - if(!m_szKeySequence.isEmpty())cfg->writeEntry("KeySequence",m_szKeySequence); - if(m_uFlags != 0)cfg->writeEntry("Flags",m_uFlags); - cfg->writeEntry("Code",m_pScript->code()); -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_useraction.h b/3.4.0/src/kvirc/kvs/kvi_kvs_useraction.h deleted file mode 100644 index d6f17d8691..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_useraction.h +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef _KVI_KVS_USERACTION_H_ -#define _KVI_KVS_USERACTION_H_ -//============================================================================= -// -// File : kvi_kvs_useraction.h -// Created on Tue 07 Dec 2004 02:00:24 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_kvs_action.h" - -class KviConfig; -class KviKvsScript; - -class KVIRC_API KviKvsUserAction : public KviKvsAction -{ - friend class KviActionManager; - Q_OBJECT -public: - KviKvsUserAction(QObject * pParent, - const QString &szName, - const QString &szScriptCode, - const QString &szVisibleNameCode, - const QString &szDescriptionCode, - const QString &szCategory, - const QString &szBigIcon, - const QString &szSmallIcon, - unsigned int uFlags, - const QString &szKeySequence = QString::null); - KviKvsUserAction(QObject * pParent); - ~KviKvsUserAction(); - - // Static allocator function. - // This MUST be used by the modules to allocate action structures - // instead of the new operator. - // See kvi_heapobject.cpp for an explaination. - static KviKvsUserAction * createInstance(QObject * pParent, - const QString &szName, - const QString &szScriptCode, - const QString &szVisibleNameCode, - const QString &szDescriptionCode, - const QString &szCategory, - const QString &szBigIcon, - const QString &szSmallIcon, - unsigned int uFlags, - const QString &szKeySequence = QString::null); - void suicide() { delete this; }; -protected: - QString m_szSmallIcon; - QString m_szCategory; - KviKvsScript * m_pDescriptionScript; - KviKvsScript * m_pVisibleNameScript; -protected: - virtual bool isKviUserActionNeverOverrideThis(); - bool load(KviConfig * cfg); - void save(KviConfig * cfg); -public: - virtual const QString & visibleName(); - virtual const QString & description(); - const QString & visibleNameCode(); - const QString & descriptionCode(); - virtual QPixmap * smallIcon(); - const QString & category(){ return m_szCategory; }; - const QString & smallIconString(){ return m_szSmallIcon; }; - static void exportToKvs(QString &szBuffer, - const QString &szName, - const QString &szScriptCode, - const QString &szVisibleName, - const QString &szDescription, - const QString &szCategory, - const QString &szBigIcon, - const QString &szSmallIcon, - unsigned int uFlags, - const QString &szKeySequence); - void exportToKvs(QString &szBuffer); -}; - - -#endif //!_KVI_KVS_USERACTION_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_variant.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_variant.cpp deleted file mode 100644 index 1d1ced6296..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_variant.cpp +++ /dev/null @@ -1,1615 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_variant.cpp -// Created on Tue 07 Oct 2003 04:01:19 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_variant.h" -#include "kvi_kvs_arraycast.h" -#include "kvi_kvs_hash.h" -#include "kvi_kvs_array.h" - -#include <math.h> - -KviKvsVariant::KviKvsVariant() -{ - m_pData = 0; -} - -KviKvsVariant::KviKvsVariant(QString * pString) -{ - m_pData = new KviKvsVariantData; - m_pData->m_eType = KviKvsVariantData::String; - m_pData->m_uRefs = 1; - m_pData->m_u.pString = pString; -} - -KviKvsVariant::KviKvsVariant(const QString &szString) -{ - m_pData = new KviKvsVariantData; - m_pData->m_eType = KviKvsVariantData::String; - m_pData->m_uRefs = 1; - m_pData->m_u.pString = new QString(szString); -} - -KviKvsVariant::KviKvsVariant(const char * szString) -{ - m_pData = new KviKvsVariantData; - m_pData->m_eType = KviKvsVariantData::String; - m_pData->m_uRefs = 1; - m_pData->m_u.pString = new QString(QString::fromUtf8(szString)); -} - - -KviKvsVariant::KviKvsVariant(KviKvsArray * pArray) -{ - m_pData = new KviKvsVariantData; - m_pData->m_eType = KviKvsVariantData::Array; - m_pData->m_uRefs = 1; - m_pData->m_u.pArray = pArray; -} - -KviKvsVariant::KviKvsVariant(KviKvsHash * pHash) -{ - m_pData = new KviKvsVariantData; - m_pData->m_eType = KviKvsVariantData::Hash; - m_pData->m_uRefs = 1; - m_pData->m_u.pHash = pHash; -} - -KviKvsVariant::KviKvsVariant(kvs_real_t * pReal) -{ - m_pData = new KviKvsVariantData; - m_pData->m_eType = KviKvsVariantData::Real; - m_pData->m_uRefs = 1; - m_pData->m_u.pReal = pReal; -} - -KviKvsVariant::KviKvsVariant(kvs_real_t dReal) -{ - m_pData = new KviKvsVariantData; - m_pData->m_eType = KviKvsVariantData::Real; - m_pData->m_uRefs = 1; - m_pData->m_u.pReal = new kvs_real_t; - *(m_pData->m_u.pReal) = dReal; -} - -KviKvsVariant::KviKvsVariant(bool bBoolean) -{ - m_pData = new KviKvsVariantData; - m_pData->m_eType = KviKvsVariantData::Boolean; - m_pData->m_uRefs = 1; - m_pData->m_u.bBoolean = bBoolean; -} - -KviKvsVariant::KviKvsVariant(kvs_int_t iInteger) -{ - m_pData = new KviKvsVariantData; - m_pData->m_eType = KviKvsVariantData::Integer; - m_pData->m_uRefs = 1; - m_pData->m_u.iInteger = iInteger; -} - -KviKvsVariant::KviKvsVariant(kvs_hobject_t hObject) -{ - m_pData = new KviKvsVariantData; - m_pData->m_eType = KviKvsVariantData::HObject; - m_pData->m_uRefs = 1; - m_pData->m_u.hObject = hObject; -} - -KviKvsVariant::KviKvsVariant(const KviKvsVariant &v) -{ - m_pData = v.m_pData; - if(m_pData)m_pData->m_uRefs++; -} - -#define DELETE_VARIANT_CONTENTS \ - switch(m_pData->m_eType) \ - { \ - case KviKvsVariantData::Array: delete m_pData->m_u.pArray; break; \ - case KviKvsVariantData::Hash: delete m_pData->m_u.pHash; break; \ - case KviKvsVariantData::String: delete m_pData->m_u.pString; break; \ - case KviKvsVariantData::Real: delete m_pData->m_u.pReal; break; \ - default: /* make gcc happy */ break; \ - } - -#define DETACH_CONTENTS \ - if(m_pData) \ - { \ - if(m_pData->m_uRefs <= 1) \ - { \ - DELETE_VARIANT_CONTENTS \ - delete m_pData; \ - } else { \ - m_pData->m_uRefs--; \ - } \ - } - -#define RENEW_VARIANT_DATA \ - if(m_pData) \ - { \ - if(m_pData->m_uRefs > 1) \ - { \ - m_pData->m_uRefs--; \ - m_pData = new KviKvsVariantData; \ - m_pData->m_uRefs = 1; \ - } else { \ - DELETE_VARIANT_CONTENTS \ - } \ - } else { \ - m_pData = new KviKvsVariantData; \ - m_pData->m_uRefs = 1; \ - } - -KviKvsVariant::~KviKvsVariant() -{ - DETACH_CONTENTS -} - -void KviKvsVariant::setString(QString * pString) -{ - RENEW_VARIANT_DATA - m_pData->m_eType = KviKvsVariantData::String; - m_pData->m_u.pString = pString; -} - -void KviKvsVariant::setString(const QString &szString) -{ - RENEW_VARIANT_DATA - m_pData->m_eType = KviKvsVariantData::String; - m_pData->m_u.pString = new QString(szString); -} - -void KviKvsVariant::setReal(kvs_real_t dReal) -{ - RENEW_VARIANT_DATA - m_pData->m_eType = KviKvsVariantData::Real; - m_pData->m_u.pReal = new kvs_real_t; - *(m_pData->m_u.pReal) = dReal; -} - -void KviKvsVariant::setHObject(kvs_hobject_t hObject) -{ - RENEW_VARIANT_DATA - m_pData->m_eType = KviKvsVariantData::HObject; - m_pData->m_u.hObject = hObject; -} - -void KviKvsVariant::setBoolean(bool bBoolean) -{ - RENEW_VARIANT_DATA - m_pData->m_eType = KviKvsVariantData::Boolean; - m_pData->m_u.bBoolean = bBoolean; -} - -void KviKvsVariant::setReal(kvs_real_t * pReal) -{ - RENEW_VARIANT_DATA - m_pData->m_eType = KviKvsVariantData::Real; - m_pData->m_u.pReal = pReal; -} - -void KviKvsVariant::setInteger(kvs_int_t iInteger) -{ - RENEW_VARIANT_DATA - m_pData->m_eType = KviKvsVariantData::Integer; - m_pData->m_u.iInteger = iInteger; -} - -void KviKvsVariant::setArray(KviKvsArray * pArray) -{ - RENEW_VARIANT_DATA - m_pData->m_eType = KviKvsVariantData::Array; - m_pData->m_u.pArray = pArray; -} - -void KviKvsVariant::setHash(KviKvsHash * pHash) -{ - RENEW_VARIANT_DATA - m_pData->m_eType = KviKvsVariantData::Hash; - m_pData->m_u.pHash = pHash; -} - -void KviKvsVariant::setNothing() -{ - if(m_pData) - { - if(m_pData->m_uRefs <= 1) - { - DELETE_VARIANT_CONTENTS - delete m_pData; - } else { - // just detach - m_pData->m_uRefs--; - } - m_pData = 0; - } -} - -bool KviKvsVariant::isEmpty() const -{ - if(!m_pData)return true; - switch(m_pData->m_eType) - { - case KviKvsVariantData::String: return m_pData->m_u.pString->isEmpty(); break; - case KviKvsVariantData::Array: return m_pData->m_u.pArray->isEmpty(); break; - case KviKvsVariantData::Hash: return m_pData->m_u.pHash->isEmpty(); break; - case KviKvsVariantData::HObject: return m_pData->m_u.hObject == 0; break; - default: /* make gcc happy */ break; - } - return false; -} - -bool KviKvsVariant::asBoolean() const -{ - if(!m_pData)return false; - switch(m_pData->m_eType) - { - case KviKvsVariantData::Boolean: return m_pData->m_u.bBoolean; break; - case KviKvsVariantData::String: - { - if(m_pData->m_u.pString->isEmpty())return false; - // check integer or real values - bool bOk; - kvs_int_t iVal = (kvs_int_t)KviQString::toI64(*(m_pData->m_u.pString),&bOk); - if(bOk)return iVal; - kvs_real_t dVal = m_pData->m_u.pString->toDouble(&bOk); - if(bOk)return (dVal != 0.0); - // non number, non empty - return true; - } - break; - case KviKvsVariantData::Integer: return m_pData->m_u.iInteger; break; - case KviKvsVariantData::Real: return *(m_pData->m_u.pReal) != 0.0; break; - case KviKvsVariantData::Array: return !(m_pData->m_u.pArray->isEmpty()); break; - case KviKvsVariantData::Hash: return !(m_pData->m_u.pHash->isEmpty()); break; - case KviKvsVariantData::HObject: return m_pData->m_u.hObject; break; - default: /* make gcc happy */ break; - } - debug("WARNING: invalid variant type %d in KviKvsVariant::asBoolean()",m_pData->m_eType); - return false; -} - -bool KviKvsVariant::asHObject(kvs_hobject_t &hObject) const -{ - if(!m_pData) - { - // nothing evaluates to a null object - hObject = 0; - return true; - } - switch(m_pData->m_eType) - { - case KviKvsVariantData::HObject: - hObject = m_pData->m_u.hObject; - return true; - break; - case KviKvsVariantData::Integer: - if(m_pData->m_u.iInteger == 0) - { - hObject = 0; - return true; - } - return false; - break; - case KviKvsVariantData::String: - if(*(m_pData->m_u.pString) == "0") - { - hObject = 0; - return true; - } - return false; - break; - case KviKvsVariantData::Boolean: - if(!(m_pData->m_u.bBoolean)) - { - hObject = 0; - return true; - } - default: /* make gcc happy */ break; - } - return false; -} - - -bool KviKvsVariant::asNumber(KviKvsNumber &n) const -{ - if(!m_pData)return false; - - if(isInteger()) - { - n.m_u.iInteger = m_pData->m_u.iInteger; - n.m_type = KviKvsNumber::Integer; - return true; - } - if(isReal()) - { - n.m_u.dReal = *(m_pData->m_u.pReal); - n.m_type = KviKvsNumber::Real; - return true; - } - if(asInteger(n.m_u.iInteger)) - { - n.m_type = KviKvsNumber::Integer; - return true; - } - if(asReal(n.m_u.dReal)) - { - n.m_type = KviKvsNumber::Real; - return true; - } - return false; -} - - -void KviKvsVariant::castToNumber(KviKvsNumber &n) const -{ - if(!m_pData) - { - n.m_u.iInteger = 0; - n.m_type = KviKvsNumber::Integer; - return; - } - - if(isInteger()) - { - n.m_u.iInteger = m_pData->m_u.iInteger; - n.m_type = KviKvsNumber::Integer; - return; - } - if(isReal()) - { - n.m_u.dReal = *(m_pData->m_u.pReal); - n.m_type = KviKvsNumber::Real; - return; - } - if(asInteger(n.m_u.iInteger)) - { - n.m_type = KviKvsNumber::Integer; - return; - } - if(asReal(n.m_u.dReal)) - { - n.m_type = KviKvsNumber::Real; - return; - } - castToInteger(n.m_u.iInteger); - n.m_type = KviKvsNumber::Integer; -} - -void KviKvsVariant::castToArray(KviKvsArrayCast *c) const -{ - if(!m_pData) - { - c->set(new KviKvsArray(),true); - return; - } - - switch(m_pData->m_eType) - { - case KviKvsVariantData::Array: - c->set(m_pData->m_u.pArray,false); - break; - case KviKvsVariantData::Hash: - { - KviPointerHashTableIterator<QString,KviKvsVariant> it(*(m_pData->m_u.pHash->dict())); - KviKvsArray * a = new KviKvsArray(); - kvs_int_t idx = 0; - while(KviKvsVariant * v = it.current()) - { - a->set(idx,new KviKvsVariant(*v)); - ++it; - idx++; - } - c->set(a,true); - } - break; - default: - { - // other scalars - KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant(*this)); - c->set(a,true); - } - break; - } -} - -void KviKvsVariant::convertToArray() -{ - if(!m_pData) - { - setArray(new KviKvsArray()); - return; - } - - switch(m_pData->m_eType) - { - case KviKvsVariantData::Array: - return; - break; - case KviKvsVariantData::Hash: - { - KviPointerHashTableIterator<QString,KviKvsVariant> it(*(m_pData->m_u.pHash->dict())); - KviKvsArray * a = new KviKvsArray(); - kvs_int_t idx = 0; - while(KviKvsVariant * v = it.current()) - { - a->set(idx,new KviKvsVariant(*v)); - ++it; - idx++; - } - setArray(a); - } - break; - default: - { - // other scalars - KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant(*this)); - setArray(a); - } - break; - } -} - -bool KviKvsVariant::asInteger(kvs_int_t &iVal) const -{ - if(!m_pData)return false; - switch(m_pData->m_eType) - { - case KviKvsVariantData::Integer: - iVal = m_pData->m_u.iInteger; - return true; - break; - case KviKvsVariantData::String: - { - bool bOk; - iVal = (kvs_int_t)KviQString::toI64(*(m_pData->m_u.pString),&bOk); - return bOk; - } - break; - case KviKvsVariantData::Real: - // FIXME: this truncates the value! - iVal = (kvs_int_t)*(m_pData->m_u.pReal); - return true; - break; - case KviKvsVariantData::Boolean: - iVal = m_pData->m_u.bBoolean ? 1 : 0; - return true; - break; - //case KviKvsVariantData::HObject: <-- light casts from objects to integer are not valid - // iVal = m_pData->m_u.hObject ? 1 : 0; - // return true; - //break; - default: /* make gcc happy */ - break; - } - return false; -} - -void KviKvsVariant::castToInteger(kvs_int_t &iVal) const -{ - if(!m_pData) - { - iVal = 0; - return; - } - switch(m_pData->m_eType) - { - case KviKvsVariantData::Integer: - iVal = m_pData->m_u.iInteger; - break; - case KviKvsVariantData::Boolean: - iVal = m_pData->m_u.bBoolean ? 1 : 0; - break; - case KviKvsVariantData::HObject: - iVal = m_pData->m_u.hObject ? 1 : 0; - break; - case KviKvsVariantData::String: - { - bool bOk; - iVal = (kvs_int_t)KviQString::toI64(*(m_pData->m_u.pString),&bOk); - if(bOk)return; - iVal = m_pData->m_u.pString->length(); - } - break; - case KviKvsVariantData::Real: - // FIXME: this truncates the value! - iVal = (kvs_int_t)*(m_pData->m_u.pReal); - break; - case KviKvsVariantData::Array: - iVal = m_pData->m_u.pArray->size(); - break; - case KviKvsVariantData::Hash: - iVal = m_pData->m_u.pHash->size(); - break; - default: /* make gcc happy */ - iVal = 0; - break; - } -} - - -bool KviKvsVariant::asReal(kvs_real_t & dVal) const -{ - if(!m_pData)return false; - switch(m_pData->m_eType) - { - case KviKvsVariantData::Integer: - dVal = m_pData->m_u.iInteger; - return true; - break; - case KviKvsVariantData::String: - { - bool bOk; - dVal = m_pData->m_u.pString->toDouble(&bOk); - return bOk; - } - break; - case KviKvsVariantData::Real: - dVal = *(m_pData->m_u.pReal); - return true; - break; - case KviKvsVariantData::Boolean: - dVal = m_pData->m_u.bBoolean ? 1.0 : 0.0; - return true; - break; - default: /* by default we make gcc happy */ break; - } - return false; -} - -void KviKvsVariant::asString(QString &szBuffer) const -{ - if(!m_pData) - { - szBuffer = QString::null; - return; - } - switch(m_pData->m_eType) - { - case KviKvsVariantData::String: szBuffer = *(m_pData->m_u.pString); break; - case KviKvsVariantData::Array: szBuffer = QString::null; m_pData->m_u.pArray->appendAsString(szBuffer); break; - case KviKvsVariantData::Hash: szBuffer = QString::null; m_pData->m_u.pHash->appendAsString(szBuffer); break; - case KviKvsVariantData::Integer: szBuffer.setNum(m_pData->m_u.iInteger); break; - case KviKvsVariantData::Real: szBuffer.setNum(*(m_pData->m_u.pReal)); break; - case KviKvsVariantData::Boolean: szBuffer.setNum(m_pData->m_u.bBoolean ? 1 : 0); break; - case KviKvsVariantData::HObject: - if(m_pData->m_u.hObject) - KviQString::sprintf(szBuffer,"object[%lx]",m_pData->m_u.hObject); - else - szBuffer = "null-object"; - break; - default: /* make gcc happy */ break; - } -} - -void KviKvsVariant::appendAsString(QString &szBuffer) const -{ - if(!m_pData)return; - switch(m_pData->m_eType) - { - case KviKvsVariantData::String: szBuffer.append(*(m_pData->m_u.pString)); break; - case KviKvsVariantData::Array: m_pData->m_u.pArray->appendAsString(szBuffer); break; - case KviKvsVariantData::Hash: m_pData->m_u.pHash->appendAsString(szBuffer); break; - case KviKvsVariantData::Integer: KviQString::appendNumber(szBuffer,m_pData->m_u.iInteger); break; - case KviKvsVariantData::Real: KviQString::appendNumber(szBuffer,*(m_pData->m_u.pReal)); break; - case KviKvsVariantData::Boolean: KviQString::appendNumber(szBuffer,m_pData->m_u.bBoolean ? 1 : 0); break; - case KviKvsVariantData::HObject: szBuffer.append(m_pData->m_u.hObject ? "object" : "null-object"); break; - default: /* make gcc happy */ break; - } -} - -void KviKvsVariant::dump(const char * prefix) const -{ - if(!m_pData) - { - debug("%s Nothing [this=0x%lx]",prefix,this); - return; - } - switch(m_pData->m_eType) - { - case KviKvsVariantData::String: debug("%s String(%s) [this=0x%lx]",prefix,m_pData->m_u.pString->utf8().data(),this); break; - case KviKvsVariantData::Array: debug("%s Array(ptr=0x%lx) [this=0x%lx]",prefix,m_pData->m_u.pArray,this); break; - case KviKvsVariantData::Hash: debug("%s Hash(ptr=0x%lx,dict=0x%lx) [this=0x%lx]",prefix,m_pData->m_u.pHash,m_pData->m_u.pHash->dict(),this); break; - case KviKvsVariantData::Integer: debug("%s Integer(%d) [this=0x%lx]",prefix,m_pData->m_u.iInteger,this); break; - case KviKvsVariantData::Real: debug("%s Real(%f) [this=0x%lx]",prefix,*(m_pData->m_u.pReal),this); break; - case KviKvsVariantData::Boolean: debug("%s Boolean(%s) [this=0x%lx]",prefix,m_pData->m_u.bBoolean ? "true" : "false",this); break; - case KviKvsVariantData::HObject: debug("%s HObject(%lx) [this=0x%lx]",prefix,m_pData->m_u.hObject,this); break; - default: /* make gcc happy */ break; - } -} - -void KviKvsVariant::copyFrom(const KviKvsVariant * v) -{ - DETACH_CONTENTS - m_pData = v->m_pData; - if(m_pData)m_pData->m_uRefs++; -} - -void KviKvsVariant::copyFrom(const KviKvsVariant &v) -{ - DETACH_CONTENTS - m_pData = v.m_pData; - if(m_pData)m_pData->m_uRefs++; - -} - -void KviKvsVariant::takeFrom(KviKvsVariant * v) -{ - DETACH_CONTENTS - m_pData = v->m_pData; - v->m_pData = 0; -} - -void KviKvsVariant::takeFrom(KviKvsVariant &v) -{ - DETACH_CONTENTS - m_pData = v.m_pData; - v.m_pData = 0; -} - -void KviKvsVariant::getTypeName(QString &szBuffer) const -{ - if(!m_pData) - { - szBuffer = "nothing"; - return; - } - switch(m_pData->m_eType) - { - case KviKvsVariantData::String: szBuffer = "string"; break; - case KviKvsVariantData::Hash: szBuffer = "hash"; break; - case KviKvsVariantData::Array: szBuffer = "array"; break; - case KviKvsVariantData::Real: szBuffer = "real"; break; - case KviKvsVariantData::Integer: szBuffer = "integer"; break; - case KviKvsVariantData::Boolean: szBuffer = "boolean"; break; - case KviKvsVariantData::HObject: szBuffer = "hobject"; break; - default: szBuffer = "internal_error"; break; - } -} - -bool KviKvsVariant::isEqualToNothing() const -{ - if(!m_pData)return true; - switch(m_pData->m_eType) - { - case KviKvsVariantData::HObject: - return (m_pData->m_u.hObject == (kvs_hobject_t)0); - break; - case KviKvsVariantData::Integer: - return (m_pData->m_u.iInteger == 0); - break; - case KviKvsVariantData::Real: - return (*(m_pData->m_u.pReal) == 0.0); - break; - case KviKvsVariantData::String: - { - if(m_pData->m_u.pString->isEmpty())return true; - kvs_real_t dReal; - if(asReal(dReal)) - return dReal == 0.0; - return false; - } - break; - case KviKvsVariantData::Boolean: - return !m_pData->m_u.bBoolean; - break; - case KviKvsVariantData::Hash: - return m_pData->m_u.pHash->isEmpty(); - break; - case KviKvsVariantData::Array: - return m_pData->m_u.pArray->isEmpty(); - break; - default: - break; - } - - return false; -} - - -#define CMP_THISGREATER -1 -#define CMP_EQUAL 0 -#define CMP_OTHERGREATER 1 - -class KviKvsVariantComparison -{ -public: - static inline int compare_integer_string(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(v1->m_pData->m_u.iInteger == 0) - { - if(v2->m_pData->m_u.pString->isEmpty())return CMP_EQUAL; - } - kvs_real_t dReal; - if(v2->asReal(dReal)) - { - if(((kvs_real_t)v1->m_pData->m_u.iInteger) == dReal)return CMP_EQUAL; - if(((kvs_real_t)v1->m_pData->m_u.iInteger) > dReal)return CMP_THISGREATER; - return CMP_OTHERGREATER; - } - // compare as strings instead - QString szString; - v1->asString(szString); - return -1 * KviQString::cmpCI(szString,*(v2->m_pData->m_u.pString)); - } - - static inline int compare_integer_real(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(((kvs_real_t)v1->m_pData->m_u.iInteger) == *(v2->m_pData->m_u.pReal))return CMP_EQUAL; - if(((kvs_real_t)v1->m_pData->m_u.iInteger) > *(v2->m_pData->m_u.pReal))return CMP_THISGREATER; - return CMP_OTHERGREATER; - } - - static inline int compare_integer_boolean(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(v1->m_pData->m_u.iInteger == 0) - return v2->m_pData->m_u.bBoolean ? CMP_OTHERGREATER : CMP_EQUAL; - return v2->m_pData->m_u.bBoolean ? CMP_EQUAL : CMP_THISGREATER; - } - - static inline int compare_integer_hash(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(v1->m_pData->m_u.iInteger == 0) - return v2->m_pData->m_u.pHash->isEmpty() ? CMP_EQUAL : CMP_OTHERGREATER; - return CMP_THISGREATER; - } - - static inline int compare_integer_array(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(v1->m_pData->m_u.iInteger == 0) - return v2->m_pData->m_u.pArray->isEmpty() ? CMP_EQUAL : CMP_OTHERGREATER; - return CMP_THISGREATER; - } - - static inline int compare_integer_hobject(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(v1->m_pData->m_u.iInteger == 0.0) - return (v2->m_pData->m_u.hObject == (kvs_hobject_t)0) ? CMP_EQUAL : CMP_THISGREATER; - return CMP_OTHERGREATER; - } - - static inline int compare_real_hobject(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(*(v1->m_pData->m_u.pReal) == 0.0) - return (v2->m_pData->m_u.hObject == (kvs_hobject_t)0) ? CMP_EQUAL : CMP_THISGREATER; - return CMP_OTHERGREATER; - } - - static inline int compare_real_string(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(*(v1->m_pData->m_u.pReal) == 0.0) - { - if(v2->m_pData->m_u.pString->isEmpty())return CMP_EQUAL; - } - kvs_real_t dReal; - if(v2->asReal(dReal)) - { - if(*(v1->m_pData->m_u.pReal) == dReal)return CMP_EQUAL; - if(*(v1->m_pData->m_u.pReal) > dReal)return CMP_THISGREATER; - return CMP_OTHERGREATER; - } - // compare as strings instead - QString szString; - v1->asString(szString); - return -1 * KviQString::cmpCI(szString,*(v2->m_pData->m_u.pString)); - } - - static inline int compare_real_boolean(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(*(v1->m_pData->m_u.pReal) == 0.0) - return v2->m_pData->m_u.bBoolean ? CMP_OTHERGREATER : CMP_EQUAL; - return v2->m_pData->m_u.bBoolean ? CMP_EQUAL : CMP_THISGREATER; - } - - static inline int compare_real_hash(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(*(v1->m_pData->m_u.pReal) == 0) - return v2->m_pData->m_u.pHash->isEmpty() ? CMP_EQUAL : CMP_OTHERGREATER; - return CMP_THISGREATER; - } - - static inline int compare_real_array(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(*(v1->m_pData->m_u.pReal) == 0) - return v2->m_pData->m_u.pArray->isEmpty() ? CMP_EQUAL : CMP_OTHERGREATER; - return CMP_THISGREATER; - } - - static inline int compare_string_hash(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(v1->m_pData->m_u.pString->isEmpty()) - { - return v2->m_pData->m_u.pHash->isEmpty() ? CMP_EQUAL : CMP_OTHERGREATER; - } - return CMP_THISGREATER; - } - - static inline int compare_string_array(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(v1->m_pData->m_u.pString->isEmpty()) - { - return v2->m_pData->m_u.pArray->isEmpty() ? CMP_EQUAL : CMP_OTHERGREATER; - } - return CMP_THISGREATER; - } - - static inline int compare_string_hobject(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(v2->m_pData->m_u.hObject == (kvs_hobject_t)0) - { - if(v1->m_pData->m_u.pString->isEmpty()) - return CMP_EQUAL; - kvs_real_t dReal; - if(v1->asReal(dReal)) - { - if(dReal == 0)return CMP_EQUAL; - } - } - - return CMP_THISGREATER; - } - - static inline int compare_boolean_string(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(v2->isEqualToNothing()) - { - return v1->m_pData->m_u.bBoolean ? CMP_THISGREATER : CMP_EQUAL; - } else { - return v1->m_pData->m_u.bBoolean ? CMP_EQUAL : CMP_THISGREATER; - } - } - - static inline int compare_boolean_hash(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(v1->m_pData->m_u.bBoolean) - return v2->m_pData->m_u.pHash->isEmpty() ? CMP_THISGREATER : CMP_EQUAL; - else - return v2->m_pData->m_u.pHash->isEmpty() ? CMP_EQUAL : CMP_OTHERGREATER; - } - - static inline int compare_boolean_array(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(v1->m_pData->m_u.bBoolean) - return v2->m_pData->m_u.pArray->isEmpty() ? CMP_THISGREATER : CMP_EQUAL; - else - return v2->m_pData->m_u.pArray->isEmpty() ? CMP_EQUAL : CMP_OTHERGREATER; - } - - static inline int compare_boolean_hobject(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(v1->m_pData->m_u.bBoolean) - return v2->m_pData->m_u.hObject == ((kvs_hobject_t)0) ? CMP_THISGREATER : CMP_EQUAL; - else - return v2->m_pData->m_u.hObject == ((kvs_hobject_t)0) ? CMP_EQUAL : CMP_OTHERGREATER; - } - - static inline int compare_array_hash(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(v1->m_pData->m_u.pArray->size() > v2->m_pData->m_u.pHash->size())return CMP_THISGREATER; - if(v1->m_pData->m_u.pArray->size() == v2->m_pData->m_u.pHash->size())return CMP_EQUAL; - return CMP_OTHERGREATER; - } - - static inline int compare_hobject_hash(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(v2->m_pData->m_u.pHash->isEmpty()) - return v1->m_pData->m_u.hObject == ((kvs_hobject_t)0) ? CMP_EQUAL : CMP_OTHERGREATER; - return v1->m_pData->m_u.hObject == ((kvs_hobject_t)0) ? CMP_THISGREATER : CMP_EQUAL; - } - - static inline int compare_hobject_array(const KviKvsVariant * v1,const KviKvsVariant * v2) - { - if(v2->m_pData->m_u.pArray->isEmpty()) - return v1->m_pData->m_u.hObject == ((kvs_hobject_t)0) ? CMP_EQUAL : CMP_OTHERGREATER; - return v1->m_pData->m_u.hObject == ((kvs_hobject_t)0) ? CMP_THISGREATER : CMP_EQUAL; - } - -}; -void KviKvsVariant::serializeString(QString& buffer) -{ - buffer.replace('\\',"\\\\"); - buffer.replace('\n',"\\n"); - buffer.replace('\r',"\\r"); - buffer.replace('\b',"\\b"); - buffer.replace('\t',"\\t"); - buffer.replace('\f',"\\f"); - buffer.replace('/',"\\/"); - buffer.replace('"',"\\\""); - buffer.prepend('"'); - buffer.append('"'); -} - -void KviKvsVariant::serialize(QString& result) -{ - switch(m_pData->m_eType) - { - case KviKvsVariantData::HObject: - //can't serialize objects yet - break; - case KviKvsVariantData::Integer: - result.setNum(m_pData->m_u.iInteger); - break; - case KviKvsVariantData::Real: - result.setNum(*(m_pData->m_u.pReal)); - break; - case KviKvsVariantData::String: - result = *(m_pData->m_u.pString); - serializeString(result); - break; - case KviKvsVariantData::Boolean: - result = m_pData->m_u.bBoolean ? "true" : "false"; - break; - case KviKvsVariantData::Hash: - m_pData->m_u.pHash->serialize(result); - break; - case KviKvsVariantData::Array: - m_pData->m_u.pArray->serialize(result); - break; - case KviKvsVariantData::Nothing: - result="null"; - break; - default: // just make gcc happy - break; - } -} - -KviKvsVariant* KviKvsVariant::unserializeTrue(const QChar** aux) -{ - if(KviQString::equalCIN(QString("true"),*aux,4)) - { - (*aux)+=4; - return new KviKvsVariant(true); - } - return 0; -} - -KviKvsVariant* KviKvsVariant::unserializeFalse(const QChar** aux) -{ - if(KviQString::equalCIN(QString("false"),*aux,5)) - { - (*aux)+=5; - return new KviKvsVariant(false); - } - return 0; -} - -KviKvsVariant* KviKvsVariant::unserializeNull(const QChar** aux) -{ - if(KviQString::equalCIN(QString("null"),*aux,4)) - { - (*aux)+=4; - return new KviKvsVariant(); - } - return 0; -} - -KviKvsVariant* KviKvsVariant::unserializeRealOrInteger(const QChar** aux) -{ - QString data; - if((*aux)->unicode() == '-') - { - data.append('-'); - (*aux)++; - } - if(!(*aux)->isDigit()) - { - return 0; - } - while((*aux)->isDigit()) - { - data.append(**aux); - (*aux)++; - } - if((*aux)->unicode()=='.') - { - return unserializeReal(aux,data); - } - return unserializeInteger(aux,data); -} - -KviKvsVariant* KviKvsVariant::unserializeReal(const QChar** aux,QString& data) -{ - QString exponent; - (*aux)++; //skip . - data.append('.'); - while((*aux)->isDigit()) - { - data.append(**aux); - (*aux)++; - } - - if((*aux)->unicode() == 'e' || (*aux)->unicode() == 'E') - { - (*aux)++; - if((*aux)->unicode() == '-') - { - exponent.append('-'); - (*aux)++; - } else { - if((*aux)->unicode() == '+') - { - exponent.append('+'); - (*aux)++; - } - } - - while((*aux)->isDigit()) - { - exponent.append(**aux); - (*aux)++; - } - } - - - - float value = data.toFloat(); - if(!exponent.isNull()) - { - value*=pow(10.0,exponent.toInt()); - } - return new KviKvsVariant(value); -} - -KviKvsVariant* KviKvsVariant::unserializeInteger(const QChar** aux,QString& data) -{ - - QString exponent; - - if((*aux)->unicode() == 'e' || (*aux)->unicode() == 'E') - { - (*aux)++; - if((*aux)->unicode() == '-') - { - exponent.append('-'); - (*aux)++; - } else { - if((*aux)->unicode() == '+') - { - exponent.append('+'); - (*aux)++; - } - } - - while((*aux)->isDigit()) - { - exponent.append(**aux); - (*aux)++; - } - } - - kvs_int_t value = data.toInt(); - if(!exponent.isNull()) - { - value*=pow(10.0,exponent.toInt()); - } - return new KviKvsVariant(value); -} - -KviKvsVariant* KviKvsVariant::unserializeString(const QChar** aux) -{ - QString buffer; - unserializeString(aux,buffer); - return new KviKvsVariant(buffer); -} - -void KviKvsVariant::unserializeString(const QChar** aux,QString& data) -{ - data=""; - QString hex; //temp var - //skip leading " - (*aux)++; - while((*aux)->unicode()) - { - switch((*aux)->unicode()) - { - case '"': - //EOF - (*aux)++; - return; - break; - case '\\': - //Special - (*aux)++; - switch((*aux)->unicode()) - { - case 't': - data.append('\t'); - break; - case '\"': - data.append('\"'); - break; - case '/': - data.append('/'); - case 'b': - data.append('\b'); - case 'f': - data.append('\f'); - break; - case 'n': - data.append('\n'); - break; - case 'r': - data.append('\r'); - break; - case 'u': - //4 hexadecmical digits pending... - hex=""; - (*aux)++; - for(int k=0;k<4 && (*aux)->unicode(); k++) - { - if((*aux)->isDigit() || - ((*aux)->unicode() >='A' && (*aux)->unicode() <='F')|| //ABCDEF - ((*aux)->unicode() >='a' && (*aux)->unicode() <='f')) //abcdef - { - hex.append(**aux); - (*aux)++; - } else { - break; - } - } - (*aux)--; - data.append(QChar(hex.toUInt(0,16))); - break; - default: - //Fallback; incorrect escape - (*aux)--; - data.append('\\'); - } - (*aux)++; - break; - default: - data.append(**aux); - (*aux)++; - break; - } - } -} - -KviKvsVariant* KviKvsVariant::unserializeHash(const QChar** aux) -{ - KviKvsHash* pHash = new KviKvsHash(); - QString szKey; - KviKvsVariant* pElement = 0; - //skip leading '{' - (*aux)++; - int i=0; - while(1) - { - //skip leading space - while((*aux)->isSpace()) - (*aux)++; - //waiting for starting of string - if((*aux)->unicode()!='\"') - { - //strange characters - delete pHash; - return 0; - } - unserializeString(aux,szKey); - if(szKey.isEmpty()) - { - //Strange element name - delete pHash; - return 0; - } - - //skip leading space before ':' - while((*aux)->isSpace()) - (*aux)++; - //waiting for name-value delimeter - if((*aux)->unicode()!=':') - { - //strange characters - delete pHash; - return 0; - } - (*aux)++; - - - //getting element - pElement = unserialize(aux); - if(pElement) - { - pHash->set(szKey,pElement); - i++; - while((*aux)->isSpace()) - (*aux)++; - switch((*aux)->unicode()) - { - case ',': - //goto next - (*aux)++; - break; - case '}': - //EOF array - (*aux)++; - return new KviKvsVariant(pHash); - break; - default: - delete pHash; - return 0; - break; - } - } else { - //error - delete pHash; - return 0; - } - } - return 0; -} - -KviKvsVariant* KviKvsVariant::unserializeArray(const QChar** aux) -{ - KviKvsArray* pArray = new KviKvsArray(); - KviKvsVariant* pElement = 0; - (*aux)++; - int i=0; - while(1) - { - pElement = unserialize(aux); - if(pElement) - { - pArray->set(i,pElement); - i++; - while((*aux)->isSpace()) - (*aux)++; - switch((*aux)->unicode()) - { - case ',': - //goto next - (*aux)++; - break; - case ']': - //EOF array - (*aux)++; - return new KviKvsVariant(pArray); - break; - default: - delete pArray; - return 0; - break; - } - } else { - //error - delete pArray; - return 0; - } - } - return 0; -} - -KviKvsVariant* KviKvsVariant::unserialize(const QChar** aux) -{ - KviKvsVariant* pResult = 0; - - while((*aux)->isSpace()) - (*aux)++; - - switch((*aux)->unicode()) - { - case 't': - //true - pResult = unserializeTrue(aux); - break; - case 'f': - //false - pResult = unserializeFalse(aux); - break; - case 'n': - //null - pResult = unserializeNull(aux); - break; - case '[': - //array - pResult = unserializeArray(aux); - break; - case '{': - //hash - pResult = unserializeHash(aux); - break; - case '"': - //string - pResult = unserializeString(aux); - break; - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case '0': - case '-': - //real or integer - pResult = unserializeRealOrInteger(aux); - break; - default: - //incorrect value - return 0; - } - - while((*aux)->isSpace()) - (*aux)++; - - return pResult; -} - -KviKvsVariant* KviKvsVariant::unserialize(const QString& data) -{ - KviKvsVariant* pResult = 0; - -#ifdef COMPILE_USE_QT4 - const QChar * aux = (const QChar *)data.constData(); -#else - const QChar * aux = (const QChar *)data.ucs2(); -#endif - - pResult = unserialize(&aux); - - if(aux->unicode()) - { - //strange extra characters? - if(pResult) delete pResult; - pResult = 0; - } - - return pResult; -} - -int KviKvsVariant::compare(const KviKvsVariant * pOther,bool bPreferNumeric) const -{ - // returns -1 if this variant is greater than pOther - // 0 if they are considered to be equal - // 1 if the other variant is greater - - if(!pOther) - return isEqualToNothing() ? CMP_EQUAL : CMP_THISGREATER; - if(!pOther->m_pData) - return isEqualToNothing() ? CMP_EQUAL : CMP_THISGREATER; - if(!m_pData) - return pOther->isEqualToNothing() ? CMP_EQUAL : CMP_OTHERGREATER; - - switch(m_pData->m_eType) - { - case KviKvsVariantData::HObject: - switch(pOther->m_pData->m_eType) - { - case KviKvsVariantData::HObject: - if(m_pData->m_u.hObject == pOther->m_pData->m_u.hObject)return CMP_EQUAL; - if(m_pData->m_u.hObject == ((kvs_hobject_t)0))return CMP_OTHERGREATER; - return CMP_THISGREATER; - break; - case KviKvsVariantData::Integer: - return -1 * KviKvsVariantComparison::compare_integer_hobject(pOther,this); - break; - case KviKvsVariantData::Real: - return -1 * KviKvsVariantComparison::compare_real_hobject(pOther,this); - break; - case KviKvsVariantData::String: - return -1 * KviKvsVariantComparison::compare_string_hobject(pOther,this); - break; - case KviKvsVariantData::Boolean: - return -1 * KviKvsVariantComparison::compare_boolean_hobject(pOther,this); - break; - case KviKvsVariantData::Hash: - return KviKvsVariantComparison::compare_hobject_hash(this,pOther); - break; - case KviKvsVariantData::Array: - return KviKvsVariantComparison::compare_hobject_array(this,pOther); - break; - default: // just make gcc happy - break; - } - break; - case KviKvsVariantData::Integer: - switch(pOther->m_pData->m_eType) - { - case KviKvsVariantData::HObject: - return KviKvsVariantComparison::compare_integer_hobject(this,pOther); - break; - case KviKvsVariantData::Integer: - if(m_pData->m_u.iInteger == pOther->m_pData->m_u.iInteger)return CMP_EQUAL; - if(m_pData->m_u.iInteger > pOther->m_pData->m_u.iInteger)return CMP_THISGREATER; - return CMP_OTHERGREATER; - break; - case KviKvsVariantData::Real: - return KviKvsVariantComparison::compare_integer_real(this,pOther); - break; - case KviKvsVariantData::String: - return KviKvsVariantComparison::compare_integer_string(this,pOther); - break; - case KviKvsVariantData::Boolean: - return KviKvsVariantComparison::compare_integer_boolean(this,pOther); - break; - case KviKvsVariantData::Hash: - return KviKvsVariantComparison::compare_integer_hash(this,pOther); - break; - case KviKvsVariantData::Array: - return KviKvsVariantComparison::compare_integer_array(this,pOther); - break; - default: // just make gcc happy - break; - } - break; - case KviKvsVariantData::Real: - switch(pOther->m_pData->m_eType) - { - case KviKvsVariantData::HObject: - return KviKvsVariantComparison::compare_real_hobject(this,pOther); - break; - case KviKvsVariantData::Integer: - return -1 * KviKvsVariantComparison::compare_integer_real(pOther,this); - break; - case KviKvsVariantData::Real: - if(*(m_pData->m_u.pReal) == *(pOther->m_pData->m_u.pReal))return CMP_EQUAL; - if(*(m_pData->m_u.pReal) > *(pOther->m_pData->m_u.pReal))return CMP_THISGREATER; - return CMP_OTHERGREATER; - break; - case KviKvsVariantData::String: - return KviKvsVariantComparison::compare_real_string(this,pOther); - break; - case KviKvsVariantData::Boolean: - return KviKvsVariantComparison::compare_real_boolean(this,pOther); - break; - case KviKvsVariantData::Hash: - return KviKvsVariantComparison::compare_real_hash(this,pOther); - break; - case KviKvsVariantData::Array: - return KviKvsVariantComparison::compare_real_array(this,pOther); - break; - default: // just make gcc happy - break; - } - break; - case KviKvsVariantData::String: - switch(pOther->m_pData->m_eType) - { - case KviKvsVariantData::String: - if(bPreferNumeric) - { - // prefer numeric comparison - double dReal1; - double dReal2; - if(asReal(dReal1)) - { - if(pOther->asReal(dReal2)) - { - if(dReal1 == dReal2)return CMP_EQUAL; - if(dReal1 > dReal2)return CMP_THISGREATER; - return CMP_OTHERGREATER; - } - } - } - return -1 * KviQString::cmpCI(*(m_pData->m_u.pString),*(pOther->m_pData->m_u.pString)); - case KviKvsVariantData::Real: - return -1 * KviKvsVariantComparison::compare_real_string(pOther,this); - case KviKvsVariantData::Integer: - return -1 * KviKvsVariantComparison::compare_integer_string(pOther,this); - case KviKvsVariantData::Boolean: - return -1 * KviKvsVariantComparison::compare_boolean_string(pOther,this); - break; - case KviKvsVariantData::Hash: - return KviKvsVariantComparison::compare_string_hash(this,pOther); - break; - case KviKvsVariantData::Array: - return KviKvsVariantComparison::compare_string_array(this,pOther); - break; - case KviKvsVariantData::HObject: - return KviKvsVariantComparison::compare_string_hobject(this,pOther); - break; - } - break; - case KviKvsVariantData::Hash: - switch(pOther->m_pData->m_eType) - { - case KviKvsVariantData::String: - return -1 * KviKvsVariantComparison::compare_string_hash(pOther,this); - case KviKvsVariantData::Real: - return -1 * KviKvsVariantComparison::compare_real_hash(pOther,this); - break; - case KviKvsVariantData::Integer: - return -1 * KviKvsVariantComparison::compare_integer_hash(pOther,this); - break; - case KviKvsVariantData::Boolean: - return -1 * KviKvsVariantComparison::compare_boolean_hash(pOther,this); - break; - case KviKvsVariantData::Hash: - if(m_pData->m_u.pHash->size() > pOther->m_pData->m_u.pHash->size())return CMP_THISGREATER; - if(m_pData->m_u.pHash->size() == pOther->m_pData->m_u.pHash->size())return CMP_EQUAL; - return CMP_OTHERGREATER; - break; - case KviKvsVariantData::Array: - return -1 * KviKvsVariantComparison::compare_array_hash(pOther,this); - break; - case KviKvsVariantData::HObject: - return -1 * KviKvsVariantComparison::compare_hobject_hash(pOther,this); - break; - } - break; - case KviKvsVariantData::Array: - switch(pOther->m_pData->m_eType) - { - case KviKvsVariantData::String: - return -1 * KviKvsVariantComparison::compare_string_array(pOther,this); - case KviKvsVariantData::Real: - return -1 * KviKvsVariantComparison::compare_real_array(pOther,this); - case KviKvsVariantData::Integer: - return -1 * KviKvsVariantComparison::compare_integer_array(pOther,this); - case KviKvsVariantData::Boolean: - return -1 * KviKvsVariantComparison::compare_boolean_array(pOther,this); - break; - case KviKvsVariantData::Hash: - return KviKvsVariantComparison::compare_array_hash(this,pOther); - break; - case KviKvsVariantData::Array: - if(m_pData->m_u.pArray->size() > pOther->m_pData->m_u.pArray->size())return CMP_THISGREATER; - if(m_pData->m_u.pArray->size() == pOther->m_pData->m_u.pArray->size())return CMP_EQUAL; - return CMP_OTHERGREATER; - break; - case KviKvsVariantData::HObject: - return -1 * KviKvsVariantComparison::compare_hobject_array(pOther,this); - break; - } - break; - case KviKvsVariantData::Boolean: - switch(pOther->m_pData->m_eType) - { - case KviKvsVariantData::String: - return KviKvsVariantComparison::compare_boolean_string(this,pOther); - break; - case KviKvsVariantData::Real: - return -1 * KviKvsVariantComparison::compare_real_boolean(pOther,this); - break; - case KviKvsVariantData::Integer: - return -1 * KviKvsVariantComparison::compare_integer_boolean(pOther,this); - break; - case KviKvsVariantData::Boolean: - if(m_pData->m_u.bBoolean == pOther->m_pData->m_u.bBoolean)return CMP_EQUAL; - if(m_pData->m_u.bBoolean)return CMP_THISGREATER; - return CMP_OTHERGREATER; - break; - case KviKvsVariantData::Hash: - return KviKvsVariantComparison::compare_boolean_hash(this,pOther); - break; - case KviKvsVariantData::Array: - return KviKvsVariantComparison::compare_boolean_array(this,pOther); - break; - case KviKvsVariantData::HObject: - return KviKvsVariantComparison::compare_boolean_hobject(this,pOther); - break; - } - break; - default: // should never happen anyway - break; - } - - return CMP_THISGREATER; // should never happen -} - diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_variant.h b/3.4.0/src/kvirc/kvs/kvi_kvs_variant.h deleted file mode 100644 index 1861143290..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_variant.h +++ /dev/null @@ -1,208 +0,0 @@ -#ifndef _KVI_KVS_VARIANT_H_ -#define _KVI_KVS_VARIANT_H_ -//============================================================================= -// -// File : kvi_kvs_variant.h -// Created on Tue 07 Oct 2003 04:01:19 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -#include "kvi_heapobject.h" -#include "kvi_kvs_types.h" - - -class KviKvsVariant; -class KviKvsArrayCast; - -class KVIRC_API KviKvsNumber -{ - friend class KviKvsVariant; -public: - enum DataType { Real, Integer }; -protected: - union { - kvs_int_t iInteger; - kvs_real_t dReal; - } m_u; - DataType m_type; -public: - DataType type() const { return m_type; }; - bool isReal() const { return m_type == Real; }; - bool isInteger() const { return m_type == Integer; }; - kvs_real_t real() const { return m_u.dReal; }; - kvs_int_t integer() const { return m_u.iInteger; }; -}; - -// pre-declare.. the real declarations are included below -class KviKvsHash; -class KviKvsArray; - -class KviKvsVariantData -{ -public: - enum Type { - Nothing = 0, // m_pData not initialized - String = 1, // QString (scalar) - Integer = 2, // long int (scalar) - Real = 4, // double (scalar) - Array = 8, // KviKvsArray - Hash = 16, // KviKvsHash - Boolean = 32, // bool (scalar) - HObject = 64 // object, shallow! (scalar) - }; -public: - unsigned int m_uRefs; - Type m_eType; - union { - kvs_int_t iInteger; - kvs_real_t * pReal; - QString * pString; - KviKvsArray * pArray; - KviKvsHash * pHash; - bool bBoolean; - kvs_hobject_t hObject; - } m_u; -}; - -// This class must not have virtual funcitons nor destructor -// Otherwise it will happily crash on windows when it is -// allocated in modules and destroyed anywhere else around... -class KVIRC_API KviKvsVariant : public KviHeapObject -{ - friend class KviKvsVariantComparison; -public: - KviKvsVariant(); - KviKvsVariant(kvs_int_t iInteger); - KviKvsVariant(kvs_real_t dReal); - KviKvsVariant(kvs_real_t * pReal); - KviKvsVariant(bool bBoolean); - KviKvsVariant(const QString &szString); - KviKvsVariant(const char * szString); // without this gcc chooses the conversion (const char *)->(void *) instead of (const char *)->(QString) and obviously calls the wrong constructor - KviKvsVariant(QString * pString); - KviKvsVariant(KviKvsArray * pArray); - KviKvsVariant(KviKvsHash * pHash); - KviKvsVariant(kvs_hobject_t hObject); - KviKvsVariant(const KviKvsVariant &v); - ~KviKvsVariant(); -protected: - KviKvsVariantData * m_pData; -public: - KviKvsVariantData::Type type(){ return m_pData ? m_pData->m_eType : KviKvsVariantData::Nothing; }; - - void setReal(kvs_real_t dReal); - void setReal(kvs_real_t * pReal); - void setInteger(kvs_int_t iInteger); - void setString(const QString &szString); - void setString(QString * pString); - void setArray(KviKvsArray * pArray); - void setHash(KviKvsHash * pHash); - void setBoolean(bool bBoolean); - void setHObject(kvs_hobject_t hObject); - void setNothing(); - //void unset(){ setNothing(); }; - - void getTypeName(QString &szBuffer) const; - - bool isNothing() const { return !m_pData; }; - bool isInteger() const { return m_pData ? (m_pData->m_eType == KviKvsVariantData::Integer) : false; }; - bool isReal() const { return m_pData ? (m_pData->m_eType == KviKvsVariantData::Real) : false; }; - bool isNumeric() const { return m_pData ? (m_pData->m_eType & (KviKvsVariantData::Integer | KviKvsVariantData::Real)) : false; }; - bool isString() const { return m_pData ? (m_pData->m_eType == KviKvsVariantData::String) : false; }; - bool isScalar() const { return m_pData ? (m_pData->m_eType & (KviKvsVariantData::String | KviKvsVariantData::Integer | KviKvsVariantData::Real)) : false; }; - bool isArray() const { return m_pData ? (m_pData->m_eType == KviKvsVariantData::Array) : false; }; - bool isHash() const { return m_pData ? (m_pData->m_eType == KviKvsVariantData::Hash) : false; }; - bool isBoolean() const { return m_pData ? (m_pData->m_eType == KviKvsVariantData::Boolean) : false; }; - bool isHObject() const { return m_pData ? (m_pData->m_eType == KviKvsVariantData::HObject) : false; }; - - bool isEmpty() const; - - // returns true if this variant is nothing, false, null, 0 or an empty string - bool isEqualToNothing() const; - - // evaluates Integer, Real and String rappresenting an Integer - bool asInteger(kvs_int_t &iVal) const; - // evaluates Real, Integer and String rappresenting a Real - bool asReal(kvs_real_t &dVal) const; - // evaluates Real, Integer and String rappresenting a Real or integer - bool asNumber(KviKvsNumber &n) const; - // always evaluates to a boolean value - bool asBoolean() const; - // evaluates to an object handle - bool asHObject(kvs_hobject_t &hObject) const; - // evaluates anything to a string - void asString(QString &szBuffer) const; - void appendAsString(QString &szBuffer) const; - - // always evaluates to some number... - void castToNumber(KviKvsNumber &n) const; - // always evaluates to an integer - void castToInteger(kvs_int_t &iVal) const; - // always evaluates to an array - void castToArray(KviKvsArrayCast *c) const; - // converts this variant to an array - void convertToArray(); - - kvs_int_t integer() const { return m_pData ? m_pData->m_u.iInteger : 0; }; - kvs_real_t real() const { return m_pData ? *(m_pData->m_u.pReal) : 0.0; }; - const QString & string() const { return m_pData ? *(m_pData->m_u.pString) : KviQString::empty; }; - KviKvsArray * array() const { return m_pData ? m_pData->m_u.pArray : 0; }; - KviKvsHash * hash() const { return m_pData ? m_pData->m_u.pHash : 0; }; - bool boolean() const { return m_pData ? m_pData->m_u.bBoolean : false; }; - kvs_hobject_t hobject() const { return m_pData ? m_pData->m_u.hObject : (kvs_hobject_t)0; }; - - void copyFrom(const KviKvsVariant * v); - void copyFrom(const KviKvsVariant & v); - void takeFrom(KviKvsVariant * v); - void takeFrom(KviKvsVariant &v); - - void dump(const char * prefix) const; - - // returns -1 if this variant is greater than the other, 0 if are equal, 1 if the other is greater - // if bPreferNumeric is true then when comparing strings a conversion to a numeric format - // is first attempted. - int compare(const KviKvsVariant * pOther,bool bPreferNumeric = false) const; - - void operator = (const KviKvsVariant &v){ copyFrom(v); }; - - //JSON serialization - void serialize(QString& result); - static void serializeString(QString& buffer); - static KviKvsVariant* unserialize(const QString& buffer); -private: - static KviKvsVariant* unserialize(const QChar** aux); - static KviKvsVariant* unserializeTrue(const QChar** aux); - static KviKvsVariant* unserializeFalse(const QChar** aux); - static KviKvsVariant* unserializeNull(const QChar** aux); - static KviKvsVariant* unserializeArray(const QChar** aux); - static KviKvsVariant* unserializeHash(const QChar** aux); - static void unserializeString(const QChar** aux,QString& buffer); - static KviKvsVariant* unserializeString(const QChar** aux); - static KviKvsVariant* unserializeRealOrInteger(const QChar** aux); - static KviKvsVariant* unserializeReal(const QChar** aux,QString& data); - static KviKvsVariant* unserializeInteger(const QChar** aux,QString& data); -}; - -#include "kvi_kvs_array.h" -#include "kvi_kvs_hash.h" - - -#endif //!_KVI_KVS_VARIANT_H_ diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_variantlist.cpp b/3.4.0/src/kvirc/kvs/kvi_kvs_variantlist.cpp deleted file mode 100644 index 3ff6907a73..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_variantlist.cpp +++ /dev/null @@ -1,199 +0,0 @@ -//============================================================================= -// -// File : kvi_kvs_variantlist.cpp -// Created on Sat 11 Oct 2003 02:20:51 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_kvs_variantlist.h" - -KviKvsVariantList::KviKvsVariantList() -{ - m_pList = new KviPointerList<KviKvsVariant>(); - m_pList->setAutoDelete(true); -} - -KviKvsVariantList::KviKvsVariantList(KviKvsVariant * v1) -{ - m_pList = new KviPointerList<KviKvsVariant>(); - m_pList->setAutoDelete(true); - m_pList->append(v1); -} - -KviKvsVariantList::KviKvsVariantList(KviKvsVariant * v1,KviKvsVariant * v2) -{ - m_pList = new KviPointerList<KviKvsVariant>(); - m_pList->setAutoDelete(true); - m_pList->append(v1); - m_pList->append(v2); -} - -KviKvsVariantList::KviKvsVariantList(KviKvsVariant * v1,KviKvsVariant * v2,KviKvsVariant * v3) -{ - m_pList = new KviPointerList<KviKvsVariant>(); - m_pList->setAutoDelete(true); - m_pList->append(v1); - m_pList->append(v2); - m_pList->append(v3); -} - -KviKvsVariantList::KviKvsVariantList(KviKvsVariant * v1,KviKvsVariant * v2,KviKvsVariant * v3,KviKvsVariant * v4) -{ - m_pList = new KviPointerList<KviKvsVariant>(); - m_pList->setAutoDelete(true); - m_pList->append(v1); - m_pList->append(v2); - m_pList->append(v3); - m_pList->append(v4); -} - -KviKvsVariantList::KviKvsVariantList(KviKvsVariant * v1,KviKvsVariant * v2,KviKvsVariant * v3,KviKvsVariant * v4,KviKvsVariant * v5) -{ - m_pList = new KviPointerList<KviKvsVariant>(); - m_pList->setAutoDelete(true); - m_pList->append(v1); - m_pList->append(v2); - m_pList->append(v3); - m_pList->append(v4); - m_pList->append(v5); -} - -KviKvsVariantList::KviKvsVariantList(KviKvsVariant * v1,KviKvsVariant * v2,KviKvsVariant * v3,KviKvsVariant * v4,KviKvsVariant * v5,KviKvsVariant * v6) -{ - m_pList = new KviPointerList<KviKvsVariant>(); - m_pList->setAutoDelete(true); - m_pList->append(v1); - m_pList->append(v2); - m_pList->append(v3); - m_pList->append(v4); - m_pList->append(v5); - m_pList->append(v6); -} - -KviKvsVariantList::KviKvsVariantList(KviKvsVariant * v1,KviKvsVariant * v2,KviKvsVariant * v3,KviKvsVariant * v4,KviKvsVariant * v5,KviKvsVariant * v6,KviKvsVariant * v7) -{ - m_pList = new KviPointerList<KviKvsVariant>(); - m_pList->setAutoDelete(true); - m_pList->append(v1); - m_pList->append(v2); - m_pList->append(v3); - m_pList->append(v4); - m_pList->append(v5); - m_pList->append(v6); - m_pList->append(v7); -} - -KviKvsVariantList::KviKvsVariantList(QString * s1) -{ - m_pList = new KviPointerList<KviKvsVariant>(); - m_pList->setAutoDelete(true); - m_pList->append(new KviKvsVariant(s1)); -} - -KviKvsVariantList::KviKvsVariantList(QString * s1,QString * s2) -{ - m_pList = new KviPointerList<KviKvsVariant>(); - m_pList->setAutoDelete(true); - m_pList->append(new KviKvsVariant(s1)); - m_pList->append(new KviKvsVariant(s2)); -} - -KviKvsVariantList::KviKvsVariantList(QString * s1,QString * s2,QString * s3) -{ - m_pList = new KviPointerList<KviKvsVariant>(); - m_pList->setAutoDelete(true); - m_pList->append(new KviKvsVariant(s1)); - m_pList->append(new KviKvsVariant(s2)); - m_pList->append(new KviKvsVariant(s3)); -} - -KviKvsVariantList::KviKvsVariantList(QString * s1,QString * s2,QString * s3,QString * s4) -{ - m_pList = new KviPointerList<KviKvsVariant>(); - m_pList->setAutoDelete(true); - m_pList->append(new KviKvsVariant(s1)); - m_pList->append(new KviKvsVariant(s2)); - m_pList->append(new KviKvsVariant(s3)); - m_pList->append(new KviKvsVariant(s4)); -} - -KviKvsVariantList::KviKvsVariantList(QString * s1,QString * s2,QString * s3,QString * s4,QString * s5) -{ - m_pList = new KviPointerList<KviKvsVariant>(); - m_pList->setAutoDelete(true); - m_pList->append(new KviKvsVariant(s1)); - m_pList->append(new KviKvsVariant(s2)); - m_pList->append(new KviKvsVariant(s3)); - m_pList->append(new KviKvsVariant(s4)); - m_pList->append(new KviKvsVariant(s5)); -} - -KviKvsVariantList::KviKvsVariantList(QString * s1,QString * s2,QString * s3,QString * s4,QString * s5,QString * s6) -{ - m_pList = new KviPointerList<KviKvsVariant>(); - m_pList->setAutoDelete(true); - m_pList->append(new KviKvsVariant(s1)); - m_pList->append(new KviKvsVariant(s2)); - m_pList->append(new KviKvsVariant(s3)); - m_pList->append(new KviKvsVariant(s4)); - m_pList->append(new KviKvsVariant(s5)); - m_pList->append(new KviKvsVariant(s6)); -} - -KviKvsVariantList::~KviKvsVariantList() -{ - delete m_pList; -} - - -void KviKvsVariantList::setAutoDelete(bool bAutoDelete) -{ - m_pList->setAutoDelete(bAutoDelete); -} - -void KviKvsVariantList::allAsString(QString &szBuffer) -{ - szBuffer = QString::null; - bool bFirst = true; - for(KviKvsVariant * v = first();v;v = next()) - { - if(bFirst)bFirst = false; - else szBuffer.append(' '); - v->appendAsString(szBuffer); - } -} - -bool KviKvsVariantList::firstAsString(QString &szBuffer) -{ - KviKvsVariant * v = first(); - if(!v)return false; - v->asString(szBuffer); - return true; -} - -bool KviKvsVariantList::nextAsString(QString &szBuffer) -{ - KviKvsVariant * v = next(); - if(!v)return false; - v->asString(szBuffer); - return true; -} diff --git a/3.4.0/src/kvirc/kvs/kvi_kvs_variantlist.h b/3.4.0/src/kvirc/kvs/kvi_kvs_variantlist.h deleted file mode 100644 index 19b9a33e59..0000000000 --- a/3.4.0/src/kvirc/kvs/kvi_kvs_variantlist.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef _KVI_KVS_VARIANTLIST_H_ -#define _KVI_KVS_VARIANTLIST_H_ -//============================================================================= -// -// File : kvi_kvs_variantlist.h -// Created on Sat 11 Oct 2003 02:20:51 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2003 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_pointerlist.h" -#include "kvi_kvs_variant.h" - - - -class KVIRC_API KviKvsVariantList -{ -public: - KviKvsVariantList(); - KviKvsVariantList(KviKvsVariant * v1); - KviKvsVariantList(KviKvsVariant * v1,KviKvsVariant * v2); - KviKvsVariantList(KviKvsVariant * v1,KviKvsVariant * v2,KviKvsVariant * v3); - KviKvsVariantList(KviKvsVariant * v1,KviKvsVariant * v2,KviKvsVariant * v3,KviKvsVariant * v4); - KviKvsVariantList(KviKvsVariant * v1,KviKvsVariant * v2,KviKvsVariant * v3,KviKvsVariant * v4,KviKvsVariant * v5); - KviKvsVariantList(KviKvsVariant * v1,KviKvsVariant * v2,KviKvsVariant * v3,KviKvsVariant * v4,KviKvsVariant * v5,KviKvsVariant * v6); - KviKvsVariantList(KviKvsVariant * v1,KviKvsVariant * v2,KviKvsVariant * v3,KviKvsVariant * v4,KviKvsVariant * v5,KviKvsVariant * v6,KviKvsVariant * v7); - KviKvsVariantList(QString * s1); - KviKvsVariantList(QString * s1,QString * s2); - KviKvsVariantList(QString * s1,QString * s2,QString * s3); - KviKvsVariantList(QString * s1,QString * s2,QString * s3,QString * s4); - KviKvsVariantList(QString * s1,QString * s2,QString * s3,QString * s4,QString * s5); - KviKvsVariantList(QString * s1,QString * s2,QString * s3,QString * s4,QString * s5,QString * s6); - ~KviKvsVariantList(); -protected: - KviPointerList<KviKvsVariant> * m_pList; -public: - KviKvsVariant * first(){ return m_pList->first(); }; - KviKvsVariant * next(){ return m_pList->next(); }; - KviKvsVariant * at(int iIdx){ return m_pList->at(iIdx); }; - unsigned int count(){ return m_pList->count(); }; - - void clear(){ m_pList->clear(); }; - - void append(const QString &szParam){ m_pList->append(new KviKvsVariant(szParam)); }; - void append(kvs_int_t iInteger){ m_pList->append(new KviKvsVariant(iInteger)); }; - void append(kvs_real_t dReal){ m_pList->append(new KviKvsVariant(dReal)); }; - void append(bool bBoolean){ m_pList->append(new KviKvsVariant(bBoolean)); }; - void append(kvs_hobject_t hObject){ m_pList->append(new KviKvsVariant(hObject)); }; - void append(KviKvsArray * pArray){ m_pList->append(new KviKvsVariant(pArray)); }; - void append(KviKvsHash * pHash){ m_pList->append(new KviKvsVariant(pHash)); }; - - void append(KviKvsVariant * v){ m_pList->append(v); }; - void prepend(KviKvsVariant * v){ m_pList->prepend(v); }; - - void setAutoDelete(bool bAutoDelete); // this is TRUE by default - - void allAsString(QString &szBuffer); - // returns true if there was a first parameter at all - bool firstAsString(QString &szBuffer); - // returns true if there was a next parameter at all - bool nextAsString(QString &szBuffer); -}; - -#endif //!_KVI_KVS_VARIANTLIST_H_ diff --git a/3.4.0/src/kvirc/module/.svnignore b/3.4.0/src/kvirc/module/.svnignore deleted file mode 100644 index 74e3b9a7ca..0000000000 --- a/3.4.0/src/kvirc/module/.svnignore +++ /dev/null @@ -1,19 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -moc_kvi_*.cpp -*.o -*.lo -*.la -*.so -*.lai -kvirc -symlinks diff --git a/3.4.0/src/kvirc/module/Makefile.am b/3.4.0/src/kvirc/module/Makefile.am deleted file mode 100644 index c84487eb66..0000000000 --- a/3.4.0/src/kvirc/module/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -EXTRA_DIST = *.cpp *.h diff --git a/3.4.0/src/kvirc/module/kvi_mexlinkfilter.cpp b/3.4.0/src/kvirc/module/kvi_mexlinkfilter.cpp deleted file mode 100644 index 602de49fb3..0000000000 --- a/3.4.0/src/kvirc/module/kvi_mexlinkfilter.cpp +++ /dev/null @@ -1,35 +0,0 @@ -//============================================================================= -// -// File : kvi_mexlinkfilter.cpp -// Creation date : Wed Apr 11 2003 03:07 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003-2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_mexlinkfilter.h" - -KviMexLinkFilter::KviMexLinkFilter(KviModuleExtensionDescriptor * d) -: QObject(), KviModuleExtension(d) -{ -} - -KviMexLinkFilter::~KviMexLinkFilter() -{ -} diff --git a/3.4.0/src/kvirc/module/kvi_mexlinkfilter.h b/3.4.0/src/kvirc/module/kvi_mexlinkfilter.h deleted file mode 100644 index d03a90560a..0000000000 --- a/3.4.0/src/kvirc/module/kvi_mexlinkfilter.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _KVI_MEXLINKFILTER_H_ -#define _KVI_MEXLINKFILTER_H_ -//============================================================================= -// -// File : kvi_mexlinkfilter.h -// Creation date : Wed Apr 11 2003 03:07 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003-2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_moduleextension.h" - -#include <qobject.h> - -class KviDataBuffer; - -class KVIRC_API KviMexLinkFilter : public QObject, public KviModuleExtension -{ - Q_OBJECT -public: - KviMexLinkFilter(KviModuleExtensionDescriptor * d); - ~KviMexLinkFilter(); -public: - virtual void processData(char * buffer,int len) = 0; - virtual bool sendPacket(KviDataBuffer * pData) = 0; -}; - -#endif //!_KVI_MEXLINKFILTER_H_ diff --git a/3.4.0/src/kvirc/module/kvi_mexserverimport.cpp b/3.4.0/src/kvirc/module/kvi_mexserverimport.cpp deleted file mode 100644 index a9c6cf8cf8..0000000000 --- a/3.4.0/src/kvirc/module/kvi_mexserverimport.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// -// File : kvi_mexserverimport.cpp -// Creation date : Wed Apr 9 2003 04:53 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_mexserverimport.h" - -KviMexServerImport::KviMexServerImport(KviModuleExtensionDescriptor * d) -: QObject() , KviModuleExtension(d) -{ -} - -KviMexServerImport::~KviMexServerImport() -{ -} diff --git a/3.4.0/src/kvirc/module/kvi_mexserverimport.h b/3.4.0/src/kvirc/module/kvi_mexserverimport.h deleted file mode 100644 index 5efd898be4..0000000000 --- a/3.4.0/src/kvirc/module/kvi_mexserverimport.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _KVI_MEXSERVERIMPORT_H_ -#define _KVI_MEXSERVERIMPORT_H_ -//============================================================================= -// -// File : kvi_mexserverimport.h -// Creation date : Wed Apr 9 2003 04:53 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_ircserverdb.h" -#include "kvi_moduleextension.h" -#include <qobject.h> - -class KVIRC_API KviMexServerImport : public QObject, public KviModuleExtension -{ - Q_OBJECT -public: - KviMexServerImport(KviModuleExtensionDescriptor * d); - ~KviMexServerImport(); -public: - virtual void start() = 0; - virtual void die() = 0; -signals: - void server(const KviIrcServer &s,const char * network); -}; - -#endif //!_KVI_MEXSERVERIMPORT_H_ diff --git a/3.4.0/src/kvirc/module/kvi_mextoolbar.cpp b/3.4.0/src/kvirc/module/kvi_mextoolbar.cpp deleted file mode 100644 index a2e8d01f62..0000000000 --- a/3.4.0/src/kvirc/module/kvi_mextoolbar.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// -// File : kvi_mextoolbar.cpp -// Creation date : Thu Sep 12 22:11:47 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_mextoolbar.h" -#include "kvi_frame.h" - -KviMexToolBar::KviMexToolBar(KviModuleExtensionDescriptor * d,const QString &szName) -: KviToolBar(szName,QT_DOCK_TOP) , KviModuleExtension(d) -{ - g_pFrame->registerModuleExtensionToolBar(this); -} - -KviMexToolBar::~KviMexToolBar() -{ - g_pFrame->unregisterModuleExtensionToolBar(this); -} - diff --git a/3.4.0/src/kvirc/module/kvi_mextoolbar.h b/3.4.0/src/kvirc/module/kvi_mextoolbar.h deleted file mode 100644 index 9528a283ad..0000000000 --- a/3.4.0/src/kvirc/module/kvi_mextoolbar.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef _KVI_MEXTOOLBAR_H_ -#define _KVI_MEXTOOLBAR_H_ -// -// File : kvi_mextoolbar.h -// Creation date : Thu Sep 12 22:11:45 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_moduleextension.h" -#include "kvi_toolbar.h" - -class KviFrame; - -class KVIRC_API KviMexToolBar : public KviToolBar , public KviModuleExtension -{ - Q_OBJECT -public: - KviMexToolBar(KviModuleExtensionDescriptor * d,const QString &szName); - ~KviMexToolBar(); -}; - -#endif //_KVI_MEXTOOLBAR_H_ diff --git a/3.4.0/src/kvirc/module/kvi_module.cpp b/3.4.0/src/kvirc/module/kvi_module.cpp deleted file mode 100644 index 1174e78a90..0000000000 --- a/3.4.0/src/kvirc/module/kvi_module.cpp +++ /dev/null @@ -1,379 +0,0 @@ -//============================================================================= -// -// File : kvi_module.cpp -// Creation date : Sat Aug 12 2000 20:30:29 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_module.h" -#include "kvi_app.h" -#include "kvi_settings.h" -#include "kvi_kvs_eventmanager.h" -#include "kvi_kvs_eventhandler.h" -#include "kvi_modulemanager.h" - -#include <time.h> - -#if QT_VERSION < 300 - #include <qobjectdict.h> -#endif - -#ifdef COMPILE_CRYPT_SUPPORT - extern KviCryptEngineManager * g_pCryptEngineManager; -#endif - -extern KVIRC_API KviModuleExtensionManager * g_pModuleExtensionManager; - -/* - @doc: modules - @type: - generic - @keyterms: - module loading, functions exported by modules, commands exported by modules, - module naming convention, module locking, plugins, functions exported by modules, - dots in command names,dots in function names - @title: - Loadable modules - @short: - KVIrc modules model - @body: - Starting from version 2.0.0, KVIrc included support for external plugins: - parts of code that can be loaded at runtime. The support was optional - and the main KVIrc functionality was indipendant of that support. - In version 3.0.0 the "modularity" has becomed one of the primary KVIrc features. - The pieces of external code are now named "modules". The module - support has been rewritten completely to extend the available features - and remove some "basic" problems that were present in 2.0.0. - This caused the old "plugins" to be binary incompatible with the new KVIrc - executable; anyway, most old "plugins" have been rewritten as "modules" - and included in the 3.0.0 distribution. Some of the basic KVIrc features - are based on modules now; for example, the help browser is now in an - external library called libkvihelp.so. This allows to keep the basic - KVIrc executable smaller and faster (in some phases). - Module loading is now "transparent" to the user. There are no - "load" and "unload" commands: the modules are automatically - loaded when the "core" requests them and unloaded after some (configurable) time - of inactivity.[br] - - [big]Module naming convention[/big][br] - Every KVIrc module must have an "unique" name: the name is a single token, - made only of [b]lowercase[/b] letters , digits and underscores. - The real object file (library) is named "libkvi<name>.so". - This convention allows KVIrc to load modules when they are referenced - by name in the scripting code (the reference in the code is case insensitive - and remapped always to the lowercase version).[br] - [big]What a module can do[/big][br] - Basically, a module exports parts of the scripting language features. - For example, the module "about" exports the "aboutkvirc" command, that - shows the dialog that lists the KVIrc staff people. The dialog - will be effectively activated only few times (maybe only once) by a single - user: including it in a separate module allows keeping rarely used code out - of the KVIrc executable and saving some memory. - To activate the dialog you only need to execute the command:[br] - [example] - about.aboutkvirc - [/example] - That's all. KVIrc will load the necessary module, run the "aboutkvirc" command, - wait until the module is not used anymore and then unload it.[br] - - [big]Transparent loading and unloading[/big][br] - Any command that has the form <name>.<command> is assumed to be - a module reference. KVIrc tries to locate the module named <name>, load it (if - not already in memory) and execute the <command>. - After the command execution KVIrc waits some user defined interval of time - (typically 2-3 minutes) and then check the module state: if the module - has not been referenced again, it is unloaded, otherwise it is kept in memory - for another period of time. To prevent accidentaly unloading a module - that has some windows or dialogs open, a module can lock itself in memory. - For example, the 'help' module lock itself when a help browser window is open - and unlocks itself when the last help browser window is closed.[br] - A module can export functions as well: the function names follow - exactly the same rule as the commands: $<name>.<function> is assumed - to be a reference to the <function> exported by module named <name>. - - [big]Forced loading and unloading[/big] - All the modules export a "load" and a "unload" command. - [example] - about.load - [/example] - The example above will do nothing more than loading the "about" - module into the core memory. - [example] - about.unload - [/example] - The example above will forcibly unload the module from the core memory; - even if it is still locked.[br] - Please note that this can be dangerous in some situations...so - better check the KVIrc behaviour twice before making public any script - that uses this command. -*/ - - - - - - - -// FIXME: #warning "Move all the modules to the new locking method ?" - - -KviModule::KviModule(kvi_library_t handle,KviModuleInfo * info,const char * name,const char * filename) -: KviKvsModuleInterface() -{ - m_dlHandle = handle; - m_pModuleInfo = info; - m_szName = name; - m_szFileName = filename; -// FIXME: this should become case insensitive and converted toUpper() - /* - m_pCommandDict = new KviPointerHashTable<const char *,KviModuleCommandParseProc>(17,false,true); - m_pCommandDict->setAutoDelete(true); - m_pFunctionDict = new KviPointerHashTable<const char *,KviModuleFunctionParseProc>(17,false,true); - m_pFunctionDict->setAutoDelete(true); - */ - m_uLock = 0; - m_lastAccessTime = (long int)time(0); - /* - m_pGenericCommandParseProc = 0; - m_pGenericFunctionParseProc = 0; - */ -} - -KviModule::~KviModule() -{ -#ifdef COMPILE_CRYPT_SUPPORT - unregisterCryptEngines(); -#endif - unregisterAllExtensions(); - /* - unregisterAllEventHandlers(); - delete m_pCommandDict; - delete m_pFunctionDict; - if(m_pGenericCommandParseProc)delete m_pGenericCommandParseProc; - if(m_pGenericFunctionParseProc)delete m_pGenericFunctionParseProc; - */ -} - -KviModuleExtensionDescriptor * KviModule::registerExtension(const KviStr &szType,const KviStr &szName,const QString &szVisibleName,KviModuleExtensionAllocRoutine r) -{ - QPixmap pix; // null - return g_pModuleExtensionManager->registerExtension(this,szType,szName,szVisibleName,r,pix); -} - -KviModuleExtensionDescriptor * KviModule::registerExtension(const KviStr &szType,const KviStr &szName,const QString &szVisibleName,KviModuleExtensionAllocRoutine r,const QPixmap &icon) -{ - return g_pModuleExtensionManager->registerExtension(this,szType,szName,szVisibleName,r,icon); -} - -KviModuleExtensionDescriptor * KviModule::findExtensionDescriptor(const KviStr &szType,const KviStr &szName) -{ - return g_pModuleExtensionManager->findExtensionDescriptor(szType,szName); -} - -void KviModule::unregisterAllExtensions() -{ - g_pModuleExtensionManager->unregisterExtensionsByModule(this); -} -/* -void KviModule::setGenericCommandParseProc(KviModuleCommandParseProc proc) -{ - if(m_pGenericCommandParseProc)delete m_pGenericCommandParseProc; - if(proc) - { - m_pGenericCommandParseProc = new KviModuleCommandParseProc(proc); - } else { - m_pGenericCommandParseProc = 0; - } -} - -void KviModule::setGenericFunctionParseProc(KviModuleFunctionParseProc proc) -{ - if(m_pGenericFunctionParseProc)delete m_pGenericFunctionParseProc; - if(proc) - { - m_pGenericFunctionParseProc = new KviModuleFunctionParseProc(proc); - } else { - m_pGenericFunctionParseProc = 0; - } -} - -void KviModule::completeCommand(const QString &cmd,KviPointerList<QString> * matches) -{ - KviPointerHashTableIterator<const char *,KviModuleCommandParseProc> it(*m_pCommandDict); - - while(it.current()) - { - if(KviQString::equalCIN(cmd,it.currentKey(),cmd.length())) - { - QString * s = new QString(); - KviQString::sprintf(*s,"%s.%s",name(),it.currentKey()); - matches->append(s); - } - ++it; - } -} - -void KviModule::completeFunction(const QString &cmd,KviPointerList<QString> * matches) -{ - KviPointerHashTableIterator<const char *,KviModuleFunctionParseProc> it(*m_pFunctionDict); - - while(it.current()) - { - if(KviQString::equalCIN(cmd,it.currentKey(),cmd.length())) - { - QString * s = new QString(); - KviQString::sprintf(*s,"%s.%s",name(),it.currentKey()); - matches->append(s); - } - ++it; - } -} - - -void KviModule::unregisterMetaObject(const char * metaObjName) -{ -#if QT_VERSION < 300 -// FIXME: #warning "We might need zeroing the d->slotAccess member of QMetaObject!" - if(!objectDict)return; - objectDict->remove(metaObjName); -#endif -} -*/ -void KviModule::updateAccessTime() -{ - m_lastAccessTime = (long int)time(0); -} - -unsigned int KviModule::secondsSinceLastAccess() -{ - return (unsigned int)(((long int)time(0)) - m_lastAccessTime); -} -/* -void KviModule::registerCommand(const char * cmd,KviModuleCommandParseProc proc) -{ - if(m_pCommandDict->find(cmd))m_pCommandDict->remove(cmd); - m_pCommandDict->insert(cmd,new KviModuleCommandParseProc(proc)); -} - -void KviModule::unregisterCommand(const char * cmd) -{ - m_pCommandDict->remove(cmd); -} - -void KviModule::unregisterAllCommands() -{ - delete m_pCommandDict; - m_pCommandDict = new KviPointerHashTable<const char *,KviModuleCommandParseProc>(17,false,true); - m_pCommandDict->setAutoDelete(true); -} - -void KviModule::registerEventHandler(int evIdx,KviModuleEventParseProc proc) -{ - KviKvsOldModuleEventHandler * h = new KviKvsOldModuleEventHandler(proc,this); - KviKvsEventManager::instance()->addAppHandler(evIdx,h); -} - -void KviModule::unregisterEventHandler(int evIdx) -{ - KviKvsEventManager::instance()->removeModuleAppHandler(evIdx,this); -} - -void KviModule::registerRawNumericEventHandler(int evIdx,KviModuleEventParseProc proc) -{ - KviKvsOldModuleEventHandler * h = new KviKvsOldModuleEventHandler(proc,this); - KviKvsEventManager::instance()->addRawHandler(evIdx,h); -} - -void KviModule::unregisterRawNumericEventHandler(int evIdx) -{ - KviKvsEventManager::instance()->removeModuleRawHandler(evIdx,this); -} - - -void KviModule::unregisterAllEventHandlers() -{ - KviKvsEventManager::instance()->removeAllModuleHandlers(this); -} - -void KviModule::registerFunction(const char * fnc,KviModuleFunctionParseProc proc) -{ - if(m_pFunctionDict->find(fnc))m_pFunctionDict->remove(fnc); - m_pFunctionDict->insert(fnc,new KviModuleFunctionParseProc(proc)); -} - -void KviModule::unregisterFunction(const char * fnc) -{ - m_pFunctionDict->remove(fnc); -} - -void KviModule::unregisterAllFunctions() -{ - delete m_pFunctionDict; - m_pFunctionDict = new KviPointerHashTable<const char *,KviModuleFunctionParseProc>(17,false,true); - m_pFunctionDict->setAutoDelete(true); -} -*/ - -#ifdef COMPILE_CRYPT_SUPPORT - -void KviModule::registerCryptEngine(KviCryptEngineDescription * d) -{ - d->providerHandle = (void *)this; - g_pCryptEngineManager->registerEngine(d); -} - -void KviModule::unregisterCryptEngine(const char * szName) -{ - g_pCryptEngineManager->unregisterEngine(szName); -} - -void KviModule::unregisterCryptEngines() -{ - g_pCryptEngineManager->unregisterEngines((void *)this); -} - -#endif - -void * KviModule::getSymbol(const char * symname) -{ - return kvi_library_symbol(handle(),symname); -} - -void KviModule::getDefaultConfigFileName(KviStr &buffer) -{ - KviStr szName(KviStr::Format,"libkvi%s.kvc",m_szName.ptr()); - g_pApp->getLocalKvircDirectory(buffer,KviApp::ConfigPlugins,szName.ptr()); -} - -void KviModule::getDefaultConfigFileName(QString &szBuffer) -{ - QString tmp = "libkvi"; - tmp += m_szName.ptr(); - tmp += ".kvc"; - g_pApp->getLocalKvircDirectory(szBuffer,KviApp::ConfigPlugins,tmp); -} - -bool KviModule::ctrl(const char * operation,void * param) -{ - if(!(m_pModuleInfo->ctrl_routine))return false; - return m_pModuleInfo->ctrl_routine(this,operation,param); -} diff --git a/3.4.0/src/kvirc/module/kvi_module.h b/3.4.0/src/kvirc/module/kvi_module.h deleted file mode 100644 index 175ddab5ef..0000000000 --- a/3.4.0/src/kvirc/module/kvi_module.h +++ /dev/null @@ -1,204 +0,0 @@ -#ifndef _KVI_MODULE_H_ -#define _KVI_MODULE_H_ - -//============================================================================= -// -// File : kvi_module.h -// Creation date : Sat Aug 12 2000 18:34:22 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" -//#include "kvi_command.h" -#include "kvi_parameterlist.h" -#include "kvi_library.h" -#include "kvi_pointerlist.h" -#include "kvi_moduleextension.h" -#include "kvi_kvs_moduleinterface.h" - -#include "kvi_pointerhashtable.h" - -#ifdef COMPILE_CRYPT_SUPPORT - #include "kvi_crypt.h" -#endif - - -#ifdef COMPILE_ON_WINDOWS - #define KVIMODULEEXPORT extern "C" __declspec(dllexport) - #define KVIMODULEEXPORTDATA KVIMODULEEXPORT - #define KVIMODULEEXPORTFUNC KVIMODULEEXPORT -#else - #define KVIMODULEEXPORT extern "C" - #define KVIMODULEEXPORTDATA - #define KVIMODULEEXPORTFUNC KVIMODULEEXPORT -#endif - -class KviModule; - - -typedef bool (*KviModuleSystemRoutine)(KviModule *); -typedef bool (*KviModuleCtrlRoutine)(KviModule *,const char *,void *); - - -typedef struct _KviModuleInfo -{ - const char * szKVIrcVersion; // must match KVI_VERSION if module version checking is in force - const char * szModuleName; - const char * szVersion; - const char * szCopyright; - const char * szDescription; - /* - * This routine is called when the module is loaded - */ - KviModuleSystemRoutine init_routine; - /* - * This should return true if the module is actually - * not providing any service and can be unloaded from memory. - * Please note that this is not a mandatory lock: KVIrc may still unload - * the module even when this function returns false. - * The only assumption you can make is that KVIrc will not try - * to unload the module spontaneously: it will do it only if forced to - * (actually only by the user, but maybe later also by constrained resources). - * If this pointer is zero, KVIrc will assume that the module - * does not provide any service and will unload the module at the - * first spontaneous cleanup. - * There is a yet stronger locking method in KviModule::lock() - */ - KviModuleSystemRoutine can_unload; - /* - * This is a generic control routine with prototype - * bool <name>(KviModule * m,const char * operation,void * param) - * KVIrc uses it to comunicate with bundled modules - * in most user-build modules this will be 0 - */ - KviModuleCtrlRoutine ctrl_routine; - /* - * This routine is called when the module is being unloaded - * Note that the module can be unloaded even if can_unload returns false: - * that's the user choice, KVIrc can only forcibly unload the module, - * so better cleanup everything here :) - */ - KviModuleSystemRoutine cleanup_routine; // WARNING : g_pApp may be in the destructor and may have no frames open! -} KviModuleInfo; - -// NOTE: The init and cleanup routines should NEVER rely on g_pApp existing! -// so only "initialization and cleanup INTERNAL to the module" goes there! - -// A module should be prepared to be unloaded at ANY time, even if it is locked -// or if can_unload returns false; locking is only a "suggestion" to the KVIrc core. - -// When unloaded, a module must ensure the destruction of all the resources that depend -// on the module core code - -#define KVIRC_MODULE_STRUCTURE_SYMBOL "KVIrc_module_info" - -#define KVIRC_MODULE(_szModuleName,_szVersion,_szCopyright,_szDescription,_init_routine,_can_unload,_ctrl_routine,_cleanup_routine) \ - \ - KVIMODULEEXPORTDATA KviModuleInfo KVIrc_module_info= \ - { \ - KVI_VERSION, \ - _szModuleName, \ - _szVersion, \ - _szCopyright, \ - _szDescription, \ - _init_routine, \ - _can_unload, \ - _ctrl_routine, \ - _cleanup_routine \ - }; - - -// old type parsing procedures -/* -typedef bool (*KviModuleCommandParseProc)(KviModule *,KviCommand *); -typedef bool (*KviModuleFunctionParseProc)(KviModule *,KviCommand *,KviParameterList *,KviStr &); -typedef bool (*KviModuleEventParseProc)(KviModule *,KviWindow *,KviParameterList *); -*/ - - -class KVIRC_API KviModule : public KviKvsModuleInterface -{ - friend class KviPointerHashTable<const char *,KviModule>; - friend class KviModuleManager; - friend class KviUserParser; -protected: - KviModule(kvi_library_t handle,KviModuleInfo * info,const char * name,const char * filename); -public: - ~KviModule(); // must be public for KviPointerList -private: - KviStr m_szName; - KviStr m_szFileName; - KviModuleInfo * m_pModuleInfo; - kvi_library_t m_dlHandle; - unsigned int m_uLock; - long int m_lastAccessTime; -protected: - void updateAccessTime(); - unsigned int secondsSinceLastAccess(); -public: - // name of this module: always low case , single word - const char * name(){ return m_szName.ptr(); }; - // filename of this module (with NO path): formatted as "libkvi%s.so",name() - const char * filename(){ return m_szFileName.ptr(); }; - kvi_library_t handle(){ return m_dlHandle; }; - KviModuleInfo * moduleInfo(){ return m_pModuleInfo; }; - - // - // This is a locking method a bit stronger than the can_unload routine - // in the descriptor. It will behave in the same way plus - // the user will be unable to unload the module unless he will specify - // the -f switch to the <module>.unload command. Without the -f switch - // he will be just warned that the module is locked in memory and - // don't want to be unloaded. - // The usage of this method is encouraged - // only when you have blocking dialogs inside the module code, like the - // QMessageBox or QFileDialog static methods. - // In this case you're entering a modal event loop that you can't control - // and if some script will attempt to forcibly unload the module - // it will surely lead to a crash when the static method returns (jumping into no mans land). - // <module>.unload -f is in fact undocumented so people will substantially - // not use it (unless they are developers and they are reading this comment). - // - void lock(){ m_uLock++; }; - void unlock(){ if(m_uLock > 0)m_uLock--; }; - bool isLocked(){ return (m_uLock > 0); }; - - void * getSymbol(const char * symname); - bool ctrl(const char * operation,void * param); - - void getDefaultConfigFileName(KviStr &buffer); - void getDefaultConfigFileName(QString &szBuffer); - - static void unregisterMetaObject(const char * metaObjName); - -#ifdef COMPILE_CRYPT_SUPPORT - void registerCryptEngine(KviCryptEngineDescription * d); - void unregisterCryptEngine(const char * szName); - void unregisterCryptEngines(); -#endif - - KviModuleExtensionDescriptor * registerExtension(const KviStr &szType,const KviStr &szName,const QString &szVisibleName,KviModuleExtensionAllocRoutine r); - KviModuleExtensionDescriptor * registerExtension(const KviStr &szType,const KviStr &szName,const QString &szVisibleName,KviModuleExtensionAllocRoutine r,const QPixmap &icon); - KviModuleExtensionDescriptor * findExtensionDescriptor(const KviStr &szType,const KviStr &szName); - void unregisterAllExtensions(); -}; - -#endif //_KVI_MODULE_H_ diff --git a/3.4.0/src/kvirc/module/kvi_moduleextension.cpp b/3.4.0/src/kvirc/module/kvi_moduleextension.cpp deleted file mode 100644 index 3f862ad39b..0000000000 --- a/3.4.0/src/kvirc/module/kvi_moduleextension.cpp +++ /dev/null @@ -1,253 +0,0 @@ -// -// File : kvi_moduleextension.cpp -// Creation date : Tue Sep 10 01:16:25 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#define _KVI_MODULEEXTENSION_CPP_ - -#include "kvi_moduleextension.h" -#include "kvi_module.h" -#include "kvi_modulemanager.h" -#include "kvi_app.h" - -// created and destroyed in kvi_app.cpp -KVIRC_API KviModuleExtensionManager * g_pModuleExtensionManager = 0; - - -KviModuleExtensionDescriptor::KviModuleExtensionDescriptor(KviModule * m,const KviStr &szType,const KviStr &szName,const QString &szVisibleName,KviModuleExtensionAllocRoutine r,const QPixmap &pix) -{ - m_iId = KviApp::getGloballyUniqueId(); - - m_pModule = m; - m_szType = szType; - m_szName = szName; - m_szVisibleName = szVisibleName; - m_allocRoutine = r; - m_pObjectList = new KviPointerList<KviModuleExtension>; - m_pObjectList->setAutoDelete(false); - if(pix.isNull())m_pIcon = 0; - else m_pIcon = new QPixmap(pix); -} - -KviModuleExtensionDescriptor::~KviModuleExtensionDescriptor() -{ - while(KviModuleExtension * e = m_pObjectList->first())e->die(); - delete m_pObjectList; - if(m_pIcon)delete m_pIcon; -} - -void KviModuleExtensionDescriptor::setIcon(const QPixmap &pix) -{ - if(m_pIcon)delete m_pIcon; - if(pix.isNull())m_pIcon = 0; - else m_pIcon = new QPixmap(pix); -} - -KviModuleExtension * KviModuleExtensionDescriptor::allocate(KviWindow * pWnd,KviPointerHashTable<QString,QVariant> * pParams,void * pSpecial) -{ - KviModuleExtensionAllocStruct s; - s.pDescriptor = this; - s.pWindow = pWnd; - s.pParams = pParams; - s.pSpecial = pSpecial; - return m_allocRoutine(&s); -} - - -void KviModuleExtensionDescriptor::registerObject(KviModuleExtension * e) -{ - m_pObjectList->append(e); -} - -void KviModuleExtensionDescriptor::unregisterObject(KviModuleExtension * e) -{ - m_pObjectList->removeRef(e); -} - - - - - - - - -KviModuleExtensionManager::KviModuleExtensionManager() -{ - m_pExtensionDict = new KviPointerHashTable<const char *,KviModuleExtensionDescriptorList>(17,false); - m_pExtensionDict->setAutoDelete(true); -} - -KviModuleExtensionManager::~KviModuleExtensionManager() -{ - delete m_pExtensionDict; -} - -KviModuleExtensionDescriptorList * KviModuleExtensionManager::getExtensionList(const KviStr &szType) -{ - g_pModuleManager->loadModulesByCaps(szType.ptr()); - return m_pExtensionDict->find(szType.ptr()); -} - -KviModuleExtensionDescriptor * KviModuleExtensionManager::registerExtension(KviModule * m,const KviStr &szType,const KviStr &szName,const QString &szVisibleName,KviModuleExtensionAllocRoutine r,const QPixmap &icon) -{ - KviModuleExtensionDescriptor * d = new KviModuleExtensionDescriptor(m,szType,szName,szVisibleName,r,icon); - KviModuleExtensionDescriptorList * l = m_pExtensionDict->find(szType.ptr()); - if(!l) - { - l = new KviModuleExtensionDescriptorList(); - l->setAutoDelete(false); - m_pExtensionDict->insert(szType.ptr(),l); - } - l->append(d); - return d; -} - -void KviModuleExtensionManager::unregisterExtensionsByModule(KviModule * m) -{ - KviPointerHashTableIterator<const char *,KviModuleExtensionDescriptorList> it(*m_pExtensionDict); - KviPointerList<KviStr> dying; - dying.setAutoDelete(true); - while(KviModuleExtensionDescriptorList * l = it.current()) - { - KviPointerList<KviModuleExtensionDescriptor> dying2; - dying2.setAutoDelete(true); - - for(KviModuleExtensionDescriptor * d = l->first();d;d = l->next()) - { - if(d->module() == m)dying2.append(d); - } - - for(KviModuleExtensionDescriptor * de = dying2.first();de;de = dying2.next()) - { - l->removeRef(de); - } - - if(l->isEmpty())dying.append(new KviStr(it.currentKey())); - ++it; - } - for(KviStr * li = dying.first();li;li = dying.next()) - { - m_pExtensionDict->remove(li->ptr()); - } -} - -KviModuleExtensionDescriptorList * KviModuleExtensionManager::allocateExtensionGetDescriptorList(const KviStr &szType,const char * preloadModule) -{ - if(preloadModule) - { - KviModule * m = g_pModuleManager->getModule(preloadModule); - (void)m; // get rid of the unused warning :D - } - - KviModuleExtensionDescriptorList * l = m_pExtensionDict->find(szType.ptr()); - if(!l) - { - // retry : it might have been unloaded - g_pModuleManager->loadModulesByCaps(szType.ptr()); - l = m_pExtensionDict->find(szType.ptr()); - } - - return l; -} - -KviModuleExtensionDescriptor * KviModuleExtensionManager::findExtensionDescriptor(const KviStr &szType,const KviStr &szName) -{ - KviModuleExtensionDescriptorList * l = m_pExtensionDict->find(szType.ptr()); - if(!l)return 0; - - for(KviModuleExtensionDescriptor * d = l->first();d;d = l->next()) - { - if(d->name().equalsCI(szName))return d; - } - - return 0; -} - -KviModuleExtension * KviModuleExtensionManager::allocateExtension(const KviStr &szType,const KviStr &szName,KviWindow * pWnd,KviPointerHashTable<QString,QVariant> * pParams,void * pSpecial,const char * preloadModule) -{ - KviModuleExtensionDescriptorList * l = allocateExtensionGetDescriptorList(szType,preloadModule); - if(!l)return 0; - - KviModuleExtensionDescriptor * d; - - for(d = l->first();d;d = l->next()) - { - if(d->name().equalsCI(szName))return d->allocate(pWnd,pParams,pSpecial); - } - - // uhm... not there ? - g_pModuleManager->loadModulesByCaps(szType.ptr()); - // try again after loading the modules - // l = m_pExtensionDict->find(szType.ptr()); <--- this shouldn't change! - for(d = l->first();d;d = l->next()) - { - if(d->name().equalsCI(szName))return d->allocate(pWnd,pParams,pSpecial); - } - - // no way : no such extension - - return 0; -} - - -KviModuleExtension * KviModuleExtensionManager::allocateExtension(const KviStr &szType,int id,KviWindow * pWnd,KviPointerHashTable<QString,QVariant> * pParams,void * pSpecial,const char * preloadModule) -{ - KviModuleExtensionDescriptorList * l = allocateExtensionGetDescriptorList(szType,preloadModule); - if(!l)return 0; - - KviModuleExtensionDescriptor * d; - for(d = l->first();d;d = l->next()) - { - if(d->id() == id)return d->allocate(pWnd,pParams,pSpecial); - } - - // uhm... not there ? - g_pModuleManager->loadModulesByCaps(szType.ptr()); - // try again after loading the modules - // l = m_pExtensionDict->find(szType.ptr()); <--- this shouldn't change! - for(d = l->first();d;d = l->next()) - { - if(d->id() == id)return d->allocate(pWnd,pParams,pSpecial); - } - // no way : no such extension - - return 0; -} - - - - - - - -KviModuleExtension::KviModuleExtension(KviModuleExtensionDescriptor * d) -: KviHeapObject() -{ - m_pDescriptor = d; - m_pDescriptor->registerObject(this); -} - -KviModuleExtension::~KviModuleExtension() -{ - m_pDescriptor->unregisterObject(this); -} - - diff --git a/3.4.0/src/kvirc/module/kvi_moduleextension.h b/3.4.0/src/kvirc/module/kvi_moduleextension.h deleted file mode 100644 index 5903ea391d..0000000000 --- a/3.4.0/src/kvirc/module/kvi_moduleextension.h +++ /dev/null @@ -1,143 +0,0 @@ -#ifndef _KVI_MODULEEXTENSION_H_ -#define _KVI_MODULEEXTENSION_H_ -// -// File : kvi_moduleextension.h -// Creation date : Tue Sep 10 01:16:24 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" -#include "kvi_pointerlist.h" -#include "kvi_heapobject.h" - -#include "kvi_pointerhashtable.h" -#include <qpixmap.h> -#include <qvariant.h> -#include "kvi_pointerhashtable.h" - -class KviWindow; -class KviModule; -class KviModuleExtension; -class KviModuleExtensionDescriptor; - -typedef struct _KviModuleExtensionAllocStructTag -{ - KviModuleExtensionDescriptor * pDescriptor; // module extension that this alloc routine refers to - KviWindow * pWindow; // may be 0! - KviPointerHashTable<QString,QVariant> * pParams; // parameter dict (may be 0!) - void * pSpecial; // special parameter passed to the alloc routine, may be 0 -} KviModuleExtensionAllocStruct; - -typedef KviModuleExtension * (*KviModuleExtensionAllocRoutine)(KviModuleExtensionAllocStruct *); - -class KVIRC_API KviModuleExtensionDescriptor -{ - friend class KviModuleExtension; - friend class KviModuleExtensionManager; // only the manager allocates and deallocates these structures -protected: - KviModuleExtensionDescriptor(KviModule * m,const KviStr &szType,const KviStr &szName,const QString &szVisibleName,KviModuleExtensionAllocRoutine r,const QPixmap &pix); -public: // this has to be public because of QPtrList... but should be protected - ~KviModuleExtensionDescriptor(); -private: - int m_iId; // unique id assigned at creation time - KviStr m_szType; // name of the service (toolbar , crypt engine...) - KviStr m_szName; // name of the extension - QString m_szVisibleName; // name that is VISIBLE and possibly translated - KviStr m_szAuthor; // Author (visible) - KviStr m_szDescription; // Description (visible!) - int m_iFlags; // Flags (0 if not applicable) - QPixmap * m_pIcon; // Icon (may be null!) - KviModuleExtensionAllocRoutine m_allocRoutine; - KviPointerList<KviModuleExtension> * m_pObjectList; - - KviModule * m_pModule; // module pointer -public: - // pParams ownership is NOT taken - KviModuleExtension * allocate(KviWindow * pWnd = 0,KviPointerHashTable<QString,QVariant> * pParams = 0,void * pSpecial = 0); - - int id(){ return m_iId; }; - KviModule * module(){ return m_pModule; }; - const KviStr &type(){ return m_szType; }; - const KviStr &name(){ return m_szName; }; - const QString &visibleName(){ return m_szVisibleName; }; - const KviStr &author(){ return m_szAuthor; }; - const KviStr &description(){ return m_szDescription; }; - const QPixmap * icon(){ return m_pIcon; }; - int flags(){ return m_iFlags; }; - - void setAuthor(const KviStr &szAuthor){ m_szAuthor = szAuthor; }; - void setDescription(const KviStr &szDescription){ m_szDescription = szDescription; }; - void setVisibleName(const KviStr &szVisibleName){ m_szVisibleName = szVisibleName; }; - void setFlags(int iFlags){ m_iFlags = iFlags; }; - void setIcon(const QPixmap &pix); - -protected: - void registerObject(KviModuleExtension * e); - void unregisterObject(KviModuleExtension * e); -}; - -typedef KviPointerList<KviModuleExtensionDescriptor> KviModuleExtensionDescriptorList; - -class KviModuleExtensionManager; - -extern KVIRC_API KviModuleExtensionManager * g_pModuleExtensionManager; - -class KVIRC_API KviModuleExtensionManager -{ - friend class KviModule; - friend class KviApp; -protected: - KviModuleExtensionManager(); // KviApp calls this - ~KviModuleExtensionManager(); // and this -protected: - KviPointerHashTable<const char *,KviModuleExtensionDescriptorList> * m_pExtensionDict; -protected: - // Only KviModule can call this - KviModuleExtensionDescriptor * registerExtension(KviModule * m,const KviStr &szType,const KviStr &szName,const QString &szVisibleName,KviModuleExtensionAllocRoutine r,const QPixmap &icon); - void unregisterExtensionsByModule(KviModule * m); -public: - KviModuleExtensionDescriptor * findExtensionDescriptor(const KviStr &szType,const KviStr &szName); - static KviModuleExtensionManager * instance(){ return g_pModuleExtensionManager; }; - KviModuleExtensionDescriptorList * getExtensionList(const KviStr &szType); - KviModuleExtension * allocateExtension(const KviStr &szType,const KviStr &szName,KviWindow * pWnd = 0,KviPointerHashTable<QString,QVariant> * pParams = 0,void * pSpecial = 0,const char * preloadModule = 0); - KviModuleExtension * allocateExtension(const KviStr &szType,int id,KviWindow * pWnd = 0,KviPointerHashTable<QString,QVariant> * pParams = 0,void * pSpecial = 0,const char * preloadModule = 0); -private: - KviModuleExtensionDescriptorList * allocateExtensionGetDescriptorList(const KviStr &szType,const char * preloadModule); -}; - - - -class KVIRC_API KviModuleExtension : public KviHeapObject -{ -public: - KviModuleExtension(KviModuleExtensionDescriptor * d); - virtual ~KviModuleExtension(); -private: - KviModuleExtensionDescriptor * m_pDescriptor; -public: - static KviModuleExtensionManager * manager(){ return g_pModuleExtensionManager; }; - KviModuleExtensionDescriptor * descriptor(){ return m_pDescriptor; }; - // A module extension MUST implement die() as "delete this" <-- FIXME: this should be no longer necessary with KviHeapObject - virtual void die() = 0; -}; - - - -#endif //_KVI_MODULEEXTENSION_H_ diff --git a/3.4.0/src/kvirc/module/kvi_modulemanager.cpp b/3.4.0/src/kvirc/module/kvi_modulemanager.cpp deleted file mode 100644 index f25af1dfb5..0000000000 --- a/3.4.0/src/kvirc/module/kvi_modulemanager.cpp +++ /dev/null @@ -1,369 +0,0 @@ -//============================================================================= -// -// File : kvi_modulemanager.cpp -// Creation date : Sat Aug 12 2000 20:32:11 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2005 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#define _KVI_MODULEMANAGER_CPP_ - -#include "kvi_modulemanager.h" -#include "kvi_fileutils.h" -#include "kvi_app.h" -#include "kvi_options.h" -#include "kvi_frame.h" -#include "kvi_console.h" -#include "kvi_locale.h" -#include "kvi_out.h" - -#include "kvi_library.h" - -#include <qdir.h> - -KviModuleManager * g_pModuleManager = 0; - - -KviModuleManager::KviModuleManager() -{ - m_pModuleDict = new KviPointerHashTable<const char *,KviModule>(17,false); - m_pModuleDict->setAutoDelete(false); - - m_pCleanupTimer = new QTimer(this); - connect(m_pCleanupTimer,SIGNAL(timeout()),this,SLOT(cleanupUnusedModules())); -} - -KviModuleManager::~KviModuleManager() -{ - unloadAllModules(); - delete m_pModuleDict; - delete m_pCleanupTimer; -} - - -void KviModuleManager::loadModulesByCaps(const char * caps,const char * dir) -{ - KviStr szCapsPath(KviStr::Format,"%s%ccaps%c%s%c",dir,KVI_PATH_SEPARATOR_CHAR, - KVI_PATH_SEPARATOR_CHAR,caps,KVI_PATH_SEPARATOR_CHAR); - - QDir d(QString(szCapsPath.ptr())); - - // FIXME: maybe check timestamps ? (old modules) - - QStringList sl = d.entryList(QDir::Files | QDir::Readable | QDir::NoSymLinks); - for(QStringList::Iterator it = sl.begin();it != sl.end();++it) - { - KviStr modname = *it; - modname.cutToLast(KVI_PATH_SEPARATOR_CHAR); - getModule((*it).ascii()); - } -} - -void KviModuleManager::loadModulesByCaps(const char * caps) -{ - KviStr szDir; - g_pApp->getLocalKvircDirectory(szDir,KviApp::Plugins); - loadModulesByCaps(caps,szDir.ptr()); - g_pApp->getGlobalKvircDirectory(szDir,KviApp::Plugins); - loadModulesByCaps(caps,szDir.ptr()); -} - -void KviModuleManager::completeModuleNames(const QString &path,const QString &word,KviPointerList<QString> * matches) -{ - QDir d(path); -#ifdef COMPILE_ON_WINDOWS - d.setNameFilter("kvi*.dll"); -#else - d.setNameFilter("libkvi*.so"); -#endif - // FIXME: maybe check timestamps ? (old modules) - - QStringList sl = d.entryList(QDir::Files | QDir::Readable | QDir::NoSymLinks); - for(QStringList::Iterator it = sl.begin();it != sl.end();++it) - { - QString * modname = new QString(*it); - KviQString::cutToLast(*modname,KVI_PATH_SEPARATOR_CHAR); - KviQString::cutToFirst(*modname,"kvi"); - if(KviQString::equalCIN(word,*modname,word.length())) - { - KviQString::cutFromLast(*modname,".so"); - if(!modname->isEmpty()) - matches->append(modname); - else - delete modname; - } else delete modname; - } -} - -void KviModuleManager::completeModuleNames(const QString &word,KviPointerList<QString> * matches) -{ - QString szDir; - // FIXME: Should check for duplicate names here! - g_pApp->getLocalKvircDirectory(szDir,KviApp::Plugins); - completeModuleNames(szDir,word,matches); - g_pApp->getGlobalKvircDirectory(szDir,KviApp::Plugins); - completeModuleNames(szDir,word,matches); -} - -KviModule * KviModuleManager::findModule(const char * modName) -{ - KviModule * m = m_pModuleDict->find(modName); - if(m)m->updateAccessTime(); - return m; -} - -KviModule * KviModuleManager::getModule(const char * modName) -{ - KviModule * m = m_pModuleDict->find(modName); - if(!m) - { - if(!loadModule(modName)) return 0; - m = m_pModuleDict->find(modName); - } - if(m)m->updateAccessTime(); - return m; -} - -/* -static bool default_module_cmd_load(KviModule *,KviCommand *) -{ - return true; -} - -static bool default_module_cmd_unload(KviModule *m,KviCommand *) -{ - g_pModuleManager->unloadModule(m->name()); - return true; -} -*/ - -bool KviModuleManager::loadModule(const char * modName) -{ - if(findModule(modName)) - { - //debug("MODULE %s ALREADY IN CORE MEMORY",modName); - return true; - } - QString tmp; - QString szName; -#ifdef COMPILE_ON_WINDOWS - KviQString::appendFormatted(szName,"kvi%s.dll",modName); -#else - KviQString::appendFormatted(szName,"libkvi%s.so",modName); -#endif - szName=szName.lower(); - - g_pApp->getLocalKvircDirectory(tmp,KviApp::Plugins,szName); - if(!KviFileUtils::fileExists(tmp)) - { - g_pApp->getGlobalKvircDirectory(tmp,KviApp::Plugins,szName); - } - - if(!KviFileUtils::fileExists(tmp)) return false; - kvi_library_t handle = kvi_library_open(tmp.local8Bit().data()); - if(!handle) - { - m_szLastError = kvi_library_error(); - //debug("ERROR IN LOADING MODULE %s (%s): %s",modName,szName.ptr(),kvi_library_error()); - return false; - } - KviModuleInfo * info = (KviModuleInfo *)kvi_library_symbol(handle,KVIRC_MODULE_STRUCTURE_SYMBOL); - if(!info) - { - m_szLastError = __tr2qs("No " KVIRC_MODULE_STRUCTURE_SYMBOL " symbol exported: not a kvirc module ?"); - kvi_library_close(handle); - return false; - } - if(!info->szKVIrcVersion) - { - m_szLastError = __tr2qs("This module has no version informations: refusing to load it"); - kvi_library_close(handle); - return false; - } - if(!KVI_OPTION_BOOL(KviOption_boolIgnoreModuleVersions)) - { - if(!kvi_strEqualCS(info->szKVIrcVersion,KVI_VERSION)) - { - m_szLastError = __tr2qs("This module was compiled for a different KVIrc version and can't be loaded"); - m_szLastError += " ("; - m_szLastError += info->szKVIrcVersion; - m_szLastError += ")"; - kvi_library_close(handle); - return false; - } - } - KviModule * module = new KviModule(handle,info,modName,szName.utf8().data()); - - // the module is probably up.. the only thing can fail is the init_routine now - // load the message catalogue if any - KviStr szDir; - // it's more probable to have the translations in the global directory - // try it as first... (yes, catalogue overriding is impossible this way.. but , anybody cares ?) - g_pApp->getGlobalKvircDirectory(szDir,KviApp::Locale); - - if(!KviLocale::loadCatalogue(modName,szDir.ptr())) - { - // try the local directory then - g_pApp->getLocalKvircDirectory(szDir,KviApp::Locale); - KviLocale::loadCatalogue(modName,szDir.ptr()); - } - - if(info->init_routine) - { - if(!((info->init_routine)(module))) - { - m_szLastError = __tr2qs("Failed to execute the init routine"); - //debug("ERROR IN LOADING MODULE %s (%s): failed to execute the init routine",modName,szName.ptr()); - kvi_library_close(handle); - delete module; - // kill the message catalogue too then - KviLocale::unloadCatalogue(modName); - return false; - } - } - m_pModuleDict->insert(modName,module); - - /* - registerDefaultCommands(module); - */ - module->registerDefaultCommands(); - - if(KVI_OPTION_BOOL(KviOption_boolCleanupUnusedModules)) - { - if(!m_pCleanupTimer->isActive()) - { - if(KVI_OPTION_UINT(KviOption_uintModuleCleanupTimerInterval) < 30) - KVI_OPTION_UINT(KviOption_uintModuleCleanupTimerInterval) = 30; - m_pCleanupTimer->start(KVI_OPTION_UINT(KviOption_uintModuleCleanupTimerInterval) * 1000); - } - } - // be verbose if needed....just make sure that we're not shutting down... - if(_OUTPUT_VERBOSE && !g_pApp->closingDown()) - { - if(g_pFrame)g_pFrame->firstConsole()->output(KVI_OUT_VERBOSE, - __tr2qs("Loaded module '%s' (%s)"),modName,szName.utf8().data()); - } - return true; -} - -/* -void KviModuleManager::registerDefaultCommands(KviModule * module) -{ - // Register the default commands - module->registerCommand("load",default_module_cmd_load); - module->registerCommand("unload",default_module_cmd_unload); -} -*/ -bool KviModuleManager::unloadModule(const char * modName) -{ - return unloadModule(findModule(modName)); -} - -bool KviModuleManager::unloadModule(KviModule * module) -{ - if(!module)return false; - moduleAboutToUnload(module); - - if(module->moduleInfo()->cleanup_routine) - { - (module->moduleInfo()->cleanup_routine)(module); - } - KviStr szModName = module->name(); - kvi_library_close(module->handle()); - //debug("Closing module %s, dlclose returns %d",szModName.ptr(),dlclose(module->handle())); - - m_pModuleDict->remove(szModName.ptr()); - delete module; - - // unload the message catalogues, if any - KviLocale::unloadCatalogue(szModName.ptr()); - - if(m_pModuleDict->isEmpty()) - { - if(m_pCleanupTimer->isActive())m_pCleanupTimer->stop(); - } - - if(_OUTPUT_VERBOSE && !g_pApp->closingDown()) - { - if(g_pFrame)g_pFrame->firstConsole()->output(KVI_OUT_VERBOSE, - __tr2qs("Unloaded module '%s'"),szModName.ptr()); - } - return true; -} - -bool KviModuleManager::hasLockedModules() -{ - KviPointerHashTableIterator<const char *,KviModule> it(*m_pModuleDict); - while(KviModule * m = it.current()) - { - if(m->isLocked())return true; - ++it; - } - return false; -} - - -void KviModuleManager::cleanupUnusedModules() -{ - KviPointerHashTableIterator<const char *,KviModule> it(*m_pModuleDict); - - KviPointerList<KviModule> lModulesToUnload; - lModulesToUnload.setAutoDelete(false); - - while(it.current()) - { - if(it.current()->secondsSinceLastAccess() > KVI_OPTION_UINT(KviOption_uintModuleCleanupTimeout)) - { - if(it.current()->moduleInfo()->can_unload) - { - if((it.current()->moduleInfo()->can_unload)(it.current())) - lModulesToUnload.append(it.current()); - else { - // the module don't want to be unloaded - // keep it memory for a while - it.current()->updateAccessTime(); - } - } else { - if(!(it.current()->isLocked())) - lModulesToUnload.append(it.current()); - } - } - ++it; - } - - for(KviModule * pModule = lModulesToUnload.first();pModule;pModule = lModulesToUnload.next()) - unloadModule(pModule); -} - -void KviModuleManager::unloadAllModules() -{ - KviPointerHashTableIterator<const char *,KviModule> it(*m_pModuleDict); - - KviPointerList<KviModule> lModulesToUnload; - lModulesToUnload.setAutoDelete(false); - while(KviModule * pModule = it.current()) - { - lModulesToUnload.append(pModule); - ++it; - } - - for(KviModule * pModule = lModulesToUnload.first();pModule;pModule = lModulesToUnload.next()) - unloadModule(pModule); -} diff --git a/3.4.0/src/kvirc/module/kvi_modulemanager.h b/3.4.0/src/kvirc/module/kvi_modulemanager.h deleted file mode 100644 index 15e080c9cc..0000000000 --- a/3.4.0/src/kvirc/module/kvi_modulemanager.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef _KVI_MODULEMANAGER_H_ -#define _KVI_MODULEMANAGER_H_ - -//============================================================================= -// -// File : kvi_modulemanager.h -// Creation date : Sat Aug 12 2000 20:31:17 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2005 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qobject.h> -#include "kvi_pointerhashtable.h" -#include <qtimer.h> -#include "kvi_pointerlist.h" - -#include "kvi_module.h" - -class KVIRC_API KviModuleManager : public QObject -{ - Q_OBJECT -public: - KviModuleManager(); - ~KviModuleManager(); -private: - KviPointerHashTable<const char *,KviModule> * m_pModuleDict; - QTimer * m_pCleanupTimer; - KviStr m_szLastError; -public: - KviStr & lastError(){ return m_szLastError; }; - KviModule * findModule(const char * modName); - KviModule * getModule(const char * modName); - bool loadModule(const char * modName); - bool unloadModule(const char * modName); - bool unloadModule(KviModule * module); - void unloadAllModules(); - //void registerDefaultCommands(KviModule * module); - void loadModulesByCaps(const char * caps,const char * dir); - void loadModulesByCaps(const char * caps); - bool hasLockedModules(); - void completeModuleNames(const QString &word,KviPointerList<QString> * matches); -protected: - void completeModuleNames(const QString &path,const QString &work,KviPointerList<QString> * matches); -public slots: - void cleanupUnusedModules(); -signals: - void moduleAboutToUnload(KviModule * m); -}; - -extern KVIRC_API KviModuleManager * g_pModuleManager; - -#endif //_KVI_MODULEMANAGER_H_ diff --git a/3.4.0/src/kvirc/sparser/.svnignore b/3.4.0/src/kvirc/sparser/.svnignore deleted file mode 100644 index dad045668c..0000000000 --- a/3.4.0/src/kvirc/sparser/.svnignore +++ /dev/null @@ -1,18 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -.libs -.deps -*.moc -*.o -*.lo -*.la -*.so -*.lai -kvirc -symlinks diff --git a/3.4.0/src/kvirc/sparser/Makefile.am b/3.4.0/src/kvirc/sparser/Makefile.am deleted file mode 100644 index c84487eb66..0000000000 --- a/3.4.0/src/kvirc/sparser/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -EXTRA_DIST = *.cpp *.h diff --git a/3.4.0/src/kvirc/sparser/kvi_antispam.cpp b/3.4.0/src/kvirc/sparser/kvi_antispam.cpp deleted file mode 100644 index e8426fe131..0000000000 --- a/3.4.0/src/kvirc/sparser/kvi_antispam.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// -// File : kvi_antispam.cpp -// Creation date : Sun Apr 18 1999 05:36:55 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#define _KVI_ANTISPAM_CPP_ - -#include "kvi_antispam.h" -#include "kvi_options.h" - -//[05:10:48] <Nataly19> :2http://www.extrababes.com5Go ahead punk, make my day ! -//[05:11:04] <treeman> :-ææ¸`ææ¸`ææ¸ -= for mp3's go to http://members.xoom.com/treemansmp3/start.htm -// =- `ææ¸`ææ¸`ææ- -//[05:10:51] <Suzi48498>:P*** **** squirms like CRAZY when **** licks between her ... -//[05:12:11] <dea_> :Hi my name is **** and I just posted pics of myself and -// other hot girls on my website at http://133.16.114.32/~guest/ -// tell me what you think! -//[15:18:37] <JuL|aN^bZ> Join #Teens4eva...Have Fun PPl!!! -//[15:19:37] <jkhnbn> Ciao, vai sul sito www.sitromba.3000.it ci sono un casino di -// immagini e video porno gratisssssssssssssssss!!!!! -//[15:19:46] <emjot``> zapraszam na kanal #poke super zabawa i opa za free !!!!! -//[15:23:20] <AlExXxX> IMPORTANTE: Se cerchi foto e video HARD andate quì: -// http://216.221.175.58/cgi-bin/affiliate/ad.cgi?id=m4rines [automsg] -//[15:23:36] <Jane> hi..join #hard sex channel --Venom ScRipT³-- SToRM iN THe DaRK!! -//[15:23:47] <lovghgh> VISIT>> http://go.to/mp3andwarez/ << VISIT[15:23:47] <lovghgh> VISIT>> http://go.to/mp3andwarez/ << VISIT -//[15:23:56] <PIMPOLO> HO le prove certe che si puo' far soldi dovendo solo ricevere sms pubblicitari sul cellulare. -// Mi sono arrivati sms pubblicitari!!! Ti interessa ? ISCRIVITI CLICCANDO DIRETTAMENTE SU QUESTO SITO: -// http://www.smscash.it/index.php3?pagid=reg&p_form=P&p_pres=0&cpre=95620&p_desc=1 (Messaggio Automatico) IR©Simpson - - -// Yes...it is really annoying when I join a channel and -// i am flooded with all that messages. -// On large-newbie-high-traffic channels I get lagged -// with the Query windows popping up with all that stuff. -// What I can do ? Ignore queries ? -// mmmmh -// -// kvi_mayBeSpam : try to guess if text may be a spam message. -// Ideas: -// - A spam message is generally a single PRIVMSG <mynick> :<text> -// so this function should be (and is) called when -// a PRIVMSG is received from a person that has no QUERY -// window open yet. -// - 95% of spam messages contain an URL inside (http,ftp,www) or a channel name. -// - The other 5% contain words like auto-msg , msg me or query <nickname> -// - There are some really common words: -// free , mp3 , sex , teen , porn , pics , girls , babe , pass , user... , hard , join -// -// In this way we can get rid of a good 70% of spam msgs. - -// Just a minor change. This allows to easily add more "banned" words. -// Maybe there should be a config dialog for that ? Some people like to get -// porno pics, but don't like mp3's for example ... ;-))) -// -- Kristoff - -// Ok...made this completely configurable.... -// The default spam words get "installed" by the default script -// 09-01-2001: Pragma - -/* - @doc: antispam - @title: - Anti-spam protection - @keyterms: - spam - @body: - KVIrc contains a small spam detector, and can help you in avoiding that annoying flood - of queries popping up when you join large channels full of lamers.[br] - The spam detector works in a rather simple way: when someone sends you a private message - containing one or more "special words", and that user has no open query window, - so the message is treated as spam and is redirected to the console window or is ignored completely - (if you enable that option).[br] - The spam words to check for, can be set by the means of [cmd]option[/cmd] stringlistSpamWords.[br] - The anti-spam engine can be enabled by setting [cmd]option[/cmd] boolUseAntiSpamOnPrivmsg and - [cmd]option[/cmd] boolUseAntiSpamOnNotice to 1.[br] - @examples: - [example] - [comment]# This will cause "new-query private messages" containing[/comment] - [comment]# words "http:","#" (channel name),"ftp:".... to be redirected to the console[/comment] - [cmd]option[/cmd] stringlistSpamWords http:,#,ftp:,sex,free,chat,join - [cmd]option[/cmd] boolUseAntiSpamOnPrivmsg 1 - [comment]# This will cause these messages to be completely ignored[/comment] - [cmd]option[/cmd] boolSilentAntiSpam 1 - [/example] -*/ - -bool kvi_mayBeSpam(KviStr * msg,KviStr &spamWord) -{ - for(QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistSpamWords).begin(); - it != KVI_OPTION_STRINGLIST(KviOption_stringlistSpamWords).end() ; ++it) - { - // FIXME : This is SLOOOOOOOOW (QString -> ascii translation!!) - - const char * aux = (*it).ascii(); - if(aux) - { - if(msg->findFirstIdx(aux,false) != -1) - { - spamWord = aux; - return true; - } - } - } - return false; -} diff --git a/3.4.0/src/kvirc/sparser/kvi_antispam.h b/3.4.0/src/kvirc/sparser/kvi_antispam.h deleted file mode 100644 index b39ebb05ca..0000000000 --- a/3.4.0/src/kvirc/sparser/kvi_antispam.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _KVI_ANTISPAM_H_ -#define _KVI_ANTISPAM_H_ -// -// File : kvi_antispam.h -// Creation date : Sun Apr 18 1999 05:36:55 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_string.h" - -extern KVIRC_API bool kvi_mayBeSpam(KviStr * msg,KviStr &spamWord); - - -#endif // _KVI_ANTISPAM_H_ diff --git a/3.4.0/src/kvirc/sparser/kvi_ircmessage.cpp b/3.4.0/src/kvirc/sparser/kvi_ircmessage.cpp deleted file mode 100644 index 002c4b898f..0000000000 --- a/3.4.0/src/kvirc/sparser/kvi_ircmessage.cpp +++ /dev/null @@ -1,179 +0,0 @@ -//============================================================================= -// -// File : kvi_ircmessage.cpp -// Creation date : Fri Aug 2 23:08:57 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_ircmessage.h" -#include "kvi_ircconnection.h" -#include "kvi_console.h" - -KviIrcMessage::KviIrcMessage(const char * message,KviIrcConnection * pConnection) -{ - m_pConnection = pConnection; - m_pConsole = pConnection->console(); - m_iFlags = 0; - - const char * aux; - m_ptr = message; - - m_pParams = new KviPointerList<KviStr>; - m_pParams->setAutoDelete(true); - - //m_pcParams = new KviPointerList<QCString>; - //m_pcParams->setAutoDelete(true); - - while(*m_ptr == ' ')++m_ptr; - const char * allParams = m_ptr; // just to be sure - if(*m_ptr) - { - if(*m_ptr == ':') - { - aux = ++m_ptr; - while(*m_ptr && (*m_ptr != ' '))++m_ptr; - m_szPrefix.extractFromString(aux,m_ptr); - while(*m_ptr == ' ')++m_ptr; - } - aux = m_ptr; - while(*m_ptr && (*m_ptr != ' '))++m_ptr; - m_szCommand.extractFromString(aux,m_ptr); - while(*m_ptr == ' ')++m_ptr; - allParams = m_ptr; - while(*m_ptr) - { - if(*m_ptr == ':') - { - ++m_ptr; - m_pParams->append(new KviStr(m_ptr)); - //m_pcParams->append(new QCString(m_ptr)); - break; // this was the last - } else { - aux = m_ptr; - while(*m_ptr && (*m_ptr != ' '))++m_ptr; - m_pParams->append(new KviStr(aux,m_ptr)); - //m_pcParams->append(new QCString(KviStr(aux,m_ptr).ptr())); - while(*m_ptr == ' ')++m_ptr; - } - } - } - m_ptr = allParams; - - m_iNumericCommand = (*m_szCommand.ptr() - '0') * 100; - - if((m_szCommand.len() == 3) && (m_iNumericCommand <= 900) && (m_iNumericCommand >= 0)) - { - aux = m_szCommand.ptr(); - aux++; - if((*aux >= '0') && (*aux <= '9')) - { - m_iNumericCommand += (*aux - '0') * 10; - aux++; - if((*aux >= '0') && (*aux <= '9')) - { - m_iNumericCommand += (*aux - '0'); - } else { - m_iNumericCommand = -1; - m_szCommand.toUpper(); - } - } else { - m_iNumericCommand = -1; - m_szCommand.toUpper(); - } - } else { - m_iNumericCommand = -1; - m_szCommand.toUpper(); - } - //m_SafeTrailingString=QCString(m_pParams->last()->ptr()); -} - -KviIrcMessage::~KviIrcMessage() -{ - delete m_pParams; -} - -void KviIrcMessage::decodeAndSplitMask(char * b,QString &szNick,QString &szUser,QString &szHost) -{ - static QString szWild("*"); - char * p = b; - - while(*p && *p != '!')p++; - if(*p) - { - if(p != b) - { - *p = 0; - szNick = m_pConnection->decodeText(b); - *p = '!'; - } else { - szNick = szWild; // ??? - } - } else { - if(p != b)szNick = m_pConnection->decodeText(b); - else szNick = szWild; // ??? - szUser = szWild; - szHost = szWild; - return; - } - p++; - b = p; - while(*p && *p != '@')p++; - if(*p) - { - if(p != b) - { - *p = 0; - szUser = m_pConnection->decodeText(b); - *p = '@'; - } else { - szUser = szWild; // ??? - } - } else { - if(p != b)szUser = m_pConnection->decodeText(b); - else szUser = szWild; // ??? - szHost = szWild; - return; - } - p++; - szHost = p; // hostnames are NOT encoded (at the moment...) - -} - -void KviIrcMessage::decodeAndSplitPrefix(QString &szNick,QString &szUser,QString &szHost) -{ - char * b; - if(m_szPrefix.hasData())b = m_szPrefix.ptr(); - else { - m_szPrefix = connection()->currentServerName(); - b = m_szPrefix.ptr(); - } - decodeAndSplitMask(b,szNick,szUser,szHost); -} - - -const char * KviIrcMessage::safePrefix() -{ - if(m_szPrefix.hasData())return m_szPrefix.ptr(); - m_szPrefix = connection()->currentServerName(); - return m_szPrefix.ptr(); -} - diff --git a/3.4.0/src/kvirc/sparser/kvi_ircmessage.h b/3.4.0/src/kvirc/sparser/kvi_ircmessage.h deleted file mode 100644 index 63ace90e71..0000000000 --- a/3.4.0/src/kvirc/sparser/kvi_ircmessage.h +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef _KVI_IRCMESSAGE_H_ -#define _KVI_IRCMESSAGE_H_ -//============================================================================= -// -// File : kvi_ircmessage.h -// Creation date : Fri Aug 2 23:08:55 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002-2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_pointerlist.h" -#include "kvi_string.h" -#include "kvi_qstring.h" -#include "kvi_console.h" - -class KviIrcConnection; -class KviIrcContext; -class KviConneciton; - -#define KVI_IRCMSG_FLAG_HALTOUTPUT 1 -#define KVI_IRCMSG_FLAG_UNRECOGNIZED 2 - -// -// This is a single IRC message received from the server. -// The message is strictly associated to the connection it came from. -// -// The IRC protocol is strictly 8 bit and thus the strings -// are all 8 bit strings. The decoding of these strings should -// be done on the targeting context (mainly channel or query...) -// - -class KVIRC_API KviIrcMessage -{ -public: - KviIrcMessage(const char * message,KviIrcConnection * pConnection); - ~KviIrcMessage(); -private: - const char * m_ptr; // shallow! never null - KviStr m_szPrefix; // the extracted prefix string - KviStr m_szCommand; // the extracted command (may be numeric) - KviPointerList<KviStr> * m_pParams; // the list of parameters - KviConsole * m_pConsole; // the console we're attacched to - KviIrcConnection * m_pConnection; // the connection we're attacched to - int m_iNumericCommand; // the numeric of the command (0 if non numeric) - int m_iFlags; // yes.. flags :D -public: - KviConsole * console(){ return m_pConsole; }; - KviIrcConnection * connection(){ return m_pConsole->connection(); }; - - bool isNumeric(){ return (m_iNumericCommand >= 0); }; - const char * command(){ return m_szCommand.ptr(); }; - KviStr * commandPtr(){ return &m_szCommand; }; - int numeric(){ return m_iNumericCommand; }; - - KviStr * prefixPtr(){ return &m_szPrefix; }; - const char * prefix(){ return m_szPrefix.ptr(); }; - const char * safePrefix(); - bool hasPrefix(){ return m_szPrefix.hasData(); }; - - bool isEmpty(){ return (m_szPrefix.isEmpty() && m_szCommand.isEmpty() && m_pParams->isEmpty()); }; - - int paramCount(){ return m_pParams->count(); }; - - const char * param(unsigned int idx){ return (idx < m_pParams->count()) ? m_pParams->at(idx)->ptr() : 0; }; - - const char * safeParam(unsigned int idx){ return (idx < m_pParams->count()) ? m_pParams->at(idx)->ptr() : KviStr::emptyString().ptr(); }; - - KviStr * paramString(unsigned int idx){ return m_pParams->at(idx); }; - - const char * trailing(){ KviStr * tr = m_pParams->last(); return tr ? tr->ptr() : 0; }; - KviStr * trailingString(){ return m_pParams->last(); }; - KviStr & safeTrailingString(){ KviStr * tr = m_pParams->last(); return tr ? *tr : KviStr::emptyString(); }; - const char * safeTrailing(){ KviStr * tr = m_pParams->last(); return tr ? tr->ptr() : KviStr::emptyString().ptr(); }; - - const char * allParams(){ return m_ptr; }; - - KviStr * firstParam(){ return m_pParams->first(); }; - KviStr * nextParam(){ return m_pParams->next(); }; - - void setHaltOutput(){ m_iFlags |= KVI_IRCMSG_FLAG_HALTOUTPUT; }; - bool haltOutput(){ return (m_iFlags & KVI_IRCMSG_FLAG_HALTOUTPUT); }; - void setUnrecognized(){ m_iFlags |= KVI_IRCMSG_FLAG_UNRECOGNIZED; }; - bool unrecognized(){ return (m_iFlags & KVI_IRCMSG_FLAG_UNRECOGNIZED); }; - - void decodeAndSplitPrefix(QString &szNick,QString &szUser,QString &szHost); - void decodeAndSplitMask(char * mask,QString &szNick,QString &szUser,QString &szHost); -}; - -#endif //_KVI_IRCMESSAGE_H_ diff --git a/3.4.0/src/kvirc/sparser/kvi_numeric.h b/3.4.0/src/kvirc/sparser/kvi_numeric.h deleted file mode 100644 index 2f5adee2b0..0000000000 --- a/3.4.0/src/kvirc/sparser/kvi_numeric.h +++ /dev/null @@ -1,430 +0,0 @@ -#ifndef _KVI_NUMERIC_H_ -#define _KVI_NUMERIC_H_ - -// -// IRC - Internet Relay Chat, include/numeric.h -// Copyright (C) 1990 Jarkko Oikarinen -// -// 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -// Revisited by Szymon Stefanek 07 Jul 1998 (pragma at kvirc dot net) -// Re-revisited again on 11 Feb 1999 (pragma at kvirc dot net) - -// We will need 4 digit replies for the new irc protocol -// and then leave 50-100 numbers between logical groups... - -// In kvirc 3.0.0 this file is newer included (at least for now: 31.07.2000) -// Today I have included it in kvi_sp_numeric.cpp (23.03.2001) - -// ==============================================================================================// -// -// E=EFnet hybrid 5.3p2 -// e=EFNet hybrid 5.3p2 with #ifdef -// I=IRCnet 2.10.0p5 -// i=IRCnet, reserved according to Undernet (sic) numerics header -// U=Undernet u2.10.04 -// u=Undernet u2.10.04 with #ifdef -// D=DALnet 4.6.7.DF -// d=DALnet 4.6.7.DF, redundant -// O=openprojects (dancer ircd) -// - -// = 000-199 ====================================================================================// -// -// Reserve numerics 000-099 for server-client connections where the client -// is local to the server. If any server is passed a numeric in this range -// from another server then it is remapped to 100-199. -avalon -// - - -#define RPL_WELCOME 1 /* :Welcome to the Internet Relay Network %s [I,E,U,D] # */ -#define RPL_YOURHOST 2 /* :Your host is %s, running version %s [I,E,U,D] # */ -#define RPL_CREATED 3 /* :This server was created %s [I,E,U,D] # */ -#define RPL_MYINFO 4 /* <server_name> <srv_version> <u_modes> <ch_modes> [I,E,U,D] # */ -#define RPL_BOUNCE 5 /* :Try server %s, port %d [I] # */ -#define RPL_PROTOCTL 5 /* %s :are available on this server [D] # */ -#define RPL_MAP 5 /* :%s%s [U] # */ -#define RPL_MAPMORE 6 /* :%s%s --> *more* [U] # */ -#define RPL_MAPEND 7 /* :End of /MAP [U] # */ -//[03:45:18] [dune.webchat.org][007] newbie dune.webchat.org 1037760291 :Tue, 19 Nov 2002 18:44:51 -0800 - -#define RPL_SNOMASK 8 /* %d :: Server notice mask (%#x) [U] # */ -//[03:45:18] [dune.webchat.org][008] newbie -/NAJgAxq7HQPwnkK^ 124963541 :This is your Session ID and Session Key. - -#define RPL_STATMEMTOT 9 /* %u %u :Bytes Blocks [U] # */ -//[03:45:18] [dune.webchat.org][009] newbie ASCII :Current character mapping. - -#define RPL_STATMEM 10 /* %u %u %s [U] # */ -#define RPL_BOUNCENEW 10 /* :Try server %s, port %d [I-NEW] # */ -// RPL_???????? 11,12,13 -#define RPL_YOURCOOKIE 14 /* <cookie> :is your reconnection cookie [E,i?] # */ - -#define RPL_CONNECTING 20 //:irc.dotsrc.org 020 * :Please wait while we process your connection. - - - -// = 200-399 ====================================================================================// -// -// Command replies -// - -#define RPL_TRACELINK 200 /* [I,E,U,D] "Link <version> <destination> <next server> <next-server-TS-version><zflag> <link-time> <sendQ> <prev-server-sendQ>" [I,E,U,D] */ -#define RPL_TRACECONNECTING 201 /* [I,E,U,D] "Try. %d %s"*/ -#define RPL_TRACEHANDSHAKE 202 /* [I,E,U,D] "H.S. %d %s"*/ -#define RPL_TRACEUNKNOWN 203 /* [I,E,U,D] "???? %d %s %d"*/ -#define RPL_TRACEOPERATOR 204 /* [I,E,U,D] "Oper %d %s"*/ -#define RPL_TRACEUSER 205 /* [I,E,U,D] "User %d %s"*/ -#define RPL_TRACESERVER 206 /* [I,E,U,D] "Serv <class> <int>S <int>C <server> <nick!user|*!*>@<host|server> <TS-version><zflag>" [I,E,U,D] */ -#define RPL_TRACENEWTYPE 208 /* [I,E,U,D] "<newtype> 0 %s"*/ -#define RPL_TRACECLASS 209 /* [I,E,U,D] "Class %d %d"*/ -#define RPL_TRACERECONNECT 210 /* [I] ??? */ -#define RPL_STATSLINKINFO 211 /* [I,E,U,D] */ -#define RPL_STATSCOMMANDS 212 /* [I,E,U,D] "%s %u %u"*/ -#define RPL_STATSCLINE 213 /* [I,E,U,D] "%c %s * %s %d %d"*/ -#define RPL_STATSNLINE 214 /* [I,E,U,D] "%c %s * %s %d %d"*/ -#define RPL_STATSILINE 215 /* [I,E,U,D] "%c %s * %s %d %d"*/ -#define RPL_STATSKLINE 216 /* [I,E,U,D] */ -#define RPL_STATSPLINE 217 /* [U] */ -#define RPL_STATSQLINE 217 /* [I,E,U,D] */ -#define RPL_STATSYLINE 218 /* [I,E,U,D] */ -#define RPL_ENDOFSTATS 219 // [I,E,U,D] */ -// #define RPL_???? 220 -#define RPL_UMODEIS 221 /* <nick> <mode> [I,E,U,D] # */ -#define RPL_STATSBLINE 222 /* [E] */ -#define RPL_SQLINE_NICK 222 /* [D] */ -#define RPL_STATSELINE 223 /* [E] */ -#define RPL_STATSFLINE 224 /* [E] */ -#define RPL_STATSDLINE 225 /* [E] */ -// RPL_?????????? 226-230 -#define RPL_SERVICEINFO 231 /* [I,U,D] */ -#define RPL_ENDOFSERVICES 232 /* [I,U,D] */ -#define RPL_SERVICE 233 /* [I,U,D] */ -#define RPL_SERVLIST 234 /* [I,E,U,D] */ -#define RPL_SERVLISTEND 235 /* [I,E,U,D] */ -// RPL_?????????? 236-238 -#define RPL_STATSIAUTH 239 /* [I] # */ -#define RPL_STATSVLINE 240 /* [I] # */ -#define RPL_STATSLLINE 241 /* [I,E,U,D] # */ -#define RPL_STATSUPTIME 242 /* [I,E,U,D] # */ -#define RPL_STATSOLINE 243 /* [I,E,U,D] # */ -#define RPL_STATSHLINE 244 /* [I,E,U,D] # */ -#define RPL_STATSSLINE 245 /* [I,E,u,D] # */ -#define RPL_STATSPING 246 /* [I] # */ -#define RPL_STATSTLINE 246 /* [U] # */ -#define RPL_STATSBLINE_I 247 /* [I] # */ -#define RPL_STATSGLINE 247 /* [U] # */ -#define RPL_STATSXLINE 247 /* [D] # */ -#define RPL_STATSDEFINE 248 /* [I] # */ -#define RPL_STATSULINE 248 /* [U,D] # */ -#define RPL_STATSDEBUG 249 /* [I,E,U,D] # */ -#define RPL_STATSCONN 250 /* [e,U,D,O] # */ -#define RPL_STATSDLINE_I 250 /* [I] # */ -#define RPL_LUSERCLIENT 251 /* ":There are %d users and %d invisible on %d servers" [I,E,U,D,O] # */ -#define RPL_LUSEROP 252 /* "%d :IRC Operators online" [I,E,U,D,O] # */ -#define RPL_LUSERUNKNOWN 253 /* "%d :unknown connection(s)" [I,E,U,D,O] # */ -#define RPL_LUSERCHANNELS 254 /* "%d :channels formed" [I,E,U,D,O] # */ -#define RPL_LUSERME 255 /* ":I have %d clients and %d servers" [I,E,U,D,O] # */ -#define RPL_ADMINME 256 /* ":Administrative info about %s" [I,E,U,D] */ -#define RPL_ADMINLOC1 257 /* ":%s" [I,E,U,D] */ -#define RPL_ADMINLOC2 258 /* ":%s" [I,E,U,D] */ -#define RPL_ADMINEMAIL 259 /* ":%s" [I,E,U,D] */ -// RPL_????????? 260 -#define RPL_TRACELOG 261 /* [I,E,U,D] */ -#define RPL_TRACEEND 262 /* [I,E] */ -#define RPL_TRACEPING 262 /* [U] */ -//[14:28:51] [ircd.tin.it][263] [newbie] LINKS :Please wait a while and try again. -#define RPL_TRYAGAIN 263 /* [I] */ -#define RPL_LOAD2HI 263 /* ":Server load is temporarily too heavy. Please wait a while and try again." [E] */ -// RPL_??????? 264 -#define RPL_LOCALUSERS 265 /* ":Current local users: %d Max: %s" [e,D,O] # */ -#define RPL_GLOBALUSERS 266 /* ":Current global users: %d Max: %d" [e,D,O] # */ -#define RPL_SHAREDUSERS 267 /* ":Current shared users: %d Max: %d" [I] # */ -// RPL_??????? 267-270 -#define RPL_SILELIST 271 /* [U,D] */ -#define RPL_ENDOFSILELIST 272 /* [U,D] */ -#define RPL_STATSDELTA 274 /* "<timedelta>" [i,E] */ -#define RPL_STATSDLINE_U 275 /* [U,D] */ -#define RPL_WHOISSSL 275 /* [AzzurraNET] %s :is using a secure connection (SSL) # */ -// RPL_??????? 276-279 -#define RPL_GLIST 280 /* [U] */ -#define RPL_ENDOFGLIST 281 /* [U] */ -// RPL_??????? 282-289 -#define RPL_HELPHDR 290 /* [D] */ -#define RPL_HELPOP 291 /* [D] */ -#define RPL_HELPTLR 292 /* [D] */ -#define RPL_HELPHLP 293 /* [D] */ -#define RPL_HELPFWD 294 /* [D] */ -#define RPL_HELPIGN 295 /* [D] */ -// RPL_??????? 296-299 -#define RPL_NONE 300 /* [I,E,U,D] */ -#define RPL_AWAY 301 /* ":fontana.openprojects.net 301 Pragma Nick :sleep :) [I,E,U,D] # */ -#define RPL_USERHOST 302 /* ":up to 5 userhost replies" [I,E,U,D] # */ -#define RPL_ISON 303 /* ":<list of present nicks>" [I,E,U,D] # */ -#define RPL_TEXT 304 /* [I,E,U,D] */ -#define RPL_UNAWAY 305 /* [I,E,U,D] # */ -#define RPL_NOWAWAY 306 /* [I,E,U,D] # */ -//#define RPL_USERIP 307 /* [U] */ -#define RPL_WHOISREGNICK 307 /* "???" [D] # */ -#define RPL_WHOISADMIN 308 /* "???" [d] # */ -#define RPL_WHOISSADMIN 309 /* "???" [d] # */ -#define RPL_WHOISHELPOP 310 /* "???" [D] # */ - -#define RPL_WHOISUSER 311 /* "%s %s %s * :%s" [I,E,U,D] # */ -#define RPL_WHOISSERVER 312 /* "%s %s :%s" [I,E,U,D] # */ -#define RPL_WHOISOPERATOR 313 /* "%s :is an IRC Operator" [I,E,U,D] # */ -#define RPL_WHOWASUSER 314 /* "%s %s %s * :%s" [I,E,U,D] # */ -#define RPL_ENDOFWHO 315 /* "<channel> :End of /WHO list." [I,E,U,D] # */ -#define RPL_WHOISCHANOP 316 /* "???" [I,E,D] # */ -#define RPL_WHOISIDLE 317 /* "%s %ld %ld :seconds idle, signon time" [I,E,U,D] # */ -#define RPL_ENDOFWHOIS 318 /* "%s :End of /WHOIS list." [I,E,U,D] # */ -#define RPL_WHOISCHANNELS 319 /* "%s :%s" [I,E,U,D] # */ -#define RPL_WHOISIDENTIFIED 320 /* %s :is an identified user [O] # */ -#define RPL_LISTSTART 321 /* Channel :Users Name [I,E,U,D] # */ -#define RPL_LIST 322 /* <channel> <users> :<topic> [I,E,U,D] # */ -#define RPL_LISTEND 323 /* :End of /LIST [I,E,U,D] # */ -#define RPL_CHANNELMODEIS 324 /* "<channel> +<mode>" [I,E,U,D] # */ -#define RPL_CHANNELPASSIS 325 /* "<channel> <password>" [i] */ -#define RPL_NOCHANPASS 326 /* "<channel> :No channel password" [i] */ -#define RPL_CHPASSUNKNOWN 327 /* [i] */ -#define RPL_CHANURL 328 /* [D] [services.dal.net][328] Pragma #linux :http://dalnet.linuxguru.net */ -//[04:25:18] [services.dal.net][328] rettter #cebu :none. -#define RPL_CREATIONTIME 329 /* "<channel> %lu" [E,U,D] # */ -#define RPL_WHOISAUTH 330 /* %s %s :is authed as .... [Quakenet] # */ -#define RPL_NOTOPIC 331 /* "<channel> :No topic is set." [I,E,U,D] # */ -#define RPL_TOPIC 332 /* "<channel> :%s" [I,E,U,D] # */ -#define RPL_TOPICWHOTIME 333 /* "<channel> <whoset> %lu" [e,U,D] # */ -#define RPL_LISTUSAGE 334 /* [U] */ -#define RPL_LISTSYNTAX 335 /* [D] */ -// RPL_?????????? 336-337 -#define RPL_CHANPASSOK 338 /* "<channel> :Channel password OK" [i] */ -#define RPL_BADCHANPASS 339 /* "<channel> :Invalid channel password" [i] */ -#define RPL_EQUALNICKS 339 -// RPL_?????????? 340 -#define RPL_INVITING 341 /* [I,E,U,D] */ -#define RPL_SUMMONING 342 /* [I,E,D] */ -// RPL_????????? 343-345 -#define RPL_INVITELIST 346 /* "<channel> <exceptionmask>" [I] # */ -#define RPL_ENDOFINVITELIST 347 /* "<channel> :End of Channel Invite List" [I] # */ -#define RPL_EXCEPTLIST 348 /* "<channel> <exceptionmask>" [I] # */ -#define RPL_ENDOFEXCEPTLIST 349 /* "<channel> :End of Channel Exception List" [I] # */ -// RPL_?????????? 350 -#define RPL_VERSION 351 /* "%s.%s %s :%s" [I,E,U,D] # */ -#define RPL_WHOREPLY 352 /* "<chn> <usr> <hst> <srv> <nck> <stat> :<hops> <real>"[I,E,U,D] # */ -#define RPL_NAMREPLY 353 /* "= <channel> :<space_separated_list_of_nicks>" [I,E,U,D] # */ -#define RPL_WHOSPCRPL 354 /* [U] */ -// RPL_????????? 355-360 -#define RPL_KILLDONE 361 /* [I,E,U,D] */ -#define RPL_CLOSING 362 /* [I,E,U,D] */ -#define RPL_CLOSEEND 363 /* [I,E,U,D] */ -#define RPL_LINKS 364 /* "<host> <parent> :<hops> <description>" [I,E,U,D] # */ -#define RPL_ENDOFLINKS 365 /* %s :End of /LINKS" [I,E,U,D] # */ -#define RPL_ENDOFNAMES 366 /* "%s :End of /NAMES list." [I,E,U,D] # */ -#define RPL_BANLIST 367 /* "<channel> <banmask>" [I,E,U,D] # */ -#define RPL_ENDOFBANLIST 368 /* "<channel> :End of channel Ban List" [I,E,U,D] # */ -#define RPL_ENDOFWHOWAS 369 /* "%s :END of /WHOWAS" [I,E,U,D] # */ -#define RPL_INFO 371 /* ":%s" [I,E,U,D] # */ -#define RPL_MOTD 372 /* ":- %s" [I,E,U,D] # */ -#define RPL_INFOSTART 373 /* ":Server INFO" [I,E,U,D] # */ -#define RPL_ENDOFINFO 374 /* ":End of /INFO list." [I,E,U,D] # */ -#define RPL_MOTDSTART 375 /* ":- %s Message of the Day - " [I,E,U,D] # */ -#define RPL_ENDOFMOTD 376 /* ":End of /MOTD command." [I,E,U,D] # */ -#define RPL_MOTD2 377 /* ":- %s" [?] # */ -#define RPL_MOTD3 378 /* ":- %s" [Austnet] # */ -// RPL_????????? 378-380 -#define RPL_YOUREOPER 381 /* [I,E,U,D] */ -#define RPL_REHASHING 382 /* [I,E,U,D] */ -#define RPL_YOURESERVICE 383 /* [I,D] */ -#define RPL_MYPORTIS 384 /* [I,E,U,D] */ -#define RPL_NOTOPERANYMORE 385 /* [I,E,U,D] */ -// RPL_????????? 386-390 -#define RPL_TIME 391 /* [I,E,U,D] */ -#define RPL_USERSSTART 392 /* [I,E,D] */ -#define RPL_USERS 393 /* [I,E,D] */ -#define RPL_ENDOFUSERS 394 /* [I,E,D] */ -#define RPL_NOUSERS 395 /* [I,E,D] */ -// RPL_????????? 396-399 - -// = 400-599 ====================================================================================// -// -// Errors are in the range from 400-599 currently and are grouped by what -// commands they come from. -// - -// ERR_????????? 400 -#define ERR_NOSUCHNICK 401 /* "%s :No such nick/channel" [I,E,U,D] # */ -#define ERR_NOSUCHSERVER 402 /* "%s :No such server" [I,E,U,D] # */ -#define ERR_NOSUCHCHANNEL 403 /* "%s :No such channel" [I,E,U,D] */ -#define ERR_CANNOTSENDTOCHAN 404 /* "%s :Cannot send to channel" [I,E,U,D] */ -#define ERR_TOOMANYCHANNELS 405 /* "%s :You have joined too many channels" [I,E,U,D] */ -#define ERR_WASNOSUCHNICK 406 /* "%s :There was no such nickname [I,E,U,D] # */ -#define ERR_TOOMANYTARGETS 407 /* "%s :Duplicate recipients. No message delivered" [I,E,U,D] */ -#define ERR_NOSUCHSERVICE 408 /* "%s :No such service" [I,D] */ -#define ERR_NOORIGIN 409 /* ":No origin specified" [I,E,U,D] */ -// ERR_?????????? 410 -#define ERR_NORECIPIENT 411 /* ":No recipient given (%s)" [I,E,U,D] */ -#define ERR_NOTEXTTOSEND 412 /* ":No text to send" [I,E,U,D] */ -#define ERR_NOTOPLEVEL 413 /* "%s :No toplevel domain specified" [I,E,U,D] */ -#define ERR_WILDTOPLEVEL 414 /* "%s :Wildcard in toplevel Domain" [I,E,U,D] */ -#define ERR_BADMASK 415 /* ??? [I] */ -//#define ERR_TOOMANYTARGETS 416 /* Can not understand this ... but I've found it in some docs [I] */ -#define ERR_QUERYTOOLONG 416 /* "<target> <erroneous command> :Too many lines in the output, please restrict your query [U] */ -// ERR_?????????? 417-420 -#define ERR_UNKNOWNCOMMAND 421 /* "%s :Unknown command" [I,E,U,D] # */ -#define ERR_NOMOTD 422 /* ":MOTD File is missing" [I,E,U,D] */ -#define ERR_NOADMININFO 423 /* "%s :No administrative info available" [I,E,U,D] */ -#define ERR_FILEERROR 424 /* ":File error doing %s on %s" [I,E,U,D] */ -// ERR_?????????? 425-430 -#define ERR_NONICKNAMEGIVEN 431 /* ":No nickname given" [I,E,U,D] */ -#define ERR_ERRONEUSNICKNAME 432 /* "%s :Erroneus Nickname" [I,E,U,D] # */ -#define ERR_NICKNAMEINUSE 433 /* "%s :Nickname is already in use." [I,E,U,D] # */ -#define ERR_SERVICENAMEINUSE 434 /* ??? [I,D] */ -#define ERR_SERVICECONFUSED 435 /* ??? [I,D] */ -#define ERR_NICKCOLLISION 436 /* "%s :Nickname collision KILL" [I,E,U,D] # */ -#define ERR_UNAVAILRESOURCE 437 /* ??? [I] # */ -//#define ERR_BANNICKCHANGE 437 /* ??? duplicate [U,D] */ -#define ERR_NICKTOOFAST 438 /* ??? [U] # */ -//#define ERR_NCHANGETOOFAST 438 /* ??? duplicate [D] */ -#define ERR_TARGETTOOFAST 439 /* ??? [U,D] */ -#define ERR_SERVICESDOWN 440 /* ??? [D] */ -#define ERR_USERNOTINCHANNEL 441 /* "%s %s :They aren't on that channel" [I,E,U,D] */ -#define ERR_NOTONCHANNEL 442 /* "%s :You're not on that channel" [I,E,U,D] */ -#define ERR_USERONCHANNEL 443 /* "%s %s :is already on channel" [I,E,U,D] */ -#define ERR_NOLOGIN 444 /* "%s :User not logged in" [I,E,U,D] */ -#define ERR_SUMMONDISABLED 445 /* ":SUMMON has been removed/disabled" [I,E,U,D] */ -#define ERR_USERSDISABLED 446 /* ":USERS has been removed/disabled" [I,E,U,D] */ -// ERR_?????????? 447-450 -#define ERR_NOTREGISTERED 451 /* ":You have not registered" [I,E,U,D] */ -#define ERR_IDCOLLISION 452 /* ":ID collision KILL" [i,?] */ -#define ERR_NICKLOST 453 /* "<nick> :Nickname collision; please enter a new nick" [i,?] */ -// ERR_?????????? 454 -#define ERR_HOSTILENAME 455 /* ??? [D] */ -// ERR_?????????? 456-460 -#define ERR_NEEDMOREPARAMS 461 /* "%s :Not enough parameters" [I,E,U,D] */ -#define ERR_ALREADYREGISTRED 462 /* ":You may not reregister" [I,E,U,D] */ -#define ERR_NOPERMFORHOST 463 /* ":Your host isn't among the privileged" [I,E,U,D] */ -#define ERR_PASSWDMISMATCH 464 /* ":Password Incorrect" [I,E,U,D] */ -#define ERR_YOUREBANNEDCREEP 465 /* ":You are banned from this server- %s" [I,E,U,D] */ -//[04:42:04] [forever.va.us.mystical.net][465] Pragma :You have been Autokilled. -#define ERR_YOUWILLBEBANNED 466 /* ??? [I,E,U,D] */ -#define ERR_KEYSET 467 /* "%s :Channel key already set" [I,E,U,D] */ -#define ERR_INVALIDUSERNAME 468 /* ??? [U,?] */ -//#define ERR_ONLYSERVERSCANCHANGE 468 /* ??? [D] */ -// ERR_??????????? 469-470 -#define ERR_CHANNELISFULL 471 /* "%s :Cannot join channel (+l)" [I,E,U,D] # */ -#define ERR_UNKNOWNMODE 472 /* "%c :is unknown mode char to me" [I,E,U,D] */ -#define ERR_INVITEONLYCHAN 473 /* "%s :Cannot join channel (+i)" [I,E,U,D] # */ -#define ERR_BANNEDFROMCHAN 474 /* "%s :Cannot join channel (+b)" [I,E,U,D] # */ -#define ERR_BADCHANNELKEY 475 /* "%s :Cannot join channel (+k)" [I,E,U,D] # */ -#define ERR_BADCHANMASK 476 /* "%s :Bad Channel Mask" [I,E,U,D] */ -#define ERR_MODELESS 477 /* ??? [U] */ -//#define ERR_???? 477 /* [irc.tin.it][477] [Pragma] 8 :Channel doesn't support modes [I] */ -#define ERR_NEEDREGGEDNICK 477 /* ??? [U] */ -//[03:48:45] [tiscali.uk.eu.dal.net][477] PragTest #italia :You need to identify to a registered nick to join that channel. -#define ERR_BANLISTFULL 478 /* ??? [U,D] */ -// ERR_??????????? 479-480 -#define ERR_NOPRIVILEGES 481 /* ":Permission Denied- You're not an IRC operator" [I,E,U,D] */ -#define ERR_CHANOPRIVSNEEDED 482 /* "%s :You're not channel operator" [I,E,U,D] */ -#define ERR_CANTKILLSERVER 483 /* ":You cant kill a server!" [E,U,D] */ -#define ERR_DESYNC 484 /* ??? [E] */ -#define ERR_ISCHANSERVICE 484 /* ??? [U] */ -#define ERR_CHANTOORECENT 487 /* "<channel> :Channel created too recently" [i] */ -#define ERR_TSLESSCHAN 488 /* "<channel> :Mode <mode> not available on TS-less channel" [i] */ -// ERR_??????????? 489-490 -#define ERR_NOOPERHOST 491 /* ":Only few of mere mortals may try to enter the twilight zone" [I,E,U,D] */ -#define ERR_NOSERVICEHOST 492 /* ??? [I,D] */ -// ERR_??????????? 493-500 -#define ERR_UMODEUNKNOWNFLAG 501 /* ":Unknown MODE flag" [I,E,U,D] */ -#define ERR_USERSDONTMATCH 502 /* ":Cant change mode for other users" [I,E,U,D] */ -#define ERR_GHOSTEDCLIENT 503 /* ":Message could not be delivered to %s" [E] */ -#define ERR_LAST_ERR_MSG 504 /* ":Last Error Message" [E] */ -// ERR_??????????? 505-510 -#define ERR_SILELISTFULL 511 /* ??? [U,D] */ -#define ERR_NOSUCHGLINE 512 /* ??? [U] */ -#define ERR_TOOMANYWATCH 513 /* ??? [D] */ -#define ERR_BADPING 514 /* ??? [U] */ -#define ERR_NEEDPONG 515 /* ??? [D] */ -#define ERR_LISTSYNTAX 516 /* ??? [D] */ -// DalNet (excellent) extension that substitutes the ISON ping -#define RPL_LOGON 600 /* <nick> <user> <host> <logintime> :logged online [D] # */ -#define RPL_LOGOFF 601 /* <nick> <user> <host> <logintime> :logged offline [D] # */ -#define RPL_WATCHOFF 602 /* <nick> <user> <host> <logintime> :stopped watching [D] # */ -#define RPL_WATCHSTAT 603 /* :You have <n> and are on <n> WATCH entries [D] # */ -#define RPL_NOWON 604 /* <nick> <user> <host> <logintime> :is online [D] # */ -#define RPL_NOWOFF 605 /* <nick> <user> <host> 0 :is offline [D] # */ -#define RPL_WATCHLIST 606 /* ? [D] # */ -#define RPL_ENDOFWATCH 607 /* :End of WATCH <char l=list s=stats> [D] # */ -// WeNet codepage extension -#define RPL_CODEPAGESET 700 /* :irc.wenet.ru 700 Pragma CP1251 :is now your translation scheme # */ -#define RPL_WHOISSCHEME 703 /* :interdacom.vgd.wenet.ru 703 Alexey Begemot KOI8-R :translation scheme */ - -///* 303 */ RPL_ISON, ":", -///* 304 */ RPL_TEXT, (char *)NULL, -///* 305 */ RPL_UNAWAY, ":You are no longer marked as being away", -///* 306 */ RPL_NOWAWAY, ":You have been marked as being away", - -///* 321 */ RPL_LISTSTART, "Channel :Users Name", -///* 322 */ RPL_LIST, "%s %d :%s", -///* 323 */ RPL_LISTEND, ":End of /LIST", -///* 324 */ RPL_CHANNELMODEIS, "%???" - -///* 334 */ 0, (char *)NULL, -///* 341 */ RPL_INVITING, "%s %s", -///* 342 */ RPL_SUMMONING, "%s :User summoned to irc", -///* 352 */ RPL_WHOREPLY, , -///* 361 */ RPL_KILLDONE, (char *)NULL, -///* 362 */ RPL_CLOSING, "%s :Closed. Status = %d", -///* 363 */ RPL_CLOSEEND, "%d: Connections Closed", -///* 364 */ RPL_LINKS, "%s %s :%d %s", -///* 365 */ RPL_ENDOFLINKS, "%s :End of /LINKS list.", -///* 367 */ RPL_BANLIST, "%s %s %s %lu", -///* 367 */ RPL_BANLIST, "%s %s", -///* 368 */ RPL_ENDOFBANLIST, "%s :End of Channel Ban List", -///* 369 */ RPL_ENDOFWHOWAS, "%s :End of WHOWAS", -///* 381 */ RPL_YOUREOPER, ":You have entered... the Twilight Zone!.", -///* 382 */ RPL_REHASHING, "%s :Rehashing", -///* 383 */ 0, (char *)NULL, -///* 384 */ RPL_MYPORTIS, "%d :Port to local server is\r\n", -///* 385 */ RPL_NOTOPERANYMORE, (char *)NULL, -///* 391 */ RPL_TIME, "%s :%s", -///* 392 */ RPL_USERSSTART, ":UserID Terminal Host", -///* 393 */ RPL_USERS, ":%-8s %-9s %-8s", -///* 394 */ RPL_ENDOFUSERS, ":End of Users", -///* 395 */ RPL_NOUSERS, ":Nobody logged in.", -///* 216 */ RPL_STATSKLINE, "%c %s * %s %s", -///* 216 */ RPL_STATSKLINE, "%c %s %s %s %d %d", -///* 217 */ RPL_STATSQLINE, "%c %s * %s %d %d", -///* 218 */ RPL_STATSYLINE, "%c %d %d %d %d %ld", -///* 219 */ RPL_ENDOFSTATS, "%c :End of /STATS report", -///* 221 */ RPL_UMODEIS, "%s", -///* 222 */ RPL_STATSBLINE, "%c %s * %s %d %d", -///* 223 */ RPL_STATSELINE, "%c %s * %s %d %d", -///* 224 */ RPL_STATSFLINE, "%c %s * %s %d %d", -///* 225 */ RPL_STATSDLINE, "%c %s %s", -///* 231 */ 0, (char *)NULL, -///* 232 */ 0, (char *)NULL, -///* 233 */ 0, (char *)NULL, -///* 234 */ RPL_SERVLIST, (char *)NULL, -///* 235 */ RPL_SERVLISTEND, (char *)NULL, -///* 241 */ RPL_STATSLLINE, "%c %s * %s %d %d", -///* 242 */ RPL_STATSUPTIME, ":Server Up %d days, %d:%02d:%02d", -///* 243 */ RPL_STATSOLINE, "%c %s * %s %d %d", -///* 244 */ RPL_STATSHLINE, "%c %s * %s %d %d", -///* 245 */ RPL_STATSSLINE, "%c %s * %s %d %d", -///* 250 */ RPL_STATSCONN,":Highest connection count: %d (%d clients)" -///* 261 */ RPL_TRACELOG, "File %s %d", -///* 262 */ RPL_ENDOFTRACE, "%s :End of TRACE", -//[21:04:58] [oltrelinux.azzurra.org][275] Pragma Pragma :is using a secure connection (SSL) -#endif // _KVI_NUMERIC_H_ diff --git a/3.4.0/src/kvirc/sparser/kvi_sp_ctcp.cpp b/3.4.0/src/kvirc/sparser/kvi_sp_ctcp.cpp deleted file mode 100644 index abe43b2b78..0000000000 --- a/3.4.0/src/kvirc/sparser/kvi_sp_ctcp.cpp +++ /dev/null @@ -1,1846 +0,0 @@ -//============================================================================= -// -// File : kvi_sp_ctcp.cpp -// Creation date : Thu Aug 16 2000 13:34:42 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -// FIXME: #warning "CTCP BEEP == WAKEUP == AWAKE" -// FIXME: #warning "CTCP AVATARREQ or QUERYAVATAR" - -#include "kvi_mirccntrl.h" -#include "kvi_osinfo.h" -#include "kvi_app.h" -#include "kvi_sparser.h" -#include "kvi_window.h" -#include "kvi_out.h" -#include "kvi_locale.h" -#include "kvi_ircsocket.h" -#include "kvi_channel.h" -#include "kvi_defaults.h" -#include "kvi_channel.h" -#include "kvi_query.h" -#include "kvi_ircuserdb.h" -#include "kvi_iconmanager.h" -#include "kvi_modulemanager.h" -#include "kvi_sharedfiles.h" -#include "kvi_time.h" -#include "kvi_fileutils.h" -#include "kvi_ctcppagedialog.h" -#include "kvi_useraction.h" -#include "kvi_options.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_ircconnectionantictcpflooddata.h" -#include "kvi_lagmeter.h" -#include "kvi_kvs_eventtriggers.h" -#include "kvi_kvs_script.h" -#include "kvi_sourcesdate.h" -#include "kvi_regusersdb.h" - -#include <stdlib.h> - -#include <qdatetime.h> - - - - -extern KVIRC_API KviSharedFilesManager * g_pSharedFilesManager; -extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog; - -/* - @doc: ctcp_handling - @title: - KVIrc and CTCP - @short: - For developers: Client-To-Client Protocol handling in KVIrc - @body: - [big]Introduction[/big][br] - Personally, I think that the CTCP specification is to - be symbolically printed & burned. It is really too complex - (you can go mad with the quoting specifications) - and NO IRC CLIENT supports it completely. - Here is my personal point of view on the CTCP protocol.[br] - [big]What is CTCP?[/big][br] - CTCP stands for Client-to-Client Protocol. It is designed - for exchanging almost arbitrary data between IRC clients; - the data is embedded into text messages of the underlying - IRC protocol.[br] - [big]Basic concepts[/big][br] - A CTCP message is sent as the <text> part of the PRIVMSG and - NOTICE IRC commands.[br] - To differentiate the CTCP message from a normal IRC message - text we use a delimiter character (ASCII char 1); we will - use the symbol <0x01> for this delimiter. - You may receive a CTCP message from server in one of the - following two ways:[br] - [b]:<source_mask> PRIVMSG <target> :<0x01><ctcp message><0x01>[/b][br] - [b]:<source_mask> NOTICE <target>:<0x01><ctcp message><0x01>[/b][br] - The PRIVMSG is used for CTCP REQUESTS, the NOTICE for CTCP REPLIES. - The NOTICE form should never generate an automatic reply.[br] - The two delimiters were used to begin and terminate the - CTCP message; The origial protocol allowed more than one CTCP - message inside a single IRC message. [b]Nobody sends more than - one message at once, no client can recognize it (since it - complicates the message parsing), it could be even dangerous (see below)[/b]. - It makes no real sense unless we wanted to use the CTCP protocol to embed escape sequences - into IRC messages, which is not the case.[br] - Furthermore, sending more CTCP messages in a single IRC message could - be easily used to flood a client. Assuming 450 characters available for the IRC message - text part, you could include 50 CTCP messages containing "<0x01>VERSION<0x01>".[br] - Since the VERSION replies are usually long (there can be 3 or 4 replies per IRC message), - a client that has no CTCP flood protection (or has it disabled) will surely - be disconnected while sending the replies, after only - receiving a single IRC message (no flood for the sender). - From my personal point of view, only [b]one CTCP message per IRC message[/b] - should be allowed and theoretically the trailing <0x01> delimiter can be optional.[br] - [big]How to extract the CTCP message[/big][br] - The IRC messages do not allow the following characters to be sent:[br] - <NUL> (Ascii character 0), <CR> (Carriage return), <LF> (Line feed).[br] - So finally we have four characters that [b]cannot appear literally into a - CTCP message[/b]: <NUL>,<CR>,<LF>,<0x01>.[br] - To extract a <ctcp_message> from an IRC PRIVMSG or NOTICE command you - have to perform the following actions:[br] - Find the <trailing> part of the IRC message (the one just after the ':' - delimiter, or the last message token).[br] - Check if the first character of the <trailing> is a <0x01>, if it is - we have a <ctcp_message> beginning just after <0x01>. - The trailing (optional) <0x01> can be removed in this phase - or later, assuming that it is not a valid char in the <ctcp message>.[br] - In this document I will assume that you have stripped the trailing <0x01> - and thus from now on we will deal only with the <ctcp message> part.[br] - - [big]Parsing a CTCP message: The quoting dilemma[/big][br] - Since there are characters that cannot appear in a <ctcp message>, - theoretically we should have to use a quoting mechanism. - Well, in fact, no actual CTCP message uses the quoting: there - is no need to include a <NUL>, a <CR> or <LF> inside the actually - defined messages (The only one could be CTCP SED, but I have never - seen it in action... is there any client that implements it?). - We could also leave the "quoting" to the "single message type semantic": - a message that needs to include "any character" could have its own - encoding method (Base64 for example). With the "one CTCP per IRC message" - convention we could even allow <0x01> inside messages. Only the leading - (and eventually trailing) <0x01> would be the delimiter, the other ones - would be valid characters. Finally, is there any CTCP type that needs - <0x01> inside a message? <0x01> is not printable (as well as <CR>,<LF> and <NUL>), - so only encoded messages (and again we can stick to the single message semantic) - messages or the ones including special parameters. Some machines might - allow <0x01> in filenames....well, a file with <0x01> in its name has something - broken inside, or the creator is a sort of "hacker" (so he also - knows how to rename a file...) :).[br] - Anyway, let's be pedantic, and define this quoting method. - Let's use the most intuitive method, adopted all around the world:[br] - The backslash character ('\') as escape.[br] - An escape sequence is formed by the backslash character and a number - of following ascii characters. We define the following two types of escape sequences:[br] - [b]'\XXX'[/b] (where XXX is an [b]octal number[/b] formed by three digits) - that indicates the ascii character with code that corresponds to the number.[br] - [b]'\C'[/b] (where C is a [b]CTCP valid ascii non digit character[/b]) that corresponds - literally to the character C discarding any other semantic that might be associated - with it (This will become clear later). - I've choosen the octal rappresentation just to follow a bit the old specification: - the authors seemed to like it. This point could be discussed in - some mailing list or sth. The '\C' sequence is useful to include the backslash - character (escape sequence '\\').[br] - - [big]Let's mess a little more[/big][br] - A CTCP message is made of [b]space separated parameters[/b].[br] - The natural way of separating parameters is to use the space character. - We define a "token" as a sequence of valid CTCP characters not including literal space. - A <ctcp parameter> is usally a token, but not always; - filenames can contain spaces inside names (and it happens very often!). - So one of the parameters of CTCP DCC is not a space separated token. - How do we handle it? Again a standard is missing. Some clients simply change - the filename placing underscores instead of spaces, this is a reasonable solution if used with care. - Other clients attempt to "isolate" the filename token by surrounding it with some kind - of quotes, usually the '"' or ''' characters. This is also a good solution. - Another one that naturally comes into my mind is to use the previously defined - quoting to define a "non-breaking space" character, because a space after a backslash - could lose its original semantic. Better yet, use the backslash followed by - the octal rappresentation of the space character ('\040'). - Anyway, to maintain compatibility with other popular IRC clients (such as mIRC), - let's include the '"' quotes in our standard: literal (unescaped) '"' quotes - define a single token string. To include a literal '"' character, escape it. - Additionally, the last parameter of a <ctcp message> may be made of multiple tokens. - - [big]A CTCP parameter extracting example[/big][br] - A trivial example of a C "CTCP parameter extracting routine" follows.[br] - An IRC message is made of up to 510 useable characters. - When a CTCP is sent there is a PRIVMSG or NOTICE token that uses at least 6 characters, - at least two spaces and a target token (that can not be empty, so it is at least one character) - and finally one <0x01> escape character. This gives 500 characters as maximum size - for a complete <ctcp message> and thus for a <ctcp token>. - In fact, the <ctcp message> is always smaller than 500 characters; there are usually two - <0x01> chars, there is a message source part at the beginning of the IRC message - that is 10-15 characters long, and there is a ':' character before the trailing parameter. - Anyway, to really be on the "safe side", we use a 512 character buffer for each - <ctcp token>. Finally, I'll assume that you have already ensured that - the <ctcp message> that we are extracting from is shorter than 511 characters in all, - and have provided a buffer big enough to avoid this code segfaulting. - I'm assuming that msg_ptr points somewhere in the <ctcp message> and is null-terminated.[br] - (There are C++ style comments, you might want to remove them) - [example] - const char * decode_escape(const char * msg_ptr,char * buffer) - { - // This one decodes an escape sequence - // and returns the pointer "just after it" - // and should be called when *msg_ptr points - // just after a backslash - char c; - if((*msg_ptr >= '0') && (*msg_ptr < '8')) - { - // a digit follows the backslash - c = *msg_ptr - '0'; - msg_ptr++; - if(*msg_ptr >= '0') && (*msg_ptr < '8')) - { - c = ((c << 3) + (*msg_ptr - '0')); - msg_ptr++; - if(*msg_ptr >= '0') && (*msg_ptr < '8')) - { - c = ((c << 3) + (*msg_ptr - '0')); - msg_ptr++; - } // else broken message, but let's be flexible - } // else it is broken, but let's be flexible - // append the character and return - *buffer = c; - return msg_ptr; - } else { - // simple escape: just append the following - // character (thus discarding its semantic) - *buffer = *msg_ptr; - return ++msg_ptr; - } - } - - const char * extract_ctcp_parameter(const char * msg_ptr,char * buffer,int spaceBreaks) - { - // this one extracts the "next" ctcp parameter in msg_ptr - // it skips the leading and trailing spaces. - // spaceBreaks should be set to 0 if (and only if) the - // extracted parameter is the last in the CTCP message. - int inString = 0; - while(*msg_ptr == ' ')msg_ptr++; - while(*msg_ptr) - { - switch(*msg_ptr) - { - case '\\': - // backslash : escape sequence - msg_ptr++; - if(*msg_ptr)msg_ptr = decode_escape(msg_ptr,buffer); - else return msg_ptr; // senseless backslash - break; - case ' ': - // space : separate tokens? - if(inString || (!spaceBreaks))*buffer++ = *msg_ptr++; - else { - // not in string and space breaks: end of token - // skip trailing white space (this could be avoided) - // and return - while(*msg_ptr == ' ')msg_ptr++; - return msg_ptr; - } - break; - case '"': - // a string begin or end - inString = !inString; - msg_ptr++; - break; - default: - // any other char - *buffer++ = *msg_ptr++; - break; - } - } - return msg_ptr; - } - [/example][br] - - [big]CTCP parameter semantics[/big][br] - The first <ctcp parameter> of a <ctcp message> is the <ctcp tag>: it defines - the semantic of the rest of the message.[br] - Altough it is a convention to specify the <ctcp tag> as uppercase letters, - and the original specification says that the whole <ctcp message> is - case sensitive, I'd prefer to follow the IRC message semantic (just to - have less "special cases") and treat the whole mssage as [b]case insensitive[/b].[br] - The remaining tokens depend on the <ctcp tag>. A description of known <ctcp tags> - and thus <ctcp messages> follows.[br] - - [big]PING[/big][br] - [b]Syntax: <0x01>PING <data><0x01>[/b][br] - The PING request is used to check the round trip time from one client to another. - The receiving client should reply with exactly the same message but sent - through a NOTICE instead of a PRIVMSG. The <data> usually contains an unsigned - integer but not necessairly; it is not even mandatory for <data> to be a single token. - The receiver should ignore the semantic of <data>.[br] - The reply is intended to be processed by IRC clients. - - [big]VERSION[/big][br] - [b]Syntax: <0x01>VERSION<0x01>[/b][br] - The VERSION request asks for informations about another user's IRC client program. - The reply should be sent thru a NOTICE with the following syntax:[br] - <0x01>VERSION <client_version_data><0x01>[br] - The preferred form for <client_version_data> is - "<client_name>:<client_version>:<client_enviroinement>", but historically - clients (and users) send a generic reply describing the client name, version - and eventually the used script name. This CTCP reply is intended to be human - readable, so any form is accepted. - - [big]USERINFO[/big][br] - [b]Syntax: <0x01>USERINFO<0x01>[/b][br] - The USERINFO request asks for informations about another user. - The reply should be sent thru a NOTICE with the following syntax:[br] - <0x01>USERINFO <user_info_data><0x01>[br] - The <user_info_data> should be a human readable "user defined" string; - - [big]CLIENTINFO[/big][br] - [b]Syntax: <0x01>CLIENTINFO<0x01>[/b][br] - The CLIENTINFO request asks for informations about another user's IRC client program. - While VERSION requests the client program name and version, CLIENTINFO requests - informations about CTCP capabilities.[br] - The reply should be sent thru a NOTICE with the following syntax:[br] - <0x01>CLIENTINFO <client_info_data><0x01>[br] - The <client_info_data> should contain a list of supported CTCP request tags. - The CLIENTINFO reply is intended to be human readable. - - [big]FINGER[/big][br] - [b]Syntax: <0x01>FINGER<0x01>[/b][br] - The FINGER request asks for informations about another IRC user. - The reply should be sent thru a NOTICE with the following syntax:[br] - <0x01>FINGER <user_info_data><0x01>[br] - The <user_info_data> should be a human readable string containing - the system username and possibly the system idle time; - - [big]SOURCE[/big][br] - [b]Syntax: <0x01>SOURCE<0x01>[/b][br] - The SOURCE request asks for the client homepage or ftp site informations. - The reply should be sent thru a NOTICE with the following syntax:[br] - <0x01>VERSION <homepage_url_data><0x01>[br] - This CTCP reply is intended to be human readable, so any form is accepted. - - [big]TIME[/big][br] - [b]Syntax: <0x01>TIME<0x01>[/b][br] - The TIME request asks for the user local time. - The reply should be sent thru a NOTICE with the following syntax:[br] - <0x01>TIME <time and date string><0x01>[br] - This CTCP reply is intended to be human readable, so any form is accepted. - - [big]ACTION[/big][br] - [b]Syntax: <0x01>ACTION<0x01>[/b][br] - The ACTION tag is used to describe an action.[br] - It should be sent through a NOTICE message and never generate a reply.[br] - - [big]AVATAR (equivalent to ICON or FACE)[/big][br] - [b]Syntax: <0x01>AVATAR<0x01>[/b][br] - The AVATAR tag is used to query an user's avatar.[br] - - [big]MULTIMEDIA (equivalent to MM or SOUND)[/big][br] - [b]Syntax: <0x01>MULTIMEDIA <filename><0x01>[/b][br] - The MULTIMEDIA tag is used to play a multimedia file on the receiver's side.[br] - The receiving client should locate the file associated to <filename>, - and play it. If the file can not be located - by the receiving client, and the MULTIMEDIA tag was sent through a PRIVMSG format CTCP, - the receiving client CAN request a [doc:dcc_connection]DCC GET[/doc] <filename> from the source user. - If the MULTIMEDIA tag was sent through a NOTICE message, the receiving client - should not generate any reply: the message should be notified to the receiving - client's user and then be discarded. The <filename> should never contain a leading - path. If any part of the <filename> appears to be a path component, it should be discarded. - The client may decide to drop the entire message too. Older clients (including - older releases of KVIrc) used to request the missing filenames by a particular - non-standard private message syntax. This convention should be dropped.[br] - - [big]DCC[/big][br] - [b]Syntax: <0x01>DCC <type> <type dependant parameters><0x01>[/b][br] - The DCC tag is used to initiate a Direct Client Connection. - The known dcc types are:[br] - CHAT[br] - SEND[br] - TSEND[br] - GET[br] - TGET[br] - ACCEPT[br] - RESUME[br] - -*/ - - - -void KviServerParser::encodeCtcpParameter(const char * param,KviStr &buffer,bool bSpaceBreaks) -{ - // - // This one encodes a single ctcp parameter with the simplest - // subset of rules and places it in the supplied buffer - // - if(!(*param)) - { - // empty parameter: the only reason we REALLY need the double quotes - if(bSpaceBreaks) - buffer.append("\"\""); - return; - } - - const char * begin = param; - - bool bMustQuote = false; - - while(*param) - { - switch(*param) - { - case ' ': - if(bSpaceBreaks) - { - if(param != begin)buffer.append(begin,param - begin); - buffer.append("\\040"); - param++; - begin = param; - } else { - // space is non breaking (last parameter) - param++; - } - break; - case '\r': - if(param != begin)buffer.append(begin,param - begin); - buffer.append("\\015"); - param++; - begin = param; - break; - case '\n': - if(param != begin)buffer.append(begin,param - begin); - buffer.append("\\012"); - param++; - begin = param; - break; - case '"': - if(param != begin)buffer.append(begin,param - begin); - buffer.append("\\042"); - param++; - begin = param; - break; - case '\\': - if(param != begin)buffer.append(begin,param - begin); - buffer.append("\\143"); - param++; - begin = param; - break; - case 0x01: - if(param != begin)buffer.append(begin,param - begin); - buffer.append("\\001"); - param++; - begin = param; - break; - default: - param++; - break; - } - } - - if(param != begin)buffer.append(begin,param - begin); -} - -void KviServerParser::encodeCtcpParameter(const char * parametr,QString &resultBuffer,bool bSpaceBreaks) -{ - // - // This one encodes a single ctcp parameter with the simplest - // subset of rules and places it in the supplied buffer - // - KviQCString buffer; - register const char* param=parametr; - if(!param) - { - if(bSpaceBreaks) - buffer.append("\"\""); - return; - } - if(!(*param)) - { - // empty parameter: the only reason we REALLY need the double quotes - if(bSpaceBreaks) - buffer.append("\"\""); - return; - } - - bool bMustQuote = false; - - while(*param) - { - switch(*param) - { - case ' ': - if(bSpaceBreaks) - { - buffer.append("\\040"); - param++; - } else { - buffer+=*param; - param++; - } - break; - case '\r': - buffer.append("\\015"); - param++; - break; - case '\n': - buffer.append("\\012"); - param++; - break; - case '"': - buffer.append("\\042"); - param++; - break; - case '\\': - buffer.append("\\143"); - param++; - break; - case 0x01: - buffer.append("\\001"); - param++; - break; - default: - buffer+=*param; - param++; - break; - } - } - resultBuffer=buffer; -} - - - -const char * KviServerParser::decodeCtcpEscape(const char * msg_ptr,KviStr &buffer) -{ - // - // This one decodes an octal sequence - // and returns the pointer "just after it". - // It should be called when *msg_ptr points - // just after a backslash. - // The decoded escape is appended to the buffer - // - // We're also assuming that *msg_ptr is not null here - // - char c; - if((*msg_ptr >= '0') && (*msg_ptr < '8')) - { - // a digit follows the backslash */ - c = *msg_ptr - '0'; - msg_ptr++; - if((*msg_ptr >= '0') && (*msg_ptr < '8')) - { - c = ((c << 3) + (*msg_ptr - '0')); - msg_ptr++; - if((*msg_ptr >= '0') && (*msg_ptr < '8')) - { - c = ((c << 3) + (*msg_ptr - '0')); - msg_ptr++; - } // else broken message, but let's be flexible - } // else it is broken, but let's be flexible - buffer.append(c); - return msg_ptr; - } - - if(*msg_ptr == 'r') - { - buffer.append('\r'); - return ++msg_ptr; - } - - if(*msg_ptr == 'n') - { - buffer.append('\n'); - return ++msg_ptr; - } - - // - // null escape: just append the following - // character (thus discarding its semantics) - // - - buffer.append(msg_ptr); - return ++msg_ptr; -} - - -const char * KviServerParser::decodeCtcpEscape(const char * msg_ptr,KviQCString &buffer) -{ - // - // This one decodes an octal sequence - // and returns the pointer "just after it". - // It should be called when *msg_ptr points - // just after a backslash. - // The decoded escape is appended to the buffer - // - // We're also assuming that *msg_ptr is not null here - // - char c; - if((*msg_ptr >= '0') && (*msg_ptr < '8')) - { - // a digit follows the backslash */ - c = *msg_ptr - '0'; - msg_ptr++; - if((*msg_ptr >= '0') && (*msg_ptr < '8')) - { - c = ((c << 3) + (*msg_ptr - '0')); - msg_ptr++; - if((*msg_ptr >= '0') && (*msg_ptr < '8')) - { - c = ((c << 3) + (*msg_ptr - '0')); - msg_ptr++; - } // else broken message, but let's be flexible - } // else it is broken, but let's be flexible - buffer+= (c ? c : ' ') ; - return msg_ptr; - } - - if(*msg_ptr == 'r') - { - buffer+='\r'; - return ++msg_ptr; - } - if(*msg_ptr == 'n') - { - buffer+='\n'; - return ++msg_ptr; - } - // - // null escape: just append the following - // character (thus discarding its semantics) - // - - buffer+=*msg_ptr; - return ++msg_ptr; -} - - -const char * KviServerParser::extractCtcpParameter(const char * msg_ptr,KviStr &buffer,bool bSpaceBreaks) -{ - // - // This one extracts the "next" ctcp parameter in msg_ptr - // and puts it in the supplied buffer. - // It is assumed that the leading and trailing CTCP - // tags have been already removed. - // Skips the leading and trailing spaces. - // bSpaceBreaks should be set to false if (and only if) the - // extracted parameter is the last in a positional parameter - // based CTCP message. - // - - int bInString = 0; - if(!msg_ptr) return 0; - while(*msg_ptr == ' ')msg_ptr++; // skip leading spaces - - if(*msg_ptr == '"') - { - // a quoted parameter - bInString = 1; - msg_ptr++; - } - - const char * begin = msg_ptr; - - while(*msg_ptr) - { - switch(*msg_ptr) - { - case '\\': - // backslash : escape sequence - if(msg_ptr != begin)buffer.append(begin,msg_ptr - begin); - msg_ptr++; - if(*msg_ptr) - { - // decode the escape - msg_ptr = decodeCtcpEscape(msg_ptr,buffer); - begin = msg_ptr; - } - // else it is a senseless trailing backslash. - // Just ignore and let the function - // return spontaneously. - break; - case ' ': - // space : separate tokens if not in string - if(bInString || (!bSpaceBreaks))msg_ptr++; - else { - // Not in string and space breaks: end of token - // skip trailing white space (this could be avoided) - // and return - if(msg_ptr != begin)buffer.append(begin,msg_ptr - begin); - while(*msg_ptr == ' ')msg_ptr++; - return msg_ptr; - } - break; - case '"': - if(bInString) - { - // A string terminator. We don't return - // immediately since if !bSpaceBreaks - // we must handle tokens until the end - // and otherwise we just run up to the - // next breaking space (but that's a bug anyway, heh). - if(msg_ptr != begin)buffer.append(begin,msg_ptr - begin); - bInString = 0; - msg_ptr++; - begin = msg_ptr; - } else { - // we don't begin a string here - // since we're in the middle of the token - // it is assumed to be simply a non encoded " - msg_ptr++; - } - break; - default: - // any other char - msg_ptr++; - break; - } - } - if(msg_ptr != begin)buffer.append(begin,msg_ptr - begin); - return msg_ptr; -} - -const char * KviServerParser::extractCtcpParameter(const char * p_msg_ptr,QString &resultBuffer,bool bSpaceBreaks) -{ - // - // This one extracts the "next" ctcp parameter in p_msg_ptr - // and puts it in the supplied buffer. - // It is assumed that the leading and trailing CTCP - // tags have been already removed. - // Skips the leading and trailing spaces. - // bSpaceBreaks should be set to false if (and only if) the - // extracted parameter is the last in a positional parameter - // based CTCP message. - // - - KviQCString buffer; - register const char* msg_ptr=p_msg_ptr; - int bInString = 0; - if(!msg_ptr) return 0; - while(*msg_ptr == ' ')msg_ptr++; // skip leading spaces - - if(*msg_ptr == '"') - { - // a quoted parameter - bInString = 1; - msg_ptr++; - } - - while(*msg_ptr) - { - switch(*msg_ptr) - { - case '\\': - // backslash : escape sequence - msg_ptr++; - if(*msg_ptr) - { - // decode the escape - msg_ptr = decodeCtcpEscape(msg_ptr,buffer); - } - // else it is a senseless trailing backslash. - // Just ignore and let the function - // return spontaneously. - break; - case ' ': - // space : separate tokens if not in string - if(bInString || (!bSpaceBreaks)) { - buffer+=*msg_ptr; - msg_ptr++; - } - else { - // Not in string and space breaks: end of token - // skip trailing white space (this could be avoided) - // and return - while(*msg_ptr == ' ')msg_ptr++; - resultBuffer=buffer; - return msg_ptr; - } - break; - case '"': - if(bInString) - { - // A string terminator. We don't return - // immediately since if !bSpaceBreaks - // we must handle tokens until the end - // and otherwise we just run up to the - // next breaking space (but that's a bug anyway, heh). - buffer+=*msg_ptr; - bInString = 0; - msg_ptr++; - } else { - // we don't begin a string here - // since we're in the middle of the token - // it is assumed to be simply a non encoded " - buffer+=*msg_ptr; - msg_ptr++; - } - break; - default: - // any other char - buffer+=*msg_ptr; - msg_ptr++; - break; - } - } - resultBuffer=buffer; - return msg_ptr; -} - - - - - -void KviServerParser::parseCtcpRequest(KviCtcpMessage *msg) -{ - msg->pData = extractCtcpParameter(msg->pData,msg->szTag); - - bool bDCCRequest = msg->szTag == "DCC" || msg->szTag == "XDCC" || msg->szTag == "TDCC"; - - bool bAction = (msg->szTag == "ACTION"); - - if (bDCCRequest) - { - if (KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpDcc)) - { - msg->msg->console()->output(KVI_OUT_IGNORE,__tr2qs("Ignoring DCC from \r!nc\r%s\r [%s@\r!h\r%s\r]"), - KviQString::toUtf8(msg->pSource->nick()).data(), - KviQString::toUtf8(msg->pSource->user()).data(), - KviQString::toUtf8(msg->pSource->host()).data() - ); - return; - } - } else { - KviRegisteredUser * u = msg->msg->connection()->userDataBase()->registeredUser(msg->pSource->nick(),msg->pSource->user(),msg->pSource->host()); - //Ignore it? - if(u) - { - if( (!bAction && u->isIgnoreEnabledFor(KviRegisteredUser::Ctcp)) || - (bAction && u->isIgnoreEnabledFor(IS_ME(msg->msg,msg->szTarget) ? KviRegisteredUser::Query : KviRegisteredUser::Channel)) ) - { - if (KVI_OPTION_BOOL(KviOption_boolVerboseIgnore)) - { - msg->msg->console()->output(KVI_OUT_IGNORE,__tr2qs("Ignoring CTCP from \r!nc\r%s\r [%s@\r!h\r%s\r]"), - KviQString::toUtf8(msg->pSource->nick()).data(), - KviQString::toUtf8(msg->pSource->user()).data(), - KviQString::toUtf8(msg->pSource->host()).data() - ); - } - return; - } - } - } - - bool bCtcpVersion = KviQString::equalCI(msg->szTag,"VERSION"); - - for(int i=0;m_ctcpRequestParseProcTable[i].msgName;i++) - { - if(KviQString::equalCI(msg->szTag,m_ctcpRequestParseProcTable[i].msgName)) - { - if(!(m_ctcpReplyParseProcTable[i].iFlags & KVI_CTCP_MESSAGE_PARSE_TRIGGERNOEVENT)) - { - QString szData = msg->msg->connection()->decodeText(msg->pData); - //do not allow to make faked version reply - if(!(bCtcpVersion && KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpVersion))) - { - if(KVS_TRIGGER_EVENT_6_HALTED(KviEvent_OnCtcpRequest, \ - msg->msg->console(), \ - msg->pSource->nick(), \ - msg->pSource->user(), \ - msg->pSource->host(), \ - msg->szTarget, \ - msg->szTag, \ - szData) && !bCtcpVersion)return; - } - } - (this->*(m_ctcpRequestParseProcTable[i].proc))(msg); - return; - } - } - - QString szData = msg->msg->connection()->decodeText(msg->pData); - // trigger the event on unrecognized requests too - if(KVS_TRIGGER_EVENT_6_HALTED(KviEvent_OnCtcpRequest, \ - msg->msg->console(), \ - msg->pSource->nick(), \ - msg->pSource->user(), \ - msg->pSource->host(), \ - msg->szTarget, \ - msg->szTag, - szData)) - return; - - // unknown - msg->bUnknown = true; - echoCtcpRequest(msg); -} - -void KviServerParser::parseCtcpReply(KviCtcpMessage *msg) -{ - msg->pData = extractCtcpParameter(msg->pData,msg->szTag); - - for(int i=0;m_ctcpReplyParseProcTable[i].msgName;i++) - { - if(KviQString::equalCI(msg->szTag,m_ctcpReplyParseProcTable[i].msgName)) - { - if(!(m_ctcpReplyParseProcTable[i].iFlags & KVI_CTCP_MESSAGE_PARSE_TRIGGERNOEVENT)) - { - QString szData = msg->msg->connection()->decodeText(msg->pData); - if(KVS_TRIGGER_EVENT_6_HALTED(KviEvent_OnCtcpReply, \ - msg->msg->console(),msg->pSource->nick(),msg->pSource->user(), \ - msg->pSource->host(),msg->szTarget,msg->szTag,szData))return; - } - (this->*(m_ctcpReplyParseProcTable[i].proc))(msg); - return; - } - } - - QString szData = msg->msg->connection()->decodeText(msg->pData); - // trigger the event on unrecognized replies too - if(KVS_TRIGGER_EVENT_6_HALTED(KviEvent_OnCtcpReply, \ - msg->msg->console(),msg->pSource->nick(),msg->pSource->user(), \ - msg->pSource->host(),msg->szTarget,msg->szTag,szData))return; - - // unknown - msg->bUnknown = true; - echoCtcpReply(msg); -} - - -// Ctcp message handlers - -bool KviServerParser::checkCtcpFlood(KviCtcpMessage *msg) -{ - if(!KVI_OPTION_BOOL(KviOption_boolUseCtcpFloodProtection))return false; - - kvi_time_t tNow = kvi_unixTime(); - - KviIrcConnectionAntiCtcpFloodData * d = msg->msg->connection()->antiCtcpFloodData(); - - unsigned int interval = (unsigned int)(((unsigned int)tNow) - ((unsigned int)d->lastCtcpTime())); - - if(interval < KVI_OPTION_UINT(KviOption_uintCtcpFloodCheckInterval)) - { - d->increaseCtcpCount(); - if(d->ctcpCount() > KVI_OPTION_UINT(KviOption_uintMaxCtcpRequests)) - { - // This is flood - msg->bIsFlood = true; - return true; - } - } else { - d->setLastCtcpTime(tNow); - d->setCtcpCount(1); - } - return false; -} - - -void KviServerParser::replyCtcp(KviCtcpMessage *msg,const char * data) -{ - KviQCString szNick = msg->msg->connection()->encodeText(msg->pSource->nick()); - msg->msg->connection()->sendFmtData("NOTICE %s :%c%s %s%c", - szNick.data(),0x01,msg->msg->connection()->encodeText(msg->szTag).data(),msg->msg->connection()->encodeText(data).data(),0x01); -} - -void KviServerParser::echoCtcpReply(KviCtcpMessage * msg) -{ - if(!msg->msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolCtcpRepliesToActiveWindow) ? msg->msg->console()->activeWindow() : msg->msg->console(); - - bool bIsChannel = false; - - if(!IS_ME(msg->msg,msg->szTarget)) - { - // Channel ctcp request! - pOut = msg->msg->connection()->findChannel(msg->szTarget); - if(!pOut) - { - pOut = msg->msg->console(); - pOut->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("The following CTCP reply has unrecognized target %Q"),&(msg->szTarget)); - } else bIsChannel = true; - } - - QString szData = msg->msg->connection()->decodeText(msg->pData); - - QString szWhat = bIsChannel ? __tr2qs("Channel CTCP") : QString("CTCP"); - - pOut->output( - msg->bUnknown ? KVI_OUT_CTCPREPLYUNKNOWN : KVI_OUT_CTCPREPLY, - __tr2qs("%Q %Q reply from \r!n\r%Q\r [%Q@\r!h\r%Q\r]: %Q"), - &szWhat,&(msg->szTag),&(msg->pSource->nick()),&(msg->pSource->user()), - &(msg->pSource->host()),&szData); - } -} - - -void KviServerParser::echoCtcpRequest(KviCtcpMessage *msg) -{ - // FIXME: #warning "DEDICATED CTCP WINDOW...MINIMIZED ?" - if(!msg->msg->haltOutput()) - { - QString req = msg->szTag; - if(*(msg->pData)) { - req.append(" "); - req.append(msg->pData); - } - - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolCtcpRequestsToActiveWindow) ? msg->msg->console()->activeWindow() : msg->msg->console(); - - bool bIsChannel = false; - - if(!IS_ME(msg->msg,msg->szTarget)) - { - // Channel ctcp request! - pOut = msg->msg->connection()->findChannel(msg->szTarget); - if(!pOut) - { - pOut = msg->msg->console(); - pOut->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("The following CTCP request has unrecognized target %Q"), - &(msg->szTarget)); - } else bIsChannel = true; - } - - QString szRequest = pOut->decodeText(req); - QString szTag = pOut->decodeText(msg->szTag); - QString szWhat = bIsChannel ? __tr2qs("Channel CTCP") : QString("CTCP"); - - if(msg->bIsFlood) - { - QString szData = msg->msg->connection()->decodeText(msg->pData); - if(!KVS_TRIGGER_EVENT_6_HALTED(KviEvent_OnCtcpFlood,pOut,msg->pSource->nick(),msg->pSource->username(),msg->pSource->host(),msg->szTarget,msg->szTag,szData)) - pOut->output(KVI_OUT_CTCPREQUESTFLOOD, - __tr2qs("%Q %Q%c request from \r!n\r%Q\r [%Q@\r!h\r%Q\r] (%Q), ignored (flood limit exceeded)"), - &szWhat,&szTag,KVI_TEXT_RESET,&(msg->pSource->nick()), - &(msg->pSource->user()),&(msg->pSource->host()),&szRequest); - } else { - QString szAction = msg->bUnknown ? __tr2qs("ignored (unrecognized)") : - (msg->bIgnored ? __tr2qs("ignored") : __tr2qs("replied")); - pOut->output( - msg->bUnknown ? KVI_OUT_CTCPREQUESTUNKNOWN : - (msg->bIgnored ? KVI_OUT_CTCPREQUESTIGNORED : KVI_OUT_CTCPREQUESTREPLIED), - __tr2qs("%Q %Q%c request from \r!n\r%Q\r [%Q@\r!h\r%Q\r] (%Q), %Q"), - &szWhat,&szTag,KVI_TEXT_RESET,&(msg->pSource->nick()), - &(msg->pSource->user()),&(msg->pSource->host()),&szRequest,&szAction); - } - } -} - - - -void KviServerParser::parseCtcpRequestPing(KviCtcpMessage *msg) -{ - if(!checkCtcpFlood(msg)) - { - if(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpPing)) - { - replyCtcp(msg,msg->pData); - } else msg->bIgnored = true; - } - - echoCtcpRequest(msg); -} - -void KviServerParser::parseCtcpReplyPing(KviCtcpMessage * msg) -{ - if(!msg->msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolCtcpRepliesToActiveWindow) ? msg->msg->console()->activeWindow() : msg->msg->console(); - - bool bIsChannel = false; - - if(!IS_ME(msg->msg,msg->szTarget)) - { - // Channel ctcp request! - pOut = msg->msg->connection()->findChannel(msg->szTarget); - if(!pOut) - { - pOut = msg->msg->console(); - pOut->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("The following CTCP PING reply has unrecognized target \"%Q\""), - &(msg->szTarget)); - } else bIsChannel = true; - } - - unsigned int uSecs; - unsigned int uMSecs = 0; - - KviStr szTime; - - struct timeval tv; - kvi_gettimeofday(&tv,0); - - msg->pData = extractCtcpParameter(msg->pData,szTime,true); - - bool bOk; - - if(szTime.contains('.')) - { - KviStr szUSecs = szTime; - szUSecs.cutToFirst('.'); - szTime.cutFromFirst('.'); - - uMSecs = szUSecs.toUInt(&bOk); - if(!bOk) - { - uMSecs = 0; - tv.tv_usec = 0; - } - } else tv.tv_usec = 0; - - - uSecs = szTime.toUInt(&bOk); - if(!bOk)pOut->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("The following CTCP PING reply has a broken time identifier \"%S\", don't trust the displayed time"),&szTime); - - unsigned int uDiffSecs = tv.tv_sec - uSecs; - - //unsigned int uDiffMSecs = ((((unsigned int)tv.tv_usec) - uMSecs) / 1000) % 1000; - //if ((uMSecs / 1000000) <= uDiffSecs) uDiffSecs -= (uMSecs / 1000000) - - while(uMSecs > 1000000)uMSecs /= 10; // precision too high? - if(((unsigned int)tv.tv_usec) < uMSecs) - { - tv.tv_usec += 1000000; - if(uDiffSecs > 0)uDiffSecs --; - } - unsigned int uDiffMSecs = (tv.tv_usec - uMSecs) / 1000; - - QString szWhat = bIsChannel ? __tr2qs("Channel CTCP") : QString("CTCP"); - - pOut->output( - msg->bUnknown ? KVI_OUT_CTCPREPLYUNKNOWN : KVI_OUT_CTCPREPLY, - __tr2qs("%Q PING reply from \r!n\r%Q\r [%Q@\r!h\r%Q\r]: %u sec %u msec"), - &szWhat,&(msg->pSource->nick()), - &(msg->pSource->user()),&(msg->pSource->host()),uDiffSecs,uDiffMSecs); - } -} - - -void KviServerParser::parseCtcpRequestVersion(KviCtcpMessage *msg) -{ - if(!checkCtcpFlood(msg)) - { - if(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpVersion)) - { - QString szVersion; -#ifdef COMPILE_USE_QT4 - #define QT4_TAG " (QT4) " -#else - #define QT4_TAG -#endif - -#ifdef COMPILE_ON_WINDOWS - szVersion = "KVIrc " KVI_VERSION QT4_TAG " '" KVI_RELEASE_NAME "' " KVI_SOURCES_DATE " - build " KVI_BUILD_DATE; - szVersion.append(QString(" - %1").arg(KviOsInfo::version())); -#else - szVersion = "KVIrc " KVI_VERSION QT4_TAG " '" KVI_RELEASE_NAME "' " KVI_SOURCES_DATE " - build " KVI_BUILD_DATE " - " KVI_BUILD_FLAGS; - szVersion.append(QString(" - %1 (%2)").arg(KviOsInfo::name()).arg(KviOsInfo::release())); -#endif - //szVersion.append(QString(" - QT Version: %1 - %2").arg(qVersion()).arg(__tr2qs("http://www.kvirc.net/"))); - if(!KVI_OPTION_STRING(KviOption_stringCtcpVersionPostfix).isEmpty()) - { - QString sz = KVI_OPTION_STRING(KviOption_stringCtcpVersionPostfix); - if(!sz.isEmpty()) - { - szVersion.append(" :"); - szVersion.append(sz); - } - } - replyCtcp(msg,szVersion.utf8().data()); - } else msg->bIgnored = true; - } - - echoCtcpRequest(msg); -} - -void KviServerParser::parseCtcpRequestUserinfo(KviCtcpMessage *msg) -{ - if(!checkCtcpFlood(msg)) - { - if(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpUserinfo)) - { - QString szReply; - if(!KVI_OPTION_STRING(KviOption_stringCtcpUserInfoAge).isEmpty()) - { - szReply = "Age="; - szReply += KVI_OPTION_STRING(KviOption_stringCtcpUserInfoAge); - } - if(!KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender).isEmpty()) - { - if(!szReply.isEmpty())szReply += "; "; - szReply += "Gender="; - szReply += KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender); - } - if(!KVI_OPTION_STRING(KviOption_stringCtcpUserInfoLocation).isEmpty()) - { - if(!szReply.isEmpty())szReply += "; "; - szReply += "Location="; - szReply += KVI_OPTION_STRING(KviOption_stringCtcpUserInfoLocation); - } - if(!KVI_OPTION_STRING(KviOption_stringCtcpUserInfoLanguages).isEmpty()) - { - if(!szReply.isEmpty())szReply += "; "; - szReply += "Languages="; - szReply += KVI_OPTION_STRING(KviOption_stringCtcpUserInfoLanguages); - } - if(!KVI_OPTION_STRING(KviOption_stringCtcpUserInfoOther).isEmpty()) - { - if(!szReply.isEmpty())szReply += "; "; - szReply += KVI_OPTION_STRING(KviOption_stringCtcpUserInfoOther); - } - if(szReply.isEmpty())szReply = KVI_DEFAULT_CTCP_USERINFO_REPLY; - replyCtcp(msg,szReply.utf8().data()); - } else msg->bIgnored = true; - } - - echoCtcpRequest(msg); -} - -// FIXME: CTCP SEX , AGE , LOCATION!!! <--- so we will be safe :) -// FIXME: KEEP THIS TABLE UP TO DATE - -static const char * ctcpTagTable[][2]= -{ - { "PING" , "Returns given parameters without parsing them" }, - { "VERSION" , "Returns the version of this client" }, - { "CLIENTINFO" , "With no parameters, lists supported CTCP tags," \ - " 'CLIENTINFO <tag>' describes <tag>" }, - { "USERINFO" , "Returns personal information about the current user" }, - { "FINGER" , "Returns information about the current user" }, - { "SOURCE" , "Returns the client homepage URL" }, - { "TIME" , "Returns the current local time" }, - { "ACTION" , "Used to describe actions, generates no reply" }, - { "AVATAR" , "Returns the current avatar (may trigger a DCC GET) or" \ - " sets your own on this side if sent through a NOTICE" }, - { "DCC" , "Initiates a DCC connection (XDCC,TDCC)" }, - { "PAGE" , "Leaves a message for this user" }, - { 0 , 0 } -}; - -void KviServerParser::parseCtcpRequestClientinfo(KviCtcpMessage *msg) -{ - // this is completely latin1 - if(!checkCtcpFlood(msg)) - { - if(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpClientinfo)) - { - KviStr szTag; - msg->pData = extractCtcpParameter(msg->pData,szTag,false); - szTag.stripWhiteSpace(); - szTag.toUpper(); - if(szTag.isEmpty()) - { - KviStr reply("KVIrc " KVI_VERSION " '" KVI_RELEASE_NAME "' " KVI_SOURCES_DATE " - http://www.kvirc.net - Supported tags: "); - for(int i=0;ctcpTagTable[i][0];i++) - { - reply.append(ctcpTagTable[i][0]); - if(ctcpTagTable[i + 1][0])reply.append(','); - } - reply.append(" - Use 'CLIENTINFO <tag>' for a description of each tag"); - replyCtcp(msg,reply.ptr()); - } else { - bool bFound = false; - for(int i=0;ctcpTagTable[i][0] && !bFound;i++) - { - if(kvi_strEqualCS(ctcpTagTable[i][0],szTag.ptr())) - { - KviStr reply(KviStr::Format,"%s: %s",ctcpTagTable[i][0],ctcpTagTable[i][1]); - replyCtcp(msg,reply.ptr()); - bFound = true; - } - } - if(!bFound) - { - msg->szTag= "ERRMSG"; - KviStr reply(KviStr::Format,"Unsupported tag %s",szTag.ptr()); - replyCtcp(msg,reply.ptr()); - } - } - } else msg->bIgnored = true; - } - - echoCtcpRequest(msg); -} - -void KviServerParser::parseCtcpRequestFinger(KviCtcpMessage *msg) -{ - // completely latin1 atm - if(!checkCtcpFlood(msg)) - { - if(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpFinger)) - { - KviStr username = getenv("USER"); - if(username.isEmpty())username = getenv("LOGNAME"); - if(username.isEmpty())username = msg->msg->connection()->userInfo()->userName(); - // FIXME: #warning "UTSNAME ?...AND OTHER INFO ?...SYSTEM IDLE TIME ?...KVIRC IDLE TIME ?" - KviStr reply(KviStr::Format,"%s",username.ptr()); - replyCtcp(msg,reply.ptr()); - } else msg->bIgnored = true; - } - - echoCtcpRequest(msg); -} - -void KviServerParser::parseCtcpRequestSource(KviCtcpMessage *msg) -{ - if(!checkCtcpFlood(msg)) - { - if(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpSource)) - { - QString version = "KVIrc " KVI_VERSION " '" KVI_RELEASE_NAME "' - http://www.kvirc.net/"; - if(!KVI_OPTION_STRING(KviOption_stringCtcpSourcePostfix).isEmpty()) - { - version+=" :"; - version+= KVI_OPTION_STRING(KviOption_stringCtcpSourcePostfix); - } - replyCtcp(msg,version.utf8().data()); - } else msg->bIgnored = true; - } - - echoCtcpRequest(msg); -} - -void KviServerParser::parseCtcpRequestTime(KviCtcpMessage *msg) -{ - if(!checkCtcpFlood(msg)) - { - if(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpTime)) - { - replyCtcp(msg,QDateTime::currentDateTime().toString()); - } else msg->bIgnored = true; - } - - echoCtcpRequest(msg); -} - -void KviServerParser::parseCtcpRequestPage(KviCtcpMessage *msg) -{ - if(!checkCtcpFlood(msg)) - { - if(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpPage)) - { - KVI_OPTION_STRING(KviOption_stringCtcpPageReply).stripWhiteSpace(); - if(KVI_OPTION_STRING(KviOption_stringCtcpPageReply).isEmpty()) - { - KVI_OPTION_STRING(KviOption_stringCtcpPageReply) = KVI_DEFAULT_CTCP_PAGE_REPLY; - } - replyCtcp(msg,KVI_OPTION_STRING(KviOption_stringCtcpPageReply)); - if(KVI_OPTION_BOOL(KviOption_boolShowDialogOnCtcpPage)) - { - if(!g_pCtcpPageDialog)g_pCtcpPageDialog = new KviCtcpPageDialog(); - KviStr szData8; - szData8 = msg->pData; - QString szData; - szData = msg->msg->connection()->decodeText(szData8.ptr()); - g_pCtcpPageDialog->addPage(msg->pSource->nick(),msg->pSource->user(),msg->pSource->host(),szData); - g_pCtcpPageDialog->popup(); - } - } else msg->bIgnored = true; - } - - echoCtcpRequest(msg); -} - -void KviServerParser::parseCtcpRequestAction(KviCtcpMessage *msg) -{ - KviStr szData8; - // CTCP ACTION is a special exception... most clients do not encode/decode it. - //msg->pData = extractCtcpParameter(msg->pData,szData8,false); - szData8 = msg->pData; - - KviWindow * pOut = 0; - bool bIsChannel = !IS_ME(msg->msg,msg->szTarget); - - QString szData; - - if(bIsChannel) - { - pOut = (KviWindow *)msg->msg->connection()->findChannel(msg->szTarget); - if(pOut)szData = pOut->decodeText(szData8.ptr()); - else szData = msg->msg->connection()->decodeText(szData8.ptr()); - } else { - KviQuery * query = msg->msg->connection()->findQuery(msg->pSource->nick()); - if(!query) - { - szData = msg->msg->connection()->decodeText(szData8.ptr()); - // New query requested ? - // FIXME: #warning "CHECK FOR SPAM!" - if(KVI_OPTION_BOOL(KviOption_boolCreateQueryOnPrivmsg)) - { - // We still want to create it - // Give the scripter a chance to filter it out again - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnQueryWindowRequest,msg->msg->console(), - msg->pSource->nick(), - msg->pSource->username(), - msg->pSource->host(), - szData)) - { - // check if the scripter hasn't created it - query = msg->msg->connection()->findQuery(msg->pSource->nick()); - } else { - // no query yet, create it! - // this will trigger OnQueryWindowCreated - query = msg->msg->console()->connection()->createQuery(msg->pSource->nick()); - query->setTarget(msg->pSource->nick(),msg->pSource->username(),msg->pSource->host()); - } - } - } - pOut = (KviWindow *)query; - if(pOut)szData = pOut->decodeText(szData8.ptr()); - else szData = msg->msg->connection()->decodeText(szData8.ptr()); - } - - bool bTargetFound = pOut; - if(!pOut) - { - pOut = KVI_OPTION_BOOL(KviOption_boolExternalMessagesToActiveWindow) ? msg->msg->console()->activeWindow() : msg->msg->console(); - } - - if(KVS_TRIGGER_EVENT_5_HALTED(KviEvent_OnAction,pOut, - msg->pSource->nick(), - msg->pSource->username(), - msg->pSource->host(), - msg->szTarget, - szData - )) - { - msg->msg->setHaltOutput(); - return; - } - - int type = msg->msg->console()->applyHighlighting(pOut,KVI_OUT_ACTION,msg->pSource->nick(),msg->pSource->user(),msg->pSource->host(),szData); - - if(type < 0)return; // event stopped the message! - if(type == KVI_OUT_HIGHLIGHT) - { - if(!pOut->hasAttention()) - { - if(KVI_OPTION_BOOL(KviOption_boolFlashWindowOnHighlightedMessages)) - pOut->demandAttention(); - if(KVI_OPTION_BOOL(KviOption_boolPopupNotifierOnHighlightedMessages)) - { - QString szMsg = "<b>"; - szMsg += msg->pSource->nick(); - szMsg += "</b> "; - szMsg += szData; - //debug("kvi_sp_ctcp.cpp:975 debug: %s",szMsg.data()); - g_pApp->notifierMessage(pOut,KVI_OPTION_MSGTYPE(KVI_OUT_ACTION).pixId(),szMsg,90); - } - } - } - - if(bTargetFound) - { - QString szMsg = QString("\r!n\r%1\r ").arg(msg->pSource->nick()); - szMsg += szData; - if(bIsChannel) - { - ((KviChannel *)pOut)->outputMessage(type,szMsg); - } else { - pOut->outputNoFmt(type,szMsg); - } - } else { - if(bIsChannel) - { - pOut->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("The following CTCP ACTION has unrecognized target %Q"), - &(msg->szTarget)); - } - KviStr buffer1,buffer2; - pOut->output(type, - __tr2qs("CTCP ACTION from \r!n\r%Q\r [%Q@\r!h\r%Q\r]: %Q"), - &(msg->pSource->nick()),&(msg->pSource->user()), - &(msg->pSource->host()),&szData); - } -} - -// FIXME: #warning "UTSNAME ?...AND OTHER INFO ?...SYSTEM IDLE TIME ?...KVIRC IDLE TIME ?" - -void KviServerParser::parseCtcpRequestAvatar(KviCtcpMessage *msg) -{ - // AVATAR - if(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpAvatar)) - { - QString szGenderTag=" "; - if(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender).startsWith("m",false)){ - szGenderTag.append("M"); - } else if(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender).startsWith("f",false)){ - szGenderTag.append("F"); - } else { - szGenderTag.append("?"); - } - - KviAvatar * a = msg->msg->console()->currentAvatar(); - if(a) - { - if(!checkCtcpFlood(msg)) - { - // FIXME: #warning "OPTION FOR SETTING A FIXED BIND ADDRESS FOR OUTGOING DCC OFFERS" - QString szUserMask; - msg->pSource->mask(szUserMask); - - QString szReply,szFileName; - szFileName=a->name(); - if(KVI_OPTION_BOOL(KviOption_boolDCCFileTransferReplaceOutgoingSpacesWithUnderscores)) - szFileName.replace(" ","_"); - - // escape the spaces with the right octal code - encodeCtcpParameter(szFileName,szReply); - - - if(!a->isRemote()) - { - KviSharedFile * o; - if(!(o = g_pSharedFilesManager->addSharedFile(szFileName,a->localPath(),szUserMask,KVI_OPTION_UINT(KviOption_uintAvatarOfferTimeoutInSecs)))) - { - // Don't delete o...it has been already deleted by g_pSharedFilesManager - msg->msg->console()->output(KVI_OUT_SYSTEMWARNING,__tr2qs("Unable to add file offer for file %Q (File not readable?)"),&(a->localPath())); - } else { - if(_OUTPUT_VERBOSE) - { - msg->msg->console()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Added %d sec file offer for file %Q (%Q) to recipient %Q"), - KVI_OPTION_UINT(KviOption_uintAvatarOfferTimeoutInSecs),&(a->name()),&(a->localPath()),&szUserMask); - } - } - //if(o)szReply.append(QString(" %1").arg(o->fileSize())); - } - - szReply.append(szGenderTag); - replyCtcp(msg,szReply.utf8().data()); - } - } else { - // no avatar set.. ignore channel requests if the user wishes - if(!IS_ME(msg->msg,msg->szTarget)) - { - // channel target - if(KVI_OPTION_BOOL(KviOption_boolIgnoreChannelAvatarRequestsWhenNoAvatarSet))msg->bIgnored = true; - } - if(!msg->bIgnored)replyCtcp(msg,""); - } - } else msg->bIgnored = true; - - echoCtcpRequest(msg); -} - - -void KviServerParser::parseCtcpReplyAvatar(KviCtcpMessage *msg) -{ - QString szRemoteFile; - QString szGender; - QString decoded=msg->msg->console()->decodeText(msg->pData); - - decoded = extractCtcpParameter(decoded.utf8().data(),szRemoteFile,true); - decoded = extractCtcpParameter(decoded.utf8().data(),szGender,true); - szRemoteFile.stripWhiteSpace(); - - bool bPrivate = IS_ME(msg->msg,msg->szTarget); - - QString textLine; - KviAvatar * avatar = 0; - - bool bResetAvatar = true; - - QString nickLink; - - KviQString::sprintf(nickLink,"\r!n\r%Q\r",&(msg->pSource->nick())); - - KviIrcUserEntry * e = msg->msg->connection()->userDataBase()->find(msg->pSource->nick()); - if(e){ - if( (szGender=="m") || (szGender=="M") ) { - e->setGender(KviIrcUserEntry::Male); - } else if((szGender=="f") || (szGender=="F") ) { - e->setGender(KviIrcUserEntry::Female); - } else { - e->setGender(KviIrcUserEntry::Unknown); - } - } - - QString szWhere = bPrivate ? __tr2qs("private") : __tr2qs("channel notification:"); - QString szWhat = bPrivate ? __tr2qs("notification") : msg->szTarget; - - if(szRemoteFile.isEmpty()) - { - // avatar unset - KviQString::sprintf(textLine,__tr2qs("%Q unsets avatar"), - &nickLink); - if(_OUTPUT_VERBOSE) - KviQString::appendFormatted(textLine," (%Q %Q)",&szWhere,&szWhat); - } else { - - // FIXME: #warning "The avatar should be the one with the requested size!!" - KviQString::sprintf(textLine,__tr2qs("%Q changes avatar to %s"), - &nickLink,szRemoteFile.utf8().data(),&szWhere,&szWhat); - if(_OUTPUT_VERBOSE) - KviQString::appendFormatted(textLine," (%Q %Q)",&szWhere,&szWhat); - - bool bIsUrl = KviQString::equalCIN("http://",szRemoteFile,7) && (szRemoteFile.length() > 7); - if(!bIsUrl) - { - // no hacks - KviQString::cutToLast(szRemoteFile,'/'); - KviQString::cutToLast(szRemoteFile,'\\'); - } - - avatar = g_pIconManager->getAvatar(QString::null,szRemoteFile); - - if((avatar == 0) && e) - { - // we have no such file on our HD.... - bResetAvatar = false; - // request DCC GET ? - if(KVI_OPTION_BOOL(KviOption_boolRequestMissingAvatars)) - { - // FIXME: #warning "Request avatars only from registered users ?" - // FIXME: #warning "Ask before making the request ?" - if(bIsUrl) - { - KviStr szLocalFilePath; - KviStr szLocalFile = szRemoteFile; - g_pIconManager->urlToCachedFileName(szLocalFile); - g_pApp->getLocalKvircDirectory(szLocalFilePath,KviApp::Avatars,szLocalFile.ptr()); - szLocalFilePath.replaceAll('\\',"\\\\"); // <-- this is especially for windows - QString szCommand = "http.get -w=nm "; - unsigned int uMaxSize = KVI_OPTION_UINT(KviOption_uintMaximumRequestedAvatarSize); - if(uMaxSize > 0)KviQString::appendFormatted(szCommand,"-m=%u ",uMaxSize); - szRemoteFile = szRemoteFile.replace(";","%3B"); - szRemoteFile = szRemoteFile.replace("\"","%22"); - szCommand += "\""+szRemoteFile+"\""; - szCommand += " \""; - szCommand += szLocalFilePath.ptr(); - szCommand += "\""; - - if(KviKvsScript::run(szCommand,msg->msg->console())) - { - if(_OUTPUT_VERBOSE) - { - KviQString::appendFormatted(textLine, - __tr2qs(": No valid local copy of avatar available, requesting one (HTTP GET %s)"), - szRemoteFile.utf8().data()); - } - g_pApp->setAvatarOnFileReceived(msg->msg->console(), - szRemoteFile,msg->pSource->nick(),msg->pSource->username(),msg->pSource->host()); - } else { - if(_OUTPUT_VERBOSE) - KviQString::appendFormatted(textLine,__tr2qs(": No valid local copy of avatar available; failed to start an HTTP transfer, ignoring")); - } - } else { - if(!checkCtcpFlood(msg)) - { - if(_OUTPUT_VERBOSE) - { - KviQString::appendFormatted(textLine, - __tr2qs(": No valid local copy of avatar available, requesting one (DCC GET %s)"), - szRemoteFile.utf8().data()); - } - - QString szFName; - encodeCtcpParameter(szRemoteFile.utf8().data(),szFName); - msg->msg->connection()->sendFmtData("PRIVMSG %s :%cDCC GET %s%c", - msg->msg->connection()->encodeText(msg->pSource->nick()).data(),0x01,msg->msg->connection()->encodeText(szFName.utf8().data()).data(),0x01); - g_pApp->setAvatarOnFileReceived(msg->msg->console(), - szRemoteFile,msg->pSource->nick(),msg->pSource->username(),msg->pSource->host()); - } else { - if(_OUTPUT_VERBOSE) - KviQString::appendFormatted(textLine,__tr2qs(": No valid local copy of avatar available; flood limit exceeded, ignoring")); - } - } - } else { - if(_OUTPUT_VERBOSE) - KviQString::appendFormatted(textLine,__tr2qs(": No valid local copy of avatar available, ignoring")); - } - } - } - - if(!e) - { - if(_OUTPUT_VERBOSE) - KviQString::appendFormatted(textLine,__tr2qs(": No such nickname in the user database, ignoring the change")); - msg->msg->console()->outputNoFmt(KVI_OUT_AVATAR,textLine); - return; - } - - if(bResetAvatar)e->setAvatar(avatar); - - msg->msg->console()->avatarChanged(avatar,msg->pSource->nick(),msg->pSource->user(),msg->pSource->host(), - msg->msg->haltOutput() ? QString::null : textLine); -} - - - -typedef void (*dccModuleCtcpDccParseRoutine)(KviDccRequest *par); - - - -void KviServerParser::parseCtcpRequestDcc(KviCtcpMessage *msg) -{ - KviDccRequest p; - KviStr aux = msg->pData; - msg->pData = extractCtcpParameter(msg->pData,p.szType); - msg->pData = extractCtcpParameter(msg->pData,p.szParam1); - msg->pData = extractCtcpParameter(msg->pData,p.szParam2); - msg->pData = extractCtcpParameter(msg->pData,p.szParam3); - msg->pData = extractCtcpParameter(msg->pData,p.szParam4); - msg->pData = extractCtcpParameter(msg->pData,p.szParam5); - p.ctcpMsg = msg; - p.bIpV6 = msg->msg->console()->isIpV6Connection(); - p.pConsole = msg->msg->console(); - - KviRegisteredUser * u = msg->msg->connection()->userDataBase()->registeredUser(msg->pSource->nick(),msg->pSource->user(),msg->pSource->host()); - - if (u) - { - if (u->isIgnoreEnabledFor(KviRegisteredUser::Dcc)) - { - if (KVI_OPTION_BOOL(KviOption_boolVerboseIgnore)) - { - msg->msg->console()->output(KVI_OUT_DCCREQUEST, - __tr2qs("Ignoring DCC %S request from \r!n\r%Q\r [%Q@\r!h\r%Q\r] (%Q %S)"), - &p.szType,&(msg->pSource->nick()), - &(msg->pSource->user()),&(msg->pSource->host()), - &msg->szTag,&aux); - } - return; - } - } - - /*if(KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpDcc)) - { - if(!msg->msg->haltOutput()) - { - msg->msg->console()->output(KVI_OUT_DCCREQUEST, - __tr2qs("Ignoring DCC %S request from \r!n\r%Q\r [%Q@\r!h\r%Q\r] (%Q %S)"), - &p.szType,&(msg->pSource->nick()), - &(msg->pSource->user()),&(msg->pSource->host()), - &msg->szTag,&aux); - } - return; - }*/ - - bool bIsFlood = checkCtcpFlood(msg); - - if(bIsFlood && - ((kvi_strEqualCI(p.szType.ptr(),"SEND")) || - (kvi_strEqualCI(p.szType.ptr(),"RSEND")) || - (kvi_strEqualCI(p.szType.ptr(),"TSEND")) || - (kvi_strEqualCI(p.szType.ptr(),"TRSEND")) - )) - { - // don't consider as flood the avatars we have requested - if(g_pApp->findPendingAvatarChange(msg->msg->console(),msg->pSource->nick(),p.szParam1.ptr())) - bIsFlood = false; - } - - if(!bIsFlood) - { - if(!msg->msg->haltOutput()) - { - QString decoded = msg->msg->console()->decodeText(p.szType.ptr()); - msg->msg->console()->output(KVI_OUT_DCCREQUEST, - __tr2qs("Processing DCC %Q request from \r!n\r%Q\r [%Q@\r!h\r%Q\r] (%s %s)"), - &decoded,&(msg->pSource->nick()), - &(msg->pSource->user()),&(msg->pSource->host()), - msg->msg->console()->decodeText(msg->szTag).data(), - msg->msg->console()->decodeText(aux.ptr()).data()); - } - - KviModule * m = g_pModuleManager->getModule("dcc"); - if(!m) - { - msg->msg->console()->output(KVI_OUT_DCCERROR, - __tr2qs("Unable to process the above request: Cannot load DCC module (%s)"),g_pModuleManager->lastError().ptr()); - } else { - dccModuleCtcpDccParseRoutine proc = (dccModuleCtcpDccParseRoutine)m->getSymbol("dccModuleCtcpDccParseRoutine"); - if(!proc) - { - msg->msg->console()->outputNoFmt(KVI_OUT_DCCERROR, - __tr2qs("Unable to process the above request: DCC module may be broken")); - } else { - proc(&p); - } - } - } else { - // That's flood - echoCtcpRequest(msg); - } -} - -void KviServerParser::parseCtcpReplyUserinfo(KviCtcpMessage *msg) -{ - QString szRemoteFile; - QString szGender; - QString decoded=msg->msg->console()->decodeText(msg->pData); - - bool bNeedToUpdateUserlist = false; - KviIrcUserEntry * e = msg->msg->connection()->userDataBase()->find(msg->pSource->nick()); - if(e) - { - int pos = decoded.find("Gender=",0,false); - - if(pos>=0) - { - QChar c = decoded[pos+7]; - switch(c.unicode()) - { - case 'F': - case 'f': - bNeedToUpdateUserlist = true; - e->setGender(KviIrcUserEntry::Female); - break; - case 'M': - case 'm': - bNeedToUpdateUserlist = true; - e->setGender(KviIrcUserEntry::Male); - break; - } - } - } - - if(bNeedToUpdateUserlist) - { - if(KviQString::equalCS(g_pActiveWindow->className(),QString("KviChannel"))) - { - ((KviChannel*)g_pActiveWindow)->userListView()->updateArea(); - } - - } - - echoCtcpReply(msg); -} - -void KviServerParser::parseCtcpReplyGeneric(KviCtcpMessage *msg) -{ - echoCtcpReply(msg); -} - - -void KviServerParser::parseCtcpReplyLagcheck(KviCtcpMessage * msg) -{ - // this is an internal CTCP used for checking lag - KviStr szTag; - msg->pData = extractCtcpParameter(msg->pData,szTag,true); - if(msg->msg->console()->connection()->lagMeter()) - msg->msg->console()->connection()->lagMeter()->lagCheckComplete(szTag.ptr()); -} - -//ERRORMSG,ECHO,ERRMSG -//SED,DCC,SOUND/MULTIMEDIA/MM,SCRIPT diff --git a/3.4.0/src/kvirc/sparser/kvi_sp_literal.cpp b/3.4.0/src/kvirc/sparser/kvi_sp_literal.cpp deleted file mode 100644 index 643fd86830..0000000000 --- a/3.4.0/src/kvirc/sparser/kvi_sp_literal.cpp +++ /dev/null @@ -1,1867 +0,0 @@ -//==================================================================================== -// -// File : kvi_sp_literal.cpp -// Creation date : Thu Aug 3 2000 01:29:12 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_sparser.h" -#include "kvi_window.h" -#include "kvi_console.h" -#include "kvi_out.h" -#include "kvi_locale.h" -#include "kvi_ircsocket.h" -#include "kvi_options.h" -#include "kvi_ircmask.h" -#include "kvi_channel.h" -#include "kvi_topicw.h" -#include "kvi_frame.h" -#include "kvi_mirccntrl.h" -#include "kvi_query.h" -#include "kvi_userlistview.h" -#include "kvi_antispam.h" -#include "kvi_nickserv.h" -#include "kvi_parameterlist.h" -#include "kvi_ircuserdb.h" -#include "kvi_app.h" -#include "kvi_regusersdb.h" -#include "kvi_debug.h" -#include "kvi_time.h" -#include "kvi_useraction.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_ircconnectiontarget.h" -#include "kvi_ircconnectionserverinfo.h" -#include "kvi_ircconnectionstatedata.h" -#include "kvi_ircconnectionnetsplitdetectordata.h" -#include "kvi_iconmanager.h" -#include "kvi_lagmeter.h" -#include "kvi_ircserver.h" -#include "kvi_kvs_eventtriggers.h" -#include "kvi_qcstring.h" - -#include "kvi_settings.h" - -#ifdef COMPILE_CRYPT_SUPPORT - #include "kvi_crypt.h" - #include "kvi_cryptcontroller.h" -#endif - -#include "kvi_kvs_script.h" - -//#include "kvi_regusersdb.h" -//#include "kvi_iconmanager.h" -#include <qdatetime.h> - -extern KviNickServRuleSet * g_pNickServRuleSet; - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// PING -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void KviServerParser::parseLiteralPing(KviIrcMessage *msg) -{ - // PING - // <optional_prefix> PING :<argument> - msg->connection()->sendFmtData("PONG %s",msg->console()->connection()->encodeText(msg->allParams()).data()); - - QString szPrefix = msg->connection()->decodeText(msg->safePrefix()); - QString szAllParams = msg->connection()->decodeText(msg->allParams()); - - if(KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnPing,msg->console(),szPrefix,szAllParams)) - msg->setHaltOutput(); - - if((!msg->haltOutput()) && KVI_OPTION_BOOL(KviOption_boolShowPingPong)) - { - msg->console()->output(KVI_OUT_SERVERPING, - __tr2qs("Received ping from \r!s\r%Q\r (PING %Q), replied pong"), - &szPrefix,&szAllParams); - } -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// PONG -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void KviServerParser::parseLiteralPong(KviIrcMessage *msg) -{ - QString szPrefix = msg->connection()->decodeText(msg->safePrefix()); - QString szAllParams = msg->connection()->decodeText(msg->allParams()); - - if(KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnPong,msg->console(),szPrefix,szAllParams)) - msg->setHaltOutput(); - - if(msg->console()->connection()->lagMeter()) - { - if(msg->console()->connection()->lagMeter()->lagCheckComplete("@ping@")) - msg->setHaltOutput(); // was internally generated! - } - - if((!msg->haltOutput()) && KVI_OPTION_BOOL(KviOption_boolShowPingPong)) - { - msg->console()->output(KVI_OUT_SERVERPING, - __tr2qs("Received pong from \r!s\r%s\r (PONG %s)"),msg->safePrefix(),msg->allParams()); - } -} - - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// ERROR -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void KviServerParser::parseLiteralError(KviIrcMessage *msg) -{ - // ERROR - // <optional_prefix> ERROR :<argument> - // ERROR :Closing Link: phoenix.pragmaware.net (Ping timeout) - - QString szPrefix = msg->connection()->decodeText(msg->safePrefix()); - QString szParams = msg->connection()->decodeText(msg->allParams()); - - if(KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnError,msg->console(),szPrefix,szParams)) - msg->setHaltOutput(); - - if(!msg->haltOutput()) - { - msg->console()->output(KVI_OUT_SERVERERROR, - __tr2qs("Server ERROR: %Q"),&szParams); - } -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// JOIN -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void KviServerParser::parseLiteralJoin(KviIrcMessage *msg) -{ - // JOIN - // :<joiner_mask> JOIN :<channel> - QString szNick,szUser,szHost; - msg->decodeAndSplitPrefix(szNick,szUser,szHost); - - const char * encodedChan = msg->safeTrailing(); - QString channel = msg->connection()->decodeText(encodedChan); - - if(channel.isEmpty()) - { - // This is broken.... - UNRECOGNIZED_MESSAGE(msg,__tr2qs("Missing channel parameter in join message")); - return; - } - - // check for extended join syntax. - // it is used in splits only (AFAIK) - // nick!user@host JOIN :#channel\x07[o|v] - const QChar * pExt = KviQString::nullTerminatedArray(channel); - char chExtMode = 0; - while(pExt->unicode() && (pExt->unicode() != 0x07))pExt++; - if(pExt->unicode()) - { - ++pExt; - if(pExt->unicode()) - { - chExtMode = (char)pExt->unicode(); - channel.remove(channel.length() - 2,2); // assuming that we're at the end (we should be) - } // else { senseless 0x07 in channel name ? - } - - // Now lookup the channel - KviConsole * console = msg->console(); - KviChannel * chan = msg->connection()->findChannel(channel); - - bool bIsMe = IS_ME(msg,szNick); - - if(!chan) - { - // This must be me...(or desync) - if(bIsMe) - { - msg->connection()->userInfoReceived(szUser,szHost); - chan = msg->connection()->createChannel(channel); // New channel (will resurrect an eventual dead one too!) - } else { - // Someone is joining an inexsisting channel!!! - UNRECOGNIZED_MESSAGE(msg,__tr("Received a join message for an unknown channel, possible desync")); - return; - } - - int iFlags = 0; - iFlags = msg->connection()->serverInfo()->modeFlagFromModeChar(chExtMode); - - KviUserListEntry * it = chan->join(szNick,szUser,szHost,iFlags); - if(iFlags)chan->updateCaption(); - - // FIXME: #warning "Trigger also OnMeVoice and OnMeOp here ?" - if(!(it->globalData()->avatar())) - { - KviAvatar * av = console->defaultAvatarFromOptions(); - if(av) - { - it->globalData()->setAvatar(av); - console->avatarChanged(av,szNick,szUser,szHost,QString::null); - } - } - - if(KVS_TRIGGER_EVENT_0_HALTED(KviEvent_OnMeJoin,chan)) - msg->setHaltOutput(); - - // the channel requests must be sent AFTER we have created and accessed the chan - // since it MAY happen that a sendFmtData() call fails by detecting a disconnect - // and thus destroys the channel window! - - // If this problem persists in other parts of the KVIrc core then - // we should disable disconnection detection during the parsing of a single - // message in KviIrcSocket. See the comment in KviIrcSocket::processData() for more info. - - // FIXME: #warning "IF VERBOSE SAY THAT WE'RE REQUESTING MODES & BAN LIST" (Synching channel) - - if(!msg->connection()->sendFmtData("MODE %s",encodedChan))return; // disconnected - - if(msg->connection()->serverInfo()->supportsModesIe()) - { - if(!KVI_OPTION_BOOL(KviOption_boolDisableBanExceptionListRequestOnJoin)) - { - if(!msg->connection()->sendFmtData("MODE %s e",encodedChan))return; // disconnected - chan->setSentBanExceptionListRequest(); - } - if(!KVI_OPTION_BOOL(KviOption_boolDisableInviteListRequestOnJoin)) - { - if(!msg->connection()->sendFmtData("MODE %s I",encodedChan))return; // disconnected - chan->setSentInviteListRequest(); - } - } - - // MODE %s b MUST BE THE LAST AUTOMATIC CHANNEL QUERY - // so we get RPL_ENDOFBANLIST as the last reply - // and we know that the channel is in sync - - if(!KVI_OPTION_BOOL(KviOption_boolDisableWhoRequestOnJoin)) - { - msg->connection()->stateData()->setLastSentChannelWhoRequest(kvi_unixTime()); - if(msg->connection()->lagMeter()) - { - KviStr tmp(KviStr::Format,"WHO %s",encodedChan); - msg->connection()->lagMeter()->lagCheckRegister(tmp.ptr(),60); - } - if(!msg->connection()->sendFmtData("WHO %s",encodedChan))return; // disconnected - chan->setSentWhoRequest(); - } - if(!KVI_OPTION_BOOL(KviOption_boolDisableBanListRequestOnJoin)) - { - if(!msg->connection()->sendFmtData("MODE %s b",encodedChan))return; // disconnected - chan->setSentBanListRequest(); - } - - } else { - // This must be someone else...(or desync) - int iFlags = 0; - iFlags = msg->connection()->serverInfo()->modeFlagFromModeChar(chExtMode); - - KviUserListEntry * it = chan->join(szNick,szUser,szHost,iFlags); - - // FIXME: #warning "Trigger also OnVoice and OnOp here ?" - // Note: checkDefaultAvatar() makes a KviRegisteredUser lookup - // if later it is needed, make it return a pointer - if(!(it->globalData()->avatar()))console->checkDefaultAvatar(it->globalData(),szNick,szUser,szHost); - - if(KVS_TRIGGER_EVENT_3_HALTED(KviEvent_OnJoin,chan,szNick,szUser,szHost)) - msg->setHaltOutput(); - // FIXME: #warning "WE COULD OPTIONALLY REQUEST A /WHO FOR THE USERS JOINING THAT WE DON'T KNOW THE HOST OF" - } - - // Now say it to the world - if(!msg->haltOutput()) - { - // FIXME: #warning "CHECK IF MESSAGES GO TO CONSOLE OR NOT" - - if(chExtMode != 0) - { - chan->output(KVI_OUT_JOIN, - __tr2qs("\r!n\r%Q\r [%Q@\r!h\r%Q\r] has joined \r!c\r%Q\r [implicit +%c umode change]"), - &szNick,&szUser,&szHost,&channel,chExtMode); - - } else { - chan->output(KVI_OUT_JOIN, - __tr2qs("\r!n\r%Q\r [%Q@\r!h\r%Q\r] has joined \r!c\r%Q\r"), - &szNick,&szUser,&szHost,&channel); - } - } - - //if(!bisMe) deleted because we can open query with our nick - QString szChans; - int iChans = msg->connection()->getCommonChannels(szNick,szChans); - KviQuery * q = console->connection()->findQuery(szNick); - if(q) - { - if(KVI_OPTION_BOOL(KviOption_boolEnableQueryTracing)) - { - q->output(KVI_OUT_QUERYTRACE, - __tr2qs("\r!n\r%Q\r [%Q@\r!h\r%Q\r] has just joined \r!c\r%Q\r"),&szNick,&szUser, - &szHost,&channel); - q->notifyCommonChannels(szNick,szUser,szHost,iChans,szChans); - } else { - q->updateLabelText(); - } - } -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// PART -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void KviServerParser::parseLiteralPart(KviIrcMessage *msg) -{ - // PART - // :<source_mask> PART <channel> :<part message> - QString szNick,szUser,szHost; - msg->decodeAndSplitPrefix(szNick,szUser,szHost); - - QString szChan = msg->connection()->decodeText(msg->safeParam(0)); - - // Now lookup the channel - KviConsole * console = msg->console(); - KviChannel * chan = msg->connection()->findChannel(szChan); - - if(!chan) - { - //chan = msg->context()->findDeadChannel(msg->safeParam(0)); - UNRECOGNIZED_MESSAGE(msg,__tr("Received a part message for an unknown channel, possible desync")); - return; - } - - // always decode with the textEncoding of the channel - QString partMsg = msg->paramCount() > 1 ? chan->decodeText(msg->safeTrailing()) : QString::null; - - if(IS_ME(msg,szNick)) - { - if(KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnMePart,chan,partMsg)) - msg->setHaltOutput(); - - KviWindow * pOut = console; - - // It's me! - if(chan->closeOnPart() && !KVI_OPTION_BOOL(KviOption_boolKeepChannelOpenOnPart)) - { - chan->frame()->closeWindow(chan); // <-- deleted path - } else { - chan->part(szNick); // this will trigger the action too - chan->setDeadChan(); - pOut = chan; - } - - if(!msg->haltOutput()) - { - if(KVI_OPTION_BOOL(KviOption_boolShowOwnParts)) - { - if(partMsg.isEmpty()) - pOut->output(KVI_OUT_PART,__tr2qs("You have left channel \r!c\r%Q\r"),&szChan); - else - pOut->output(KVI_OUT_PART,__tr2qs("You have left channel \r!c\r%Q\r: %Q"),&szChan,&partMsg); - } - } - - } else { - // Someone else - - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnPart,chan,szNick,szUser,szHost,partMsg)) - msg->setHaltOutput(); - - chan->part(szNick); - - if(!msg->haltOutput()) - { - if(!partMsg.isEmpty()) - chan->output(KVI_OUT_PART, - __tr2qs("\r!n\r%Q\r [%Q@\r!h\r%Q\r] has left \r!c\r%Q\r: %Q"),&szNick,&szUser, - &szHost,&szChan,&partMsg); - else - chan->output(KVI_OUT_PART, - __tr2qs("\r!n\r%Q\r [%Q@\r!h\r%Q\r] has left \r!c\r%Q\r"),&szNick,&szUser, - &szHost,&szChan); - - } - - if(KVI_OPTION_BOOL(KviOption_boolEnableQueryTracing)) - { - QString szChans; - int iChans = console->connection()->getCommonChannels(szNick,szChans); - KviQuery * q = console->connection()->findQuery(szNick); - if(q) - { - if(!partMsg.isEmpty()) - q->output(KVI_OUT_QUERYTRACE, - __tr2qs("\r!nc\r%Q\r [%Q@\r!h\r%Q\r] has just left \r!c\r%Q\r: %Q"), - &szNick,&szUser,&szHost,&szChan,&partMsg); - else - q->output(KVI_OUT_QUERYTRACE, - __tr2qs("\r!nc\r%Q\r [%Q@\r!h\r%Q\r] has just left \r!c\r%Q\r"), - &szNick,&szUser,&szHost,&szChan); - q->notifyCommonChannels(szNick,szUser,szHost,iChans,szChans); - } - } - } -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// QUIT -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void KviServerParser::parseLiteralQuit(KviIrcMessage *msg) -{ - // QUIT - // :<source_mask> QUIT :<quit message> - QString szNick,szUser,szHost; - msg->decodeAndSplitPrefix(szNick,szUser,szHost); - - KviConsole * console = msg->console(); - - // NETSPLIT DETECTION STUFF - // this doesn't need to be decoded for the moment - const char * aux = msg->safeTrailing(); - bool bWasSplit = false; - //determine if signoff string matches "%.% %.%", and only one space (from eggdrop code) - char *p = (char *)strchr(aux, ' '); - if (p && (p == (char *)strrchr(aux,' '))) - { - char *daSpace = p; - // one space detected. go ahead - char *z1, *z2; - *p = 0; - z1 = (char *)strchr(p + 1, '.'); - z2 = (char *)strchr(aux, '.'); - if (z1 && z2 && (*(z1 + 1) > 47) && (z1 - 1 != p) && (z2 + 1 != p) && (z2 != aux) && console->connection()) - { - // server split, or else it looked like it anyway - KviIrcConnectionNetsplitDetectorData * ndd = msg->connection()->netsplitDetectorData(); - *p=' '; - bWasSplit = true; - - time_t curTime = kvi_unixTime(); - int diff = ((unsigned int)curTime) - ((unsigned int)ndd->lastNetsplitOnQuitTime()); - bool bDuplicate = false; - - QString szReason = aux; - if(diff < 6) - { - if(KviQString::equalCI(ndd->lastNetsplitOnQuitReason(),szReason)) - { - bDuplicate = true; - } - } - - ndd->setLastNetsplitOnQuitTime(curTime); - ndd->setLastNetsplitOnQuitReason(szReason); - - if(!bDuplicate) - { - KviStr sz1(aux,daSpace - aux); - KviStr sz2(daSpace + 1); - - QString szD1 = msg->connection()->decodeText(sz1.ptr()); - QString szD2 = msg->connection()->decodeText(sz2.ptr()); - if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnNetsplit,console,szD1,szD2)) - { - if(!msg->haltOutput()) - console->output(KVI_OUT_SPLIT,__tr2qs("Netsplit detected: %s"),aux); - } - } - } else *p = ' '; - } - - // FIXME: #warning "Add a netsplit parameter ?" - - if(KviKvsEventManager::instance()->hasAppHandlers(KviEvent_OnQuit)) - { - // compute the channel list - QString chanlist; - QString szReason = msg->connection()->decodeText(msg->safeTrailing()); - - for(KviChannel *daChan=console->channelList()->first();daChan;daChan=console->channelList()->next()) - { - if(daChan->isOn(szNick)) - { - if(chanlist.isEmpty())chanlist = daChan->windowName(); - else { - chanlist.append(','); - chanlist.append(daChan->windowName()); - } - } - } - - KviKvsVariantList vList; - vList.append(szNick); - vList.append(szUser); - vList.append(szHost); - vList.append(szReason); - vList.append(chanlist); - - if(KviKvsEventManager::instance()->trigger(KviEvent_OnQuit,console,&vList)) - msg->setHaltOutput(); - } - - - for(KviChannel *c=console->channelList()->first();c;c=console->channelList()->next()) - { - if(c->part(szNick)) - { - if(!msg->haltOutput()) - { - QString quitMsg = c->decodeText(msg->safeTrailing()); - - if(bWasSplit) - { - quitMsg.prepend("NETSPLIT "); - } - - if(!msg->haltOutput())c->output(KVI_OUT_QUIT, - __tr2qs("\r!n\r%Q\r [%Q@\r!h\r%Q\r] has quit IRC: %Q"), - &szNick,&szUser,&szHost,&quitMsg); - } - } - } - - if(!msg->haltOutput()) - { - KviQuery * q = msg->connection()->findQuery(szNick); - if(q) - { - QString quitMsg = q->decodeText(msg->safeTrailing()); - if(bWasSplit) - { - quitMsg.prepend("NETSPLIT "); - } - q->output(KVI_OUT_QUIT,__tr2qs("\r!n\r%Q\r [%Q@\r!h\r%Q\r] has quit IRC: %Q"), - &szNick,&szUser,&szHost,&quitMsg); - } - } -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// KICK -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void KviServerParser::parseLiteralKick(KviIrcMessage *msg) -{ - // KICK - // :<source_mask> KICK <channel> <nick> :<kick message> - QString szNick,szUser,szHost; - msg->decodeAndSplitPrefix(szNick,szUser,szHost); - - QString szChan = msg->connection()->decodeText(msg->safeParam(0)); - QString victim = msg->connection()->decodeText(msg->safeParam(1)); - - KviConsole * console = msg->console(); - KviChannel * chan = msg->connection()->findChannel(szChan); - - if(!chan){ - // Ooops , desync with the server. - UNRECOGNIZED_MESSAGE(msg,__tr("Received a kick message for an unknown channel, possible desync")); - return; - } - - QString szKickMsg = chan->decodeText(msg->safeTrailing()); - - if(IS_ME(msg,victim)) - { - // ops...I have been kicked - - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnMeKick,chan, - szNick,szUser,szHost,szKickMsg)) - msg->setHaltOutput(); - if(!KVI_OPTION_STRING(KviOption_stringOnMeKickedSound).isEmpty()) KviKvsScript::run("snd.play $0",0,new KviKvsVariantList(new KviKvsVariant(KVI_OPTION_STRING(KviOption_stringOnMeKickedSound)))); - - QString szPass = chan->channelKey(); - - if(KVI_OPTION_BOOL(KviOption_boolKeepChannelOpenOnKick)) - { - chan->userAction(szNick,szUser,szHost,KVI_USERACTION_KICK); - chan->part(victim); - chan->setDeadChan(); - - if(!msg->haltOutput()) - { - // FIXME: #warning "OPTION FOR THIS TO GO TO THE CONSOLE!" - chan->output(KVI_OUT_MEKICK, - __tr2qs("You have been kicked from \r!c\r%Q\r by \r!n\r%Q\r [%Q@\r!h\r%Q\r]: %Q"), - &szChan,&szNick,&szUser,&szHost,&szKickMsg); - } - } else { - chan->frame()->closeWindow(chan); // <-- deleted path - - if(!msg->haltOutput()) - { - // FIXME: #warning "This could go also to the active window!" - console->output(KVI_OUT_MEKICK, - __tr2qs("You have been kicked from \r!c\r%Q\r by \r!n\r%Q\r [%Q@\r!h\r%Q\r]: %Q"), - &szChan,&szNick,&szUser,&szHost,&szKickMsg); - } - } - if(KVI_OPTION_BOOL(KviOption_boolRejoinChannelOnKick)) - { - if(_OUTPUT_VERBOSE) - console->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Attempting to rejoin \r!c\r%Q\r..."),&szChan); - KviQCString szC = msg->connection()->encodeText(szChan); - if(!szPass.isEmpty()) - { - KviQCString szP = msg->connection()->encodeText(szChan); - msg->connection()->sendFmtData("JOIN %s %s",szC.data(),szP.data()); - } else msg->connection()->sendFmtData("JOIN %s",szC.data()); - } - } else { - // ok...someone else has been kicked - - if(KVS_TRIGGER_EVENT_5_HALTED(KviEvent_OnKick,chan, - szNick,szUser,szHost,victim,szKickMsg)) - msg->setHaltOutput(); - - KviIrcUserEntry * e = msg->connection()->userDataBase()->find(victim); - - QString szVHost; - QString szVUser; - - if(e) - { - szVHost = e->host(); - szVUser = e->user(); - } else { - szVHost = "*"; - szVUser = "*"; - } - - chan->userAction(szNick,szUser,szHost,KVI_USERACTION_KICK); - - chan->part(victim); - - if(!msg->haltOutput()) - { -// FIXME: #warning "OPTION FOR THIS TO GO TO THE CONSOLE!" - chan->output(KVI_OUT_KICK, - __tr2qs("\r!n\r%Q\r [%Q@\r!h\r%Q\r] has been kicked from \r!c\r%Q\r by \r!n\r%Q\r [%Q@\r!h\r%Q\r]: %Q"), - &victim,&szVUser,&szVHost,&szChan,&szNick,&szUser,&szHost,&szKickMsg); - } - - if(KVI_OPTION_BOOL(KviOption_boolEnableQueryTracing)) - { - KviQuery * q = console->connection()->findQuery(victim); - if(q) - { - QString szChans; - int iChans = console->connection()->getCommonChannels(victim,szChans); - q->output(KVI_OUT_QUERYTRACE, - __tr2qs("\r!n\r%Q\r [%Q@\r!h\r%Q\r] has just been kicked from \r!c\r%Q\r by \r!n\r%Q\r [%Q@\r!h\r%Q\r]: %Q"), - &victim,&szVUser,&szVHost,&szChan, - &szNick,&szUser,&szHost,&szKickMsg); - q->notifyCommonChannels(victim,szVUser,szVHost,iChans,szChans); - } - } - } -} - -#ifdef COMPILE_CRYPT_SUPPORT - #define DECRYPT_IF_NEEDED(_target,_txt,_type,_type2,_buffer,_retptr,_retmsgtype) \ - if(KviCryptSessionInfo * cinf = _target->cryptSessionInfo()){ \ - if(cinf->bDoDecrypt){ \ - switch(cinf->pEngine->decrypt(_txt,_buffer)) \ - { \ - case KviCryptEngine::DecryptOkWasEncrypted: \ - _retptr = _buffer.ptr(); \ - _retmsgtype = _type2; \ - break; \ - case KviCryptEngine::DecryptOkWasPlainText: \ - case KviCryptEngine::DecryptOkWasEncoded: \ - _retptr = _buffer.ptr(); \ - _retmsgtype = _type; \ - break; \ - default: /* also case KviCryptEngine::DecryptError: */ \ - { \ - QString szEngineError = cinf->pEngine->lastError(); \ - _target->output(KVI_OUT_SYSTEMERROR, \ - __tr2qs("The following message appears to be encrypted, but the crypto engine failed to decode it: %Q"), \ - &szEngineError); \ - _retptr = _txt + 1; _retmsgtype=_type; \ - } \ - break; \ - } \ - } else _retptr = _txt, _retmsgtype=_type; \ - } else _retptr = _txt, _retmsgtype=_type; -#else //!COMPILE_CRYPT_SUPPORT - #define DECRYPT_IF_NEEDED(_target,_txt,_type,_type2,_buffer,_retptr,_retmsgtype) \ - _retptr = _txt; _retmsgtype = _type; -#endif //!COMPILE_CRYPT_SUPPORT - - - -void KviServerParser::parseLiteralPrivmsg(KviIrcMessage *msg) -{ - // PRIVMSG - // :source PRIVMSG <target> :<message> - QString szNick,szUser,szHost; - msg->decodeAndSplitPrefix(szNick,szUser,szHost); - - QString szTarget = msg->connection()->decodeText(msg->safeParam(0)); - QString szMsg = msg->connection()->decodeText(msg->safeTrailing()); - - KviConsole * console = msg->console(); - KviRegisteredUser * u = msg->connection()->userDataBase()->registeredUser(szNick,szUser,szHost); - //Highlight it? - - // FIXME: #warning "DEDICATED CTCP WINDOW ?" - KviStr * pTrailing = msg->trailingString(); - if(pTrailing) - { - if(*(pTrailing->ptr()) == 0x01) - { - if(pTrailing->len() > 1) - { - if(pTrailing->lastCharIs(0x01))pTrailing->cutRight(1); - pTrailing->cutLeft(1); - KviCtcpMessage ctcp; - ctcp.msg = msg; - ctcp.pData = pTrailing->ptr(); - KviIrcMask talker(szNick,szUser,szHost); // FIXME! - ctcp.pSource = &talker; - ctcp.szTarget = msg->connection()->decodeText(msg->safeParam(0)); - ctcp.bIgnored = false; - ctcp.bIsFlood = false; - ctcp.bUnknown = false; - parseCtcpRequest(&ctcp); - return; - } - } - } - - // Normal PRIVMSG - if(IS_ME(msg,szTarget)) - { - //Ignore it? - if (u) - { - if (u->isIgnoreEnabledFor(KviRegisteredUser::Query)) - { - if(KVS_TRIGGER_EVENT_5_HALTED(KviEvent_OnIgnoredMessage,msg->console(),szNick,szUser,szHost,szTarget,szMsg)) return; - - if (KVI_OPTION_BOOL(KviOption_boolVerboseIgnore)) - { - console->output(KVI_OUT_IGNORE,__tr2qs("Ignoring query-PRIVMSG from \r!nc\r%Q\r [%Q@\r!h\r%Q\r]: %Q"),&szNick,&szUser,&szHost,&szMsg); - } - return; - } - } - // FIXME: #warning "PROCESS MULTIMEDIA FILE REQUESTS" - - // if(g_pOptions->m_bListenToMultimediaFileRequests) - // { - // if(*aux == '!') - // { - // const char *tmp = aux; - // tmp++; - // if(kvi_strEqualCI(tmp,m_pFrm->m_global.szCurrentNick.ptr())) - // { - // // A multimedia file request ? - // tmp += m_pFrm->m_global.szCurrentNick.len(); - // if(((*tmp) == ' ') || ((*tmp) == '\t')) - // { - // while(((*tmp) == ' ') || ((*tmp) == '\t'))tmp++; - // if(*tmp) - // { - // KviStr file = tmp; - // KviStr filePath; - // m_pFrm->findMultimediaFileOffert(filePath,file); - // if(filePath.hasData()) - // { - // m_pFrm->activeWindow()->output(KVI_OUT_INTERNAL,__tr("%s requests previously offered file %s: sending (%s)"),talker.nick(),file.ptr(),filePath.ptr()); - // KviStr cmd(KviStr::Format,"DCC SEND %s %s",talker.nick(),filePath.ptr()); - // m_pFrm->m_pUserParser->parseUserCommand(cmd,m_pConsole); - // return; - - // } else { - // m_pFrm->activeWindow()->output(KVI_OUT_INTERNAL,__tr("%s requests file %s: no such file was offered , ignoring"),talker.nick(),file.ptr()); - // return; - // } - // } - // } - // } - // } - // } - - // A query request - // do we have a matching window ? - KviQuery * query = msg->connection()->findQuery(szNick); - - if(!query) - { - // New query requested. Check if we really should create it or not - - // first of all the anti spam , if desired. - // the antispam blocks anything else - // Eventually we could trigger a special event to notify the user of the - // spam message... - if(KVI_OPTION_BOOL(KviOption_boolUseAntiSpamOnPrivmsg)) - { - KviStr * theMsg = msg->trailingString(); - if(theMsg) - { - KviStr spamWord; - if(kvi_mayBeSpam(theMsg,spamWord)) - { - // FIXME: OnSpam ? - if(!(msg->haltOutput() || KVI_OPTION_BOOL(KviOption_boolSilentAntiSpam))) - { - QString szMsg = msg->connection()->decodeText(msg->safeTrailing()); - console->output(KVI_OUT_SPAM, - __tr2qs("Spam privmsg from \r!n\r%Q\r [%Q@\r!h\r%Q\r]: %Q (matching spamword \"%s\")"), - &szNick,&szUser,&szHost,&szMsg,spamWord.ptr()); - } - return; - } - } - } - - // this is not a spam, or at least it hasn't been recognized as spam - - // user option ? (this should again override any script) - // if the scripters want really to force the query creation they can do - // it manually or they can set the option to true at KVIrc startup - if(KVI_OPTION_BOOL(KviOption_boolCreateQueryOnPrivmsg)) - { - QString szMsg = msg->connection()->decodeText(msg->safeTrailing()); - // We still want to create it - // Give the scripter a chance to filter it out again - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnQueryWindowRequest, - console,szNick,szUser,szHost,szMsg)) - { - // check if the scripter hasn't created it - query = msg->connection()->findQuery(szNick); - } else { - // no query yet, create it! - // this will trigger OnQueryWindowCreated - query = console->connection()->createQuery(szNick); - // and this will trigger OnQueryTargetAdded - query->setTarget(szNick,szUser,szHost); - } - } - } - - // ok, now we either have a query or not - if(query) - { - // ok, we have the query. Trigger the user action anyway - query->userAction(szNick,szUser,szHost,KVI_USERACTION_PRIVMSG); - // decrypt the message if needed - KviStr szBuffer; const char * txtptr; int msgtype; - DECRYPT_IF_NEEDED(query,msg->safeTrailing(),KVI_OUT_QUERYPRIVMSG,KVI_OUT_QUERYPRIVMSGCRYPTED,szBuffer,txtptr,msgtype) - // trigger the script event and eventually kill the output - QString szMsgText = query->decodeText(txtptr); - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnQueryMessage,query,szNick,szUser,szHost,szMsgText)) - msg->setHaltOutput(); - - if(!KVI_OPTION_STRING(KviOption_stringOnQueryMessageSound).isEmpty() && query!=g_pActiveWindow) - { - // KviKvsScript does NOT take parameters ownership - KviKvsVariantList soundParams(new KviKvsVariant(KVI_OPTION_STRING(KviOption_stringOnQueryMessageSound))); - //KviKvsScript::run("snd.play $0",0,&soundParams); <-- we also should provide a window for the script: it's always a good idea - KviKvsScript::run("snd.play $0",query,&soundParams); - } - - // spit out the message text - if(!msg->haltOutput()) - { - int iFlags = 0; - if(!query->hasAttention()) - { - if(KVI_OPTION_BOOL(KviOption_boolFlashQueryWindowOnNewMessages)) - { - // avoid double window flashing - iFlags |= KviConsole::NoWindowFlashing; - query->demandAttention(); - } - if(KVI_OPTION_BOOL(KviOption_boolPopupNotifierOnNewQueryMessages)) - { - // don't send the message to the notifier twice - iFlags |= KviConsole::NoNotifier; - QString szMsg = ""; - //QString szMsg = "<b><"; - //szMsg += szNick; - //szMsg += "></b> "; - QString szHtml = szMsgText; - szHtml.replace("<","<"); - szHtml.replace(">",">"); - szMsg += szHtml; - //debug("kvi_sp_literal.cpp:908 debug: %s",szHtml.data()); - g_pApp->notifierMessage(query,KVI_SMALLICON_QUERYPRIVMSG,szMsg,1800); - } - } - console->outputPrivmsg(query,msgtype,szNick,szUser,szHost,szMsgText,iFlags); - } - } else { - // no query creation: no decryption possible - // trigger the query message event in the console - QString szMsgText = msg->connection()->decodeText(msg->safeTrailing()); - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnQueryMessage,console,szNick,szUser,szHost,szMsgText)) - msg->setHaltOutput(); - - // we don't have a query here! - //if(!KVI_OPTION_STRING(KviOption_stringOnQueryMessageSound).isEmpty() && query!=g_pActiveWindow) - if(!KVI_OPTION_STRING(KviOption_stringOnQueryMessageSound).isEmpty() && console!=g_pActiveWindow) - { - // same as above - KviKvsVariantList soundParams(new KviKvsVariant(KVI_OPTION_STRING(KviOption_stringOnQueryMessageSound))); - KviKvsScript::run("snd.play $0",console,&soundParams); - } - // spit the message text out - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolExternalMessagesToActiveWindow) ? - console->activeWindow() : (KviWindow *)(console); - - if(KviIrcConnection * pConnection = console->connection()) - { - KviWindow * aWin = console->activeWindow(); - if((aWin->type() == KVI_WINDOW_TYPE_CHANNEL) && ((KviChannel *)aWin)->isOn(szNick)) - pOut = aWin; - else { - for(KviChannel * c = pConnection->channelList()->first();c;c = pConnection->channelList()->next()) - if(c->isOn(szNick)) - { - pOut = (KviWindow *) c; - break; - } - } - } - - pOut->output(KVI_OUT_QUERYPRIVMSG,"[PRIVMSG \r!nc\r%Q\r]: %Q",&szNick,&szMsgText); - } - } - } else { - // Channel PRIVMSG - - KviChannel * chan = msg->connection()->findChannel(szTarget); - - QString szOriginalTarget = szTarget; - QString szPrefixes; - - //Ignore it? - if(u) - { - if(u->isIgnoreEnabledFor(KviRegisteredUser::Channel)) - { - if(KVS_TRIGGER_EVENT_5_HALTED(KviEvent_OnIgnoredMessage,msg->console(),szNick,szUser,szHost,szTarget,szMsg)) - return; - - if (KVI_OPTION_BOOL(KviOption_boolVerboseIgnore)) - { - console->output(KVI_OUT_IGNORE,__tr2qs("Ignoring channel-PRIVMSG from \r!nc\r%Q\r [%Q@\r!h\r%Q\r]: %Q"),&szNick,&szUser,&szHost,&szMsg); - } - return; - } - } - - if(!chan) - { - // check if the channel has some leading mode prefixes - while((szTarget.length() > 0) && console->connection()->serverInfo()->isSupportedModePrefix(szTarget[0].unicode())) - { - szPrefixes += szTarget[0]; - szTarget.remove(0,1); - } - chan = msg->connection()->findChannel(szTarget); - } - - if(!chan) - { - if(!msg->haltOutput()) - { - QString szMsgText = msg->connection()->decodeText(msg->safeTrailing()); - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolOperatorMessagesToActiveWindow) ? - console->activeWindow() : (KviWindow *)(console); - QString broad; - KviQString::sprintf(broad,"[>> %Q] %Q",&szOriginalTarget,&szMsgText); - console->outputPrivmsg(pOut,KVI_OUT_BROADCASTPRIVMSG,szNick,szUser,szHost,broad,0); - } - } else { - chan->userAction(szNick,szUser,szHost,KVI_USERACTION_PRIVMSG); - - KviStr szBuffer; const char * txtptr; int msgtype; - DECRYPT_IF_NEEDED(chan,msg->safeTrailing(),KVI_OUT_CHANPRIVMSG,KVI_OUT_CHANPRIVMSGCRYPTED,szBuffer,txtptr,msgtype) - - QString szMsgText = chan->decodeText(txtptr); - - if(KVS_TRIGGER_EVENT_5_HALTED(KviEvent_OnChannelMessage,chan,szNick,szUser,szHost,szMsgText,szPrefixes)) - msg->setHaltOutput(); - - if(!msg->haltOutput()) - { - if(szPrefixes.length() > 0) - { - QString szBroad; - KviQString::sprintf(szBroad,"[>> %Q\r!c\r%Q\r] %Q",&szPrefixes,&szTarget,&szMsgText); - console->outputPrivmsg(chan,msgtype,szNick,szUser,szHost,szBroad,0); - } else { - console->outputPrivmsg(chan,msgtype,szNick,szUser,szHost,szMsgText,0); - } - } - } - } -} - - -void KviServerParser::parseLiteralNotice(KviIrcMessage *msg) -{ - // NOTICE - // :source NOTICE <target> :<message> - QString szNick,szUser,szHost; - msg->decodeAndSplitPrefix(szNick,szUser,szHost); - - KviConsole * console = msg->console(); - - if(szHost == "*") - { - if(szUser == "*") - { - if(szNick.find('.') != -1) - { - // server notice - // FIXME: "Dedicated window for server notices ?" - QString szMsgText = msg->connection()->decodeText(msg->safeTrailing()); - if(KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnServerNotice,console,szNick,szMsgText)) - msg->setHaltOutput(); - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolServerNoticesToActiveWindow) ? - console->activeWindow() : (KviWindow *)(console); - pOut->output(KVI_OUT_SERVERNOTICE,"[\r!s\r%Q\r]: %Q",&szNick,&szMsgText); - } - return; - } - } - } - - // FIXME: "DEDICATED CTCP WINDOW ?" - - KviStr * pTrailing = msg->trailingString(); - if(pTrailing) - { - if(*(pTrailing->ptr()) == 0x01){ - if(pTrailing->len() > 1) - { - if(pTrailing->lastCharIs(0x01))pTrailing->cutRight(1); - pTrailing->cutLeft(1); - KviCtcpMessage ctcp; - ctcp.msg = msg; - ctcp.pData = pTrailing->ptr(); - KviIrcMask talker(szNick,szUser,szHost); // FIXME - ctcp.pSource = &talker; - ctcp.szTarget = msg->connection()->decodeText(msg->safeParam(0)); - ctcp.bIgnored = false; - ctcp.bIsFlood = false; - ctcp.bUnknown = false; - parseCtcpReply(&ctcp); - return; - } - } - } - - QString szTarget = msg->connection()->decodeText(msg->safeParam(0)); - - KviRegisteredUser * u = msg->connection()->userDataBase()->registeredUser(szNick,szUser,szHost); - //Ignore it? - if(u) - { - if(u->isIgnoreEnabledFor(KviRegisteredUser::Notice)) - { - if(KVI_OPTION_BOOL(KviOption_boolVerboseIgnore)) - { - QString szMsg = msg->connection()->decodeText(msg->safeTrailing()); - console->output(KVI_OUT_IGNORE,__tr2qs("Ignoring Notice from \r!nc\r%Q\r [%Q@\r!h\r%Q\r]: %Q"),&szNick,&szUser,&szHost,&szMsg); - } - return; - } - } - - // Normal NOTICE - if(IS_ME(msg,szTarget)) - { - // FIXME: "The NickServ and ChanServ handling should be optional!" - - if(KviQString::equalCI(szNick,"NickServ")) - { - QString szMsgText = msg->connection()->decodeText(msg->safeTrailing()); - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnNickServNotice,console,szNick,szUser,szHost,szMsgText)) - msg->setHaltOutput(); - - // nickname service... does it ask for identification ? - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolServicesNoticesToActiveWindow) ? - console->activeWindow() : (KviWindow *)(console); - pOut->output(KVI_OUT_NICKSERV,"\r!n\r%Q\r [%Q@\r!h\r%Q\r]: %Q",&szNick,&szUser,&szHost,&szMsgText); - } - - bool bAuthDone = false; - KviNickServRuleSet * r = msg->connection()->target()->network()->nickServRuleSet(); - if(r) - { - if(r->isEnabled() && !r->isEmpty()) - { - KviIrcMask talker(szNick,szUser,szHost); - KviNickServRule * rule = r->matchRule(msg->connection()->currentNickName(),&talker,szMsgText); - if(rule) - { - bAuthDone = true; - console->outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("NickServ requests authentication, executing scheduled command")); - if(!KviKvsScript::run(rule->identifyCommand(),console)) - { - console->outputNoFmt(KVI_OUT_SYSTEMERROR,__tr2qs("The scheduled NickServ identification command appears to be broken, please change the setting")); - } - } - } - } - - if(!bAuthDone) - { - if(g_pNickServRuleSet->isEnabled() && !g_pNickServRuleSet->isEmpty()) - { - KviIrcMask talker(szNick,szUser,szHost); - KviNickServRule * rule = g_pNickServRuleSet->matchRule(msg->connection()->currentNickName(),&talker,szMsgText,msg->connection()->currentServerName()); - if(rule) - { - console->outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("NickServ requests authentication, executing scheduled command")); - if(!KviKvsScript::run(rule->identifyCommand(),console)) - { - console->outputNoFmt(KVI_OUT_SYSTEMERROR,__tr2qs("The scheduled NickServ identification command appears to be broken, please change the setting")); - } - } - } - } - - return; - } - - if(KviQString::equalCI(szNick,"ChanServ")) - { - QString szMsgText = msg->connection()->decodeText(msg->safeTrailing()); - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnChanServNotice,console,szNick,szUser,szHost,szMsgText)) - msg->setHaltOutput(); - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolServicesNoticesToActiveWindow) ? - console->activeWindow() : (KviWindow *)(console); - pOut->output(KVI_OUT_CHANSERV,"\r!n\r%Q\r [%Q@\r!h\r%Q\r]: %Q",&szNick,&szUser,&szHost,&szMsgText); - } - return; - } - - // FIXME: PROCESS MULTIMEDIA FILE REQUESTS - - // A query request - // do we have a matching window ? - KviQuery * query = msg->connection()->findQuery(szNick); - - if(!query) - { - // New query requested. Check if we really should create it or not - - // first of all the anti spam , if desired. - // the antispam blocks anything else - // Eventually we could trigger a special event to notify the user of the - // spam message... - if(KVI_OPTION_BOOL(KviOption_boolUseAntiSpamOnNotice)) - { - KviStr * theMsg = msg->trailingString(); // FIXME - if(theMsg) - { - KviStr spamWord; - if(kvi_mayBeSpam(theMsg,spamWord)) - { - // FIXME: OnSpam ? - - if(!(msg->haltOutput() || KVI_OPTION_BOOL(KviOption_boolSilentAntiSpam))) - { - QString szMsgText = msg->connection()->decodeText(msg->safeTrailing()); - QString szSpamWord = spamWord.ptr(); - console->output(KVI_OUT_SPAM,__tr2qs("Spam notice from \r!n\r%Q\r [%Q@\r!h\r%Q\r]: %Q (matching spamword \"%Q\")"), - &szNick,&szUser,&szHost,&szMsgText,&szSpamWord); - } - return; - } - } - } - - // this is not a spam, or at least it hasn't been recognized as spam - - // user option ? (this should again override any script) - // if the scripters want really to force the query creation they can do - // it manually or they can set the option to true at KVIrc startup - if(KVI_OPTION_BOOL(KviOption_boolCreateQueryOnNotice)) - { - QString szMsgText = msg->connection()->decodeText(msg->safeTrailing()); - // We still want to create it - // Give the scripter a chance to filter it out again - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnQueryWindowRequest,console,szNick,szUser,szHost,szMsgText)) - { - // check if the scripter hasn't created it - query = msg->connection()->findQuery(szNick); - } else { - // no query yet, create it! - // this will trigger OnQueryWindowCreated - query = console->connection()->createQuery(szNick); - // and this will trigger OnQueryTargetAdded - query->setTarget(szNick,szUser,szHost); - } - } - } - - // ok, now we either have a query or not - if(query) - { - // ok, we have the query. Trigger the user action anyway - query->userAction(szNick,szUser,szHost,KVI_USERACTION_NOTICE); - // decrypt it if needed - KviStr szBuffer; const char * txtptr; int msgtype; - DECRYPT_IF_NEEDED(query,msg->safeTrailing(),KVI_OUT_QUERYNOTICE,KVI_OUT_QUERYNOTICECRYPTED,szBuffer,txtptr,msgtype) - QString szMsgText = query->decodeText(txtptr); - // trigger the script event and eventually kill the output - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnQueryNotice,query,szNick,szUser,szHost,szMsgText)) - msg->setHaltOutput(); - // spit out the message text - if(!msg->haltOutput()) - { - int iFlags = 0; - - if(!query->hasAttention()) - { - if(KVI_OPTION_BOOL(KviOption_boolFlashQueryWindowOnNewMessages)) - { - // avoid double window flashing - iFlags |= KviConsole::NoWindowFlashing; - query->demandAttention(); - } - if(KVI_OPTION_BOOL(KviOption_boolPopupNotifierOnNewQueryMessages)) - { - // don't send the message twice to the notifier - iFlags |= KviConsole::NoNotifier; - QString szMsg = ""; - //QString szMsg = "<b><"; - //szMsg += szNick; - //szMsg += "></b> "; - QString szHtml = szMsgText; - szHtml.replace("<","<"); - szHtml.replace(">",">"); - szMsg += szHtml; - //debug("kvi_sp_literal.cpp:1262 debug: %s",szHtml.data()); - g_pApp->notifierMessage(query,KVI_SMALLICON_QUERYNOTICE,szMsg,1800); - } - } - - console->outputPrivmsg(query,msgtype,szNick,szUser,szHost,szMsgText,iFlags); - } - } else { - QString szMsgText = msg->connection()->decodeText(msg->safeTrailing()); - // no query creation: no decryption possible - // trigger the query message event in the console - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnQueryNotice,console,szNick,szUser,szHost,szMsgText)) - msg->setHaltOutput(); - // spit the message text out - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolExternalMessagesToActiveWindow) ? - console->activeWindow() : (KviWindow *)(console); - - if(KviIrcConnection * pConnection = console->connection()) - { - KviWindow * aWin = console->activeWindow(); - if((aWin->type() == KVI_WINDOW_TYPE_CHANNEL) && ((KviChannel *)aWin)->isOn(szNick)) - pOut = aWin; - else { - for(KviChannel * c = pConnection->channelList()->first();c;c = pConnection->channelList()->next()) - if(c->isOn(szNick)) - { - pOut = (KviWindow *) c; - break; - } - } - } - - pOut->output(KVI_OUT_QUERYNOTICE,"*\r!n\r%Q\r* %Q",&szNick,&szMsgText); - } - } - return; - } - - // Channel NOTICE - KviChannel * chan = msg->connection()->findChannel(szTarget); - - QString szOriginalTarget = szTarget; - QString szPrefixes; - - if(!chan) - { - // check if the channel has some leading mode prefixes - while((szTarget.length() > 0) && console->connection()->serverInfo()->isSupportedModePrefix(szTarget[0].unicode())) - { - szPrefixes += szTarget[0]; - szTarget.remove(0,1); - } - chan = msg->connection()->findChannel(szTarget); - } - - if(!chan) - { - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolOperatorMessagesToActiveWindow) ? - console->activeWindow() : (KviWindow *)(console); - QString szBroad; - QString szMsgText = msg->connection()->decodeText(msg->safeTrailing()); - KviQString::sprintf(szBroad,"[>> %Q] %Q",&szOriginalTarget,&szMsgText); - console->outputPrivmsg(pOut,KVI_OUT_BROADCASTNOTICE,szNick,szUser,szHost,szBroad,0); - return; - } - } else { - chan->userAction(szNick,szUser,szHost,KVI_USERACTION_NOTICE); - - KviStr szBuffer; const char * txtptr; int msgtype; - DECRYPT_IF_NEEDED(chan,msg->safeTrailing(),KVI_OUT_CHANNELNOTICE,KVI_OUT_CHANNELNOTICECRYPTED,szBuffer,txtptr,msgtype) - QString szMsgText = chan->decodeText(txtptr); - - if(KVS_TRIGGER_EVENT_3_HALTED(KviEvent_OnChannelNotice,chan,szNick,szMsgText,szOriginalTarget))msg->setHaltOutput(); - - if(!msg->haltOutput()) - { - if(szPrefixes.length() > 0) - { - QString szBroad; - KviQString::sprintf(szBroad,"[>> %Q\r!c\r%Q\r] %Q",&szPrefixes,&szTarget,&szMsgText); - console->outputPrivmsg(chan,msgtype,szNick,szUser,szHost,szBroad,0); - } else { - console->outputPrivmsg(chan,msgtype,szNick,szUser,szHost,szMsgText,0); - } - } - } -} - - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// TOPIC -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void KviServerParser::parseLiteralTopic(KviIrcMessage *msg) -{ - // TOPIC - // :<source_mask> TOPIC <channel> :<topic> - QString szNick,szUser,szHost; - msg->decodeAndSplitPrefix(szNick,szUser,szHost); - QString szTarget = msg->connection()->decodeText(msg->safeParam(0)); - - // Now lookup the channel - KviChannel * chan = msg->connection()->findChannel(szTarget); - - if(!chan) - { - UNRECOGNIZED_MESSAGE(msg,__tr2qs("Received a topic message for an unknown channel, possible desync")); - return; - } - - QString szTopic = chan->decodeText(msg->safeTrailing()); - - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnTopic,chan,szNick,szUser,szHost,szTopic)) - msg->setHaltOutput(); - - chan->topicWidget()->setTopic(szTopic); - chan->topicWidget()->setTopicSetBy(szNick); - QString tmp = QDateTime::currentDateTime().toString(); - chan->topicWidget()->setTopicSetAt(tmp); - - chan->userAction(szNick,szUser,szHost,KVI_USERACTION_TOPIC); - - if(!msg->haltOutput()) - { - chan->output(KVI_OUT_TOPIC, - __tr2qs("\r!n\r%Q\r [%Q@\r!h\r%Q\r] has changed topic to \"%Q%c\""), - &szNick,&szUser,&szHost,&szTopic,KVI_TEXT_RESET); - } -} - -void KviServerParser::parseLiteralNick(KviIrcMessage *msg) -{ - // NICK - // :source NICK <newnick> - QString szNick,szUser,szHost; - msg->decodeAndSplitPrefix(szNick,szUser,szHost); - KviConsole * console = msg->console(); - QString szNewNick = msg->connection()->decodeText(msg->safeTrailing()); - - bool bIsMe = IS_ME(msg,szNick); - - if(bIsMe) - { - // We have changed our nick - msg->connection()->nickChange(szNewNick); - - if(KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnMeNickChange,console,szNick,szNewNick)) - msg->setHaltOutput(); - } else { - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnNickChange,console,szNick,szUser,szHost,szNewNick)) - msg->setHaltOutput(); - } - - for(KviChannel * c = console->channelList()->first();c;c = console->channelList()->next()) - { - if(c->nickChange(szNick,szNewNick)) - { - if(!msg->haltOutput()) - c->output(KVI_OUT_NICK,__tr2qs("\r!n\r%Q\r [%Q@\r!h\r%Q\r] is now known as \r!n\r%Q\r"), - &szNick,&szUser,&szHost,&szNewNick); - // FIXME if(bIsMe)output(YOU ARE now known as.. ?) - } - if(bIsMe)c->updateCaption(); - } - - - // FIXME: #warning "NEW NICK MIGHT BE REGISTERED AND HAVE AN AVATAR!" - - if(bIsMe) - { - // just update all the captions : we have changed OUR nick - for(KviQuery * q = console->queryList()->first();q;q = console->queryList()->next()) - { - if(!msg->haltOutput()) - q->output(KVI_OUT_NICK,__tr2qs("You have changed your nickname to %Q"),&szNewNick); - q->updateCaption(); - } - } - KviQuery * q = console->connection()->findQuery(szNick); - // It CAN happen that szNewNick first queries us without being - // on any channel then he QUITS , he reconnects , he joins - // a channel with szNick , queries us and changes nick to szNewNick : gotcha! - // should merge the queries! - KviQuery * old = console->connection()->findQuery(szNewNick); - if(old && (old != q)) - { - if(KVI_OPTION_BOOL(KviOption_boolEnableQueryTracing) && (!_OUTPUT_QUIET)) - { - old->output(KVI_OUT_QUERYTRACE, - __tr2qs("The target of this query was lost and has been found when \r!n\r%Q\r [%Q@\r!h\r%Q\r] changed his nickname to \r!n\r%Q\r"), - &szNick,&szUser,&szHost,&szNewNick); - } - if(q) - { - bool bQWasActive = (q == g_pActiveWindow); - if(!_OUTPUT_MUTE) - { - old->output(KVI_OUT_SYSTEMWARNING, - __tr2qs("The recent nickname change from \r!n\r%Q\r to \r!n\r%Q\r caused a query collision: merging output"), - &szNick,&szNewNick); - } - old->mergeQuery(q); - q->frame()->closeWindow(q); // deleted path - if(!msg->haltOutput()) - old->output(KVI_OUT_NICK,__tr2qs("\r!n\r%Q\r [%Q@\r!h\r%Q\r] is now known as \r!n\r%Q\r"), - &szNick,&szUser,&szHost,&szNewNick); - if(!_OUTPUT_MUTE) - old->output(KVI_OUT_SYSTEMWARNING,__tr2qs("End of merged output")); - old->userAction(szNewNick,szUser,szHost,KVI_USERACTION_NICK); - if(bQWasActive)old->delayedAutoRaise(); - } - if(KVI_OPTION_BOOL(KviOption_boolEnableQueryTracing)) - { - QString szChans; - int iChans = console->connection()->getCommonChannels(szNewNick,szChans); - old->notifyCommonChannels(szNewNick,szUser,szHost,iChans,szChans); - } - } else { - if(q) - { - // the target SHOULD have changed his nick here - if(!q->nickChange(szNick,szNewNick)) - debug("Internal error: query %s failed to change nick from %s to s",szNick.utf8().data(),szNick.utf8().data(),szNewNick.utf8().data()); - if(!msg->haltOutput()) - q->output(KVI_OUT_NICK,__tr2qs("\r!n\r%Q\r [%Q@\r!h\r%Q\r] is now known as \r!n\r%Q\r"), - &szNick,&szUser,&szHost,&szNewNick); - q->userAction(szNewNick,szUser,szHost,KVI_USERACTION_NICK); - } - } - -// FIXME: #warning "UPDATE ALL THE OTHER CONNECTION RELATED WINDOW CAPTIONS WHEN bIsMe!!" -} - -void KviServerParser::parseLiteralInvite(KviIrcMessage *msg) -{ - // INVITE - // :source INVITE <target> <channel> - QString szNick,szUser,szHost; - msg->decodeAndSplitPrefix(szNick,szUser,szHost); - - QString szTarget = msg->connection()->decodeText(msg->safeParam(0)); - QString szChannel = msg->connection()->decodeText(msg->safeParam(1)); - - KviConsole * console = msg->console(); - KviRegisteredUser * u = msg->connection()->userDataBase()->registeredUser(szNick,szUser,szHost); - //Ignore it? - if(u) - { - if(u->isIgnoreEnabledFor(KviRegisteredUser::Invite)) - { - if(KVI_OPTION_BOOL(KviOption_boolVerboseIgnore)) - { - console->output(KVI_OUT_IGNORE,__tr2qs("Ignoring invite from \r!nc\r%Q\r [%Q@\r!h\r%Q\r]"),&szNick,&szUser,&szHost); - } - return; - } - } - - if(IS_ME(msg,szTarget)) - { - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnInvite,msg->console(),szNick,szUser,szHost,szChannel)) - msg->setHaltOutput(); - - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolInvitesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - QString szAction = KVI_OPTION_BOOL(KviOption_boolAutoJoinOnInvite) ? __tr2qs("autojoining") : __tr2qs("double-click the channel name to join"); - pOut->output(KVI_OUT_INVITE,__tr2qs("\r!n\r%Q\r [%Q@\r!h\r%Q\r] invites you to channel \r!c\r%Q\r (%Q)"), - &szNick,&szUser,&szHost,&szChannel,&szAction); - } - - if(KVI_OPTION_BOOL(KviOption_boolAutoJoinOnInvite)) - msg->connection()->sendFmtData("JOIN %s",msg->safeParam(1)); - - } else { - UNRECOGNIZED_MESSAGE(msg,__tr("Received an invite message directed to another nick, possible desync")); - } -} - -void KviServerParser::parseLiteralWallops(KviIrcMessage *msg) -{ - // WALLOPS - // :source WALLOPS :msg - QString szNick,szUser,szHost; - msg->decodeAndSplitPrefix(szNick,szUser,szHost); - - QString szMsg = msg->connection()->decodeText(msg->safeTrailing()); - - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnWallops,msg->console(),szNick,szUser,szHost,szMsg)) - msg->setHaltOutput(); - - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolOperatorMessagesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - pOut->output(KVI_OUT_WALLOPS,__tr2qs("WALLOPS from \r!n\r%Q\r [%Q@\r!h\r%Q\r]: %Q"), - &szNick,&szUser,&szHost,&szMsg); - } -} - -void KviServerParser::parseUserMode(KviIrcMessage *msg,const char * modeflptr) -{ - // changed my user mode - bool bSet = true; - while(*modeflptr) - { - switch(*modeflptr) - { - case '+': bSet = true; break; - case '-': bSet = false; break; - default: - if(msg->connection()->changeUserMode(*modeflptr,bSet)) - { - if(msg->connection()->serverInfo()->registerModeChar()==*modeflptr) - { - KviKvsVariantList vList; - KviKvsEventManager::instance()->trigger(KviEvent_OnNickServAuth,msg->console(),&vList); - } - // There was a mode change - if(KviKvsEventManager::instance()->hasAppHandlers(KviEvent_OnUserMode)) - { - QString szModeFlag(bSet ? QChar('+') : QChar('-')); - szModeFlag += QChar(*modeflptr); - KviKvsVariantList vList(new KviKvsVariant(szModeFlag)); - if(KviKvsEventManager::instance()->trigger(KviEvent_OnUserMode,msg->console(),&vList)) - msg->setHaltOutput(); - } - } - break; - } - ++modeflptr; - } -} - - - -void KviServerParser::parseLiteralMode(KviIrcMessage *msg) -{ - // NICK - // :source MODE target <params> - // :source MODE <me> +|-modeflag - // :source MODE <channel> +-modeflags [parameters] - QString szNick,szUser,szHost; - msg->decodeAndSplitPrefix(szNick,szUser,szHost); - - // if(!source.hasHost()) - // { - // // This is a server or a channel service - // KviStr snick = source.nick(); - // if(snick.contains('.'))source.setHost(source.nick()); // this is a server - // } - - QString szTarget = msg->connection()->decodeText(msg->safeParam(0)); - KviStr modefl(msg->safeParam(1)); - - if(IS_ME(msg,szTarget)) - { - parseUserMode(msg,modefl.ptr()); - if(!msg->haltOutput()) - msg->console()->output(KVI_OUT_MODE,__tr2qs("You have set user mode %s"),modefl.ptr()); - } else { - // a channel mode - KviChannel * chan = msg->connection()->findChannel(szTarget); - - if(!chan){ - // Ooops , desync with the server. - UNRECOGNIZED_MESSAGE(msg,__tr("Received a mode change for an unknown channel, possible desync")); - return; - } - - chan->userAction(szNick,szUser,szHost,KVI_USERACTION_CHANMODE); - parseChannelMode(szNick,szUser,szHost,chan,modefl,msg,2); - } -} - -void KviServerParser::parseChannelMode(const QString &szNick,const QString &szUser,const QString &szHost,KviChannel * chan,KviStr &modefl,KviIrcMessage *msg,int curParam) -{ - // FIXME: freenode has two ugly incompatible extensions: - // mode e: that is NOT viewable (???) - // mode q that stands for "quiet-ban" - // mode #chan +q mask - // adds mask to the banlist with the prefix % - // and doesn't allow the users matching the mask to talk to the channel - - bool bSet = true; - const char * aux = modefl.ptr(); - QString aParam; - - QString nickBuffer; - QString hostBuffer; - - if(szHost != "*") - { - KviQString::sprintf(nickBuffer,"\r!n\r%Q\r",&szNick); - KviQString::sprintf(hostBuffer,"\r!h\r%Q\r",&szHost); - } else { - if(nickBuffer.find('.') != -1) - { - // This looks a lot like a server! - KviQString::sprintf(nickBuffer,"\r!s\r%Q\r",&szNick); - } else { - // Probably a service....whois should work - KviQString::sprintf(nickBuffer,"\r!n\r%Q\r",&szNick); - } - hostBuffer = szHost; - } - - KviIrcMask * auxMask; - - int curParamSave = curParam; - bool bIsMe; - - //FIXME: Use PREFIX in 005 numeric instead of bServerSupportsModeIe - get rid of it altogether - //bool bModeIe = console->connection()->serverInfo()->supportsModesIe(); - - - while(*aux) - { - switch(*aux) - { - case '+': - bSet = true; - break; - case '-': - bSet = false; - break; - case 'k': - if(bSet)aParam = msg->safeParam(curParam++); - else aParam = ""; - chan->setChannelKey(aParam); - - if(bSet) { - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnKeySet,chan,szNick,szUser,szHost,aParam)) - msg->setHaltOutput(); - } else { - if(KVS_TRIGGER_EVENT_3_HALTED(KviEvent_OnKeyUnset,chan,szNick,szUser,szHost)) - msg->setHaltOutput(); - } - - if(!(msg->haltOutput() || KVI_OPTION_BOOL(KviOption_boolShowCompactModeChanges))) - { - if(bSet)chan->output(KVI_OUT_KEY, - __tr2qs("%Q [%Q@%Q] has set channel key to \"\r!m-k\r%Q\r\""), - &nickBuffer,&szUser,&hostBuffer,&aParam); - else chan->output(KVI_OUT_KEY, - __tr2qs("%Q [%Q@%Q] has unset the channel key"), - &nickBuffer,&szUser,&hostBuffer); - } - break; - case 'l': - if(bSet)aParam = msg->safeParam(curParam++); - else aParam = ""; - chan->setChannelLimit(aParam); - - if(bSet) { - if(KVS_TRIGGER_EVENT_4_HALTED(KviEvent_OnLimitSet,chan,szNick,szUser,szHost,aParam)) - msg->setHaltOutput(); - } else { - if(KVS_TRIGGER_EVENT_3_HALTED(KviEvent_OnLimitUnset,chan,szNick,szUser,szHost)) - msg->setHaltOutput(); - } - - if(!(msg->haltOutput() || KVI_OPTION_BOOL(KviOption_boolShowCompactModeChanges))) - { - if(bSet)chan->output(KVI_OUT_LIMIT, - __tr2qs("%Q [%Q@%Q] has set channel \r!m-l\rlimit to %Q\r"), - &nickBuffer,&szUser,&hostBuffer,&aParam); - else chan->output(KVI_OUT_LIMIT, - __tr2qs("%Q [%Q@%Q] has unset the channel limit"), - &nickBuffer,&szUser,&hostBuffer); - } - break; - -#define CHANUSER_MODE(__modechar,__chanfunc,__evmeset,__evmeunset,__evset,__evunset,__icomeset,__icomeunset,__icoset,__icounset) \ - case __modechar: \ - if(msg->connection()->serverInfo()->isSupportedModeFlag(__modechar)) \ - { \ - aParam = msg->connection()->decodeText(msg->safeParam(curParam++)); \ - chan->__chanfunc(aParam,bSet); \ - bIsMe = IS_ME(msg,aParam); \ - if(bIsMe) \ - { \ - if(KVS_TRIGGER_EVENT_3_HALTED(bSet ? __evmeset : __evmeunset,chan,szNick,szUser,szHost))msg->setHaltOutput(); \ - chan->updateCaption(); \ - } else { \ - if(KVS_TRIGGER_EVENT_4_HALTED(bSet ? __evset : __evunset,chan,szNick,szUser,szHost,aParam))msg->setHaltOutput(); \ - } \ - if(!(msg->haltOutput() || KVI_OPTION_BOOL(KviOption_boolShowCompactModeChanges))) \ - { \ - chan->output(bSet ? (bIsMe ? __icomeset : __icoset) : (bIsMe ? __icomeunset : __icounset), \ - __tr2qs("%Q [%Q@%Q] has set mode %c%c \r!n\r%Q\r"), \ - &nickBuffer,&szUser,&hostBuffer,bSet ? '+' : '-',__modechar,&aParam); \ - } \ - } else {\ - chan->setChannelMode(__modechar,bSet);\ - if(!(msg->haltOutput() || KVI_OPTION_BOOL(KviOption_boolShowCompactModeChanges)))\ - {\ - chan->output(KVI_OUT_CHANMODE,\ - __tr2qs("%Q [%Q@%Q] has set channel \r!m%c%c\rmode %c%c\r"),\ - &nickBuffer,&szUser,&hostBuffer,\ - bSet ? '-' : '+',__modechar,bSet ? '+' : '-',__modechar);\ - }\ - }\ - break; - CHANUSER_MODE('q',setChanOwner,KviEvent_OnMeChanOwner,KviEvent_OnMeDeChanOwner,KviEvent_OnChanOwner,KviEvent_OnDeChanOwner,KVI_OUT_MECHANOWNER,KVI_OUT_MEDECHANOWNER,KVI_OUT_CHANOWNER,KVI_OUT_DECHANOWNER) - CHANUSER_MODE('a',setChanAdmin,KviEvent_OnMeChanAdmin,KviEvent_OnMeDeChanAdmin,KviEvent_OnChanAdmin,KviEvent_OnDeChanAdmin,KVI_OUT_MECHANADMIN,KVI_OUT_MEDECHANADMIN,KVI_OUT_CHANADMIN,KVI_OUT_DECHANADMIN) - CHANUSER_MODE('o',op,KviEvent_OnMeOp,KviEvent_OnMeDeOp,KviEvent_OnOp,KviEvent_OnDeOp,KVI_OUT_MEOP,KVI_OUT_MEDEOP,KVI_OUT_OP,KVI_OUT_DEOP) - CHANUSER_MODE('h',halfop,KviEvent_OnMeHalfOp,KviEvent_OnMeDeHalfOp,KviEvent_OnHalfOp,KviEvent_OnDeHalfOp,KVI_OUT_MEHALFOP,KVI_OUT_MEDEHALFOP,KVI_OUT_HALFOP,KVI_OUT_HALFDEOP) - CHANUSER_MODE('v',voice,KviEvent_OnMeVoice,KviEvent_OnMeDeVoice,KviEvent_OnVoice,KviEvent_OnDeVoice,KVI_OUT_MEVOICE,KVI_OUT_MEDEVOICE,KVI_OUT_VOICE,KVI_OUT_DEVOICE) - CHANUSER_MODE('u',userop,KviEvent_OnMeUserOp,KviEvent_OnMeDeUserOp,KviEvent_OnUserOp,KviEvent_OnDeUserOp,KVI_OUT_MEUSEROP,KVI_OUT_MEDEUSEROP,KVI_OUT_USEROP,KVI_OUT_USERDEOP) - -#define CHANNEL_MODE(__modefl,__evmeset,__evmeunset,__evset,__evunset,__icomeset,__icomeunset,__icoset,__icounset) \ - case __modefl: \ - aParam = msg->connection()->decodeText(msg->safeParam(curParam++)); \ - chan->setMask(*aux,aParam,bSet,msg->connection()->decodeText(msg->safePrefix()),QDateTime::currentDateTime().toTime_t()); \ - auxMask = new KviIrcMask(aParam); \ - bIsMe = auxMask->matchesFixed( \ - msg->connection()->userInfo()->nickName(), \ - msg->connection()->userInfo()->userName(), \ - msg->connection()->userInfo()->hostName()); \ - delete auxMask; \ - if(bIsMe) \ - { \ - if(KVS_TRIGGER_EVENT_4_HALTED(bSet ? __evmeset : __evmeunset,chan,szNick,szUser,szHost,aParam))msg->setHaltOutput(); \ - } else { \ - if(KVS_TRIGGER_EVENT_4_HALTED(bSet ? __evset : __evunset,chan,szNick,szUser,szHost,aParam))msg->setHaltOutput(); \ - } \ - if(!(msg->haltOutput() || KVI_OPTION_BOOL(KviOption_boolShowCompactModeChanges))) \ - { \ - chan->output(bSet ? (bIsMe ? __icomeset : __icoset) : (bIsMe ? __icomeunset : __icounset), \ - __tr2qs("%Q [%Q@%Q] has set mode %c%c \r!m%c%c\r%Q\r"), \ - &nickBuffer,&szUser,&hostBuffer, \ - bSet ? '+' : '-',__modefl,bSet ? '-' : '+',__modefl,&aParam); \ - } \ - break; - - CHANNEL_MODE('b',KviEvent_OnMeBan,KviEvent_OnMeUnban,KviEvent_OnBan,KviEvent_OnUnban,KVI_OUT_MEBAN,KVI_OUT_MEUNBAN,KVI_OUT_BAN,KVI_OUT_UNBAN) - CHANNEL_MODE('I',KviEvent_OnMeInviteException,KviEvent_OnMeInviteExceptionRemove,KviEvent_OnInviteException,KviEvent_OnInviteExceptionRemove,KVI_OUT_MEINVITEEXCEPT,KVI_OUT_MEINVITEUNEXCEPT,KVI_OUT_INVITEEXCEPT,KVI_OUT_INVITEUNEXCEPT) - CHANNEL_MODE('e',KviEvent_OnMeBanException,KviEvent_OnMeBanExceptionRemove,KviEvent_OnBanException,KviEvent_OnBanExceptionRemove,KVI_OUT_MEBANEXCEPT,KVI_OUT_MEBANUNEXCEPT,KVI_OUT_BANEXCEPT,KVI_OUT_BANUNEXCEPT) - - default: - chan->setChannelMode(*aux,bSet); - if(!(msg->haltOutput() || KVI_OPTION_BOOL(KviOption_boolShowCompactModeChanges))) - { - chan->output(KVI_OUT_CHANMODE, - __tr2qs("%Q [%Q@%Q] has set channel \r!m%c%c\rmode %c%c\r"), - &nickBuffer,&szUser,&hostBuffer, - bSet ? '-' : '+',*aux,bSet ? '+' : '-',*aux); - } - break; - } - ++aux; - } - - QString param; - QString params; - param = msg->connection()->decodeText(msg->safeParam(curParamSave++)); - while(!param.isEmpty()) - { - if(!params.isEmpty())params.append(' '); - params.append(param); - param = msg->connection()->decodeText(msg->safeParam(curParamSave++)); - } - - if(KVS_TRIGGER_EVENT_5_HALTED(KviEvent_OnChannelModeChange,chan,szNick,szUser,szHost,modefl.ptr(),params)) - msg->setHaltOutput(); - - if(KVI_OPTION_BOOL(KviOption_boolShowCompactModeChanges) && (!msg->haltOutput()) && (!kvi_strEqualCS(modefl.ptr(),"+"))) - { - if(!params.isEmpty()) - { - chan->output(KVI_OUT_CHANMODE,__tr2qs("%Q [%Q@%Q] has set mode %s %Q"), - &nickBuffer,&szUser,&hostBuffer,modefl.ptr(),¶ms); - } else { - chan->output(KVI_OUT_CHANMODE,__tr2qs("%Q [%Q@%Q] has set channel mode %s"), - &nickBuffer,&szUser,&hostBuffer,modefl.ptr()); - } - } -} diff --git a/3.4.0/src/kvirc/sparser/kvi_sp_numeric.cpp b/3.4.0/src/kvirc/sparser/kvi_sp_numeric.cpp deleted file mode 100644 index 5a79883188..0000000000 --- a/3.4.0/src/kvirc/sparser/kvi_sp_numeric.cpp +++ /dev/null @@ -1,2003 +0,0 @@ -//============================================================================= -// -// File : kvi_sp_numeric.cpp -// Creation date : Thu Aug 3 2000 01:30:45 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_sparser.h" -#include "kvi_window.h" -#include "kvi_query.h" -#include "kvi_out.h" -#include "kvi_locale.h" -#include "kvi_ircsocket.h" -#include "kvi_options.h" -#include "kvi_channel.h" -#include "kvi_topicw.h" -#include "kvi_ircuserdb.h" -#include "kvi_defaults.h" -#include "kvi_mirccntrl.h" -#include "kvi_frame.h" -#include "kvi_parameterlist.h" -#include "kvi_app.h" -#include "kvi_notifylist.h" -#include "kvi_numeric.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionstatedata.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_ircconnectionserverinfo.h" -#include "kvi_ircconnectionasyncwhoisdata.h" -#include "kvi_ircconnectiontarget.h" -#include "kvi_time.h" -#include "kvi_lagmeter.h" -#include "kvi_qcstring.h" - -#include <qpixmap.h> -#include <qdatetime.h> -#include <qtextcodec.h> -#include <qregexp.h> - -#include "kvi_kvs_eventtriggers.h" -#include "kvi_kvs_script.h" -#include "kvi_kvs_variantlist.h" - -// #define IS_CHANNEL_TYPE_FLAG(_str) ((*(_str) == '#') || (*(_str) == '&') || (*(_str) == '!')) -#define IS_CHANNEL_TYPE_FLAG(_qchar) (msg->connection()->serverInfo()->supportedChannelTypes().find(_qchar) != -1) -#define IS_USER_MODE_PREFIX(_qchar) (msg->connection()->serverInfo()->supportedModePrefixes().find(_qchar) != -1) - -// Numeric message handlers - -// FIXME: #warning "IN ALL OUTPUT ADD ESCAPE SEQUENCES!!!!" -// FIXME: #warning "parseErrorUnknownModeChar() for modes e and I , parseErrorUnknownCommand for WATCH" - -void KviServerParser::parseNumeric001(KviIrcMessage *msg) -{ - // 001: RPL_WELCOME - // :prefix 001 target :Welcome to the Internet Relay Network <usermask> - // FIXME: #warning "SET THE USERMASK FROM SERVER" - QString szText = msg->connection()->decodeText(msg->safeTrailing()); - QRegExp rx( " ([^ ]+)!([^ ]+)@([^ ]+)$" ); - if( rx.search(szText) != -1) - { - msg->connection()->userInfo()->setUnmaskedHostName(rx.cap(3)); - msg->connection()->userInfo()->setNickName(rx.cap(1)); - msg->connection()->userInfoReceived(rx.cap(2),rx.cap(3)); - } - if(msg->connection()->context()->state() != KviIrcContext::Connected) - msg->connection()->loginComplete(msg->connection()->decodeText(msg->param(0))); - if(!msg->haltOutput()) - msg->console()->outputNoFmt(KVI_OUT_SERVERINFO,szText); -} - -void KviServerParser::parseNumeric002(KviIrcMessage *msg) -{ - // 002: RPL_YOURHOST [I,E,U,D] - // :prefix 002 target :Your host is <server name>, running version <server version> - if(msg->connection()->context()->state() != KviIrcContext::Connected) - msg->connection()->loginComplete(msg->connection()->decodeText(msg->param(0))); - if(!msg->haltOutput())msg->console()->outputNoFmt(KVI_OUT_SERVERINFO,msg->connection()->decodeText(msg->safeTrailing())); -} - -void KviServerParser::parseNumeric003(KviIrcMessage *msg) -{ - // 003: RPL_CREATED [I,E,U,D] - // :prefix 003 target :This server was created <date> - if(msg->connection()->context()->state() != KviIrcContext::Connected) - msg->connection()->loginComplete(msg->connection()->decodeText(msg->param(0))); - if(!msg->haltOutput())msg->console()->outputNoFmt(KVI_OUT_SERVERINFO,msg->connection()->decodeText(msg->safeTrailing())); -} - -void KviServerParser::parseNumeric004(KviIrcMessage *msg) -{ - // 004: RPL_MYINFO [I,E,U,D] - // :prefix 004 target <server_name> <srv_version> <u_modes> <ch_modes> - if(msg->connection()->context()->state() != KviIrcContext::Connected) - msg->connection()->loginComplete(msg->connection()->decodeText(msg->param(0))); - - int uParams = msg->paramCount(); - int uModeParam = 3; - - if(uParams < 2)uParams = 2; - - KviStr version = msg->safeParam(2); - msg->connection()->serverInfo()->setServerVersion(msg->safeParam(2)); - - KviStr umodes; - // skip version number (great, thanks WEBMASTER INCORPORATED -_-) - do - { - umodes = msg->safeParam(uModeParam); - } while (((umodes.contains('.')) || (umodes.contains('-'))) && uModeParam++ < uParams); - - KviStr chanmodes = msg->safeParam(uModeParam+1); - - if(uModeParam > 3) - { - version.append(' '); - version.append(msg->safeParam(3)); - } - - if((umodes.occurences('o') != 1) || (chanmodes.occurences('o') != 1) || - (chanmodes.occurences('b') != 1) || (chanmodes.occurences('v') != 1) || - (chanmodes.occurences('t') != 1) || (chanmodes.occurences('n') != 1) || - (chanmodes.contains('.')) || (chanmodes.contains('-')) || (chanmodes.contains('('))) - { - if(!_OUTPUT_QUIET) - { - msg->console()->output(KVI_OUT_SYSTEMWARNING,__tr2qs( - "One or more standard mode flags are missing in the server available modes.\n" \ - "This is caused either by a non RFC1459-compliant IRC daemon or a broken server reply.\n" \ - "Server umodes seem to be '%s' and channel modes seem to be '%s'.\n" \ - "Ignoring this reply and assuming that the basic set of modes is available.\n" \ - "If you have strange problems, try changing the server."),umodes.ptr(),chanmodes.ptr()); - } - umodes = "oiws"; // standard support - chanmodes = "obtkmlvsn"; // standard support - } - - if(KVI_OPTION_BOOL(KviOption_boolShowExtendedServerInfo) && (!msg->haltOutput())) - { - if(umodes.hasData())msg->console()->outputNoFmt(KVI_OUT_SERVERINFO,__tr2qs("Available user modes:")); - - const char * aux = umodes.ptr(); - QString tmp; - - while(*aux) - { - tmp = msg->connection()->serverInfo()->getUserModeDescription(*aux); - if(tmp.isEmpty()) - { - QString tmp2 = __tr2qs(": Unknown user mode"); - KviQString::sprintf(tmp,"%c: %Q",*aux,&tmp2); - } - - msg->console()->outputNoFmt(KVI_OUT_SERVERINFO,tmp); - aux++; - } - - if(chanmodes.hasData())msg->console()->outputNoFmt(KVI_OUT_SERVERINFO,__tr2qs("Available channel modes:")); - - aux = chanmodes.ptr(); - - while(*aux) - { - KviQString::sprintf(tmp,"%c: %Q",*aux,&(msg->connection()->serverInfo()->getChannelModeDescription(*aux))); - msg->console()->outputNoFmt(KVI_OUT_SERVERINFO,tmp); - aux++; - } - } - - QString szServer = msg->connection()->decodeText(msg->safeParam(1)); - - msg->connection()->serverInfoReceived(szServer,umodes.ptr(),chanmodes.ptr()); - - // FIXME: #warning "TO ACTIVE ? OR TO CONSOLE ?" - if(!_OUTPUT_MUTE) - { - if(!msg->haltOutput())msg->console()->output(KVI_OUT_SERVERINFO, - __tr2qs("Server %Q version %S supporting user modes '%S' and channel modes '%S'"), - &szServer,&version,&umodes,&chanmodes); - } -} - -void KviServerParser::parseNumeric005(KviIrcMessage *msg) -{ - // 005: RPL_PROTOCTL [D] - // :prefix 005 target <proto> <proto> .... :are available/supported on this server - // 005: RPL_BOUNCE [?] - // :prefix 005 target :Try server <server>, port <port> - // 005: RPL_ISUPPORT - if(msg->connection()->context()->state() != KviIrcContext::Connected) - msg->connection()->loginComplete(msg->connection()->decodeText(msg->param(0))); - - bool bUhNames = false; - bool bNamesx = false; - - unsigned int count = msg->paramCount(); - if(count > 2) - { - count--; - for(unsigned int i = 1;i < count;i++) - { - const char * p = msg->param(i); - if(kvi_strEqualCIN("PREFIX=(",p,8)) - { - p+=8; - const char * pModes = p; - while(*p && (*p != ')'))p++; - KviStr szModeFlags(pModes,p-pModes); - if(*p)p++; - KviStr szModePrefixes = p; - if(szModePrefixes.hasData() && (szModePrefixes.len() == szModeFlags.len())) - { - msg->connection()->serverInfo()->setSupportedModePrefixes(szModePrefixes.ptr(),szModeFlags.ptr()); - } - } else if(kvi_strEqualCIN("CHANTYPES=",p,10)) - { - p+=10; - KviStr tmp = p; - if(tmp.hasData())msg->connection()->serverInfo()->setSupportedChannelTypes(tmp.ptr()); - } else if(kvi_strEqualCI("WATCH",p) || kvi_strEqualCIN("WATCH=",p,6)) - { - msg->connection()->serverInfo()->setSupportsWatchList(true); - if((!_OUTPUT_MUTE) && (!msg->haltOutput()) && KVI_OPTION_BOOL(KviOption_boolShowExtendedServerInfo)) - { - msg->console()->outputNoFmt(KVI_OUT_SERVERINFO,__tr2qs("This server supports the WATCH notify list method, it will be used")); - } - } else if(kvi_strEqualCIN("TOPICLEN=",p,9)) - { - p += 9; - QString tmp = p; - if(!tmp.isEmpty()) { - bool ok; - int len = tmp.toInt( &ok ); - if(ok) msg->connection()->serverInfo()->setMaxTopicLen(len); - } - } else if(kvi_strEqualCIN("NETWORK=",p,8)) - { - p += 8; - QString tmp = p; - if(!tmp.isEmpty())msg->console()->connection()->target()->setNetworkName(tmp); - if((!_OUTPUT_MUTE) && (!msg->haltOutput()) && KVI_OPTION_BOOL(KviOption_boolShowExtendedServerInfo)) - { - msg->console()->output(KVI_OUT_SERVERINFO,__tr2qs("The current network is %Q"),&tmp); - } - } else if(kvi_strEqualCI("CODEPAGES",p)) - { - msg->connection()->serverInfo()->setSupportsCodePages(true); - if((!_OUTPUT_MUTE) && (!msg->haltOutput()) && KVI_OPTION_BOOL(KviOption_boolShowExtendedServerInfo)) - { - msg->console()->outputNoFmt(KVI_OUT_SERVERINFO,__tr2qs("This server supports the CODEPAGE command, it will be used")); - } - - //msg->connection()->sendFmtData("CODEPAGE %s",msg->console()->textCodec()->name()); - - } else if(kvi_strEqualCIN("CHANMODES=",p,10)) - { - p+=10; - QString tmp = p; - msg->connection()->serverInfo()->setSupportedChannelModes(tmp); - }else if(kvi_strEqualCIN("MODES=",p,6)) - { - p+=6; - QString tmp = p; - bool bok; - int num=tmp.toUInt(&bok); - if(bok) - msg->connection()->serverInfo()->setMaxModeChanges(num); - } else if(kvi_strEqualCIN("NAMESX",p,6)) - { - p+=6; - bNamesx=true; - } else if(kvi_strEqualCIN("UHNAMES",p,7)) - { - p+=7; - bUhNames=true; - }else if(kvi_strEqualCIN("CHARSET=",p,8)) - { - p+=8; - QString tmp = p; - msg->connection()->serverInfo()->setSupportsCodePages(true); - - if((!_OUTPUT_MUTE) && (!msg->haltOutput()) && KVI_OPTION_BOOL(KviOption_boolShowExtendedServerInfo)) - { - msg->console()->outputNoFmt(KVI_OUT_SERVERINFO,__tr2qs("This server supports the CODEPAGE command, it will be used")); - } - - /*if( tmp.contains(msg->console()->textCodec()->name(),false) || tmp.contains("*",false) ) - { - msg->connection()->sendFmtData("CODEPAGE %s",msg->console()->textCodec()->name()); - }*/ - } - } - if((!_OUTPUT_MUTE) && (!msg->haltOutput())) - { - const char * aux = msg->allParams(); - while(*aux == ' ')aux++; - while(*aux && (*aux != ' '))aux++; - while(*aux == ' ')aux++; - if(*aux == ':')aux++; - if(!msg->haltOutput())msg->console()->output(KVI_OUT_SERVERINFO,__tr2qs("This server supports: %s"),msg->connection()->decodeText(aux).utf8().data()); - if(bNamesx || bUhNames) { - msg->connection()->sendFmtData("PROTOCTL %s %s",bNamesx ? "NAMESX" : "", bUhNames ? "UHNAMES" : ""); - } - } - } else { - QString inf = msg->connection()->decodeText(msg->safeTrailing()); - if(!msg->haltOutput())msg->console()->outputNoFmt(KVI_OUT_SERVERINFO,inf); - } - // } else { - // // RPL_BOUNCE prolly - // if(!msg->haltOutput())msg->console()->outputNoFmt(KVI_OUT_SERVERINFO,msg->safeTrailing()); - // } -} - -void KviServerParser::parseNumericMotd(KviIrcMessage *msg) -{ - // 372: RPL_MOTD [I,E,U,D] - // :prefix 372 target : - <motd> - // 377: RPL_MOTD2 [?] - // :prefix 377 target : - <motd> - // 378: RPL_MOTD3 [Austnet] - // :prefix 377 target : - <motd> - // 375: RPL_MOTDSTART [I,E,U,D] - // :prefix 375 target : - <server> Message of the Day - - // 372: RPL_ENDOFMOTD [I,E,U,D] - // :prefix 376 target :End of /MOTD command. - // FIXME: #warning "SKIP MOTD , MOTD IN A SEPARATE WINDOW , SILENT ENDOFMOTD , MOTD IN ACTIVE WINDOW" - if(!msg->haltOutput())msg->console()->outputNoFmt(KVI_OUT_MOTD,msg->connection()->decodeText(msg->safeTrailing())); - - if(msg->numeric() == RPL_ENDOFMOTD) - { - msg->connection()->endOfMotdReceived(); - } -} - -void KviServerParser::parseNumericEndOfNames(KviIrcMessage *msg) -{ - // 366: RPL_ENDOFNAMES [I,E,U,D] - // :prefix 366 target <channel> :End of /NAMES list. - QString szChan = msg->connection()->decodeText(msg->safeParam(1)); - KviChannel * chan = msg->connection()->findChannel(szChan); - if(chan) - { - if(!chan->hasAllNames()) - { - chan->setHasAllNames(); - return; - } - } - - if(!msg->haltOutput() && !_OUTPUT_MUTE) - { -// FIXME: #warning "KVI_OUT_NAMES missing" - KviWindow * pOut = chan ? chan : KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - pOut->output(KVI_OUT_UNHANDLED,__tr2qs("End of NAMES for \r!c\r%Q\r"),&szChan); - } -} - -void KviServerParser::parseNumeric020(KviIrcMessage *msg) -{ - // 020: RPL_CONNECTING - //:irc.dotsrc.org 020 * :Please wait while we process your connection. - QString szServer; - if(!msg->haltOutput()) - { - QString szWText = msg->console()->decodeText(msg->safeTrailing()); - msg->console()->output( - KVI_OUT_CONNECTION,"%c\r!s\r%s\r%c: %Q",KVI_TEXT_BOLD, - msg->safePrefix(),KVI_TEXT_BOLD,&szWText); - } -} - -void KviServerParser::parseNumericNames(KviIrcMessage *msg) -{ - // 353: RPL_NAMREPLY [I,E,U,D] - // :prefix 353 target [=|*|@] <channel> :<space_separated_list_of_nicks> - - // [=|*|@] is the type of the channel: - // = --> public * --> private @ --> secret - // ...but we ignore it - //QString szChan = msg->connection()->decodeText(msg->cSafeParam(2)->data()); // <-- KviQCString::data() is implicitly unsafe: it CAN return 0 - QString szChan = msg->connection()->decodeText(msg->safeParam(2)); - KviChannel * chan = msg->connection()->findChannel(szChan); - // and run to the first nickname - char * aux = msg->safeTrailingString().ptr(); - while((*aux) && (*aux == ' '))aux++; - // now check if we have that channel - - char * trailing = aux; - - bool bHalt = msg->haltOutput(); - - if(chan) - { - bHalt = bHalt || (!chan->hasAllNames()); - - // K...time to parse a lot of data - chan->enableUserListUpdates(false); - - int iPrevFlags = chan->myFlags(); - - KviIrcConnectionServerInfo * pServerInfo = msg->connection()->serverInfo(); - - while(*aux) - { - int iFlags = 0; - // @ = op (+o), + = voiced (+v), % = halfop (+h), - = userop (+u), ^ = protected (+a?), * = chan owner (+q), !, & = channel admin (+a?) - // ^ +a is a weird mode: it also breaks nicknames on some networks! - // not a valid first char(s) of nickname, must be a mode prefix - - bool bContinue = true; - - while(pServerInfo->isSupportedModePrefix((unsigned char)(*aux))) - { - // leading umode flag(s) - iFlags |= pServerInfo->modeFlagFromPrefixChar(*aux); - aux++; - } - - char * begin = aux; - while(*aux && (*aux != ' '))aux++; - char save = *aux; - *aux = 0; - // NAMESX + UHNAMES support - KviIrcMask mask(msg->connection()->decodeText(begin)); - // and make it join - if(!mask.nick().isEmpty())chan->join(mask.nick(), - mask.hasUser() ? mask.user() : QString::null, - mask.hasHost() ? mask.host() : QString::null, - iFlags); - *aux = ' '; - *aux = save; - // run to the next nick (or the end) - while((*aux) && (*aux == ' '))aux++; - } - - if(iPrevFlags != chan->myFlags())chan->updateCaption(); - - chan->enableUserListUpdates(true); - // finished a block - } - - // So it is a result of a /NAMES command or a local desync - // We handle it in a cool way. - - if(!bHalt) - { - // FIXME: #warning "KVI_OUT_NAMES missing" - KviWindow * pOut = chan ? chan : KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - QString szTrailing = trailing ? msg->connection()->decodeText(trailing) : QString(""); - pOut->output(KVI_OUT_UNHANDLED,__tr2qs("Names for \r!c\r%Q\r: %Q"),&szChan,&szTrailing); - } -} - -void KviServerParser::parseNumericTopic(KviIrcMessage *msg) -{ - // 332: RPL_TOPIC [I,E,U,D] - // :prefix 332 target <channel> :<topic> - QString szChan = msg->connection()->decodeText(msg->safeParam(1)); - KviChannel * chan = msg->connection()->findChannel(szChan); - if(chan) - { - QString szTopic = chan->decodeText(msg->safeTrailing()); - - chan->topicWidget()->setTopic(szTopic); - chan->topicWidget()->setTopicSetBy(__tr2qs("(unknown)")); - if(KVI_OPTION_BOOL(KviOption_boolEchoNumericTopic)) - { - if(!msg->haltOutput()) - chan->output(KVI_OUT_TOPIC,__tr2qs("Channel topic is: %Q"),&szTopic); - } - } else { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - - QString szTopic = msg->connection()->decodeText(msg->safeTrailing()); - pOut->output(KVI_OUT_TOPIC,__tr2qs("Topic for \r!c\r%Q\r is: %Q"), - &szChan,&szTopic); - } - -} - -void KviServerParser::parseNumericNoTopic(KviIrcMessage *msg) -{ - // 331: RPL_NOTOPIC [I,E,U,D] - // :prefix 331 target <channel> :No topic is set - QString szChan = msg->connection()->decodeText(msg->safeParam(1)); - KviChannel * chan = msg->connection()->findChannel(szChan); - if(chan) - { - chan->topicWidget()->setTopic(""); - if(KVI_OPTION_BOOL(KviOption_boolEchoNumericTopic)) - { - if(!msg->haltOutput()) - chan->outputNoFmt(KVI_OUT_TOPIC,__tr2qs("No channel topic is set")); - } - } else { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - pOut->output(KVI_OUT_TOPIC,__tr2qs("No topic is set for channel \r!c\r%Q\r"), - &szChan); - } -} - -void KviServerParser::parseNumericTopicWhoTime(KviIrcMessage *msg) -{ - // 333: RPL_TOPICWHOTIME [e,U,D] - // :prefix 333 target <channel> <whoset> <time> - - QString szChan = msg->connection()->decodeText(msg->safeParam(1)); - KviChannel * chan = msg->connection()->findChannel(szChan); - - KviStr tmp = msg->safeParam(3); - bool bOk = false; - unsigned long t = 0; - if(tmp.hasData())t = tmp.toUInt(&bOk); - - QDateTime dt; - dt.setTime_t(t); - - QString szDate = dt.toString(); - QString szWho = msg->connection()->decodeText(msg->safeParam(2)); - KviIrcMask who(szWho); - QString szDisplayableWho; - if( !(who.hasUser() && who.hasHost()) ) - { - szDisplayableWho="\r!n\r"+szWho+"\r"; - } else { - KviQString::sprintf(szDisplayableWho,"\r!n\r%Q\r!%Q@\r!h\r%Q\r",&(who.nick()),&(who.user()),&(who.host())); - } - if(chan) - { - chan->topicWidget()->setTopicSetBy(szWho); - if(bOk)chan->topicWidget()->setTopicSetAt(szDate); - if(KVI_OPTION_BOOL(KviOption_boolEchoNumericTopic)) - { - if(!msg->haltOutput()) - { - if(bOk)chan->output(KVI_OUT_TOPIC,__tr2qs("Topic was set by %Q on %Q"),&szDisplayableWho,&szDate); - else chan->output(KVI_OUT_TOPIC,__tr2qs("Topic was set by %Q"),&szDisplayableWho); - } - } - } else { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - if(bOk) - { - pOut->output(KVI_OUT_TOPIC,__tr2qs("Topic for \r!c\r%Q\r was set by %Q on %Q"), - &szChan,&szDisplayableWho,&szDate); - } else { - pOut->output(KVI_OUT_TOPIC,__tr2qs("Topic for \r!c\r%Q\r was set by %Q"), - &szChan,&szDisplayableWho); - } - } -} - -void KviServerParser::parseNumericChannelModeIs(KviIrcMessage *msg) -{ - // 324: RPL_CHANNELMODEIS [I,E,U,D] - // :prefix 324 target <channel> +<chanmode> - QString szSource = msg->connection()->decodeText(msg->safePrefix()); - QString szChan = msg->connection()->decodeText(msg->safeParam(1)); - KviChannel * chan = msg->connection()->findChannel(szChan); - KviStr modefl = msg->safeParam(2); - if(chan)parseChannelMode(szSource,"*","*",chan,modefl,msg,3); - else { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - if((!szChan.isEmpty()) && IS_CHANNEL_TYPE_FLAG(szChan[0])) - { - pOut->output(KVI_OUT_CHANMODE,__tr2qs("Channel mode for \r!c\r%Q\r is %s"), - &szChan,msg->safeParam(2)); - } else { - pOut->output(KVI_OUT_MODE,__tr2qs("User mode for \r!n\r%Q\r is %s"), - &szChan,msg->safeParam(2)); - } - } -} - -void getDateTimeStringFromCharTimeT(QString &buffer,const char *time_t_string) -{ - KviStr tmp=time_t_string; - bool bOk=false; - unsigned int uTime = tmp.toUInt(&bOk); - if(bOk){ - QDateTime dt; - dt.setTime_t(uTime); - buffer = dt.toString(); - } else buffer = __tr2qs("(Unknown)"); -} - -#define PARSE_NUMERIC_ENDOFLIST(__funcname,__setGotIt,__didSendRequest,__setDone,__daicon,__szWhatQString) \ - void KviServerParser::__funcname(KviIrcMessage *msg) \ - { \ - QString szChan = msg->connection()->decodeText(msg->safeParam(1)); \ - KviChannel * chan = msg->connection()->findChannel(szChan); \ - if(chan) \ - { \ - chan->__setGotIt(); \ - if(chan->__didSendRequest()) \ - { \ - chan->__setDone(); \ - return; \ - } \ - } \ - if(!msg->haltOutput()) \ - { \ - KviWindow * pOut = chan ? chan : KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? \ - msg->console()->activeWindow() : (KviWindow *)(msg->console()); \ - pOut->output(__daicon,__tr2qs("End of channel %Q for \r!c\r%Q\r"),&(__szWhatQString),&szChan); \ - } \ - } - -PARSE_NUMERIC_ENDOFLIST(parseNumericEndOfBanList,setHasBanList,sentBanListRequest,setBanListDone,KVI_OUT_BAN,__tr2qs("ban list")) -PARSE_NUMERIC_ENDOFLIST(parseNumericEndOfInviteList,setHasInviteList,sentInviteListRequest,setInviteListDone,KVI_OUT_INVITEEXCEPT,__tr2qs("invite list")) -PARSE_NUMERIC_ENDOFLIST(parseNumericEndOfExceptList,setHasBanExceptionList,sentBanExceptionListRequest,setBanExceptionListDone,KVI_OUT_BANEXCEPT,__tr2qs("ban exception list")) - -#define PARSE_NUMERIC_LIST(__funcname,__modechar,__sentRequest,__ico,__szWhatQString) \ - void KviServerParser::__funcname(KviIrcMessage *msg) \ - { \ - QString szChan = msg->connection()->decodeText(msg->safeParam(1)); \ - QString banmask = msg->connection()->decodeText(msg->safeParam(2)); \ - QString bansetby = msg->connection()->decodeText(msg->safeParam(3)); \ - QString bansetat; \ - getDateTimeStringFromCharTimeT(bansetat,msg->safeParam(4)); \ - if(bansetby.isEmpty())bansetby = __tr2qs("(Unknown)"); \ - KviChannel * chan = msg->connection()->findChannel(szChan); \ - if(chan) \ - { \ - chan->setMask(__modechar,banmask,true,bansetby,QString(msg->safeParam(4)).toUInt()); \ - if(chan->__sentRequest())return; \ - } \ - if(!msg->haltOutput()) \ - { \ - KviWindow * pOut = chan ? chan : KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? \ - msg->console()->activeWindow() : (KviWindow *)(msg->console()); \ - pOut->output(__ico,__tr2qs("%Q for \r!c\r%Q\r: \r!m-%c\r%Q\r (set by %Q on %Q)"), \ - &(__szWhatQString),&szChan,__modechar,&banmask,&bansetby,&bansetat); \ - } \ - } - -// 367: RPL_BANLIST [I,E,U,D] -// :prefix 367 target <channel> <banmask> [bansetby] [bansetat] -PARSE_NUMERIC_LIST(parseNumericBanList,'b',sentBanListRequest,KVI_OUT_BAN,__tr2qs("Ban listing")) -// 346: RPL_INVITELIST [I,E,U,D] -// :prefix 346 target <channel> <invitemask> [invitesetby] [invitesetat] -PARSE_NUMERIC_LIST(parseNumericInviteList,'I',sentInviteListRequest,KVI_OUT_INVITEEXCEPT,__tr2qs("Invite listing")) -// 346: RPL_EXCEPTLIST [I,E,U,D] -// :prefix 346 target <channel> <banmask> [bansetby] [bansetat] -PARSE_NUMERIC_LIST(parseNumericExceptList,'e',sentBanExceptionListRequest,KVI_OUT_BANEXCEPT,__tr2qs("Ban exception listing")); - - -void KviServerParser::parseNumericWhoReply(KviIrcMessage *msg) -{ - // 352: RPL_WHOREPLY [I,E,U,D] - // :prefix 352 target <chan> <usr> <hst> <srv> <nck> <stat> :<hops> <real> - - QString szChan = msg->connection()->decodeText(msg->safeParam(1)); - QString szUser = msg->connection()->decodeText(msg->safeParam(2)); - QString szHost = msg->connection()->decodeText(msg->safeParam(3)); - QString szServ = msg->connection()->decodeText(msg->safeParam(4)); - QString szNick = msg->connection()->decodeText(msg->safeParam(5)); - QString szFlag = msg->connection()->decodeText(msg->safeParam(6)); - bool bAway = szFlag.find('G') != -1; - - KviStr trailing = msg->safeTrailing(); - KviStr hops = trailing.getToken(' '); - bool bHopsOk = false; - int iHops = hops.toInt(&bHopsOk); - - QString szReal = msg->connection()->decodeText(trailing.ptr()); - - // Update the user entry - KviIrcUserDataBase * db = msg->connection()->userDataBase(); - KviIrcUserEntry * e = db->find(szNick); - if(e) - { - if(bHopsOk)e->setHops(iHops); - e->setUser(szUser); - e->setHost(szHost); - e->setServer(szServ); - e->setRealName(szReal); - e->setAway(bAway); - KviQuery * q = msg->connection()->findQuery(szNick); - if(q) q->updateLabelText(); - if(!e->avatar()) - { - // FIXME: #warning "THE AVATAR SHOULD BE RESIZED TO MATCH THE MAX WIDTH/HEIGHT" - // maybe now we can match this user ? - msg->console()->checkDefaultAvatar(e,szNick,szUser,szHost); - } - } - - KviChannel * chan = msg->connection()->findChannel(szChan); - if(chan) - { - if(!chan->hasWhoList()) - { - // FIXME: #warning "IF VERBOSE && SHOW INTERNAL WHO REPLIES...." - return; - } - if(chan->sentSyncWhoRequest()) - { - // FIXME: #warning "IF VERBOSE && SHOW INTERNAL WHO REPLIES...." - return; - } - } - - // FIXME: #warning "SYNC OP/VOICE on channel!!!" - - if(!msg->haltOutput()) - { - KviWindow * pOut = chan ? chan : KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - - QString szAway = bAway ? __tr2qs("Yes") : __tr2qs("No"); - - pOut->output(KVI_OUT_WHO, - __tr2qs("WHO entry for %c\r!n\r%Q\r%c [%Q@\r!h\r%Q\r]: %cChannel%c: \r!c\r%Q\r, %cServer%c: \r!s\r%Q\r, %cHops%c: %d, %cFlags%c: %Q, %cAway%c: %Q, %cReal name%c: %Q"), - KVI_TEXT_BOLD,&szNick, KVI_TEXT_BOLD, - &szUser,&szHost,KVI_TEXT_UNDERLINE, - KVI_TEXT_UNDERLINE,&szChan,KVI_TEXT_UNDERLINE, - KVI_TEXT_UNDERLINE,&szServ,KVI_TEXT_UNDERLINE, - KVI_TEXT_UNDERLINE,iHops, KVI_TEXT_UNDERLINE, KVI_TEXT_UNDERLINE, - &szFlag, KVI_TEXT_UNDERLINE, KVI_TEXT_UNDERLINE, - &szAway, KVI_TEXT_UNDERLINE, - KVI_TEXT_UNDERLINE, &szReal); - } - - -} - -void KviServerParser::parseNumericEndOfWho(KviIrcMessage *msg) -{ - // 315: RPL_ENDOFWHO [I,E,U,D] - // :prefix 315 target <channel/nick> :End of /WHO List. - QString szChan = msg->connection()->decodeText(msg->safeParam(1)); - KviChannel * chan = msg->connection()->findChannel(szChan); - if(chan) - { - chan->userListView()->updateArea(); - kvi_time_t tNow = kvi_unixTime(); - msg->connection()->stateData()->setLastReceivedChannelWhoReply(tNow); - chan->setLastReceivedWhoReply(tNow); - if(msg->connection()->lagMeter()) - { - KviStr tmp(KviStr::Format,"WHO %s",msg->safeParam(1)); - msg->connection()->lagMeter()->lagCheckComplete(tmp.ptr()); - } - - if(!chan->hasWhoList()) - { - // FIXME: #warning "IF VERBOSE && SHOW INTERNAL WHO REPLIES...." - chan->setHasWhoList(); - return; - } - - if(chan->sentSyncWhoRequest()) - { - // FIXME: #warning "IF VERBOSE && SHOW INTERNAL WHO REPLIES...." - chan->clearSentSyncWhoRequest(); - return; - } - } - - if(!msg->haltOutput()) - { - KviWindow * pOut = chan ? chan : KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - QString whoTarget = msg->connection()->decodeText(msg->safeParam(1)); - if(IS_CHANNEL_TYPE_FLAG(whoTarget[0])) - whoTarget.prepend("\r!c\r"); - else - whoTarget.prepend("\r!n\r"); - whoTarget.append("\r"); - pOut->output(KVI_OUT_WHO,__tr2qs("End of WHO list for %Q"),&whoTarget); - } -} - -void KviServerParser::parseLoginNicknameProblem(KviIrcMessage *msg) -{ - // ops...not logged in yet... - QString nextNick; - unsigned int uNickCnt; - switch(msg->connection()->stateData()->loginNickIndex()) - { - case 0: - // used a server specific nickname - KVI_OPTION_STRING(KviOption_stringNickname1).stripWhiteSpace(); - if(KVI_OPTION_STRING(KviOption_stringNickname1).isEmpty()) - KVI_OPTION_STRING(KviOption_stringNickname1) = KVI_DEFAULT_NICKNAME1; - nextNick = KVI_OPTION_STRING(KviOption_stringNickname1); - uNickCnt = 1; - case 1: - // used the first nickname of the identity - KVI_OPTION_STRING(KviOption_stringNickname2).stripWhiteSpace(); - if(KVI_OPTION_STRING(KviOption_stringNickname2).isEmpty()) - KVI_OPTION_STRING(KviOption_stringNickname2) = KVI_DEFAULT_NICKNAME2; - nextNick = KVI_OPTION_STRING(KviOption_stringNickname2); - uNickCnt = 2; - break; - case 2: - // used the second nickname of the identity - KVI_OPTION_STRING(KviOption_stringNickname3).stripWhiteSpace(); - if(KVI_OPTION_STRING(KviOption_stringNickname3).isEmpty()) - KVI_OPTION_STRING(KviOption_stringNickname3) = KVI_DEFAULT_NICKNAME3; - nextNick = KVI_OPTION_STRING(KviOption_stringNickname3); - uNickCnt = 3; - break; - default: - { - // used all the nicknames of the identity - // fall back to a random string... - nextNick = msg->safeParam(1); - nextNick.stripWhiteSpace(); - if(nextNick.isEmpty())nextNick = KVI_DEFAULT_NICKNAME1; - nextNick = nextNick.left(7); - QString num; - num.setNum(msg->connection()->stateData()->loginNickIndex()); - nextNick.append(num); - uNickCnt = msg->connection()->stateData()->loginNickIndex() + 1; - } - break; - } - - QString szOldNick = msg->connection()->userInfo()->nickName(); - msg->console()->notifyListView()->nickChange(szOldNick,nextNick); - - msg->connection()->userInfo()->setNickName(nextNick); - msg->connection()->stateData()->setLoginNickIndex(uNickCnt); - - if(uNickCnt > 7) - { - msg->console()->output(KVI_OUT_NICKNAMEPROBLEM, - __tr2qs("Something really weird is happening: the server is refusing all the login nicknames...")); - - if(msg->connection()->stateData()->loginNickIndex() > 10) - { - msg->console()->output(KVI_OUT_NICKNAMEPROBLEM, - __tr2qs("The server is refusing all the login nicknames: giving up, you must send the nickname manually")); - return; - } - } - - if(!msg->haltOutput()) - { - QString szActual = msg->connection()->decodeText(msg->safeParam(1)); - QString szWText = msg->connection()->decodeText(msg->safeTrailing()); - msg->console()->output(KVI_OUT_NICKNAMEPROBLEM, - __tr2qs("No way to login as '\r!n\r%Q\r' (%d: %Q), trying '%Q'..."), - &szActual,msg->numeric(),&szWText,&nextNick); - } - - KviQCString d = msg->connection()->encodeText(nextNick); - msg->connection()->sendFmtData("NICK %s",d.data()); -} - -void KviServerParser::parseNumericUnavailResource(KviIrcMessage *msg) -{ - // 437: ERR_UNAVAILRESOURCE [I] - // :prefix 437 <target> <nick/channel> :Nick/Channel is temporairly unavailable - if(!(msg->console()->isConnected())) - { - parseLoginNicknameProblem(msg); - } else { - // already connected... just say that we have problems - if(!msg->haltOutput()) - { - QString szNk = msg->connection()->decodeText(msg->safeParam(1)); - QString szWText = msg->connection()->decodeText(msg->safeTrailing()); - msg->console()->output(KVI_OUT_NICKNAMEPROBLEM, - "\r!n\r%Q\r: %Q",&szNk,&szWText); - } - } -} - -void KviServerParser::parseNumericCantJoinChannel(KviIrcMessage *msg) -{ - // 471: ERR_CHANNELISFULL [I,E,U,D] - // 473: ERR_INVITEONLYCHAN [I,E,U,D] - // 474: ERR_BANNEDFROMCHAN [I,E,U,D] - // 475: ERR_BADCHANNELKEY [I,E,U,D] - // :prefix 47* <target> <channel> :Can't join channel (+l/i/b/k) - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->connection()->findChannel(msg->safeParam(1))); - if(!pOut)pOut = (KviWindow *)(msg->console()); - QString szChannel = msg->connection()->decodeText(msg->safeParam(1)); - QString szWText = msg->connection()->decodeText(msg->safeTrailing()); - pOut->output(KVI_OUT_JOINERROR, - "\r!c\r%Q\r: %Q",&szChannel,&szWText); - } -} - -// Keep the source ordered: this should be named "parseOtherChannelError" - -void KviServerParser::otherChannelError(KviIrcMessage *msg) -{ - // 482: ERR_CHANOPRIVSNEEDED - // 467: ERR_KEYSET - // 472: ERR_UNKNOWNMODE - // :prefix 4?? <target> <channel> :error text - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->connection()->findChannel(msg->safeParam(1))); - if(!pOut)pOut = (KviWindow *)(msg->console()); - QString szChannel = msg->connection()->decodeText(msg->safeParam(1)); - QString szWText = msg->connection()->decodeText(msg->safeTrailing()); - pOut->output(KVI_OUT_GENERICERROR, - "\r!c\r%Q\r: %Q",&szChannel,&szWText); - } -} - -void KviServerParser::parseCommandSyntaxHelp(KviIrcMessage *msg) -{ - // 704 RPL_COMMANDSYNTAX - // :prefix 704 <target> <command> :text - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->console()); - QString szCommand = msg->connection()->decodeText(msg->safeParam(1)); - QString szWText = msg->connection()->decodeText(msg->safeTrailing()); - pOut->output(KVI_OUT_HELP, - __tr2qs("Command syntax %Q: %Q"),&szCommand,&szWText); // Pragma: wheee..... that should be in english :D - } -} - -void KviServerParser::parseCommandHelp(KviIrcMessage *msg) -{ - // 705 RPL_COMMANDHELP - // :prefix 705 <target> <command> :text - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->console()); - QString szCommand = msg->connection()->decodeText(msg->safeParam(1)); - QString szWText = msg->connection()->decodeText(msg->safeTrailing()); - pOut->outputNoFmt(KVI_OUT_HELP,szWText); - } -} - -void KviServerParser::parseChannelHelp(KviIrcMessage *msg) -{ - // 477 RPL_CHANNELHELP (freenode) - // :prefix 477 <target> <channel> :text - if(!msg->haltOutput()) - { - QString szChan = msg->connection()->decodeText(msg->safeParam(1)); - QString szText = msg->connection()->decodeText(msg->safeTrailing()); - KviWindow * pOut = msg->connection()->findChannel(szChan); - if(pOut) - { - pOut->output(KVI_OUT_HELP,__tr2qs("Tip: %Q"),&szText); - } else { - pOut = (KviWindow *)(msg->console()); - pOut->output(KVI_OUT_HELP,__tr2qs("Tip for %Q: %Q"),&szChan,&szText); - } - - } -} - - -void KviServerParser::parseCommandEndOfHelp(KviIrcMessage *msg) -{ - // 704 RPL_COMMANDSYNTAX - // 705 RPL_COMMANDHELP - // :prefix 706 <target> <command> :End of /HELP. - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->console()); - QString szCommand = msg->connection()->decodeText(msg->safeParam(1)); - pOut->output(KVI_OUT_HELP, - __tr2qs("End of help about %Q"),&szCommand); - } -} - -void KviServerParser::parseNumericNicknameProblem(KviIrcMessage *msg) -{ - // 433: ERR_NICKNAMEINUSE [I,E,U,D] - // :prefix 433 <target> <nick> :Nickname is already in use. - // 432: ERR_ERRONEUSNICKNAME [I,E,U,D] - // :prefix 433 <target> <nick> :Erroneous nickname - - if(!(msg->console()->isConnected())) - { - parseLoginNicknameProblem(msg); - } else { - // already connected... just say that we have problems - if(!msg->haltOutput()) - { - QString szNk = msg->connection()->decodeText(msg->safeParam(1)); - QString szWText = msg->connection()->decodeText(msg->safeTrailing()); - msg->console()->output(KVI_OUT_NICKNAMEPROBLEM, - "\r!n\r%Q\r: %Q",&szNk,&szWText); - } - } -} - -void KviServerParser::parseNumericWhoisAway(KviIrcMessage * msg) -{ -// FIXME: #warning "Need an icon here too: sth like KVI_OUT_WHOISSERVER, but with 'A' letter" - msg->connection()->stateData()->setLastReceivedWhoisReply(kvi_unixTime()); - - QString szNk = msg->connection()->decodeText(msg->safeParam(1)); - KviIrcUserDataBase * db = msg->connection()->userDataBase(); - KviIrcUserEntry * e = db->find(szNk); - if(e)e->setAway(true); - KviQuery * q = msg->connection()->findQuery(szNk); - if(q) q->updateLabelText(); - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->connection()->findQuery(szNk)); - QString szWText = pOut ? pOut->decodeText(msg->safeTrailing()) : msg->connection()->decodeText(msg->safeTrailing()); - - if(!pOut)pOut = KVI_OPTION_BOOL(KviOption_boolWhoisRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - pOut->output(KVI_OUT_WHOISUSER,__tr2qs("%c\r!n\r%Q\r%c is away: %Q"), - KVI_TEXT_BOLD,&szNk,KVI_TEXT_BOLD,&szWText); - } -} - -void KviServerParser::parseNumericWhoisUser(KviIrcMessage *msg) -{ - // 311: RPL_WHOISUSER [I,E,U,D] - // :prefix 311 <target> <nick> <user> <host> * :<real_name> - msg->connection()->stateData()->setLastReceivedWhoisReply(kvi_unixTime()); - - QString szNick = msg->connection()->decodeText(msg->safeParam(1)); - QString szUser = msg->connection()->decodeText(msg->safeParam(2)); - QString szHost = msg->connection()->decodeText(msg->safeParam(3)); - QString szReal = msg->connection()->decodeText(msg->safeTrailing()); - KviIrcUserDataBase * db = msg->connection()->userDataBase(); - KviIrcUserEntry * e = db->find(szNick); - if(e) - { - e->setUser(szUser); - e->setHost(szHost); - e->setRealName(szReal); - if(e->gender()!=KviIrcUserEntry::Unknown) { - if(KviQString::equalCS(g_pActiveWindow->className(),QString("KviChannel"))) - { - ((KviChannel*)g_pActiveWindow)->userListView()->updateArea(); - } - } - KviQuery * q = msg->connection()->findQuery(szNick); - if(q) q->updateLabelText(); - if(!e->avatar()) - { - // FIXME: #warning "THE AVATAR SHOULD BE RESIZED TO MATCH THE MAX WIDTH/HEIGHT" - // maybe now we can match this user ? - msg->console()->checkDefaultAvatar(e,szNick,szUser,szHost); - } - } - - KviAsyncWhoisInfo * i = msg->connection()->asyncWhoisData()->lookup(szNick); - if(i) - { - i->szNick = szNick; - i->szUser = szUser; - i->szHost = szHost; - i->szReal = szReal; - return; - } - - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolWhoisRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - pOut->output( - KVI_OUT_WHOISUSER,__tr2qs("%c\r!n\r%Q\r%c is %c\r!n\r%Q\r!%Q@\r!h\r%Q\r%c"),KVI_TEXT_BOLD, - &szNick,KVI_TEXT_BOLD,KVI_TEXT_UNDERLINE,&szNick, - &szUser,&szHost,KVI_TEXT_UNDERLINE); - - pOut->output( - KVI_OUT_WHOISUSER,__tr2qs("%c\r!n\r%Q\r%c's real name: %Q"),KVI_TEXT_BOLD, - &szNick,KVI_TEXT_BOLD,&szReal); - } -} - -void KviServerParser::parseNumericWhowasUser(KviIrcMessage * msg) -{ - // 314: RPL_WHOWASUSER [I,E,U,D] - // :prefix 314 <target> <nick> <user> <host> * :<real_name> - - if(!msg->haltOutput()) - { - QString szNick = msg->connection()->decodeText(msg->safeParam(1)); - QString szUser = msg->connection()->decodeText(msg->safeParam(2)); - QString szHost = msg->connection()->decodeText(msg->safeParam(3)); - QString szReal = msg->connection()->decodeText(msg->safeTrailing()); - - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolWhoisRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - pOut->output( - KVI_OUT_WHOISUSER,__tr2qs("%c\r!n\r%Q\r%c was %c\r!n\r%Q\r!%Q@\r!h\r%Q\r%c"),KVI_TEXT_BOLD, - &szNick,KVI_TEXT_BOLD,KVI_TEXT_UNDERLINE,&szNick, - &szUser,&szHost,KVI_TEXT_UNDERLINE); - pOut->output( - KVI_OUT_WHOISUSER,__tr2qs("%c\r!n\r%Q\r%c's real name was: %Q"),KVI_TEXT_BOLD, - &szNick,KVI_TEXT_BOLD,&szReal); - } -} - - -void KviServerParser::parseNumericWhoisChannels(KviIrcMessage *msg) -{ - // 319: RPL_WHOISCHANNELS [I,E,U,D] - // :prefix 319 <target> <nick> :<channel list> - - msg->connection()->stateData()->setLastReceivedWhoisReply(kvi_unixTime()); - - QString szNick = msg->connection()->decodeText(msg->safeParam(1)); - QString szChans = msg->connection()->decodeText(msg->safeTrailing()); - - KviAsyncWhoisInfo * i = msg->connection()->asyncWhoisData()->lookup(szNick); - if(i) - { - i->szChannels = szChans; - return; - } - - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolWhoisRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - - QStringList sl = QStringList::split(" ",szChans); - QString szChanList; - - for(QStringList::Iterator it = sl.begin();it != sl.end();++it) - { - QString szCur = *it; - // deals with <flag>[#channel] and [##channel] - int len = szCur.length(); - int i =0; - while(i < len) - { - - if(IS_CHANNEL_TYPE_FLAG(szCur[i]) && (!IS_USER_MODE_PREFIX(szCur[i])))break; - i++; - } - if(i < len) - { - if(i > 0) - { - len = szCur.length() - i; - if(szChanList.length() > 0)szChanList.append(", "); - szChanList += szCur.left(i); - QString szR = szCur.right(len); - KviQString::appendFormatted(szChanList,"\r!c\r%Q\r",&szR); - } else { - if(szChanList.length() > 0)szChanList.append(", "); - KviQString::appendFormatted(szChanList,"\r!c\r%Q\r",&szCur); - } - } else { - // we dunno what is this.. just append - if(szChanList.length() > 0)szChanList.append(", "); - szChanList.append(szCur); - } - } - - pOut->output( - KVI_OUT_WHOISCHANNELS,__tr2qs("%c\r!n\r%Q\r%c's channels: %Q"),KVI_TEXT_BOLD, - &szNick,KVI_TEXT_BOLD,&szChanList); - } -} - -void KviServerParser::parseNumericWhoisIdle(KviIrcMessage *msg) -{ - // 317: RPL_WHOISIDLE [I,E,U,D] - // :prefix 317 <target> <nick> <number> <number> :seconds idle, signon time - - // FIXME: #warning "and NICK LINKS" - msg->connection()->stateData()->setLastReceivedWhoisReply(kvi_unixTime()); - - QString szNick = msg->connection()->decodeText(msg->safeParam(1)); - - KviAsyncWhoisInfo * i = msg->connection()->asyncWhoisData()->lookup(szNick); - if(i) - { - i->szIdle = msg->safeParam(2); - i->szSignon = msg->safeParam(3); - bool bOk = false; - i->szSignon.toUInt(&bOk); - if(!bOk)i->szSignon = ""; - return; - } - - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolWhoisRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - KviStr idle = msg->safeParam(2); // shouldn't be encoded - KviStr sign = msg->safeParam(3); // shouldn't be encoded - - bool bOk; - unsigned int uTime = idle.toUInt(&bOk); - if(!bOk) - { - UNRECOGNIZED_MESSAGE(msg,__tr2qs("Received a broken RPL_WHOISIDLE, can't evaluate the idle time")); - return; - } - unsigned int uDays = uTime / 86400; - uTime = uTime % 86400; - unsigned int uHours = uTime / 3600; - uTime = uTime % 3600; - unsigned int uMins = uTime / 60; - uTime = uTime % 60; - pOut->output( - KVI_OUT_WHOISIDLE,__tr2qs("%c\r!n\r%Q\r%c's idle time: %ud %uh %um %us"),KVI_TEXT_BOLD, - &szNick,KVI_TEXT_BOLD,uDays,uHours,uMins,uTime); - - uTime = sign.toUInt(&bOk); - if(bOk) - { - QDateTime dt; - dt.setTime_t((time_t)uTime); - QString tmp = dt.toString(); - pOut->output( - KVI_OUT_WHOISIDLE,__tr2qs("%c\r!n\r%Q\r%c's signon time: %Q"),KVI_TEXT_BOLD, - &szNick,KVI_TEXT_BOLD,&tmp); - } - } -} - -void KviServerParser::parseNumericWhoisServer(KviIrcMessage *msg) -{ - // 312: RPL_WHOISSERVER [I,E,U,D] (sent also in response to WHOWAS) - // :prefix 312 <target> <nick> <server> :<server description / last whowas date> - msg->connection()->stateData()->setLastReceivedWhoisReply(kvi_unixTime()); - - QString szNick = msg->connection()->decodeText(msg->safeParam(1)); - QString szServ = msg->connection()->decodeText(msg->safeParam(2)); - - KviIrcUserDataBase * db = msg->connection()->userDataBase(); - KviIrcUserEntry * e = db->find(szNick); - if(e)e->setServer(szServ); - KviQuery * q = msg->connection()->findQuery(szNick); - if(q) q->updateLabelText(); - KviAsyncWhoisInfo * i = msg->connection()->asyncWhoisData()->lookup(msg->safeParam(1)); - if(i) - { - i->szServer = szServ; - return; - } - - // FIXME: #warning "AWHOIS HERE.... and NICK LINKS" - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolWhoisRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - QString szWText = pOut->decodeText(msg->safeTrailing()); - pOut->output( - KVI_OUT_WHOISSERVER,__tr2qs("%c\r!n\r%Q\r%c's server: \r!s\r%Q\r - %Q"),KVI_TEXT_BOLD, - &szNick,KVI_TEXT_BOLD,&szServ,&szWText); - } -} - -void KviServerParser::parseNumericWhoisAuth(KviIrcMessage *msg) -{ - // :prefix RPL_WHOISAUTH <target> <nick> :is authed as - // actually seen only on Quakenet - msg->connection()->stateData()->setLastReceivedWhoisReply(kvi_unixTime()); - - QString szNick = msg->connection()->decodeText(msg->safeParam(1)); - QString szAuth = msg->connection()->decodeText(msg->safeParam(2)); - - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolWhoisRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - pOut->output( - KVI_OUT_WHOISOTHER,__tr2qs("%c\r!n\r%Q\r%c is authenticated as %Q"),KVI_TEXT_BOLD, - &szNick,KVI_TEXT_BOLD,&szAuth); - } -} - -void KviServerParser::parseNumericWhoisOther(KviIrcMessage *msg) -{ - // *: RPL_WHOIS* [?] - // :prefix * <target> <nick> :<description> - // used for RPL_WHOISCHANOP,RPL_WHOISADMIN, - // RPL_WHOISSADMIN,RPL_WHOISOPERATOR,RPL_WHOISREGNICK,RPL_WHOISSSL - // and all the other unrecognized codes that look really like a RPL_WHOIS* - - msg->connection()->stateData()->setLastReceivedWhoisReply(kvi_unixTime()); - - QString szNick = msg->connection()->decodeText(msg->safeParam(1)); - QString szOth = msg->connection()->decodeText(msg->safeTrailing()); - - KviAsyncWhoisInfo * i = msg->connection()->asyncWhoisData()->lookup(szNick); - if(i) - { - if(!(i->szServer.isEmpty()))i->szServer.append(','); - i->szServer.append(szOth); - return; - } - - // FIXME: #warning "NICK LINKS" - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolWhoisRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - pOut->output( - KVI_OUT_WHOISOTHER,__tr2qs("%c\r!n\r%Q\r%c's info: %Q"),KVI_TEXT_BOLD, - &szNick,KVI_TEXT_BOLD,&szOth); - } -} - -// FIXME: #warning "WHOWAS MISSING" - -void KviServerParser::parseNumericEndOfWhois(KviIrcMessage *msg) -{ - // 318: RPL_ENDOFWHOIS [I,E,U,D] - // :prefix 318 <target> <nick> :End of /WHOIS list - - msg->connection()->stateData()->setLastReceivedWhoisReply(0); - - QString szNick = msg->connection()->decodeText(msg->safeParam(1)); - - KviAsyncWhoisInfo * i = msg->connection()->asyncWhoisData()->lookup(szNick); - if(i) - { - if(!g_pApp->windowExists(i->pWindow))i->pWindow = msg->console(); - - // that's the new KVS engine! - KviKvsVariantList vl; - vl.setAutoDelete(true); - vl.append(new KviKvsVariant(i->szNick)); - vl.append(new KviKvsVariant(i->szUser)); - vl.append(new KviKvsVariant(i->szHost)); - vl.append(new KviKvsVariant(i->szReal)); - vl.append(new KviKvsVariant(i->szServer)); - vl.append(new KviKvsVariant(i->szIdle)); - vl.append(new KviKvsVariant(i->szSignon)); - vl.append(new KviKvsVariant(i->szChannels)); - vl.append(new KviKvsVariant(QString(msg->safePrefix()))); - vl.append(new KviKvsVariant(i->szSpecial)); - vl.append(new KviKvsVariant(*(i->pMagic))); - i->pCallback->run(i->pWindow,&vl,0,KviKvsScript::PreserveParams); - msg->connection()->asyncWhoisData()->remove(i); - return; - } - - // FIXME: #warning "NICK LINKS" - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolWhoisRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - QString pref = msg->connection()->decodeText(msg->safePrefix()); - pOut->output( - KVI_OUT_WHOISOTHER,__tr2qs("%c\r!n\r%Q\r%c WHOIS info from \r!s\r%Q\r"),KVI_TEXT_BOLD, - &szNick,KVI_TEXT_BOLD,&pref); - } -} - - -void KviServerParser::parseNumericEndOfWhowas(KviIrcMessage *msg) -{ - // 369: RPL_ENDOFWHOWAS [I,E,U,D] - // :prefix 369 <target> <nick> :End of /WHOWAS list - if(!msg->haltOutput()) - { - QString szNick = msg->connection()->decodeText(msg->safeParam(1)); - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolWhoisRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - QString pref = msg->connection()->decodeText(msg->safePrefix()); - pOut->output( - KVI_OUT_WHOISOTHER,__tr2qs("%c\r!n\r%Q\r%c WHOWAS info from \r!s\r%Q\r"),KVI_TEXT_BOLD, - &szNick,KVI_TEXT_BOLD,&pref); - } -} - -void KviServerParser::parseNumericNoSuchNick(KviIrcMessage *msg) -{ - // 401: ERR_NOSUCHNICK [I,E,U,D] - // 406: ERR_WASNOSUCHNICK [I,E,U,D] - // :prefix 401 <target> <nick> :No such nick/channel - // :prefix 406 <target> <nick> :There was no such nickname - QString szNick = msg->connection()->decodeText(msg->safeParam(1)); - - if(msg->numeric() == ERR_NOSUCHNICK) - { - KviAsyncWhoisInfo * i = msg->connection()->asyncWhoisData()->lookup(szNick); - if(i) - { - if(!g_pApp->windowExists(i->pWindow))i->pWindow = msg->console(); - // that's the new KVS engine! - KviKvsVariantList vl; - vl.setAutoDelete(true); - vl.append(new KviKvsVariant(i->szNick)); - vl.append(new KviKvsVariant()); - vl.append(new KviKvsVariant()); - vl.append(new KviKvsVariant()); - vl.append(new KviKvsVariant()); - vl.append(new KviKvsVariant()); - vl.append(new KviKvsVariant()); - vl.append(new KviKvsVariant()); - vl.append(new KviKvsVariant()); - vl.append(new KviKvsVariant()); - vl.append(new KviKvsVariant(*(i->pMagic))); - i->pCallback->run(i->pWindow,&vl,0,KviKvsScript::PreserveParams); - msg->connection()->asyncWhoisData()->remove(i); - return; - } - } - // FIXME: #warning "KVI_OUT_NOSUCHNICKCHANNEL ?" - // FIXME: #warning "QUERIES SHOULD REPORT NO TARGET HERE! (?)" - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->connection()->findQuery(szNick)); - if(!pOut) - { - pOut = (KviWindow *)(msg->console()->activeWindow()); - } - //} else { - // ((KviQuery *)pOut)->removeTarget(msg->safeParam(1)); - //} - QString szWText = pOut->decodeText(msg->safeTrailing()); - pOut->output(KVI_OUT_NICKNAMEPROBLEM,"\r!n\r%Q\r: %Q", - &szNick,&szWText); - } -} - -void KviServerParser::parseNumericCreationTime(KviIrcMessage *msg) -{ - // 329: RPL_CREATIONTIME - // :prefix 329 <target> <channel> <creation_time> - QString szChan = msg->connection()->decodeText(msg->safeParam(1)); - KviChannel * chan = msg->connection()->findChannel(szChan); - KviStr tmstr = msg->safeParam(2); - QDateTime dt; - dt.setTime_t((time_t)tmstr.toUInt()); - - if(!tmstr.isUnsignedNum()) - { - UNRECOGNIZED_MESSAGE(msg,__tr2qs("Can't evaluate creation time")); - return; - } - QString szDate = dt.toString(); - if(chan) - { - if(!msg->haltOutput()) - { - chan->output(KVI_OUT_CREATIONTIME,__tr2qs("Channel was created at %Q"),&szDate); - } - } else { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - pOut->output(KVI_OUT_CREATIONTIME,__tr2qs("Channel \r!c\r%Q\r was created at %Q"), - &szChan,&szDate); - } -} - -void KviServerParser::parseNumericIsOn(KviIrcMessage *msg) -{ - // 303: RPL_ISON - // :prefix 303 <target> :<ison replies> - if(msg->connection()->notifyListManager()) - { - if(msg->connection()->notifyListManager()->handleIsOn(msg))return; - } - // not handled...output it - - // FIXME: #warning "OUTPUT IT! (In a suitable way)" - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - QString szPrefix = msg->connection()->decodeText(msg->safePrefix()); - QString szAllParms = msg->connection()->decodeText(msg->allParams()); - pOut->output(KVI_OUT_UNHANDLED, - "[%Q][%s] %Q",&szPrefix,msg->command(),&szAllParms); - } -} - -void KviServerParser::parseNumericUserhost(KviIrcMessage *msg) -{ - // 302: RPL_USERHOST - // :prefix 302 <target> :<userhost replies> - if(msg->connection()->notifyListManager()) - { - if(msg->connection()->notifyListManager()->handleUserhost(msg))return; - } - // not handled...output it - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - QString szUser = msg->connection()->decodeText(msg->safeTrailing()); - pOut->output(KVI_OUT_WHOISUSER,__tr2qs("USERHOST info: %Q"),&szUser); - } -} - -void KviServerParser::parseNumericListStart(KviIrcMessage *msg) -{ - // 321: RPL_LISTSTART [I,E,U,D] - // :prefix 321 <target> :Channel users name - if(msg->haltOutput())return; // stopped by raw - - if(!(msg->console()->ircContext()->listWindow())) - { - // attempt to load the module... - msg->console()->ircContext()->createListWindow(); - } - - if(msg->console()->ircContext()->listWindow()) - { - // module loaded - msg->console()->ircContext()->listWindow()->control(EXTERNAL_SERVER_DATA_PARSER_CONTROL_STARTOFDATA); - } else { - msg->console()->output(KVI_OUT_LIST,__tr2qs("Channel list begin: channel, users, topic")); - } -} - -void KviServerParser::parseNumericList(KviIrcMessage *msg) -{ - // 322: RPL_LIST [I,E,U,D] - // :prefix 364 <target> <channel> <users> :<topic> - if(msg->haltOutput())return; // stopped by raw - - if(!(msg->console()->ircContext()->listWindow())) - { - // attempt to load the module... - msg->console()->ircContext()->createListWindow(); - if(msg->console()->ircContext()->listWindow()) - { - msg->console()->ircContext()->listWindow()->control(EXTERNAL_SERVER_DATA_PARSER_CONTROL_STARTOFDATA); - } - } - - if(msg->console()->ircContext()->listWindow()) - { - // module loaded - msg->console()->ircContext()->listWindow()->processData(msg); - } else { - // ops...can't load the module... - QString szList = msg->connection()->decodeText(msg->allParams()); - msg->console()->output(KVI_OUT_LIST,__tr2qs("List: %Q"),&szList); - } -} - -void KviServerParser::parseNumericListEnd(KviIrcMessage *msg) -{ - // 323: RPL_LISTEND [I,E,U,D] - // :prefix 323 <target> :End of /LIST - if(msg->haltOutput())return; // stopped by raw - - if(msg->console()->ircContext()->listWindow()) - { - msg->console()->ircContext()->listWindow()->control(EXTERNAL_SERVER_DATA_PARSER_CONTROL_ENDOFDATA); - } else { - msg->console()->output(KVI_OUT_LIST,__tr2qs("End of LIST")); - } - -} - -void KviServerParser::parseNumericLinks(KviIrcMessage *msg) -{ - // 364: RPL_LINKS [I,E,U,D] - // :prefix 364 <target> <host> <parent> :<hops> <description> - if(!(msg->console()->ircContext()->linksWindow())) - { - // attempt to load the module... - msg->console()->ircContext()->createLinksWindow(); - } - - if(msg->console()->ircContext()->linksWindow()) - { - // module loaded - msg->console()->ircContext()->linksWindow()->processData(msg); - } else { - // ops...can't load the module... or the event halted the window creation - if(!msg->haltOutput()) - { - QString szList = msg->connection()->decodeText(msg->allParams()); - msg->console()->output(KVI_OUT_LINKS,__tr2qs("Link: %Q"),&szList); - } - } -} - -void KviServerParser::parseNumericEndOfLinks(KviIrcMessage *msg) -{ - // 365: RPL_ENDOFLINKS [I,E,U,D] - // :prefix 365 <target> :End of /LINKS - if(msg->console()->ircContext()->linksWindow()) - { - msg->console()->ircContext()->linksWindow()->control(EXTERNAL_SERVER_DATA_PARSER_CONTROL_ENDOFDATA); - } else { - if(!msg->haltOutput()) - { - msg->console()->output(KVI_OUT_LINKS,__tr2qs("End of LINKS")); - } - } -} - -void KviServerParser::parseNumericBackFromAway(KviIrcMessage * msg) -{ - // 305: RPL_UNAWAY [I,E,U,D] - // :prefix 305 <target> :You are no longer away - bool bWasAway = msg->connection()->userInfo()->isAway(); - QString szNickBeforeAway; - QString szWText = msg->connection()->decodeText(msg->safeTrailing()); - - if(bWasAway)szNickBeforeAway = msg->connection()->userInfo()->nickNameBeforeAway(); - msg->connection()->changeAwayState(false); - - // trigger the event - QString tmp; - KviQString::sprintf(tmp,"%u",bWasAway ? (unsigned int)(msg->connection()->userInfo()->awayTime()) : 0); - if(KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnMeBack,msg->console(),tmp,szWText)) - msg->setHaltOutput(); - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - - if(bWasAway) - { - int uTimeDiff = bWasAway ? (kvi_unixTime() - msg->connection()->userInfo()->awayTime()) : 0; - pOut->output(KVI_OUT_AWAY,__tr2qs("[Leaving away status after %ud %uh %um %us]: %Q"), - uTimeDiff / 86400,(uTimeDiff % 86400) / 3600,(uTimeDiff % 3600) / 60,uTimeDiff % 60, - &szWText); - } else { - pOut->output(KVI_OUT_AWAY,__tr2qs("[Leaving away status]: %Q"),&szWText); - } - } - - if(KVI_OPTION_BOOL(KviOption_boolChangeNickAway) && bWasAway && (!(szNickBeforeAway.isEmpty()))) - { - if(_OUTPUT_PARANOIC) - msg->console()->output(KVI_OUT_AWAY,__tr2qs("Restoring pre-away nickname (%Q)"),&szNickBeforeAway); - KviQCString szDat = msg->connection()->encodeText(szNickBeforeAway); - msg->connection()->sendFmtData("NICK %s",szDat.data()); - } - -} - -void KviServerParser::parseNumericAway(KviIrcMessage * msg) -{ - // 306: RPL_NOWAWAY [I,E,U,D] - // :prefix 305 <target> :You're away man - msg->connection()->changeAwayState(true); - QString szWText = msg->connection()->decodeText(msg->safeTrailing()); - - if(KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnMeAway,msg->console(),szWText))msg->setHaltOutput(); - - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - pOut->output(KVI_OUT_AWAY,__tr2qs("[Entering away status]: %Q"),&szWText); - } - - if(KVI_OPTION_BOOL(KviOption_boolChangeNickAway)) - { - QString nick = msg->connection()->decodeText(msg->safeParam(0)); - QString szNewNick; - if(KVI_OPTION_BOOL(KviOption_boolAutoGeneratedAwayNick)) - { - if(nick.length() > 5)szNewNick = nick.left(5); - else szNewNick = nick; - szNewNick.append("AWAY"); - } else { - szNewNick = KVI_OPTION_STRING(KviOption_stringCustomAwayNick); - szNewNick.replace("%nick%",nick); - } - - if(_OUTPUT_PARANOIC) - msg->console()->output(KVI_OUT_AWAY,__tr2qs("Setting away nickname (%Q)"),&szNewNick); - KviQCString dat = msg->connection()->encodeText(szNewNick); - msg->connection()->sendFmtData("NICK %s",dat.data()); - } -} - -void KviServerParser::parseNumericWatch(KviIrcMessage *msg) -{ - // 600: RPL_LOGON - // :prefix 600 <target> <nick> <user> <host> <logintime> :logged online - // 601: RPL_LOGON - // :prefix 601 <target> <nick> <user> <host> <logintime> :logged offline - // 602: RPL_WATCHOFF - // :prefix 602 <target> <nick> <user> <host> <logintime> :stopped watching - // 604: PRL_NOWON - // :prefix 604 <target> <nick> <user> <host> <logintime> :is online - // 605: PRL_NOWOFF - // :prefix 605 <target> <nick> <user> <host> 0 :is offline - - if(msg->connection()->notifyListManager()) - { - if(msg->connection()->notifyListManager()->handleWatchReply(msg))return; - } - // not handled...output it - -// FIXME: #warning "OUTPUT IT! (In a suitable way) (And handle 602 , 603 , 606 and 607 gracefully)" - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - pOut->output(KVI_OUT_UNHANDLED, - "[%s][%s] %s",msg->prefix(),msg->command(),msg->allParams()); - } -} - -void KviServerParser::parseNumericStats(KviIrcMessage * msg) -{ - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->console()); - if(msg->paramCount() > 2) - { - KviStr szParms; - KviStr *p = msg->firstParam(); - for(p = msg->nextParam();p;p = msg->nextParam()) - { - if(szParms.hasData())szParms.append(' '); - szParms.append(*p); - } - pOut->outputNoFmt(KVI_OUT_STATS,msg->connection()->decodeText(szParms).utf8().data()); - } else { - pOut->outputNoFmt(KVI_OUT_STATS,msg->connection()->decodeText(msg->safeTrailing()).utf8().data()); - } - } -} - -void KviServerParser::parseNumericServerAdminInfoTitle(KviIrcMessage * msg) -{ - //RPL_ADMINME 256 - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->console()); - pOut->outputNoFmt(KVI_OUT_SERVERINFO,msg->connection()->decodeText(msg->safeTrailing()).utf8().data()); - } -} -void KviServerParser::parseNumericServerAdminInfoServerName(KviIrcMessage * msg) -{ - //RPL_ADMINLOC1 257 - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->console()); - QString szInfo = msg->connection()->decodeText(msg->safeTrailing()); - pOut->output(KVI_OUT_SERVERINFO,__tr2qs("%c\r!s\r%s\r%c's server info: %s"),KVI_TEXT_BOLD,msg->prefix(),KVI_TEXT_BOLD,szInfo.utf8().data()); - } -} - -void KviServerParser::parseNumericServerAdminInfoAdminName(KviIrcMessage * msg) -{ - //RPL_ADMINLOC2 258 - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->console()); - QString szInfo = msg->connection()->decodeText(msg->safeTrailing()); - pOut->output(KVI_OUT_SERVERINFO,__tr2qs("%c\r!s\r%s\r%c's administrator is %s"),KVI_TEXT_BOLD,msg->prefix(),KVI_TEXT_BOLD,szInfo.utf8().data()); - } -} - -void KviServerParser::parseNumericServerAdminInfoAdminContact(KviIrcMessage * msg) -{ - //RPL_ADMINEMAIL 259 - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->console()); - QString szInfo = msg->connection()->decodeText(msg->safeTrailing()); - pOut->output(KVI_OUT_SERVERINFO,__tr2qs("%c\r!s\r%s\r%c's contact adress is %s"),KVI_TEXT_BOLD,msg->prefix(),KVI_TEXT_BOLD,szInfo.utf8().data()); - } -} - -void KviServerParser::parseNumericCommandSyntax(KviIrcMessage * msg) -{ - //RPL_COMMANDSYNTAX 334 - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->console()); - pOut->outputNoFmt(KVI_OUT_STATS,msg->connection()->decodeText(msg->safeTrailing())); - } -} - -void KviServerParser::parseNumericInviting(KviIrcMessage * msg) -{ - //RPL_INVITING 341 - if(!msg->haltOutput()) - { - QString szWho = msg->connection()->decodeText(msg->safeParam(0)); - QString szTarget = msg->connection()->decodeText(msg->safeParam(1)); - QString szChan = msg->connection()->decodeText(msg->safeParam(2)); - KviChannel * chan = msg->connection()->findChannel(szChan); - if(chan) - { - chan->output(KVI_OUT_INVITE,__tr2qs("\r!n\r%Q\r invited %Q into channel %Q"),&szWho,&szTarget,&szChan); - } else { - KviWindow * pOut = (KviWindow *)(msg->console()); - pOut->output(KVI_OUT_INVITE,__tr2qs("\r!n\r%Q\r invited %Q into channel %Q"),&szWho,&szTarget,&szChan); - } - } -} - -void KviServerParser::parseNumericInfo(KviIrcMessage * msg) -{ - //RPL_INFO 371 - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->console()); - QString szInfo = msg->connection()->decodeText(msg->safeTrailing()); - pOut->outputNoFmt(KVI_OUT_SERVERINFO,szInfo); - } -} - -void KviServerParser::parseNumericInfoStart(KviIrcMessage * msg) -{ - //RPL_INFOSTART 373 - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->console()); - pOut->output(KVI_OUT_SERVERINFO,__tr2qs("%c\r!s\r%s\r%c's information:"),KVI_TEXT_BOLD,msg->prefix(),KVI_TEXT_BOLD); - } -} - -void KviServerParser::parseNumericInfoEnd(KviIrcMessage * msg) -{ - //RPL_ENDOFINFO 374 - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->console()); - pOut->output(KVI_OUT_SERVERINFO,__tr2qs("End of %c\r!s\r%s\r%c's information"),KVI_TEXT_BOLD,msg->prefix(),KVI_TEXT_BOLD); - } -} - -void KviServerParser::parseNumericTime(KviIrcMessage * msg) -{ - //RPL_TIME 391 - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->console()); - QString szInfo = msg->connection()->decodeText(msg->safeTrailing()); - pOut->output(KVI_OUT_SERVERINFO,__tr2qs("%c\r!s\r%s\r%c's time is %Q"),KVI_TEXT_BOLD,msg->prefix(),KVI_TEXT_BOLD,&szInfo); - } -} - -void KviServerParser::parseNumericNoSuchServer(KviIrcMessage * msg) -{ - //ERR_NOSUCHSERVER 402 - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->console()); - QString szWhat = msg->connection()->decodeText(msg->safeParam(1)); - pOut->output(KVI_OUT_GENERICERROR,__tr2qs("%Q: no such server"),&szWhat); - } -} - -void KviServerParser::parseNumericNoSuchChannel(KviIrcMessage * msg) -{ - // ERR_NOSUCHCHANNEL 403 - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->console()); - QString szWhat = msg->connection()->decodeText(msg->safeParam(1)); - pOut->output(KVI_OUT_GENERICERROR,__tr2qs("%Q: no such channel"),&szWhat); - } -} - -void KviServerParser::parseNumericCannotSendColor(KviIrcMessage * msg) -{ - // ERR_NOCOLORSONCHAN 408 - if(!msg->haltOutput()) - { - QString szChan = msg->connection()->decodeText(msg->safeParam(1)); - QString szInfo = msg->connection()->decodeText(msg->safeTrailing()); - KviChannel * chan = msg->connection()->findChannel(szChan); - if(chan) - { - chan->output(KVI_OUT_GENERICERROR,__tr2qs("Cannot sent to channel: %Q"),&szInfo); - } else { - KviWindow * pOut = (KviWindow *)(msg->console()); - pOut->output(KVI_OUT_GENERICERROR,__tr2qs("Cannot sent text to channel %Q: %Q"),&szChan,&szInfo); - } - } -} - -void KviServerParser::parseNumericCannotSend(KviIrcMessage * msg) -{ - // ERR_CANNOTSENDTOCHAN 404 - if(!msg->haltOutput()) - { - QString szChan = msg->connection()->decodeText(msg->safeParam(1)); - QString szInfo = msg->connection()->decodeText(msg->safeTrailing()); - KviChannel * chan = msg->connection()->findChannel(szChan); - if(chan) - { - chan->output(KVI_OUT_GENERICERROR,__tr2qs("Cannot sent to channel")); - } else { - KviWindow * pOut = (KviWindow *)(msg->console()); - pOut->output(KVI_OUT_GENERICERROR,__tr2qs("Cannot sent text to channel %Q"),&szChan); - } - } -} - - -void KviServerParser::parseNumericCodePageSet(KviIrcMessage *msg) -{ - // a nice extension for irc.wenet.ru - // 700: RPL_CODEPAGESET - // :prefix 700 target <encoding> :is now your translation scheme - - QString encoding = msg->connection()->decodeText(msg->safeParam(1)); - if(msg->connection()->serverInfo()->supportsCodePages()) - { - if(encoding=="NONE") encoding="KOI8-R"; //RusNet default codepage - msg->console()->output(KVI_OUT_TEXTENCODING,__tr2qs("Your encoding is now %Q"),&encoding); - msg->console()->setTextEncoding(encoding); - msg->connection()->setEncoding(encoding); - } else { - QString szMe = msg->connection()->decodeText(msg->safeParam(0)); - if( (szMe==msg->connection()->currentNickName() || szMe == "*" ) //fix for pre-login codepage message - && KviLocale::codecForName(encoding.utf8().data())) - { - msg->console()->output(KVI_OUT_TEXTENCODING,__tr2qs("Your encoding is now %Q"),&encoding); - msg->console()->setTextEncoding(encoding); - msg->connection()->setEncoding(encoding); - } else if(!msg->haltOutput()) // simply unhandled - { - QString szWText = msg->connection()->decodeText(msg->allParams()); - msg->connection()->console()->output(KVI_OUT_UNHANDLED, - "[%s][%s] %Q",msg->prefix(),msg->command(),&szWText); - } - } -} - -void KviServerParser::parseNumericCodePageScheme(KviIrcMessage *msg) -{ - // a nice extension for irc.wenet.ru - // 703: RPL_WHOISSCHEME - // :prefix 703 <mynick> <nick> <encoding> :translation scheme - - msg->connection()->stateData()->setLastReceivedWhoisReply(kvi_unixTime()); - - if(msg->connection()->serverInfo()->supportsCodePages()) - { - QString szNick = msg->connection()->decodeText(msg->safeParam(1)); - QString szCodepage = msg->connection()->decodeText(msg->safeParam(2)); - - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolWhoisRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - QString szWText = pOut->decodeText(msg->safeTrailing()); - pOut->output( - KVI_OUT_WHOISOTHER,__tr2qs("%c\r!n\r%Q\r%c's codepage is %Q: %Q"),KVI_TEXT_BOLD, - &szNick,KVI_TEXT_BOLD,&szCodepage,&szWText); - } - } else { - // simply unhandled - if(!msg->haltOutput()) - { - QString szWText = msg->connection()->decodeText(msg->allParams()); - msg->connection()->console()->output(KVI_OUT_UNHANDLED, - "[%s][%s] %Q",msg->prefix(),msg->command(),&szWText); - } - } -} - -void KviServerParser::parseNumericUserMode(KviIrcMessage *msg) -{ - // 321: RPL_UMODEIS [I,E,U,D] - // :prefix 221 <target> <modeflags> - parseUserMode(msg,msg->safeParam(1)); - - if(!msg->haltOutput()) - { - KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolServerRepliesToActiveWindow) ? - msg->console()->activeWindow() : (KviWindow *)(msg->console()); - pOut->output(KVI_OUT_MODE,__tr2qs("Your user mode is %s"),msg->safeParam(1)); - } -} - -void KviServerParser::parseNumericEndOfStats(KviIrcMessage *msg) -{ - if(!msg->haltOutput()) - { - KviWindow * pOut = (KviWindow *)(msg->console()); - QString szText = msg->connection()->decodeText(msg->safeTrailing()); - pOut->outputNoFmt(KVI_OUT_STATS, szText); - } -} diff --git a/3.4.0/src/kvirc/sparser/kvi_sp_tables.cpp b/3.4.0/src/kvirc/sparser/kvi_sp_tables.cpp deleted file mode 100644 index 8089909db9..0000000000 --- a/3.4.0/src/kvirc/sparser/kvi_sp_tables.cpp +++ /dev/null @@ -1,1089 +0,0 @@ -// -// File : kvi_sp_tables.cpp -// Creation date : Sun Jun 30 2000 18:10:19 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_sparser.h" - -// FIXME: #warning "Reorder this table!" -#define PTM(__m) KVI_PTR2MEMBER(KviServerParser::__m) - -KviLiteralMessageParseStruct KviServerParser::m_literalParseProcTable[]= -{ - { "PRIVMSG" , PTM(parseLiteralPrivmsg)}, - { "PING" , PTM(parseLiteralPing) }, - { "MODE" , PTM(parseLiteralMode) }, - { "TOPIC" , PTM(parseLiteralTopic) }, - { "JOIN" , PTM(parseLiteralJoin) }, - { "PART" , PTM(parseLiteralPart) }, - { "QUIT" , PTM(parseLiteralQuit) }, - { "NICK" , PTM(parseLiteralNick) }, - { "KICK" , PTM(parseLiteralKick) }, - { "NOTICE" , PTM(parseLiteralNotice) }, - { "INVITE" , PTM(parseLiteralInvite) }, - { "WALLOPS" , PTM(parseLiteralWallops)}, - { "PONG" , PTM(parseLiteralPong) }, - { "ERROR" , PTM(parseLiteralError) }, - { 0 , 0 } -}; - -// FIXME: #warning "Merge these two tables into one" - -KviCtcpMessageParseStruct KviServerParser::m_ctcpRequestParseProcTable[]= -{ - { "PING" , PTM(parseCtcpRequestPing) , 0 }, - { "VERSION" , PTM(parseCtcpRequestVersion) , 0 }, - { "USERINFO" , PTM(parseCtcpRequestUserinfo) , 0 }, - { "CLIENTINFO" , PTM(parseCtcpRequestClientinfo) , 0 }, - { "FINGER" , PTM(parseCtcpRequestFinger) , 0 }, - { "SOURCE" , PTM(parseCtcpRequestSource) , 0 }, - { "TIME" , PTM(parseCtcpRequestTime) , 0 }, - { "ACTION" , PTM(parseCtcpRequestAction) , 0 }, - { "AVATAR" , PTM(parseCtcpRequestAvatar) , 0 }, - { "DCC" , PTM(parseCtcpRequestDcc) , 0 }, - { "TDCC" , PTM(parseCtcpRequestDcc) , 0 }, - { "XDCC" , PTM(parseCtcpRequestDcc) , 0 }, - { "PAGE" , PTM(parseCtcpRequestPage) , 0 }, - { 0 , 0 , 0 } -}; - -KviCtcpMessageParseStruct KviServerParser::m_ctcpReplyParseProcTable[]= -{ - { "AVATAR" , PTM(parseCtcpReplyAvatar) , 0 }, - { "ACTION" , PTM(parseCtcpRequestAction) , 0 }, - { "DCC" , PTM(parseCtcpRequestDcc) , 0 }, - { "TDCC" , PTM(parseCtcpRequestDcc) , 0 }, - { "XDCC" , PTM(parseCtcpRequestDcc) , 0 }, - { "VERSION" , PTM(parseCtcpReplyGeneric) , 0 }, - { "USERINFO" , PTM(parseCtcpReplyUserinfo) , 0 }, - { "CLIENTINFO" , PTM(parseCtcpReplyGeneric) , 0 }, - { "FINGER" , PTM(parseCtcpReplyGeneric) , 0 }, - { "TIME" , PTM(parseCtcpReplyGeneric) , 0 }, - { "SOURCE" , PTM(parseCtcpReplyGeneric) , 0 }, - { "PING" , PTM(parseCtcpReplyPing) , 0 }, - { "PAGE" , PTM(parseCtcpReplyGeneric) , 0 }, - { "LAGCHECK" , PTM(parseCtcpReplyLagcheck) , KVI_CTCP_MESSAGE_PARSE_TRIGGERNOEVENT }, - { 0 , 0 , 0 } -}; - -messageParseProc KviServerParser::m_numericParseProcTable[1000]= -{ - 0, // 000 - PTM(parseNumeric001) , // 001 RPL_WELCOME - PTM(parseNumeric002) , // 002 RPL_YOURHOST - PTM(parseNumeric003) , // 003 RPL_CREATED - PTM(parseNumeric004) , // 004 RPL_MYINFO - PTM(parseNumeric005) , // 005 RPL_BOUNCE, RPL_PROTOCTL - 0, // 006 - 0, // 007 - 0, // 008 - 0, // 009 - 0, // 010 - 0, // 011 - 0, // 012 - 0, // 013 - 0, // 014 - 0, // 015 - 0, // 016 - 0, // 017 - 0, // 018 - 0, // 019 - PTM(parseNumeric020) , // 020 - 0, // 021 - 0, // 022 - 0, // 023 - 0, // 024 - 0, // 025 - 0, // 026 - 0, // 027 - 0, // 028 - 0, // 029 - 0, // 030 - 0, // 031 - 0, // 032 - 0, // 033 - 0, // 034 - 0, // 035 - 0, // 036 - 0, // 037 - 0, // 038 - 0, // 039 - 0, // 040 - 0, // 041 - 0, // 042 - 0, // 043 - 0, // 044 - 0, // 045 - 0, // 046 - 0, // 047 - 0, // 048 - 0, // 049 - 0, // 050 - 0, // 051 - 0, // 052 - 0, // 053 - 0, // 054 - 0, // 055 - 0, // 056 - 0, // 057 - 0, // 058 - 0, // 059 - 0, // 060 - 0, // 061 - 0, // 062 - 0, // 063 - 0, // 064 - 0, // 065 - 0, // 066 - 0, // 067 - 0, // 068 - 0, // 069 - 0, // 070 - 0, // 071 - 0, // 072 - 0, // 073 - 0, // 074 - 0, // 075 - 0, // 076 - 0, // 077 - 0, // 078 - 0, // 079 - 0, // 080 - 0, // 081 - 0, // 082 - 0, // 083 - 0, // 084 - 0, // 085 - 0, // 086 - 0, // 087 - 0, // 088 - 0, // 089 - 0, // 090 - 0, // 091 - 0, // 092 - 0, // 093 - 0, // 094 - 0, // 095 - 0, // 096 - 0, // 097 - 0, // 098 - 0, // 099 - 0, // 100 - 0, // 101 - 0, // 102 - 0, // 103 - 0, // 104 - 0, // 105 - 0, // 106 - 0, // 107 - 0, // 108 - 0, // 109 - 0, // 110 - 0, // 111 - 0, // 112 - 0, // 113 - 0, // 114 - 0, // 115 - 0, // 116 - 0, // 117 - 0, // 118 - 0, // 119 - 0, // 120 - 0, // 121 - 0, // 122 - 0, // 123 - 0, // 124 - 0, // 125 - 0, // 126 - 0, // 127 - 0, // 128 - 0, // 129 - 0, // 130 - 0, // 131 - 0, // 132 - 0, // 133 - 0, // 134 - 0, // 135 - 0, // 136 - 0, // 137 - 0, // 138 - 0, // 139 - 0, // 140 - 0, // 141 - 0, // 142 - 0, // 143 - 0, // 144 - 0, // 145 - 0, // 146 - 0, // 147 - 0, // 148 - 0, // 149 - 0, // 150 - 0, // 151 - 0, // 152 - 0, // 153 - 0, // 154 - 0, // 155 - 0, // 156 - 0, // 157 - 0, // 158 - 0, // 159 - 0, // 160 - 0, // 161 - 0, // 162 - 0, // 163 - 0, // 164 - 0, // 165 - 0, // 166 - 0, // 167 - 0, // 168 - 0, // 169 - 0, // 170 - 0, // 171 - 0, // 172 - 0, // 173 - 0, // 174 - 0, // 175 - 0, // 176 - 0, // 177 - 0, // 178 - 0, // 179 - 0, // 180 - 0, // 181 - 0, // 182 - 0, // 183 - 0, // 184 - 0, // 185 - 0, // 186 - 0, // 187 - 0, // 188 - 0, // 189 - 0, // 190 - 0, // 191 - 0, // 192 - 0, // 193 - 0, // 194 - 0, // 195 - 0, // 196 - 0, // 197 - 0, // 198 - 0, // 199 - 0, // 200 - 0, // 201 - 0, // 202 - 0, // 203 - 0, // 204 - 0, // 205 - 0, // 206 - 0, // 207 - 0, // 208 - 0, // 209 - 0, // 210 - 0, // 211 - 0, // 212 - 0, // 213 - 0, // 214 - 0, // 215 - 0, // 216 - 0, // 217 - 0, // 218 - PTM(parseNumericEndOfStats), // 219 RPL_ENDOFSTATS - 0, // 220 - PTM(parseNumericUserMode) , // 221 RPL_UMODEIS - PTM(parseNumericCodePageSet), // 222 RusNet Codepage set - 0, // 223 - 0, // 224 - 0, // 225 - 0, // 226 - 0, // 227 - 0, // 228 - 0, // 229 - 0, // 230 - 0, // 231 - 0, // 232 - 0, // 233 - 0, // 234 - 0, // 235 - 0, // 236 - 0, // 237 - 0, // 238 - PTM(parseNumericStats) , // 239 RPL_STATSIAUTH - PTM(parseNumericStats) , // 240 RPL_STATSVLINE - PTM(parseNumericStats) , // 241 RPL_STATSLLINE - PTM(parseNumericStats) , // 242 RPL_STATSUPTIME - PTM(parseNumericStats) , // 243 RPL_STATSOLINE - PTM(parseNumericStats) , // 244 RPL_STATSHLINE - PTM(parseNumericStats) , // 245 RPL_STATSSLINE - PTM(parseNumericStats) , // 246 RPL_STATSPING RPL_STATSTLINE - PTM(parseNumericStats) , // 247 RPL_STATSBLINE_I RPL_STATSGLINE RPL_STATSXLINE - PTM(parseNumericStats) , // 248 RPL_STATSDEFINE RPL_STATSULINE - PTM(parseNumericStats) , // 249 RPL_STATSDEBUG - PTM(parseNumericStats) , // 250 RPL_STATSCONN RPL_STATSDLINE_I - PTM(parseNumericStats) , // 251 RPL_LUSERCLIENT - PTM(parseNumericStats) , // 252 RPL_LUSEROP - PTM(parseNumericStats) , // 253 RPL_LUSERUNKNOWN - PTM(parseNumericStats) , // 254 RPL_LUSERCHANNELS - PTM(parseNumericStats) , // 255 RPL_LUSERME - PTM(parseNumericServerAdminInfoTitle) , // 256 RPL_ADMINME - PTM(parseNumericServerAdminInfoServerName) , // 257 RPL_ADMINLOC1 - PTM(parseNumericServerAdminInfoAdminName) , // 258 RPL_ADMINLOC2 - PTM(parseNumericServerAdminInfoAdminContact) , // 259 RPL_ADMINEMAIL - 0, // 260 - 0, // 261 - 0, // 262 - 0, // 263 - 0, // 264 - PTM(parseNumericStats) , // 265 RPL_LOCALUSERS - PTM(parseNumericStats) , // 266 RPL_GLOBALUSERS - PTM(parseNumericStats) , // 267 RPL_SHAREDUSERS - 0, // 268 - 0, // 269 - 0, // 270 - 0, // 271 - 0, // 272 - 0, // 273 - 0, // 274 - PTM(parseNumericWhoisOther) , // 275 RPL_WHOISSSL - 0, // 276 - 0, // 277 - 0, // 278 - 0, // 279 - 0, // 280 - 0, // 281 - 0, // 282 - 0, // 283 - 0, // 284 - 0, // 285 - 0, // 286 - 0, // 287 - 0, // 288 - 0, // 289 - 0, // 290 - 0, // 291 - 0, // 292 - 0, // 293 - 0, // 294 - 0, // 295 - 0, // 296 - 0, // 297 - 0, // 298 - 0, // 299 - 0, // 300 - PTM(parseNumericWhoisAway) , // 301 - PTM(parseNumericUserhost) , // 302 RPL_USERHOST - PTM(parseNumericIsOn) , // 303 RPL_ISON - 0, // 304 - PTM(parseNumericBackFromAway) , // 305 RPL_UNAWAY - PTM(parseNumericAway) , // 306 RPL_NOWAWAY - PTM(parseNumericWhoisOther) , // 307 RPL_WHOISREGNICK - PTM(parseNumericWhoisOther) , // 308 RPL_WHOISADMIN - PTM(parseNumericWhoisOther) , // 309 RPL_WHOISSADMIN - PTM(parseNumericWhoisOther) , // 310 RPL_WHOISHELPOP - PTM(parseNumericWhoisUser) , // 311 RPL_WHOISUSER - PTM(parseNumericWhoisServer) , // 312 RPL_WHOISSERVER - PTM(parseNumericWhoisOther) , // 313 RPL_WHOISOPERATOR - PTM(parseNumericWhowasUser) , // 314 RPL_WHOWASUSER - PTM(parseNumericEndOfWho) , // 315 RPL_ENDOFWHO - PTM(parseNumericWhoisOther) , // 316 RPL_WHOISCHANOP - PTM(parseNumericWhoisIdle) , // 317 RPL_WHOISIDLE - PTM(parseNumericEndOfWhois) , // 318 RPL_ENDOFWHOIS - PTM(parseNumericWhoisChannels) , // 319 RPL_WHOISCHANNELS - PTM(parseNumericWhoisOther) , // 320 RPL_WHOISIDENTIFIED - PTM(parseNumericListStart) , // 321 RPL_LISTSTART - PTM(parseNumericList) , // 322 RPL_LIST - PTM(parseNumericListEnd) , // 323 RPL_LISTEND - PTM(parseNumericChannelModeIs) , // 324 RPL_CHANNELMODEIS - 0, // 325 - 0, // 326 - 0, // 327 - 0, // 328 - PTM(parseNumericCreationTime) , // 329 RPL_CREATIONTIME - PTM(parseNumericWhoisAuth) , // 330 RPL_WHOISAUTH - PTM(parseNumericNoTopic) , // 331 RPL_NOTOPIC - PTM(parseNumericTopic) , // 332 RPL_TOPIC - PTM(parseNumericTopicWhoTime) , // 333 RPL_TOPICWHOTIME - PTM(parseNumericCommandSyntax) , // 334 RPL_COMMANDSYNTAX - 0, // 335 - 0, // 336 - 0, // 337 - PTM(parseNumericWhoisOther), // 338 RPL_WHOISACTUALLY - PTM(parseNumericWhoisOther), // 339 - 0, // 340 - PTM(parseNumericInviting) , // 351 RPL_INVITING - 0, // 342 - 0, // 343 - 0, // 344 - 0, // 345 - PTM(parseNumericInviteList) , // 346 RPL_INVITELIST - PTM(parseNumericEndOfInviteList) , // 347 RPL_ENDOFINVITELIST - PTM(parseNumericExceptList) , // 348 RPL_EXCEPTLIST - PTM(parseNumericEndOfExceptList) , // 349 RPL_ENDOFEXCEPTLIST - 0, // 350 - 0, // 351 - PTM(parseNumericWhoReply) , // 352 RPL_WHOREPLY - PTM(parseNumericNames) , // 353 RPL_NAMREPLY - 0, // 354 - 0, // 355 - 0, // 356 - 0, // 357 - 0, // 358 - 0, // 359 - 0, // 360 - 0, // 361 - 0, // 362 - 0, // 363 - PTM(parseNumericLinks) , // 364 RPL_LINKS - PTM(parseNumericEndOfLinks) , // 365 RPL_ENDOFLINKS - PTM(parseNumericEndOfNames) , // 366 RPL_ENDOFNAMES - PTM(parseNumericBanList) , // 367 RPL_BANLIST - PTM(parseNumericEndOfBanList) , // 368 RPL_ENDOFBANLIST - PTM(parseNumericEndOfWhowas) , // 369 RPL_ENDOFWHOWAS - 0, // 370 - PTM(parseNumericInfo) , // 371 RPL_INFO - PTM(parseNumericMotd) , // 372 RPL_MOTD - PTM(parseNumericInfoStart) , // 373 RPL_INFOSTART - PTM(parseNumericInfoEnd) , // 374 RPL_ENDOFINFO - PTM(parseNumericMotd) , // 375 RPL_MOTDSTART - PTM(parseNumericMotd) , // 376 RPL_ENDOFMOTD - PTM(parseNumericMotd) , // 377 RPL_MOTD2 - PTM(parseNumericMotd) , // 378 RPL_MOTD3 - 0, // 379 - 0, // 380 - 0, // 381 - 0, // 382 - 0, // 383 - 0, // 384 - 0, // 385 - 0, // 386 - 0, // 387 - 0, // 388 - 0, // 389 - 0, // 390 - PTM(parseNumericTime) , // 391 RPL_TIME - 0, // 392 - 0, // 393 - 0, // 394 - 0, // 395 - 0, // 396 - 0, // 397 - 0, // 398 - 0, // 399 - 0, // 400 - PTM(parseNumericNoSuchNick) , // 401 ERR_NOSUCHNICK - PTM(parseNumericNoSuchServer) , // 402 ERR_NOSUCHSERVER - PTM(parseNumericNoSuchChannel) , // 403 ERR_NOSUCHCHANNEL - PTM(parseNumericCannotSend) , // 404 ERR_CANNOTSENDTOCHAN - 0, // 405 - PTM(parseNumericNoSuchNick) , // 406 ERR_WASNOSUCHNICK - 0, // 407 - PTM(parseNumericCannotSendColor) , // 408 ERR_NOCOLORSONCHAN - 0, // 409 - 0, // 410 - 0, // 411 - 0, // 412 - 0, // 413 - 0, // 414 - 0, // 415 - 0, // 416 - 0, // 417 - 0, // 418 - 0, // 419 - 0, // 420 - 0, // 421 - 0, // 422 - 0, // 423 - 0, // 424 - 0, // 425 - 0, // 426 - 0, // 427 - 0, // 428 - 0, // 429 - 0, // 430 - 0, // 431 - PTM(parseNumericNicknameProblem) , // 432 ERR_ERRONEUSNICKNAME - PTM(parseNumericNicknameProblem) , // 433 ERR_NICKNAMEINUSE - 0, // 434 - 0, // 435 - 0, // 436 - PTM(parseNumericUnavailResource) , // 437 ERR_UNAVAILRESOURCE - 0, // 438 - 0, // 439 - 0, // 440 - 0, // 441 - 0, // 442 - 0, // 443 - 0, // 444 - 0, // 445 - 0, // 446 - 0, // 447 - 0, // 448 - 0, // 449 - 0, // 450 - 0, // 451 - 0, // 452 - 0, // 453 - 0, // 454 - 0, // 455 - 0, // 456 - 0, // 457 - 0, // 458 - 0, // 459 - 0, // 460 - 0, // 461 - 0, // 462 - 0, // 463 - 0, // 464 - 0, // 465 - 0, // 466 - PTM(otherChannelError), // 467 ERR_KEYSET - 0, // 468 - 0, // 469 - 0, // 470 - PTM(parseNumericCantJoinChannel) , // 471 ERR_CHANNELISFULL - PTM(otherChannelError), // 472 ERR_UNKNOWNMODE - PTM(parseNumericCantJoinChannel) , // 473 ERR_INVITEONLYCHAN - PTM(parseNumericCantJoinChannel) , // 474 ERR_BANNEDFROMCHAN - PTM(parseNumericCantJoinChannel) , // 475 ERR_BADCHANNELKEY - 0, // 476 - PTM(parseChannelHelp), // 477 RPL_CHANNELHELP - 0, // 478 - 0, // 479 - 0, // 480 - 0, // 481 - PTM(otherChannelError), // 482 ERR_CHANOPRIVSNEEDED - 0, // 483 - 0, // 484 - 0, // 485 - 0, // 486 - 0, // 487 - 0, // 488 - 0, // 489 - 0, // 490 - 0, // 491 - 0, // 492 - 0, // 493 - 0, // 494 - 0, // 495 - 0, // 496 - 0, // 497 - 0, // 498 - 0, // 499 - 0, // 500 - 0, // 501 - 0, // 502 - 0, // 503 - 0, // 504 - 0, // 505 - 0, // 506 - 0, // 507 - 0, // 508 - 0, // 509 - 0, // 510 - 0, // 511 - 0, // 512 - 0, // 513 - 0, // 514 - 0, // 515 - 0, // 516 - 0, // 517 - 0, // 518 - 0, // 519 - 0, // 520 - 0, // 521 - 0, // 522 - 0, // 523 - 0, // 524 - 0, // 525 - 0, // 526 - 0, // 527 - 0, // 528 - 0, // 529 - 0, // 530 - 0, // 531 - 0, // 532 - 0, // 533 - 0, // 534 - 0, // 535 - 0, // 536 - 0, // 537 - 0, // 538 - 0, // 539 - 0, // 540 - 0, // 541 - 0, // 542 - 0, // 543 - 0, // 544 - 0, // 545 - 0, // 546 - 0, // 547 - 0, // 548 - 0, // 549 - 0, // 550 - 0, // 551 - 0, // 552 - 0, // 553 - 0, // 554 - 0, // 555 - 0, // 556 - 0, // 557 - 0, // 558 - 0, // 559 - 0, // 560 - 0, // 561 - 0, // 562 - 0, // 563 - 0, // 564 - 0, // 565 - 0, // 566 - 0, // 567 - 0, // 568 - 0, // 569 - 0, // 570 - 0, // 571 - 0, // 572 - 0, // 573 - 0, // 574 - 0, // 575 - 0, // 576 - 0, // 577 - 0, // 578 - 0, // 579 - 0, // 580 - 0, // 581 - 0, // 582 - 0, // 583 - 0, // 584 - 0, // 585 - 0, // 586 - 0, // 587 - 0, // 588 - 0, // 589 - 0, // 590 - 0, // 591 - 0, // 592 - 0, // 593 - 0, // 594 - 0, // 595 - 0, // 596 - 0, // 597 - 0, // 598 - 0, // 599 - PTM(parseNumericWatch) , // 600 RPL_LOGON - PTM(parseNumericWatch) , // 601 RPL_LOGOFF - PTM(parseNumericWatch) , // 602 RPL_WATCHOFF - 0, // 603 RPL_WATCHSTAT - PTM(parseNumericWatch) , // 604 RPL_NOWON - PTM(parseNumericWatch) , // 605 RPL_NOWOFF - 0, // 606 RPL_WATCHLIST - 0, // 607 RPL_ENDOFWATCH - 0, // 608 - 0, // 609 - 0, // 610 - 0, // 611 - 0, // 612 - 0, // 613 - 0, // 614 - 0, // 615 - 0, // 616 - 0, // 617 - 0, // 618 - 0, // 619 - 0, // 620 - 0, // 621 - 0, // 622 - 0, // 623 - 0, // 624 - 0, // 625 - 0, // 626 - 0, // 627 - 0, // 628 - 0, // 629 - 0, // 630 - 0, // 631 - 0, // 632 - 0, // 633 - 0, // 634 - 0, // 635 - 0, // 636 - 0, // 637 - 0, // 638 - 0, // 639 - 0, // 640 - 0, // 641 - 0, // 642 - 0, // 643 - 0, // 644 - 0, // 645 - 0, // 646 - 0, // 647 - 0, // 648 - 0, // 649 - 0, // 650 - 0, // 651 - 0, // 652 - 0, // 653 - 0, // 654 - 0, // 655 - 0, // 656 - 0, // 657 - 0, // 658 - 0, // 659 - 0, // 660 - 0, // 661 - 0, // 662 - 0, // 663 - 0, // 664 - 0, // 665 - 0, // 666 - 0, // 667 - 0, // 668 - 0, // 669 - 0, // 670 - 0, // 671 - 0, // 672 - 0, // 673 - 0, // 674 - 0, // 675 - 0, // 676 - 0, // 677 - 0, // 678 - 0, // 679 - 0, // 680 - 0, // 681 - 0, // 682 - 0, // 683 - 0, // 684 - 0, // 685 - 0, // 686 - 0, // 687 - 0, // 688 - 0, // 689 - 0, // 690 - 0, // 691 - 0, // 692 - 0, // 693 - 0, // 694 - 0, // 695 - 0, // 696 - 0, // 697 - 0, // 698 - 0, // 699 - PTM(parseNumericCodePageSet) , // 700 RPL_CODEPAGESET - 0, // 701 - 0, // 702 - PTM(parseNumericCodePageScheme) , // 703 RPL_WHOISSCHEME - PTM(parseCommandSyntaxHelp), // 704 RPL_COMMANDSYNTAX - PTM(parseCommandHelp), // 705 RPL_COMMANDHELP - PTM(parseCommandEndOfHelp), // 706 RPL_ENDOFCOMMANDHELP - 0, // 707 - 0, // 708 - 0, // 709 - 0, // 710 - 0, // 711 - 0, // 712 - 0, // 713 - 0, // 714 - 0, // 715 - 0, // 716 - 0, // 717 - 0, // 718 - 0, // 719 - 0, // 720 - 0, // 721 - 0, // 722 - 0, // 723 - 0, // 724 - 0, // 725 - 0, // 726 - 0, // 727 - 0, // 728 - 0, // 729 - 0, // 730 - 0, // 731 - 0, // 732 - 0, // 733 - 0, // 734 - 0, // 735 - 0, // 736 - 0, // 737 - 0, // 738 - 0, // 739 - 0, // 740 - 0, // 741 - 0, // 742 - 0, // 743 - 0, // 744 - 0, // 745 - 0, // 746 - 0, // 747 - 0, // 748 - 0, // 749 - 0, // 750 - 0, // 751 - 0, // 752 - 0, // 753 - 0, // 754 - 0, // 755 - 0, // 756 - 0, // 757 - 0, // 758 - 0, // 759 - 0, // 760 - 0, // 761 - 0, // 762 - 0, // 763 - 0, // 764 - 0, // 765 - 0, // 766 - 0, // 767 - 0, // 768 - 0, // 769 - 0, // 770 - 0, // 771 - 0, // 772 - 0, // 773 - 0, // 774 - 0, // 775 - 0, // 776 - 0, // 777 - 0, // 778 - 0, // 779 - 0, // 780 - 0, // 781 - 0, // 782 - 0, // 783 - 0, // 784 - 0, // 785 - 0, // 786 - 0, // 787 - 0, // 788 - 0, // 789 - 0, // 790 - 0, // 791 - 0, // 792 - 0, // 793 - 0, // 794 - 0, // 795 - 0, // 796 - 0, // 797 - 0, // 798 - 0, // 799 - 0, // 800 - 0, // 801 - 0, // 802 - 0, // 803 - 0, // 804 - 0, // 805 - 0, // 806 - 0, // 807 - 0, // 808 - 0, // 809 - 0, // 810 - 0, // 811 - 0, // 812 - 0, // 813 - 0, // 814 - 0, // 815 - 0, // 816 - 0, // 817 - 0, // 818 - 0, // 819 - 0, // 820 - 0, // 821 - 0, // 822 - 0, // 823 - 0, // 824 - 0, // 825 - 0, // 826 - 0, // 827 - 0, // 828 - 0, // 829 - 0, // 830 - 0, // 831 - 0, // 832 - 0, // 833 - 0, // 834 - 0, // 835 - 0, // 836 - 0, // 837 - 0, // 838 - 0, // 839 - 0, // 840 - 0, // 841 - 0, // 842 - 0, // 843 - 0, // 844 - 0, // 845 - 0, // 846 - 0, // 847 - 0, // 848 - 0, // 849 - 0, // 850 - 0, // 851 - 0, // 852 - 0, // 853 - 0, // 854 - 0, // 855 - 0, // 856 - 0, // 857 - 0, // 858 - 0, // 859 - 0, // 860 - 0, // 861 - 0, // 862 - 0, // 863 - 0, // 864 - 0, // 865 - 0, // 866 - 0, // 867 - 0, // 868 - 0, // 869 - 0, // 870 - 0, // 871 - 0, // 872 - 0, // 873 - 0, // 874 - 0, // 875 - 0, // 876 - 0, // 877 - 0, // 878 - 0, // 879 - 0, // 880 - 0, // 881 - 0, // 882 - 0, // 883 - 0, // 884 - 0, // 885 - 0, // 886 - 0, // 887 - 0, // 888 - 0, // 889 - 0, // 890 - 0, // 891 - 0, // 892 - 0, // 893 - 0, // 894 - 0, // 895 - 0, // 896 - 0, // 897 - 0, // 898 - 0, // 899 - 0, // 900 - 0, // 901 - 0, // 902 - 0, // 903 - 0, // 904 - 0, // 905 - 0, // 906 - 0, // 907 - 0, // 908 - 0, // 909 - 0, // 910 - 0, // 911 - 0, // 912 - 0, // 913 - 0, // 914 - 0, // 915 - 0, // 916 - 0, // 917 - 0, // 918 - 0, // 919 - 0, // 920 - 0, // 921 - 0, // 922 - 0, // 923 - 0, // 924 - 0, // 925 - 0, // 926 - 0, // 927 - 0, // 928 - 0, // 929 - 0, // 930 - 0, // 931 - 0, // 932 - 0, // 933 - 0, // 934 - 0, // 935 - 0, // 936 - 0, // 937 - 0, // 938 - 0, // 939 - 0, // 940 - 0, // 941 - 0, // 942 - 0, // 943 - 0, // 944 - 0, // 945 - 0, // 946 - 0, // 947 - 0, // 948 - 0, // 949 - 0, // 950 - 0, // 951 - 0, // 952 - 0, // 953 - 0, // 954 - 0, // 955 - 0, // 956 - 0, // 957 - 0, // 958 - 0, // 959 - 0, // 960 - 0, // 961 - 0, // 962 - 0, // 963 - 0, // 964 - 0, // 965 - 0, // 966 - 0, // 967 - 0, // 968 - 0, // 969 - 0, // 970 - 0, // 971 - 0, // 972 - 0, // 973 - 0, // 974 - 0, // 975 - 0, // 976 - 0, // 977 - 0, // 978 - 0, // 979 - 0, // 980 - 0, // 981 - 0, // 982 - 0, // 983 - 0, // 984 - 0, // 985 - 0, // 986 - 0, // 987 - 0, // 988 - 0, // 989 - 0, // 990 - 0, // 991 - 0, // 992 - 0, // 993 - 0, // 994 - 0, // 995 - 0, // 996 - 0, // 997 - 0, // 998 - 0 // 999 -}; diff --git a/3.4.0/src/kvirc/sparser/kvi_sparser.cpp b/3.4.0/src/kvirc/sparser/kvi_sparser.cpp deleted file mode 100644 index 272728c91a..0000000000 --- a/3.4.0/src/kvirc/sparser/kvi_sparser.cpp +++ /dev/null @@ -1,150 +0,0 @@ -//============================================================================= -// -// File : kvi_sparser.cpp -// Creation date : Sun Jun 30 2000 03:25:17 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#define _KVI_SPARSER_CPP_ - -#include "kvi_sparser.h" -#include "kvi_window.h" -#include "kvi_out.h" -#include "kvi_locale.h" -#include "kvi_ircsocket.h" -#include "kvi_options.h" -#include "kvi_kvs_eventmanager.h" -#include "kvi_kvs_eventtriggers.h" -#include "kvi_ircconnectionstatedata.h" - -KviServerParser * g_pServerParser = 0; - - -KviServerParser::KviServerParser() -: QObject(0,"server_parser") -{ -} - -KviServerParser::~KviServerParser() -{ -} - -void KviServerParser::parseMessage(const char * message,KviIrcConnection * pConnection) -{ - if(*message != 0 ) - { - KviIrcMessage msg(message,pConnection); - if(msg.isNumeric()) - { - if(KviKvsEventManager::instance()->hasRawHandlers(msg.numeric())) - { - KviKvsVariantList parms; - parms.append(pConnection->decodeText(msg.safePrefix())); - parms.append(pConnection->decodeText(msg.command())); - - for(KviStr * str = msg.firstParam();str;str = msg.nextParam()) - parms.append(pConnection->console()->decodeText(str->ptr())); - - if(KviKvsEventManager::instance()->triggerRaw(msg.numeric(),pConnection->console(),&parms)) - msg.setHaltOutput(); - } - - messageParseProc proc = m_numericParseProcTable[msg.numeric()]; - if(proc) - { - (this->*proc)(&msg); - if(!msg.unrecognized())return; // parsed - } else { - // we don't have a proc for this - - // special handling of unknown RPL_WHOIS* messages - // if - // - we're in the middle of a RPL_WHOIS* sequence (i.e. have received a RPL_WHOIS* message since less than 10 seconds) - // - we have not received RPL_ENDOFWHOIS yet (the time of the last RPL_WHOIS* is reset to zero when a RPL_ENDOFWHOIS is received) - // - this message is unrecognized and looks like a RPL_WHOIS* - // then pass it to the WhoisOther handler. - // - // Thnx Elephantman :) - - if(msg.paramCount() >= 3) // might look like :prefix RPL_WHOIS* <target> <nick> [?] :<something> - { - kvi_time_t tNow = kvi_unixTime(); - - if((tNow - pConnection->stateData()->lastReceivedWhoisReply()) < 10) - { - // we're in the middle of a RPL_WHOIS* sequence and haven't - // received a RPL_ENDOFWHOIS yet. - parseNumericWhoisOther(&msg); - if(!msg.unrecognized())return; - } - } - } - } else { - for(int i=0;m_literalParseProcTable[i].msgName;i++) - { - if(kvi_strEqualCS(m_literalParseProcTable[i].msgName,msg.command())) - { - (this->*(m_literalParseProcTable[i].proc))(&msg); - if(!msg.unrecognized())return; // parsed - } - } - - - if(KviKvsEventManager::instance()->hasAppHandlers(KviEvent_OnUnhandledLiteral)) - { - KviKvsVariantList parms; - parms.append(pConnection->decodeText(msg.safePrefix())); - parms.append(pConnection->decodeText(msg.command())); - - for(KviStr * str = msg.firstParam();str;str = msg.nextParam()) - parms.append(pConnection->console()->decodeText(str->ptr())); - - if(KviKvsEventManager::instance()->trigger(KviEvent_OnUnhandledLiteral,pConnection->console(),&parms)) - msg.setHaltOutput(); - } - - } - - // unhandled || unrecognized - if(!msg.haltOutput() && !_OUTPUT_MUTE) - { - QString szWText = pConnection->decodeText(msg.allParams()); - if(msg.unrecognized()) - { - pConnection->console()->output(KVI_OUT_UNRECOGNIZED, - __tr2qs("[Server parser]: Encountered problems while parsing the following message:")); - pConnection->console()->output(KVI_OUT_UNRECOGNIZED, - __tr2qs("[Server parser]: [%s][%s] %Q"),msg.prefix(),msg.command(),&szWText); - pConnection->console()->output(KVI_OUT_UNRECOGNIZED, - __tr2qs("[Server parser]: %s"),m_szLastParserError.ptr()); - } else { - // ignore spurious CRLF pairs (some servers send them a lot) unless we want PARANOID output - if((!msg.isEmpty()) || _OUTPUT_PARANOIC) - pConnection->console()->output(KVI_OUT_UNHANDLED, - "[%s][%s] %Q",msg.prefix(),msg.command(),&szWText); - } - } - } -} - - - - -#include "kvi_sparser.moc" diff --git a/3.4.0/src/kvirc/sparser/kvi_sparser.h b/3.4.0/src/kvirc/sparser/kvi_sparser.h deleted file mode 100644 index f8a602e413..0000000000 --- a/3.4.0/src/kvirc/sparser/kvi_sparser.h +++ /dev/null @@ -1,268 +0,0 @@ -#ifndef _KVI_SPARSER_H_ -#define _KVI_SPARSER_H_ - -//============================================================================= -// -// File : kvi_sparser.h -// Creation date : Sat Jun 29 2000 14:23:11 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2005 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <time.h> - -#include <qobject.h> -#include "kvi_pointerlist.h" - -#include "kvi_qstring.h" -#include "kvi_qcstring.h" -#include "kvi_console.h" - -#include "kvi_ircmessage.h" - -class KviWindow; -class KviChannel; -class KviServerParser; -class KviFrame; -class KviIrcConnection; - - - -#define UNRECOGNIZED_MESSAGE(_msg,_err) \ - _msg->setUnrecognized(); \ - m_szLastParserError = _err; - -#define IS_ME(_msg,_nick) KviQString::equalCI(_msg->connection()->currentNickName(),_nick) - -typedef void (KviServerParser::*messageParseProc)(KviIrcMessage *); - -typedef struct _KviLiteralMessageParseStruct -{ - const char * msgName; - messageParseProc proc; -} KviLiteralMessageParseStruct; - -class KviIrcMask; - -typedef struct _KviCtcpMessage -{ - KviIrcMessage * msg; - const char * pData; - QString szTarget; - KviIrcMask * pSource; - bool bIgnored; - bool bIsFlood; - bool bUnknown; - - QString szTag; -} KviCtcpMessage; - -typedef struct _KviDccRequest -{ - KviStr szType; - KviStr szParam1; - KviStr szParam2; - KviStr szParam3; - KviStr szParam4; - KviStr szParam5; - bool bIpV6; - KviCtcpMessage * ctcpMsg; - KviConsole * pConsole; -} KviDccRequest; - -typedef void (KviServerParser::*ctcpParseProc)(KviCtcpMessage *); - -#define KVI_CTCP_MESSAGE_PARSE_TRIGGERNOEVENT 1 - -typedef struct _KviCtcpMessageParseStruct -{ - const char * msgName; - ctcpParseProc proc; - int iFlags; -} KviCtcpMessageParseStruct; - - -#define EXTERNAL_SERVER_DATA_PARSER_CONTROL_RESET 0 -#define EXTERNAL_SERVER_DATA_PARSER_CONTROL_STARTOFDATA 1 -#define EXTERNAL_SERVER_DATA_PARSER_CONTROL_ENDOFDATA 2 - -class KVIRC_API KviExternalServerDataParser -{ -public: - KviExternalServerDataParser(){}; - virtual ~KviExternalServerDataParser(){}; -public: - virtual void processData(KviIrcMessage *){}; - virtual void control(int){}; - virtual void die(){ delete this; }; -}; - - -class KVIRC_API KviServerParser : public QObject -{ - Q_OBJECT -public: - KviServerParser(); - ~KviServerParser(); -private: - static messageParseProc m_numericParseProcTable[1000]; - static KviLiteralMessageParseStruct m_literalParseProcTable[]; - static KviCtcpMessageParseStruct m_ctcpRequestParseProcTable[]; - static KviCtcpMessageParseStruct m_ctcpReplyParseProcTable[]; - KviStr m_szLastParserError; - -// KviStr m_szNoAwayNick; //<-- moved to kvi_console.h in KviConnectionInfo -public: - void parseMessage(const char * message,KviIrcConnection *pConnection); -private: - void parseNumeric001(KviIrcMessage *msg); - void parseNumeric002(KviIrcMessage *msg); - void parseNumeric003(KviIrcMessage *msg); - void parseNumeric004(KviIrcMessage *msg); - void parseNumeric005(KviIrcMessage *msg); - - void parseNumericMotd(KviIrcMessage *msg); - void parseNumericNames(KviIrcMessage *msg); - void parseNumericEndOfNames(KviIrcMessage *msg); - void parseNumericTopic(KviIrcMessage *msg); - void parseNumericNoTopic(KviIrcMessage *msg); - void parseNumericTopicWhoTime(KviIrcMessage *msg); - void parseNumericChannelModeIs(KviIrcMessage *msg); - void parseNumericBanList(KviIrcMessage *msg); - void parseNumericEndOfBanList(KviIrcMessage *msg); - void parseNumericInviteList(KviIrcMessage *msg); - void parseNumericEndOfInviteList(KviIrcMessage *msg); - void parseNumericExceptList(KviIrcMessage *msg); - void parseNumericEndOfExceptList(KviIrcMessage *msg); - void parseNumericWhoReply(KviIrcMessage *msg); - void parseNumericEndOfWho(KviIrcMessage *msg); - void parseNumericNicknameProblem(KviIrcMessage *msg); - void parseNumericWhoisAway(KviIrcMessage *); - void parseNumericWhoisUser(KviIrcMessage *msg); - void parseNumericWhoisChannels(KviIrcMessage *msg); - void parseNumericWhoisIdle(KviIrcMessage *msg); - void parseNumericWhoisServer(KviIrcMessage *msg); - void parseNumericWhoisOther(KviIrcMessage *msg); - void parseNumericWhoisAuth(KviIrcMessage *msg); - void parseNumericWhowasUser(KviIrcMessage *msg); - void parseNumericEndOfWhois(KviIrcMessage *msg); - void parseNumericEndOfWhowas(KviIrcMessage *msg); - void parseNumericNoSuchNick(KviIrcMessage *msg); - void parseNumericCreationTime(KviIrcMessage *msg); - void parseNumericIsOn(KviIrcMessage *msg); - void parseNumericUnavailResource(KviIrcMessage *msg); - void parseNumericLinks(KviIrcMessage *msg); - void parseNumericEndOfLinks(KviIrcMessage *msg); - void parseNumericUserhost(KviIrcMessage *msg); - void parseLoginNicknameProblem(KviIrcMessage *msg); - void parseNumericBackFromAway(KviIrcMessage *); - void parseNumericAway(KviIrcMessage *); - void parseNumericWatch(KviIrcMessage *msg); - void parseNumericList(KviIrcMessage *msg); - void parseNumericListStart(KviIrcMessage *msg); - void parseNumericListEnd(KviIrcMessage *msg); - void parseNumericCantJoinChannel(KviIrcMessage *msg); - void parseNumericStats(KviIrcMessage *msg); - void parseNumericUserMode(KviIrcMessage * msg); - void parseNumericCodePageSet(KviIrcMessage * msg); - void parseNumericCodePageScheme(KviIrcMessage * msg); - void parseNumeric020(KviIrcMessage *msg); - void parseNumericCannotSend(KviIrcMessage *msg); - void parseNumericNoSuchChannel(KviIrcMessage *msg); - void parseNumericNoSuchServer(KviIrcMessage *msg); - void parseNumericTime(KviIrcMessage *msg); - void parseNumericInfoEnd(KviIrcMessage *msg); - void parseNumericInfoStart(KviIrcMessage *msg); - void parseNumericInfo(KviIrcMessage *msg); - void parseNumericInviting(KviIrcMessage *msg); - void parseNumericCommandSyntax(KviIrcMessage *msg); - void parseNumericServerAdminInfoAdminContact(KviIrcMessage *msg); - void parseNumericServerAdminInfoAdminName(KviIrcMessage *msg); - void parseNumericServerAdminInfoServerName(KviIrcMessage *msg); - void parseNumericServerAdminInfoTitle(KviIrcMessage *msg); - void parseNumericCannotSendColor(KviIrcMessage *msg); - void parseNumericEndOfStats(KviIrcMessage *msg); - void otherChannelError(KviIrcMessage *msg); - void parseCommandSyntaxHelp(KviIrcMessage *msg); - void parseCommandHelp(KviIrcMessage *msg); - void parseCommandEndOfHelp(KviIrcMessage *msg); - void parseChannelHelp(KviIrcMessage *msg); - - void parseLiteralPing(KviIrcMessage *msg); - void parseLiteralJoin(KviIrcMessage *msg); - void parseLiteralTopic(KviIrcMessage *msg); - void parseLiteralPart(KviIrcMessage *msg); - void parseLiteralPrivmsg(KviIrcMessage *msg); - void parseLiteralNotice(KviIrcMessage *msg); - void parseLiteralQuit(KviIrcMessage *msg); - void parseLiteralNick(KviIrcMessage *msg); - void parseLiteralMode(KviIrcMessage *msg); - void parseLiteralKick(KviIrcMessage *msg); - void parseLiteralInvite(KviIrcMessage *msg); - void parseLiteralWallops(KviIrcMessage *msg); - void parseLiteralPong(KviIrcMessage *msg); - void parseLiteralError(KviIrcMessage *msg); - void parseChannelMode(const QString &szNick,const QString &szUser,const QString &szHost,KviChannel * chan,KviStr &modefl,KviIrcMessage *msg,int curParam); - void parseUserMode(KviIrcMessage *msg,const char * modeflptr); - - - - void parseCtcpRequest(KviCtcpMessage *msg); - void parseCtcpReply(KviCtcpMessage *msg); - void echoCtcpRequest(KviCtcpMessage *msg); - void echoCtcpReply(KviCtcpMessage *msg); - void replyCtcp(KviCtcpMessage *msg,const char * data); - bool checkCtcpFlood(KviCtcpMessage *msg); - - void parseCtcpRequestPing(KviCtcpMessage *msg); - void parseCtcpRequestVersion(KviCtcpMessage *msg); - void parseCtcpRequestUserinfo(KviCtcpMessage *msg); - void parseCtcpRequestClientinfo(KviCtcpMessage *msg); - void parseCtcpRequestFinger(KviCtcpMessage *msg); - void parseCtcpRequestSource(KviCtcpMessage *msg); - void parseCtcpRequestAction(KviCtcpMessage *msg); - void parseCtcpRequestTime(KviCtcpMessage *msg); - void parseCtcpRequestAvatar(KviCtcpMessage *msg); - void parseCtcpRequestDcc(KviCtcpMessage *msg); - void parseCtcpRequestPage(KviCtcpMessage *msg); - - void parseCtcpReplyAvatar(KviCtcpMessage *msg); - void parseCtcpReplyUserinfo(KviCtcpMessage *msg); - void parseCtcpReplyGeneric(KviCtcpMessage *msg); - void parseCtcpReplyPing(KviCtcpMessage *msg); - void parseCtcpReplyLagcheck(KviCtcpMessage *msg); -// void parseCtcpReply(const char * msg_ptr,KviIrcUser &source,const char * target); -public: - static void encodeCtcpParameter(const char * param,KviStr &buffer,bool bSpaceBreaks = true); - static void encodeCtcpParameter(const char * param,QString &buffer,bool bSpaceBreaks = true); - static const char * decodeCtcpEscape(const char * msg_ptr,KviStr &buffer); - static const char * decodeCtcpEscape(const char * msg_ptr,KviQCString &buffer); - static const char * extractCtcpParameter(const char * msg_ptr,KviStr &buffer,bool bSpaceBreaks = true); - static const char * extractCtcpParameter(const char * msg_ptr,QString &buffer,bool bSpaceBreaks = true); -}; - -#ifndef _KVI_SPARSER_CPP_ - extern KVIRC_API KviServerParser * g_pServerParser; -#endif - - -#endif //_KVI_SPARSER_H_ diff --git a/3.4.0/src/kvirc/ui/.svnignore b/3.4.0/src/kvirc/ui/.svnignore deleted file mode 100644 index 03dfbb30c1..0000000000 --- a/3.4.0/src/kvirc/ui/.svnignore +++ /dev/null @@ -1,19 +0,0 @@ -Makefile.in -Makefile -core -config.h -config.h.in -stamp-h -stamp-h.in -stamp.h.in -moc_*.cpp -.libs -.deps -*.moc -*.o -*.lo -*.la -*.so -*.lai -kvirc -symlinks diff --git a/3.4.0/src/kvirc/ui/Makefile.am b/3.4.0/src/kvirc/ui/Makefile.am deleted file mode 100644 index c84487eb66..0000000000 --- a/3.4.0/src/kvirc/ui/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -EXTRA_DIST = *.cpp *.h diff --git a/3.4.0/src/kvirc/ui/kvi_actiondrawer.cpp b/3.4.0/src/kvirc/ui/kvi_actiondrawer.cpp deleted file mode 100644 index b09476dae9..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_actiondrawer.cpp +++ /dev/null @@ -1,227 +0,0 @@ -//============================================================================= -// -// File : kvi_actiondrawer.cpp -// Created on Sun 21 Nov 2004 05:44:22 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_actiondrawer.h" -#include "kvi_action.h" -#include "kvi_actionmanager.h" -#include "kvi_iconmanager.h" -#include "kvi_locale.h" - -#include <qlayout.h> -#include <qlabel.h> -//#include <qscrollview.h> -#include <qpainter.h> -#include <qpixmap.h> -#ifdef COMPILE_USE_QT4 - #include <q3header.h> - #include <q3simplerichtext.h> - #include <qmime.h> - #include <qevent.h> -#else - #include <qheader.h> - #include <qsimplerichtext.h> -#endif - -#include "kvi_draganddrop.h" - -#define LVI_ICON_SIZE 32 -#define LVI_BORDER 4 -#define LVI_SPACING 8 -#define LVI_MINIMUM_TEXT_WIDTH 300 -#define LVI_MINIMUM_CELL_WIDTH (LVI_MINIMUM_TEXT_WIDTH + LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING + LVI_BORDER) - -KviActionDrawerPageListViewItem::KviActionDrawerPageListViewItem(KviTalListView * v,KviAction * a) -: KviTalListViewItem(v,"") -{ - m_pListView = v; - setDragEnabled(true); - m_szName = a->name(); - QString t = "<b>" + a->visibleName() + "</b>"; - if(a->isKviUserActionNeverOverrideThis()) - t += " <font color=\"#a0a0a0\">[" + __tr2qs("Script") + "]</font>"; - t += "<br><font size=\"-1\">" + a->description()+ "</font>"; - m_szKey = a->visibleName().upper(); -#ifdef COMPILE_USE_QT4 - m_pText = new Q3SimpleRichText(t,v->font()); -#else - m_pText = new QSimpleRichText(t,v->font()); -#endif - QPixmap * p = a->bigIcon(); - m_pIcon = p ? new QPixmap(*p) : new QPixmap(LVI_ICON_SIZE,LVI_ICON_SIZE); -} - -KviActionDrawerPageListViewItem::~KviActionDrawerPageListViewItem() -{ - delete m_pIcon; - delete m_pText; -} - -QString KviActionDrawerPageListViewItem::key(int,bool) const -{ - return m_szKey; -} - -void KviActionDrawerPageListViewItem::setup() -{ - KviTalListViewItem::setup(); - int iWidth = m_pListView->visibleWidth(); - if(iWidth < LVI_MINIMUM_CELL_WIDTH)iWidth = LVI_MINIMUM_CELL_WIDTH; - iWidth -= LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING + LVI_BORDER; - m_pText->setWidth(iWidth); - int iHeight = m_pText->height() + (2 * LVI_BORDER); - if(iHeight < (LVI_ICON_SIZE + (2 * LVI_BORDER)))iHeight = LVI_ICON_SIZE + (2 * LVI_BORDER); - setHeight(iHeight); -} - -void KviActionDrawerPageListViewItem::paintCell(QPainter * p,const QColorGroup & cg,int column,int width,int align) -{ - KviTalListViewItem::paintCell(p,cg,column,width,align); - //p->fillRect(QRect(0,0,width,height()),isSelected() ? cg.highlight() : cg.base()); - p->drawPixmap(LVI_BORDER,LVI_BORDER,*m_pIcon); - int afterIcon = LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING; - int www = m_pListView->visibleWidth() - (afterIcon + LVI_BORDER); - m_pText->setWidth(www); - if(isSelected()) - { - QColorGroup cg2(cg); - cg2.setColor(QColorGroup::HighlightedText,cg.text()); - m_pText->draw(p,afterIcon,LVI_BORDER,QRect(afterIcon,LVI_BORDER,www,height() - (LVI_BORDER * 2)),cg2); - } else { - m_pText->draw(p,afterIcon,LVI_BORDER,QRect(afterIcon,LVI_BORDER,www,height() - (LVI_BORDER * 2)),cg); - } -} - -KviActionDrawerPageListView::KviActionDrawerPageListView(KviActionDrawerPage * pParent) -: KviListView(pParent) -{ - QPixmap * p = g_pIconManager->getImage("kvi_actiondrawer.png"); - if(p)setBackgroundOverlayPixmap(p,Qt::AlignRight | Qt::AlignBottom); - -// m_pPage = pParent; - setSelectionMode(Single); - header()->hide(); - int iWidth = visibleWidth(); - if(iWidth < LVI_MINIMUM_CELL_WIDTH)iWidth = LVI_MINIMUM_CELL_WIDTH; - addColumn("",iWidth); - setSorting(0,true); -} - -KviActionDrawerPageListView::~KviActionDrawerPageListView() -{ -} - - -void KviActionDrawerPageListView::contentsMousePressEvent(QMouseEvent * e) -{ - KviListView::contentsMousePressEvent(e); - KviActionDrawerPageListViewItem * i = (KviActionDrawerPageListViewItem *)itemAt(QPoint(5,contentsToViewport(e->pos()).y())); - if(!i)return; - KviTextDrag * dr = new KviTextDrag(i->name(),this); // does this leak memory ? - if(i->icon())dr->setPixmap(*(i->icon()),QPoint(3,3)); - dr->dragCopy(); -} - -void KviActionDrawerPageListView::resizeEvent(QResizeEvent * e) -{ - KviListView::resizeEvent(e); - int iWidth = visibleWidth(); - if(iWidth < LVI_MINIMUM_CELL_WIDTH)iWidth = LVI_MINIMUM_CELL_WIDTH; - setColumnWidth(0,iWidth); -} - - -KviActionDrawerPage::KviActionDrawerPage(QWidget * pParent,const QString &szDescription) -: QWidget(pParent) -{ - QGridLayout * g = new QGridLayout(this,2,1,4,4); - - QString t = "<b>" + szDescription + "</b>"; - QLabel * l = new QLabel(t,this); - g->addWidget(l,0,0); - - m_pListView = new KviActionDrawerPageListView(this); - - g->addWidget(m_pListView,1,0); - - g->setRowStretch(1,1); -} - -KviActionDrawerPage::~KviActionDrawerPage() -{ -} - -void KviActionDrawerPage::add(KviAction * a) -{ - (void)new KviActionDrawerPageListViewItem(m_pListView,a); -} - -KviActionDrawer::KviActionDrawer(QWidget * pParent) -: QTabWidget(pParent) -{ - setMinimumWidth(400); - setMinimumHeight(300); -} - -KviActionDrawer::~KviActionDrawer() -{ -} - -void KviActionDrawer::fill() -{ - KviActionManager::loadAllAvailableActions(); - - KviPointerHashTable<QString,KviActionDrawerPage> pages; - pages.setAutoDelete(false); - - KviPointerHashTable<QString,KviAction> * d = KviActionManager::instance()->actions(); - if(!d)return; // ooops - - KviPointerHashTableIterator<QString,KviAction> it(*d); - while(KviAction * a = it.current()) - { - KviActionCategory * c = a->category(); - if(!c)c = KviActionManager::categoryGeneric(); - KviActionDrawerPage * p = pages.find(c->visibleName()); - if(!p) - { - p = new KviActionDrawerPage(this,c->description()); - pages.replace(c->visibleName(),p); - addTab(p,c->visibleName()); - //p->show(); - } - p->add(a); - ++it; - } - - KviActionDrawerPage * p = pages.find(KviActionManager::categoryIrc()->visibleName()); - if(p) - { - int iii = indexOf(p); - if(iii >= 0)setCurrentPage(iii); - } -} - - diff --git a/3.4.0/src/kvirc/ui/kvi_actiondrawer.h b/3.4.0/src/kvirc/ui/kvi_actiondrawer.h deleted file mode 100644 index 581d003906..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_actiondrawer.h +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef _KVI_ACTIONDRAWER_H_ -#define _KVI_ACTIONDRAWER_H_ -//============================================================================= -// -// File : kvi_actiondrawer.h -// Created on Sun 21 Nov 2004 05:44:22 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" - -#include <qwidget.h> -#include <qtabwidget.h> - -#include "kvi_listview.h" - -class KviActionDrawerPage; -class QPixmap; -#ifdef COMPILE_USE_QT4 - class Q3SimpleRichText; -#else - class QSimpleRichText; -#endif -class KviAction; - -class KVIRC_API KviActionDrawerPageListViewItem : public KviTalListViewItem -{ -public: - KviActionDrawerPageListViewItem(KviTalListView * v,KviAction * a); - ~KviActionDrawerPageListViewItem(); -protected: - QString m_szName; -#ifdef COMPILE_USE_QT4 - Q3SimpleRichText * m_pText; -#else - QSimpleRichText * m_pText; -#endif - QPixmap * m_pIcon; - KviTalListView * m_pListView; - QString m_szKey; -public: - QPixmap * icon(){ return m_pIcon; }; - const QString & name(){ return m_szName; }; -protected: - virtual void paintCell(QPainter * p,const QColorGroup & cg,int column,int width,int align); - virtual void setup(); - virtual QString key(int,bool) const; -}; - -class KVIRC_API KviActionDrawerPageListView : public KviListView -{ - friend class KviActionDrawerPage; - Q_OBJECT -protected: - KviActionDrawerPageListView(KviActionDrawerPage * pParent); -public: - ~KviActionDrawerPageListView(); -//protected: -// KviActionDrawerPage * m_pPage; -protected: - virtual void resizeEvent(QResizeEvent * e); - virtual void contentsMousePressEvent(QMouseEvent * e); -}; - -class KVIRC_API KviActionDrawerPage : public QWidget -{ - friend class KviActionDrawer; - Q_OBJECT -protected: - KviActionDrawerPage(QWidget * pParent,const QString &szDescription); -public: - ~KviActionDrawerPage(); -protected: - KviActionDrawerPageListView * m_pListView; -protected: - void add(KviAction * a); -}; - -class KVIRC_API KviActionDrawer : public QTabWidget -{ - Q_OBJECT -public: - KviActionDrawer(QWidget * pParent); - ~KviActionDrawer(); -public: - void fill(); -}; - -#endif //!_KVI_ACTIONDRAWER_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_channel.cpp b/3.4.0/src/kvirc/ui/kvi_channel.cpp deleted file mode 100644 index b736d676a3..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_channel.cpp +++ /dev/null @@ -1,1628 +0,0 @@ -//============================================================================= -// -// File : kvi_channel.cpp -// Creation date : Tue Aug 1 2000 02:20:22 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - -// -// Channel widget : abstraction of an IRC channel -// - -#define __KVIRC__ - -#include "kvi_toolwindows_container.h" -#include "kvi_styled_controls.h" -#include "kvi_channel.h" -#include "kvi_console.h" -#include "kvi_iconmanager.h" -#include "kvi_ircview.h" -#include "kvi_input.h" -#include "kvi_options.h" -#include "kvi_locale.h" -#include "kvi_topicw.h" -#include "kvi_ircsocket.h" -#include "kvi_out.h" -#include "kvi_malloc.h" -#include "kvi_taskbar.h" -#include "kvi_frame.h" -#include "kvi_config.h" -#include "kvi_themedlabel.h" -#include "kvi_maskeditor.h" -#include "kvi_mirccntrl.h" -#include "kvi_settings.h" -#include "kvi_parameterlist.h" -#include "kvi_modeeditor.h" -#include "kvi_app.h" -#include "kvi_useraction.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionserverinfo.h" -#include "kvi_defaults.h" -#include "kvi_sparser.h" -#include "kvi_modew.h" -#include "kvi_mirccntrl.h" - -#ifdef COMPILE_CRYPT_SUPPORT - #include "kvi_crypt.h" - #include "kvi_cryptcontroller.h" -#endif - -#include "kvi_kvs_script.h" -#include "kvi_kvs_eventtriggers.h" - -#include <time.h> - -#include <qsplitter.h> -#include <qtoolbutton.h> -#include <qlabel.h> -#include <qevent.h> - -#include <qpalette.h> -#include "kvi_tal_popupmenu.h" -#include "kvi_pointerhashtable.h" -#include <qmessagebox.h> -#include "kvi_tal_widgetstack.h" - -#ifndef AVERAGE_CHANNEL_USERS - #define AVERAGE_CHANNEL_USERS 101 -#endif - - - -// FIXME: #warning "+a Anonymous channel mode!" -// FIXME: #warning "+r channel mode (reop)" -// FIXME: #warning "OnChannelFlood event...." - - -KviChannel::KviChannel(KviFrame * lpFrm,KviConsole * lpConsole,const char * name) -: KviWindow(KVI_WINDOW_TYPE_CHANNEL,lpFrm,name,lpConsole) -{ - // Init some member variables - m_pInput = 0; - m_iStateFlags = 0; - m_pBanList = new KviPointerList<KviMaskEntry>; - m_pBanList->setAutoDelete(true); - m_pBanExceptionList = new KviPointerList<KviMaskEntry>; - m_pBanExceptionList->setAutoDelete(true); - m_pInviteList = new KviPointerList<KviMaskEntry>; - m_pInviteList->setAutoDelete(true); - m_pActionHistory = new KviPointerList<KviChannelAction>; - m_pActionHistory->setAutoDelete(true); - m_uActionHistoryHotActionCount = 0; - - m_pTmpHighLighted = new KviPointerHashTable<const char *,QString>(); - m_pTmpHighLighted->setAutoDelete(true); - - // Register ourselves - connection()->registerChannel(this); - // And create the widgets layout - // Button box - m_pButtonBox = new KviTalHBox(this); - - m_pTopSplitter = new QSplitter(Qt::Horizontal,m_pButtonBox); - - m_pButtonBox->setStretchFactor(m_pTopSplitter,1); - - m_pButtonContainer = new KviTalHBox(m_pButtonBox); - - // Topic widget on the left - m_pTopicWidget = new KviTopicWidget(m_pTopSplitter,"topic_widget"); - - connect(m_pTopicWidget,SIGNAL(topicSelected(const QString &)), - this,SLOT(topicSelected(const QString &))); - // mode label follows the topic widget - m_pModeWidget = new KviModeWidget(m_pTopSplitter,this,"mode_"); - KviTalToolTip::add(m_pModeWidget,__tr2qs("Channel mode")); - - createTextEncodingButton(m_pButtonContainer); - - // Central splitter - m_pSplitter = new QSplitter(Qt::Horizontal,this); - #ifdef COMPILE_USE_QT4 - m_pSplitter->setObjectName(name); - #else - m_pSplitter->setName(name); - #endif - m_pSplitter->setOpaqueResize(false); - // Spitted vertially on the left - m_pVertSplitter = new QSplitter(Qt::Vertical,m_pSplitter); - m_pVertSplitter->setOpaqueResize(false); - // With the IRC view over - m_pIrcView = new KviIrcView(m_pVertSplitter,lpFrm,this); - #ifdef COMPILE_USE_QT4 - m_pIrcView->setObjectName(name); - #else - m_pIrcView->setName(name); - #endif - connect(m_pIrcView,SIGNAL(rightClicked()),this,SLOT(textViewRightClicked())); - // And the double view (that may be unused) - m_pMessageView = 0; - // The userlist on the right - //m_pEditorsContainer= new KviToolWindowsContainer(m_pSplitter); - - - // and the related buttons - m_pDoubleViewButton = createToolButton(m_pButtonContainer,"double_view_button",KVI_SMALLICON_HIDEDOUBLEVIEW,KVI_SMALLICON_SHOWDOUBLEVIEW,__tr2qs("Split View"),false); - connect(m_pDoubleViewButton,SIGNAL(clicked()),this,SLOT(toggleDoubleView())); - - m_pListViewButton = new KviWindowToolPageButton(KVI_SMALLICON_HIDELISTVIEW,KVI_SMALLICON_SHOWLISTVIEW,__tr2qs("User List"),buttonContainer(),true,"list_view_button"); - connect(m_pListViewButton,SIGNAL(clicked()),this,SLOT(toggleListView())); - m_pBanEditorButton = new KviWindowToolPageButton(KVI_SMALLICON_UNBAN,KVI_SMALLICON_BAN,__tr2qs("Ban Editor"),buttonContainer(),false,"ban_editor_button"); - connect(m_pBanEditorButton,SIGNAL(clicked()),this,SLOT(toggleBanEditor())); - - if(m_pConsole->connection()->serverInfo()->supportedListModes().contains('e')) - { - m_pBanExceptionEditorButton =new KviWindowToolPageButton(KVI_SMALLICON_BANUNEXCEPT,KVI_SMALLICON_BANEXCEPT,__tr2qs("Ban Exception Editor"),buttonContainer(),false,"ban_exception_editor_button"); - connect(m_pBanExceptionEditorButton,SIGNAL(clicked()),this,SLOT(toggleBanExceptionEditor())); - } else { - m_pBanExceptionEditorButton=0; - } - if(m_pConsole->connection()->serverInfo()->supportedListModes().contains('I')) - { - m_pInviteEditorButton =new KviWindowToolPageButton(KVI_SMALLICON_INVITEUNEXCEPT,KVI_SMALLICON_INVITEEXCEPT,__tr2qs("Invite Exception Editor"),buttonContainer(),false,"invite_exception_editor_button"); - connect(m_pInviteEditorButton,SIGNAL(clicked()),this,SLOT(toggleInviteEditor())); - } else { - m_pInviteEditorButton = 0; - } - m_pModeEditorButton = new KviWindowToolPageButton(KVI_SMALLICON_CHANMODEHIDE,KVI_SMALLICON_CHANMODE,__tr2qs("Mode Editor"),buttonContainer(),false,"mode_editor_button"); - connect(m_pModeEditorButton,SIGNAL(clicked()),this,SLOT(toggleModeEditor())); - m_pModeEditor = 0; - -#ifdef COMPILE_CRYPT_SUPPORT - createCryptControllerButton(m_pButtonContainer); -#endif - - m_pHideToolsButton = new KviStyledToolButton(m_pButtonBox,"hide_container_button"); - -#ifndef COMPILE_USE_QT4 - m_pHideToolsButton->setUsesBigPixmap(false); -#else - m_pHideToolsButton->setAutoRaise(true); -#endif - m_pHideToolsButton->setFixedWidth(10); - - if(g_pIconManager->getBigIcon("kvi_horizontal_left.png")) - m_pHideToolsButton->setPixmap(*(g_pIconManager->getBigIcon("kvi_horizontal_left.png"))); - - connect(m_pHideToolsButton,SIGNAL(clicked()),this,SLOT(toggleToolButtons())); - - m_pUserListView = new KviUserListView(m_pSplitter,m_pListViewButton,connection()->userDataBase(),this, - AVERAGE_CHANNEL_USERS,__tr2qs("User List"),"user_list_view"); -// m_pEditorsContainer->addWidget(m_pUserListView); -// m_pEditorsContainer->raiseWidget(m_pUserListView); - // And finally the input line on the bottom - m_pInput = new KviInput(this,m_pUserListView); - // no mask editors yet - m_pBanEditor = 0; - m_pBanExceptionEditor = 0; - m_pInviteEditor = 0; - // Ensure proper focusing - //setFocusHandler(m_pInput,this); - // And turn on the secondary IRC view if needed - - if(KVI_OPTION_BOOL(KviOption_boolAutoLogChannels))m_pIrcView->startLogging(); - - applyOptions(); - m_joinTime = QDateTime::currentDateTime(); - m_tLastReceivedWhoReply = (kvi_time_t)m_joinTime.toTime_t(); - - -} - -KviChannel::~KviChannel() -{ - // Unregister ourself - if(type() == KVI_WINDOW_TYPE_DEADCHANNEL)context()->unregisterDeadChannel(this); - else connection()->unregisterChannel(this); - // Then remove all the users and free mem - m_pUserListView->enableUpdates(false); - m_pUserListView->partAll(); - delete m_pActionHistory; - delete m_pBanList; - delete m_pBanExceptionList; - delete m_pInviteList; - delete m_pTmpHighLighted; -} - -void KviChannel::toggleToolButtons() -{ - if(!buttonContainer()) return; - toggleButtonContainer(); - QPixmap* pix= buttonContainer()->isVisible() ? - g_pIconManager->getBigIcon("kvi_horizontal_left.png") : - g_pIconManager->getBigIcon("kvi_horizontal_right.png"); - if(pix) - m_pHideToolsButton->setPixmap(*pix); -} - -void KviChannel::triggerCreationEvents() -{ - KVS_TRIGGER_EVENT_0(KviEvent_OnChannelWindowCreated,this); -} - -void KviChannel::textViewRightClicked() -{ - KVS_TRIGGER_EVENT_0(KviEvent_OnChannelPopupRequest,this); -} - -void KviChannel::getBaseLogFileName(QString &buffer) -{ - QString szChan(windowName()); - szChan.replace(".","%2e"); - if (console()->connection()) - { - buffer=szChan; - buffer.append("."); - buffer.append(console()->currentNetworkName()); - } else { - buffer=szChan; - buffer.append("."); - buffer.append(console()->ircContextId()); - } -} - -void KviChannel::applyOptions() -{ - m_pUserListView->applyOptions(); - m_pTopicWidget->applyOptions(); - - if(m_pMessageView)m_pMessageView->applyOptions(); - - m_pModeWidget->applyOptions(); - - // this applies options for IrcView and Input and forces the window to relayout - KviWindow::applyOptions(); -} - -void KviChannel::getConfigGroupName(QString &buf) -{ - buf = windowName(); -} - -void KviChannel::saveProperties(KviConfig *cfg) -{ - KviWindow::saveProperties(cfg); - cfg->writeEntry("TopSplitter",m_pTopSplitter->sizes()); - cfg->writeEntry("Splitter",m_pSplitter->sizes()); -#ifdef COMPILE_USE_QT4 - QList<int> tmp = m_pVertSplitter->sizes(); - KviValueList<int> tmp2; - for(QList<int>::Iterator it = tmp.begin();it != tmp.end();++it) - tmp2.append(*it); - cfg->writeEntry("VertSplitter",m_pMessageView ? tmp2 : m_VertSplitterSizesList); -#else - cfg->writeEntry("VertSplitter",m_pMessageView ? m_pVertSplitter->sizes() : m_VertSplitterSizesList); -#endif - cfg->writeEntry("PrivateBackground",m_privateBackground); - cfg->writeEntry("DoubleView",m_pMessageView ? true : false); - if(m_pUserListView) - cfg->writeEntry("UserListHidden",m_pUserListView->isHidden()); - cfg->writeEntry("ToolButtonsHidden",buttonContainer()->isHidden()); -} - -void KviChannel::loadProperties(KviConfig *cfg) -{ - int w = width(); - KviValueList<int> def; - def.append((w * 75) / 100); - def.append((w * 15) / 100); - def.append((w * 10) / 100); - m_pTopSplitter->setSizes(cfg->readIntListEntry("TopSplitter",def)); - def.clear(); - def.append((w * 82) / 100); - def.append((w * 18) / 100); - m_pSplitter->setSizes(cfg->readIntListEntry("Splitter",def)); - //debug("SETTING DEFAULT SIZES"); - def.clear(); - - def.append((w * 60) / 100); - def.append((w * 40) / 100); - m_VertSplitterSizesList=cfg->readIntListEntry("VertSplitter",def); - showDoubleView(cfg->readBoolEntry("DoubleView",false)); - //def.append((w * 50) / 100); - //def.append((w * 50) / 100); - - m_privateBackground = cfg->readPixmapEntry("PrivateBackground",KviPixmap()); - if(m_privateBackground.pixmap()) - { - m_pIrcView->setPrivateBackgroundPixmap(*(m_privateBackground.pixmap())); - if(m_pMessageView)m_pMessageView->setPrivateBackgroundPixmap(*(m_privateBackground.pixmap())); - } - - KviWindow::loadProperties(cfg); - if(m_pUserListView) - { - bool bHidden=cfg->readBoolEntry("UserListHidden",0); - m_pUserListView->setHidden(bHidden); - resizeEvent(0); - } - if(cfg->readBoolEntry("ToolButtonsHidden",KVI_OPTION_BOOL(KviOption_boolHideWindowToolButtons))!=buttonContainer()->isHidden()) - toggleToolButtons(); -} - - -void KviChannel::showDoubleView(bool bShow) -{ - if(m_pMessageView) - { - if(bShow)return; - m_pIrcView->joinMessagesFrom(m_pMessageView); - m_VertSplitterSizesList=m_pVertSplitter->sizes(); - delete m_pMessageView; - m_pMessageView = 0; - if(m_pDoubleViewButton->isOn())m_pDoubleViewButton->setOn(false); - } else { - if(!bShow)return; - m_pMessageView = new KviIrcView(m_pVertSplitter,m_pFrm,this); - m_pVertSplitter->setSizes(m_VertSplitterSizesList); - //setFocusHandler(m_pInput,m_pMessageView); //socket it! - if(!(m_pDoubleViewButton->isOn()))m_pDoubleViewButton->setOn(true); - if(m_privateBackground.pixmap()) - { - m_pMessageView->setPrivateBackgroundPixmap(*(m_privateBackground.pixmap())); - } - connect(m_pMessageView,SIGNAL(rightClicked()),this,SLOT(textViewRightClicked())); - m_pMessageView->setMasterView(m_pIrcView); - m_pIrcView->splitMessagesTo(m_pMessageView); - m_pMessageView->show(); - } -} - -void KviChannel::toggleDoubleView() -{ - showDoubleView(!m_pMessageView); -} - -void KviChannel::toggleListView() -{ - if(m_pUserListView->isVisible()) - { - m_pUserListView->hide(); - if(m_pListViewButton->isOn())m_pListViewButton->setOn(false); - } else { - m_pUserListView->show(); - if(!(m_pListViewButton->isOn()))m_pListViewButton->setOn(true); - } -} - - -void KviChannel::toggleModeEditor() -{ - if(m_pModeEditor) - { - delete m_pModeEditor; - m_pModeEditor = 0; - m_pSplitter->setMinimumHeight(20); //gfgf - if(m_pModeEditorButton->isOn()) m_pModeEditorButton->setOn(false); - resizeEvent(0); - } else { - m_pModeEditor = new KviModeEditor(m_pSplitter,m_pModeEditorButton,"mode_editor",console(),m_szChannelMode,m_szChannelKey,m_szChannelLimit.ptr()); - connect(m_pModeEditor,SIGNAL(setMode(const char *)),this,SLOT(setMode(const char *))); - connect(m_pModeEditor,SIGNAL(done()),this,SLOT(modeSelectorDone())); - m_pModeEditor->show(); - //setFocusHandlerNoClass(m_pInput,m_pModeEditor,"QLineEdit"); - if(!m_pModeEditorButton->isOn())m_pModeEditorButton->setOn(true); - } -} - -void KviChannel::modeSelectorDone() -{ - if(m_pModeEditor)toggleModeEditor(); -} - -void KviChannel::setMode(const char * mode) -{ - if(!connection())return; - KviQCString tmp = connection()->encodeText(m_szName); - connection()->sendFmtData("MODE %s %s",tmp.data(),mode); -} - -void KviChannel::toggleBanEditor() -{ - toggleEditor(&m_pBanEditor,&m_pBanEditorButton, - m_pBanList,'b',"ban_editor"); -} - -void KviChannel::toggleBanExceptionEditor() -{ - toggleEditor(&m_pBanExceptionEditor,&m_pBanExceptionEditorButton, - m_pBanExceptionList,'e',"ban_exception_editor"); -} - -void KviChannel::toggleInviteEditor() -{ - toggleEditor(&m_pInviteEditor,&m_pInviteEditorButton, - m_pInviteList,'I',"invite_exception_editor"); -} - -void KviChannel::toggleEditor(KviMaskEditor ** ppEd,KviWindowToolPageButton ** ppBtn,KviPointerList<KviMaskEntry> *l,char flag,const char *edName) -{ - if(*ppEd) - { - delete *ppEd; - *ppEd = 0; - if(!(*ppBtn))return; - if((*ppBtn)->isOn()) (*ppBtn)->setOn(false); - } else { - bool bHasList = true; - switch(flag) - { - case 'b': - if(!(bHasList = hasBanList())) - { - m_pBanList->clear(); - setSentBanListRequest(); - } - break; - case 'e': - if(!(bHasList = hasBanExceptionList())) - { - m_pBanExceptionList->clear(); - setSentBanExceptionListRequest(); - } - break; - case 'I': - if(!(bHasList = hasInviteList())) - { - m_pInviteList->clear(); - setSentInviteListRequest(); - } - break; - } - if(!bHasList) - { - if(connection()) - { - KviQCString szName = connection()->encodeText(m_szName); - connection()->sendFmtData("MODE %s %c",szName.data(),flag); - } - } - - *ppEd = new KviMaskEditor(m_pSplitter,*ppBtn,l,flag,edName); - connect(*ppEd,SIGNAL(removeMasks(KviMaskEditor *,KviPointerList<KviMaskEntry> *)), - this,SLOT(removeMasks(KviMaskEditor *,KviPointerList<KviMaskEntry> *))); - //setFocusHandler(m_pInput,*ppEd); //socket it! - (*ppEd)->show(); - if(!(*ppBtn))return; - if(!((*ppBtn)->isOn()))(*ppBtn)->setOn(true); - } -} - -void KviChannel::removeMasks(KviMaskEditor *ed,KviPointerList<KviMaskEntry> *l) -{ - KviStr masks; - KviStr flags; - unsigned int count = 0; - for(KviMaskEntry * e = l->first();e;e = l->next()) - { - if(masks.hasData())masks.append(' '); - masks.append(e->szMask); - flags.append(ed->flag()); - count++; - if(count == connection()->serverInfo()->maxModeChanges()) - { - if(connection()) - { - KviQCString szName = connection()->encodeText(m_szName); - connection()->sendFmtData("MODE %s -%s %s",szName.data(),flags.ptr(),connection()->encodeText(QString(masks)).data()); - } - flags = ""; - masks = ""; - count = 0; - } - } - if(masks.hasData()) - { - if(connection()) - { - KviQCString szName = connection()->encodeText(m_szName); - connection()->sendFmtData("MODE %s -%s %s",szName.data(),flags.ptr(),connection()->encodeText(QString(masks)).data()); - } - } -} - -QPixmap * KviChannel::myIconPtr() -{ - return g_pIconManager->getSmallIcon((m_iStateFlags & KVI_CHANNEL_STATE_DEADCHAN) ? KVI_SMALLICON_DEADCHANNEL : KVI_SMALLICON_CHANNEL); -} - -void KviChannel::resizeEvent(QResizeEvent *e) -{ -#ifdef COMPILE_USE_QT4 - int hght = m_pInput->heightHint(); - int hght2 = m_pTopicWidget->sizeHint().height(); - m_pButtonBox->setGeometry(0,0,width(),hght2); - m_pSplitter->setGeometry(0,hght2,width(),height() - (hght + hght2)); - m_pInput->setGeometry(0,height() - hght,width(),hght); -#else - int hght = m_pInput->heightHint(); - int hght2 = m_pButtonBox->sizeHint().height(); - m_pButtonBox->setGeometry(0,0,width(),hght2); - m_pSplitter->setGeometry(0,hght2,width(),height() - (hght + hght2)); - m_pInput->setGeometry(0,height() - hght,width(),hght); -#endif -} - -QSize KviChannel::sizeHint() const -{ - QSize ret(m_pSplitter->sizeHint().width(), - m_pIrcView->sizeHint().height() + m_pInput->heightHint() + m_pButtonBox->sizeHint().height()); - return ret; -} - -void KviChannel::setChannelMode(char mode,bool bAdd) -{ - if(!m_pConsole->connection()->serverInfo()->supportedListModes().contains(mode)){ - if(bAdd) - { - if(!(m_szChannelMode.contains(mode)))m_szChannelMode.append(mode); - } else { - if(m_szChannelMode.contains(mode)) - { - m_szChannelMode.replace(mode,""); - } - } - updateModeLabel(); - updateCaption(); - } -} - -void KviChannel::setChannelKey(const char * key) -{ - m_szChannelKey = key; - updateModeLabel(); - updateCaption(); -} - -void KviChannel::setChannelLimit(const char * limit) -{ - m_szChannelLimit = limit; - updateModeLabel(); - updateCaption(); -} - -void KviChannel::addHighlightedUser(const char * nick) -{ - if(!m_pUserListView->findEntry(nick))return; - else - m_pTmpHighLighted->replace(nick,new QString()); -} - -void KviChannel::removeHighlightedUser(const char * nick) -{ - m_pTmpHighLighted->remove(nick); -} - -void KviChannel::getChannelModeString(QString &buffer) -{ - buffer = m_szChannelMode; - if(!m_szChannelKey.isEmpty())buffer.append('k'); - if(m_szChannelLimit.hasData())buffer.append('l'); -} - -void KviChannel::setDeadChan() -{ - m_iStateFlags |= KVI_CHANNEL_STATE_DEADCHAN; - m_iStateFlags &= ~(KVI_CHANNEL_STATE_NOCLOSEONPART | KVI_CHANNEL_STATE_SENTSYNCWHOREQUEST); - - m_pUserListView->enableUpdates(false); - m_pUserListView->partAll(); - m_pUserListView->enableUpdates(true); - m_pUserListView->setUserDataBase(0); - - m_pBanList->clear(); - m_pBanExceptionList->clear(); - m_pInviteList->clear(); - - m_pActionHistory->clear(); - m_uActionHistoryHotActionCount = 0; - - m_szChannelMode = ""; - m_szChannelKey = ""; - m_szChannelLimit = ""; - - // this should be moved to irc context! - connection()->unregisterChannel(this); - context()->registerDeadChannel(this); - - setType(KVI_WINDOW_TYPE_DEADCHANNEL); - - updateIcon(); - updateModeLabel(); - updateCaption(); -} - -void KviChannel::setAliveChan() -{ - // Rise like phoenix! - m_iStateFlags = 0; - setType(KVI_WINDOW_TYPE_CHANNEL); - m_pUserListView->setUserDataBase(connection()->userDataBase()); - m_joinTime = QDateTime::currentDateTime(); - context()->unregisterDeadChannel(this); - connection()->registerChannel(this); - // Update log file name - if(m_pIrcView->isLogging())m_pIrcView->startLogging(); - updateIcon(); - updateCaption(); - m_pTopicWidget->reset(); // reset the topic (fixes bug #20 signaled by Klaus Weidenbach) -} - -void KviChannel::getTalkingUsersStats(QString &buffer,QStringList &l,bool bPast) -{ - if(l.count() < 1)return; - - if(l.count() == 1) - { - buffer += "<b>"; - buffer += l.first(); - buffer += "</b>"; - buffer += " "; - buffer += bPast ? __tr2qs("said something recently") : __tr2qs("is talking"); - } else if(l.count() == 2) - { - buffer += "<b>"; - buffer += l.first(); - buffer += "</b> "; - buffer += __tr2qs("and"); - buffer += " <b>"; - l.remove(l.begin()); - buffer += l.first(); - buffer += "</b> "; - buffer += bPast ? __tr2qs("were talking recently") : __tr2qs("are talking"); - } else { - buffer += "<b>"; - buffer += l.first(); - buffer += "</b>, <b>"; - l.remove(l.begin()); - buffer += l.first(); - if(l.count() == 2) - { - buffer += "</b> "; - buffer += __tr2qs("and"); - buffer += " <b>"; - l.remove(l.begin()); - buffer += l.first(); - buffer += "</b>"; - } else { - // (l.count() - 1) is > 1 - buffer += "</b> "; - buffer += __tr2qs("and other %1 users").arg(l.count() - 1); - } - buffer += " "; - buffer += bPast ? __tr2qs("were talking recently") : __tr2qs("are talking"); - } -} - -void KviChannel::getTaskBarTipText(QString &buffer) -{ - static QString html_bold("<b>"); - static QString html_tab("  "); - static QString html_eofbold("</b> "); - static QString p5(" ("); - // p6 == p4 - static QString p7(" ("); - static QString p8(": "); - static QString p9(")"); - static QString p10("<br>"); - - static QString end_of_doc = "</table></body></html>"; - static QString end_of_fontboldrow = END_TABLE_BOLD_ROW; - static QString start_of_row = "<tr><td>"; - static QString end_of_row = "</td></tr>"; - - buffer = "<html>" \ - "<body>" \ - "<table width=\"100%\">"\ - START_TABLE_BOLD_ROW; - - if(m_iStateFlags & KVI_CHANNEL_STATE_DEADCHAN) - { - buffer += __tr2qs("Dead channel"); - buffer += end_of_fontboldrow; - buffer += end_of_doc; - return; - } - - KviUserListViewUserStats s; - m_pUserListView->userStats(&s); - - - buffer += m_szPlainTextCaption; - buffer += end_of_fontboldrow; - - buffer += start_of_row; - - QString op = __tr2qs("operator"); - QString ops = __tr2qs("operators"); - - ////////////////////// - - buffer += html_tab; - buffer += html_bold; - - QString num; - - num.setNum(s.uActive); - buffer += num; - - buffer += html_eofbold; - buffer += (s.uActive == 1 ? __tr2qs("active user") : __tr2qs("active users")); - - buffer += p5; - buffer += html_bold; - - num.setNum(s.uActiveOp); - - buffer += num; - buffer += html_eofbold; - buffer += (s.uActiveOp == 1 ? op : ops); - - buffer += p9; -/* - * #warning FIXME: What is this supposed to mean? - buffer += "<font size=\"-1\">"; - buffer += p7; - - buffer += __tr2qs("humanity"); - - buffer += p8; - buffer += html_bold; - - num.setNum(s.iAvgTemperature); - - buffer += num; - buffer += "</bold>"; - - buffer += p9; -*/ - buffer += p10; - buffer += "</font>"; - - - - ////////////////////// - - buffer += html_tab; - buffer += html_bold; - - num.setNum(s.uHot); - buffer += num; - - buffer += html_eofbold; - buffer += (s.uHot == 1 ? __tr2qs("hot user") : __tr2qs("hot users")); - - buffer += p5; - buffer += html_bold; - - num.setNum(s.uHotOp); - - buffer += num; - buffer += html_eofbold; - buffer += (s.uHotOp == 1 ? op : ops); - - buffer += p9; - - ///////////// - - buffer += end_of_row; - buffer += start_of_row; - - /////////////////// - - if(s.uChanOwner > 0) - { - buffer += html_tab; - buffer += html_bold; - num.setNum(s.uChanOwner); - buffer += num; - buffer += html_eofbold; - buffer += (s.uChanOwner == 1 ? __tr2qs("channel owner") : __tr2qs("channel owners")); - buffer += p10; - } - - if(s.uChanAdmin > 0) - { - buffer += html_tab; - buffer += html_bold; - num.setNum(s.uChanAdmin); - buffer += num; - buffer += html_eofbold; - buffer += (s.uChanAdmin == 1 ? __tr2qs("channel administrator") : __tr2qs("channel administrators")); - buffer += p10; - } - - if(s.uOp > 0) - { - buffer += html_tab; - buffer += html_bold; - num.setNum(s.uOp); - buffer += num; - buffer += html_eofbold; - buffer += (s.uOp == 1 ? op : ops); - buffer += p10; - } - - if(s.uHalfOp > 0) - { - buffer += html_tab; - buffer += html_bold; - num.setNum(s.uHalfOp); - buffer += num; - buffer += html_eofbold; - buffer += (s.uHalfOp == 1 ? __tr2qs("half-operator") : __tr2qs("half-operators")); - buffer += p10; - } - - if(s.uVoiced > 0) - { - buffer += html_tab; - buffer += html_bold; - num.setNum(s.uVoiced); - buffer += num; - buffer += html_eofbold; - buffer += (s.uVoiced == 1 ? __tr2qs("voiced user") : __tr2qs("voiced users")); - buffer += p10; - } - - if(s.uUserOp > 0) - { - buffer += html_tab; - buffer += html_bold; - num.setNum(s.uUserOp); - buffer += num; - buffer += html_eofbold; - buffer += (s.uUserOp == 1 ? __tr2qs("user-operator") : __tr2qs("user-operators")); - buffer += p10; - } - - buffer += html_tab; - buffer += html_bold; - num.setNum(s.uTotal); - buffer += num; - buffer += html_eofbold; - buffer += (s.uTotal == 1 ? __tr2qs("user total") : __tr2qs("users total")); - - buffer += end_of_row; - - KviChannelActivityStats cas; - getChannelActivityStats(&cas); - - - if(cas.lTalkingUsers.count() > 0) - { - if((cas.lTalkingUsers.count() < 3) && (cas.lWereTalkingUsers.count() > 0)) - { - buffer += "<tr><td bgcolor=\"#E0E0E0\">"; - getTalkingUsersStats(buffer,cas.lWereTalkingUsers,true); - buffer += end_of_row; - } - buffer += "<tr><td bgcolor=\"#E0E0E0\">"; - getTalkingUsersStats(buffer,cas.lTalkingUsers,false); - buffer += end_of_row; - } else { - if(cas.lWereTalkingUsers.count() > 0) - { - buffer += "<tr><td bgcolor=\"#E0E0E0\">"; - getTalkingUsersStats(buffer,cas.lWereTalkingUsers,true); - buffer += end_of_row; - } - } - - buffer += "<tr><td bgcolor=\"#A0A0A0\"><b>"; - - if(cas.dActionsPerMinute < 0.1)buffer += __tr2qs("No activity"); - else if(cas.dActionsPerMinute < 0.3)buffer += __tr2qs("Minimal activity"); - else if(cas.dActionsPerMinute < 1.0)buffer += __tr2qs("Very low activity"); - else if(cas.dActionsPerMinute < 3.0)buffer += cas.bStatsInaccurate ? __tr2qs("Might be low activity") : __tr2qs("Low activity"); - else if(cas.dActionsPerMinute < 10.0)buffer += cas.bStatsInaccurate ? __tr2qs("Might be medium activity") : __tr2qs("Medium activity"); - else if(cas.dActionsPerMinute < 30.0)buffer += cas.bStatsInaccurate ? __tr2qs("Might be high activity") : __tr2qs("High activity"); - else if(cas.dActionsPerMinute < 60.0)buffer += cas.bStatsInaccurate ? __tr2qs("Might be very high activity") : __tr2qs("Very high activity"); - else buffer += cas.bStatsInaccurate ? __tr2qs("Might be flooded with messages") : __tr2qs("Flooded with messages"); - - - if(cas.dActionsPerMinute >= 0.1) - { - QString num; - num.sprintf(" [%u%% ",cas.uHotActionPercent); - buffer += num; - buffer += __tr2qs("human"); - buffer += "]"; - } - - - buffer += "</b></td></tr>"; - - buffer += end_of_doc; -} - -void KviChannel::fillCaptionBuffers() -{ - static QString begin("<nobr><font color=\""); - static QString boldbegin("\"><b>"); - static QString endofbold("</b></font> <font color=\""); - static QString endoffont("\">"); - static QString end("</font></nobr>"); - - if(!connection()) - { - QString dead = __tr2qs("[Dead channel]"); - - m_szNameWithUserFlag = m_szName; - - m_szPlainTextCaption = m_szName; - m_szPlainTextCaption += " : "; - m_szPlainTextCaption += dead; - - m_szHtmlActiveCaption = begin; - m_szHtmlActiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name(); - m_szHtmlActiveCaption += boldbegin; - m_szHtmlActiveCaption += m_szName; - m_szHtmlActiveCaption += endofbold; - m_szHtmlActiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextActive2).name(); - m_szHtmlActiveCaption += endoffont; - m_szHtmlActiveCaption += dead; - m_szHtmlActiveCaption += end; - - m_szHtmlInactiveCaption = begin; - m_szHtmlInactiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name(); - m_szHtmlInactiveCaption += boldbegin; - m_szHtmlInactiveCaption += m_szName; - m_szHtmlInactiveCaption += endofbold; - m_szHtmlInactiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive2).name(); - m_szHtmlInactiveCaption += endoffont; - m_szHtmlInactiveCaption += dead; - m_szHtmlInactiveCaption += end; - return; - } - - char uFlag = getUserFlag(connection()->currentNickName()); - - - if(uFlag) - { - m_szNameWithUserFlag = QChar(uFlag); - m_szNameWithUserFlag += m_szName; - } else { - m_szNameWithUserFlag = m_szName; - } - - QString szChanMode; - getChannelModeString(szChanMode); - - m_szPlainTextCaption = m_szNameWithUserFlag; - if(!szChanMode.isEmpty()) - { - m_szPlainTextCaption += " (+"; - m_szPlainTextCaption += szChanMode; - m_szPlainTextCaption += QChar(')'); - } - - QString szNickOnServer = QChar('['); - szNickOnServer += connection()->currentNickName(); - szNickOnServer += __tr2qs(" on "); - szNickOnServer += connection()->currentServerName(); - szNickOnServer += QChar(']'); - - m_szPlainTextCaption += QChar(' '); - m_szPlainTextCaption += szNickOnServer; - - m_szHtmlActiveCaption = begin; - m_szHtmlActiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name(); - m_szHtmlActiveCaption += boldbegin; - m_szHtmlActiveCaption += m_szNameWithUserFlag; - m_szHtmlActiveCaption += endofbold; - m_szHtmlActiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextActive2).name(); - m_szHtmlActiveCaption += endoffont; - m_szHtmlActiveCaption += szNickOnServer; - m_szHtmlActiveCaption += end; - - m_szHtmlInactiveCaption = begin; - m_szHtmlInactiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name(); - m_szHtmlInactiveCaption += boldbegin; - m_szHtmlInactiveCaption += m_szNameWithUserFlag; - m_szHtmlInactiveCaption += endofbold; - m_szHtmlInactiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive2).name(); - m_szHtmlInactiveCaption += endoffont; - m_szHtmlInactiveCaption += szNickOnServer; - m_szHtmlInactiveCaption += end; -} - -void KviChannel::ownMessage(const QString &buffer) -{ - if(!connection())return; - - KviQCString szName = connection()->encodeText(windowName()); - KviQCString szData = encodeText(buffer); - const char * d = szData.data(); - if(!d)return; - -#ifdef COMPILE_CRYPT_SUPPORT - if(cryptSessionInfo()) - { - if(cryptSessionInfo()->bDoEncrypt) - { - if(*d != KVI_TEXT_CRYPTESCAPE) - { - KviStr encrypted; - cryptSessionInfo()->pEngine->setMaxEncryptLen(500 - szName.length()); - switch(cryptSessionInfo()->pEngine->encrypt(d,encrypted)) - { - case KviCryptEngine::Encrypted: - if(!connection()->sendFmtData("PRIVMSG %s :%s",szName.data(),encrypted.ptr()))return; - m_pConsole->outputPrivmsg(this,KVI_OUT_OWNPRIVMSGCRYPTED, - QString::null,QString::null,QString::null,buffer,KviConsole::NoNotifications); - break; - case KviCryptEngine::Encoded: - { - if(!connection()->sendFmtData("PRIVMSG %s :%s",szName.data(),encrypted.ptr()))return; - // ugly ,but we must redecode here - QString szRedecoded = decodeText(encrypted.ptr()); - m_pConsole->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG, - QString::null,QString::null,QString::null,szRedecoded,KviConsole::NoNotifications); - } - break; - default: // also case KviCryptEngine::EncryptError - { - QString szEngineError = cryptSessionInfo()->pEngine->lastError(); - output(KVI_OUT_SYSTEMERROR, - __tr2qs("The crypto engine was unable to encrypt the current message (%Q): %Q, no data sent to the server"), - &buffer,&szEngineError); - } - break; - } - userAction(connection()->currentNickName(),KVI_USERACTION_PRIVMSG); - return; - } else { - d++; //eat the escape code - QString tmp = buffer.right(buffer.length() - 1); - if(!connection()->sendFmtData("PRIVMSG %s :%s",szName.data(),d))return; - m_pConsole->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG,QString::null,QString::null,QString::null,tmp,KviConsole::NoNotifications); - userAction(connection()->currentNickName(),KVI_USERACTION_PRIVMSG); - return; - } - } - } -#endif - - if(connection()->sendFmtData("PRIVMSG %s :%s",szName.data(),d)) - { - m_pConsole->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG,QString::null,QString::null,QString::null,buffer,KviConsole::NoNotifications); - userAction(connection()->currentNickName(),KVI_USERACTION_PRIVMSG); - } -} - -void KviChannel::ownAction(const QString &buffer) -{ - if(!connection())return; - KviQCString szName = connection()->encodeText(m_szName); - KviQCString szData = encodeText(buffer); - const char * d = szData.data(); - if(!d)return; - if(!connection()->sendFmtData("PRIVMSG %s :%cACTION %s%c",szName.data(),0x01,d,0x01))return; - if(KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnMeAction,this,QString(d)))return; - QString szBuffer = "\r!nc\r"; - szBuffer += connection()->currentNickName(); - szBuffer += "\r "; - szBuffer += buffer; - outputMessage(KVI_OUT_ACTION,szBuffer); - userAction(connection()->currentNickName(),KVI_USERACTION_ACTION); -} - -bool KviChannel::nickChange(const QString &oldNick,const QString &newNick) -{ - bool bWasHere = m_pUserListView->nickChange(oldNick,newNick); - if(bWasHere)channelAction(newNick,KVI_USERACTION_NICK,kvi_getUserActionTemperature(KVI_USERACTION_NICK)); - return bWasHere; -} - -bool KviChannel::part(const QString &nick) -{ - bool bWasHere = m_pUserListView->part(nick); - if(bWasHere)channelAction(nick,KVI_USERACTION_PART,kvi_getUserActionTemperature(KVI_USERACTION_PART)); - return bWasHere; -} - - -#define KVI_CHANACTIVITY_LIMIT_ICE 5 -#define KVI_CHANACTIVITY_LIMIT_VERYCOLD 10 -#define KVI_CHANACTIVITY_LIMIT_COLD 20 -#define KVI_CHANACTIVITY_LIMIT_UNDEFINED 30 -#define KVI_CHANACTIVITY_LIMIT_HOT 50 -#define KVI_CHANACTIVITY_LIMIT_VERYHOT 70 - - -bool KviChannel::activityMeter(unsigned int * puActivityValue,unsigned int * puActivityTemperature) -{ - fixActionHistory(); - - unsigned int uHotActionPercent; - double dActionsPerMinute; - - if(m_pActionHistory->count() < 1) - { - // nothing is happening - uHotActionPercent = 0; - dActionsPerMinute = 0; - } else { - kvi_time_t tNow = kvi_unixTime(); - - KviChannelAction * a = m_pActionHistory->last(); - - double dSpan = (double)(tNow - a->tTime); - - if(m_pActionHistory->count() < KVI_CHANNEL_ACTION_HISTORY_MAX_COUNT) - { - if(m_joinTime.secsTo(QDateTime::currentDateTime()) < KVI_CHANNEL_ACTION_HISTORY_MAX_TIMESPAN) - { - // we can't exactly estimate - if(dSpan < 60.0)dSpan = 60.0; - } else { - // there are less actions at all or they have been pushed out because of the timespan - dSpan = KVI_CHANNEL_ACTION_HISTORY_MAX_TIMESPAN; - } - } // else the actions have been pushed out of the history because they were too much - - if(dSpan > 0.0) - dActionsPerMinute = (((double)(m_pActionHistory->count())) / (dSpan)) * 60.0; - else - dActionsPerMinute = (double)(m_pActionHistory->count()); // ??? - - uHotActionPercent = (m_uActionHistoryHotActionCount * 100) / (m_pActionHistory->count()); - } - - - if(dActionsPerMinute < 0.3)*puActivityValue = KVI_ACTIVITY_NONE; - else if(dActionsPerMinute < 1.0)*puActivityValue = KVI_ACTIVITY_VERYLOW; - else if(dActionsPerMinute < 4.0)*puActivityValue = KVI_ACTIVITY_LOW; - else if(dActionsPerMinute < 10.0)*puActivityValue = KVI_ACTIVITY_MEDIUM; - else if(dActionsPerMinute < 30.0)*puActivityValue = KVI_ACTIVITY_HIGH; - else *puActivityValue = KVI_ACTIVITY_VERYHIGH; - - if(uHotActionPercent < KVI_CHANACTIVITY_LIMIT_ICE)*puActivityTemperature = KVI_ACTIVITY_ICE; - else if(uHotActionPercent < KVI_CHANACTIVITY_LIMIT_VERYCOLD)*puActivityTemperature = KVI_ACTIVITY_VERYCOLD; - else if(uHotActionPercent < KVI_CHANACTIVITY_LIMIT_COLD)*puActivityTemperature = KVI_ACTIVITY_COLD; - else if(uHotActionPercent < KVI_CHANACTIVITY_LIMIT_UNDEFINED)*puActivityTemperature = KVI_ACTIVITY_UNDEFINED; - else if(uHotActionPercent < KVI_CHANACTIVITY_LIMIT_HOT)*puActivityTemperature = KVI_ACTIVITY_HOT; - else if(uHotActionPercent < KVI_CHANACTIVITY_LIMIT_VERYHOT)*puActivityTemperature = KVI_ACTIVITY_VERYHOT; - else *puActivityTemperature = KVI_ACTIVITY_FIRE; - - return true; -} - - -void KviChannel::channelAction(const QString &nick,unsigned int uActionType,int iTemperature) -{ - KviChannelAction * a = new KviChannelAction; - a->tTime = kvi_unixTime(); - a->uActionType = uActionType; - a->iTemperature = iTemperature; - a->szNick = nick; - - if(iTemperature > 0)m_uActionHistoryHotActionCount++; - - m_pActionHistory->append(a); - fixActionHistory(); -} - -void KviChannel::fixActionHistory() -{ - while(m_pActionHistory->count() > KVI_CHANNEL_ACTION_HISTORY_MAX_COUNT)m_pActionHistory->removeFirst(); - KviChannelAction * a = m_pActionHistory->last(); - if(!a)return; - - kvi_time_t tMinimum = a->tTime - KVI_CHANNEL_ACTION_HISTORY_MAX_TIMESPAN; - - KviChannelAction * act = m_pActionHistory->first(); - while(act && (act->tTime < tMinimum)) - { - if(act->iTemperature > 0)m_uActionHistoryHotActionCount--; - m_pActionHistory->removeFirst(); - act = m_pActionHistory->first(); - } -} - - -void KviChannel::lostUserFocus() -{ - KviWindow::lostUserFocus(); - if(!m_pMessageView)return; - if(m_pMessageView->hasLineMark())m_pMessageView->clearLineMark(true); -} - - -void KviChannel::getChannelActivityStats(KviChannelActivityStats * s) -{ - fixActionHistory(); - - s->uActionCount = m_pActionHistory->count(); - s->iAverageActionTemperature = 0; - s->uActionsInTheLastMinute = 0; - s->uHotActionCount = 0; - s->uHotActionPercent = 0; - s->bStatsInaccurate = false; - - if(s->uActionCount < 1) - { - // nothing is happening - s->uLastActionTimeSpan = 0; - s->uFirstActionTimeSpan = 0; - s->dActionsPerMinute = 0; - - return; - } - - kvi_time_t tNow = kvi_unixTime(); - - KviChannelAction * a = m_pActionHistory->last(); - s->uLastActionTimeSpan = tNow - a->tTime; - - a = m_pActionHistory->first(); - s->uFirstActionTimeSpan = tNow - a->tTime; - - double dSpan = (double)s->uFirstActionTimeSpan; - - if(s->uActionCount < KVI_CHANNEL_ACTION_HISTORY_MAX_COUNT) - { - if(m_joinTime.secsTo(QDateTime::currentDateTime()) < KVI_CHANNEL_ACTION_HISTORY_MAX_TIMESPAN) - { - // we can't exactly estimate - s->bStatsInaccurate = true; - if(dSpan < 60.0)dSpan = 60.0; - } else { - // there are less actions at all or they have been pushed out because of the timespan - dSpan = KVI_CHANNEL_ACTION_HISTORY_MAX_TIMESPAN; - } - } // else the actions have been pushed out of the history because they were too much - - if(dSpan > 0.0) - s->dActionsPerMinute = (((double)s->uActionCount) / (dSpan)) * 60.0; - else - s->dActionsPerMinute = (double)s->uActionCount; // ??? - - kvi_time_t tTwoMinsAgo = tNow; - tTwoMinsAgo-= 120; - tNow -= 60; - - KviPointerHashTable<QString,int> userDict; - userDict.setAutoDelete(false); - - int fake; - s->lTalkingUsers.clear(); - s->lWereTalkingUsers.clear(); - - for(a = m_pActionHistory->last();a;a = m_pActionHistory->prev()) - { - if(a->tTime >= tNow)s->uActionsInTheLastMinute++; - - if(a->iTemperature > 0)s->uHotActionCount++; - s->iAverageActionTemperature += a->iTemperature; - - if((a->uActionType == KVI_USERACTION_PRIVMSG) || - (a->uActionType == KVI_USERACTION_NOTICE) || - (a->uActionType == KVI_USERACTION_ACTION)) - { - if(!userDict.find(a->szNick)) - { - if(isOn(a->szNick.ascii())) - { - if(a->tTime >= tTwoMinsAgo)s->lTalkingUsers.append(a->szNick); - else s->lWereTalkingUsers.append(a->szNick); - userDict.insert(a->szNick,&fake); - } - } - } - } - - s->iAverageActionTemperature = s->iAverageActionTemperature / (int)s->uActionCount; - - s->uHotActionPercent = (s->uHotActionCount * 100) / s->uActionCount; -} - - - -void KviChannel::userAction(const QString &nick,const QString &user,const QString &host,unsigned int uActionType) -{ - int iTemperature = kvi_getUserActionTemperature(uActionType); - channelAction(nick,uActionType,iTemperature); - m_pUserListView->userAction(nick,user,host,iTemperature); -} - -void KviChannel::userAction(const QString &nick,unsigned int uActionType) -{ - int iTemperature = kvi_getUserActionTemperature(uActionType); - channelAction(nick,uActionType,iTemperature); - m_pUserListView->userAction(nick,iTemperature); -} - -void KviChannel::userAction(KviIrcMask * user,unsigned int uActionType) -{ - int iTemperature = kvi_getUserActionTemperature(uActionType); - channelAction(user->nick(),uActionType,iTemperature); - m_pUserListView->userAction(user,iTemperature); -} - -void KviChannel::topicSelected(const QString & topic) -{ - if(!connection())return; - KviQCString szEncoded = encodeText(topic); - KviQCString szName = connection()->encodeText(m_szName); - connection()->sendFmtData("TOPIC %s :%s",szName.data(),szEncoded.length() ? szEncoded.data() : ""); -} - -void KviChannel::closeEvent(QCloseEvent *e) -{ - if((m_iStateFlags & KVI_CHANNEL_STATE_SENTPART) || (m_iStateFlags & KVI_CHANNEL_STATE_DEADCHAN) || !(m_pConsole->isConnected())) - { - m_pContext->unregisterDeadChannel(this); - KviWindow::closeEvent(e); - } else { - e->ignore(); - // FIXME: #warning "THIS PART SHOULD BECOME A COMMAND /PART $option()..so the identifiers are parsed" - if(connection()) - { - QString tmp = KVI_OPTION_STRING(KviOption_stringPartMessage); - tmp.replace(";","\\;"); - tmp.replace("\n"," "); - KviKvsVariant vRet; - - if(KviKvsScript::evaluate(tmp,this,0,&vRet))vRet.asString(tmp); - - KviQCString dat = encodeText(tmp); - partMessageSent(); - KviQCString szName = connection()->encodeText(m_szName); - connection()->sendFmtData("PART %s :%s",szName.data(),dat.data() ? dat.data() : ""); - // be sure to not reference ourselves here.. we could be disconnected! - } else { - partMessageSent(); // huh ? - } - } -} - -void KviChannel::partMessageSent(bool bCloseOnPart,bool bShowMessage) -{ - m_iStateFlags |= KVI_CHANNEL_STATE_SENTPART; - if(!bCloseOnPart)m_iStateFlags |= KVI_CHANNEL_STATE_NOCLOSEONPART; - if(bShowMessage)outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Sent part request, waiting for reply...")); -} - -#define IS_FNC(__name,__ulvname) \ -bool KviChannel::__name(bool bAtLeast) \ -{ \ - if(!connection())return false; \ - return m_pUserListView->__ulvname(connection()->currentNickName(),bAtLeast); \ -} - -IS_FNC(isMeChanOwner,isChanOwner) -IS_FNC(isMeChanAdmin,isChanAdmin) -IS_FNC(isMeOp,isOp) -IS_FNC(isMeVoice,isVoice) -IS_FNC(isMeHalfOp,isHalfOp) -IS_FNC(isMeUserOp,isUserOp) - -int KviChannel::myFlags() -{ - if(!connection())return 0; - return m_pUserListView->flags(connection()->currentNickName()); -} - - -void KviChannel::setMask(char flag, const QString &mask,bool bAdd,const QString &setBy,unsigned int setAt) -{ - if(!connection())return; - KviPointerList<KviMaskEntry> * list = m_pBanList; - KviMaskEditor * editor = m_pBanEditor; - switch(flag) - { - case 'b': - m_iStateFlags ^= KVI_CHANNEL_STATE_HAVEBANLIST; - break; - case 'e': - m_iStateFlags ^= KVI_CHANNEL_STATE_HAVEBANEXCEPTIONLIST; - list = m_pBanExceptionList; - editor = m_pBanExceptionEditor; - break; - case 'I': - m_iStateFlags ^= KVI_CHANNEL_STATE_HAVEINVITELIST; - list = m_pInviteList; - editor = m_pInviteEditor; - break; - } - - internalMask(mask,bAdd,setBy,setAt,list,&editor); - m_pUserListView->setMaskEntries(flag,(int)list->count()); -} - -void KviChannel::internalMask(const QString &mask,bool bAdd,const QString &setBy,unsigned int setAt,KviPointerList<KviMaskEntry> *l,KviMaskEditor **ppEd) -{ - KviMaskEntry * e = 0; - if(bAdd) - { - for(e = l->first();e;e = l->next()) - { - if(KviQString::equalCI(e->szMask,mask))return; //already there - } - e = new KviMaskEntry; - e->szMask = mask; - e->szSetBy = (!setBy.isEmpty()) ? setBy : __tr2qs("(Unknown)"); - e->uSetAt = setAt; - l->append(e); - if(*ppEd)(*ppEd)->addMask(e); - } else { - for(e = l->first();e;e = l->next()) - { - if(KviQString::equalCI(e->szMask,mask))break; - } - if(e) - { - if(*ppEd)(*ppEd)->removeMask(e); - l->removeRef(e); - } - } -} - -void KviChannel::updateModeLabel() -{ - QString tmp = m_szChannelMode; - QString tip = __tr2qs("<b>Channel mode:</b>"); - //const char * aux = m_szChannelMode.utf8().data(); leaks memory and will not work with getChannelModeDescription() (can channel modes be multibyte ?) - KviStr mod = m_szChannelMode; - const char * aux = mod.ptr(); - while(*aux) - { - KviQString::appendFormatted(tip,"<br>%c: %Q",*aux,&(m_pConsole->connection()->serverInfo()->getChannelModeDescription(*aux))); - ++aux; - } - - if(!m_szChannelKey.isEmpty()) - { - if(!tmp.isEmpty())tmp.append(' '); - KviQString::appendFormatted(tmp,"k:%s",m_szChannelKey.utf8().data()); - KviQString::appendFormatted(tip,__tr2qs("<br><b>Key:</b> %s"),m_szChannelKey.utf8().data()); - } - - if(m_szChannelLimit.hasData()) - { - if(!tmp.isEmpty())tmp.append(' '); - KviQString::appendFormatted(tmp,"l:%s",m_szChannelLimit.ptr()); - KviQString::appendFormatted(tip,__tr2qs("<br><b>Limit:</b> %s"),m_szChannelLimit.ptr()); - } - - m_pModeWidget->refreshModes(); - KviTalToolTip::remove(m_pModeWidget); - KviTalToolTip::add(m_pModeWidget,tip); -} - -/* -void KviChannel::outputMessage(int msg_type,const char *format,...) -{ - kvi_wchar_t txt_ptr[512]; //It should be enough for all outputs... - kvi_va_list list; - kvi_va_start(list,format); - if(kvi_wvsnprintcf(txt_ptr,512,format,list) < 0){ - //Just in case... - kvi_va_end(list); - int len = 512; - kvi_wchar_t *long_txt_ptr = 0; - int result; - do{ - len += 512; - //first time long_txt_ptr == 0 so it is equivalent to malloc - //At least the man page says that... - long_txt_ptr = (kvi_wchar_t *)kvi_realloc((void *)long_txt_ptr,len * sizeof(kvi_wchar_t)); - kvi_va_start(list,format); - result = kvi_wvsnprintcf(long_txt_ptr,len,format,list); - kvi_va_end(list); - } while(result < 0); - internalOutput(m_pMessageView ? m_pMessageView : m_pIrcView,msg_type,long_txt_ptr); - kvi_free((void *)long_txt_ptr); - } else { - //Succesful vsnprintf - kvi_va_end(list); - internalOutput(m_pMessageView ? m_pMessageView : m_pIrcView,msg_type,txt_ptr); - } -} -*/ - -void KviChannel::outputMessage(int msg_type,const QString &msg) -{ - QString szBuf(msg); - preprocessMessage(szBuf); - const QChar * pC = KviQString::nullTerminatedArray(szBuf); - if(!pC)return; - internalOutput(m_pMessageView ? m_pMessageView : m_pIrcView,msg_type,(const kvi_wchar_t *)pC); -} - - - -void KviChannel::checkChannelSync() -{ - if(m_iStateFlags & KVI_CHANNEL_STATE_SYNCHRONIZED)return; - - if(m_iStateFlags & KVI_CHANNEL_STATE_SENTWHOREQUEST) - { - if(!(m_iStateFlags & KVI_CHANNEL_STATE_HAVEWHOLIST))return; - } - - if(m_iStateFlags & KVI_CHANNEL_STATE_SENTBANLISTREQUEST) - { - if(!(m_iStateFlags & KVI_CHANNEL_STATE_HAVEBANLIST))return; - } - - if(m_iStateFlags & KVI_CHANNEL_STATE_SENTBANEXCEPTIONLISTREQUEST) - { - if(!(m_iStateFlags & KVI_CHANNEL_STATE_HAVEBANEXCEPTIONLIST))return; - } - - if(m_iStateFlags & KVI_CHANNEL_STATE_SENTINVITELISTREQUEST) - { - if(!(m_iStateFlags & KVI_CHANNEL_STATE_HAVEINVITELIST))return; - } - - m_iStateFlags |= KVI_CHANNEL_STATE_SYNCHRONIZED; - // we already have all the spontaneous server replies - // (so probably mode, topic (or no topic is set),names) - // we have already received the I and e lists (if requested) - kvs_int_t iSyncTime = m_joinTime.time().msecsTo(QTime::currentTime()); - if(iSyncTime < 0)iSyncTime += 86400000; - - bool bStop = KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnChannelSync,this,iSyncTime); - - if(!bStop && KVI_OPTION_BOOL(KviOption_boolShowChannelSyncTime)) - { - output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Channel synchronized in %d.%d seconds"),iSyncTime / 1000,iSyncTime % 1000); - } -} - -bool KviChannel::eventFilter(QObject * o, QEvent * e) -{ - if(e->type() == QEvent::FocusOut && o == m_pTopicWidget && \ - m_pTopicWidget->isVisible()) - m_pTopicWidget->deactivate(); - - return KviWindow::eventFilter(o, e); -} - - -void KviChannel::preprocessMessage(QString & szMessage) -{ - QStringList strings = QStringList::split(" ",szMessage, TRUE); - for ( QStringList::Iterator it = strings.begin(); it != strings.end(); ++it ) { - if((*it).contains('\r')) continue; - QString tmp = KviMircCntrl::stripControlBytes(*it); - if( findEntry(*it) ) *it=QString("\r!n\r%1\r").arg(*it); - if(m_pConsole) - if(m_pConsole->connection()) - if(m_pConsole->connection()->serverInfo()->supportedChannelTypes().contains(tmp[0])) - if((*it)==tmp) - *it=QString("\r!c\r%1\r").arg(*it); - else - *it=QString("\r!c%1\r%2\r").arg(tmp).arg(*it); - } - szMessage=strings.join(" "); -} - -void KviChannel::unhighlight() -{ - if(!m_pTaskBarItem)return; - m_pTaskBarItem->unhighlight(); -} - -#include "kvi_channel.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_channel.h b/3.4.0/src/kvirc/ui/kvi_channel.h deleted file mode 100644 index cd06db5d09..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_channel.h +++ /dev/null @@ -1,313 +0,0 @@ -#ifndef _KVI_CHANNEL_H_ -#define _KVI_CHANNEL_H_ -//============================================================================= -// -// File : kvi_channel.h -// Creation date : Tue Aug 1 2000 01:42:00 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - - -#include "kvi_console.h" -#include "kvi_window.h" -#include "kvi_string.h" -#include "kvi_ircuserdb.h" -#include "kvi_pixmap.h" -#include "kvi_userlistview.h" -#include "kvi_time.h" -#include "kvi_modew.h" -#include "kvi_valuelist.h" - -#include <qdatetime.h> -#include "kvi_pointerhashtable.h" -#include <qstringlist.h> - -class KviConsole; -class QSplitter; -class QToolButton; -class KviTopicWidget; -class KviIrcMask; -class KviThemedLabel; -class KviTalHBox; - -#ifdef COMPILE_ON_WINDOWS - // windows compiler wants this instead of the forward decl - #include "kvi_maskeditor.h" -#else - typedef struct _KviMaskEntry KviMaskEntry; // kvi_maskeditor.h -#endif -class KviMaskEditor; -class KviModeEditor; - -#define KVI_CHANNEL_STATE_HAVEALLNAMES 1 -#define KVI_CHANNEL_STATE_HAVEBANLIST (1 << 1) -#define KVI_CHANNEL_STATE_HAVEWHOLIST (1 << 2) -#define KVI_CHANNEL_STATE_HAVEBANEXCEPTIONLIST (1 << 3) -#define KVI_CHANNEL_STATE_HAVEINVITELIST (1 << 4) -#define KVI_CHANNEL_STATE_DEADCHAN (1 << 5) - -#define KVI_CHANNEL_STATE_SENTBANLISTREQUEST (1 << 6) -#define KVI_CHANNEL_STATE_SENTBANEXCEPTIONLISTREQUEST (1 << 7) -#define KVI_CHANNEL_STATE_SENTINVITELISTREQUEST (1 << 8) -#define KVI_CHANNEL_STATE_SENTWHOREQUEST (1 << 9) - -#define KVI_CHANNEL_STATE_SENTPART (1 << 10) -#define KVI_CHANNEL_STATE_SYNCHRONIZED (1 << 11) - -#define KVI_CHANNEL_STATE_NOCLOSEONPART (1 << 12) - -#define KVI_CHANNEL_STATE_SENTSYNCWHOREQUEST (1 << 13) - -typedef struct _KviChannelAction -{ - QString szNick; // action source nick - unsigned int uActionType; // type of the action - kvi_time_t tTime; // time of the action - int iTemperature; // temperature of the action -} KviChannelAction; - -// this is the maximum count of actions that we keep in memory -#define KVI_CHANNEL_ACTION_HISTORY_MAX_COUNT 40 -// this is the timespan of the oldest action that we keep in memory -// 600 secs = 10 mins -#define KVI_CHANNEL_ACTION_HISTORY_MAX_TIMESPAN 600 - -typedef struct _KviChannelActivityStats -{ - unsigned int uActionCount; // number of actions in the history - bool bStatsInaccurate; // the stats are inaccurate because we have just joined the chan - unsigned int uLastActionTimeSpan; // the timespan between the last action and now - unsigned int uFirstActionTimeSpan; // the time span between the first and the last action - double dActionsPerMinute; // average number of actions per minute in the lastActionTimeSpan - unsigned int uActionsInTheLastMinute; // number of actions in the last minute - int iAverageActionTemperature; // the average chan temperature - unsigned int uHotActionCount; - unsigned int uHotActionPercent; - QStringList lTalkingUsers; // users that seem to be talking NOW - QStringList lWereTalkingUsers; -} KviChannelActivityStats; - -class KVIRC_API KviChannel : public KviWindow -{ - Q_OBJECT -public: - KviChannel(KviFrame * lpFrm,KviConsole * lpConsole,const char * name); - ~KviChannel(); -protected: - QSplitter * m_pTopSplitter; - QSplitter * m_pVertSplitter; - BUTTON_CLASS * m_pDoubleViewButton; - KviWindowToolPageButton * m_pListViewButton; - KviWindowToolPageButton * m_pBanEditorButton; - KviWindowToolPageButton * m_pBanExceptionEditorButton; - KviWindowToolPageButton * m_pInviteEditorButton; - KviWindowToolPageButton * m_pModeEditorButton; - KviMaskEditor * m_pBanEditor; - KviMaskEditor * m_pBanExceptionEditor; - KviMaskEditor * m_pInviteEditor; - KviModeEditor * m_pModeEditor; - KviIrcView * m_pMessageView; - KviTopicWidget * m_pTopicWidget; - KviUserListView * m_pUserListView; - KviModeWidget * m_pModeWidget; - int m_iStateFlags; - QString m_szChannelMode; - QString m_szChannelKey; - KviStr m_szChannelLimit; - KviPointerList<KviMaskEntry> * m_pBanList; - KviPointerList<KviMaskEntry> * m_pBanExceptionList; - KviPointerList<KviMaskEntry> * m_pInviteList; - KviPixmap m_privateBackground; - QDateTime m_joinTime; - QString m_szNameWithUserFlag; - KviPointerHashTable<const char *,QString> * m_pTmpHighLighted; - unsigned int m_uActionHistoryHotActionCount; - KviPointerList<KviChannelAction> * m_pActionHistory; - kvi_time_t m_tLastReceivedWhoReply; - KviValueList<int> m_VertSplitterSizesList; - KviTalHBox * m_pButtonContainer; -protected: - bool eventFilter(QObject *, QEvent *); - virtual QPixmap * myIconPtr(); - virtual void fillCaptionBuffers(); - virtual void resizeEvent(QResizeEvent *e); - virtual void closeEvent(QCloseEvent *e); -// virtual void fillContextPopup(KviTalPopupMenu * p); - virtual void getConfigGroupName(QString &buf); - virtual void saveProperties(KviConfig * cfg); - virtual void loadProperties(KviConfig * cfg); - virtual void applyOptions(); - virtual void getBaseLogFileName(QString &buffer); - virtual void triggerCreationEvents(); - void toggleEditor(KviMaskEditor ** ppEd,KviWindowToolPageButton ** ppBtn,KviPointerList<KviMaskEntry> *l,char flag,const char *edName); - void internalMask(const QString &mask,bool bAdd,const QString &setBy,unsigned int setAt,KviPointerList<KviMaskEntry> *l,KviMaskEditor **ppEd); - void checkChannelSync(); - void showDoubleView(bool bShow); - void fixActionHistory(); - void getTalkingUsersStats(QString &buffer,QStringList &l,bool bPast); -public: - void getChannelActivityStats(KviChannelActivityStats * s); - //void getChannelActivityStatsDescription(QString &buffer); - - KviPointerList<KviMaskEntry> * banList(){ return m_pBanList; }; - KviPointerList<KviMaskEntry> * banExceptionList(){ return m_pBanExceptionList; }; - KviPointerList<KviMaskEntry> * inviteList(){ return m_pInviteList; }; - - QString * firstSelectedNickname(){ return m_pUserListView->firstSelectedNickname(); }; - QString * nextSelectedNickname(){ return m_pUserListView->nextSelectedNickname(); }; - - int selectedCount(){ return m_pUserListView->selectedCount(); }; - int opCount(){ return m_pUserListView->opCount(); }; - int voiceCount(){ return m_pUserListView->voiceCount(); }; - int halfOpCount(){ return m_pUserListView->halfOpCount(); }; - int userOpCount(){ return m_pUserListView->userOpCount(); }; - int chanAdminCount(){ return m_pUserListView->chanAdminCount(); }; - int chanOwnerCount(){ return m_pUserListView->chanOwnerCount(); }; - unsigned int count(){ return m_pUserListView->count(); }; - - unsigned int banCount(){ return m_pBanList->count(); }; - unsigned int banExceptionCount(){ return m_pBanExceptionList->count(); }; - unsigned int inviteCount(){ return m_pInviteList->count(); }; - - const QString & nameWithUserFlag(){ return m_szNameWithUserFlag; }; - virtual const QString & target(){ return windowName(); }; -// void appendSelectedNicknames(KviStr &buffer); - void setMask(char flag, const QString &mask,bool bAdd,const QString &setBy,unsigned int setAt); - - kvi_time_t lastReceivedWhoReply(){ return m_tLastReceivedWhoReply; }; - void setLastReceivedWhoReply(kvi_time_t tTime){ m_tLastReceivedWhoReply = tTime; }; - void setSentSyncWhoRequest(){ m_iStateFlags |= KVI_CHANNEL_STATE_SENTSYNCWHOREQUEST; }; - void clearSentSyncWhoRequest(){ m_iStateFlags ^= KVI_CHANNEL_STATE_SENTSYNCWHOREQUEST; }; - bool sentSyncWhoRequest(){ return (m_iStateFlags & KVI_CHANNEL_STATE_SENTSYNCWHOREQUEST); }; - - bool sentWhoRequest(){ return (m_iStateFlags & KVI_CHANNEL_STATE_SENTWHOREQUEST); }; - void setSentWhoRequest(){ m_iStateFlags |= KVI_CHANNEL_STATE_SENTWHOREQUEST; }; - bool sentInviteListRequest(){ return (m_iStateFlags & KVI_CHANNEL_STATE_SENTINVITELISTREQUEST); }; - void setSentInviteListRequest(){ m_iStateFlags |= KVI_CHANNEL_STATE_SENTINVITELISTREQUEST; }; - void setInviteListDone(){ m_iStateFlags ^= KVI_CHANNEL_STATE_SENTINVITELISTREQUEST; }; - bool sentBanListRequest(){ return (m_iStateFlags & KVI_CHANNEL_STATE_SENTBANLISTREQUEST); }; - void setSentBanListRequest(){ m_iStateFlags |= KVI_CHANNEL_STATE_SENTBANLISTREQUEST; }; - void setBanListDone(){ m_iStateFlags ^= KVI_CHANNEL_STATE_SENTBANLISTREQUEST; }; - bool sentBanExceptionListRequest(){ return (m_iStateFlags & KVI_CHANNEL_STATE_SENTBANEXCEPTIONLISTREQUEST); }; - void setSentBanExceptionListRequest(){ m_iStateFlags |= KVI_CHANNEL_STATE_SENTBANEXCEPTIONLISTREQUEST; }; - void setBanExceptionListDone(){ m_iStateFlags ^= KVI_CHANNEL_STATE_SENTBANEXCEPTIONLISTREQUEST; }; - - bool hasAllNames(){ return (m_iStateFlags & KVI_CHANNEL_STATE_HAVEALLNAMES); }; - void setHasAllNames(){ m_iStateFlags |= KVI_CHANNEL_STATE_HAVEALLNAMES; checkChannelSync(); }; - bool hasInviteList(){ return (m_iStateFlags & KVI_CHANNEL_STATE_HAVEINVITELIST); checkChannelSync(); }; - void setHasInviteList(){ m_iStateFlags |= KVI_CHANNEL_STATE_HAVEINVITELIST; }; - bool hasWhoList(){ return (m_iStateFlags & KVI_CHANNEL_STATE_HAVEWHOLIST); }; - void setHasWhoList(){ m_iStateFlags |= KVI_CHANNEL_STATE_HAVEWHOLIST; checkChannelSync(); }; - bool hasBanList(){ return (m_iStateFlags & KVI_CHANNEL_STATE_HAVEBANLIST); }; - void setHasBanList(){ m_iStateFlags |= KVI_CHANNEL_STATE_HAVEBANLIST; checkChannelSync(); }; - bool hasBanExceptionList(){ return (m_iStateFlags & KVI_CHANNEL_STATE_HAVEBANEXCEPTIONLIST); }; - void setHasBanExceptionList(){ m_iStateFlags |= KVI_CHANNEL_STATE_HAVEBANEXCEPTIONLIST; checkChannelSync(); }; - - bool closeOnPart(){ return !(m_iStateFlags & KVI_CHANNEL_STATE_NOCLOSEONPART); }; - void partMessageSent(bool bCloseOnPart = true,bool bShowMessage = true); - - virtual bool activityMeter(unsigned int * puActivityValue,unsigned int * puActivityTemperature); - - void setDeadChan(); - void setAliveChan(); - void prependUserFlag(const QString &nick,QString &buffer){ m_pUserListView->prependUserFlag(nick,buffer); }; - char getUserFlag(const QString &nick){ return m_pUserListView->getUserFlag(nick); }; - bool isDeadChan(){ return (m_iStateFlags & KVI_CHANNEL_STATE_DEADCHAN); }; - virtual QSize sizeHint() const; - void enableUserListUpdates(bool bEnable){ m_pUserListView->enableUpdates(bEnable); }; - KviUserListEntry * join(const QString &nick,const QString &user = QString::null,const QString &host = QString::null,int iFlags = 0) - { return m_pUserListView->join(nick,user,host,iFlags); }; - bool op(const QString &nick,bool bOp){ return m_pUserListView->op(nick,bOp); }; - bool avatarChanged(const QString &nick){ return m_pUserListView->avatarChanged(nick); }; - bool voice(const QString &nick,bool bVoice){ return m_pUserListView->voice(nick,bVoice); }; - bool halfop(const QString &nick,bool bHalfOp){ return m_pUserListView->halfop(nick,bHalfOp); }; - bool userop(const QString &nick,bool bUserOp){ return m_pUserListView->userop(nick,bUserOp); }; - bool setChanOwner(const QString &nick,bool bChanOwner){ return m_pUserListView->setChanOwner(nick,bChanOwner); }; - bool setChanAdmin(const QString &nick,bool bChanAdmin){ return m_pUserListView->setChanAdmin(nick,bChanAdmin); }; - void userAction(KviIrcMask * user,unsigned int uActionType); - void userAction(const QString &nick,unsigned int uActionType); - void userAction(const QString &nick,const QString &user,const QString &host,unsigned int uActionType); - bool nickChange(const QString &oldNick,const QString &newNick); - void channelAction(const QString &nick,unsigned int uActionType,int iTemperature); - bool part(const QString &nick); - bool isOn(const QString &nick){ return (m_pUserListView->findEntry(nick) != 0); }; - KviUserListEntry * findEntry(const QString &nick){ return m_pUserListView->findEntry(nick); }; - KviUserListView * userListView(){ return m_pUserListView; }; - bool isMeOp(bool bAtLeast = false); - bool isMeChanOwner(bool bAtLeast = false); - bool isMeChanAdmin(bool bAtLeast = false); - bool isMeVoice(bool bAtLeast = false); - bool isMeHalfOp(bool bAtLeast = false); - bool isMeUserOp(bool bAtLeast = false); - bool isOp(const QString &nick,bool bAtLeast = false){ return m_pUserListView->isOp(nick,bAtLeast); }; - bool isVoice(const QString &nick,bool bAtLeast = false){ return m_pUserListView->isVoice(nick,bAtLeast); }; - bool isHalfOp(const QString &nick,bool bAtLeast = false){ return m_pUserListView->isHalfOp(nick,bAtLeast); }; - bool isUserOp(const QString &nick,bool bAtLeast = false){ return m_pUserListView->isUserOp(nick,bAtLeast); }; - bool isChanOwner(const QString &nick,bool bAtLeast = false){ return m_pUserListView->isChanOwner(nick,bAtLeast); }; - bool isChanAdmin(const QString &nick,bool bAtLeast = false){ return m_pUserListView->isChanAdmin(nick,bAtLeast); }; - int myFlags(); - void updateModeLabel(); - KviTopicWidget * topicWidget(){ return m_pTopicWidget; }; - virtual void outputMessage(int msg_type,const QString &msg); - void ownMessage(const QString &buffer); - void ownAction(const QString &buffer); - void setChannelMode(char mode,bool bAdd); - void setChannelKey(const char * key); - void setChannelLimit(const char * limit); - - void getChannelModeString(QString &buffer); - - KviStr & channelLimit(){ return m_szChannelLimit; }; - bool hasChannelLimit(){ return m_szChannelLimit.hasData(); }; - - bool hasChannelKey() { return !m_szChannelKey.isEmpty(); }; - QString & channelKey(){ return m_szChannelKey; }; - - void addHighlightedUser(const char * nick); - void removeHighlightedUser(const char * nick); - bool isHighlightedUser(const char * nick) { return m_pTmpHighLighted->find(nick); }; - KviIrcView * messageView() const { return m_pMessageView; }; - virtual void lostUserFocus(); - virtual void getTaskBarTipText(QString &buffer); - QString channelMode() { return m_szChannelMode; }; - - void unhighlight(); - - QFrame * buttonContainer() { return (QFrame*)m_pButtonContainer; }; -private slots: - void toggleDoubleView(); - void toggleListView(); - void toggleBanEditor(); - void toggleBanExceptionEditor(); - void toggleInviteEditor(); - void toggleModeEditor(); - void topicSelected(const QString & topic); - void setMode(const char * mode); - void modeSelectorDone(); - void textViewRightClicked(); - void removeMasks(KviMaskEditor *ed,KviPointerList<KviMaskEntry> *l); - void toggleToolButtons(); -protected: - virtual void preprocessMessage(QString & szMessage); -}; - -#endif //_KVI_CHANNEL_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_colorwin.cpp b/3.4.0/src/kvirc/ui/kvi_colorwin.cpp deleted file mode 100644 index 18e0751bce..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_colorwin.cpp +++ /dev/null @@ -1,122 +0,0 @@ -//============================================================================= -// -// File : kvi_colorwin.cpp -// Creation date : Wed Jan 6 1999 04:30:20 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_colorwin.h" -#include "kvi_app.h" -#include "kvi_options.h" - - -#include <qnamespace.h> -#include <qpainter.h> -#include <qstring.h> -#include <qevent.h> - - -KviColorWindow::KviColorWindow() -:QWidget(0,"toplevel_color_window",Qt::WType_Popup) -{ -#ifdef COMPILE_USE_QT4 - setFocusPolicy(Qt::NoFocus); -#else - setFocusPolicy(QWidget::NoFocus); -#endif - setBackgroundMode(Qt::NoBackground); - setFixedSize(146,38); - m_pOwner = 0; - QFont fnt = QFont(); - fnt.setStyleHint(QFont::TypeWriter); - fnt.setPointSize(10); - //QFont fnt("fixed",10); - setFont(fnt); - m_iTimerId = -1; -} - -KviColorWindow::~KviColorWindow() -{ - if(m_iTimerId != -1) - killTimer(m_iTimerId); -// if(m_pOwner)m_pOwner->setFocus(); -} - -void KviColorWindow::popup(QWidget *owner) -{ - m_pOwner = owner; - show(); -} - - -void KviColorWindow::paintEvent(QPaintEvent *) -{ - static int clrIdx[16]={ 1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1 }; - QPainter p(this); - - for(int i=0;i<16;i++) - { - p.fillRect((i % 8) * 18,(i / 8) * 18,18,18,KVI_OPTION_MIRCCOLOR(i)); - p.setPen(KVI_OPTION_MIRCCOLOR(clrIdx[i])); - KviStr szI(KviStr::Format,"%d",i); - p.drawText((i % 8) * 18,(i / 8) * 18,18,18,Qt::AlignVCenter | Qt::AlignHCenter,szI.ptr()); - } -} - -void KviColorWindow::keyPressEvent(QKeyEvent *e) -{ - if(m_iTimerId != -1) - killTimer(m_iTimerId); - hide(); - if(m_pOwner)g_pApp->sendEvent(m_pOwner,e); -} - -void KviColorWindow::mousePressEvent(QMouseEvent *e) -{ - QString str; - int key=e->x()/18; - if (e->x()<36 && e->y()>18) key +=8; - if (e->x()>36 && e->y()>18) key -=2; - int ascii=key+48; - str.setNum(key); - if (e->x()>36 && e->y()>18) - if(m_pOwner) g_pApp->sendEvent(m_pOwner,new QKeyEvent(QEvent::KeyPress,Qt::Key_1,49,Qt::NoButton,"1")); - if(m_pOwner) g_pApp->sendEvent(m_pOwner,new QKeyEvent(QEvent::KeyPress,key,ascii,Qt::NoButton,str)); - if(m_iTimerId != -1) - killTimer(m_iTimerId); - hide(); -} -void KviColorWindow::show() -{ - m_iTimerId = startTimer(10000); //10 sec ...seems enough - QWidget::show(); -} - -void KviColorWindow::timerEvent(QTimerEvent *) -{ - if(m_iTimerId != -1) - killTimer(m_iTimerId); - hide(); -} - - -#include "kvi_colorwin.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_colorwin.h b/3.4.0/src/kvirc/ui/kvi_colorwin.h deleted file mode 100644 index f879cec590..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_colorwin.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _KVI_COLORWIN_H_ -#define _KVI_COLORWIN_H_ -// -// File : kvi_colorwin.h -// Creation date : Wed Jan 6 1999 04:27:45 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qwidget.h> - -class KVIRC_API KviColorWindow : public QWidget -{ - Q_OBJECT -public: - KviColorWindow(); - ~KviColorWindow(); -private: - QWidget *m_pOwner; - int m_iTimerId; -public: - void popup(QWidget *owner); -private: - virtual void show(); - virtual void paintEvent(QPaintEvent *); - virtual void keyPressEvent(QKeyEvent *e); - virtual void mousePressEvent(QMouseEvent *); - virtual void timerEvent(QTimerEvent *); -}; - -#endif //_KVI_COLORWIN_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_console.cpp b/3.4.0/src/kvirc/ui/kvi_console.cpp deleted file mode 100644 index 0f183d4a9c..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_console.cpp +++ /dev/null @@ -1,1274 +0,0 @@ -//============================================================================= -// -// File : kvi_console.cpp -// Creation date : Sun Jun 25 2000 15:01:34 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - - -// FIXME: The TextEncoding should be inherited from network! - -#define __KVIRC__ - -#include "kvi_ircurl.h" -#include "kvi_app.h" -#include "kvi_console.h" -#include "kvi_frame.h" -#include "kvi_iconmanager.h" -#include "kvi_options.h" -#include "kvi_locale.h" -#include "kvi_ircview.h" -#include "kvi_mirccntrl.h" -#include "kvi_input.h" -#include "kvi_error.h" -#include "kvi_proxydb.h" -#include "kvi_netutils.h" -#include "kvi_ircserver.h" -#include "kvi_ircserverdb.h" -#include "kvi_dns.h" -#include "kvi_defaults.h" -#include "kvi_ircuserdb.h" -#include "kvi_channel.h" -#include "kvi_query.h" -#include "kvi_parameterlist.h" -#include "kvi_regusersdb.h" -#include "kvi_userlistview.h" -#include "kvi_out.h" -#include "kvi_config.h" -#include "kvi_irctoolbar.h" -#include "kvi_internalcmd.h" -#include "kvi_sparser.h" -#include "kvi_themedlabel.h" -#include "kvi_garbage.h" -#include "kvi_modulemanager.h" -#include "kvi_fileutils.h" -#include "kvi_irctoolbar.h" -#include "kvi_time.h" -#include "kvi_mexlinkfilter.h" -#include "kvi_avatarcache.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_ircconnectionserverinfo.h" -#include "kvi_ircconnectionstatedata.h" -#include "kvi_ircconnectiontarget.h" -#include "kvi_ircconnectionstatistics.h" -#include "kvi_asynchronousconnectiondata.h" -#include "kvi_ircdatastreammonitor.h" -#include "kvi_toolwindows_container.h" -#include "kvi_msgbox.h" - -#ifdef COMPILE_SSL_SUPPORT - #include "kvi_sslmaster.h" -#endif - -#include "kvi_kvs_script.h" -#include "kvi_kvs_eventtriggers.h" - -#include <qsplitter.h> -#include <qtoolbar.h> -#include <qtoolbutton.h> -#include <qtimer.h> -#include "kvi_tal_hbox.h" -#include "kvi_tal_popupmenu.h" -#include <qmessagebox.h> -#include <qstringlist.h> - -#ifdef COMPILE_USE_QT4 - #include <q3mimefactory.h> -#endif - -#define __KVI_DEBUG__ -#include "kvi_debug.h" - - -extern KVIRC_API KviIrcServerDataBase * g_pIrcServerDataBase; -extern KVIRC_API KviProxyDataBase * g_pProxyDataBase; -extern KVIRC_API KviGarbageCollector * g_pGarbageCollector; - -// %tmp[] = $str.grep("test",%array[]) - -KviConsole::KviConsole(KviFrame * lpFrm,int iFlags) -#ifdef COMPILE_ON_WINDOWS -: KviWindow(KVI_WINDOW_TYPE_CONSOLE,lpFrm,"CONSOLE",0) -#else -: KviWindow(KVI_WINDOW_TYPE_CONSOLE,lpFrm,"CONSOLE",this) -#endif -{ - m_pConsole = this; - m_pContext = new KviIrcContext(this); - - m_iFlags = iFlags; - if(m_pContext->id() == 1) - { - m_iFlags |= KVI_CONSOLE_FLAG_FIRSTINAPP; - } - - m_pButtonBox = new KviTalHBox(this); - m_pButtonBox->setSpacing(0); - m_pButtonBox->setMargin(0); - new QLabel(__tr2qs("Address:"),m_pButtonBox,"url_label"); - m_pAddressEdit = new QComboBox(m_pButtonBox,"url_editor"); - m_pAddressEdit->setAutoCompletion(true); - m_pAddressEdit->setDuplicatesEnabled(false); - m_pAddressEdit->setEditable(true); - m_pAddressEdit->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_URL))); - recentUrlsChanged(); - m_pAddressEdit->setCurrentText(""); - m_pAddressEdit->setInsertionPolicy(QComboBox::NoInsertion); - m_pAddressEdit->setMinimumHeight(24); //icon is 16px, + margins - m_pButtonBox->setStretchFactor(m_pAddressEdit,1); -#ifdef COMPILE_USE_QT4 - m_pButtonBox->setObjectName( QLatin1String( "kvi_window_button_box" ) ); -#endif - KviTalToolTip::add(m_pAddressEdit,__tr2qs("Current IRC URI")); - connect(m_pAddressEdit,SIGNAL(activated(const QString & )),this,SLOT(ircUriChanged(const QString & ))); - connect(g_pApp,SIGNAL(recentUrlsChanged()),this,SLOT(recentUrlsChanged())); - - - m_pSplitter = new QSplitter(Qt::Horizontal,this,"splitter"); - m_pIrcView = new KviIrcView(m_pSplitter,lpFrm,this); - connect(m_pIrcView,SIGNAL(rightClicked()),this,SLOT(textViewRightClicked())); - - // FIXME: #warning "If notify list is disabled avoid to show this" - // FIXME: #warning "Button to show/hide the notifyListView (NOT DELETE RE_CREATE!)" - // The userlist on the right - //m_pEditorsContainer= new KviToolWindowsContainer(m_pSplitter); - m_pNotifyViewButton = new KviWindowToolPageButton(KVI_SMALLICON_HIDELISTVIEW,KVI_SMALLICON_SHOWLISTVIEW,__tr2qs("Notify List"),buttonContainer(),true,"list_view_button"); - connect(m_pNotifyViewButton,SIGNAL(clicked()),this,SLOT(toggleNotifyView())); - - m_pNotifyListView = new KviUserListView(m_pSplitter,m_pNotifyViewButton,0,this,19,__tr2qs("Notify List"),"notify_list_view"); - - m_pInput = new KviInput(this,m_pNotifyListView); - - if(KVI_OPTION_BOOL(KviOption_boolAutoLogConsole))m_pIrcView->startLogging(); - -} - - -int KviConsole::selectedCount() -{ - return m_pNotifyListView->selectedCount(); -} - -void KviConsole::recentUrlsChanged(){ - QString cur = m_pAddressEdit->currentText(); - m_pAddressEdit->clear(); - for ( - QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistRecentIrcUrls).begin(); - it != KVI_OPTION_STRINGLIST(KviOption_stringlistRecentIrcUrls).end(); - ++it - ) { - m_pAddressEdit->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_URL)),*it); - } - m_pAddressEdit->setCurrentText(cur); -} - -bool KviConsole::isNotConnected() -{ - return (context()->state() == KviIrcContext::Idle); -} - -bool KviConsole::connectionInProgress() -{ - if(context()->asynchronousConnectionData() != 0)return true; - if(context()->state() != KviIrcContext::Idle)return true; - return false; -} - - -KviConsole::~KviConsole() -{ - // FIXME: #warning "WARNING : THIS SHOULD BECOME A COMMAND /QUIT $option() so the idents are parsed!" - - // Force connection close: it will just return if no connection is present - context()->terminateConnectionRequest(true); - - KVS_TRIGGER_EVENT_0(KviEvent_OnIrcContextDestroyed,this); - - if(g_pFrame->consoleCount() <= 1) - { - KVS_TRIGGER_EVENT_0(KviEvent_OnFrameWindowDestroyed,this); - KVS_TRIGGER_EVENT_0(KviEvent_OnKVIrcShutdown,this); - } - - //if(m_pLastIrcServer)delete m_pLastIrcServer; - - delete m_pContext; - m_pContext = 0; -} - -KviIrcSocket * KviConsole::socket() -{ - return connection() ? connection()->socket() : 0; -} - -unsigned int KviConsole::ircContextId() -{ - return m_pContext->id(); -} - -QString KviConsole::currentNetworkName() -{ - return (connection() ? connection()->networkName() : QString::null); -} - - -void KviConsole::triggerCreationEvents() -{ - if(m_iFlags & KVI_CONSOLE_FLAG_FIRSTINAPP) // this is the first context in the application - { - KVS_TRIGGER_EVENT_0(KviEvent_OnKVIrcStartup,this); - - if(KVI_OPTION_BOOL(KviOption_boolShowTipAtStartup)) - g_pFrame->executeInternalCommand(KVI_INTERNALCOMMAND_TIP_OPEN); - } - - if(m_iFlags & KVI_CONSOLE_FLAG_FIRSTINFRAME) - { - KVS_TRIGGER_EVENT_0(KviEvent_OnFrameWindowCreated,this); - } - - KVS_TRIGGER_EVENT_0(KviEvent_OnIrcContextCreated,this); -} - - -void KviConsole::fillContextPopup(KviTalPopupMenu * p) -{ - int id; - int cc = 0; - int qc = 0; - // FIXME: add items to close dead queries and channels ? - if(connection()) - { - cc = channelCount(); - qc = queryCount(); - p->insertSeparator(); - id = p->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)),__tr2qs("Part All Channels"),connection(),SLOT(partAllChannels())); - if(!cc)p->setItemEnabled(id,false); - id = p->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_QUERY)),__tr2qs("Close All Queries"),connection(),SLOT(closeAllQueries())); - if(!qc)p->setItemEnabled(id,false); - } - - p->insertSeparator(); - p->insertItem(__tr2qs("Unhighlight All Windows"),context(),SLOT(unhighlightAllWindows())); - if(connection()) - { - id = p->insertItem(__tr2qs("Unhighlight All Channels"),connection(),SLOT(unhighlightAllChannels())); - if(!cc)p->setItemEnabled(id,false); - id = p->insertItem(__tr2qs("Unhighlight All Queries"),connection(),SLOT(unhighlightAllQueries())); - if(!qc)p->setItemEnabled(id,false); - } -} - -void KviConsole::completeChannel(const QString &word,KviPointerList<QString> * matches) -{ - // FIXME: first look in our context ? - /* - if(!connection())return; - for(KviChannel * c = connection()->channelList()->first();c;c = connection()->channelList()->next()) - { - if(kvi_strEqualCIN(c->windowName(),word.ptr(),word.len()))matches->append(new KviStr((*it) - } - */ - QStringList *pList = g_pApp->getRecentChannels(currentNetworkName()); - if(pList) - { - for(QStringList::Iterator it = pList->begin(); it != pList->end(); ++it) - { - if(KviQString::equalCIN((*it),word,word.length()))matches->append(new QString(*it)); - } - } -} - -void KviConsole::completeServer(const QString &word, KviPointerList<QString> * matches) -{ - for(QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers).begin(); it != KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers).end(); ++it) - { - QString srv((*it)); - - KviQString::cutToFirst(srv,'/'); - while(srv.startsWith("/"))srv.remove(0,1); - KviQString::cutFromLast(srv,':'); - //We should have a full server name here, without the irc:// and without the port - if(KviQString::equalCIN(srv,word,word.length())) - { - matches->append(new QString(srv)); - } - - } -} - -void KviConsole::getUserTipText(const QString &nick,KviIrcUserEntry *e,QString &buffer) -{ - KviRegisteredMask *u = g_pRegisteredUserDataBase->findMatchingMask(nick,e->user(),e->host()); - - buffer = "<table width=\"100%\">" \ - "<tr><td bgcolor=\"#303030\">" \ - "<center><font color=\"#FFFFFF\"><b>"; - - buffer += nick; - buffer += "!"; - buffer += e->user().isEmpty() ? QString("*") : e->user(); - buffer += "@"; - buffer += e->host().isEmpty() ? QString("*") : e->host(); - - - buffer += "</b></font></center></td></tr>"; - if(u) - { - QString szComment=u->user()->getProperty("comment"); - if(!szComment.isEmpty()) - { - buffer += "<tr bgcolor=\"#F0F0F0\"><td><center><font size=\"-1\">("; - buffer += szComment; - buffer += ")</font></center></td></tr>"; - } - } - if(e->avatar()) - { -#ifdef COMPILE_USE_QT4 - Q3MimeSourceFactory::defaultFactory()->setPixmap("ulv_avatar",*(e->avatar()->pixmap())); -#else - QMimeSourceFactory::defaultFactory()->setPixmap("ulv_avatar",*(e->avatar()->pixmap())); -#endif - buffer += QString("<tr><td><center><img src=\"ulv_avatar\" width=\"%1\"></center></td></tr>").arg(e->avatar()->pixmap()->width()); - } - - if(e->hasRealName()) - { - buffer += "<tr><td><center><b>"; - buffer += KviMircCntrl::stripControlBytes(e->realName()); - buffer += "</b></center></td></tr>"; - } - - if(e->gender()!=KviIrcUserEntry::Unknown) - { - buffer += "<tr><td>"; - buffer += __tr2qs("Gender:"); - buffer += " "; - buffer += (e->gender()==KviIrcUserEntry::Male) ? __tr2qs("Male") : __tr2qs("Female"); - buffer += "</td></tr>"; - } - - if(u) - { - QString mask; - u->mask()->mask(mask); - buffer += "<tr bgcolor=\"#F0F0F0\"><td>"; - buffer += __tr2qs("Registered as"); - buffer += " <b>"; - buffer += u->user()->name(); - buffer += "</b>; Group "; - buffer += u->user()->group(); - buffer += "</td></tr><tr bgcolor=\"#F0F0F0\"><td><font size=\"-1\">"; - buffer += __tr2qs("(Matched by"); - buffer += " "; - buffer += mask; - buffer += ")</td></tr>"; - } - - if(connection()) - { - QString chans; - if(connection()->getCommonChannels(nick,chans,false)) - { - buffer += "<tr><td bgcolor=\"#F0F0F0\">"; - buffer += __tr2qs("On <b>"); - buffer += chans; - buffer += "</b></td></tr>"; - } - } - - if(e->hasServer()) - { - buffer += "<tr><td bgcolor=\"#F0F0F0\"><nobr>"; - buffer += __tr2qs("Using server <b>%1</b>").arg(e->server()); - - if(e->hasHops()) - { - buffer += " ("; - buffer += __tr2qs("%1 hops").arg(e->hops()); - buffer += ")</nobr></td></tr>"; - } else { - buffer += "</nobr></td></tr></table>"; - } - } - - if(e->isAway()) - { - buffer += "<tr><td bgcolor=\"#F0F0F0\">"; - buffer += __tr2qs("Probably Away"); - buffer += "</td></tr>"; - } -} - - -void KviConsole::toggleNotifyView() -{ - showNotifyList(!m_pNotifyListView->isVisible()); -} - -void KviConsole::executeInternalCommand(int index) -{ - KviKvsScript::run(kvi_getInternalCommandBuffer(index),this); -} - -void KviConsole::saveProperties(KviConfig *cfg) -{ - KviWindow::saveProperties(cfg); - cfg->writeEntry("Splitter",m_pSplitter->sizes()); - cfg->writeEntry("NotifyListViewVisible",m_pNotifyListView->isVisible()); - -} - -void KviConsole::getBaseLogFileName(QString &buffer) -{ - buffer=QString("CONSOLE%1").arg(ircContextId()); -} - -void KviConsole::showNotifyList(bool bShow) -{ - if(!bShow) - { - m_pNotifyListView->hide(); - if(m_pNotifyViewButton->isOn())m_pNotifyViewButton->setOn(false); - } else { - m_pNotifyListView->show(); - if(!(m_pNotifyViewButton->isOn()))m_pNotifyViewButton->setOn(true); - } -} - -void KviConsole::loadProperties(KviConfig *cfg) -{ - int w = width(); - KviValueList<int> def; - def.append((w * 85) / 100); - def.append((w * 15) / 100); - KviValueList<int> cur = cfg->readIntListEntry("Splitter",def); - // check the size correctness - if(cur.count() != 2)cur = def; - else { - int i1 = cur[0]; - int i2 = cur[1]; - if(i1 < i2)cur = def; - } - m_pSplitter->setSizes(cur); - KviWindow::loadProperties(cfg); - showNotifyList(cfg->readBoolEntry("NotifyListViewVisible",false)); -} - -void KviConsole::textViewRightClicked() -{ - KVS_TRIGGER_EVENT_0(KviEvent_OnConsolePopupRequest,this); -} - - -KviWindow * KviConsole::activeWindow() -{ - if(!g_pActiveWindow)return this; - if(g_pActiveWindow->console() == this)return g_pActiveWindow; - return this; -} - -void KviConsole::ircUriChanged(const QString & text){ - if(KviIrcUrl::run(text,KviIrcUrl::CurrentContext,this) & KviIrcUrl::InvalidProtocol) - { - KviMessageBox::warning(__tr2qs("KVIrc can accept only irc://, irc6://, ircs:// or irc6s:// URL's\n" - "Your URL is invalid. Check spelling and try again")); - } -} - -void KviConsole::updateUri() -{ - QString uri; - if(connection()) - { - KviIrcServer* server = connection()->target()->server(); - if(server) - { - KviIrcUrl::join(uri,server); - KviChannel * last =connection()->channelList()->last(); - for(KviChannel * c = connection()->channelList()->first();c;c = connection()->channelList()->next()) - { - uri.append(c->name()); - if(c->hasChannelKey()) { - uri.append("?"); - uri.append(c->channelKey()); - } - if(c!=last) uri.append(","); - } - } - } - m_pAddressEdit->setCurrentText(uri); -} - -void KviConsole::connectionAttached() -{ - //need to update URI - connect(m_pContext->connection(),SIGNAL(chanListChanged()),this,SLOT(updateUri())); - updateUri(); - m_pNotifyListView->setUserDataBase(connection()->userDataBase()); -} - -void KviConsole::connectionDetached() -{ - //need to update URI? - m_pNotifyListView->partAll(); - m_pNotifyListView->setUserDataBase(0); // this is rather for crash tests -} - -bool KviConsole::isIpV6Connection() -{ - __range_valid(connection()); - return connection()->server()->isIpV6(); -} - -void KviConsole::closeEvent(QCloseEvent *e) -{ - if(g_pFrame->consoleCount() > 1) - { - // there are other consoles beside this one - if(context()->state() == KviIrcContext::Connected) - { - if(!KVI_OPTION_BOOL(KviOption_boolAlwaysDisconnectClosingConnectedConsole)) - { - switch(QMessageBox::warning(this, - __tr2qs("Confirmation - KVIrc"), - __tr2qs("You have just attempted to close a console window with an active connection inside.\n" \ - "Are you sure you wish to terminate the connection?"), - __tr2qs("&Always"), - __tr2qs("&Yes"), - __tr2qs("&No"), - 2,2)) - { - case 0: - KVI_OPTION_BOOL(KviOption_boolAlwaysDisconnectClosingConnectedConsole) = true; - break; - case 1: - // nothing here - break; - default: // 2 = no - return; - break; - } - } - // ask the context to terminate the connection gracefully - context()->terminateConnectionRequest(false); - // the close event will recall terminateConnectionRequest() - // to brutally interrupt it in a while - } - - // just close - KviWindow::closeEvent(e); - return; - } - - // this is the only console... ask if the user really wants to quit KVirc - if(!KVI_OPTION_BOOL(KviOption_boolAlwaysQuitKVIrcClosingLastConsole)) - { - switch(QMessageBox::warning(this, - __tr2qs("Confirmation - KVIrc"), - __tr2qs("You have just attempted to close the last console window.\nAre you sure you wish to quit KVIrc?"), - __tr2qs("&Always"), - __tr2qs("&Yes"), - __tr2qs("&No"), - 2,2)) - { - case 0: - KVI_OPTION_BOOL(KviOption_boolAlwaysQuitKVIrcClosingLastConsole) = true; - break; - case 1: - // nothing here - break; - default: // 2 = no - return; - break; - } - } - - g_pApp->quit(); -} - -// internal helper for applyHighlighting -int KviConsole::triggerOnHighlight(KviWindow *wnd,int type,const QString &nick,const QString &user,const QString &host,const QString &szMsg,const QString &trigger) -{ - if(!KVI_OPTION_STRING(KviOption_stringOnHighlightedMessageSound).isEmpty() && wnd!=g_pActiveWindow) KviKvsScript::run("snd.play $0",0,new KviKvsVariantList(new KviKvsVariant(KVI_OPTION_STRING(KviOption_stringOnHighlightedMessageSound)))); - QString szMessageType; - KviQString::sprintf(szMessageType,"%d",type); - if(KVS_TRIGGER_EVENT_7_HALTED(KviEvent_OnHighlight, - wnd,nick,user,host, - szMsg,trigger, - szMessageType,(type == KVI_OUT_ACTION))) - return -1; - return KVI_OUT_HIGHLIGHT; -} - -// if it returns -1 you should just return and not display the message -int KviConsole::applyHighlighting(KviWindow *wnd,int type,const QString &nick,const QString &user,const QString &host,const QString &szMsg) -{ - QString szPattern=KVI_OPTION_STRING(KviOption_stringWordSplitters); - QString szSource; - QString szStripMsg=KviMircCntrl::stripControlBytes(szMsg); - QChar* aux=(QChar*)(szStripMsg.ucs2()); - if(aux) - { - while(aux->unicode()) - { - if( KVI_OPTION_STRING(KviOption_stringWordSplitters).find(*aux) > -1 ) - szSource.append(' '); - else - szSource.append(*aux); - aux++; - } - } else { - szSource=szStripMsg; - } - szSource.append(' '); - szSource.prepend(' '); - if(KVI_OPTION_BOOL(KviOption_boolAlwaysHighlightNick) && connection()) - { - if(szSource.find(QString(" %1 ").arg(connection()->userInfo()->nickName()),0,false) > -1) - return triggerOnHighlight(wnd,type,nick,user,host,szMsg,connection()->userInfo()->nickName()); - } - - if(KVI_OPTION_BOOL(KviOption_boolUseWordHighlighting)) - { - for(QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistHighlightWords).begin(); - it != KVI_OPTION_STRINGLIST(KviOption_stringlistHighlightWords).end() ; ++it) - { - if((*it).isEmpty()) - continue; - // FIXME : This is SLOOOOOOOOW (QString -> ascii translation!!) !!!! - if(szSource.find(QString(" %1 ").arg(*it),0,false) > -1) - { - return triggerOnHighlight(wnd,type,nick,user,host,szMsg,*it); - } - } - } - - if(wnd->type() == KVI_WINDOW_TYPE_CHANNEL) - { - if(((KviChannel *)wnd)->isHighlightedUser(nick)) - return triggerOnHighlight(wnd,type,nick,user,host,szMsg,nick); - - // FIXME: this is for userhighlighing - // maybe mark the users as highlighted in the console user database - // and then lookup them there ? this would be potentially a lot faster - KviRegisteredUser * u = connection()->userDataBase()->registeredUser(nick,user,host); - - // note that we're highlighting users only in channels since - // in a query (or DCC) highlighting the remote end is senseless. - if(u) - { - if(u->getBoolProperty("highlight")) - return triggerOnHighlight(wnd,type,nick,user,host,szMsg,nick); - } - } - - return type; -} - -#define KVI_NUM_NICK_COLORS 95 - -static const char * g_nickColors[KVI_NUM_NICK_COLORS]= -{ - "0,1" ,"0,2" ,"0,3" ,"0,4" ,"0,5" ,"0,6" ,"0,10" ,"0,12" ,"0,14" , //9 - "1,0" ,"1,4" ,"1,7" ,"1,8" ,"1,9" ,"1,11" ,"1,15" , //7 - "2,0" ,"2,4" ,"2,7" ,"2,8" ,"2,9" ,"2,11" ,"2,15" , //7 - "3,8" ,"3,9" ,"3,0" ,"3,15" , //4 - "4,0" ,"4,1" ,"4,8" ,"4,9" ,"4,11" ,"4,15" , //6 - "5,0" ,"5,7" ,"5,8" ,"5,15" , //4 - "6,0" ,"6,7" ,"6,8" ,"6,9" ,"6,10" ,"6,11" ,"6,15" , //7 - "7,1" ,"7,2" ,"7,5" ,"7,6" ,"7,14" , //5 - "8,1" ,"8,2" ,"8,3" ,"8,4" ,"8,5" ,"8,6" ,"8,7" ,"8,10" ,"8,12" ,"8,14" , //10 - "9,1" ,"9,2" ,"9,3" ,"9,5" ,"9,6" ,"9,14" , //6 - "10,1" ,"10,2" , //2 - "11,1" ,"11,2" ,"11,3" ,"11,5" ,"11,6" ,"11,14", //6 - "12,0" ,"12,7" ,"12,8" ,"12,9" ,"12,10","12,11","12,15", //7 - "13,0" ,"13,1" ,"13,6" ,"13,8" ,"13,11","13,15", //6 - "14,0" ,"14,8" ,"14,11","14,15", //4 - "15,1" ,"15,2" ,"15,3" ,"15,6" ,"15,14" //5 -}; - -void KviConsole::outputPrivmsg(KviWindow *wnd, - int type, - const QString &daNick, - const QString &daUser, - const QString &daHost, - const QString &msg, - int iFlags, - const QString &prefix, - const QString &suffix) -{ - // FIXME: #warning "THIS IS USED BY WINDOWS THAT ARE NOT BOUND TO THIS IRC CONTEXT" - // FIXME: #warning "REMEMBER IT IN ESCAPE COMMANDS" - // __range_valid(wnd); - - bool bIsChan = (wnd->type() == KVI_WINDOW_TYPE_CHANNEL); - bool bIsNotice = ((type == KVI_OUT_CHANNELNOTICE)||(type == KVI_OUT_CHANNELNOTICECRYPTED) \ - ||(type == KVI_OUT_QUERYNOTICE)||(type == KVI_OUT_QUERYNOTICECRYPTED)); - - QString nick = daNick; // not that beautiful.. :/ - QString user = daUser; - QString host = daHost; - - if(connection()) - { - if(nick.isEmpty())nick = connection()->userInfo()->nickName(); - if(user.isEmpty())user = connection()->userInfo()->userName(); - if(host.isEmpty())host = connection()->userInfo()->hostName(); - } - - QString szDecodedMessage = msg; // shallow copy - - if(KVI_OPTION_BOOL(KviOption_boolStripMircColorsInUserMessages)) - szDecodedMessage = KviMircCntrl::stripControlBytes(szDecodedMessage); - - if(!(iFlags & NoHighlighting)) - { - // HIGHLIGHTING BLOCK - int iSaveType = type; - type = applyHighlighting(wnd,type,nick,user,host,szDecodedMessage); - if(type < 0)return; // event stopped the message! - if(type == KVI_OUT_HIGHLIGHT) - { - if(!wnd->hasAttention()) - { - if(KVI_OPTION_BOOL(KviOption_boolFlashWindowOnHighlightedMessages) && - (!(iFlags & NoWindowFlashing))) - { - wnd->demandAttention(); - } - if(KVI_OPTION_BOOL(KviOption_boolPopupNotifierOnHighlightedMessages) && - (!(iFlags & NoNotifier))) - { - QString szMsg = "<b><"; - szMsg += nick; - szMsg += "></b> "; - szMsg += szDecodedMessage; - //debug("kvi_console.cpp:629 debug: %s",szMsg.data()); - g_pApp->notifierMessage(wnd,KVI_OPTION_MSGTYPE(iSaveType).pixId(),szMsg,90); - } - } - } - } - - // <PREFIX>nick[!user@host]<POSTFIX>This is a test message - - QString szNick; - KviQString::sprintf(szNick,"\r!nc\r%Q\r",&nick); - - if(KVI_OPTION_BOOL(KviOption_boolShowUserAndHostInPrivmsgView)) - KviQString::appendFormatted(szNick,"!%Q@\r!h\r%Q\r",&user,&host); - - if(bIsChan && KVI_OPTION_BOOL(KviOption_boolShowChannelUserFlagInPrivmsgView)) - ((KviChannel *)wnd)->prependUserFlag(nick,szNick); - - if(KVI_OPTION_BOOL(KviOption_boolColorNicks)) - { - int sum = 0; - int i = nick.length(); - const QChar * aux = nick.unicode(); - // FIXME: Shouldn't this be case insensitive ? - while(i > 0) - { - sum += aux->unicode(); - aux++; - i--; - } - szNick.prepend(g_nickColors[sum % KVI_NUM_NICK_COLORS]); - szNick.prepend(KVI_TEXT_COLOR); - szNick.append(KVI_TEXT_COLOR); - } -/* if(KVI_OPTION_BOOL(KviOption_boolUseUserListColorsAsNickColors) && bIsChan) - { - if(((KviChannel*)wnd)->userListView()) - { - KviUserListEntry *e = ((KviChannel*)wnd)->userListView()->findEntry(nick); - if(e) - { - int sum = 0; - int i = nick.length(); - const QChar * aux = nick.unicode(); - // FIXME: Shouldn't this be case insensitive ? - while(i > 0) - { - sum += aux->unicode(); - aux++; - i--; - } - int color; - if(e->flags() == 0) - { - color = KVI_COLOR_EXT_USER_NORMAL; - } else { - color = (e->flags() & KVI_USERFLAG_CHANOWNER) ? \ - KVI_COLOR_EXT_USER_OWNER : ((e->flags() & KVI_USERFLAG_CHANADMIN) ? \ - KVI_COLOR_EXT_USER_ADMIN : ((e->flags() & KVI_USERFLAG_OP) ? \ - KVI_COLOR_EXT_USER_OP : ((e->flags() & KVI_USERFLAG_HALFOP) ? \ - KVI_COLOR_EXT_USER_HALFOP : ((e->flags() & KVI_USERFLAG_VOICE) ? \ - KVI_COLOR_EXT_USER_VOICE : KVI_COLOR_EXT_USER_USEROP)))); - } - szNick.prepend(QString("%1").arg(color)); - szNick.prepend(KVI_TEXT_COLOR); - szNick.append(KVI_TEXT_COLOR); - } - } - }*/ - if(KVI_OPTION_BOOL(KviOption_boolBoldedNicks)) - { - szNick.prepend(KVI_TEXT_BOLD); - szNick.append(KVI_TEXT_BOLD); - } - - QString szMessage; - - if(KVI_OPTION_BOOL(KviOption_boolUseExtendedPrivmsgView)) - { - szMessage = prefix.isEmpty() ? KVI_OPTION_STRING(KviOption_stringExtendedPrivmsgPrefix) : prefix; - szMessage += szNick; - szMessage += suffix.isEmpty() ? KVI_OPTION_STRING(KviOption_stringExtendedPrivmsgPostfix) : suffix; - } else { - if(bIsNotice) - { - static QString pre1("*"); - static QString suf1("* "); - szMessage = prefix.isEmpty() ? pre1 : prefix; - szMessage += szNick; - szMessage += suffix.isEmpty() ? suf1 : suffix; - } else { - static QString pre2("<"); - static QString suf2("> "); - szMessage = prefix.isEmpty() ? pre2 : prefix; - szMessage += szNick; - szMessage += suffix.isEmpty() ? suf2 : suffix; - } - } - - szMessage += szDecodedMessage; - - if(bIsChan)((KviChannel *)wnd)->outputMessage(type,szMessage); - else wnd->outputNoFmt(type,szMessage); -} - -void KviConsole::avatarChangedUpdateWindows(const QString &nick,const QString &textLine) -{ - if(!connection())return; //ops... - - // in quiet mode avoid bugging the user about avatar changes - bool bOut = ((!textLine.isEmpty()) && (!(_OUTPUT_QUIET))); - - for(KviChannel * c = connection()->channelList()->first();c;c = connection()->channelList()->next()) - { - if(c->avatarChanged(nick)) - { - if(bOut)c->outputNoFmt(KVI_OUT_AVATAR,textLine); - } - } - for(KviQuery * q = connection()->queryList()->first();q;q = connection()->queryList()->next()) - { - if(q->avatarChanged(nick)) - { - if(bOut)q->outputNoFmt(KVI_OUT_AVATAR,textLine); - } - } - m_pNotifyListView->avatarChanged(nick); // recalc the item height here too! -} - -void KviConsole::avatarChanged(KviAvatar * avatar,const QString &nick,const QString &user,const QString &host,const QString &textLine) -{ - if(!connection())return; //ops... - - bool bRegisteredStuff = false; - - if(KVI_OPTION_BOOL(KviOption_boolSetLastAvatarAsDefaultForRegisteredUsers)) - { - // Don't even try to do it for myself - if(!KviQString::equalCI(nick,connection()->userInfo()->nickName())) - { - KviRegisteredUser * u = connection()->userDataBase()->registeredUser(nick,user,host); - if(u) - { - if(avatar)u->setProperty("avatar",avatar->identificationString()); - else u->setProperty("avatar",QString::null); - bRegisteredStuff = true; - } - } - } - - if(!bRegisteredStuff) - { - // cache it - if(avatar) - KviAvatarCache::instance()->replace(avatar->identificationString(),KviIrcMask(nick,user,host),currentNetworkName().utf8().data()); - else - KviAvatarCache::instance()->remove(KviIrcMask(nick,user,host),currentNetworkName().utf8().data()); - } - - avatarChangedUpdateWindows(nick,textLine); -} - -void KviConsole::checkDefaultAvatar(KviIrcUserEntry *e,const QString &nick,const QString &user,const QString &host) -{ - // look it up in the cache - QString szAvatar = KviAvatarCache::instance()->lookup(KviIrcMask(nick,user,host),currentNetworkName().utf8().data()); - if(!szAvatar.isEmpty()) - { - // got a cache hit... is it on disk ? - KviAvatar * avatar = g_pIconManager->getAvatar(QString::null,szAvatar); - if(avatar) - { - // cached image on disk - e->setAvatar(avatar); - avatarChangedUpdateWindows(nick,QString::null); - return; - } else { - // no cached image on disk.. will need to requery it anyway - // remove from cache - KviAvatarCache::instance()->remove(KviIrcMask(nick,user,host),currentNetworkName().utf8().data()); - } - } - - // registered ? - KviRegisteredUser * u = connection()->userDataBase()->registeredUser(nick,user,host); - if(u) - { - // the user is registered... - QString szAvatar; - if(u->getProperty("avatar",szAvatar)) - { - // the user has a default avatar... - KviAvatar * avatar = g_pIconManager->getAvatar(QString::null,szAvatar); - if(avatar) - { - e->setAvatar(avatar); - avatarChangedUpdateWindows(nick,QString::null); - return; - } - } - } -} - -void KviConsole::resetAvatarForMatchingUsers(KviRegisteredUser * u) -{ - if(!connection())return; - - QString szAvatar; - if(!u->getProperty("avatar",szAvatar))return; - - KviPointerHashTableIterator<QString,KviIrcUserEntry> it(*(connection()->userDataBase()->dict())); - while(KviIrcUserEntry * e = it.current()) - { - if(e->hasHost()) - { - if(u->matchesFixed(it.currentKey(),e->user(),e->host())) - { - KviAvatar * a = g_pIconManager->getAvatar(QString::null,szAvatar); - e->setAvatar(a); - avatarChangedUpdateWindows(it.currentKey(),QString::null); - } - } - ++it; - } -} - -KviAvatar * KviConsole::setAvatar(const QString &nick,const QString &user,const QString &host,const QString &szLocalPath,const QString &szName) -{ - if(!connection())return 0; - KviIrcUserEntry * e = connection()->userDataBase()->find(nick); - if(e) - { - // User and host must match - if((!user.isEmpty()) && e->hasUser()) - { - if(!KviQString::equalCI(user,e->user()))return 0; - } - - if((!host.isEmpty()) && e->hasHost()) - { - if(!KviQString::equalCI(host,e->host()))return 0; - } - - // Ok...got it - - KviAvatar * avatar = g_pIconManager->getAvatar(szLocalPath,szName); - if(avatar) - { - e->setAvatar(avatar); - avatarChanged(avatar,nick,user,host,QString::null); - return avatar; - } else { - if(_OUTPUT_PARANOIC) - output(KVI_OUT_VERBOSE,__tr2qs("Failed to load avatar with name \"%Q\" and local path \"%Q\""),&szName,&szLocalPath); - } - } - return 0; -} - -KviAvatar * KviConsole::defaultAvatarFromOptions() -{ - QPixmap * avatar = KVI_OPTION_PIXMAP(KviOption_pixmapMyAvatar).pixmap(); - if(!avatar)return 0; - if(avatar->isNull())return 0; - if(KVI_OPTION_STRING(KviOption_stringMyAvatar).isEmpty())return 0; - return new KviAvatar(KVI_OPTION_PIXMAP(KviOption_pixmapMyAvatar).path(),KVI_OPTION_STRING(KviOption_stringMyAvatar),new QPixmap(*avatar)); -} - -KviAvatar * KviConsole::currentAvatar() -{ - if(!connection())return 0; - KviIrcUserEntry * e = connection()->userDataBase()->find(connection()->userInfo()->nickName()); - if(!e)return 0; - KviAvatar * a = e->avatar(); - if(!a) - { - a = defaultAvatarFromOptions(); - if(a) - { - e->setAvatar(a); - avatarChanged(a,connection()->userInfo()->nickName(),QString::null,QString::null,QString::null); - } - } - return a; -} - -void KviConsole::setAvatarFromOptions() -{ - if(!connection())return; - KviIrcUserEntry * e = connection()->userDataBase()->find(connection()->userInfo()->nickName()); - if(!e)return; - KviAvatar * a = defaultAvatarFromOptions(); - if(a) - { - e->setAvatar(a); - avatarChanged(a,connection()->userInfo()->nickName(),QString::null,QString::null,QString::null); - } -} - -void KviConsole::applyOptions() -{ - m_pNotifyListView->applyOptions(); - m_pInput->applyOptions(); - m_pIrcView->applyOptions(); - - KviWindow::applyOptions(); - - // trick - resize(width() - 1,height() - 1); - resize(width() + 1,height() + 1); -} - -void KviConsole::resizeEvent(QResizeEvent *e) -{ - int hght = m_pInput->heightHint(); - int hght2 = m_pButtonBox->sizeHint().height(); - m_pButtonBox->setGeometry(0,0,width(),hght2); - m_pSplitter->setGeometry(0,hght2,width(),height() - (hght + hght2)); - m_pInput->setGeometry(0,height() - hght,width(),hght); -} - -QSize KviConsole::sizeHint() const -{ - QSize ret(m_pIrcView->sizeHint().height(),m_pIrcView->sizeHint().height() + m_pInput->heightHint()); - return ret; -} - -void KviConsole::fillStatusString() -{ - switch(context()->state()) - { - case KviIrcContext::Idle: m_szStatusString = __tr2qs("No connection"); break; - case KviIrcContext::Connecting: m_szStatusString = __tr2qs("Connection in progress..."); break; - case KviIrcContext::LoggingIn: m_szStatusString = __tr2qs("Login in progress..."); break; - case KviIrcContext::Connected: - m_szStatusString = connection()->userInfo()->nickName(); - if(!connection()->userInfo()->userMode().isEmpty()) - { - m_szStatusString += " (+"; - m_szStatusString += connection()->userInfo()->userMode(); - - if(connection()->userInfo()->isAway()) - { - m_szStatusString += QChar(' '); - m_szStatusString += __tr2qs("away"); - } - m_szStatusString += QChar(')'); - } else { - if(connection()->userInfo()->isAway()) - { - m_szStatusString += " ("; - m_szStatusString += __tr2qs("away"); - m_szStatusString += QChar(')'); - } - } - - m_szStatusString += __tr2qs(" on "); - m_szStatusString += connection()->serverInfo()->name(); - break; - } -} - -void KviConsole::fillCaptionBuffers() -{ - fillStatusString(); - - static QString begin("<nobr><font color=\""); - static QString boldbegin("\"><b>"); - static QString endofbold("</b></font> <font color=\""); - static QString endoffont("\">"); - static QString end("</font></nobr>"); - - m_szPlainTextCaption = windowName(); - m_szPlainTextCaption += " ["; - m_szPlainTextCaption += m_szStatusString; - m_szPlainTextCaption += QChar(']'); - - m_szHtmlActiveCaption = begin; - m_szHtmlActiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name(); - m_szHtmlActiveCaption += boldbegin; - m_szHtmlActiveCaption += windowName(); - m_szHtmlActiveCaption += endofbold; - m_szHtmlActiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextActive2).name(); - m_szHtmlActiveCaption += endoffont; - m_szHtmlActiveCaption += m_szStatusString; - m_szHtmlActiveCaption += end; - - m_szHtmlInactiveCaption = begin; - m_szHtmlInactiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name(); - m_szHtmlInactiveCaption += boldbegin; - m_szHtmlInactiveCaption += windowName(); - m_szHtmlInactiveCaption += endofbold; - m_szHtmlInactiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive2).name(); - m_szHtmlInactiveCaption += endoffont; - m_szHtmlInactiveCaption += m_szStatusString; - m_szHtmlInactiveCaption += end; -} - - -QPixmap * KviConsole::myIconPtr() -{ - return g_pIconManager->getSmallIcon(isConnected() ? KVI_SMALLICON_LINKS : KVI_SMALLICON_CONSOLE); -} - - -void KviConsole::getTaskBarTipText(QString &buffer) -{ - fillStatusString(); - - static QString html_bold("<b>"); - static QString html_tab("  "); - static QString html_eofbold("</b>"); - static QString html_hrbr("<br><hr>"); - static QString html_channel(__tr2qs("channel")); - static QString html_channels(__tr2qs("channels")); - static QString html_query(__tr2qs("query")); - static QString html_queries(__tr2qs("queries")); - static QString html_space(" "); - static QString html_commaspace(", "); - static QString html_br("<br>"); - static QString html_spaceparopen(" ("); - static QString html_spaceparclosed(")"); - - buffer = "<table width=\"100%\">" \ - START_TABLE_BOLD_ROW; - buffer += m_szStatusString; - buffer += END_TABLE_BOLD_ROW; - if((context()->state() == KviIrcContext::Connected) && connection()) - { - QString num; - - unsigned int uD; - unsigned int uH; - - uD = connection()->channelList()->count(); - uH = connection()->queryList()->count(); - - if(uD || uH > 0) - { - buffer += "<tr><td>"; - buffer += html_tab; - - if(uD > 0) - { - num.setNum(uD); - - buffer += html_bold; - buffer += num; - buffer += html_eofbold; - buffer += html_space; - buffer += uD > 1 ? html_channels : html_channel; - if(uH > 0) - buffer += html_commaspace; - } - - if(uH > 0) - { - num.setNum(uH); - buffer += html_bold; - buffer += num; - buffer += html_eofbold; - buffer += html_space; - buffer += uH > 1 ? html_queries : html_query; - } - buffer += "</td></tr>"; - } - - QDateTime dt; - dt.setTime_t(connection()->statistics()->connectionStartTime()); - - buffer += START_TABLE_NORMAL_ROW; - - buffer += __tr2qs("Connected since"); - buffer += html_space; - buffer += html_br; - buffer += html_tab; - buffer += html_bold; - buffer += dt.toString(); - buffer += html_eofbold; - buffer += html_br; - - //buffer += html_spaceparopen; - - QString tspan = KviTimeUtils::formatTimeInterval((unsigned int)(kvi_secondsSince(connection()->statistics()->connectionStartTime())), - KviTimeUtils::NoLeadingEmptyIntervals | KviTimeUtils::NoLeadingZeroes); - - buffer += __tr2qs("Online for"); - buffer += html_space; - buffer += html_bold; - buffer += tspan; - buffer += html_eofbold; - //buffer += html_spaceparclosed; - - buffer += "</td></tr><tr><td bgcolor=\"#F0F0F0\">"; - - tspan = KviTimeUtils::formatTimeInterval((unsigned int)(kvi_secondsSince(connection()->statistics()->lastMessageTime())), - KviTimeUtils::NoLeadingEmptyIntervals | KviTimeUtils::NoLeadingZeroes); - - buffer += __tr2qs("Server idle for"); - buffer += html_space; - buffer += html_bold; - buffer += tspan; - buffer += "</b></td></tr>"; - } - - buffer += "</table>"; -} - -#include "kvi_console.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_console.h b/3.4.0/src/kvirc/ui/kvi_console.h deleted file mode 100644 index ef4cb5993d..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_console.h +++ /dev/null @@ -1,212 +0,0 @@ -#ifndef _KVI_CONSOLE_H_ -#define _KVI_CONSOLE_H_ -//============================================================================= -// -// File : kvi_console.h -// Creation date : Sun Jun 25 2000 15:00:20 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_ircconnection.h" -#include "kvi_window.h" -#include "kvi_ircsocket.h" -#include "kvi_string.h" -#include "kvi_irccontext.h" - -#include "kvi_pointerlist.h" - -#include <time.h> -#include <qcombobox.h> - - -class QToolBar; -class QToolButton; - -class KviAvatar; -class KviDns; -class KviIrcUserDataBase; -class KviIrcUserEntry; -class KviIrcServer; -class KviIrcNetwork; -class KviProxy; -#ifndef COMPILE_ON_WINDOWS - class KviChannel; - class KviQuery; -#else - // windoze wants it to compile QList<KviChannel> and QList<KviQuery> - #include "kvi_channel.h" - #include "kvi_query.h" -#endif -class KviUserListView; -class KviNotifyListManager; -class KviRegisteredUser; -class KviWindowToolPageButton; - - - -//================================================================================================= -// -// The console window -// -//================================================================================================= - -#define KVI_CONSOLE_FLAG_FIRSTINAPP 1 -#define KVI_CONSOLE_FLAG_FIRSTINFRAME 2 - - -class KVIRC_API KviConsole : public KviWindow -{ - friend class KviFrame; - friend class KviIrcSocket; - friend class KviChannel; - friend class KviQuery; - friend class KviIrcContext; - Q_OBJECT -protected: - KviConsole(KviFrame * lpFrm,int iFlags); -public: - ~KviConsole(); -protected: - int m_iFlags; // FIXME: make this a KviWindow property ? - // UI - KviUserListView * m_pNotifyListView; - KviWindowToolPageButton * m_pNotifyViewButton; - QComboBox * m_pAddressEdit; - QString m_szStatusString; // nick (flags) on server | not connected -protected: - // UI - virtual QPixmap * myIconPtr(); - virtual void fillCaptionBuffers(); - virtual void resizeEvent(QResizeEvent *e); - virtual void closeEvent(QCloseEvent *e); - virtual void getBaseLogFileName(QString &buffer); - virtual void getTaskBarTipText(QString &buffer); - virtual void fillContextPopup(KviTalPopupMenu * p); - virtual QSize sizeHint() const; - virtual void applyOptions(); - virtual void triggerCreationEvents(); - void fillStatusString(); - //void socketError(int iError); - //void socketStateChange(); - //void registerLinkMonitor(KviIrcSocketMonitor * m); - //void unregisterLinkMonitor(KviIrcSocketMonitor * m); - virtual void loadProperties(KviConfig * cfg); - virtual void saveProperties(KviConfig * cfg); - - void destroyConnection(); - // internal helper for applyHighlighting - int triggerOnHighlight(KviWindow *wnd,int type,const QString &nick,const QString &user,const QString &host,const QString &szMsg,const QString &trigger); - - void showNotifyList(bool bShow); - -public: - // UI - KviUserListView * notifyListView(){ return m_pNotifyListView; }; - int selectedCount(); - - - // - // State - // - KviIrcContext::State state(){ return context()->state(); }; - KVI_DEPRECATED KviIrcContext * ircContext(){ return context(); }; - unsigned int ircContextId() KVI_DEPRECATED; - // - // Sock state - // - KviIrcSocket * socket() KVI_DEPRECATED; - - // these should disappear! - bool isConnected(){ return context()->isConnected(); }; - bool isIpV6Connection(); - bool isNotConnected(); - bool connectionInProgress(); - // - // This connection info - // - QString currentNetworkName(); - KviAvatar * currentAvatar(); - // - // IRC Context wide helpers (connection related) - // - void getUserTipText(const QString &nick,KviIrcUserEntry *e,QString &buffer); - enum OutputPrivmsgFlags { - NoWindowFlashing = 1, // has meaning only if NoHighlighting is NOT given, otherwise it is implied - NoNotifier = 2, // has meaning only if NoHighlighitng is NOT given, otherwise it is implied - NoHighlighting = 4, - NoNotifications = 7 // this is 1|2|4 implies NoWindowFlashing and NoNotifier - }; - void outputPrivmsg(KviWindow *wnd,int type,const QString &nick, - const QString &user,const QString &host,const QString &msg,int iFlags = 0,const QString &prefix = QString::null,const QString &suffix = QString::null); - // this applies highlighting to the specified message - // and triggers the OnHighlight event. - // it returns KVI_OUT_HIGHLIGHT if highlighting was applied - // and -1 if OnHighlight called halt - // otherwise it returns <type> - int applyHighlighting(KviWindow *wnd,int type,const QString &nick,const QString &user,const QString &host,const QString &szMsg); - // Avatar helpers (conneciton related) - void resetAvatarForMatchingUsers(KviRegisteredUser * u); - // this should be protected at least - void avatarChangedUpdateWindows(const QString &nick,const QString &textLine); - void avatarChanged(KviAvatar * avatar,const QString &nick,const QString &user,const QString &host,const QString &textLine); - KviAvatar * setAvatar(const QString &nick,const QString &user,const QString &host,const QString &szLocalPath,const QString &szName); - void checkDefaultAvatar(KviIrcUserEntry *e,const QString &nick,const QString &user,const QString &host); - void setAvatarFromOptions(); - - // This returns the default avatar for the current KVIrc user - // if he has choosen a valid avatar in the options dialog - // otherwise returns 0. - // The avatar is allocated with new and must be deleted - // when no longer needed. - KviAvatar * defaultAvatarFromOptions(); - - void terminateConnectionRequest(bool bForce = false,const char * quitMsg = 0); - - // Status string (usermode + nick) (connection related too) - const QString & statusString(){ return m_szStatusString; }; - - // forwarders from KviIrcConnection - KVI_DEPRECATED KviPointerList<KviChannel> * channelList(){ return connection() ? connection()->channelList() : 0; }; - KVI_DEPRECATED KviPointerList<KviQuery> * queryList(){ return connection() ? connection()->queryList() : 0; }; - KVI_DEPRECATED unsigned int channelCount(){ return (connection() ? connection()->channelList()->count() : 0); }; - KVI_DEPRECATED unsigned int queryCount(){ return (connection() ? connection()->queryList()->count() : 0); }; - - // Window management - //KVI_DEPRECATED KviChannel * findChannel(const char * name){ return connection() ? connection()->findChannel(name) : 0; }; - //KVI_DEPRECATED KviQuery * findQuery(const char * nick){ return connection() ? connection()->findQuery(nick) : 0; }; - - KviWindow * activeWindow(); - // User db, connection related - void completeChannel(const QString &word,KviPointerList<QString> * matches); - void completeServer(const QString &word,KviPointerList<QString> * matches); - void connectionAttached(); - void connectionDetached(); -public slots: - void updateUri(); - void executeInternalCommand(int index); - void recentUrlsChanged(); -protected slots: - void ircUriChanged(const QString & ); - void toggleNotifyView(); - void textViewRightClicked(); -}; - -#endif //_KVI_CONSOLE_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_cryptcontroller.cpp b/3.4.0/src/kvirc/ui/kvi_cryptcontroller.cpp deleted file mode 100644 index 70607abe5e..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_cryptcontroller.cpp +++ /dev/null @@ -1,390 +0,0 @@ -// -// File : kvi_cryptcontroller.cpp -// Creation date : Fri Nov 03 2000 14:16:33 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2005 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_settings.h" - - -#ifdef COMPILE_CRYPT_SUPPORT - - #include "kvi_cryptcontroller.h" - #include "kvi_styled_controls.h" - - #include "kvi_window.h" - #include "kvi_locale.h" - #include "kvi_out.h" - #include "kvi_iconmanager.h" - #include "kvi_modulemanager.h" - #include "kvi_module.h" - #include "kvi_malloc.h" - #include "kvi_memmove.h" - #include "kvi_toolwindows_container.h" - - #include <qlayout.h> - #include "kvi_pointerhashtable.h" - - // kvi_app.cpp - extern KVIRC_API KviCryptEngineManager * g_pCryptEngineManager; - extern KVIRC_API KviModuleManager * g_pModuleManager; - - KviEngineListBoxItem::KviEngineListBoxItem(KviTalListBox * lb,KviCryptEngineDescription * d,const char * modName) - : KviTalListBoxText(lb,d->szName) - { - m_szName = d->szName; - m_szAuthor = d->szAuthor; - m_szDescription = d->szDescription; - m_iFlags = d->iFlags; - m_szModuleName = modName; - setText(d->szName); - } - - KviEngineListBoxItem::~KviEngineListBoxItem() - { - } - - - - - KviCryptController::KviCryptController(QWidget * par,KviWindowToolPageButton* button,const char * name,KviWindow * wnd,KviCryptSessionInfo * cur) - : KviWindowToolWidget(par,button) - { -// FIXME: #warning "Load the available modules here" - - // Load the known encryption modules - (void)g_pModuleManager->loadModulesByCaps("crypt"); -// (void)g_pModuleManager->getModule("koi2win"); -// (void)g_pModuleManager->getModule("mircstrip"); -// (void)g_pModuleManager->getModule("texturizer"); - - m_pWindow = wnd; - -#ifdef COMPILE_USE_QT4 - setFocusPolicy(Qt::ClickFocus); -#else - setFocusPolicy(QWidget::ClickFocus); -#endif - - QGridLayout *g = new QGridLayout(this,10,4,2,2); - - QLabel *l = new QLabel(this); - l->setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_LOCKED))); - g->addWidget(l,0,0); - l = new QLabel(__tr2qs("Cryptography/text transformation"),this); - g->addMultiCellWidget(l,0,0,1,3); - - QFrame * frm = new QFrame(this); - frm->setFrameStyle(QFrame::HLine | QFrame::Sunken); - g->addMultiCellWidget(frm,1,1,0,3); - - m_pEnableCheck = new KviStyledCheckBox(__tr2qs("Use the crypt engine"),this); - g->addMultiCellWidget(m_pEnableCheck,2,2,0,3); - connect(m_pEnableCheck,SIGNAL(toggled(bool)),this,SLOT(enableCheckToggled(bool))); - - m_pListBox = new KviTalListBox(this); - connect(m_pListBox,SIGNAL(highlighted(KviTalListBoxItem *)),this,SLOT(engineHighlighted(KviTalListBoxItem *))); - g->addMultiCellWidget(m_pListBox,3,8,0,0); - - m_pDescriptionLabel = new QLabel(this); - m_pDescriptionLabel->setFrameStyle(QFrame::Sunken | QFrame::StyledPanel); -#ifdef COMPILE_USE_QT4 - m_pDescriptionLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft); -#else - m_pDescriptionLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft); -#endif - g->addMultiCellWidget(m_pDescriptionLabel,3,3,1,3); - - m_pAuthorLabel = new QLabel(this); - m_pAuthorLabel->setFrameStyle(QFrame::Sunken | QFrame::StyledPanel); - g->addMultiCellWidget(m_pAuthorLabel,4,4,1,3); - - m_pEnableEncrypt = new KviStyledCheckBox(__tr2qs("Enable encryption"),this); - g->addMultiCellWidget(m_pEnableEncrypt,5,5,1,3); - - m_pEncryptKeyLabel = new QLabel(__tr2qs("Encrypt key:"),this); - g->addWidget(m_pEncryptKeyLabel,6,1); - - m_pEncryptKeyEdit = new QLineEdit(this); - g->addWidget(m_pEncryptKeyEdit,6,2); - - m_pEncryptHexKeyCheck = new KviStyledCheckBox(__tr2qs("Hex"),this); - g->addWidget(m_pEncryptHexKeyCheck,6,3); - - m_pEnableDecrypt = new KviStyledCheckBox(__tr2qs("Enable decryption"),this); - g->addMultiCellWidget(m_pEnableDecrypt,7,7,1,3); - - m_pDecryptKeyLabel = new QLabel(__tr2qs("Decrypt key:"),this); - g->addWidget(m_pDecryptKeyLabel,8,1); - - m_pDecryptKeyEdit = new QLineEdit(this); - g->addWidget(m_pDecryptKeyEdit,8,2); - - m_pDecryptHexKeyCheck = new KviStyledCheckBox(__tr2qs("Hex"),this); - g->addWidget(m_pDecryptHexKeyCheck,8,3); - - m_pOkButton = new QPushButton(__tr2qs("OK"),this); - g->addMultiCellWidget(m_pOkButton,9,9,0,3); - connect(m_pOkButton,SIGNAL(clicked()),this,SLOT(okClicked())); - - g->setRowStretch(3,1); - g->setColStretch(2,1); - - m_pLastItem = 0; - m_pSessionInfo = 0; - - fillEngineList(); - - if(cur) - { - KviTalListBoxItem * it = (KviTalListBoxItem *)m_pListBox->findItem(cur->szEngineName.ptr()); - if(it) - { - m_pEnableCheck->setChecked(true); - m_pListBox->setCurrentItem(it); - engineHighlighted(it); - m_pEnableEncrypt->setChecked(cur->bDoEncrypt); - m_pEnableDecrypt->setChecked(cur->bDoDecrypt); - } else enableWidgets(false); - } else { - enableWidgets(false); - } - registerSelf(); - } - - KviCryptController::~KviCryptController() - { - if(m_pSessionInfo) - { - // huh ? - g_pCryptEngineManager->deallocateEngine(m_pSessionInfo->pEngine); - delete m_pSessionInfo; - } - // Unload the unused ones... - g_pModuleManager->cleanupUnusedModules(); - } - - void KviCryptController::fillEngineList() - { - const KviPointerHashTable<QString,KviCryptEngineDescription> * a = g_pCryptEngineManager->engineDict(); - if(a) - { - KviPointerHashTableIterator<QString,KviCryptEngineDescription> it(*a); - while(it.current()) - { - KviStr modName = it.current()->providerHandle ? ((KviModule *)(it.current()->providerHandle))->name() : ""; - (void)(new KviEngineListBoxItem(m_pListBox,it.current(),modName.ptr())); - ++it; - } - if(m_pListBox->count() != 0)return; - } - noEnginesAvailable(); - } - - void KviCryptController::engineHighlighted(KviTalListBoxItem *it) - { - if(it) - { - KviEngineListBoxItem * eit = (KviEngineListBoxItem *)it; - m_pAuthorLabel->setText(eit->m_szAuthor.ptr()); - QString des = "<p>"; - des += eit->m_szDescription.ptr(); - des += "<br><br>"; - des += __tr2qs("If you dont want to encrypt a particular text line then just start it with the CTRL+P prefix"); - m_pDescriptionLabel->setText(des); - m_pEnableEncrypt->setEnabled(eit->m_iFlags & KVI_CRYPTENGINE_CAN_ENCRYPT); - m_pEncryptKeyLabel->setEnabled((eit->m_iFlags & KVI_CRYPTENGINE_CAN_ENCRYPT) && - (eit->m_iFlags & KVI_CRYPTENGINE_WANT_ENCRYPT_KEY)); - m_pEncryptKeyEdit->setEnabled((eit->m_iFlags & KVI_CRYPTENGINE_CAN_ENCRYPT) && - (eit->m_iFlags & KVI_CRYPTENGINE_WANT_ENCRYPT_KEY)); - m_pEnableEncrypt->setChecked(m_pEncryptKeyEdit->isEnabled()); - m_pEnableDecrypt->setEnabled(eit->m_iFlags & KVI_CRYPTENGINE_CAN_DECRYPT); - m_pEncryptHexKeyCheck->setEnabled(m_pEncryptKeyEdit->isEnabled()); - m_pEncryptHexKeyCheck->setChecked(false); - m_pDecryptKeyLabel->setEnabled((eit->m_iFlags & KVI_CRYPTENGINE_CAN_DECRYPT) && - (eit->m_iFlags & KVI_CRYPTENGINE_WANT_DECRYPT_KEY)); - m_pDecryptKeyEdit->setEnabled((eit->m_iFlags & KVI_CRYPTENGINE_CAN_DECRYPT) && - (eit->m_iFlags & KVI_CRYPTENGINE_WANT_DECRYPT_KEY)); - m_pEnableDecrypt->setChecked(m_pDecryptKeyEdit->isEnabled()); - m_pDecryptHexKeyCheck->setEnabled(m_pDecryptKeyEdit->isEnabled()); - m_pDecryptHexKeyCheck->setChecked(false); - m_pLastItem = eit; - enableWidgets(true); - } else m_pLastItem = 0; - } - - void KviCryptController::enableCheckToggled(bool bChecked) - { - enableWidgets(bChecked); - } - - void KviCryptController::enableWidgets(bool bEnabled) - { - m_pListBox->setEnabled(bEnabled); - m_pAuthorLabel->setEnabled(bEnabled && m_pLastItem); - m_pDescriptionLabel->setEnabled(bEnabled && m_pLastItem); - bool bCanDecrypt = m_pLastItem ? m_pLastItem->m_iFlags & KVI_CRYPTENGINE_CAN_DECRYPT : false; - bool bCanEncrypt = m_pLastItem ? m_pLastItem->m_iFlags & KVI_CRYPTENGINE_CAN_ENCRYPT : false; - m_pEnableEncrypt->setEnabled(bEnabled && bCanEncrypt); - m_pEnableDecrypt->setEnabled(bEnabled && bCanDecrypt); - bool bWantDecryptKey = m_pLastItem ? (bCanDecrypt && (m_pLastItem->m_iFlags & KVI_CRYPTENGINE_WANT_DECRYPT_KEY)) : false; - bool bWantEncryptKey = m_pLastItem ? (bCanEncrypt && (m_pLastItem->m_iFlags & KVI_CRYPTENGINE_WANT_ENCRYPT_KEY)) : false; - m_pEncryptKeyLabel->setEnabled(bEnabled && m_pEnableEncrypt->isChecked() && bWantEncryptKey); - m_pDecryptKeyLabel->setEnabled(bEnabled && m_pEnableDecrypt->isChecked() && bWantDecryptKey); - m_pEncryptKeyEdit->setEnabled(m_pEncryptKeyLabel->isEnabled()); - m_pDecryptKeyEdit->setEnabled(m_pDecryptKeyLabel->isEnabled()); - m_pEncryptHexKeyCheck->setEnabled(m_pEncryptKeyLabel->isEnabled()); - m_pDecryptHexKeyCheck->setEnabled(m_pDecryptKeyLabel->isEnabled()); - } - - void KviCryptController::noEnginesAvailable() - { - - m_pEnableCheck->setEnabled(false); - enableWidgets(false); - m_pDescriptionLabel->setText(__tr2qs("Sorry, no crypt engines available")); - m_pDescriptionLabel->setEnabled(true); // we want this text to be visible. - m_pOkButton->setEnabled(false); - } - - void KviCryptController::okClicked() - { - if(m_pEnableCheck->isChecked()) - { - if(m_pLastItem) - { - if(m_pEnableEncrypt->isChecked() || m_pEnableDecrypt->isChecked()) - { - m_pSessionInfo = allocateCryptSessionInfo(); - // Reregister the module in case that it has been unloaded - // while this dialog was open - if(m_pLastItem->m_szModuleName.hasData())(void)g_pModuleManager->getModule(m_pLastItem->m_szModuleName.ptr()); - m_pSessionInfo->pEngine = g_pCryptEngineManager->allocateEngine(m_pLastItem->m_szName.ptr()); - if(!m_pSessionInfo->pEngine) - { - m_pWindow->output(KVI_OUT_SYSTEMERROR,__tr2qs("Crypt: Can't create an engine instance: crypting disabled")); - delete m_pSessionInfo; - m_pSessionInfo = 0; - } else { - // initialize the engine - if(!initializeEngine(m_pSessionInfo->pEngine)) - { - KviStr errStr = m_pSessionInfo->pEngine->lastError(); - g_pCryptEngineManager->deallocateEngine(m_pSessionInfo->pEngine); - delete m_pSessionInfo; - m_pSessionInfo = 0; - m_pWindow->output(KVI_OUT_SYSTEMERROR,__tr2qs("Crypt: Can't initialize the engine :%s"),errStr.ptr()); - } else { - // ok, engine ready and waiting... - m_pSessionInfo->szEngineName = m_pLastItem->m_szName; - m_pSessionInfo->bDoEncrypt = m_pEnableEncrypt->isChecked(); - m_pSessionInfo->bDoDecrypt = m_pEnableDecrypt->isChecked(); - } - } - } else m_pWindow->output(KVI_OUT_SYSTEMERROR,__tr2qs("Crypt: You have to enable encryption and/or decryption for the engine to work")); - } - } - emit done(); - } - - bool KviCryptController::initializeEngine(KviCryptEngine * eng) - { - KviStr m_szEncryptKey; - KviStr m_szDecryptKey; - - char * encKey = 0; - int encKeyLen = 0; - - if(m_pEnableEncrypt->isChecked()) - { - m_szEncryptKey = m_pEncryptKeyEdit->text(); - if(m_pEncryptHexKeyCheck->isChecked()) - { - char * tmpKey; - encKeyLen = m_szEncryptKey.hexToBuffer(&tmpKey,false); - if(encKeyLen > 0) - { - encKey = (char *)kvi_malloc(encKeyLen); - kvi_memmove(encKey,tmpKey,encKeyLen); - KviStr::freeBuffer(tmpKey); - } - } else { - encKey = (char *)kvi_malloc(m_szEncryptKey.len()); - kvi_memmove(encKey,m_szEncryptKey.ptr(),m_szEncryptKey.len()); - encKeyLen = m_szEncryptKey.len(); - } - } - - char * decKey = 0; - int decKeyLen = 0; - - if(m_pEnableDecrypt->isChecked()) - { - m_szDecryptKey = m_pDecryptKeyEdit->text(); - if(m_pDecryptHexKeyCheck->isChecked()) - { - char * tmpKey; - decKeyLen = m_szDecryptKey.hexToBuffer(&tmpKey,false); - if(decKeyLen > 0) - { - decKey = (char *)kvi_malloc(decKeyLen); - kvi_memmove(decKey,tmpKey,decKeyLen); - KviStr::freeBuffer(tmpKey); - } - } else { - decKey = (char *)kvi_malloc(m_szDecryptKey.len()); - kvi_memmove(decKey,m_szDecryptKey.ptr(),m_szDecryptKey.len()); - decKeyLen = m_szDecryptKey.len(); - } - } - - bool bRet = eng->init(encKey,encKeyLen,decKey,decKeyLen); - if(encKey)kvi_free(encKey); - if(decKey)kvi_free(decKey); - - return bRet; - } - - KviCryptSessionInfo * KviCryptController::getNewSessionInfo() - { - KviCryptSessionInfo * inf = m_pSessionInfo; - m_pSessionInfo = 0; - return inf; - } - - KviCryptSessionInfo * KviCryptController::allocateCryptSessionInfo() - { - // this is mainly for modules wanting to alloc this - return new KviCryptSessionInfo(); - } - - void KviCryptController::destroyCryptSessionInfo(KviCryptSessionInfo ** inf) - { - if(!(*inf))return; - (*inf)->pEngine->disconnect(); // disconnect every signal (this is mainly for destroyed()) - g_pCryptEngineManager->deallocateEngine((*inf)->pEngine); // kill the engine - delete *inf; - *inf = 0; - } - - #include "kvi_cryptcontroller.moc" - -#endif //COMPILE_CRYPT_SUPPORT diff --git a/3.4.0/src/kvirc/ui/kvi_cryptcontroller.h b/3.4.0/src/kvirc/ui/kvi_cryptcontroller.h deleted file mode 100644 index 2bb21f92d5..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_cryptcontroller.h +++ /dev/null @@ -1,116 +0,0 @@ -#ifndef _KVI_CRYPTCONTROLLER_H_ -#define _KVI_CRYPTCONTROLLER_H_ -//============================================================================= -// -// File : kvi_cryptcontroller.h -// Creation date : Fri Nov 03 2000 14:11:03 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - - - -// Qt4 moc bails out on this ?????? - -#if defined(COMPILE_CRYPT_SUPPORT) || defined(Q_MOC_RUN) - #include <qwidget.h> - #include "kvi_tal_listbox.h" - #include <qpushbutton.h> - #include <qcheckbox.h> - #include <qlabel.h> - #include <qlineedit.h> - #include "kvi_styled_controls.h" - - #include "kvi_crypt.h" - #include "kvi_heapobject.h" - #include "kvi_toolwindows_container.h" - - class KviWindow; - - class KVIRC_API KviCryptSessionInfo : public KviHeapObject - { - public: - KviCryptEngine * pEngine; - KviStr szEngineName; - bool bDoEncrypt; - bool bDoDecrypt; - }; - - class KVIRC_API KviEngineListBoxItem : public KviTalListBoxText - { - friend class KviCryptController; - public: - KviEngineListBoxItem(KviTalListBox * lb,KviCryptEngineDescription * d,const char * modName); - ~KviEngineListBoxItem(); - public: - KviStr m_szName; - KviStr m_szAuthor; - KviStr m_szDescription; - KviStr m_szModuleName; - int m_iFlags; - }; - - - class KVIRC_API KviCryptController : public KviWindowToolWidget - { - Q_OBJECT - public: - KviCryptController(QWidget * parent,KviWindowToolPageButton* button,const char * name,KviWindow * wnd,KviCryptSessionInfo * cur); - ~KviCryptController(); - protected: - KviWindow * m_pWindow; - KviTalListBox * m_pListBox; - QPushButton * m_pOkButton; - KviStyledCheckBox * m_pEnableCheck; - QLabel * m_pDescriptionLabel; - QLabel * m_pAuthorLabel; - KviStyledCheckBox * m_pEnableEncrypt; - QLabel * m_pEncryptKeyLabel; - QLineEdit * m_pEncryptKeyEdit; - KviStyledCheckBox * m_pEncryptHexKeyCheck; - KviStyledCheckBox * m_pEnableDecrypt; - QLabel * m_pDecryptKeyLabel; - QLineEdit * m_pDecryptKeyEdit; - KviStyledCheckBox * m_pDecryptHexKeyCheck; - KviEngineListBoxItem * m_pLastItem; - KviCryptSessionInfo * m_pSessionInfo; - private slots: - void enableCheckToggled(bool bChecked); - void engineHighlighted(KviTalListBoxItem *it); - void okClicked(); - public: - KviCryptSessionInfo * getNewSessionInfo(); - static KviCryptSessionInfo * allocateCryptSessionInfo(); - static void destroyCryptSessionInfo(KviCryptSessionInfo ** inf); - private: - void fillEngineList(); - void noEnginesAvailable(); - void enableWidgets(bool bEnabled); - bool initializeEngine(KviCryptEngine * eng); - signals: - void done(); - }; - - -#endif //COMPILE_CRYPT_SUPPORT - - -#endif //!_KVI_CRYPTCONTROLLER_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_ctcppagedialog.cpp b/3.4.0/src/kvirc/ui/kvi_ctcppagedialog.cpp deleted file mode 100644 index fde9bc1494..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_ctcppagedialog.cpp +++ /dev/null @@ -1,147 +0,0 @@ -// -// File : kvi_ctcppagedialog.cpp -// Creation date : Tue May 21 2002 22:09:45 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_ctcppagedialog.h" - -#include "kvi_locale.h" -#include "kvi_app.h" - -#include "kvi_iconmanager.h" - -#include <qdatetime.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qpixmap.h> - -#ifdef COMPILE_USE_QT4 - #include <qdesktopwidget.h> -#endif - -// kvi_app.cpp -extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog; - -KviCtcpPageDialog::KviCtcpPageDialog() -: QWidget(0,"kvirc_ctcppage_dialog", -#ifdef COMPILE_USE_QT4 - Qt::WindowStaysOnTopHint | Qt::Tool | Qt::Dialog | Qt::Window) -#else - WStyle_StaysOnTop | WStyle_Tool | WType_Dialog | WType_TopLevel) -#endif -{ - QGridLayout * g = new QGridLayout(this,4,1,6,0); - m_pWidgetStack = new KviTalWidgetStack(this); - g->addWidget(m_pWidgetStack,0,0); - m_pTabBar = new QTabBar(this); - m_pTabBar->setShape(QTabBar::TriangularBelow); - connect(m_pTabBar,SIGNAL(selected(int)),this,SLOT(tabSelected(int))); - g->addWidget(m_pTabBar,1,0); - - g->setRowStretch(0,1); - - g->addRowSpacing(2,15); - - m_pCloseButton = new QPushButton(__tr2qs("Close"),this); - connect(m_pCloseButton,SIGNAL(clicked()),this,SLOT(die())); - g->addWidget(m_pCloseButton,3,0); - - setMinimumSize(300,200); - setMaximumSize(780,580); - setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CTCPREQUESTREPLIED))); - - setCaption(__tr2qs("CTCP Page - KVIrc")); -} - -KviCtcpPageDialog::~KviCtcpPageDialog() -{ - g_pCtcpPageDialog = 0; -} - -void KviCtcpPageDialog::center() -{ - move((g_pApp->desktop()->width() - width()) >> 1, - (g_pApp->desktop()->height() - height()) >> 1); -} - -void KviCtcpPageDialog::die() -{ - delete this; -} - -void KviCtcpPageDialog::tabSelected(int id) -{ - m_pWidgetStack->raiseWidget(id); -} - -void KviCtcpPageDialog::addPage(const QString &szNick,const QString &szUser,const QString &szHost,const QString &szMsg) -{ -#ifdef COMPILE_USE_QT4 - int id = m_pTabBar->addTab(szNick); -#else - int id = m_pTabBar->addTab(new QTab(szNick)); -#endif - QLabel * l = new QLabel(this); - l->setFrameStyle(QFrame::Raised | QFrame::StyledPanel); - //l->setMaximumWidth(600); - QString date = QDateTime::currentDateTime().toString(); - - QString tmp = "<center>"; - tmp += __tr2qs("You have been paged by"); - tmp += "<br><b>"; - tmp += szNick; - tmp += " ["; - tmp += szUser; - tmp += "@"; - tmp += szHost; - tmp += "]</b>:<br><br><b>"; - tmp += szMsg; - tmp += "</b><br><br>["; - tmp += date; - tmp += "]</center>"; - - l->setText(tmp); - m_pWidgetStack->addWidget(l,id); - m_pWidgetStack->raiseWidget(l); - m_pTabBar->setCurrentTab(id); -} - -void KviCtcpPageDialog::closeEvent(QCloseEvent *) -{ - delete this; -} - -void KviCtcpPageDialog::popup() -{ - show(); -// raise(); -// setActiveWindow(); - m_pCloseButton->setFocus(); -} - -void KviCtcpPageDialog::showEvent(QShowEvent *e) -{ - QWidget::showEvent(e); - center(); -} - -#include "kvi_ctcppagedialog.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_ctcppagedialog.h b/3.4.0/src/kvirc/ui/kvi_ctcppagedialog.h deleted file mode 100644 index 35ebdd5dbf..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_ctcppagedialog.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef _KVI_CTCPPAGEDIALOG_H_ -#define _KVI_CTCPPAGEDIALOG_H_ -// -// File : kvi_ctcppagedialog.h -// Creation date : Tue May 21 2002 22:09:45 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_string.h" - -#include "kvi_tal_widgetstack.h" -#include <qtabbar.h> -#include <qwidget.h> -#include <qpushbutton.h> - -class KVIRC_API KviCtcpPageDialog : public QWidget -{ - Q_OBJECT -public: - KviCtcpPageDialog(); - ~KviCtcpPageDialog(); -protected: - KviTalWidgetStack * m_pWidgetStack; - QTabBar * m_pTabBar; - QPushButton * m_pCloseButton; -public: - void popup(); - void addPage(const QString &szNick,const QString &szUser,const QString &szHost,const QString &szMsg); -protected slots: - void tabSelected(int id); - void die(); -protected: - void center(); - virtual void showEvent(QShowEvent *e); - virtual void closeEvent(QCloseEvent *); -}; - -#endif //_KVI_CTCPPAGEDIALOG_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_customtoolbar.cpp b/3.4.0/src/kvirc/ui/kvi_customtoolbar.cpp deleted file mode 100644 index d09afff524..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_customtoolbar.cpp +++ /dev/null @@ -1,670 +0,0 @@ -//============================================================================= -// -// File : kvi_customtoolbar.cpp -// Created on Sun 21 Nov 2004 05:28:57 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_customtoolbar.h" -#include "kvi_frame.h" -#include "kvi_locale.h" -#include "kvi_app.h" -#include "kvi_actionmanager.h" -#include "kvi_customtoolbardescriptor.h" - -#include <qcursor.h> -#include "kvi_tal_popupmenu.h" -#include <qlayout.h> -#include <qpixmap.h> -#include <qcursor.h> -#include <qtoolbutton.h> -#include <qpainter.h> -#include <qstyle.h> - -#ifdef COMPILE_USE_QT4 - #include <qevent.h> - #include <q3dragobject.h> - - #define QDragObject Q3DragObject - #define QTextDrag Q3TextDrag - #define QIconDrag Q3IconDrag - - #include <qstyleoption.h> -#else - #include <qobjectlist.h> - #include <qdragobject.h> -#endif - - - -KviCustomToolBarSeparator::KviCustomToolBarSeparator(KviCustomToolBar *pParent,const char * name) -: QWidget(pParent,name) -{ - m_pToolBar = pParent; - setBackgroundMode(pParent->backgroundMode()); - setBackgroundOrigin(ParentOrigin); - setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum)); -} - -QSize KviCustomToolBarSeparator::sizeHint() const -{ -#ifdef COMPILE_USE_QT4 - QStyleOption opt; - opt.initFrom(this); - int extent = style()->pixelMetric(QStyle::PM_ToolBarSeparatorExtent,&opt,this); -#else - int extent = style().pixelMetric(QStyle::PM_DockWindowSeparatorExtent,this); -#endif - if(m_pToolBar->orientation() == Qt::Horizontal)return QSize(extent,0); - else return QSize(0,extent); -} - -void KviCustomToolBarSeparator::paintEvent(QPaintEvent *) -{ - QPainter p(this); -#ifdef COMPILE_USE_QT4 - QStyleOption opt; - opt.initFrom(this); - style()->drawPrimitive(QStyle::PE_Q3DockWindowSeparator,&opt,&p,this); -#else - QStyle::SFlags flags = QStyle::Style_Default; - if(m_pToolBar->orientation() == Qt::Horizontal)flags |= QStyle::Style_Horizontal; - style().drawPrimitive(QStyle::PE_DockWindowSeparator,&p,rect(),colorGroup(),flags); -#endif -} - - -KviCustomToolBar::KviCustomToolBar(KviCustomToolBarDescriptor * d,const QString &label,QT_TOOLBARDOCK_TYPE dock,bool bNewLine,const char * nam) -: KviToolBar(label,dock,bNewLine,nam) -{ - m_pDescriptor = d; - m_pMovedChild = 0; - m_pDraggedChild = 0; - m_pFilteredChildren = 0; - setAcceptDrops(true); - connect(KviActionManager::instance(),SIGNAL(beginCustomizeToolBars()),this,SLOT(beginCustomize())); - connect(KviActionManager::instance(),SIGNAL(endCustomizeToolBars()),this,SLOT(endCustomize())); - setMinimumSize(20,20); - d->registerToolBar(this); - if(KviActionManager::customizingToolBars()) - beginCustomize(); // because we will not get the signal -} - -KviCustomToolBar::~KviCustomToolBar() -{ - if(KviActionManager::customizingToolBars()) - syncDescriptor(); // because we will not get endCustomize() - m_pDescriptor->unregisterToolBar(this); - if(KviActionManager::customizingToolBars()) - { - if(KviActionManager::currentToolBar() == this) - KviActionManager::instance()->setCurrentToolBar(0); - } - if(m_pFilteredChildren)delete m_pFilteredChildren; -} - -void KviCustomToolBar::paintEvent(QPaintEvent * e) -{ - KviToolBar::paintEvent(e); - if(KviActionManager::customizingToolBars() && (KviActionManager::currentToolBar() == this)) - { - QPainter p(this); - p.setPen(Qt::red); - p.drawRect(0,0,width(),height()); - } -} - -void KviCustomToolBar::filteredChildDestroyed() -{ - if(!m_pFilteredChildren)return; - const QObject * o = sender(); - m_pFilteredChildren->remove((void *)o); -} - -void KviCustomToolBar::filterChild(QObject * o) -{ - bool * b = new bool(((QWidget *)o)->isEnabled()); - if(m_pFilteredChildren) - m_pFilteredChildren->insert(o,b); - if(!*b)((QWidget *)o)->setEnabled(true); - o->installEventFilter(this); - connect(o,SIGNAL(destroyed()),this,SLOT(filteredChildDestroyed())); -} - -void KviCustomToolBar::unfilterChild(QObject * o) -{ - if(m_pFilteredChildren) - { - bool * b = m_pFilteredChildren->find(o); - if(b) - { - if(!*b)((QWidget *)o)->setEnabled(false); - o->removeEventFilter(this); - disconnect(o,SIGNAL(destroyed()),this,SLOT(filteredChildDestroyed())); - } - } -} - -void KviCustomToolBar::beginCustomize() -{ - if(m_pFilteredChildren)delete m_pFilteredChildren; - m_pFilteredChildren = new KviPointerHashTable<void *,bool>; - m_pFilteredChildren->setAutoDelete(true); - // filter the events for all the children -#ifdef COMPILE_USE_QT4 - QList<QObject*> l = children(); - for(QList<QObject*>::Iterator it = l.begin();it != l.end();++it) - { - if((*it)->isWidgetType()) - filterChild(*it); - } -#else - const QObjectList * l = children(); - QObjectListIterator it(*l); - while(QObject * o = it.current()) - { - if(o->isWidgetType()) - filterChild(o); - ++it; - } -#endif -} - -void KviCustomToolBar::endCustomize() -{ - // stop filtering events -#ifdef COMPILE_USE_QT4 - QList<QObject*> l = children(); - for(QList<QObject*>::Iterator it = l.begin();it != l.end();++it) - { - if((*it)->isWidgetType()) - unfilterChild(*it); - } -#else - const QObjectList * l = children(); - QObjectListIterator it(*l); - while(QObject * o = it.current()) - { - if(o->isWidgetType()) - unfilterChild(o); - ++it; - } -#endif - // FIXME: We SHOULD MAKE SURE that the children are re-enabled... - // this could be done by calling setEnabled(isEnabled()) on each action ? - if(m_pFilteredChildren) - { - delete m_pFilteredChildren; - m_pFilteredChildren = 0; - } - syncDescriptor(); -} - -void KviCustomToolBar::syncDescriptor() -{ - // store the item order in the descriptor - QBoxLayout * lay = boxLayout(); - QLayoutIterator iter = lay->iterator(); - QLayoutItem * i; - m_pDescriptor->actions()->clear(); - while((i = iter.current())) - { - if(QWidget * w = i->widget()) - m_pDescriptor->actions()->append(new QString(w->name())); - ++iter; - } -} - -void KviCustomToolBar::childEvent(QChildEvent *e) -{ - if(KviActionManager::customizingToolBars()) - { - // this is useful for droppped and dragged-out children - if(e->type() == QEvent::ChildInserted) - { - if(e->child()->isWidgetType()) - filterChild(e->child()); - goto done; - } - - if(e->type() == QEvent::ChildRemoved) - { - if(e->child()->isWidgetType()) - unfilterChild(e->child()); - goto done; - } - } -done: - KviToolBar::childEvent(e); -} - -void KviCustomToolBar::dragEnterEvent(QDragEnterEvent *e) -{ - if(!KviActionManager::customizingToolBars())return; - KviActionManager::instance()->setCurrentToolBar(this); - QString text; - if(QTextDrag::decode(e,text)) - { - if(!text.isEmpty()) - { - KviAction * a = KviActionManager::instance()->getAction(text); - if(a) - { - e->accept(true); - int idx = dropIndexAt(mapFromGlobal(QCursor::pos()),0,0); - m_pDraggedChild = a->addToCustomToolBar(this); -#ifdef COMPILE_USE_QT4 - QWidget * pWidgetToMove = widgetAt(idx); - bool bDone = false; - QAction * a; - if(pWidgetToMove) - { - a = actionForWidget(pWidgetToMove); - if(a) - { - bDone = true; - a = insertWidget(a,m_pDraggedChild); - } - } - if(!bDone) - a = addWidget(m_pDraggedChild); - a->setVisible(true); -#else - boxLayout()->remove(m_pDraggedChild); // in case it was already added - boxLayout()->insertWidget(idx,m_pDraggedChild); -#ifdef COMPILE_KDE_SUPPORT - // bleah :///// - insertWidget(-1,m_pDraggedChild->sizeHint().width(),m_pDraggedChild,idx); -#endif -#endif - QEvent ev(QEvent::LayoutHint); - QApplication::sendEvent(this,&ev); - } else e->accept(false); - } else e->accept(false); - } else e->accept(false); -} - -void KviCustomToolBar::dragMoveEvent(QDragMoveEvent *e) -{ - if(!m_pDraggedChild)return; - drag(m_pDraggedChild,mapFromGlobal(QCursor::pos())); -} - -void KviCustomToolBar::dragLeaveEvent(QDragLeaveEvent *e) -{ - if(m_pDraggedChild) - { - if(m_pFilteredChildren) - m_pFilteredChildren->remove(m_pDraggedChild); // just to be sure - delete m_pDraggedChild; - m_pDraggedChild = 0; - } -} - -void KviCustomToolBar::dropEvent(QDropEvent *e) -{ - if(!m_pDraggedChild)return; - m_pDraggedChild = 0; - e->accept(); - // nuthin :) -} - -int KviCustomToolBar::dropIndexAt(const QPoint &pnt,QWidget * exclude,int * excludeIdx) -{ - // find the widget at the current poisition - // treating exclude as if it was going to be removed - // find also the exclude index if needed -#ifdef COMPILE_USE_QT4 - QLayout * l = layout(); -#else - QBoxLayout * l = boxLayout(); -#endif - QLayoutItem * i = 0; - if(excludeIdx)*excludeIdx = -1; - int idx = 0; - - if(!l)return 0; - QLayoutIterator it = l->iterator(); - - // find the children with minimum distance - int iMinDistIdx = -1; - QWidget * pMinDistW = 0; - unsigned int uMinDist = 0xffffffff; - int iExcludeIdx = -1; - QPoint pntExclude; - QWidget * w = 0; - - while((i = it.current())) - { - if((w = i->widget())) - { - if(uMinDist != 0) - { - int iRight = w->x() + w->width(); - int iBottom = w->y() + w->height(); - if((pnt.x() >= w->x()) && (pnt.y() >= w->y()) && (pnt.x() <= iRight) && (pnt.y() <= iBottom)) - { - // inside the widget - // distance 0 - pMinDistW = w; - iMinDistIdx = idx; - uMinDist = 0; - } else { - // outside the widget - // compute the distance - unsigned int uXDist = (pnt.x() < w->x()) ? (w->x() - pnt.x()) : (pnt.x() > iRight ? (pnt.x() - iRight) : 0); - unsigned int uYDist = (pnt.y() < w->y()) ? (w->y() - pnt.y()) : (pnt.y() > iBottom ? (pnt.y() - iBottom) : 0); - if((uXDist < 8192) && (uYDist < 8192)) - { - // it is in reasonable rect - unsigned int uDist = (uXDist * uXDist) + (uYDist * uYDist); - if(uDist < uMinDist) - { - // min distance for now - uMinDist = uDist; - pMinDistW = w; - iMinDistIdx = idx; - } - } // else the user has a really HUUUGE screen - } - } // else the minimum distance widget has already been found - if(w == exclude) - { - iExcludeIdx = idx; - pntExclude = w->pos(); - } - } - idx++; - ++it; - } - - if(!pMinDistW) - { - // ops.. not found at all (empty toolbar or really far from any button) - if(orientation() == Qt::Horizontal) - { - if(pnt.x() < (width() / 2))iMinDistIdx = 0; // insert at position 0 - else iMinDistIdx = idx; - // else insert at the last position found - } else { - if(pnt.y() < (height() / 2))iMinDistIdx = 0; // insert at position 0 - else iMinDistIdx = idx; - // else insert at the last position found - } - } else { - // got it, check for the exclude idx - if((iExcludeIdx == -1) || (iExcludeIdx != iMinDistIdx)) - { - // would not put it over exclude idx - // check if we have to stay on right or left of the widget found - if(orientation() == Qt::Horizontal) - { - if(pnt.x() > (pMinDistW->x() + (pMinDistW->width() / 2))) - iMinDistIdx++; // need to put it on the right - } else { - if(pnt.y() > (pMinDistW->y() + (pMinDistW->height() / 2))) - iMinDistIdx++; // need to put it below - } - } - - // ok , check again (we might have moved exactly over exclude idx now!) - if((iExcludeIdx != -1) && (iExcludeIdx != iMinDistIdx)) - { - // got the exclude idx by the way and wouldn't put exactly over it - // check if exclude idx is "before" the current possible insert position - // if it is , then lower down the index by one - if(orientation() == Qt::Horizontal) - { - if(pnt.x() > pntExclude.x()) - iMinDistIdx--; // removing exclude will move everything one step back - } else { - if(pnt.y() > pntExclude.y()) - iMinDistIdx--; // removing exclude will move everything one step back - } - } - } - - if(iMinDistIdx < 0)iMinDistIdx = 0; - if(excludeIdx)*excludeIdx = iExcludeIdx; - - return iMinDistIdx; - -} - -#ifdef COMPILE_USE_QT4 -QWidget * KviCustomToolBar::widgetAt(int index) -{ - QLayout * l = layout(); - if(!l) - return NULL; - QLayoutItem * it = l->itemAt(index); - if(!it) - return NULL; - return it->widget(); -} - -QAction * KviCustomToolBar::actionForWidget(QWidget * pWidget) -{ - return actionAt(pWidget->x() + 1,pWidget->y() + 1); -} - -#endif - -void KviCustomToolBar::drag(QWidget * child,const QPoint &pnt) -{ - int me = -1; - int idx = dropIndexAt(pnt,child,&me); - debug("DROP INDEX IS %d, ME IS %d",idx,me); - if(idx == me) - return; // would move over itself -#ifdef COMPILE_USE_QT4 - QWidget * pWidgetToMove = widgetAt(idx > me ? idx-1 : idx); - debug("SEARCHING FOR WIDGET TO MOVE AT %d AND FOUND %x (ME=%x)",idx > me ? idx-1 : idx,pWidgetToMove,child); - if(pWidgetToMove == child) - return; // hmmm - bool bDone = false; - QAction * pMyOwnAction = actionForWidget(child); - if(!pMyOwnAction) - return; - QAction * a; - removeAction(pMyOwnAction); - if(pWidgetToMove) - { - a = actionForWidget(pWidgetToMove); - if(a) - { - debug("AND GOT ACTION FOR THAT WIDGET"); - - bDone = true; - a = insertWidget(a,child); - } - } else { - addAction(a); - } - if(!bDone) - a = addWidget(child); - a->setVisible(true); -#else - boxLayout()->remove(child); - boxLayout()->insertWidget(idx,child); -#ifdef COMPILE_KDE_SUPPORT - // bleah :///// - insertWidget(-1,child->width(),child,idx); -#endif -#endif - QEvent ev(QEvent::LayoutHint); - QApplication::sendEvent(this,&ev); -} - -void KviCustomToolBar::mousePressEvent(QMouseEvent * e) -{ - if(KviActionManager::customizingToolBars()) - KviActionManager::instance()->setCurrentToolBar(this); - KviToolBar::mousePressEvent(e); -} - -bool KviCustomToolBar::eventFilter(QObject *o,QEvent *e) -{ - if(!KviActionManager::customizingToolBars())goto unhandled; // anything here is done when customizing only - if(e->type() == QEvent::Enter) - { - if(m_pMovedChild)return true; // kill it while moving other children - } - if(e->type() == QEvent::Leave) - { - if(m_pMovedChild)return true; // kill it while moving other children - } - if(e->type() == QEvent::MouseButtonPress) - { - KviActionManager::instance()->setCurrentToolBar(this); - QMouseEvent * ev = (QMouseEvent *)e; - if(ev->button() & Qt::LeftButton) - { - if(o->isWidgetType()) - { - if(!( - o->inherits("KviTalPopupMenu") || - o->inherits("QToolBarHandle") || - o->inherits("QDockWindowHandle") || - o->inherits("QDockWindowResizeHandle") || - o->inherits("QToolBarExtensionWidget") - )) - { - m_pMovedChild = (QWidget *)o; - // allow resizing of children - // FIXME: do it only if the child is really resizable - if(m_pMovedChild->width() > 20) // might be an applet - { - if(ev->pos().x() > (m_pMovedChild->width() - 4)) - { - m_pMovedChild = 0; - goto unhandled; // let the applet handle the event it - } - } - g_pApp->setOverrideCursor(Qt::sizeAllCursor); - return true; - } - } - } - goto unhandled; - } - if(e->type() == QEvent::MouseButtonRelease) - { - if(m_pMovedChild) - { - g_pApp->restoreOverrideCursor(); - m_pMovedChild = 0; - return true; - } - goto unhandled; - } - if(e->type() == QEvent::MouseMove) - { - if(m_pMovedChild) - { - QMouseEvent * ev = (QMouseEvent *)e; - - QPoint pnt = mapFromGlobal(m_pMovedChild->mapToGlobal(ev->pos())); - if((pnt.y() < 0) || (pnt.y() > height()) || (pnt.x() < 0) || (pnt.x() > width())) - { - // drag out! -// FIXME: This is screwed up in Qt4.... :/ -#ifdef COMPILE_USE_QT4 - QDrag * d = new QDrag(this); - QMimeData * m = new QMimeData(); - m->setText(m_pMovedChild->name()); - d->setMimeData(m); -#else - QDragObject * d = new QTextDrag(m_pMovedChild->name(),this); -#endif - KviAction * act = KviActionManager::instance()->getAction(m_pMovedChild->name()); - if(act) - { - QPixmap * pixie = act->bigIcon(); -#ifdef COMPILE_USE_QT4 - if(pixie) - { - d->setPixmap(*pixie); - d->setHotSpot(QPoint(3,3)); - } -#else - if(pixie)d->setPixmap(*pixie,QPoint(3,3)); -#endif - } - //d->setPixmap(QPixmap::grabWidget(m_pMovedChild),QPoint(m_pMovedChild->width() / 2,m_pMovedChild->height() / 2)); - // throw it somewhere else for now - if(m_pFilteredChildren) - unfilterChild(m_pMovedChild); -#ifdef COMPILE_USE_QT4 - QAction * pActionForMovedChild = actionForWidget(m_pMovedChild); - if(pActionForMovedChild) - pActionForMovedChild->setVisible(false); - m_pMovedChild->hide(); -#else - m_pMovedChild->hide(); - m_pMovedChild->reparent(g_pFrame,QPoint(-1000,-1000),false); -#endif - QEvent ev(QEvent::LayoutHint); - QApplication::sendEvent(this,&ev); -#ifdef COMPILE_USE_QT4 - if(!d->exec(Qt::MoveAction) != Qt::MoveAction) -#else - if(!d->dragMove()) -#endif - { - // the user has probably failed to remove the action from the toolbar - // flash the trashcan in the customize toolbars dialog - KviActionManager::instance()->emitRemoveActionsHintRequest(); - // will filter it as ChildInserted -#ifndef COMPILE_USE_QT4 - m_pMovedChild->reparent(this,QPoint(0,0),false); -#endif -#ifdef COMPILE_USE_QT4 - QAction * pActionForMovedChild = actionForWidget(m_pMovedChild); - if(pActionForMovedChild) - pActionForMovedChild->setVisible(false); -#else - boxLayout()->insertWidget(0,m_pMovedChild); - m_pMovedChild->show(); -#ifdef COMPILE_KDE_SUPPORT - // bleah :///// - insertWidget(-1,m_pMovedChild->width(),m_pMovedChild,0); -#endif -#endif - QEvent ev(QEvent::LayoutHint); - QApplication::sendEvent(this,&ev); - } else { - QApplication::sendPostedEvents(m_pMovedChild,0); - m_pMovedChild->deleteLater(); - m_pMovedChild = 0; - } - return true; - } - - drag(m_pMovedChild,pnt); - return true; - } - goto unhandled; - } -unhandled: - return KviToolBar::eventFilter(o,e); -} diff --git a/3.4.0/src/kvirc/ui/kvi_customtoolbar.h b/3.4.0/src/kvirc/ui/kvi_customtoolbar.h deleted file mode 100644 index 7c880893ec..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_customtoolbar.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef _KVI_CUSTOMTOOLBAR_H_ -#define _KVI_CUSTOMTOOLBAR_H_ -//============================================================================= -// -// File : kvi_customtoolbar.h -// Created on Sun 21 Nov 2004 05:28:57 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_toolbar.h" -#include "kvi_pointerhashtable.h" - -#ifdef COMPILE_ON_WINDOWS - #include "kvi_customtoolbardescriptor.h" -#else - class KviCustomToolBarDescriptor; -#endif -class KviCustomToolBar; - -class KviCustomToolBarSeparator : public QWidget -{ - Q_OBJECT -public: - KviCustomToolBarSeparator(KviCustomToolBar *pParent,const char * name); - QSize sizeHint() const; -protected: - KviCustomToolBar * m_pToolBar; -protected: - void paintEvent(QPaintEvent *e); -}; - -class KVIRC_API KviCustomToolBar : public KviToolBar -{ - friend class KviCustomToolBarDescriptor; - Q_OBJECT -protected: - KviCustomToolBar(KviCustomToolBarDescriptor * d,const QString &label,QT_TOOLBARDOCK_TYPE dock = QT_DOCK_TOP,bool bNewLine = false,const char * nam = 0); -public: - ~KviCustomToolBar(); -protected: - KviCustomToolBarDescriptor * m_pDescriptor; - QWidget * m_pMovedChild; - QWidget * m_pDraggedChild; - KviPointerHashTable<void *,bool> * m_pFilteredChildren; -public: - KviCustomToolBarDescriptor * descriptor(){ return m_pDescriptor; }; -protected: - virtual void mousePressEvent(QMouseEvent * e); - virtual void dragEnterEvent(QDragEnterEvent *e); - virtual void dragMoveEvent(QDragMoveEvent *e); - virtual void dragLeaveEvent(QDragLeaveEvent *e); - virtual void dropEvent(QDropEvent *e); - virtual void childEvent(QChildEvent *e); - virtual bool eventFilter(QObject *o,QEvent *e); - int dropIndexAt(const QPoint &pnt,QWidget * exclude,int * excludeIdx); -#ifdef COMPILE_USE_QT4 - QWidget * widgetAt(int index); - QAction * actionForWidget(QWidget * pWidget); -#endif - void drag(QWidget * child,const QPoint &pnt); - void filterChild(QObject * o); - void unfilterChild(QObject * o); - virtual void paintEvent(QPaintEvent * e); - void syncDescriptor(); -protected slots: - void beginCustomize(); - void endCustomize(); - void filteredChildDestroyed(); -}; - - - -#endif //!_KVI_CUSTOMTOOLBAR_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_debugwindow.cpp b/3.4.0/src/kvirc/ui/kvi_debugwindow.cpp deleted file mode 100644 index 0b2e7f12da..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_debugwindow.cpp +++ /dev/null @@ -1,132 +0,0 @@ -//============================================================================= -// -// File : kvi_debugwindow.cpp -// Creation date : Sun Jul 18 2005 14:12:22 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2005 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_debugwindow.h" -#include "kvi_console.h" -#include "kvi_iconmanager.h" -#include "kvi_ircview.h" -#include "kvi_input.h" -#include "kvi_options.h" -#include "kvi_locale.h" -#include "kvi_config.h" - -#include "kvi_parameterlist.h" -#include "kvi_frame.h" -#include "kvi_valuelist.h" - -#include <qpixmap.h> -#include <qsplitter.h> -#include <qtoolbutton.h> - -KviDebugWindow * KviDebugWindow::m_pInstance = 0; - - -KviDebugWindow::KviDebugWindow() -: KviWindow(KVI_WINDOW_TYPE_DEBUG,g_pFrame,__tr2qs("Debug Messages"),0) -{ - m_pInstance = this; - m_pSplitter = new QSplitter(Qt::Horizontal,this,"main_splitter"); - m_pIrcView = new KviIrcView(m_pSplitter,g_pFrame,this); - m_pInput = new KviInput(this,0); - updateCaption(); -} - -KviDebugWindow::~KviDebugWindow() -{ - m_pInstance = 0; -} - -KviDebugWindow * KviDebugWindow::getInstance() -{ - if(m_pInstance)return m_pInstance; - m_pInstance = new KviDebugWindow(); - g_pFrame->addWindow(m_pInstance,!KVI_OPTION_BOOL(KviOption_boolShowMinimizedDebugWindow)); - if(KVI_OPTION_BOOL(KviOption_boolShowMinimizedDebugWindow)) - m_pInstance->minimize(); - return m_pInstance; -} - - - -void KviDebugWindow::getBaseLogFileName(QString &buffer) -{ - buffer = "debug"; -} - -void KviDebugWindow::saveProperties(KviConfig *cfg) -{ - KviWindow::saveProperties(cfg); - cfg->writeEntry("Splitter",m_pSplitter->sizes()); -} - -void KviDebugWindow::loadProperties(KviConfig *cfg) -{ - int w = width(); - KviWindow::loadProperties(cfg); - KviValueList<int> def; - def.append((w * 80) / 100); - def.append((w * 20) / 100); - m_pSplitter->setSizes(cfg->readIntListEntry("Splitter",def)); -} - -void KviDebugWindow::fillCaptionBuffers() -{ - static QString begin("<nobr><font color=\""); - static QString boldbegin("\"><b>"); - static QString end("</b></font></nobr>"); - - m_szPlainTextCaption = windowName(); - - m_szHtmlActiveCaption = begin; - m_szHtmlActiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name(); - m_szHtmlActiveCaption += boldbegin; - m_szHtmlActiveCaption += windowName(); - m_szHtmlActiveCaption += end; - - m_szHtmlInactiveCaption = begin; - m_szHtmlInactiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name(); - m_szHtmlInactiveCaption += boldbegin; - m_szHtmlInactiveCaption += windowName(); - m_szHtmlInactiveCaption += end; -} - -QPixmap * KviDebugWindow::myIconPtr() -{ - return g_pIconManager->getSmallIcon(KVI_SMALLICON_BUG); -} - -void KviDebugWindow::resizeEvent(QResizeEvent *e) -{ - int hght = m_pInput->heightHint(); - m_pSplitter->setGeometry(0,0,width(),height() - hght); - m_pInput->setGeometry(0,height() - hght,width(),hght); -} - -QSize KviDebugWindow::sizeHint() const -{ - QSize ret(m_pSplitter->sizeHint().width(),m_pIrcView->sizeHint().height() + m_pInput->heightHint()); - return ret; -} - diff --git a/3.4.0/src/kvirc/ui/kvi_debugwindow.h b/3.4.0/src/kvirc/ui/kvi_debugwindow.h deleted file mode 100644 index ca630e8e30..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_debugwindow.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef _KVI_DEBUGWINDOW_H_ -#define _KVI_DEBUGWINDOW_H_ -//============================================================================= -// -// File : kvi_debugwindow.h -// Creation date : Sun Jul 18 2005 14:14:00 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2005 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_window.h" -#include "kvi_string.h" - -class QSplitter; - -class KVIRC_API KviDebugWindow : public KviWindow -{ - Q_OBJECT -public: - KviDebugWindow(); - ~KviDebugWindow(); -protected: - static KviDebugWindow * m_pInstance; -public: - static KviDebugWindow * instance(){ return m_pInstance; }; - static KviDebugWindow * getInstance(); -protected: - virtual QPixmap * myIconPtr(); - virtual void fillCaptionBuffers(); - virtual void resizeEvent(QResizeEvent *e); - virtual void loadProperties(KviConfig * cfg); - virtual void saveProperties(KviConfig * cfg); - virtual void getBaseLogFileName(QString &buffer); - virtual QSize sizeHint() const; -}; - -#endif //_KVI_DEBUGWINDOW_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_dynamictooltip.cpp b/3.4.0/src/kvirc/ui/kvi_dynamictooltip.cpp deleted file mode 100644 index 42a386a9a1..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_dynamictooltip.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// -// File : kvi_dynamictooltip.cpp -// Creation date : Wed Nov 01 2000 15:25:11 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_dynamictooltip.h" - -KviDynamicToolTipHelper::KviDynamicToolTipHelper(QWidget * parent,KviDynamicToolTip * parToolTip) -: KviTalToolTip(parent) -{ - m_pParentToolTip = parToolTip; -} - -KviDynamicToolTipHelper::~KviDynamicToolTipHelper() -{ -} - -void KviDynamicToolTipHelper::maybeTip(const QPoint & pnt) -{ - m_pParentToolTip->maybeTip(pnt); -} - -KviDynamicToolTip::KviDynamicToolTip(QWidget * parent,const char * name) -: QObject(parent,name) -{ - m_pHelper = new KviDynamicToolTipHelper(parent,this); -} - -KviDynamicToolTip::~KviDynamicToolTip() -{ - delete m_pHelper; -} - -void KviDynamicToolTip::maybeTip(const QPoint &pnt) -{ - emit tipRequest(this,pnt); -} - -void KviDynamicToolTip::tip(const QRect &rct,const QString & text) -{ - m_pHelper->tip(rct,text); -} - -#include "kvi_dynamictooltip.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_dynamictooltip.h b/3.4.0/src/kvirc/ui/kvi_dynamictooltip.h deleted file mode 100644 index daa91348ef..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_dynamictooltip.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef _KVI_DYNAMICTOOLTIP_H_ -#define _KVI_DYNAMICTOOLTIP_H_ - -// -// File : kvi_dynamictooltip.h -// Creation date : Wed Nov 01 2000 15:23:12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_tal_tooltip.h" -#include <qobject.h> - -class KviDynamicToolTip; - -class KVIRC_API KviDynamicToolTipHelper : public KviTalToolTip -{ - friend class KviDynamicToolTip; -protected: - KviDynamicToolTipHelper(QWidget * parent,KviDynamicToolTip * parToolTip); - virtual ~KviDynamicToolTipHelper(); -protected: - KviDynamicToolTip * m_pParentToolTip; -protected: - virtual void maybeTip(const QPoint &pnt); -}; - -class KVIRC_API KviDynamicToolTip : public QObject -{ - friend class KviDynamicToolTipHelper; - Q_OBJECT -public: - KviDynamicToolTip(QWidget * parent,const char * name = 0); - virtual ~KviDynamicToolTip(); -protected: - KviDynamicToolTipHelper * m_pHelper; -public: - void tip(const QRect &rct,const QString & text); -protected: - void maybeTip(const QPoint &pnt); -signals: - void tipRequest(KviDynamicToolTip *tip,const QPoint &pnt); -}; - -#endif //!_KVI_DYNAMICTOOLTIP_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_filedialog.cpp b/3.4.0/src/kvirc/ui/kvi_filedialog.cpp deleted file mode 100644 index cf51924bcc..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_filedialog.cpp +++ /dev/null @@ -1,229 +0,0 @@ -// -// File : kvi_filedialog.cpp -// Creation date : Mon Nov 20 2000 12:20:42 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_filedialog.h" -#include "kvi_mediatype.h" -#include "kvi_iconmanager.h" -#include "kvi_locale.h" -#include "kvi_app.h" -#include "kvi_fileutils.h" -#include "kvi_frame.h" -#include "kvi_qstring.h" - -#include <qdir.h> -#include "kvi_tal_tooltip.h" -#include <qmessagebox.h> - -extern KviMediaManager * g_pMediaManager; - - -KviFileDialog::KviFileDialog(const QString &dirName, const QString &filter, - QWidget *parent, const char *name, bool modal) -: KviTalFileDialog(dirName,filter,parent,name,modal) -{ - - setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_FOLDER))); - -} - -KviFileDialog::~KviFileDialog() -{ -} - - -/* -void KviFileDialog::goKvirc() -{ - - KviStr tmp; - g_pApp->getLocalKvircDirectory(tmp,KviApp::None); - setDir(QDir(tmp.ptr())); - -} - -void KviFileDialog::goHome() -{ - - setDir(QDir::home()); - -} -*/ - - - -bool KviFileDialog::askForOpenFileName(QString &buffer,const QString &caption,const QString &initial,const QString &filter,bool showHidden, bool showNative,QWidget* parent) -{ -#ifdef COMPILE_ON_WINDOWS - if(showNative) - { - buffer=QFileDialog::getOpenFileName(initial,filter,parent,"open_file_name_dialog",caption); - KviFileUtils::adjustFilePath(buffer); - return !buffer.isEmpty(); - } -#endif - KviFileDialog * d = new KviFileDialog(initial,filter,parent,"open_file_name_dialog",true); - d->setCaption(caption); - d->setMode(QFileDialog::ExistingFile); - //d->setShowHiddenFiles(showHidden); - if(d->exec() == QDialog::Accepted) - { - buffer = d->selectedFile(); - KviFileUtils::adjustFilePath(buffer); - delete d; - return !buffer.isEmpty(); - } - delete d; - return false; -} - - -bool KviFileDialog::askForSaveFileName(QString &buffer,const QString & caption,const QString &initial,const QString &filter,bool showHidden,bool bConfirmOverwrite,bool showNative,QWidget* parent) -{ - #ifdef COMPILE_ON_WINDOWS - if (showNative) - { - while (1) - { - buffer=QFileDialog::getSaveFileName(initial,filter,parent,"save_file_name_dialog",caption); - KviFileUtils::adjustFilePath(buffer); - //return !buffer.isEmpty(); - if(buffer.isEmpty()) return false; - if(!bConfirmOverwrite) return true; - // Check for the file existence - if(!KviFileUtils::fileExists(buffer)) return true; - QString tmp; - KviQString::sprintf(tmp,__tr2qs("The file %s already exists.<br>Do you wish to overwrite it?"),buffer.utf8().data()); - switch(QMessageBox::information(parent,__tr2qs("File Exists - KVIrc"),tmp,QMessageBox::Yes,QMessageBox::No | QMessageBox::Default,QMessageBox::Cancel | QMessageBox::Escape)) - { - case QMessageBox::Cancel: return false; break; - case QMessageBox::Yes: return true; break; - } - - } - - - } - #endif - - - KviFileDialog * d = new KviFileDialog(initial,filter,parent,"save_file_name_dialog",true); - d->setCaption(caption); - d->setMode(QFileDialog::AnyFile); - //d->setShowHiddenFiles(showHidden); - - while(d->exec() == QDialog::Accepted) - { - buffer = d->selectedFile(); - KviFileUtils::adjustFilePath(buffer); - - if(!buffer.isEmpty()) - { - if(!bConfirmOverwrite) - { - delete d; - return true; - } - // Check for the file existence - if(KviFileUtils::fileExists(buffer)) - { - QString tmp; - KviQString::sprintf(tmp,__tr2qs("The file %s already exists.<br>Do you wish to overwrite it?"),buffer.utf8().data()); - switch(QMessageBox::information(d,__tr2qs("File Exists - KVIrc"),tmp,QMessageBox::Yes,QMessageBox::No | QMessageBox::Default,QMessageBox::Cancel | QMessageBox::Escape)) - { - case QMessageBox::Cancel: delete d; return false; break; - case QMessageBox::Yes: delete d; return true; break; - } - } else { - delete d; - return true; // ok...file not exists - } - } else { - delete d; - return false; // empty buffer - } - } - - delete d; - return false; - -} - -bool KviFileDialog::askForDirectoryName(QString &buffer,const QString & caption,const QString & initial,const char * filter,bool showHidden,bool showNative,QWidget* parent) -{ -#ifdef COMPILE_ON_WINDOWS - if(showNative) - { - buffer = QFileDialog::getExistingDirectory(initial,parent,"open_file_name_dialog",caption); - return !buffer.isEmpty(); - } -#else - #ifdef COMPILE_KDE_SUPPORT - // the KDE based dir selection dialog is now quite nice - buffer = KFileDialog::getExistingDirectory(initial,parent,caption); - return !buffer.isEmpty(); - #endif -#endif - - KviFileDialog * d = new KviFileDialog(initial, - filter,parent,"directory_name_dialog",true); - d->setCaption(caption); - d->setMode(QFileDialog::Directory); - //d->setShowHiddenFiles(showHidden); - if(d->exec() == QDialog::Accepted) - { - buffer = d->selectedFile(); - KviFileUtils::adjustFilePath(buffer); - delete d; - return !buffer.isEmpty(); - } - delete d; - - return false; -} - - -bool KviFileDialog::askForOpenFileNames(QStringList &buffer,const QString & caption,const QString & initial,const char * filter,bool showHidden,bool showNative,QWidget* parent) -{ - #ifdef COMPILE_ON_WINDOWS - if (showNative) - { - buffer=QFileDialog::getOpenFileNames(filter,initial,parent,"open_file_name_dialog",caption); - return (buffer.count()>0); - } - - #endif - KviFileDialog * d = new KviFileDialog(initial,filter ? QString(filter) : QString::null,parent,"open_file_names_dialog",true); - d->setCaption(caption); - d->setMode(QFileDialog::ExistingFiles); - //d->setShowHiddenFiles(showHidden); - if(d->exec() == QDialog::Accepted) - { - buffer = d->selectedFiles(); - delete d; - return (buffer.count() > 0); - } - delete d; - return false; -} - - -#include "kvi_filedialog.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_filedialog.h b/3.4.0/src/kvirc/ui/kvi_filedialog.h deleted file mode 100644 index 4631c1cc68..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_filedialog.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef _KVI_FILEDIALOG_H_ -#define _KVI_FILEDIALOG_H_ - -// -// File : kvi_filedialog.h -// Creation date : Mon Nov 20 2000 03:52:12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// - -#ifdef Unsorted - #undef Unsorted -#endif -#include "kvi_settings.h" -#include "kvi_string.h" - - -#include "kvi_tal_filedialog.h" - -#include <qstringlist.h> - - -class KVIRC_API KviFileDialog : public KviTalFileDialog -{ - Q_OBJECT -public: - KviFileDialog(const QString &dirName, const QString &filter=QString::null, - QWidget *parent=0, const char *name=0, bool modal=false); - ~KviFileDialog(); -public: - static bool askForOpenFileName(QString &buffer,const QString & caption,const QString &initial = QString::null,const QString &filter = QString::null,bool showHidden = false,bool showNative = true,QWidget* parent=0); - static bool askForSaveFileName(QString &buffer,const QString & caption,const QString &initial = QString::null,const QString &filter = QString::null,bool showHidden = false,bool bConfirmOverwrite = false,bool showNative = true,QWidget* parent=0); - - static bool askForDirectoryName(QString &buffer,const QString & caption,const QString & initial,const char * filter = 0,bool showHidden = false,bool showNative=true,QWidget* parent=0); - static bool askForOpenFileNames(QStringList &buffer,const QString & caption,const QString & initial,const char * filter = 0,bool showHidden = false,bool showNative=true,QWidget* parent=0); - -}; - - -#endif //_KVI_FILEDIALOG_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_frame.cpp b/3.4.0/src/kvirc/ui/kvi_frame.cpp deleted file mode 100644 index 95e32fc0ae..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_frame.cpp +++ /dev/null @@ -1,1450 +0,0 @@ -//============================================================================= -// -// File : kvi_frame.cpp -// Creation date : Sun Jun 18 2000 17:59:02 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#define _KVI_FRAME_CPP_ - -#include "kvi_debug.h" -#include "kvi_app.h" -#include "kvi_settings.h" -#include "kvi_frame.h" -#include "kvi_options.h" -#include "kvi_menubar.h" -#include "kvi_mdimanager.h" -#include "kvi_mdichild.h" -#include "kvi_iconmanager.h" -#include "kvi_window.h" -#include "kvi_taskbar.h" -#include "kvi_console.h" -#include "kvi_config.h" -#include "kvi_internalcmd.h" -#include "kvi_console.h" -#include "kvi_debug.h" -#include "kvi_irctoolbar.h" -#include "kvi_confignames.h" -#include "kvi_parameterlist.h" -#include "kvi_module.h" -#include "kvi_mextoolbar.h" -#include "kvi_locale.h" -#include "kvi_irccontext.h" -#include "kvi_statusbar.h" -#include "kvi_customtoolbar.h" -#include "kvi_customtoolbarmanager.h" -#include "kvi_customtoolbardescriptor.h" -#include "kvi_actionmanager.h" -#include "kvi_defaults.h" -#include "kvi_ircview.h" -#include "kvi_tal_popupmenu.h" - -#include "kvi_kvs_script.h" -#include "kvi_kvs_eventtriggers.h" - -#include <qsplitter.h> -#include <qvariant.h> -#include <qlineedit.h> -#include <qmessagebox.h> -#include <qcheckbox.h> - -#include <qtimer.h> -#include <qlayout.h> - -#if QT_VERSION >= 300 - #include <qfile.h> - #include <qtextstream.h> - #ifdef COMPILE_USE_QT4 - #include <q3dockarea.h> - #define QDockArea Q3DockArea - #else - #include <qdockarea.h> - #endif -#endif - - -#ifdef COMPILE_USE_QT4 - #include <qdesktopwidget.h> - #include <qevent.h> - #include <QShortcut> -#else - #include <qaccel.h> -#endif - -#include <time.h> - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - #include <qpixmap.h> - // kvi_app.h - extern QPixmap * g_pShadedParentGlobalDesktopBackground; - extern QPixmap * g_pShadedChildGlobalDesktopBackground; -// FIXME: #warning "When a toolbar is moved , MdiManager is resized but does not update the MdiChild backgrounds" -#endif - -// Declared and managed by KviApp (kvi_app.cpp) -extern KviConfig * g_pWinPropertiesConfig; -KVIRC_API KviFrame * g_pFrame = 0; // the one and only frame object - -KviFrame::KviFrame() -: KviTalMainWindow(0,"kvirc_frame") -{ - g_pFrame = this; - - setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_KVIRC))); - - m_pWinList = new KviPointerList<KviWindow>; - m_pWinList->setAutoDelete(false); - - m_pModuleExtensionToolBarList = new KviPointerList<KviMexToolBar>; - m_pModuleExtensionToolBarList->setAutoDelete(false); - - m_pActiveContext = 0; - - m_pDockExtension = 0; - - m_pSplitter = new QSplitter(Qt::Horizontal,this,"main_splitter"); -// m_pSplitter->setFrameShape(QFrame::NoFrame); - - setCentralWidget(m_pSplitter); - - setUsesBigPixmaps(KVI_OPTION_BOOL(KviOption_boolUseBigIcons)); - - m_pMdi = new KviMdiManager(m_pSplitter,this,"mdi_manager"); - connect(m_pMdi,SIGNAL(enteredSdiMode()),this,SLOT(enteredSdiMode())); - connect(m_pMdi,SIGNAL(leftSdiMode()),this,SLOT(leftSdiMode())); - - // This theoretically had to exists before KviMdiManager (that uses enterSdiMode) - m_pMenuBar = new KviMenuBar(this,"main_menu_bar"); -#ifdef COMPILE_USE_QT4 - setMenuWidget(m_pMenuBar); -#endif - - if(KVI_OPTION_BOOL(KviOption_boolStatusBarVisible)) - { - m_pStatusBar = new KviStatusBar(this); -#ifdef COMPILE_USE_QT4 - setStatusBar(m_pStatusBar); -#endif - // torque: moved out of status bar constructor - // because module init functions exectued in load() - // couldn't access the status bar via g_pFrame->mainStatusBar() - // (assignment of m_pStatusBar happened after load() and - // the init function) - m_pStatusBar->load(); - - } else - m_pStatusBar = 0; - - m_pTaskBar = 0; - - createTaskBar(); - - if((KVI_OPTION_RECT(KviOption_rectFrameGeometry).width() < 100) || (KVI_OPTION_RECT(KviOption_rectFrameGeometry).height() < 100)) - { - // Try to find some reasonable defaults - KVI_OPTION_RECT(KviOption_rectFrameGeometry) = QRect(10,10,g_pApp->desktop()->width() - 200,g_pApp->desktop()->height() - 150); - } - - resize(KVI_OPTION_RECT(KviOption_rectFrameGeometry).width(), - KVI_OPTION_RECT(KviOption_rectFrameGeometry).height()); - move(KVI_OPTION_RECT(KviOption_rectFrameGeometry).x(), - KVI_OPTION_RECT(KviOption_rectFrameGeometry).y()); - - applyOptions(); - - - m_pAccel = new KviAccel(this); - - installAccelerators(this); - - layout()->setResizeMode(QLayout::FreeResize); -} - -KviFrame::~KviFrame() -{ - KVI_OPTION_RECT(KviOption_rectFrameGeometry) = QRect(pos().x(),pos().y(), - size().width(),size().height()); - - KVI_OPTION_BOOL(KviOption_boolUseBigIcons) = usesBigPixmaps(); - KVI_OPTION_BOOL(KviOption_boolMdiManagerInSdiMode) = m_pMdi->isInSDIMode(); - KVI_OPTION_BOOL(KviOption_boolStatusBarVisible) = m_pStatusBar ? true : false; - - KviCustomToolBarManager::instance()->storeVisibilityState(); - - saveToolBarPositions(); - saveModuleExtensionToolBars(); - - // Call the frame destructor callback AFTER saving the toolbar positions - // This is because the destructor callback kills alls the KVS objects - // and thus the eventual user toolbar objects too and their position - // wouldn't be saved if they are shown at startup. - - g_pApp->frameDestructorCallback(); - - // Now start killing stuff - - // Explicitly kill all the module extension toolbars: qt has NOT to delete them: we must call their "die" method - while(KviMexToolBar * t = m_pModuleExtensionToolBarList->first())t->die(); - delete m_pModuleExtensionToolBarList; - - KVI_OPTION_BOOL(KviOption_boolShowDockExtension) = m_pDockExtension; - - if(m_pDockExtension) - { - m_pDockExtension->die(); - m_pDockExtension = 0; - } - - // the really last thing to do : close all the windows - while(m_pWinList->first()) - closeWindow(m_pWinList->first()); - delete m_pWinList; - - delete m_pAccel; - g_pFrame = 0; -} - -int KviFrame::registerAccelerator(const QString &szKeySequence,QObject * recv,const char * slot) -{ - int id = m_pAccel->insertItem(szKeySequence); - m_pAccel->connectItem(id,recv,slot); - return id; -} - -void KviFrame::unregisterAccelerator(int id) -{ - m_pAccel->removeItem(id); -} - -void KviFrame::registerModuleExtensionToolBar(KviMexToolBar * t) -{ - m_pModuleExtensionToolBarList->append(t); -} - -void KviFrame::unregisterModuleExtensionToolBar(KviMexToolBar * t) -{ - m_pModuleExtensionToolBarList->removeRef(t); -} - -void KviFrame::restoreModuleExtensionToolBars() -{ - for(QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistModuleExtensionToolbars).begin();it != KVI_OPTION_STRINGLIST(KviOption_stringlistModuleExtensionToolbars).end();++it) - { - QString szEntry = *it; - int idx = szEntry.find(':'); - if(idx != -1) - { - QString szMod = szEntry.left(idx); - szEntry.remove(0,idx + 1); - g_pModuleExtensionManager->allocateExtension("toolbar",KviStr(szEntry),firstConsole(),0,0,szMod); - } - } -} - -void KviFrame::saveModuleExtensionToolBars() -{ - KVI_OPTION_STRINGLIST(KviOption_stringlistModuleExtensionToolbars).clear(); - - for(KviMexToolBar * t = m_pModuleExtensionToolBarList->first();t;t = m_pModuleExtensionToolBarList->next()) - { - QString s = t->descriptor()->module()->name(); - s += ":"; - s += t->descriptor()->name().ptr(); - - //debug("FOUND TOOLBAR %s",t->descriptor()->name().ptr()); - - KVI_OPTION_STRINGLIST(KviOption_stringlistModuleExtensionToolbars).append(s); - } -} - -KviMexToolBar * KviFrame::moduleExtensionToolBar(int extensionId) -{ - for(KviMexToolBar * t = m_pModuleExtensionToolBarList->first();t;t = m_pModuleExtensionToolBarList->next()) - { - if(extensionId == t->descriptor()->id())return t; - } - return 0; -} - -/* - @doc: keyboard - @type: - generic - @title: - Keyboard shortcuts - @keyterms: - Keyboard shortcuts - @short: - The list of the common keyboard shortcuts - @body: - [b]Ctrl+LeftArrow[/b]: Selection left to the previous word[br] - [b]Ctrl+RightArrow[/b]: Selection right to the next word[br] - [b]Ctrl+Shift+LeftArrow[/b]: Previous word[br] - [b]Ctrl+Shift+RightArrow[/b]: Next word[br] - [b]Alt+LeftArrow[/b]: Previous window[br] - [b]Alt+RightArrow[/b]: Next window[br] - [b]Alt+Shift+LeftArrow[/b]: Previous window in the same IRC context[/b] - [b]Alt+Shift+RightArrow[/b]: Next window in the same IRC context[/b] - [b]Ctrl+UpArrow[/b]: Maximize current window[br] - [b]Ctrl+DownArrow[/b] or [b]ESC[/b]: Minimize current window[br] - [b]Ctrl+<digit>[/b], [b]F1-F12[/b], [b]Shift+(F1-F12)[/b]: Script accelerators (see [event:onaccelkeypressed]OnAccelKeyPressed[/event])[br] - [b]Shift+<F1-F12>[/b] window switch[br] - [b]Tab in the first word of input[/b]: Completes nicknames in the current channel or query[br] - [b]Tab after a leading /[/b]: Completes commands[br] - [b]Tab after a / in the middle of input[/b]: Completes directories[br] - [b]Tab after a $[/b]: Completes function names[br] - [b]Shift+Tab after the first word of input[/b]: completes masks in the current channel or query[br] - [b]Ctrl+B[/b]: Inserts the 'bold' mIRC text control character[br] - [b]Ctrl+K[/b]: Inserts the 'color' mIRC text control character[br] - [b]Ctrl+R[/b]: Inserts the 'reverse' mIRC text control character[br] - [b]Ctrl+U[/b]: Inserts the 'underline' mIRC text control character[br] - [b]Ctrl+O[/b]: Inserts the 'reset' mIRC text control character[br] - [b]Ctrl+P[/b]: Inserts the 'non-crypt' (plain text) KVIrc control character used to disable encryption of the current text line[br] - [b]Ctrl+C[/b]: Copies the selected text to clipboard[br] - [b]Ctrl+X[/b]: Cuts the selected text[br] - [b]Ctrl+V[/b]: Pastes the clipboard contents (same as middle mouse click)[br] - [b]Ctrl+I[/b]: Inserts the 'icon' control code and pops up the icon list box - [b]CursorUp[/b]: Moves backward in the command history[br] - [b]CursorDown[/b]: Moves forward in the command history[br] - [b]Ctrl+PageUp[/b]: Opens the history popup[br] - [b]CursorRight[/b]: Moves the cursor to the right[br] - [b]CursorLeft[/b]: Moves the cursor to the left :)[br] - [b]Shift+CursorLeft[/b]: Moves the selection to the left[br] - [b]Shift+RightCursor[/b]: Moves the selection to the right[br] - [b]PageUp[/b]: Scrolls the output window up one page[br] - [b]PageDown[/b]: Scrolls the output window down one page[b] - [b]Shift+PageUp[/b]: Scrolls the output window up one line[br] - [b]Shift+PageDown[/b]: Scrolls the output window down one line[b] - [b]Alt+lt;numeric_sequence>[/b]: Inserts the character by ASCII/Unicode code[br] - [b]Ctrl+Backspace[/b]: Shows or hides the multiline editor[br] - [b]Ctrl+F4[/b]: Closes the current window[br] - <example> - Alt+32: Inserts ASCII/Unicode character 32: ' ' (a space) - Alt+00032: Same as above :) - Alt+13: Inserts the Carriage Return (CR) control character - Alt+77: Inserts ASCII/Unicode character 77: 'M' - Alt+23566: Inserts Unicode character 23566 (an ideogram) - </example> -*/ - -KviAccel * KviFrame::installAccelerators(QWidget * wnd) -{ - QWidget * pParent = wnd ? (QWidget *)wnd : (QWidget *)this; -#ifdef COMPILE_USE_QT4 - new QShortcut(QKeySequence(Qt::Key_Left + Qt::ALT),pParent,SLOT(switchToPrevWindow())); - new QShortcut(QKeySequence(Qt::Key_Right + Qt::ALT),pParent,SLOT(switchToNextWindow())); - new QShortcut(QKeySequence(Qt::Key_Up + Qt::CTRL),pParent,SLOT(maximizeWindow())); - new QShortcut(QKeySequence(Qt::Key_Down + Qt::CTRL),pParent,SLOT(minimizeWindow())); - new QShortcut(QKeySequence(Qt::Key_Escape +Qt::CTRL),pParent,SLOT(minimizeWindow())); - new QShortcut(QKeySequence(Qt::Key_Left + Qt::ALT + Qt::SHIFT),pParent,SLOT(switchToPrevWindowInContext())); - new QShortcut(QKeySequence(Qt::Key_Right + Qt::ALT + Qt::SHIFT),pParent,SLOT(switchToNextWindowInContext())); -#endif - KviAccel *ac = new KviAccel(pParent); - - static int accel_table[] = { - Qt::Key_Left + Qt::ALT , // prev window - Qt::Key_Right + Qt::ALT , // next window - Qt::Key_Up + Qt::CTRL , // maximize window - Qt::Key_Down + Qt::CTRL , // minimize window - Qt::Key_Escape +Qt::CTRL, // minimize window - Qt::Key_Left + Qt::ALT + Qt::SHIFT , // prev window in context - Qt::Key_Right + Qt::ALT + Qt::SHIFT, // next window in context - Qt::Key_F4 + Qt::CTRL , // close current window - Qt::Key_1 + Qt::CTRL , // script accels... - Qt::Key_2 + Qt::CTRL , - Qt::Key_3 + Qt::CTRL , - Qt::Key_4 + Qt::CTRL , - Qt::Key_5 + Qt::CTRL , - Qt::Key_6 + Qt::CTRL , - Qt::Key_7 + Qt::CTRL , - Qt::Key_8 + Qt::CTRL , - Qt::Key_9 + Qt::CTRL , - Qt::Key_0 + Qt::CTRL , - Qt::Key_F1 , // reserved for context sensitive help - Qt::Key_F2 , - Qt::Key_F3 , - Qt::Key_F4 , - Qt::Key_F5 , - Qt::Key_F6 , - Qt::Key_F7 , - Qt::Key_F8 , - Qt::Key_F9 , - Qt::Key_F10 , - Qt::Key_F11 , - Qt::Key_F12 , -/* Qt::Key_F1 + Qt::SHIFT , // window select... - Qt::Key_F2 + Qt::SHIFT , - Qt::Key_F3 + Qt::SHIFT , - Qt::Key_F4 + Qt::SHIFT , - Qt::Key_F5 + Qt::SHIFT , - Qt::Key_F6 + Qt::SHIFT , - Qt::Key_F7 + Qt::SHIFT , - Qt::Key_F8 + Qt::SHIFT , - Qt::Key_F9 + Qt::SHIFT , - Qt::Key_F10 + Qt::SHIFT , - Qt::Key_F11 + Qt::SHIFT , - Qt::Key_F12 + Qt::SHIFT ,*/ - 0 - }; - - int i=0; - int keys; - while((keys = accel_table[i])) - { - ac->insertItem(keys); - i++; - } - - connect(ac,SIGNAL(activated(int)),this,SLOT(accelActivated(int))); - return ac; -} - -void KviFrame::accelActivated(int id) -{ - KviAccel * acc = (KviAccel *)sender(); - - int keys = (int)(acc->key(id)); - KviTaskBarItem *item = 0; - debug("accel"); - switch(keys) - { - case (Qt::Key_Left+Qt::ALT): switchToPrevWindow(); break; - case (Qt::Key_Right+Qt::ALT): switchToNextWindow(); break; - case (Qt::Key_Up+Qt::CTRL): maximizeWindow(); break; - case (Qt::Key_Escape+Qt::CTRL): - case (Qt::Key_Down+Qt::CTRL): minimizeWindow(); break; - case (Qt::Key_Left+Qt::ALT+Qt::SHIFT): switchToPrevWindowInContext(); break; - case (Qt::Key_Right+Qt::ALT+Qt::SHIFT): switchToNextWindowInContext(); break; - case (Qt::Key_F4+Qt::CTRL): if(g_pActiveWindow)g_pActiveWindow->close(); break; - case (Qt::Key_F1): g_pApp->contextSensitiveHelp(); break; -/* case(Qt::Key_F1 + SHIFT): - item = m_pTaskBar->item(0); - if(item) setActiveWindow(item->window()); - break; - case(Qt::Key_F2 + SHIFT): - item = m_pTaskBar->item(1); - if(item) setActiveWindow(item->window()); - break; - case(Qt::Key_F3 + SHIFT): - item = m_pTaskBar->item(2); - if(item) setActiveWindow(item->window()); - break; - case(Qt::Key_F4 + SHIFT): - item = m_pTaskBar->item(3); - if(item) setActiveWindow(item->window()); - break; - case(Qt::Key_F5 + SHIFT): - item = m_pTaskBar->item(4); - if(item) setActiveWindow(item->window()); - break; - case(Qt::Key_F6 + SHIFT): - item = m_pTaskBar->item(5); - if(item) setActiveWindow(item->window()); - break; - case(Qt::Key_F7 + SHIFT): - item = m_pTaskBar->item(6); - if(item) setActiveWindow(item->window()); - break; - case(Qt::Key_F8 + SHIFT): - item = m_pTaskBar->item(7); - if(item) setActiveWindow(item->window()); - break; - case(Qt::Key_F9 + SHIFT): - item = m_pTaskBar->item(8); - if(item) setActiveWindow(item->window()); - break; - case(Qt::Key_F10 + SHIFT): - item = m_pTaskBar->item(9); - if(item) setActiveWindow(item->window()); - break; - case(Qt::Key_F11 + SHIFT): - item = m_pTaskBar->item(10); - if(item) setActiveWindow(item->window()); - break; - case(Qt::Key_F12 + SHIFT): - item = m_pTaskBar->item(11); - if(item) setActiveWindow(item->window()); - break;*/ - default: - { - KVS_TRIGGER_EVENT_1(KviEvent_OnAccelKeyPressed,g_pActiveWindow,(QString)(acc->key(id))); - } - break; - }; -} - -void KviFrame::executeInternalCommand(int index) -{ - KviKvsScript::run(kvi_getInternalCommandBuffer(index),firstConsole()); -} - - -void KviFrame::saveWindowProperties(KviWindow * wnd,const char * szSection) -{ - g_pWinPropertiesConfig->setGroup(szSection); - g_pWinPropertiesConfig->writeEntry("EntryTimestamp",(unsigned int)time(0)); - - // Allow max 80 window properties to be floating around - while(g_pWinPropertiesConfig->groupsCount() > 80) - { - // Kill the oldest group - KviConfigIterator it(*(g_pWinPropertiesConfig->dict())); - KviStr minKey; - unsigned int minVal = time(0); - while(it.current() && minVal) - { - QString * pVal = it.current()->find("EntryTimestamp"); - if(pVal) - { - bool bOk; - unsigned int uVal = pVal->toUInt(&bOk); - if(bOk) - { - if(uVal < minVal) - { - minVal = uVal; - minKey = it.currentKey(); - } - } else { - minVal = 0; - minKey = it.currentKey(); - } - } else { - minVal = 0; - minKey = it.currentKey(); - } - ++it; - } - - if(minKey.hasData())g_pWinPropertiesConfig->clearGroup(minKey.ptr()); - else debug("Oops...no minimum key found!"); - } - - // The following line should NOT be needed...but just to be sure... - g_pWinPropertiesConfig->setGroup(szSection); - - g_pWinPropertiesConfig->writeEntry("IsDocked",wnd->mdiParent()); - -// KviWindow * top = g_pActiveWindow; -// if(!top)top = wnd; -// g_pWinPropertiesConfig->writeEntry("IsMaximized",top->isMaximized()); - - g_pWinPropertiesConfig->writeEntry("WinRect",wnd->externalGeometry()); - - wnd->saveProperties(g_pWinPropertiesConfig); -} - -void KviFrame::closeWindow(KviWindow *wnd) -{ - // notify the destruction - wnd->triggerDestructionEvents(); - - // save it's properties - if(KVI_OPTION_BOOL(KviOption_boolWindowsRememberProperties)) // && (wnd->type() == KVI_WINDOW_TYPE_CHANNEL)) - { - QString group; - wnd->getConfigGroupName(group); - // not uses default settings : store it always - saveWindowProperties(wnd,group); - } - - // forget it... - m_pWinList->removeRef(wnd); - - // hide it - if(wnd->mdiParent())wnd->mdiParent()->hide(); - else wnd->hide(); - - if(wnd == g_pActiveWindow) - { - // we need another active window before destroying it - KviMdiChild * pMdiChild = wnd->mdiParent(); - if(pMdiChild) - { - pMdiChild = m_pMdi->highestChildExcluding(pMdiChild); - } else { - // the best candidate for the new active window - // is the top mdiManager's child - pMdiChild = m_pMdi->topChild(); - } - KviWindow * pCandidate; - if(pMdiChild) - { - pCandidate = (KviWindow *)(pMdiChild->client()); - } else { - pCandidate = m_pWinList->first(); - if(pCandidate == wnd)pCandidate = 0; - } - - if(pCandidate) - childWindowActivated(pCandidate); - // else { m_pActiveWindow = 0; m_pActiveContext = 0; }; - } - - if(wnd == g_pActiveWindow) // ops... :/ ... this happens only at shutdown - { - g_pActiveWindow = 0; - m_pActiveContext = 0; - } - - // and shut it down... - // KviWindow will call childWindowDestroyed() here - if(wnd->mdiParent())m_pMdi->destroyChild(wnd->mdiParent(),true); - else delete wnd; -} - - -void KviFrame::addWindow(KviWindow *wnd,bool bShow) -{ - m_pWinList->append(wnd); - wnd->createTaskBarItem(); // create the window taskbar item AFTER it has been constructed - - QString group; - wnd->getConfigGroupName(group); - - bool bGroupSettings = false; - - if(g_pWinPropertiesConfig->hasGroup(group)) - { - g_pWinPropertiesConfig->setGroup(group); - } else { - bGroupSettings = true; - if(g_pWinPropertiesConfig->hasGroup(wnd->typeString())) - { - g_pWinPropertiesConfig->setGroup(wnd->typeString()); - } else { - g_pWinPropertiesConfig->setGroup("no_settings_group"); - wnd->loadProperties(g_pWinPropertiesConfig); // load it anyway (will set defaults if windows don't remember properties) - goto default_docking; // no settings stored - } - } - - { - wnd->loadProperties(g_pWinPropertiesConfig); // load it anyway (will set defaults if windows don't remember properties) - - if(KVI_OPTION_BOOL(KviOption_boolWindowsRememberProperties)) - { - bool bDocked = g_pWinPropertiesConfig->readBoolEntry("IsDocked",true); - //bool bMaximized = g_pWinPropertiesConfig->readBoolEntry("IsMaximized",false); - bool bMaximized; - - if(KVI_OPTION_BOOL(KviOption_boolMdiManagerInSdiMode)) - { - bMaximized = true; - //KVI_OPTION_BOOL(KviOption_boolMdiManagerInSdiMode) = false; - } else bMaximized = false; - - QRect rect = g_pWinPropertiesConfig->readRectEntry("WinRect",QRect(10,10,500,380)); - - if(bDocked) - { - // when group settings are used , we always cascade the windows - // this means that windows that have no specialized config group name - // are always cascaded : this is true for consoles , queries (and other windows) but not channels (and some other windows) - KviMdiChild * lpC = dockWindow(wnd,false,bGroupSettings,&rect); - lpC->setRestoredGeometry(rect); - wnd->triggerCreationEvents(); - if(bShow) - { - m_pMdi->showAndActivate(lpC); - if(bMaximized)wnd->maximize(); - // Handle the special case of this top level widget not being the active one. - // In this situation the child will not get the focusInEvent - // and thus will not call out childWindowActivated() method - if(!isActiveWindow())childWindowActivated(wnd); - } - } else { - wnd->setGeometry(rect); - wnd->triggerCreationEvents(); - if(bShow) - { - wnd->show(); - if(bMaximized)wnd->maximize(); - } - wnd->youAreUndocked(); - if(bShow) - { - wnd->raise(); - wnd->setFocus(); - } - } - goto docking_done; - } - } - -default_docking: - { - KviMdiChild * lpC = dockWindow(wnd,false); //cascade it - wnd->triggerCreationEvents(); - if(bShow) - { - m_pMdi->showAndActivate(lpC); - if(KVI_OPTION_BOOL(KviOption_boolMdiManagerInSdiMode)) wnd->maximize(); - // Handle the special case of this top level widget not being the active one. - // In this situation the child will not get the focusInEvent - // and thus will not call out childWindowActivated() method - if(!isActiveWindow())childWindowActivated(wnd); - } - } -docking_done: - // we like to have an active window.. but don't trigger the events until it is really shown - if(!g_pActiveWindow) - { - g_pActiveWindow = wnd; - m_pActiveContext = wnd->context(); - } -} - -KviMdiChild * KviFrame::dockWindow(KviWindow *wnd,bool bShow,bool bCascade,QRect *setGeom) -{ - if(wnd->mdiParent())return wnd->mdiParent(); - KviMdiChild * lpC = new KviMdiChild(m_pMdi,""); - lpC->setClient(wnd); - wnd->youAreDocked(); - m_pMdi->manageChild(lpC,bCascade,setGeom); - if(bShow)m_pMdi->showAndActivate(lpC); - return lpC; -} - -void KviFrame::undockWindow(KviWindow *wnd) -{ - if(!(wnd->mdiParent()))return; - KviMdiChild * lpC = wnd->mdiParent(); - lpC->unsetClient(); - m_pMdi->destroyChild(lpC,false); - wnd->youAreUndocked(); - wnd->raise(); - wnd->setFocus(); -} - - -void KviFrame::newConsole() -{ - createNewConsole(); -} - -KviConsole * KviFrame::createNewConsole(bool bFirstInFrame) -{ - // the first console must be created BEFORE the toolbars visible - // at startup otherwise we cannot execute script code - // which is necessary for the actions that are going to be added - // to the toolbars - KviConsole * c = new KviConsole(this,bFirstInFrame ? KVI_CONSOLE_FLAG_FIRSTINFRAME : 0); - addWindow(c); - - if(bFirstInFrame) - { - restoreModuleExtensionToolBars(); - KviCustomToolBarManager::instance()->createToolBarsVisibleAtStartup(); - KviActionManager::instance()->delayedRegisterAccelerators(); - restoreToolBarPositions(); - } - - return c; -} - -unsigned int KviFrame::consoleCount() -{ - unsigned int count = 0; - for(KviWindow * wnd = m_pWinList->first();wnd;wnd = m_pWinList->next()) - { - if(wnd->type() == KVI_WINDOW_TYPE_CONSOLE)count++; - } - return count; -} - -KviConsole * KviFrame::firstConsole() -{ - for(KviWindow * wnd = m_pWinList->first();wnd;wnd = m_pWinList->next()) - { - if(wnd->type() == KVI_WINDOW_TYPE_CONSOLE)return (KviConsole *)wnd; - } - __range_valid(false); - return 0; //should newer be here!.. but sometimes we are ? -} - -KviConsole * KviFrame::firstNotConnectedConsole() -{ - for(KviWindow * wnd = m_pWinList->first();wnd;wnd = m_pWinList->next()) - { - if(wnd->type() == KVI_WINDOW_TYPE_CONSOLE) - { - if(!((KviConsole *)wnd)->connectionInProgress()) - return (KviConsole *)wnd; - } - } - return 0; -} - -void KviFrame::childWindowCloseRequest(KviWindow *wnd) -{ - closeWindow(wnd); -} - -void KviFrame::unhighlightWindowsOfContext(KviIrcContext * c) -{ - for(KviWindow *w = m_pWinList->first();w;w = m_pWinList->next()) - if(w->context() == c)w->unhighlight(); -} - -void KviFrame::setActiveWindow(KviWindow *wnd) -{ - // ASSERT(m_pWinList->findRef(wnd)) - if(wnd->isMinimized())wnd->restore(); - if(wnd->mdiParent())wnd->setFocus(); - else wnd->delayedAutoRaise(); -} - -KviIrcConnection * KviFrame::activeConnection() -{ - return m_pActiveContext ? m_pActiveContext->connection() : 0; -} - -void KviFrame::childWindowSelectionStateChange(KviWindow * pWnd,bool bGotSelectionNow) -{ - if(pWnd != g_pActiveWindow)return; - emit activeWindowSelectionStateChanged(bGotSelectionNow); - -} - -void KviFrame::childContextStateChange(KviIrcContext * c) -{ - if(c != m_pActiveContext)return; - emit activeContextStateChanged(); -} - -void KviFrame::childConnectionLagChange(KviIrcConnection * c) -{ - KviIrcContext * ctx = c->context(); - if(ctx != m_pActiveContext)return; - emit activeConnectionLagChanged(); -} - -void KviFrame::childConnectionServerInfoChange(KviIrcConnection * c) -{ - KviIrcContext * ctx = c->context(); - if(ctx != m_pActiveContext)return; - emit activeConnectionServerInfoChanged(); -} - -void KviFrame::childConnectionNickNameChange(KviIrcConnection * c) -{ - KviIrcContext * ctx = c->context(); - if(ctx != m_pActiveContext)return; - emit activeConnectionNickNameChanged(); -} - -void KviFrame::childConnectionAwayStateChange(KviIrcConnection * c) -{ - KviIrcContext * ctx = c->context(); - if(ctx != m_pActiveContext)return; - emit activeConnectionAwayStateChanged(); -} - -void KviFrame::childConnectionUserModeChange(KviIrcConnection * c) -{ - KviIrcContext * ctx = c->context(); - if(ctx != m_pActiveContext)return; - emit activeConnectionUserModeChanged(); -} - - -void KviFrame::childWindowActivated(KviWindow *wnd) -{ - // ASSERT(m_pWinList->findRef(wnd)) - if(g_pActiveWindow == wnd)return; - if(g_pActiveWindow)g_pActiveWindow->lostUserFocus(); - // YES: it's HERE! - g_pActiveWindow = wnd; - - bool bActiveContextChanged = (m_pActiveContext != wnd->context()); - m_pActiveContext = wnd->context(); - - if(wnd->isMaximized() && wnd->mdiParent())updateCaption(); - m_pTaskBar->setActiveItem(wnd->taskBarItem()); - - //wnd->gainedActiveWindowStatus(); // <-- atm unused - - if(g_pActiveWindow->view()) - g_pActiveWindow->view()->clearUnreaded(); - - emit activeWindowChanged(); - if(bActiveContextChanged)emit activeContextChanged(); - - KVS_TRIGGER_EVENT_0(KviEvent_OnWindowActivated,wnd); -} - -void KviFrame::windowActivationChange(bool bOldActive) -{ - // if we have just been activated by the WM - // then update the active window task bar item - // It will then reset its highlight state - // and hopefully make the dock widget work correctly - // in this case. - // This will also trigger the OnWindowActivated event :) - if(isActiveWindow()) - { - if(!bOldActive) - { - if(g_pActiveWindow) - { - KviWindow * pTmp = g_pActiveWindow; - g_pActiveWindow = 0; // really ugly hack! - childWindowActivated(pTmp); - } - } - } else { - if(g_pActiveWindow)g_pActiveWindow->lostUserFocus(); - } -} - -void KviFrame::enteredSdiMode() -{ - updateCaption(); -} - -void KviFrame::leftSdiMode() -{ - updateCaption(); -} - -#define KVI_DEFAULT_FRAME_CAPTION "KVIrc " KVI_VERSION " " KVI_RELEASE_NAME - -void KviFrame::updateCaption() -{ - if(g_pActiveWindow) - { - if(g_pActiveWindow->isMaximized() && g_pActiveWindow->mdiParent()) - { - QString tmp = g_pActiveWindow->plainTextCaption(); - tmp += QChar(' '); - tmp += KVI_DEFAULT_FRAME_CAPTION; - setCaption(tmp); - return; - } - } - setCaption(KVI_DEFAULT_FRAME_CAPTION); -} - - -void KviFrame::closeEvent(QCloseEvent *e) -{ - - if(KVI_OPTION_BOOL(KviOption_boolCloseInTray)) - { - e->ignore(); - - if(!dockExtension()) - { - executeInternalCommand(KVI_INTERNALCOMMAND_DOCKWIDGET_SHOW); - } - if(dockExtension()) - { - - dockExtension()->setPrevWindowState(windowState()); - QTimer::singleShot( 0, this, SLOT(hide()) ); - } - return; - } - - if(KVI_OPTION_BOOL(KviOption_boolConfirmCloseWhenThereAreConnections)) - { - // check for running connections - - bool bGotRunningConnection = false; - for(KviWindow * w = m_pWinList->first();w;w = m_pWinList->next()) - { - if(w->type() == KVI_WINDOW_TYPE_CONSOLE) - { - if(((KviConsole *)w)->connectionInProgress()) - { - bGotRunningConnection = true; - break; - } - } - } - - if(bGotRunningConnection) - { - QString txt = "<p>"; - txt += __tr2qs("There are active connections, are you sure you wish to "); - txt += __tr2qs("quit KVIrc?"); - txt += "</p>"; - - switch(QMessageBox::warning(this,__tr2qs("Confirmation - KVIrc"),txt,__tr2qs("&Yes"),__tr2qs("&Always"),__tr2qs("&No"),2,2)) - { - case 0: - // ok to close - break; - case 1: - // ok to close but don't ask again - KVI_OPTION_BOOL(KviOption_boolConfirmCloseWhenThereAreConnections) = false; - break; - case 2: - e->ignore(); - return; - break; - } - } - } - - e->accept(); - - if(g_pApp) - g_pApp->destroyFrame(); -} - -void KviFrame::resizeEvent(QResizeEvent *e) -{ - KVI_OPTION_RECT(KviOption_rectFrameGeometry) = QRect(pos().x(),pos().y(), - size().width(),size().height()); - KviTalMainWindow::resizeEvent(e); -} - -void KviFrame::updatePseudoTransparency() -{ -#ifdef COMPILE_PSEUDO_TRANSPARENCY - if(g_pShadedParentGlobalDesktopBackground)m_pMdi->viewport()->update(); - - if(g_pShadedChildGlobalDesktopBackground) - { - for(KviWindow * wnd = m_pWinList->first();wnd;wnd = m_pWinList->next())wnd->updateBackgrounds(); - m_pTaskBar->updatePseudoTransparency(); - } -#endif -} - -void KviFrame::moveEvent(QMoveEvent *e) -{ - KVI_OPTION_RECT(KviOption_rectFrameGeometry) = QRect(pos().x(),pos().y(), - size().width(),size().height()); -#ifdef COMPILE_PSEUDO_TRANSPARENCY - updatePseudoTransparency(); -#endif - KviTalMainWindow::moveEvent(e); -} - -void KviFrame::applyOptions() -{ - m_pMdi->update(); - for(KviWindow * wnd = m_pWinList->first();wnd;wnd = m_pWinList->next())wnd->applyOptions(); - updateCaption(); - - m_pTaskBar->applyOptions(); -} - -void KviFrame::toggleStatusBar() -{ - if(m_pStatusBar) - { - delete m_pStatusBar; - m_pStatusBar = 0; - } else { - //if(statusBar())delete statusBar(); // kill any existing status bar (QT BUG) - - m_pStatusBar = new KviStatusBar(this); - m_pStatusBar->load(); -#ifdef COMPILE_USE_QT4 - setStatusBar(m_pStatusBar); -#endif - m_pStatusBar->show(); -#ifndef COMPILE_USE_QT4 - setUpLayout(); -#endif //!COMPILE_USE_QT4 - } -} - -void KviFrame::fillToolBarsPopup(KviTalPopupMenu * p) -{ - p->clear(); - - disconnect(p,SIGNAL(activated(int)),this,SLOT(toolbarsPopupSelected(int))); // just to be sure - connect(p,SIGNAL(activated(int)),this,SLOT(toolbarsPopupSelected(int))); - - int id; - int cnt = 0; - - KviModuleExtensionDescriptorList * l = g_pModuleExtensionManager->getExtensionList("toolbar"); - if(l) - { - for(KviModuleExtensionDescriptor * d = l->first();d;d = l->next()) - { - QString label = __tr2qs("Show %1").arg(d->visibleName()); - if(d->icon())id = p->insertItem(*(d->icon()),label); - else id = p->insertItem(label); - p->setItemChecked(id,moduleExtensionToolBar(d->id())); - p->setItemParameter(id,d->id()); - cnt++; - } - } - - // FIXME: Should this display "Hide %1" when the toolbar is already visible ? - KviPointerHashTableIterator<QString,KviCustomToolBarDescriptor> it2(*(KviCustomToolBarManager::instance()->descriptors())); - if(it2.current()) - { - if(cnt > 0)p->insertSeparator(); - while(KviCustomToolBarDescriptor * d = it2.current()) - { - QString label = __tr2qs("Show %1").arg(d->label()); - QString ico = d->iconId(); - // use the icon only if there is no check - if(d->toolBar()) - { - id = p->insertItem(label); - p->setItemChecked(id,true); - } else { - if(!ico.isEmpty()) - { - QPixmap * pix = g_pIconManager->getImage(d->iconId()); - if(pix) - { - id = p->insertItem(*pix,label); - } else { - id = p->insertItem(label); - } - } else { - id = p->insertItem(label); - } - } - p->setItemParameter(id,d->internalId()); - ++it2; - cnt++; - } - } - - if(cnt > 0)p->insertSeparator(); - p->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TOOLBAR)),__tr2qs("Customize..."),this,SLOT(customizeToolBars())); -} - -void KviFrame::customizeToolBars() -{ - KviKvsScript::run("toolbareditor.open",g_pActiveWindow); -} - -void KviFrame::toolbarsPopupSelected(int id) -{ - const QObject * o = sender(); - if(!o)return; - if(!o->inherits("KviTalPopupMenu"))return; - const KviTalPopupMenu * p = (const KviTalPopupMenu *)o; - int idext = p->itemParameter(id); - - KviCustomToolBarDescriptor * dd = KviCustomToolBarManager::instance()->findDescriptorByInternalId(idext); - if(dd) - { - if(dd->toolBar())delete dd->toolBar(); - else dd->createToolBar(); - } - - if(KviMexToolBar * t = moduleExtensionToolBar(idext)) - { - t->die(); - } else { - g_pModuleExtensionManager->allocateExtension("toolbar",idext,firstConsole()); - } -} - - - -bool KviFrame::focusNextPrevChild(bool next) -{ - //debug("FOCUS NEXT PREV CHILD"); - QWidget * w = focusWidget(); - if(w) - { -#ifdef COMPILE_USE_QT4 - if(w->focusPolicy() == Qt::StrongFocus)return false; -#else - if(w->focusPolicy() == QWidget::StrongFocus)return false; -#endif - //QVariant v = w->property("KviProperty_FocusOwner"); - //if(v.isValid())return false; // Do NOT change the focus widget! - - if(w->parent()) - { - QVariant v = w->parent()->property("KviProperty_ChildFocusOwner"); - if(v.isValid())return false; // Do NOT change the focus widget! - } - } - // try to focus the widget on top of the Mdi - if(m_pMdi->topChild()) - { - m_pMdi->focusTopChild(); - return false; - } - return KviTalMainWindow::focusNextPrevChild(next); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// Toolbar positioning stuff -//////////////////////////////////////////////////////////////////////////////////////////////////// - - -void KviFrame::saveToolBarPositions() -{ - QString szTemp; - g_pApp->getLocalKvircDirectory(szTemp,KviApp::Config,KVI_CONFIGFILE_TOOLBARS); - - QFile f(szTemp); - if(f.open(IO_WriteOnly | IO_Truncate)) - { -#ifdef COMPILE_USE_QT4 - f.write(saveState(1)); -#else //!COMPILE_USE_QT4 - QTextStream ts(&f); - ts << *this; - f.close(); -#endif //!COMPILE_USE_QT4 - } -} - -void KviFrame::restoreToolBarPositions() -{ - QString szTemp; - g_pApp->getLocalKvircDirectory(szTemp,KviApp::Config,KVI_CONFIGFILE_TOOLBARS); - - QFile f(szTemp); - - bool bNeedDefaults = false; - - if(f.open(IO_ReadOnly)) - { -#ifdef COMPILE_USE_QT4 - if(!restoreState(f.readAll(),1)) - debug("Error while restoring toolbars position"); -#else //!COMPILE_USE_QT4 - QTextStream ts(&f); - ts >> *this; - f.close(); -#endif //!COMPILE_USE_QT4 - } else { - bNeedDefaults = true; - } - - if(m_pTaskBar->inherits("KviTreeTaskBar")) - { -#ifdef COMPILE_USE_QT4 - // ensure that it is not too wide - m_pTaskBar->setMaximumWidth(600); - if(m_pTaskBar->width() > 600) - m_pTaskBar->setFixedWidth(250); -#else //!COMPILE_USE_QT4 - QDockArea * a = m_pTaskBar->area(); - if((a == topDock()) || (a == bottomDock())) - { - // nope.... need to move it - a->removeDockWindow(m_pTaskBar,true,false); - - //int iMaxWidth = m_pTaskBar->maximumWidth(); - leftDock()->moveDockWindow(m_pTaskBar); - //m_pTaskBar->setMaximumWidth(iMaxWidth); - //m_pTaskBar->setOrientation(Vertical); - } - // ensure that it is not too wide - if(m_pTaskBar->width() > 600) - m_pTaskBar->setFixedExtentWidth(250); -#endif //!COMPILE_USE_QT4 - } /*else if(m_pTaskBar->inherits("KviClassicTaskBar")) - { - QDockArea * a = m_pTaskBar->area(); - if((a == leftDock()) || (a == rightDock())) - { - // nope.... need to move it - a->removeDockWindow(m_pTaskBar,true,false); - bottomDock()->moveDockWindow(m_pTaskBar); - bottomDock()->lineUp(true); - } - }*/ - -#ifndef COMPILE_USE_QT4 - if(bNeedDefaults) - lineUpDockWindows(false); -#endif //!COMPILE_USE_QT4 -} - - -void KviFrame::createTaskBar() -{ - if(KVI_OPTION_BOOL(KviOption_boolUseTreeWindowListTaskBar)) - { - m_pTaskBar = new KviTreeTaskBar(); -#ifdef COMPILE_USE_QT4 - m_pTaskBar->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); - addDockWidget(Qt::LeftDockWidgetArea,m_pTaskBar); -#else //!COMPILE_USE_QT4 - setDockEnabled(m_pTaskBar,Qt::DockTop,false); - setDockEnabled(m_pTaskBar,Qt::DockBottom,false); -#endif //!COMPILE_USE_QT4 - } else { - m_pTaskBar = new KviClassicTaskBar(); -#ifdef COMPILE_USE_QT4 - m_pTaskBar->setAllowedAreas(Qt::AllDockWidgetAreas); - addDockWidget(Qt::BottomDockWidgetArea,m_pTaskBar); -#else //!COMPILE_USE_QT4 - setDockEnabled(m_pTaskBar,Qt::DockTop,true); - setDockEnabled(m_pTaskBar,Qt::DockBottom,true); -#endif //!COMPILE_USE_QT4 - } -#ifndef COMPILE_USE_QT4 - setDockEnabled(m_pTaskBar,Qt::DockLeft,true); - setDockEnabled(m_pTaskBar,Qt::DockRight,true); -#endif //!COMPILE_USE_QT4 -} - -void KviFrame::recreateTaskBar() -{ - QString szOldClass = m_pTaskBar->className(); - - saveToolBarPositions(); - KviWindow * w; - for(w = m_pWinList->first();w;w = m_pWinList->next()) - { - w->destroyTaskBarItem(); - } -#ifndef COMPILE_USE_QT4 - removeDockWindow(m_pTaskBar); -#endif //!COMPILE_USE_QT4 - delete m_pTaskBar; - createTaskBar(); - for(w = m_pWinList->first();w;w = m_pWinList->next()) - { - w->createTaskBarItem(); - } - restoreToolBarPositions(); - - - /* - QString szNewClass = m_pTaskBar->className(); - if(szOldClass != szNewClass) - { - // the class changed... - // make sure that the tree task bar is in the left or right dock - // and the classic one is in the top or bottom on - - Qt::Dock dock; - int index; - bool nl; - int eo; - getLocation(m_pTaskBar,dock,index,nl,eo); - - if(KVI_OPTION_BOOL(KviOption_boolUseTreeWindowListTaskBar)) - { - if((dock == Qt::Bottom) || (dock == Qt::Top)) - moveDockWindow(m_pTaskBar,Qt::Left); - } else { - if((dock == Qt::Left) || (dock == Qt::Right)) - moveDockWindow(m_pTaskBar,Qt::Bottom); - } - } - */ - - if(g_pActiveWindow)m_pTaskBar->setActiveItem(g_pActiveWindow->taskBarItem()); -} - - -#if QT_VERSION == 0x030201 -unsigned int KviFrame::windowState() -{ - /* enum GNWindowState { WindowNoState = 0x00000000, WindowMinimized = 0x00000001, - WindowMaximized = 0x00000002, WindowFullScreen = 0x00000004, WindowActive = 0x00000008 }; - GNWindowState GNWState; - if(isMinimized()) GNWState=WindowMinimized; - else if(isMaximized()) GNWState=WindowMaximized; - else if(isActiveWindow()) GNWState=WindowActive; - else if(isFullScreen()) GNWState=WindowFullScreen; - else GNWState=WindowNoState; */ - -/* WindowNoState = 0x00000000 WindowMinimized = 0x00000001 - WindowMaximized = 0x00000002 WindowFullScreen = 0x00000004 WindowActive = 0x00000008*/ - if(isMinimized()) return 0x00000001; - else if(isMaximized()) return 0x00000002; - else if(isActiveWindow()) return 0x00000008; - else if(isFullScreen()) return 0x00000004; - else return 0x00000000; -} -void KviFrame::setWindowState(unsigned int GNWState) -{ - switch(GNWState) - { - case 0x00000001: - showMinimized(); - break; - case 0x00000002: - showMaximized(); - break; - } // switch -} -#endif - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// Some accelerators -//////////////////////////////////////////////////////////////////////////////////////////////////// - -void KviFrame::maximizeWindow(void) -{ - if(!g_pActiveWindow)return; - if(g_pActiveWindow->isMaximized())g_pActiveWindow->restore(); - else g_pActiveWindow->maximize(); -} - -void KviFrame::minimizeWindow(void) -{ - if(g_pActiveWindow)g_pActiveWindow->minimize(); -} - -void KviFrame::switchToPrevWindow(void) -{ - m_pTaskBar->switchWindow(false,false); -} - -void KviFrame::switchToNextWindow(void) -{ - m_pTaskBar->switchWindow(true,false); -} - -void KviFrame::switchToPrevWindowInContext(void) -{ - m_pTaskBar->switchWindow(false,true); -} - -void KviFrame::switchToNextWindowInContext(void) -{ - m_pTaskBar->switchWindow(true,true); -} - -void KviFrame::hideEvent ( QHideEvent * e) -{ - if(KVI_OPTION_BOOL(KviOption_boolMinimizeInTray)) - { - if(e->spontaneous()) - { - - if(!dockExtension()) - { - executeInternalCommand(KVI_INTERNALCOMMAND_DOCKWIDGET_SHOW); - } - QTimer::singleShot( 0, this, SLOT(hide()) ); - } - - } -} - -#include "kvi_frame.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_frame.h b/3.4.0/src/kvirc/ui/kvi_frame.h deleted file mode 100644 index 12b1387c18..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_frame.h +++ /dev/null @@ -1,259 +0,0 @@ -#ifndef _KVI_FRAME_H_ -#define _KVI_FRAME_H_ -//============================================================================= -// -// File : kvi_frame.h -// Creation date : Sun Jun 18 2000 17:59:02 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. -// -//============================================================================= - -//============================================================================= -// -// KviFrame: -// The main window for the KVIrc application -// -//============================================================================= - -#include "kvi_settings.h" - -#include "kvi_tal_mainwindow.h" -#include "kvi_qstring.h" -#include "kvi_pointerlist.h" - -class KviMenuBar; -class KviMdiManager; -class KviMdiChild; -class KviWindow; -class KviConsole; -class KviTaskBarBase; -class QSplitter; -class KviConfig; -class KviMexToolBar; -class KviIrcContext; -class KviIrcConnection; -class KviStatusBar; -class KviTalPopupMenu; - -#include "kvi_accel.h" // we need this :/ - -#ifdef COMPILE_ON_WINDOWS - // MSCV has problems with KviPointerList<KviWindow> otherwise - #include "kvi_window.h" -#endif - -// base class for the dock extension applets.. -// this should be probably moved out of here -class KVIRC_API KviDockExtension -{ -protected: - unsigned int m_uStoredWindowState; -public: - KviDockExtension() : m_uStoredWindowState(0){}; - virtual ~KviDockExtension(){}; -public: - void setPrevWindowState(unsigned int state) { m_uStoredWindowState = state; }; - unsigned int getPrevWindowState() { return m_uStoredWindowState; }; - - virtual void refresh(){}; - virtual void die(){ delete this; }; -}; - - - -class KVIRC_API KviFrame : public KviTalMainWindow // , public KviIrcContextManager -{ - friend class KviWindow; - friend class KviConsole; - friend class KviApp; - friend class KviServerParser; - friend class KviMexToolBar; - friend class KviMdiManager; - friend class KviIrcContext; - friend class KviIrcConnection; - friend class KviLagMeter; - friend class KviUserListView; - friend class KviUserListViewArea; - Q_OBJECT -public: - KviFrame(); - ~KviFrame(); -protected: - // subwindows - QSplitter * m_pSplitter; // the frame is splitted vertically and thus can host widgets - KviMenuBar * m_pMenuBar; // the main menu bar - KviMdiManager * m_pMdi; // the mdi manager widget (child of the splitter) - KviPointerList<KviMexToolBar> * m_pModuleExtensionToolBarList; // the module extension toolbars - KviTaskBarBase * m_pTaskBar; // the taskbar - KviStatusBar * m_pStatusBar; - // the mdi workspace child windows - KviPointerList<KviWindow> * m_pWinList; // the main list of windows - KviIrcContext * m_pActiveContext; // the context of the m_pActiveWindow - // other - KviDockExtension * m_pDockExtension; // the frame's dock extension: this should be prolly moved ? - KviAccel * m_pAccel; // the global accelelrator -public: - // the mdi manager: handles mdi children - KviMdiManager * mdiManager(){ return m_pMdi; }; - // the splitter is the central widget for this frame - QSplitter * splitter(){ return m_pSplitter; }; - // KviTaskBarBase is the base class for KviTreeTaskBar and the KviClassicTaskBar - KviTaskBarBase * taskBar(){ return m_pTaskBar; }; - // well.. the menu bar :D - KviMenuBar * mainMenuBar(){ return m_pMenuBar; }; - KviStatusBar * mainStatusBar(){ return m_pStatusBar; }; - // this function may return 0 if the active window has no irc context - KviIrcContext * activeContext(){ return m_pActiveContext; }; - // shortcut to a = activeContext(); return a ? a->connection() : 0 - KviIrcConnection * activeConnection(); - // The list of the windows belonging to this frame - // Note that the windows may be also undocked, but they are still owned by the frame - KviPointerList<KviWindow> * windowList() { return m_pWinList; }; - // Sets the specified window to be the active one - // Raises it and focuses it - void setActiveWindow(KviWindow *wnd); - // Adds a new KviWindow to this frame - // This should be done just after the KviWindow constructor has returned - // If bShow is false then the window is not explicitly shown - // otherwise it is set as active window. - void addWindow(KviWindow *wnd,bool bShow = true); // public for modules - // Checks if a specified window is still existing in this frame child - // window list. This is useful for asynchronous functions - // that keep a window pointer and need to ensure that it is still - // valid after an uncontrolled delay. (Think of a /timer implementation) - bool windowExists(KviWindow * wnd){ return (m_pWinList->findRef(wnd) != -1); }; - // The number of consoles in this frame - unsigned int consoleCount(); - // Creates a new console window. DON'T use the KviConsole constructor directly. - // (The script creation events are triggered from here) - KviConsole * createNewConsole(bool bFirstInFrame = false); - // Returns the first available console. - // There is almost always an available console. - // Exceptions are the startup and the shutdown (see activeWindow()) - KviConsole * firstConsole(); - // Returns the first console that has no connection in progress - // This function CAN return 0 if all the consoles are connected - KviConsole * firstNotConnectedConsole(); - // this is explicitly dedicated to the DockExtension applets - void setDockExtension(KviDockExtension * e){ m_pDockExtension = e; }; - // returns the dockExtension applet. Useful for calling refresh() when - // some particular event happens - KviDockExtension * dockExtension(){ return m_pDockExtension; }; - // Updates the main window caption. - // Should be called when the active window changes - // and the active irc context changes state - void updateCaption(); - // helper for saving the window properties - void saveWindowProperties(KviWindow * wnd,const char * szSection); - // finds the module extension toolbar with the specified identifier - // see kvi_moduleextension.h and kvi_mextoolbar.h - KviMexToolBar * moduleExtensionToolBar(int extensionId); - // Helper to fill the toolbars popup - // it is used by KviToolBar and KviMenuBar - void fillToolBarsPopup(KviTalPopupMenu * p); - int registerAccelerator(const QString &szKeySequence,QObject * recv,const char * slot); - void unregisterAccelerator(int id); - -#if QT_VERSION == 0x030201 - - unsigned int windowState(); - void setWindowState(unsigned int GNWState); - -#endif - -public slots: - void newConsole(); - void executeInternalCommand(int index); - void toggleStatusBar(); - void customizeToolBars(); -protected: - void restoreModuleExtensionToolBars(); - void saveModuleExtensionToolBars(); - void registerModuleExtensionToolBar(KviMexToolBar * t); - void unregisterModuleExtensionToolBar(KviMexToolBar * t); - - void unhighlightWindowsOfContext(KviIrcContext * c); - - void createTaskBar(); - void recreateTaskBar(); - - KviMdiChild * dockWindow(KviWindow *wnd,bool bShow = true,bool bCascade = true,QRect * setGeom = 0); - void undockWindow(KviWindow *wnd); - - void closeWindow(KviWindow *wnd); - - // called by KviWindow - void childWindowCloseRequest(KviWindow *wnd); - void childWindowActivated(KviWindow *wnd); - - void childContextStateChange(KviIrcContext * c); - void childConnectionNickNameChange(KviIrcConnection * c); - void childConnectionAwayStateChange(KviIrcConnection * c); - void childConnectionUserModeChange(KviIrcConnection * c); - void childConnectionLagChange(KviIrcConnection * c); - void childConnectionServerInfoChange(KviIrcConnection * c); - void childWindowSelectionStateChange(KviWindow * pWnd,bool bGotSelectionNow); - - virtual void closeEvent(QCloseEvent *e); - virtual void resizeEvent(QResizeEvent *e); - virtual void moveEvent(QMoveEvent *e); - virtual bool focusNextPrevChild(bool next); - virtual void windowActivationChange(bool bOldActive); - - void updatePseudoTransparency(); - - KviAccel * installAccelerators(QWidget * wnd); - - virtual void hideEvent ( QHideEvent * e); -protected slots: - void switchToNextWindow(); - void switchToPrevWindow(); - void switchToNextWindowInContext(); - void switchToPrevWindowInContext(); - - void maximizeWindow(); - void minimizeWindow(); - - void accelActivated(int id); - void enteredSdiMode(); - void leftSdiMode(); - void toolbarsPopupSelected(int id); - -signals: - void activeWindowChanged(); // almost never 0.. but may be - void activeContextChanged(); // may be 0! - void activeContextStateChanged(); // emitted only when the active context is non 0 and it changes state - void activeConnectionNickNameChanged(); - void activeConnectionUserModeChanged(); - void activeConnectionAwayStateChanged(); - void activeConnectionServerInfoChanged(); - void activeConnectionLagChanged(); - void activeWindowSelectionStateChanged(bool bGotSelectionNow); -protected: - void applyOptions(); -private: - void saveToolBarPositions(); - void restoreToolBarPositions(); -}; - -#ifndef _KVI_FRAME_CPP_ - extern KVIRC_API KviFrame * g_pFrame; -#endif - -#endif //_KVI_FRAME_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_historywin.cpp b/3.4.0/src/kvirc/ui/kvi_historywin.cpp deleted file mode 100644 index 7940708bc7..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_historywin.cpp +++ /dev/null @@ -1,255 +0,0 @@ -#ifndef _KVI_HISTORYWIN_CPP_ -#define _KVI_HISTORYWIN_CPP_ -// -// File : kvi_historywin.cpp -// Creation date : Mon Aug 19 01:34:48 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_historywin.h" -#include "kvi_app.h" -#include "kvi_options.h" -#include "kvi_input.h" -#include "kvi_mirccntrl.h" - -#include <qnamespace.h> - -#ifdef COMPILE_USE_QT4 - #include <qevent.h> -#endif - -#include <ctype.h> - -extern KviInputHistory * g_pInputHistory; - -KviHistoryWindow::KviHistoryWindow() -#ifdef COMPILE_USE_QT4 -: KviTalListBox(0,Qt::Popup) -#else -: KviTalListBox(0,Qt::WType_Popup) -#endif -{ - m_pOwner = 0; -#ifdef COMPILE_USE_QT4 - setHScrollBarMode(Q3ScrollView::AlwaysOff); -#else - setHScrollBarMode(QScrollView::AlwaysOff); -#endif - connect(this,SIGNAL(selected(const QString &)),this,SLOT(itemSelected(const QString &))); - - m_iTimerId = -1; -} - -KviHistoryWindow::~KviHistoryWindow() -{ - if(m_iTimerId != -1) - { - killTimer(m_iTimerId); - m_iTimerId = -1; - } -} - -void KviHistoryWindow::fill() -{ - clear(); - for(QString * s = g_pInputHistory->list()->last();s;s = g_pInputHistory->list()->prev()) - { - insertItem(*s); - } - if(count() > 0)setCurrentItem(count() - 1); -} - -void KviHistoryWindow::popup(KviInput *owner) -{ - if(m_pOwner)disconnect(m_pOwner,SIGNAL(destroyed()),this,SLOT(ownerDead())); - m_pOwner = owner; - connect(m_pOwner,SIGNAL(destroyed()),this,SLOT(ownerDead())); - fill(); - show(); -} - -void KviHistoryWindow::mousePressEvent(QMouseEvent *e) -{ - if(e->pos().x() < 0)goto hideme; - if(e->pos().x() > width())goto hideme; - if(e->pos().y() < 0)goto hideme; - if(e->pos().y() > height())goto hideme; - - KviTalListBox::mousePressEvent(e); - e->accept(); - return; - -hideme: - doHide(); -} - -/* -bool KviHistoryWindow::findTypedSeq() -{ - int cnt = count(); - int max = 0; - int mit = -1; - bool bFullMax = false; - for(int i=0;i<cnt;i++) - { - KviStr szIt = text(i); - int j; - for(j=0;j<szIt.len();j++) - { - if(tolower(*(szIt.ptr() + j)) != tolower(*(m_szTypedSeq.ptr() + j)))break; - } - if(j < max) - { - goto got_mit; - } else { - if(j >= max) - { - bFullMax = (j == szIt.len()); - max = j; - mit = i; - } - } - } -got_mit: - setCurrentItem(mit); - m_szCurFullSeq = text(mit); - return bFullMax; -} -*/ - -void KviHistoryWindow::keyPressEvent(QKeyEvent *e) -{ - switch(e->key()) - { - case Qt::Key_Up: - case Qt::Key_Down: - case Qt::Key_PageUp: - case Qt::Key_PageDown: - case Qt::Key_Return: - KviTalListBox::keyPressEvent(e); - return; - break; - case Qt::Key_Escape: - doHide(); - return; - break; -/* - case Qt::Key_Backspace: - if(m_szTypedSeq.hasData()) - { - m_szTypedSeq.cutRight(1); - findTypedSeq(); - } else { - doHide(); - if(m_pOwner)g_pApp->sendEvent(m_pOwner,e); - } - return; - break; -*/ -/* - case Qt::Key_Space: - doHide(); - if(findTypedSeq()) - { - KviStr szItem = m_szTypedSeq; - szItem.append(' '); - if(m_pOwner)m_pOwner->insertText(szItem); - } else { - if(m_pOwner)g_pApp->sendEvent(m_pOwner,e); - } - return; - break; -*/ -/* - case Qt::Key_Tab: - doHide(); - findTypedSeq(); - KviStr szItem = m_szCurFullSeq; - szItem.append(KVI_TEXT_ICON); - if(m_pOwner)m_pOwner->insertText(szItem); - return; - break; -*/ - } -/* - int as = e->ascii(); - if((as >= 'a' && as <= 'z') || (as >= 'A' && as <= 'Z') || (as >= '0' && as <= '9') - || (as == '?') || (as == '$') || (as == '.') || (as == ',') || (as == '!') || (as =='&')) - { - m_szTypedSeq.append((char)as); - findTypedSeq(); - } else { -*/ - if(m_pOwner)g_pApp->sendEvent(m_pOwner,e); -/* - } -*/ -} - -void KviHistoryWindow::ownerDead() -{ - m_pOwner = 0; - doHide(); -} - -void KviHistoryWindow::show() -{ - m_iTimerId = startTimer(100000); //100 sec ...seems enough - QWidget::show(); -} - -void KviHistoryWindow::timerEvent(QTimerEvent *) -{ - m_pOwner = 0; // do not setFocus() to the owner after the timeout - doHide(); -} - -void KviHistoryWindow::doHide() -{ - if(m_iTimerId != -1) - { - killTimer(m_iTimerId); - m_iTimerId = -1; - } - hide(); - if(m_pOwner) - m_pOwner->setFocus(); -} - -void KviHistoryWindow::itemSelected(const QString &str) -{ - doHide(); - if(m_pOwner)m_pOwner->setText(str); -} - - -void KviHistoryWindow::hideEvent(QHideEvent *) -{ - if(m_iTimerId != -1) - { - killTimer(m_iTimerId); - m_iTimerId = -1; - } -} - -#include "kvi_historywin.moc" -#endif //_KVI_HISTORYWIN_CPP_ diff --git a/3.4.0/src/kvirc/ui/kvi_historywin.h b/3.4.0/src/kvirc/ui/kvi_historywin.h deleted file mode 100644 index d9f4d433e5..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_historywin.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef _KVI_HISTORYWIN_H_ -#define _KVI_HISTORYWIN_H_ -// -// File : kvi_historywin.h -// Creation date : Mon Aug 19 01:34:46 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" - -#include "kvi_tal_listbox.h" - -class KviInput; - -#define KVI_HISTORY_WIN_HEIGHT 130 - -class KVIRC_API KviHistoryWindow : public KviTalListBox -{ - Q_OBJECT -public: - KviHistoryWindow(); - ~KviHistoryWindow(); -private: - KviInput * m_pOwner; - int m_iTimerId; -public: - void popup(KviInput *owner); -// KviInput * owner(){ return m_pOwner; }; - void doHide(); -private: - virtual void show(); -// bool findTypedSeq(); // returns true if it is a complete word - virtual void keyPressEvent(QKeyEvent *e); - virtual void mousePressEvent(QMouseEvent *e); - virtual void timerEvent(QTimerEvent *); - virtual void hideEvent ( QHideEvent * ); - void fill(); -public slots: - void ownerDead(); - void itemSelected(const QString &str); -}; - -#endif //_KVI_HISTORYWIN_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_htmldialog.cpp b/3.4.0/src/kvirc/ui/kvi_htmldialog.cpp deleted file mode 100644 index 9d4578619a..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_htmldialog.cpp +++ /dev/null @@ -1,155 +0,0 @@ -//============================================================================= -// -// File : kvi_htmldialog.cpp -// Created on Wed 03 Jan 2007 03:36:36 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2007 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_htmldialog.h" -#include "kvi_locale.h" -#include "kvi_tal_textedit.h" - -#include <qlabel.h> -#include <qpushbutton.h> -#include <qlayout.h> -#include <qtextbrowser.h> - -KviHtmlDialog::KviHtmlDialog(QWidget * pParent,KviHtmlDialogData * pData) -: QDialog(pParent) -{ - m_pData = pData; - - if(pData->szCaption.isEmpty()) - setCaption("KVIrc"); - else - setCaption(pData->szCaption); - - if(!pData->pixIcon.isNull()) - setIcon(pData->pixIcon); - - QGridLayout * g = new QGridLayout(this,4,3,7,7); - - QLabel * l; - QTextBrowser * te; - QPushButton * pb; - - int iUp = 0; - int iDown = 2; - - if(!pData->szUpperLabelText.isEmpty()) - { - l = new QLabel(this); - l->setText(pData->szUpperLabelText); - g->addMultiCellWidget(l,0,0,0,2); - iUp = 1; - } - - if(!pData->szLowerLabelText.isEmpty()) - { - l = new QLabel(this); - l->setText(pData->szLowerLabelText); - g->addMultiCellWidget(l,2,2,0,2); - iDown = 1; - } - - te = new QTextBrowser(this); - te->setText(pData->szHtmlText); - //te->setReadOnly(true); - - if(pData->iFlags & KviHtmlDialogData::ForceMinimumSize) - te->setMinimumSize(pData->iMinimumWidth,pData->iMinimumHeight); - - //te->setReadOnly(true); - g->addMultiCellWidget(te,iUp,iDown,0,2); - - int iButtons = pData->szButton3Text.isEmpty() ? (pData->szButton2Text.isEmpty() ? 1 : 2) : 3; - if(pData->iCancelButton > iButtons)pData->iCancelButton = iButtons; - if(pData->iDefaultButton > iButtons)pData->iDefaultButton = iButtons; - - pb = new QPushButton(this); - pb->setText(pData->szButton1Text.isEmpty() ? __tr2qs("OK") : pData->szButton1Text); - pb->setDefault(pData->iDefaultButton == 1); - int iCoord = iButtons == 1 ? 1 : 0; - g->addWidget(pb,3,iCoord); - connect(pb,SIGNAL(clicked()),this,SLOT(button1Pressed())); - - if(!pData->szButton2Text.isEmpty()) - { - pb = new QPushButton(this); - pb->setText(pData->szButton2Text); - pb->setDefault(pData->iDefaultButton == 2); - iCoord = iButtons == 2 ? 2 : 1; - g->addWidget(pb,3,iCoord); - connect(pb,SIGNAL(clicked()),this,SLOT(button2Pressed())); - - if(!pData->szButton3Text.isEmpty()) - { - pb = new QPushButton(this); - pb->setText(pData->szButton3Text); - pb->setDefault(pData->iDefaultButton == 3); - g->addWidget(pb,3,2); - connect(pb,SIGNAL(clicked()),this,SLOT(button3Pressed())); - } - } - - g->setRowStretch(1,1); - - m_pData->iSelectedButton = m_pData->iDefaultButton; -} - -KviHtmlDialog::~KviHtmlDialog() -{ - -} - -void KviHtmlDialog::button1Pressed() -{ - m_pData->iSelectedButton = 1; - accept(); -} - -void KviHtmlDialog::button2Pressed() -{ - m_pData->iSelectedButton = 2; - accept(); -} - -void KviHtmlDialog::button3Pressed() -{ - m_pData->iSelectedButton = 3; - accept(); -} - -void KviHtmlDialog::reject() -{ - m_pData->iSelectedButton = m_pData->iCancelButton; - QDialog::reject(); -} - -int KviHtmlDialog::display(QWidget * pParent,KviHtmlDialogData * pData) -{ - KviHtmlDialog * pDialog = new KviHtmlDialog(pParent,pData); - pDialog->exec(); - delete pDialog; - return pData->iSelectedButton; -} - - diff --git a/3.4.0/src/kvirc/ui/kvi_htmldialog.h b/3.4.0/src/kvirc/ui/kvi_htmldialog.h deleted file mode 100644 index 6bb811a319..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_htmldialog.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef _KVI_HTMLDIALOG_H_ -#define _KVI_HTMLDIALOG_H_ -//============================================================================= -// -// File : kvi_htmldialog.h -// Created on Wed 03 Jan 2007 03:36:36 by Szymon Stefanek -// -// This file is part of the KVIrc IRC Client distribution -// Copyright (C) 2007 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_qstring.h" -#include "kvi_settings.h" - - -#include <qpixmap.h> -#include <qdialog.h> - -class KviHtmlDialogData -{ -public: - // input - - // mandatory fields - enum Flags { ForceMinimumSize = 1 }; - int iFlags; // da flags :) - int iDefaultButton; // the button to use when Enter is pressed (1,2 or 3) - int iCancelButton; // the button to use when Esc is pressed (1,2 or 3) - QString szHtmlText; // Shouldn't be empty :D - - // optional fields - QString szCaption; // KVIrc is used when this is empty - QString szUpperLabelText; // no label is shown if this is empty - QString szLowerLabelText; // no label is shown if this is empty - QString szButton1Text; // OK is used if this is empty - QString szButton2Text; // no button is shown if this is empty - QString szButton3Text; // no button is shown if this is empty - - int iMinimumWidth; - int iMinimumHeight; - - QPixmap pixIcon; // may be null - - // output - int iSelectedButton; // returns 1,2 or 3 -}; - -class KVIRC_API KviHtmlDialog : public QDialog -{ - Q_OBJECT -public: - // the dialog does NOT delete this structure and assumes that - // it remains alive until the dialog closes (i.e. it may access - // the structure in the destructor - KviHtmlDialog(QWidget * pParent,KviHtmlDialogData * pData); - ~KviHtmlDialog(); -protected: - KviHtmlDialogData * m_pData; -public: - // displays the dialog as modal and returns 1,2 or 3 - static int display(QWidget * pParent,KviHtmlDialogData * pData); -protected slots: - void button1Pressed(); - void button2Pressed(); - void button3Pressed(); -protected: - virtual void reject(); -}; - - - -#endif //!_KVI_HTMLDIALOG_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_imagedialog.cpp b/3.4.0/src/kvirc/ui/kvi_imagedialog.cpp deleted file mode 100644 index 9f0b527565..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_imagedialog.cpp +++ /dev/null @@ -1,367 +0,0 @@ -// -// File : kvi_imagedialog.cpp -// Creation date : Sun Dec 22 2002 19:42 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_imagedialog.h" - -#include "kvi_locale.h" - -#include <qlayout.h> -#include <qpushbutton.h> - -#include <qimage.h> -#include <qfileinfo.h> -#include <qdir.h> - -#include <qpainter.h> - -#include "kvi_fileutils.h" - -#include "kvi_iconmanager.h" -#include "kvi_options.h" - -#include "kvi_app.h" - -int KviImageDialogItem::height(const KviTalListBox *lb) const -{ - return pixmap()->height() + 12 + lb->fontMetrics().lineSpacing(); -} - -int KviImageDialogItem::width(const KviTalListBox *lb) const -{ - int w; - if(text().isEmpty())w = 24; - w = lb->fontMetrics().width(text()) + 4; - if(w > 100)w = 100; - if(w < 24)w = 24; - return QMAX(pixmap()->width() + 10,w); -} - -void KviImageDialogItem::paint(QPainter * p) -{ - const QPixmap *pm = pixmap(); - if(pm && !pm->isNull())p->drawPixmap(5,5, *pm); - - if(!m_bIsFolder) - { - p->setPen(Qt::gray); - p->drawRect(3,3,pm->width() + 4,pm->height() + 4); - } - - QRect daRect(listBox()->itemRect(this)); - - p->setPen(Qt::black); - p->drawRect(1,1,daRect.width() - 2,daRect.height() - 2); - - if(text().isEmpty())return; - - QString t = text(); - - QFontMetrics fm(p->fontMetrics()); - - int wdth = fm.width(t); - - int idx = t.length(); - while(wdth > (daRect.width() - 6) && idx > 3) - { - t = text(); - t.truncate(idx); - t.append("..."); - wdth = fm.width(t); - idx--; - } - - p->drawText(3,pm->height() + 8,daRect.width() - 6,daRect.height() - (pm->height() + 6),Qt::AlignLeft | Qt::AlignTop,t); -} - - -KviImageDialog::KviImageDialog(QWidget * par, - const QString &szCaption, - int types, - int initialType, - const QString &szInitialDir, - int maxPreviewFileSize,bool modal) -: QDialog(par) -{ - m_szInitialPath = szInitialDir; - setModal(modal); - m_iMaxPreviewFileSize = maxPreviewFileSize; - - setCaption(szCaption.isEmpty() ? __tr2qs("Choose image ...") : szCaption); - - m_pTimer = new QTimer(this); - connect(m_pTimer,SIGNAL(timeout()),this,SLOT(heartbeat())); - - QGridLayout * g = new QGridLayout(this,4,3,5,3); - - m_pTypeComboBox = new QComboBox(this); - - g->addMultiCellWidget(m_pTypeComboBox,0,0,0,2); - - m_pTypeList = new KviValueList<int>; - - QString bi = __tr2qs("Builtin images"); - - QString tmp = bi; - - if((types & KID_TYPE_ALL) == 0)types = KID_TYPE_FULL_PATH; - - if(types & KID_TYPE_BUILTIN_IMAGES_SMALL) - { - tmp += ": "; - tmp += __tr2qs("Small icons"); - m_pTypeComboBox->insertItem(tmp); - m_pTypeList->append(KID_TYPE_BUILTIN_IMAGES_SMALL); - } - - if(types & KID_TYPE_FULL_PATH) - { - m_pTypeComboBox->insertItem(__tr2qs("Full path")); - m_pTypeList->append(KID_TYPE_FULL_PATH); - } - - int idx = m_pTypeList->findIndex(initialType); - if(idx < 0)idx = 0; - - QWidget * l = new QWidget(this); - g->addMultiCellWidget(l,1,1,0,2); - - - m_pListBox = new KviTalListBox(this); - m_pListBox->setColumnMode(KviTalListBox::FitToWidth); - m_pListBox->setRowMode(KviTalListBox::Variable); - - m_pTip = new KviDynamicToolTip(m_pListBox->viewport()); - - g->addMultiCellWidget(m_pListBox,2,2,0,2); - - QPushButton * b = new QPushButton(__tr2qs("Cancel"),this); - connect(b,SIGNAL(clicked()),this,SLOT(cancelClicked())); - g->addWidget(b,3,1); - - b = new QPushButton(__tr2qs("Ok"),this); - connect(b,SIGNAL(clicked()),this,SLOT(okClicked())); - g->addWidget(b,3,2); - - g->setRowStretch(2,1); - g->setColStretch(0,1); - - connect(m_pTypeComboBox,SIGNAL(activated(int)),this,SLOT(jobTypeSelected(int))); - connect(m_pListBox,SIGNAL(doubleClicked(KviTalListBoxItem *)),this,SLOT(itemDoubleClicked(KviTalListBoxItem *))); - connect(m_pTip,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &))); - - m_pTypeComboBox->setCurrentItem(idx); - jobTypeSelected(idx); - - m_pListBox->setMinimumSize(420,350); -} - -KviImageDialog::~KviImageDialog() -{ - delete m_pTimer; - delete m_pTypeList; -} - -void KviImageDialog::jobTypeSelected(int index) -{ - if(index < 0)return; - if(index >= (int)(m_pTypeList->count()))index = (int)m_pTypeList->count(); - if(m_szInitialPath.isEmpty()) - startJob(*(m_pTypeList->at(index)),KVI_OPTION_STRING(KviOption_stringLastImageDialogPath)); - else { - startJob(*(m_pTypeList->at(index)),m_szInitialPath); - m_szInitialPath = ""; // clear it so we will use the last path - } -} - -void KviImageDialog::startJob(int type,const QString &szInitialPath) -{ - m_pTimer->stop(); - m_iJobType = type; - - m_iJobIndexHelper = 0; - if(m_iJobType == KID_TYPE_FULL_PATH) - { - QDir d(szInitialPath); - if(!d.exists())d = QDir::homeDirPath(); - if(!d.exists())d = QDir::rootDirPath(); - m_szJobPath = d.absPath(); - KVI_OPTION_STRING(KviOption_stringLastImageDialogPath) = m_szJobPath; - m_lJobFileList = d.entryList(QDir::Hidden | QDir::All,QDir::DirsFirst | QDir::Name | QDir::IgnoreCase); - } - - m_pTimer->start(100); -} - -void KviImageDialog::jobTerminated() -{ - m_pTimer->stop(); -} - -void KviImageDialog::heartbeat() -{ - if(m_iJobIndexHelper == 0)m_pListBox->clear(); - - - switch(m_iJobType) - { - case KID_TYPE_BUILTIN_IMAGES_SMALL: - { - if(m_iJobIndexHelper >= KVI_NUM_SMALL_ICONS) - { - jobTerminated(); - return; - } - int max = m_iJobIndexHelper + 15; - if(max > KVI_NUM_SMALL_ICONS)max = KVI_NUM_SMALL_ICONS; - while(m_iJobIndexHelper < max) - { - QString id = g_pIconManager->getSmallIconName(m_iJobIndexHelper); - KviImageDialogItem * it; - QString tip; - KviQString::sprintf(tip,__tr2qs("Builtin $icon(%Q) [index %d]"),&id,m_iJobIndexHelper); - QString image_id = "$icon("; - image_id += id; - image_id += ")"; - it = new KviImageDialogItem(m_pListBox,*(g_pIconManager->getSmallIcon(m_iJobIndexHelper)),id,image_id,tip); - m_iJobIndexHelper++; - } - } - break; - case KID_TYPE_FULL_PATH: - { - m_iJobIndexHelper++; - if(m_lJobFileList.isEmpty()) - { - jobTerminated(); - return; - } - int idx = 0; - while((idx < 20) && (!m_lJobFileList.isEmpty())) - { - QString szFile = m_lJobFileList.first(); - m_lJobFileList.remove(szFile); - QString szPath = m_szJobPath; - szPath += KVI_PATH_SEPARATOR; - szPath += szFile; - QFileInfo fi(szPath); - idx += fi.size() / 128000; // we do less entries when have big files to read - if(fi.isDir()) - { - if(szFile != ".") - { - QString tip = szFile; - tip += "<br><hr>"; - tip += __tr2qs("directory"); - KviImageDialogItem * it; - it = new KviImageDialogItem(m_pListBox,*(g_pIconManager->getBigIcon(KVI_BIGICON_FOLDER)),szFile,szPath,tip,true); - } - } else { - if(((int)fi.size()) < m_iMaxPreviewFileSize) - { - QImage i(szPath); - if(i.isNull())continue; - QPixmap pix; -#ifdef COMPILE_USE_QT4 - if((i.width() > 80) || (i.height() > 80))pix = i.scaled(80,80,Qt::KeepAspectRatio); -#else - if((i.width() > 80) || (i.height() > 80))pix = i.scale(80,80,QImage::ScaleMin); -#endif - else pix = i; - - QString tip = szFile; - tip += "<br><hr>"; - QString sz; - sz.setNum(i.width()); - tip += sz; - tip += " x "; - sz.setNum(i.height()); - tip += sz; - tip += " "; - tip += __tr2qs("pixels"); - tip += "<br>"; - sz.setNum(fi.size()); - tip += sz; - tip += " "; - tip += __tr2qs("bytes"); - tip += "<br>"; - - KviImageDialogItem * it; - it = new KviImageDialogItem(m_pListBox,pix,szFile,szPath,tip); - } - } - idx++; - } - } - break; - } -} - -void KviImageDialog::okClicked() -{ - KviTalListBoxItem * it = 0; - int idx = m_pListBox->currentItem(); - if(idx != -1)it = (KviTalListBoxItem *)m_pListBox->item(idx); - if(!it)return; - itemDoubleClicked(it); -} - -void KviImageDialog::cancelClicked() -{ - m_szSelectedImage = QString::null; - reject(); -} - -void KviImageDialog::closeEvent(QCloseEvent * e) -{ - m_szSelectedImage = QString::null; - QDialog::closeEvent(e); -} - -void KviImageDialog::itemDoubleClicked(KviTalListBoxItem * it) -{ - if(!it)return; - KviImageDialogItem * i = (KviImageDialogItem *)it; - if(i->isFolder()) - { - startJob(KID_TYPE_FULL_PATH,i->imageId()); - } else { - QString szImageId = i->imageId(); - if(szImageId.length() > 0) - { - if(szImageId.at(0) == QChar('$')) - m_szSelectedImage = szImageId; // it's $icon(something) - else - g_pApp->mapImageFile(m_szSelectedImage,i->imageId()); // it's a file and we need to map it to our filesystem view - accept(); - } - } -} - -void KviImageDialog::tipRequest(KviDynamicToolTip *,const QPoint &pnt) -{ - KviTalListBoxItem * it = (KviTalListBoxItem *)m_pListBox->itemAt(pnt); - if(!it)return; - QRect r = m_pListBox->itemRect(it); - KviImageDialogItem * i = (KviImageDialogItem *)it; - m_pTip->tip(r,i->tipText()); -} diff --git a/3.4.0/src/kvirc/ui/kvi_imagedialog.h b/3.4.0/src/kvirc/ui/kvi_imagedialog.h deleted file mode 100644 index 27737fb82c..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_imagedialog.h +++ /dev/null @@ -1,109 +0,0 @@ -#ifndef _KVI_IMAGEDIALOG_H_ -#define _KVI_IMAGEDIALOG_H_ -// -// File : kvi_imagedialog.h -// Creation date : Sun Dec 22 2002 19:42 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - - - - -#include <qdialog.h> -#include <qcombobox.h> -#include "kvi_tal_listbox.h" -#include "kvi_valuelist.h" -#include <qtimer.h> -#include <qstringlist.h> - -#include "kvi_dynamictooltip.h" - -class KviImageDialogItem : public KviTalListBoxPixmap -{ -public: - bool m_bIsFolder; - QString m_szImageId; - QString m_szTipText; -public: - KviImageDialogItem(KviTalListBox * b,const QPixmap &thumb,const QString &szFile,const QString &image_id,const QString &szTipText = QString::null,bool bIsFolder = false) - : KviTalListBoxPixmap(b,thumb,szFile) , m_bIsFolder(bIsFolder) , m_szImageId(image_id) , m_szTipText(szTipText) {}; - ~KviImageDialogItem(){}; -public: - bool isFolder(){ return m_bIsFolder; }; - const QString & imageId(){ return m_szImageId; }; - const QString & tipText(){ return m_szTipText; }; - virtual int height(const KviTalListBox *) const; - virtual int width(const KviTalListBox *) const; - virtual void paint(QPainter * p); -}; - - -#define KID_TYPE_BUILTIN_IMAGES_SMALL 1 -#define KID_TYPE_FULL_PATH 2 - -#define KID_TYPE_ALL 3 - -class KVIRC_API KviImageDialog : public QDialog -{ - Q_OBJECT -public: - KviImageDialog(QWidget * par, - const QString &szCaption = QString::null, - int types = KID_TYPE_ALL, - int initialType = 0, - const QString &szInitialDir = QString::null, - int maxPreviewFileSize = 256000, bool modal=false); - virtual ~KviImageDialog(); -protected: - QComboBox * m_pTypeComboBox; - KviValueList<int> * m_pTypeList; - KviTalListBox * m_pListBox; - QTimer * m_pTimer; - int m_iJobType; - - int m_iMaxPreviewFileSize; - - QString m_szJobPath; - QStringList m_lJobFileList; - - int m_iJobIndexHelper; - - QString m_szSelectedImage; - - QString m_szInitialPath; - - KviDynamicToolTip * m_pTip; -public: - const QString & selectedImage(){ return m_szSelectedImage; }; -protected: - void startJob(int type,const QString &szInitialPath = QString::null); - void jobTerminated(); - virtual void closeEvent(QCloseEvent *e); -protected slots: - void okClicked(); - void cancelClicked(); - void heartbeat(); - void jobTypeSelected(int index); - void itemDoubleClicked(KviTalListBoxItem * it); - void tipRequest(KviDynamicToolTip *,const QPoint &pnt); -}; - -#endif //_KVI_IMAGEDIALOG_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_input.cpp b/3.4.0/src/kvirc/ui/kvi_input.cpp deleted file mode 100644 index f92256434d..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_input.cpp +++ /dev/null @@ -1,2680 +0,0 @@ -//============================================================================= -// -// File : kvi_input.cpp -// Creation date : Sun Jan 3 1999 23:11:50 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#define _KVI_DEBUG_CHECK_RANGE_ -#include "kvi_debug.h" - -#define _KVI_INPUT_CPP_ - -#include "kvi_options.h" -#include "kvi_app.h" -#include "kvi_settings.h" -#include "kvi_defaults.h" -#include "kvi_colorwin.h" -#include "kvi_texticonwin.h" -#include "kvi_window.h" - -#include "kvi_locale.h" -#include "kvi_mirccntrl.h" -#include "kvi_userlistview.h" -#include "kvi_ircview.h" -#include "kvi_console.h" -#include "kvi_out.h" -#include "kvi_iconmanager.h" -#include "kvi_scripteditor.h" -#include "kvi_config.h" -#include "kvi_historywin.h" -#include "kvi_input.h" -#include "kvi_userinput.h" -#include "kvi_kvs_script.h" -#include "kvi_kvs_kernel.h" -#include "kvi_doublebuffer.h" -#include "kvi_styled_controls.h" -#include "kvi_texticonmanager.h" -#include "kvi_draganddrop.h" - -#include <qlabel.h> -#include <ctype.h> -#include <stdlib.h> -#include <qfiledialog.h> -#include "kvi_tal_popupmenu.h" -#include <qpainter.h> -#include <qclipboard.h> -#include <qstringlist.h> -#include "kvi_pointerlist.h" -#include <qapplication.h> -#include <qclipboard.h> -#include <qmessagebox.h> -#include "kvi_tal_hbox.h" -#include <qlayout.h> -#include <qstyle.h> -#include <qevent.h> - - -#ifndef ACCEL_KEY -#define ACCEL_KEY(k) "\t" + QString(QKeySequence( Qt::CTRL | Qt::Key_ ## k )) -#endif - -// FIXME: #warning "This hack is temporary...later remove it" -#if QT_VERSION >= 300 - #ifndef QT_CLEAN_NAMESPACE - #define QT_CLEAN_NAMESPACE - #include <qcursor.h> - #undef QT_CLEAN_NAMESPACE - #else - #include <qcursor.h> - #endif -#else - #include <qcursor.h> -#endif - - - -//This comes from kvi_app.cpp -extern KviColorWindow * g_pColorWindow; -extern KviTextIconWindow * g_pTextIconWindow; -extern KviHistoryWindow * g_pHistoryWindow; -extern KviTalPopupMenu * g_pInputPopup; - -static QFontMetrics * g_pLastFontMetrics = 0; - - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - extern QPixmap * g_pShadedChildGlobalDesktopBackground; -#endif - - -#define KVI_INPUT_MAX_GLOBAL_HISTORY_ENTRIES 100 -#define KVI_INPUT_MAX_LOCAL_HISTORY_ENTRIES 20 - - -extern KviInputHistory * g_pInputHistory; - - -KviInputHistory::KviInputHistory() -{ - m_pStringList = new KviPointerList<QString>; - m_pStringList->setAutoDelete(true); -} - -KviInputHistory::~KviInputHistory() -{ - delete m_pStringList; -} - -void KviInputHistory::add(QString * s) -{ - m_pStringList->insert(0,s); - if(m_pStringList->count() > KVI_INPUT_MAX_GLOBAL_HISTORY_ENTRIES)m_pStringList->removeLast(); -} - -void KviInputHistory::load(const char * filename) -{ - KviConfig c(filename,KviConfig::Read); - - int cnt = c.readIntEntry("Count",0); - - if(cnt > KVI_INPUT_MAX_GLOBAL_HISTORY_ENTRIES)cnt = KVI_INPUT_MAX_GLOBAL_HISTORY_ENTRIES; - - KviStr tmp; - - for(int i=0;i<cnt;i++) - { - tmp.sprintf("S%d",i); - QString entry = c.readQStringEntry(tmp.ptr(),""); - if(!entry.isEmpty())add(new QString(entry)); - } -} - -void KviInputHistory::save(const char * filename) -{ - KviConfig c(filename,KviConfig::Write); - c.clear(); - - c.writeEntry("Count",m_pStringList->count()); - - KviStr tmp; - int idx = 0; - - for(QString * s = m_pStringList->first();s;s = m_pStringList->next()) - { - if(!s->isEmpty()) - { - tmp.sprintf("S%d",idx); - c.writeEntry(tmp.ptr(),*s); - idx++; - } - } -} - -//=============== KviInputEditor ==============// - -static int g_iInputFontCharWidth[256]; -static bool g_bInputFontMetricsDirty = true; - - -KviInputEditor::KviInputEditor(QWidget * par,KviWindow *wnd,KviUserListView * view) -:QFrame(par,"input") -{ - m_pIconMenu = 0; - m_pInputParent = par; - m_iMaxBufferSize = KVI_INPUT_MAX_BUFFER_SIZE; - m_iCursorPosition = 0; //Index of the char AFTER the cursor - m_iFirstVisibleChar = 0; //Index of the first visible character - m_iSelectionBegin = -1; //Index of the first char in the selection - m_iSelectionEnd = -1; //Index of the last char in the selection - m_bIMComposing = false; //Whether the input method is active (composing). - // for input method support - m_iIMStart = 0; //Index of the start of the preedit string. - m_iIMLength = 0; //Length of the preedit string. - m_iIMSelectionBegin = 0; //Index of the start of the selection in preedit string. - m_iIMSelectionLength = 0; //Length of the selection in preedit string. - - m_bCursorOn = false; //Cursor state - m_iCursorTimer = 0; //Timer that iverts the cursor state - m_iDragTimer = 0; //Timer for drag selection updates - m_iLastCursorXPosition = KVI_INPUT_MARGIN; //Calculated in paintEvent - m_iSelectionAnchorChar = -1; //Character clicked at the beginning of the selection process - m_iCurHistoryIdx = -1; //No data in the history - m_bUpdatesEnabled = true; - m_pKviWindow = wnd; - m_pUserListView = view; - m_pHistory = new KviPointerList<QString>; - m_pHistory->setAutoDelete(true); - m_bReadOnly = FALSE; - - setInputMethodEnabled(true); - -#ifdef COMPILE_USE_QT4 - setAutoFillBackground(false); - setFocusPolicy(Qt::StrongFocus); -#else - setBackgroundMode(Qt::NoBackground); - setFocusPolicy(QWidget::StrongFocus); -#endif - setAcceptDrops(true); - setFrameStyle( LineEditPanel ); - setFrameShadow( Plain ); - - m_pIconMenu = new KviTalPopupMenu(); - connect(m_pIconMenu,SIGNAL(activated(int)),this,SLOT(iconPopupActivated(int))); - -#ifdef COMPILE_USE_QT4 - setCursor(Qt::IBeamCursor); -#else - setCursor(IbeamCursor); -#endif -} - -KviInputEditor::~KviInputEditor() -{ - if(g_pLastFontMetrics) delete g_pLastFontMetrics; - g_pLastFontMetrics = 0; - if(m_pIconMenu)delete m_pIconMenu; - delete m_pHistory; - if(m_iCursorTimer)killTimer(m_iCursorTimer); - killDragTimer(); -} - -void KviInputEditor::recalcFontMetrics(QFontMetrics * pFm) -{ - QFontMetrics fm(KVI_OPTION_FONT(KviOption_fontInput)); - unsigned short i; - for(i=1;i<32;i++) - { - QChar c = getSubstituteChar(i); - g_iInputFontCharWidth[i] = fm.width(c); - if(c != QChar(i))g_iInputFontCharWidth[i] += 4; - } - for(i=32;i<256;i++) - { - g_iInputFontCharWidth[i] = fm.width(QChar(i)); - } - g_bInputFontMetricsDirty = false; -} - -void KviInputEditor::applyOptions() -{ - g_bInputFontMetricsDirty = true; - update(); -} - -void KviInputEditor::dragEnterEvent(QDragEnterEvent *e) -{ - if(KviUriDrag::canDecode(e)) - { - e->accept(true); -// FIXME: #warning "FIX THIS COMMENTED STUFF" -/* - m_pKviWindow->m_pFrm->m_pStatusBar->tempText(__tr("Drop the file to /PARSE it"),5000); -*/ - } else e->accept(false); -} - -void KviInputEditor::dropEvent(QDropEvent *e) -{ - QStringList list; - if(KviUriDrag::decodeLocalFiles(e,list)) - { - //debug("Local files decoded"); - if(!list.isEmpty()) - { - //debug("List not empty"); - QStringList::ConstIterator it = list.begin(); //kewl ! :) - for( ; it != list.end(); ++it ) - { - QString tmp = *it; //wow :) -#ifndef COMPILE_ON_WINDOWS - if(tmp.length() > 0) - { - if(tmp[0] != QChar('/'))tmp.prepend("/"); //HACK HACK HACK for Qt bug (?!?) - } -#endif - tmp.prepend("/PARSE \""); - tmp.append("\""); - if(m_pKviWindow) - KviKvsScript::run(tmp,m_pKviWindow); - } - } - } -} - -int KviInputEditor::heightHint() const -{ - return sizeHint().height(); -} - -QSize KviInputEditor::sizeHint() const -{ - //grabbed from qlineedit.cpp - constPolish(); - QFontMetrics fm(KVI_OPTION_FONT(KviOption_fontInput)); - int h = QMAX(fm.lineSpacing(), 14) + 2*2; /* innerMargin */ - int w = fm.width( 'x' ) * 17; // "some" - int m = frameWidth() * 2; -#ifdef COMPILE_USE_QT4 - QStyleOption opt; - opt.initFrom(this); - return (style()->sizeFromContents(QStyle::CT_LineEdit,&opt, - QSize( w + m, h + m ). - expandedTo(QApplication::globalStrut()),this)); -#else - return (style().sizeFromContents(QStyle::CT_LineEdit, this, - QSize( w + m, h + m ). - expandedTo(QApplication::globalStrut()))); -#endif -} - -#define KVI_INPUT_DEF_BACK 100 -#define KVI_INPUT_DEF_FORE 101 - -#ifdef COMPILE_USE_QT4 -void KviInputEditor::paintEvent(QPaintEvent *e) -{ - QPainter p(this); - SET_ANTI_ALIASING(p); - drawFrame(&p); - drawContents(&p); -} -#endif - -void KviInputEditor::drawContents(QPainter *p) -{ - if(!isVisible())return; - - QRect rect = contentsRect(); - int widgetWidth = rect.width(); - int widgetHeight = rect.height(); - - KviDoubleBuffer doublebuffer(widgetWidth,widgetHeight); - QPixmap * pDoubleBufferPixmap = doublebuffer.pixmap(); - - QPainter pa(pDoubleBufferPixmap); - SET_ANTI_ALIASING(pa); - - pa.setFont(KVI_OPTION_FONT(KviOption_fontInput)); - - QFontMetrics fm(pa.fontMetrics()); - - if(!g_pLastFontMetrics) - g_pLastFontMetrics = new QFontMetrics(pa.fontMetrics()); - - if(g_bInputFontMetricsDirty) - recalcFontMetrics(&fm); - - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - if(g_pShadedChildGlobalDesktopBackground) - { - QPoint pnt = mapToGlobal(rect.topLeft()); - pa.drawTiledPixmap(0,0,widgetWidth,widgetHeight,*g_pShadedChildGlobalDesktopBackground,pnt.x(),pnt.y()); - } else { -#endif - QPixmap *pix=KVI_OPTION_PIXMAP(KviOption_pixmapInputBackground).pixmap(); - - pa.fillRect(0,0,widgetWidth,widgetHeight,KVI_OPTION_COLOR(KviOption_colorInputBackground)); - if(pix) - KviPixmapUtils::drawPixmapWithPainter(&pa,pix,KVI_OPTION_UINT(KviOption_uintInputPixmapAlign),rect,widgetWidth,widgetHeight); -#ifdef COMPILE_PSEUDO_TRANSPARENCY - } -#endif - - - int curXPos = KVI_INPUT_MARGIN; - int maxXPos = widgetWidth-2*KVI_INPUT_MARGIN; - m_iCurBack = KVI_INPUT_DEF_BACK; //transparent - m_iCurFore = KVI_INPUT_DEF_FORE; //normal fore color - m_bCurBold = false; - m_bCurUnderline = false; - - int bottom = widgetHeight-(widgetHeight-fm.height())/2; - int textBaseline = fm.ascent()+(widgetHeight-fm.height())/2; - int top = (widgetHeight-fm.height())/2; - - runUpToTheFirstVisibleChar(); - - int charIdx = m_iFirstVisibleChar; - - pa.setClipRect(0,0,widgetWidth,widgetHeight); - - //Control the selection state - if((m_iSelectionEnd < m_iSelectionBegin) || (m_iSelectionEnd == -1) || (m_iSelectionBegin == -1)) - { - m_iSelectionEnd = -1; - m_iSelectionBegin = -1; - } - - if((m_iSelectionBegin != -1) && (m_iSelectionEnd >= m_iFirstVisibleChar)) - { - int iSelStart = m_iSelectionBegin; - - // TODO Refactor: write a function to combine this with the code determining iIMStart and iIMSelectionStart - if(iSelStart < m_iFirstVisibleChar)iSelStart = m_iFirstVisibleChar; - int xLeft = xPositionFromCharIndex(fm,iSelStart,TRUE); - int xRight = xPositionFromCharIndex(fm,m_iSelectionEnd + 1,TRUE); - -// pa.setRasterOp(Qt::NotROP); - pa.fillRect(xLeft,frameWidth(),xRight - xLeft,widgetWidth,KVI_OPTION_COLOR(KviOption_colorInputSelectionBackground)); -// pa.setRasterOp(Qt::CopyROP); - } - - // When m_bIMComposing is true, the text between m_iIMStart and m_iIMStart+m_iIMLength should be highlighted to show that this is the active - // preedit area for the input method, and the text outside cannot be edited while - // composing. Maybe this can be implemented similarly as painting the selection? - // Also notice that inside the preedit, there can also be a selection, given by - // m_iSelectionBegin and m_iSelectionLength, and the widget needs to highlight that - // while in IM composition mode - if(m_bIMComposing && m_iIMLength > 0) - { - // TODO Write a function to combine IM selection drawing code. maybe the preedit area too. - int iIMSelectionStart = m_iIMSelectionBegin; - if(iIMSelectionStart < m_iFirstVisibleChar) iIMSelectionStart = m_iFirstVisibleChar; - int xIMSelectionLeft = xPositionFromCharIndex(fm,iIMSelectionStart,TRUE); - int xIMSelectionRight = xPositionFromCharIndex(fm,iIMSelectionStart + m_iIMSelectionLength,TRUE); -// pa.setRasterOp(Qt::NotROP); - pa.fillRect(xIMSelectionLeft,0,xIMSelectionRight - xIMSelectionLeft, widgetWidth,KVI_OPTION_COLOR(KviOption_colorInputSelectionBackground)); -// pa.setRasterOp(Qt::CopyROP); - - // highlight the IM selection - int iIMStart = m_iIMStart; - if(m_iIMStart < m_iFirstVisibleChar) m_iIMStart = m_iFirstVisibleChar; - int xIMLeft = xPositionFromCharIndex(fm,iIMStart,TRUE); - int xIMRight = xPositionFromCharIndex(fm,iIMStart + m_iIMLength,TRUE); - - // underline the IM preedit - // Maybe should be put in drawTextBlock, similar to drawing underlined text - pa.drawLine(xIMLeft, bottom, xIMRight, bottom); - } - - pa.setClipping(false); - - while((charIdx < ((int)(m_szTextBuffer.length()))) && (curXPos < maxXPos)) - { - extractNextBlock(charIdx,fm,curXPos,maxXPos); - - if(m_bControlBlock) - { - pa.setPen(KVI_OPTION_COLOR(KviOption_colorInputControl)); - - QString s = getSubstituteChar(m_szTextBuffer[charIdx].unicode()); - - // the block width is 4 pixels more than the actual character - - pa.drawText(curXPos + 2,textBaseline,s,1); - - pa.drawRect(curXPos,top,m_iBlockWidth-1,bottom); - } else { - if(m_iSelectionBegin!=-1) - { - int iBlockEnd=charIdx+m_iBlockLen; - //block is selected (maybe partially) - if( iBlockEnd>m_iSelectionBegin && charIdx<=m_iSelectionEnd ) - { - int iSubStart,iSubLen; - //in common it consists of 3 parts: unselected-selected-unselected - //some of thst parts can be empty (for example block is fully selected) - - //first part start is always equal to the block start - iSubStart=charIdx; - iSubLen = m_iSelectionBegin>charIdx ? m_iSelectionBegin-charIdx : 0; - - - if(iSubLen) - { - drawTextBlock(&pa,fm,curXPos,textBaseline,iSubStart,iSubLen,FALSE); - curXPos += m_iBlockWidth; - m_iBlockWidth=0; - } - - //second one - iSubStart+=iSubLen; - iSubLen=m_iSelectionEnd<iBlockEnd ? m_iSelectionEnd-iSubStart+1 : iBlockEnd-iSubStart; - - - if(iSubLen) - { - drawTextBlock(&pa,fm,curXPos,textBaseline,iSubStart,iSubLen,TRUE); - curXPos += m_iBlockWidth; - m_iBlockWidth=0; - } - - if( m_iSelectionEnd<(iBlockEnd-1)) - { - iSubStart+=iSubLen; - iSubLen=iBlockEnd-iSubStart; - drawTextBlock(&pa,fm,curXPos,textBaseline,iSubStart,iSubLen,FALSE); - } - } else { - drawTextBlock(&pa,fm,curXPos,textBaseline,charIdx,m_iBlockLen); - } - } else { - drawTextBlock(&pa,fm,curXPos,textBaseline,charIdx,m_iBlockLen); - } - } - - curXPos += m_iBlockWidth; - charIdx += m_iBlockLen; - } - - //Now the cursor - - m_iLastCursorXPosition = KVI_INPUT_MARGIN; - m_iBlockLen = m_iFirstVisibleChar; - - while(m_iBlockLen < m_iCursorPosition) - { - QChar c = m_szTextBuffer.at(m_iBlockLen); -#ifdef COMPILE_USE_QT4 - m_iLastCursorXPosition+= c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c); -#else - m_iLastCursorXPosition+= (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c); -#endif - m_iBlockLen++; - } - - //m_iLastCursorXPosition = cur1XPos; - - if(m_bCursorOn) - { - pa.setPen(KVI_OPTION_COLOR(KviOption_colorInputCursor)); - pa.drawLine(m_iLastCursorXPosition,0,m_iLastCursorXPosition,widgetHeight); - } else { - pa.setPen(KVI_OPTION_COLOR(KviOption_colorInputForeground)); - } - -#ifdef COMPILE_USE_QT4 - // The other version of drawPixmap seems to be buggy - p->drawPixmap(rect.x(),rect.y(),rect.width(),rect.height(),*pDoubleBufferPixmap,0,0,widgetWidth,widgetHeight); -#else - p->drawPixmap(rect.x(),rect.y(),*pDoubleBufferPixmap,0,0,widgetWidth,widgetHeight); -#endif -} - -void KviInputEditor::drawTextBlock(QPainter * pa,QFontMetrics & fm,int curXPos,int textBaseline,int charIdx,int len,bool bSelected) -{ - QString tmp = m_szTextBuffer.mid(charIdx,len); - m_iBlockWidth = fm.width(tmp); - - QRect rect = contentsRect(); - int widgetHeight = rect.height(); - - if(m_iCurFore == KVI_INPUT_DEF_FORE) - { - pa->setPen( bSelected ? KVI_OPTION_COLOR(KviOption_colorInputSelectionForeground) : KVI_OPTION_COLOR(KviOption_colorInputForeground)); - } else { - if(((unsigned char)m_iCurFore) > 16) - { - pa->setPen(KVI_OPTION_COLOR(KviOption_colorInputBackground)); - } else { - pa->setPen(KVI_OPTION_MIRCCOLOR((unsigned char)m_iCurFore)); - } - } - - if(m_iCurBack != KVI_INPUT_DEF_BACK) - { - if(((unsigned char)m_iCurBack) > 16) - { - pa->fillRect(curXPos,(widgetHeight-fm.height())/2,m_iBlockWidth,fm.height(),KVI_OPTION_COLOR(KviOption_colorInputForeground)); - } else { - pa->fillRect(curXPos,(widgetHeight-fm.height())/2,m_iBlockWidth,fm.height(),KVI_OPTION_MIRCCOLOR((unsigned char)m_iCurBack)); - } - } - - pa->drawText(curXPos,textBaseline,tmp); - - if(m_bCurBold)pa->drawText(curXPos+1,textBaseline,tmp); - if(m_bCurUnderline) - { - pa->drawLine(curXPos,textBaseline + fm.descent(),curXPos+m_iBlockWidth,textBaseline + fm.descent()); - } - -} - -QChar KviInputEditor::getSubstituteChar(unsigned short control_code) -{ - switch(control_code) - { - case KVI_TEXT_COLOR: - return QChar('K'); - break; - case KVI_TEXT_BOLD: - return QChar('B'); - break; - case KVI_TEXT_RESET: - return QChar('O'); - break; - case KVI_TEXT_REVERSE: - return QChar('R'); - break; - case KVI_TEXT_UNDERLINE: - return QChar('U'); - break; - case KVI_TEXT_CRYPTESCAPE: - return QChar('P'); - break; - case KVI_TEXT_ICON: - return QChar('I'); - break; - default: - return QChar(control_code); - break; - } -} - -void KviInputEditor::extractNextBlock(int idx,QFontMetrics & fm,int curXPos,int maxXPos) -{ - m_iBlockLen = 0; - m_iBlockWidth = 0; - - QChar c = m_szTextBuffer[idx]; - - if((c.unicode() > 32) || - ((c != QChar(KVI_TEXT_COLOR)) && - (c != QChar(KVI_TEXT_BOLD)) && (c != QChar(KVI_TEXT_UNDERLINE)) && - (c != QChar(KVI_TEXT_RESET)) && (c != QChar(KVI_TEXT_REVERSE)) && - (c != QChar(KVI_TEXT_CRYPTESCAPE)) && (c != QChar(KVI_TEXT_ICON)))) - { - m_bControlBlock = false; - //Not a control code...run.. - while((idx < ((int)(m_szTextBuffer.length()))) && (curXPos < maxXPos)) - { - c = m_szTextBuffer[idx]; - if((c.unicode() > 32) || - ((c != QChar(KVI_TEXT_COLOR)) && (c != QChar(KVI_TEXT_BOLD)) && - (c != QChar(KVI_TEXT_UNDERLINE)) && (c != QChar(KVI_TEXT_RESET)) && - (c != QChar(KVI_TEXT_REVERSE)) && (c != QChar(KVI_TEXT_CRYPTESCAPE)) && - (c != QChar(KVI_TEXT_ICON)))) - { - m_iBlockLen++; -#ifdef COMPILE_USE_QT4 - int xxx = c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);; -#else - int xxx = (c.unicode() < 256 ? g_iInputFontCharWidth[c.unicode()] : fm.width(c)); -#endif - m_iBlockWidth +=xxx; - curXPos +=xxx; - idx++; - } else break; - } - return; - } else { - m_bControlBlock = true; - m_iBlockLen = 1; - m_iBlockWidth = g_iInputFontCharWidth[c.unicode()]; - //Control code - switch(c.unicode()) - { - case KVI_TEXT_BOLD: - m_bCurBold = ! m_bCurBold; - break; - case KVI_TEXT_UNDERLINE: - m_bCurUnderline = ! m_bCurUnderline; - break; - case KVI_TEXT_RESET: - m_iCurFore = KVI_INPUT_DEF_FORE; - m_iCurBack = KVI_INPUT_DEF_BACK; - m_bCurBold = false; - m_bCurUnderline = false; - break; - case KVI_TEXT_REVERSE: - { - char auxClr = m_iCurFore; - m_iCurFore = m_iCurBack; - m_iCurBack = auxClr; - } - break; - case KVI_TEXT_CRYPTESCAPE: - case KVI_TEXT_ICON: - // makes a single block - break; - case KVI_TEXT_COLOR: - { - idx++; - if(idx >= ((int)(m_szTextBuffer.length())))return; - unsigned char fore; - unsigned char back; - idx = getUnicodeColorBytes(m_szTextBuffer,idx,&fore,&back); - if(fore != KVI_NOCHANGE) - { - m_iCurFore = fore; - if(back != KVI_NOCHANGE)m_iCurBack = back; - } else { - // ONLY a CTRL+K - m_iCurBack = KVI_INPUT_DEF_BACK; - m_iCurFore = KVI_INPUT_DEF_FORE; - } - } - break; - default: - debug("Ops.."); - exit(0); - break; - } - } -} - -void KviInputEditor::runUpToTheFirstVisibleChar() -{ - register int idx = 0; - while(idx < m_iFirstVisibleChar) - { - unsigned short c = m_szTextBuffer[idx].unicode(); - if(c < 32) - { - switch(c) - { - case KVI_TEXT_BOLD: - m_bCurBold = ! m_bCurBold; - break; - case KVI_TEXT_UNDERLINE: - m_bCurUnderline = ! m_bCurUnderline; - break; - case KVI_TEXT_RESET: - m_iCurFore = KVI_INPUT_DEF_FORE; - m_iCurBack = KVI_INPUT_DEF_BACK; - m_bCurBold = false; - m_bCurUnderline = false; - break; - case KVI_TEXT_REVERSE: - { - char auxClr = m_iCurFore; - m_iCurFore = m_iCurBack; - m_iCurBack = auxClr; - } - break; - case KVI_TEXT_COLOR: - { - idx++; - if(idx >= ((int)(m_szTextBuffer.length())))return; - unsigned char fore; - unsigned char back; - idx = getUnicodeColorBytes(m_szTextBuffer,idx,&fore,&back); - idx--; - if(fore != KVI_NOCHANGE)m_iCurFore = fore; - else m_iCurFore = KVI_INPUT_DEF_FORE; - if(back != KVI_NOCHANGE)m_iCurBack = back; - else m_iCurBack = KVI_INPUT_DEF_BACK; - } - break; - case 0: - debug("KviInputEditor::Encountered invisible end of the string!"); - exit(0); - break; - } - } - idx++; - } -} - - -void KviInputEditor::mousePressEvent(QMouseEvent *e) -{ - if(e->button() & Qt::LeftButton) - { - m_iCursorPosition = charIndexFromXPosition(e->pos().x()); - //move the cursor to - int anchorX = xPositionFromCharIndex(m_iCursorPosition); - if(anchorX > (width()-frameWidth()))m_iFirstVisibleChar++; - m_iSelectionAnchorChar = m_iCursorPosition; - selectOneChar(-1); - //grabMouse(QCursor(crossCursor)); - repaintWithCursorOn(); - killDragTimer(); - m_iDragTimer = startTimer(KVI_INPUT_DRAG_TIMEOUT); - - } else if(e->button() & Qt::RightButton) - { - int type = g_pActiveWindow->type(); - - //Popup menu - g_pInputPopup->clear(); - - QString szClip; - - QClipboard * c = QApplication::clipboard(); - if(c) - { - szClip = c->text(QClipboard::Clipboard); - -#ifdef COMPILE_USE_QT4 - int occ = szClip.count(QChar('\n')); -#else - int occ = szClip.contains(QChar('\n')); -#endif - - if(!szClip.isEmpty()) - { - if(szClip.length() > 60) - { - szClip.truncate(60); - szClip.append("..."); - } - szClip.replace(QChar('&'),"&"); - szClip.replace(QChar('<'),"<"); - szClip.replace(QChar('>'),">"); - szClip.replace(QChar('\n'),"<br>"); - - QString label = "<center><b>"; - label += __tr2qs("Clipboard"); - label += ":</b><br>"; - label += szClip; - label += "<br><b>"; - - QString num; - num.setNum(occ); - - label += num; - label += QChar(' '); - label += (occ == 1) ? __tr2qs("line break") : __tr2qs("line breaks"); - label += "</b></center>"; - - QLabel * l = new QLabel(label,g_pInputPopup); - l->setFrameStyle(QFrame::Raised | QFrame::StyledPanel); - l->setMargin(5); - // FIXME: This does NOT work under Qt 4.x (they seem to consider it as bad UI design) -#ifndef COMPILE_USE_QT4 - g_pInputPopup->insertItem(l); -#else - delete l; -#endif - } - } - - int id = g_pInputPopup->insertItem(__tr2qs("Cu&t") + ACCEL_KEY(X),this,SLOT(cut())); - g_pInputPopup->setItemEnabled(id,hasSelection()); - id = g_pInputPopup->insertItem(__tr2qs("&Copy") + ACCEL_KEY(C),this,SLOT(copyToClipboard())); - g_pInputPopup->setItemEnabled(id,hasSelection()); - id = g_pInputPopup->insertItem(__tr2qs("&Paste") + ACCEL_KEY(V),this,SLOT(pasteClipboardWithConfirmation())); - g_pInputPopup->setItemEnabled(id,!szClip.isEmpty() && !m_bReadOnly); - id = g_pInputPopup->insertItem(__tr2qs("Paste (Slowly)"),this,SLOT(pasteSlow())); - if ((type == KVI_WINDOW_TYPE_CHANNEL) || (type == KVI_WINDOW_TYPE_QUERY) || (type == KVI_WINDOW_TYPE_DCCCHAT)) - g_pInputPopup->setItemEnabled(id,!szClip.isEmpty() && !m_bReadOnly); - else - g_pInputPopup->setItemEnabled(id,false); - id = g_pInputPopup->insertItem(__tr2qs("Paste &File") + ACCEL_KEY(F),this,SLOT(pasteFile())); - if ((type != KVI_WINDOW_TYPE_CHANNEL) && (type != KVI_WINDOW_TYPE_QUERY) && (type != KVI_WINDOW_TYPE_DCCCHAT)) - g_pInputPopup->setItemEnabled(id,false); - else - g_pInputPopup->setItemEnabled(id,!m_bReadOnly); - if(m_bSpSlowFlag ==true) - { - id = g_pInputPopup->insertItem(__tr2qs("Stop Paste"),this,SLOT(stopPasteSlow())); /*G&N 2005*/ - } - id = g_pInputPopup->insertItem(__tr2qs("Clear"),this,SLOT(clear())); - g_pInputPopup->setItemEnabled(id,!m_szTextBuffer.isEmpty() && !m_bReadOnly); - g_pInputPopup->insertSeparator(); - id = g_pInputPopup->insertItem(__tr2qs("Select All"),this,SLOT(selectAll())); - g_pInputPopup->setItemEnabled(id,(!m_szTextBuffer.isEmpty())); - - - g_pInputPopup->insertSeparator(); - m_pIconMenu->clear(); - - KviPointerHashTable<QString,KviTextIcon> * d = g_pTextIconManager->textIconDict(); - KviPointerHashTableIterator<QString,KviTextIcon> it(*d); - QStringList strList; - while(KviTextIcon * i = it.current()) - { - strList.append(it.currentKey()); - ++it; - } - strList.sort(); - KviTextIcon * icon; - QPixmap *pix; - - for(QStringList::Iterator iter = strList.begin(); iter != strList.end(); ++iter) - { - icon=g_pTextIconManager->lookupTextIcon(*iter); - if(icon) - { - pix = icon->pixmap(); - if(pix) m_pIconMenu->insertItem(*pix,*iter); - } - } - - g_pInputPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_BIGGRIN)),__tr2qs("Insert Icon"),m_pIconMenu); - g_pInputPopup->popup(mapToGlobal(e->pos())); - } else { - pasteSelectionWithConfirmation(); - } -} -void KviInputEditor::iconPopupActivated(int id) -{ - if(!m_bReadOnly) - { - QString text = m_pIconMenu->text(id); - if(!text.isEmpty()) - { - text.prepend(KVI_TEXT_ICON); - text.append(' '); - insertText(text); - } - } -} - -bool KviInputEditor::hasSelection() -{ - return ((m_iSelectionBegin != -1)&&(m_iSelectionEnd != -1)); -} - -void KviInputEditor::copyToClipboard() -{ - if(!hasSelection())return; - QClipboard * c = QApplication::clipboard(); - if(!c)return; - QString szTxt = m_szTextBuffer.mid(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1); - c->setText(szTxt,QClipboard::Clipboard); - repaintWithCursorOn(); -} - -void KviInputEditor::copyToSelection(bool bDonNotCopyToClipboard) -{ - if(!hasSelection())return; - QClipboard * c = QApplication::clipboard(); - if(!c)return; - QString szTxt = m_szTextBuffer.mid(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1); - if(c->supportsSelection()) - c->setText(szTxt,QClipboard::Selection); - else if(!bDonNotCopyToClipboard) - c->setText(szTxt,QClipboard::Clipboard); - repaintWithCursorOn(); -} - - -void KviInputEditor::moveCursorTo(int idx,bool bRepaint) -{ - if(idx < 0)idx = 0; - if(idx > ((int)(m_szTextBuffer.length())))idx = m_szTextBuffer.length(); - if(idx > m_iCursorPosition) - { - while(m_iCursorPosition < idx) - { - moveRightFirstVisibleCharToShowCursor(); - m_iCursorPosition++; - } - } else { - m_iCursorPosition = idx; - if(m_iFirstVisibleChar > m_iCursorPosition)m_iFirstVisibleChar = m_iCursorPosition; - } - if(bRepaint)repaintWithCursorOn(); -} - -void KviInputEditor::removeSelected() -{ - if(!hasSelection())return; - m_szTextBuffer.remove(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1); - moveCursorTo(m_iSelectionBegin,false); - selectOneChar(-1); - repaintWithCursorOn(); -} - -void KviInputEditor::cut() -{ - if(!hasSelection())return; - QClipboard * c = QApplication::clipboard(); - if(!c)return; - c->setText(m_szTextBuffer.mid(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1),QClipboard::Clipboard); - m_szTextBuffer.remove(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1); - moveCursorTo(m_iSelectionBegin,false); - selectOneChar(-1); - repaintWithCursorOn(); -} - -void KviInputEditor::insertText(const QString &text) -{ - QString szText = text; // crop away constness - if(szText.isEmpty())return; - - //szText.replaceAll('\t'," "); //Do not paste tabs - - //szText.replace(QRegExp("\t")," "); // do not paste tabs - - m_bUpdatesEnabled = false; - removeSelected(); - m_bUpdatesEnabled = true; - - if(szText.find('\n') == -1) - { - m_szTextBuffer.insert(m_iCursorPosition,szText); - m_szTextBuffer.truncate(m_iMaxBufferSize); - moveCursorTo(m_iCursorPosition + szText.length()); - } else { - //Multiline paste...do not execute commands here - QString szBlock; - while(!szText.isEmpty()) - { - int idx = szText.find('\n'); - if(idx != -1) - { - szBlock = szText.left(idx); - //else szBlock = QChar(KVI_TEXT_RESET); - szText.remove(0,idx+1); - } else { - szBlock = szText; - szText = ""; - } - - m_szTextBuffer.insert(m_iCursorPosition,szBlock); - m_szTextBuffer.truncate(m_iMaxBufferSize); - - int pos = 0; - while((pos < ((int)(m_szTextBuffer.length()))) && (m_szTextBuffer[pos] < 33))pos++; - if((pos < ((int)(m_szTextBuffer.length()))) && (m_szTextBuffer[pos] == QChar('/')))m_szTextBuffer.insert(pos,"\\"); - - returnPressed(idx != -1); - } - } -} - -// Replace (length) characters in the buffer from (start) with (text), returns -// the length of the text inserted (different from text.length() only if the -// buffer was truncated. -int KviInputEditor::replaceSegment(int start, int length, const QString &text) -{ - m_szTextBuffer.remove(start, length); - m_szTextBuffer.insert(start, text); - m_szTextBuffer.truncate(m_iMaxBufferSize); - repaintWithCursorOn(); - - int iInsertedLength = text.length(); - int iMaxInsertedLength = m_iMaxBufferSize - start; - if(iInsertedLength > iMaxInsertedLength) return iMaxInsertedLength; - return iInsertedLength; -} - -void KviInputEditor::pasteClipboardWithConfirmation() -{ - QClipboard * c = QApplication::clipboard(); - if(!c)return; - QString szText = c->text(QClipboard::Clipboard); - - if(szText.contains(QChar('\n')) > 0) - { - if(m_pInputParent->inherits("KviInput")) - ((KviInput*)(m_pInputParent))->multiLinePaste(szText); - } else { - insertText(szText); - } -} - -void KviInputEditor::pasteSelectionWithConfirmation() -{ - QClipboard * c = QApplication::clipboard(); - if(!c)return; - QString szText = c->text(c->supportsSelection() ? QClipboard::Selection : QClipboard::Clipboard); - - if(szText.contains(QChar('\n')) > 0) - { - if(m_pInputParent->inherits("KviInput")) - ((KviInput*)(m_pInputParent))->multiLinePaste(szText); - } else { - insertText(szText); - } -} - -void KviInputEditor::pasteSlow() -{ - KviKvsScript::run("spaste.clipboard",g_pActiveWindow); - m_bSpSlowFlag = true; -} - -void KviInputEditor::stopPasteSlow() -{ - KviKvsScript::run("spaste.stop",g_pActiveWindow); - m_bSpSlowFlag = false; -} - -void KviInputEditor::pasteFile() -{ - QString stmp = QFileDialog::getOpenFileName("","",this,"Paste File", "Choose a file" ); - if(stmp!="") - { - QString stmp1 = "spaste.file " + stmp ; - KviKvsScript::run(stmp1,g_pActiveWindow); - m_bSpSlowFlag = true; - } -} - -void KviInputEditor::selectAll() -{ - if(m_szTextBuffer.length() > 0) - { - m_iSelectionBegin = 0; - m_iSelectionEnd = m_szTextBuffer.length()-1; - } - end(); -} - -void KviInputEditor::clear() -{ - m_szTextBuffer = ""; - selectOneChar(-1); - home(); -} - -void KviInputEditor::setText(const QString text) -{ - m_szTextBuffer = text; - m_szTextBuffer.truncate(m_iMaxBufferSize); - selectOneChar(-1); - end(); -} - -void KviInputEditor::mouseReleaseEvent(QMouseEvent *) -{ - if(m_iDragTimer) - { - m_iSelectionAnchorChar =-1; - //releaseMouse(); - killDragTimer(); - } - if(hasSelection()) - copyToSelection(); -} - -void KviInputEditor::killDragTimer() -{ - if(m_iDragTimer) - { - killTimer(m_iDragTimer); - m_iDragTimer = 0; - } -} - -void KviInputEditor::timerEvent(QTimerEvent *e) -{ - if(e->timerId() == m_iCursorTimer) - { - if(!hasFocus() || !isVisibleToTLW()) - { - killTimer(m_iCursorTimer); - m_iCursorTimer = 0; - m_bCursorOn = false; - } else m_bCursorOn = ! m_bCursorOn; - update(); - } else { - //Drag timer - handleDragSelection(); - } -} - -void KviInputEditor::handleDragSelection() -{ - if(m_iSelectionAnchorChar == -1)return; - - QPoint pnt = mapFromGlobal(QCursor::pos()); - - - if(pnt.x() <= 0) - { - //Left side dragging - if(m_iFirstVisibleChar > 0)m_iFirstVisibleChar--; - m_iCursorPosition = m_iFirstVisibleChar; - } else if(pnt.x() >= width()) - { - //Right side dragging...add a single character to the selection on the right - if(m_iCursorPosition < ((int)(m_szTextBuffer.length()))) - { - moveRightFirstVisibleCharToShowCursor(); - m_iCursorPosition++; - } //else at the end of the selection...don't move anything - } else { - //Inside the window... - m_iCursorPosition = charIndexFromXPosition(pnt.x()); - } - if(m_iCursorPosition == m_iSelectionAnchorChar)selectOneChar(-1); - else { - if(m_iCursorPosition > m_iSelectionAnchorChar) - { - m_iSelectionBegin = m_iSelectionAnchorChar; - m_iSelectionEnd = m_iCursorPosition-1; - } else { - m_iSelectionBegin = m_iCursorPosition; - m_iSelectionEnd = m_iSelectionAnchorChar-1; - } - } - repaintWithCursorOn(); -} - -void KviInputEditor::returnPressed(bool bRepaint) -{ - if (!m_szTextBuffer.isEmpty() /* && (!m_pHistory->current() || m_szTextBuffer.compare(*(m_pHistory->current())))*/) - { - if(m_pInputParent->inherits("KviInput")) - g_pInputHistory->add(new QString(m_szTextBuffer)); - - m_pHistory->insert(0,new QString(m_szTextBuffer)); - } - - __range_valid(KVI_INPUT_MAX_LOCAL_HISTORY_ENTRIES > 1); //ABSOLUTELY NEEDED, if not, pHist will be destroyed... - if(m_pHistory->count() > KVI_INPUT_MAX_LOCAL_HISTORY_ENTRIES)m_pHistory->removeLast(); - - m_iCurHistoryIdx = -1; - - // FIXME: ALL THIS STUFF SHOULD BE CONVERTED TO QString - /* - if(m_pInputParent->inherits("KviInput")) - { - QString szBuffer(m_szTextBuffer); - m_szTextBuffer=""; - selectOneChar(-1); - m_iCursorPosition = 0; - m_iFirstVisibleChar = 0; - if(bRepaint)repaintWithCursorOn(); - KviUserInput::parse(szBuffer,m_pKviWindow); - } else { - */ - emit enterPressed(); - /* - return; - } - */ -} - -void KviInputEditor::focusInEvent(QFocusEvent *) -{ - if(m_iCursorTimer==0) - { - m_iCursorTimer = startTimer(KVI_INPUT_BLINK_TIME); - m_bCursorOn = true; - update(); - } - // XIM handling... -#ifndef COMPILE_USE_QT4 - // THIS SEEMS TO BE GONE IN Qt4.x ? (even if the documentation states that it *should* be there) - setMicroFocusHint(1,1,width() - 2,height() - 2,true,0); -#endif -} - -void KviInputEditor::focusOutEvent(QFocusEvent *) -{ - if(m_iCursorTimer)killTimer(m_iCursorTimer); - m_iCursorTimer = 0; - m_bCursorOn = false; - update(); -} - - -void KviInputEditor::internalCursorRight(bool bShift) -{ - if(m_iCursorPosition >= ((int)(m_szTextBuffer.length())))return; - moveRightFirstVisibleCharToShowCursor(); - //Grow the selection if needed - if(bShift) - { - if((m_iSelectionBegin > -1)&&(m_iSelectionEnd > -1)) - { - if(m_iSelectionEnd == m_iCursorPosition-1)m_iSelectionEnd++; - else if(m_iSelectionBegin == m_iCursorPosition)m_iSelectionBegin++; - else selectOneChar(m_iCursorPosition); - } else selectOneChar(m_iCursorPosition); - } else selectOneChar(-1); - m_iCursorPosition++; -} - -void KviInputEditor::internalCursorLeft(bool bShift) -{ - if(m_iCursorPosition <= 0)return; - - if(bShift) - { - if((m_iSelectionBegin > -1)&&(m_iSelectionEnd > -1)) - { - if(m_iSelectionBegin == m_iCursorPosition)m_iSelectionBegin--; - else if(m_iSelectionEnd == m_iCursorPosition-1)m_iSelectionEnd--; - else selectOneChar(m_iCursorPosition - 1); - } else selectOneChar(m_iCursorPosition - 1); - } else selectOneChar(-1); - - m_iCursorPosition--; - if(m_iFirstVisibleChar > m_iCursorPosition)m_iFirstVisibleChar--; -} - -// remember the text before and after the cursor at this point, and put them -// before and after the text inserted by IM in imEndEvent. -// hagabaka -void KviInputEditor::imStartEvent(QIMEvent *e) -{ - removeSelected(); - m_iIMStart = m_iIMSelectionBegin = m_iCursorPosition; - m_iIMLength = 0; - m_bIMComposing = true; - e->accept(); -} - -// Whenever the IM's preedit changes, update the visuals and internal data. refer to <http://doc.trolltech.com/3.3/qimevent.html> */ -// hagabaka -void KviInputEditor::imComposeEvent(QIMEvent *e) -{ - // replace the old pre-edit string with e->text() - m_bUpdatesEnabled = false; -#ifdef COMPILE_USE_QT4 - // Qt 4.x ?????????? - m_iIMLength = replaceSegment(m_iIMStart, m_iIMLength, e->commitString()); - - // update selection inside the pre-edit - m_iIMSelectionBegin = m_iIMStart + e->replacementStart(); - m_iIMSelectionLength = e->replacementLength(); - moveCursorTo(m_iIMSelectionBegin); - -#else - m_iIMLength = replaceSegment(m_iIMStart, m_iIMLength, e->text()); - - // update selection inside the pre-edit - m_iIMSelectionBegin = m_iIMStart + e->cursorPos(); - m_iIMSelectionLength = e->selectionLength(); - moveCursorTo(m_iIMSelectionBegin); -#endif - - - // repaint - m_bUpdatesEnabled = true; - repaintWithCursorOn(); - e->accept(); -} - -// Input method is done; put its resulting text to where the preedit area was -// hagabaka -void KviInputEditor::imEndEvent(QIMEvent *e) -{ - // replace the preedit area with the IM result text - m_bUpdatesEnabled = false; -#ifdef COMPILE_USE_QT4 - // Qt 4.x ?????????? - m_iIMLength = replaceSegment(m_iIMStart, m_iIMLength, e->commitString()); -#else - m_iIMLength = replaceSegment(m_iIMStart, m_iIMLength, e->text()); -#endif - - // move cursor to after the IM result text - moveCursorTo(m_iIMStart + m_iIMLength); - - // repaint - m_bUpdatesEnabled = true; - repaintWithCursorOn(); - - // reset data - m_bIMComposing = false; - e->accept(); -} - -// FIXME According to <http://www.kde.gr.jp/~asaki/how-to-support-input-method.html>, if the XIM -// style used is OverTheTop, code needs to be added in keyPressEvent handler */ -// hagabaka -void KviInputEditor::keyPressEvent(QKeyEvent *e) -{ - // disable the keyPress handling when IM is in composition. - if(m_bIMComposing) - { - e->ignore(); - return; - } - // completion thingies - - if(!m_bReadOnly) - { - if((e->key() == Qt::Key_Tab) || (e->key() == Qt::Key_BackTab)) - { - completion(e->state() & Qt::ShiftButton); - return; - } else { - m_bLastCompletionFinished=1; - } - } - - - if(e->key() == Qt::Key_Escape) - { - emit escapePressed(); - return; - } - - if((e->state() & Qt::AltButton) || (e->state() & Qt::ControlButton)) - { - switch(e->key()) - { - case Qt::Key_Backspace: - if(m_pInputParent->inherits("KviInput")) - { - ((KviInput*)(m_pInputParent))->multiLinePaste(m_szTextBuffer); - clear(); - return; - } - break; - } - } - -//Make CtrlKey and CommandKey ("Apple") behave equally on MacOSX. -//This way typical X11 and Apple shortcuts can be used simultanously within the input line. -#ifndef Q_OS_MACX - if(e->state() & Qt::ControlButton) -#else - if((e->state() & Qt::ControlButton) || (e->state() & Qt::MetaButton)) -#endif - { - switch(e->key()) - { - case Qt::Key_Right: - if(m_iCursorPosition < ((int)(m_szTextBuffer.length()))) - { - // skip whitespace - while(m_iCursorPosition < ((int)(m_szTextBuffer.length()))) - { - if(!m_szTextBuffer.at(m_iCursorPosition).isSpace())break; - internalCursorRight(e->state() & Qt::ShiftButton); - } - // skip nonwhitespace - while(m_iCursorPosition < ((int)(m_szTextBuffer.length()))) - { - if(m_szTextBuffer.at(m_iCursorPosition).isSpace())break; - internalCursorRight(e->state() & Qt::ShiftButton); - } - repaintWithCursorOn(); - } - break; - case Qt::Key_Left: - if(m_iCursorPosition > 0) - { - // skip whitespace - while(m_iCursorPosition > 0) - { - if(!m_szTextBuffer.at(m_iCursorPosition - 1).isSpace())break; - internalCursorLeft(e->state() & Qt::ShiftButton); - } - // skip nonwhitespace - while(m_iCursorPosition > 0) - { - if(m_szTextBuffer.at(m_iCursorPosition - 1).isSpace())break; - internalCursorLeft(e->state() & Qt::ShiftButton); - } - repaintWithCursorOn(); - } - break; - case Qt::Key_K: - { - if(!m_bReadOnly) - { - insertChar(KVI_TEXT_COLOR); - int xPos = xPositionFromCharIndex(m_iCursorPosition); - if(xPos > 24)xPos-=24; - if(!g_pColorWindow)g_pColorWindow = new KviColorWindow(); - if(xPos+g_pColorWindow->width() > width())xPos = width()-(g_pColorWindow->width()+2); - g_pColorWindow->move(mapToGlobal(QPoint(xPos,-35))); - g_pColorWindow->popup(this); - } - } - break; - case Qt::Key_B: - if(!m_bReadOnly) insertChar(KVI_TEXT_BOLD); - break; - case Qt::Key_O: - if(!m_bReadOnly) insertChar(KVI_TEXT_RESET); - break; - case Qt::Key_U: - if(!m_bReadOnly) insertChar(KVI_TEXT_UNDERLINE); - break; - case Qt::Key_R: - if(!m_bReadOnly) insertChar(KVI_TEXT_REVERSE); - break; - case Qt::Key_P: - if(!m_bReadOnly) insertChar(KVI_TEXT_CRYPTESCAPE); // DO NOT CRYPT THIS STUFF - break; - case Qt::Key_I: - { - if(!m_bReadOnly) - { - insertChar(KVI_TEXT_ICON); // THE NEXT WORD IS AN ICON NAME - int xPos = xPositionFromCharIndex(m_iCursorPosition); - if(xPos > 24)xPos-=24; - if(!g_pTextIconWindow)g_pTextIconWindow = new KviTextIconWindow(); - if(xPos+g_pTextIconWindow->width() > width())xPos = width()-(g_pTextIconWindow->width()+2); - g_pTextIconWindow->move(mapToGlobal(QPoint(xPos,-KVI_TEXTICON_WIN_HEIGHT))); - g_pTextIconWindow->popup(this); - } - } - break; - case Qt::Key_C: - copyToClipboard(); - break; - case Qt::Key_X: - if(!m_bReadOnly) cut(); - break; - case Qt::Key_V: - if(!m_bReadOnly) pasteClipboardWithConfirmation(); - break; - //case Qt::Key_Backspace: - case Qt::Key_W: - if(m_iCursorPosition > 0 && !m_bReadOnly && !hasSelection()) - { - // skip whitespace - while(m_iCursorPosition > 0) - { - if(!m_szTextBuffer.at(m_iCursorPosition - 1).isSpace())break; - m_szTextBuffer.remove(m_iCursorPosition-1,1); - m_iCursorPosition--; - if(m_iFirstVisibleChar > m_iCursorPosition)m_iFirstVisibleChar--; - } - // skip nonwhitespace - while(m_iCursorPosition > 0) - { - if(m_szTextBuffer.at(m_iCursorPosition - 1).isSpace())break; - m_szTextBuffer.remove(m_iCursorPosition-1,1); - m_iCursorPosition--; - if(m_iFirstVisibleChar > m_iCursorPosition)m_iFirstVisibleChar--; - } - repaintWithCursorOn(); - } - break; - case Qt::Key_PageUp: - if(KVI_OPTION_BOOL(KviOption_boolDisableInputHistory)) break; - if(m_pInputParent->inherits("KviInput")) - ((KviInput*)(m_pInputParent))->historyButtonClicked(); - break; - case Qt::Key_F: - if(m_pKviWindow) - if(m_pKviWindow->view())m_pKviWindow->view()->toggleToolWidget(); - break; - case Qt::Key_A: - m_iSelectionBegin=0; - m_iSelectionEnd=m_szTextBuffer.length()-1; - m_iCursorPosition=m_szTextBuffer.length(); - repaintWithCursorOn(); - break; - case Qt::Key_Return: - case Qt::Key_Enter: - if(m_pInputParent->inherits("KviInput")) - { - QString szBuffer(m_szTextBuffer); - m_szTextBuffer=""; - selectOneChar(-1); - m_iCursorPosition = 0; - m_iFirstVisibleChar = 0; - repaintWithCursorOn(); - KviUserInput::parseNonCommand(szBuffer,m_pKviWindow); - if (!szBuffer.isEmpty()) - { - g_pInputHistory->add(new QString(szBuffer)); - m_pHistory->insert(0,new QString(szBuffer)); - } - - __range_valid(KVI_INPUT_MAX_LOCAL_HISTORY_ENTRIES > 1); //ABSOLUTELY NEEDED, if not, pHist will be destroyed... - if(m_pHistory->count() > KVI_INPUT_MAX_LOCAL_HISTORY_ENTRIES)m_pHistory->removeLast(); - - m_iCurHistoryIdx = -1; - } - break; - default: - if(!m_bReadOnly) insertText(e->text()); - break; - } - return; - } - - if((e->state() & Qt::AltButton) && (e->state() & Qt::Keypad)) - { - // Qt::Key_Meta seems to substitute Qt::Key_Alt on some keyboards - if((e->key() == Qt::Key_Alt) || (e->key() == Qt::Key_Meta)) - { - m_szAltKeyCode = ""; - return; - } else if((e->ascii() >= '0') && (e->ascii() <= '9')) - { - m_szAltKeyCode += e->ascii(); - return; - } - - //debug("%c",e->ascii()); - if(!m_bReadOnly) { - insertText(e->text()); - } - return; - } - - if(e->state() & Qt::ShiftButton) - { - switch(e->key()) - { - case Qt::Key_Insert: - if(!m_bReadOnly) pasteClipboardWithConfirmation(); - return; - break; - case Qt::Key_PageUp: - if(m_pKviWindow) - if(m_pKviWindow->view())m_pKviWindow->view()->prevLine(); - return; - break; - case Qt::Key_PageDown: - if(m_pKviWindow) - if(m_pKviWindow->view())m_pKviWindow->view()->nextLine(); - return; - break; - } - } - - switch(e->key()) - { - case Qt::Key_Right: - if(m_iCursorPosition < ((int)(m_szTextBuffer.length()))) - { - internalCursorRight(e->state() & Qt::ShiftButton); - repaintWithCursorOn(); - } - break; - case Qt::Key_Left: - if(m_iCursorPosition > 0) - { - internalCursorLeft(e->state() & Qt::ShiftButton); - repaintWithCursorOn(); - } - break; - case Qt::Key_Backspace: - if(!m_bReadOnly) - { - if(hasSelection() && (m_iSelectionEnd >= m_iCursorPosition-1) && (m_iSelectionBegin <= m_iCursorPosition)) - { - //remove the selection - m_szTextBuffer.remove(m_iSelectionBegin,(m_iSelectionEnd-m_iSelectionBegin)+1); - m_iCursorPosition = m_iSelectionBegin; - if(m_iFirstVisibleChar > m_iCursorPosition)m_iFirstVisibleChar = m_iCursorPosition; - } else if(m_iCursorPosition > 0) { - m_iCursorPosition--; - m_szTextBuffer.remove(m_iCursorPosition,1); - if(m_iFirstVisibleChar > m_iCursorPosition)m_iFirstVisibleChar--; - } - selectOneChar(-1); - repaintWithCursorOn(); - } - break; - case Qt::Key_Delete: - if(!m_bReadOnly) - { - if(hasSelection()) removeSelected(); - else if(m_iCursorPosition < (int)m_szTextBuffer.length()) - { - m_szTextBuffer.remove(m_iCursorPosition,1); - selectOneChar(-1); - repaintWithCursorOn(); - } - } - break; - case Qt::Key_Home: - if(m_iCursorPosition > 0) - { - if(e->state() & Qt::ShiftButton) - { - if((m_iSelectionBegin == -1)&&(m_iSelectionEnd == -1))m_iSelectionEnd = m_iCursorPosition - 1; - m_iSelectionBegin = 0; - } else { - selectOneChar(-1); - } - home(); - } - break; - case Qt::Key_End://we should call it even the cursor is at the end for deselecting - if(e->state() & Qt::ShiftButton) - { - if((m_iSelectionBegin == -1)&&(m_iSelectionEnd == -1))m_iSelectionBegin = m_iCursorPosition; - m_iSelectionEnd = m_szTextBuffer.length()-1; - } else { - selectOneChar(-1); - } - end(); - break; - case Qt::Key_Up: - if(!m_bReadOnly) - { - if(m_pHistory->count() > 0) - { - if(m_iCurHistoryIdx < 0) - { - m_szSaveTextBuffer = m_szTextBuffer; - m_szTextBuffer = *(m_pHistory->at(0)); - m_iCurHistoryIdx = 0; - } else if(m_iCurHistoryIdx >= (int)(m_pHistory->count()-1)) - { - m_szTextBuffer=m_szSaveTextBuffer; - m_iCurHistoryIdx = -1; - } else { - m_iCurHistoryIdx++; - m_szTextBuffer = *(m_pHistory->at(m_iCurHistoryIdx)); - } - selectOneChar(-1); - if(KVI_OPTION_BOOL(KviOption_boolInputHistoryCursorAtEnd))end(); - else home(); - } - } - break; - case Qt::Key_Down: - if(!m_bReadOnly) - { - if(m_pHistory->count() > 0) - { - if(m_iCurHistoryIdx < 0) - { - m_szSaveTextBuffer = m_szTextBuffer; - m_szTextBuffer = *(m_pHistory->at(m_pHistory->count()-1)); - m_iCurHistoryIdx =m_pHistory->count()-1; - } else if(m_iCurHistoryIdx == 0) - { - m_szTextBuffer=m_szSaveTextBuffer; - m_iCurHistoryIdx = -1; - } else { - m_iCurHistoryIdx--; - m_szTextBuffer = *(m_pHistory->at(m_iCurHistoryIdx)); - } - selectOneChar(-1); - if(KVI_OPTION_BOOL(KviOption_boolInputHistoryCursorAtEnd))end(); - else home(); - } - } - break; - case Qt::Key_PageUp: - if(m_pKviWindow) - if(m_pKviWindow->view())m_pKviWindow->view()->prevPage(); - break; - case Qt::Key_PageDown: - if(m_pKviWindow) - if(m_pKviWindow->view())m_pKviWindow->view()->nextPage(); - break; - case Qt::Key_Return: - case Qt::Key_Enter: - returnPressed(); - break; - case Qt::Key_Alt: - case Qt::Key_Meta: - m_szAltKeyCode = ""; - break; - default: - if(!e->text().isEmpty() && !m_bReadOnly) - insertText(e->text()); - break; - } -} - -void KviInputEditor::keyReleaseEvent(QKeyEvent *e) -{ - if((e->key() == Qt::Key_Alt) || (e->key() == Qt::Key_Meta)) - { - if(m_szAltKeyCode.hasData()) - { - bool bOk; - unsigned short ch = m_szAltKeyCode.toUShort(&bOk); - if(bOk && ch != 0) - { - //debug("INSERTING CHAR %d",ch); - insertChar(QChar(ch)); - e->accept(); - } - } - m_szAltKeyCode = ""; - } - e->ignore(); -} - -void KviInputEditor::getWordBeforeCursor(QString &buffer,bool * bIsFirstWordInLine) -{ - if(m_szTextBuffer.isEmpty() || m_iCursorPosition <= 0) - { - buffer = ""; - return; - } - - buffer = m_szTextBuffer.left(m_iCursorPosition); - - int idx = buffer.findRev(' '); - int idx2 = buffer.findRev(','); // This is for comma separated lists... - int idx3 = buffer.findRev('('); - int idx4 = buffer.findRev('"'); - if(idx2 > idx)idx = idx2; - if(idx3 > idx)idx = idx3; - if(idx4 > idx)idx = idx4; - *bIsFirstWordInLine = false; - if(idx > -1)buffer.remove(0,idx+1); - else *bIsFirstWordInLine = true; -} - -void KviInputEditor::completion(bool bShift) -{ - // FIXME: Spaces in directory completion can mess everything completely - // On windows the KVI_PATH_SEPARATOR_CHARacters are breaking everything... - // Well.... :D - - QString word; - QString match; - - bool bFirstWordInLine; - getWordBeforeCursor(word,&bFirstWordInLine); - if(word.isEmpty()) - { - if(m_szLastCompletedNick.isEmpty())return; // nothing to complete - else { - // this is standard nick completion continued - standardNickCompletion(bShift,word,bFirstWordInLine); - repaintWithCursorOn(); - return; - } - } - KviPointerList<QString> tmp; - tmp.setAutoDelete(true); - - bool bIsCommand = false; - bool bIsDir = false; - bool bIsNick = false; - - unsigned short uc = word[0].unicode(); - - if(uc == '/') - { - if(bFirstWordInLine) - { - // command completion - word.remove(0,1); - if(word.isEmpty())return; - KviKvsKernel::instance()->completeCommand(word,&tmp); - bIsCommand = true; - } else { - // directory completion attempt - g_pApp->completeDirectory(word,&tmp); - bIsDir = true; - } - } else if(uc == '$') - { - // function/identifer completion - word.remove(0,1); - if(word.isEmpty())return; - KviKvsKernel::instance()->completeFunction(word,&tmp); - } else if(uc == '#' || uc == '&' || uc == '!') - { - if(m_pKviWindow) - { - if( (word.length()==1) && (m_pKviWindow->windowName()[0].unicode()==uc)) - { - match=m_pKviWindow->windowName(); - match.append(" "); - replaceWordBeforeCursor(word,match,false); - repaintWithCursorOn(); - return; - } else { - if(m_pKviWindow->console()) - m_pKviWindow->console()->completeChannel(word,&tmp); - } - } - - //FIXME: Complete also on irc:// starting strings, not only irc.? - } else if(KviQString::equalCIN(word,"irc.",4)) - { - // irc server name - if(m_pKviWindow) - if(m_pKviWindow->console()) - m_pKviWindow->console()->completeServer(word,&tmp); - } else { - // empty word will end up here - if(m_pUserListView) - { - if(KVI_OPTION_BOOL(KviOption_boolBashLikeNickCompletion)) - { - m_pUserListView->completeNickBashLike(word,&tmp,bShift); - bIsNick = true; - } else { - standardNickCompletion(bShift,word,bFirstWordInLine); - repaintWithCursorOn(); - return; - } - } - } - - // Lookup the longest exact match - - if(tmp.count() > 0) - { - if(tmp.count() == 1) - { - match = *(tmp.first()); - if(bIsCommand)match.append(' '); - else if(bIsNick) - { - if(!KVI_OPTION_STRING(KviOption_stringNickCompletionPostfix).isEmpty()) - { - if(bFirstWordInLine || (!KVI_OPTION_BOOL(KviOption_boolUseNickCompletionPostfixForFirstWordOnly))) - match.append(KVI_OPTION_STRING(KviOption_stringNickCompletionPostfix)); - } - } - } else { - QString all; - QString * s = tmp.first(); - match = *s; - int wLen = word.length(); - for(;s;s = tmp.next()) - { - if(s->length() < match.length()) - match.remove(s->length(),match.length() - s->length()); - // All the matches here have length >= word.len()!!! - const QChar * b1 = KviQString::nullTerminatedArray(*s) + wLen; - const QChar * b2 = KviQString::nullTerminatedArray(match) + wLen; - const QChar * c1 = b1; - const QChar * c2 = b2; - if(bIsDir)while(c1->unicode() && (c1->unicode() == c2->unicode()))c1++,c2++; - else while(c1->unicode() && (c1->lower().unicode() == c2->lower().unicode()))c1++,c2++; - int len = wLen + (c1 - b1); - if(len < ((int)(match.length())))match.remove(len,match.length() - len); - if(!all.isEmpty())all.append(", "); - all.append(*s); - } - if(m_pKviWindow) - m_pKviWindow->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("%d matches: %Q"),tmp.count(),&all); - } - } else - if(m_pKviWindow) - m_pKviWindow->outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("No matches")); - - if(!match.isEmpty()) - { - //if(!bIsDir && !bIsNick)match = match.lower(); <-- why? It is nice to have - // $module.someFunctionName instad - // of unreadable $module.somefunctionfame - replaceWordBeforeCursor(word,match,false); - } - - repaintWithCursorOn(); -} - -void KviInputEditor::replaceWordBeforeCursor(const QString &word,const QString &replacement,bool bRepaint) -{ - selectOneChar(-1); - m_iCursorPosition -= word.length(); - m_szTextBuffer.remove(m_iCursorPosition,word.length()); - m_szTextBuffer.insert(m_iCursorPosition,replacement); - m_szTextBuffer.truncate(m_iMaxBufferSize); - moveCursorTo(m_iCursorPosition + replacement.length()); - if(bRepaint)repaintWithCursorOn(); -} - -void KviInputEditor::standardNickCompletion(bool bAddMask,QString &word,bool bFirstWordInLine) -{ - // FIXME: this could be really simplified... - if(!m_pUserListView)return; - selectOneChar(-1); - - QString buffer; - if(m_szLastCompletedNick.isEmpty()) - { - // New completion session: we NEED sth to complete - if(word.isEmpty())return; - if(m_pUserListView->completeNickStandard(word,m_szLastCompletedNick,buffer,bAddMask)) - { - // completed: save the buffer - m_szLastCompletionBuffer = m_szTextBuffer; - m_iLastCompletionCursorPosition = m_iCursorPosition; - m_iLastCompletionCursorXPosition = m_iLastCursorXPosition; - m_iLastCompletionFirstVisibleChar = m_iFirstVisibleChar; - m_szLastCompletedNick = buffer; - if(!KVI_OPTION_STRING(KviOption_stringNickCompletionPostfix).isEmpty()) - { - if(bFirstWordInLine || (!KVI_OPTION_BOOL(KviOption_boolUseNickCompletionPostfixForFirstWordOnly))) - buffer.append(KVI_OPTION_STRING(KviOption_stringNickCompletionPostfix)); - } - replaceWordBeforeCursor(word,buffer,false); - m_bLastCompletionFinished=0; - // REPAINT CALLED FROM OUTSIDE! - } // else no match at all - } else if(!m_bLastCompletionFinished) { - // Old session - // swap the buffers - m_szTextBuffer = m_szLastCompletionBuffer; - m_iCursorPosition = m_iLastCompletionCursorPosition; - m_iLastCursorXPosition = m_iLastCompletionCursorXPosition; - m_iFirstVisibleChar = m_iLastCompletionFirstVisibleChar; - // re-extract - //word = m_szTextBuffer.left(m_iCursorPosition); - - getWordBeforeCursor(word,&bFirstWordInLine); - if(word.isEmpty())return; - if(m_pUserListView->completeNickStandard(word,m_szLastCompletedNick,buffer,bAddMask)) - { - // completed - m_szLastCompletedNick = buffer; - if(!KVI_OPTION_STRING(KviOption_stringNickCompletionPostfix).isEmpty()) - { - if(bFirstWordInLine || (!KVI_OPTION_BOOL(KviOption_boolUseNickCompletionPostfixForFirstWordOnly))) - buffer.append(KVI_OPTION_STRING(KviOption_stringNickCompletionPostfix)); - } - replaceWordBeforeCursor(word,buffer,false); - m_bLastCompletionFinished=0; - // REPAINT CALLED FROM OUTSIDE! - } else { - m_bLastCompletionFinished=1; - m_szLastCompletedNick = ""; - } - } else { - // Old session finished - // re-extract - //word = m_szTextBuffer.left(m_iCursorPosition); - //getWordBeforeCursor(word,&bFirstWordInLine); - if(word.isEmpty())return; - if(m_pUserListView->completeNickStandard(word,"",buffer,bAddMask)) - { - // completed - m_szLastCompletionBuffer = m_szTextBuffer; - m_iLastCompletionCursorPosition = m_iCursorPosition; - m_iLastCompletionCursorXPosition = m_iLastCursorXPosition; - m_iLastCompletionFirstVisibleChar = m_iFirstVisibleChar; - m_szLastCompletedNick = buffer; - if(!KVI_OPTION_STRING(KviOption_stringNickCompletionPostfix).isEmpty()) - { - if(bFirstWordInLine || (!KVI_OPTION_BOOL(KviOption_boolUseNickCompletionPostfixForFirstWordOnly))) - buffer.append(KVI_OPTION_STRING(KviOption_stringNickCompletionPostfix)); - } - replaceWordBeforeCursor(word,buffer,false); - m_bLastCompletionFinished=0; - // REPAINT CALLED FROM OUTSIDE! - } else { - m_bLastCompletionFinished=1; - m_szLastCompletedNick = ""; - } - } -} - - -//Funky helpers - -void KviInputEditor::end() -{ - m_iLastCursorXPosition = frameWidth(); - m_iCursorPosition = 0; - m_iFirstVisibleChar = 0; - while(m_iCursorPosition < ((int)(m_szTextBuffer.length()))) - { - moveRightFirstVisibleCharToShowCursor(); - m_iCursorPosition++; - } - repaintWithCursorOn(); -} - -void KviInputEditor::home() -{ - m_iFirstVisibleChar = 0; - m_iCursorPosition = 0; - repaintWithCursorOn(); -} - -void KviInputEditor::insertChar(QChar c) -{ - if(m_szTextBuffer.length() >= m_iMaxBufferSize)return; - - // Kill the selection - if((m_iSelectionBegin > -1) || (m_iSelectionEnd > -1)) - { - if((m_iCursorPosition >= m_iSelectionBegin) && (m_iCursorPosition <= m_iSelectionEnd)) - { - m_bUpdatesEnabled = false; - removeSelected(); - m_bUpdatesEnabled = true; - } - } - selectOneChar(-1); - m_szTextBuffer.insert(m_iCursorPosition,c); - moveRightFirstVisibleCharToShowCursor(); - m_iCursorPosition++; - repaintWithCursorOn(); -} - -void KviInputEditor::moveRightFirstVisibleCharToShowCursor() -{ - // :) - QFontMetrics fm(KVI_OPTION_FONT(KviOption_fontInput)); - - QChar c = m_szTextBuffer.at(m_iCursorPosition); - -#ifdef COMPILE_USE_QT4 - m_iLastCursorXPosition += c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);; -#else - m_iLastCursorXPosition += (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c); -#endif - while(m_iLastCursorXPosition >= contentsRect().width()-2*KVI_INPUT_MARGIN) - { - c = m_szTextBuffer.at(m_iFirstVisibleChar); -#ifdef COMPILE_USE_QT4 - m_iLastCursorXPosition -= c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);; -#else - m_iLastCursorXPosition -= (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c); -#endif - m_iFirstVisibleChar++; - } -} - -void KviInputEditor::repaintWithCursorOn() -{ - // :) - if(m_bUpdatesEnabled) - { - m_bCursorOn = true; - update(); - } -} - -void KviInputEditor::selectOneChar(int pos) -{ - m_iSelectionBegin = pos; - m_iSelectionEnd = pos; -} - -int KviInputEditor::charIndexFromXPosition(int xPos) -{ - int curXPos = frameWidth()+KVI_INPUT_MARGIN; - int curChar = m_iFirstVisibleChar; - int bufLen = m_szTextBuffer.length(); - - QFontMetrics fm(KVI_OPTION_FONT(KviOption_fontInput)); - while(curChar < bufLen) - { - QChar c = m_szTextBuffer.at(curChar); -#ifdef COMPILE_USE_QT4 - int widthCh = c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);; -#else - int widthCh = (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c); -#endif - if(xPos < (curXPos+(widthCh/2)))return curChar; - else if(xPos < (curXPos+widthCh))return (curChar+1); - { - curXPos+=widthCh; - curChar++; - } - } - return curChar; -} - -int KviInputEditor::xPositionFromCharIndex(QFontMetrics& fm,int chIdx,bool bContentsCoords) -{ - // FIXME: this could use fm.width(m_szTextBuffer,chIdx) - int curXPos = bContentsCoords ? KVI_INPUT_MARGIN : frameWidth()+KVI_INPUT_MARGIN; - int curChar = m_iFirstVisibleChar; - while(curChar < chIdx) - { - QChar c = m_szTextBuffer.at(curChar); -#ifdef COMPILE_USE_QT4 - curXPos += c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);; -#else - curXPos += (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c); -#endif - curChar++; - } - return curXPos; -} - -int KviInputEditor::xPositionFromCharIndex(int chIdx,bool bContentsCoords) -{ - // FIXME: this could use fm.width(m_szTextBuffer,chIdx) - int curXPos = bContentsCoords ? KVI_INPUT_MARGIN : frameWidth()+KVI_INPUT_MARGIN; - int curChar = m_iFirstVisibleChar; - //debug("%i",g_pLastFontMetrics); - if(!g_pLastFontMetrics) g_pLastFontMetrics = new QFontMetrics(KVI_OPTION_FONT(KviOption_fontInput)); - while(curChar < chIdx) - { - QChar c = m_szTextBuffer.at(curChar); -#ifdef COMPILE_USE_QT4 - curXPos += c.unicode() < 32 ? g_pLastFontMetrics->width(getSubstituteChar(c.unicode())) + 3 : g_pLastFontMetrics->width(c); -#else - curXPos += (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : g_pLastFontMetrics->width(c); -#endif - curChar++; - } - return curXPos; -} - -/* - @doc: texticons - @type: - generic - @title: - The KVIrc TextIcons extension - @short: - The KVIrc TextIcons extension - @body: - Starting from version 3.0.0 KVIrc supports the TextIcon extension - to the standard IRC protocol. It is a mean for sending text enriched - of small images without sending the images themselves.[br] - The idea is quite simple: the IRC client (and it's user) associates - some small images to text strings (called icon tokens) and the strings are sent - in place of the images preceeded by a special escape character.[br] - The choosen escape character is 29 (hex 0x1d) which corresponds - to the ASCII group separator.[br] - So for example if a client has the association of the icon token "rose" with a small - icon containing a red rose flower then KVIrc could send the string - "<0x1d>rose" in the message stream to ask the remote parties to - display such an icon. If the remote parties don't have this association - then they will simply strip the control code and display the string "rose", - (eventually showing it in some enchanced way).[br] - The icon tokens can't contain spaces - so the receiving clients stop the extraction of the icon strings - when a space, an icon escape or the message termination is encountered. - [br] - <icon escape> := character 0x1d (ASCII group separator)[br] - <icon token> := any character with the exception of 0x1d, CR,LF and SPACE.[br] - [br] - Please note that this is a KVIrc extension and the remote clients - that don't support this feature will not display the icon (and will - eventually show the 0x1d character in the data stream).[br] - If you like this feature please either convince the remote users - to try KVIrc or tell them to write to their client developers asking - for this simple feature to be implemented.[br] -*/ - - -/* - @doc: commandline - @title: - The Commandline Input Features - @type: - generic - @short: - Commandline input features - @body: - [big]Principles of operation[/big] - [p] - The idea is simple: anything that starts with a slash (/) character - is interpreted as a command. Anything else is plain text that is - sent to the target of the window (channel, query, dcc chat etc..). - [/p] - [big]The two operating modes[/big] - [p] - The commandline input has two operating modes: the "user friendly mode" and - the "kvs mode". In the user friendly mode all the parameters of the commands - are interpreted exactly like you type them. There is no special interpretation - of $,%,-,( and ; characters. This allows you to type "/me is happy ;)", for example. - In the kvs mode the full parameter interpretation is enabled and the commands - work just like in any other script editor. This means that anything that - starts with a $ is a function call, anything that starts with a % is a variable, - the dash characters after command names are interpreted as switches and ; is the - command separator. This in turn does NOT allow you to type "/me is happy ;)" - because ; is the command separator and ) will be interpreted as the beginning - of the next command. In KVS mode you obviously have to escape the ; character - by typing "/me is happy \;)". The user friendly mode is good for everyday chatting - and for novice users while the KVS mode is for experts that know that minimum about - scripting languages. Please note that in the user-friendly mode you're not allowed - to type multiple commands at once :). - [/p] - [big]Default Key Bindings:[/big][br] - Ctrl+B: Inserts the 'bold' mIRC text control character<br> - Ctrl+K: Inserts the 'color' mIRC text control character<br> - Ctrl+R: Inserts the 'reverse' mIRC text control character<br> - Ctrl+U: Inserts the 'underline' mIRC text control character<br> - Ctrl+O: Inserts the 'reset' mIRC text control character<br> - Ctrl+P: Inserts the 'non-crypt' (plain text) KVIrc control character used to disable encryption of the current text line<br> - Ctrl+C: Copies the selected text to clipboard<br> - Ctrl+X: Cuts the selected text<br> - Ctrl+V: Pastes the clipboard contents (same as middle mouse click)<br> - Ctrl+I: Inserts the 'icon' control code and pops up the icon list box<br> - Ctrl+A: Select all<br> - CursorUp: Moves backward in the command history<br> - CursorDown: Moves forward in the command history<br> - CursorRight: Moves the cursor to the right<br> - CursorLeft: Moves the cursor to the left :)<br> - Shift+CursorLeft: Moves the selection to the left<br> - Shift+RightCursor: Moves the selection to the right<br> - Ctrl+CursorLeft: Moves the cursor one word left<br> - Ctrl+CursorRight: Moves the cursor one word right<br> - Ctrl+Shift+CursorLeft: Moves the selection one word left<br> - Ctrl+Shift+CursorRight: Moves the selection one word right<br> - Tab: Nickname, function/command, or filename completion (see below)<br> - Shift+Tab: Hostmask or function/command completion (see below)<br> - Alt+<numeric_sequence>: Inserts the character by ASCII/Unicode code<br> - <example> - Alt+32: Inserts ASCII/Unicode character 32: ' ' (a space) - Alt+00032: Same as above :) - Alt+13: Inserts the Carriage Return (CR) control character - Alt+77: Inserts ASCII/Unicode character 77: 'M' - Alt+23566: Inserts Unicode character 23566 (an ideogram) - </example> - Also look at the <a href="shortcuts.kvihelp">global shortcuts</a> reference.<br> - If you drop a file on this widget, a <a href="parse.kvihelp">/PARSE <filename></a> will be executed.<br> - You can enable word substitution in the preferences dialog.<br> - For example, if you choose to substitute "afaik" with "As far as I know",<br> - when you will type "afaik" somewhere in the command line, and then - press Space or Return, that word will be replaced with "As far as I know".<br> - Experiment with it :)<br> - The Tab key activates the completion of the current word.<br> - If a word is prefixed with a '/', it is treated as a command to be completed, - if it begins with '$', it is treated as a function or identifier to be completed, - otherwise it is treated as a nickname or filename to be completed.<br> - <example> - /ec<Tab> will produce /echo<space> - /echo $loca<Tab> will produce /echo $localhost - </example> - Multiple matches are listed in the view window and the word is completed - to the common part of all the matches.<br> - <example> - $sel<Tab;> will find multiple matches and produce $selected - </example> - Experiment with that too :) -*/ - - - -KviInput::KviInput(KviWindow *par,KviUserListView * view) -: QWidget(par,"input") -{ - QBoxLayout* pLayout=new QHBoxLayout(this); - pLayout->setAutoAdd(true); - pLayout->setDirection(QBoxLayout::RightToLeft); - - pLayout->setMargin(0); - pLayout->setSpacing(0); - - m_pWindow = par; - m_pMultiLineEditor = 0; - - m_pHideToolsButton = new KviStyledToolButton(this,"hide_container_button"); - - m_pHideToolsButton->setUsesBigPixmap(false); - m_pHideToolsButton->setFixedWidth(10); - - if(g_pIconManager->getBigIcon("kvi_horizontal_left.png")) - m_pHideToolsButton->setPixmap(*(g_pIconManager->getBigIcon("kvi_horizontal_left.png"))); - - connect(m_pHideToolsButton,SIGNAL(clicked()),this,SLOT(toggleToolButtons())); - - m_pButtonContainer=new KviTalHBox(this); - m_pButtonContainer->setSpacing(0); - -#ifdef COMPILE_USE_QT4 - m_pButtonContainer->setSizePolicy(QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Preferred)); -// if(m_pButtonContainer->layout()) -// m_pButtonContainer->layout()->setSizeConstraint(QLayout::SetMinimumSize); -#endif - - m_pHistoryButton = new KviStyledToolButton(m_pButtonContainer,"historybutton"); - m_pHistoryButton->setUsesBigPixmap(false); - //m_pHistoryButton->setUpdatesEnabled(TRUE); ??? - QIconSet is1; - if(!KVI_OPTION_BOOL(KviOption_boolDisableInputHistory))//G&N mar 2005 - { - is1.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TIME)),QIconSet::Small); - m_pHistoryButton->setIconSet(is1); - KviTalToolTip::add(m_pHistoryButton,__tr2qs("Show History<br><Ctrl+PageUp>")); - connect(m_pHistoryButton,SIGNAL(clicked()),this,SLOT(historyButtonClicked())); - } - else - { - is1.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_QUITSPLIT)),QIconSet::Small); - m_pHistoryButton->setIconSet(is1); - KviTalToolTip::add(m_pHistoryButton,__tr2qs("Input History Disabled")); - } - - m_pIconButton = new KviStyledToolButton(m_pButtonContainer,"iconbutton"); - m_pIconButton->setUsesBigPixmap(false); - QIconSet is3; - is3.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_BIGGRIN)),QIconSet::Small); - m_pIconButton->setIconSet(is3); - KviTalToolTip::add(m_pIconButton,__tr2qs("Show Icons Popup<br><Ctrl+I><br>See also /help texticons")); - - connect(m_pIconButton,SIGNAL(clicked()),this,SLOT(iconButtonClicked())); - - - m_pCommandlineModeButton = new KviStyledToolButton(m_pButtonContainer,"commandlinemodebutton"); - m_pCommandlineModeButton->setUsesBigPixmap(false); - m_pCommandlineModeButton->setToggleButton(true); - QIconSet is0; - is0.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SAYSMILE)),QIconSet::Small,QIconSet::Normal,QIconSet::On); - is0.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SAYKVS)),QIconSet::Small,QIconSet::Normal,QIconSet::Off); - m_pCommandlineModeButton->setIconSet(is0); - KviTalToolTip::add(m_pCommandlineModeButton,__tr2qs("User friendly commandline mode<br>See also /help commandline")); - if(KVI_OPTION_BOOL(KviOption_boolCommandlineInUserFriendlyModeByDefault)) - m_pCommandlineModeButton->setOn(true); - - - m_pMultiEditorButton = new KviStyledToolButton(m_pButtonContainer,"multieditorbutton"); - m_pMultiEditorButton->setToggleButton(true); - m_pMultiEditorButton->setUsesBigPixmap(false); - QIconSet is2; - is2.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TERMINAL)),QIconSet::Small,QIconSet::Normal,QIconSet::On); - is2.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TERMINAL)),QIconSet::Small,QIconSet::Normal,QIconSet::Off); - m_pMultiEditorButton->setIconSet(is2); - QString szTip = __tr2qs("Multi-line Editor<br><Alt+Backspace>"); - szTip += " - <Ctrl+Backspace>"; - KviTalToolTip::add(m_pMultiEditorButton,szTip); - - connect(m_pMultiEditorButton,SIGNAL(toggled(bool)),this,SLOT(multilineEditorButtonToggled(bool))); - - m_pInputEditor = new KviInputEditor(this,par,view); - connect(m_pInputEditor,SIGNAL(enterPressed()),this,SLOT(inputEditorEnterPressed())); -#ifdef COMPILE_USE_QT4 - m_pInputEditor->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Ignored)); -#else - m_pInputEditor->setSizePolicy(QSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored)); -#endif - - -#ifdef COMPILE_USE_QT4 - m_pMultiEditorButton->setAutoRaise(true); - m_pCommandlineModeButton->setAutoRaise(true); - m_pIconButton->setAutoRaise(true); - m_pHistoryButton->setAutoRaise(true); - m_pHideToolsButton->setAutoRaise(true); -#endif - - pLayout->setStretchFactor(m_pInputEditor,100000); - pLayout->setStretchFactor(m_pButtonContainer,0); - pLayout->setStretchFactor(m_pHideToolsButton,0); -} - -KviInput::~KviInput() -{ - if(m_pMultiLineEditor)KviScriptEditor::destroyInstance(m_pMultiLineEditor); -} - -bool KviInput::isButtonsHidden() -{ - return m_pButtonContainer->isHidden(); -} - -void KviInput::setButtonsHidden(bool bHidden) -{ - if(!m_pHideToolsButton || !m_pButtonContainer) return; - if(bHidden==m_pButtonContainer->isHidden()) return; - m_pButtonContainer->setHidden(bHidden); - QPixmap* pix= bHidden ? - g_pIconManager->getBigIcon("kvi_horizontal_right.png") : - g_pIconManager->getBigIcon("kvi_horizontal_left.png"); - if(pix) - m_pHideToolsButton->setPixmap(*pix); -} - -void KviInput::toggleToolButtons() -{ - setButtonsHidden(!isButtonsHidden()); -} - -void KviInput::inputEditorEnterPressed() -{ - QString szText = m_pInputEditor->text(); - KviUserInput::parse(szText,m_pWindow,QString::null,m_pCommandlineModeButton->isOn()); - m_pInputEditor->setText(""); -} - -void KviInput::keyPressEvent(QKeyEvent *e) -{ - //debug("KviInput::keyPressEvent(key:%d,state:%d,text:%s)",e->key(),e->state(),e->text().isEmpty() ? "empty" : e->text().utf8().data()); - - if((e->state() & Qt::ControlButton) || (e->state() & Qt::AltButton) || (e->state() & Qt::MetaButton)) - { - switch(e->key()) - { - case Qt::Key_Backspace: - //if(m_pMultiLineEditor) - multilineEditorButtonToggled(!m_pMultiLineEditor); - break; - } - } - - if(e->state() & Qt::ControlButton) - { - switch(e->key()) - { - case Qt::Key_Enter: - case Qt::Key_Return: - { - if(m_pMultiLineEditor) - { - QString szText; - m_pMultiLineEditor->getText(szText); - if(szText.isEmpty())return; - if(KVI_OPTION_BOOL(KviOption_boolWarnAboutPastingMultipleLines)) - { - if(szText.length() > 256) - { - if(szText[0] != '/') - { -#ifdef COMPILE_USE_QT4 - int nLines = szText.count('\n') + 1; -#else - int nLines = szText.contains('\n') + 1; -#endif - if(nLines > 15) - { - int nRet = QMessageBox::question( - this, - __tr2qs("Confirm Multiline Message"), - __tr2qs("You're about to send a message with %1 lines of text.<br><br>" \ - "There is nothing wrong with it, this warning is<br>" \ - "here to prevent you from accidentally sending<br>" \ - "a really large message just because you didn't edit it<br>" \ - "properly after pasting text from the clipboard.<br><br>" \ - "Do you want the message to be sent?").arg(nLines), - __tr2qs("Yes, always"), - __tr2qs("Yes"), - __tr2qs("No"), - 1,2); - switch(nRet) - { - case 0: - KVI_OPTION_BOOL(KviOption_boolWarnAboutPastingMultipleLines) = false; - break; - case 2: - return; - break; - default: // also case 1 - break; - } - } - } - } - } - KviUserInput::parse(szText,m_pWindow,QString::null,m_pCommandlineModeButton->isOn()); - m_pMultiLineEditor->setText(""); - } - } - break; - case Qt::Key_PageUp: - historyButtonClicked(); - break; - } - } -} - -void KviInput::multiLinePaste(const QString &text) -{ - if(!m_pMultiLineEditor)multilineEditorButtonToggled(true); - m_pMultiLineEditor->setText(text); -} - -void KviInput::multilineEditorButtonToggled(bool bOn) -{ - if(m_pMultiLineEditor) - { - if(bOn)return; - KviScriptEditor::destroyInstance(m_pMultiLineEditor); - m_pMultiLineEditor = 0; - m_pInputEditor->show(); - m_pWindow->childrenTreeChanged(0); - m_pInputEditor->setFocus(); - m_pMultiEditorButton->setOn(false); - } else { - if(!bOn)return; - m_pMultiLineEditor = KviScriptEditor::createInstance(this); - QString szText = __tr2qs("<Ctrl+Return>; submits, <Alt+Backspace>; hides this editor"); - // compatibility entry to avoid breaking translation just before a release... :) - szText.replace("Alt+Backspace","Ctrl+Backspace"); - m_pMultiLineEditor->setFindText(szText); - m_pMultiLineEditor->setFindLineeditReadOnly(true); - m_pInputEditor->hide(); - m_pMultiLineEditor->show(); - m_pWindow->childrenTreeChanged(m_pMultiLineEditor); - m_pMultiLineEditor->setFocus(); - m_pMultiEditorButton->setOn(true); - } -} - -void KviInput::iconButtonClicked() -{ - if(!g_pTextIconWindow)g_pTextIconWindow = new KviTextIconWindow(); - QPoint pnt = m_pIconButton->mapToGlobal(QPoint(m_pIconButton->width(),0)); - g_pTextIconWindow->move(pnt.x()-g_pTextIconWindow->width(),pnt.y() - g_pTextIconWindow->height()); - g_pTextIconWindow->popup(this,true); -} - -void KviInput::historyButtonClicked() -{ - if(!g_pHistoryWindow)g_pHistoryWindow = new KviHistoryWindow(); - - QPoint pnt = mapToGlobal(QPoint(0,0)); - - g_pHistoryWindow->setGeometry(pnt.x(),pnt.y() - KVI_HISTORY_WIN_HEIGHT,width(),KVI_HISTORY_WIN_HEIGHT); - g_pHistoryWindow->popup(this); -} - -#define BUTTON_WIDTH 20 - -/*void KviInput::resizeEvent(QResizeEvent *e) -{ - //m_pButtonContainer - m_pInputEditor->setGeometry(0,0,m_pButtonContainer->isVisible() ? width() - (BUTTON_WIDTH * 4)-10 : width() - 10,height()); - if(m_pMultiLineEditor)m_pMultiLineEditor->setGeometry(0,0,m_pButtonContainer->isVisible() ? width() - (BUTTON_WIDTH * 4)-10 : width() - 10,height()); - if(m_pButtonContainer->isVisible()) m_pButtonContainer->setGeometry(width() - (BUTTON_WIDTH * 4)-10,0,BUTTON_WIDTH*4,height()); - - m_pHideToolsButton->setGeometry(width() - 10,0,10,height()); - - QWidget::resizeEvent(e); -}*/ - -void KviInput::setFocus() -{ - // redirect setFocus() to the right children - if(m_pMultiLineEditor)m_pMultiLineEditor->setFocus(); - else m_pInputEditor->setFocus(); -} - -void KviInput::focusInEvent(QFocusEvent * e) -{ - // if we get a focus in event , redirect the focus to the children - if(m_pMultiLineEditor)m_pMultiLineEditor->setFocus(); - else m_pInputEditor->setFocus(); -} - - -int KviInput::heightHint() const -{ - return m_pMultiLineEditor ? 120 : m_pInputEditor->heightHint(); -} - -void KviInput::setText(const QString &text) -{ - // FIXME: Latin1 -> QString ? - if(m_pMultiLineEditor)m_pMultiLineEditor->setText(text); - else m_pInputEditor->setText(text); -} - -void KviInput::insertChar(char c) -{ - m_pInputEditor->insertChar(c); -} - -void KviInput::insertText(const QString& text) -{ - m_pInputEditor->insertText(text); -} - -void KviInput::applyOptions() -{ - if(g_pLastFontMetrics) delete g_pLastFontMetrics; - g_pLastFontMetrics = 0; - - if(KVI_OPTION_BOOL(KviOption_boolDisableInputHistory))//G&N mar 2005 - { - QIconSet is1; - is1.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_QUITSPLIT)),QIconSet::Small); - m_pHistoryButton->setIconSet(is1); - KviTalToolTip::add(m_pHistoryButton,__tr2qs("Input History Disabled")); - m_pHistoryButton->disconnect(SIGNAL(clicked())); - } - - if(!KVI_OPTION_BOOL(KviOption_boolDisableInputHistory)) - { - QIconSet is1; - is1.setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TIME)),QIconSet::Small); - m_pHistoryButton->setIconSet(is1); - KviTalToolTip::add(m_pHistoryButton,__tr2qs("Show History<br><Ctrl+PageUp>")); - connect(m_pHistoryButton,SIGNAL(clicked()),this,SLOT(historyButtonClicked())); - } - - m_pInputEditor->applyOptions(); -} - -void KviInput::setFocusProxy(QWidget *) -{ - /* do nothing */ -} - -//const QString & KviInput::text() -QString KviInput::text() -{ - QString szText; - if(m_pMultiLineEditor) - m_pMultiLineEditor->getText(szText); - else - szText=m_pInputEditor->text(); - return szText; -} - -#include "kvi_input.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_input.h b/3.4.0/src/kvirc/ui/kvi_input.h deleted file mode 100644 index 0fd4031be3..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_input.h +++ /dev/null @@ -1,262 +0,0 @@ -#ifndef _KVI_INPUT_H_ -#define _KVI_INPUT_H_ - -//============================================================================= -// -// File : kvi_input.h -// Creation date : Sun Jan 3 1999 23:04:10 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - - -#include <qwidget.h> -#include "kvi_tal_hbox.h" -#include <qpixmap.h> -#include "kvi_pointerlist.h" - -#include "kvi_string.h" - -//#include <qdialog.h> -#include <qtoolbutton.h> - -class KviUserListView; -class KviWindow; -class KviInput; -class KviTalHBox; -class QFontMetrics; - -// Default maximum buffer size. -#define KVI_INPUT_MAX_BUFFER_SIZE 400 -// Border , better do not touch this -#define KVI_INPUT_BORDER 1 -#define KVI_INPUT_MARGIN 2 -// Cursor blink time...just don't set it to a value less than 100 if -// you don't want to be lagged by your cursors :) -#define KVI_INPUT_BLINK_TIME 800 -// Drag scroll speed...(smaller values = faster) -#define KVI_INPUT_DRAG_TIMEOUT 80 -// Maximum entries in the history buffer -#define KVI_INPUT_MAX_HISTORY_ENTRIES 100 - -class KVIRC_API KviInputHistory -{ -public: - KviInputHistory(); - ~KviInputHistory(); -protected: - KviPointerList<QString> * m_pStringList; -public: - void add(QString * s); - KviPointerList<QString> * list(){ return m_pStringList; }; - void save(const char * filename); - void load(const char * filename); -}; - -#ifdef COMPILE_USE_QT4 - #define QIMEvent QInputMethodEvent -#endif - -class KVIRC_API KviInputEditor : public QFrame -{ - // friend class KviUserParser; - //Q_PROPERTY( int KviProperty_FocusOwner READ heightHint ) - Q_PROPERTY( int TransparencyCapable READ heightHint ) - - Q_OBJECT -public: - KviInputEditor(QWidget * par,KviWindow *wnd,KviUserListView * view = 0); - ~KviInputEditor(); -protected: - - QString m_szTextBuffer; - int m_iCursorPosition; - int m_iFirstVisibleChar; - int m_iSelectionBegin; - int m_iSelectionEnd; - int m_iMaxBufferSize; - bool m_bSpSlowFlag; // <-- what is this ? - - // members for supporting input methods - QString m_szIMText; - int m_iIMStart; - int m_iIMLength; - int m_iIMSelectionBegin; - int m_iIMSelectionLength; - bool m_bIMComposing; - - unsigned char m_iCurFore; - unsigned char m_iCurBack; - bool m_bCurBold; - bool m_bCurUnderline; - - int m_iBlockLen; - int m_iBlockWidth; - bool m_bControlBlock; - - bool m_bCursorOn; - - int m_iCursorTimer; - int m_iDragTimer; - - int m_iLastCursorXPosition; - int m_iSelectionAnchorChar; - - // History stuff - KviPointerList<QString> * m_pHistory; - int m_iCurHistoryIdx; - - KviStr m_szSaveTextBuffer; - - // Nick completion - KviUserListView * m_pUserListView; - QString m_szLastCompletedNick; - QString m_szLastCompletionBuffer; - int m_iLastCompletionCursorPosition; - int m_iLastCompletionCursorXPosition; - int m_iLastCompletionFirstVisibleChar; - bool m_bLastCompletionFinished; - - bool m_bUpdatesEnabled; - KviStr m_szAltKeyCode; - KviWindow * m_pKviWindow; - QWidget * m_pInputParent; - KviTalPopupMenu * m_pIconMenu; - bool m_bReadOnly; -public: - int heightHint() const; - virtual QSize sizeHint() const; - void setText(const QString text); - QString text() { return m_szTextBuffer; }; - void insertChar(QChar c); - void insertText(const QString &text); - void applyOptions(); - void setMaxBufferSize(int size) { m_iMaxBufferSize = size; }; - void setReadOnly(bool bReadOnly) {m_bReadOnly=bReadOnly; }; - bool readOnly() {return m_bReadOnly; }; -private: - void replaceWordBeforeCursor(const QString &word,const QString &replacement,bool bRepaint = true); - int replaceSegment(int start, int length, const QString &string); - void getWordBeforeCursor(QString &buffer,bool * bIsFirstWordInLine); - void runUpToTheFirstVisibleChar(); - void extractNextBlock(int idx,QFontMetrics & fm,int curXPos,int maxXPos); - void drawTextBlock(QPainter *pa,QFontMetrics & fm,int curXPos,int textBaseline,int idx,int len,bool bSelected=FALSE); - QChar getSubstituteChar(unsigned short control_code); - void moveRightFirstVisibleCharToShowCursor(); - void repaintWithCursorOn(); - void selectOneChar(int pos); - int charIndexFromXPosition(int xPos); - int xPositionFromCharIndex(QFontMetrics& fm,int chIdx,bool bContentsCoords=FALSE); - int xPositionFromCharIndex(int chIdx,bool bContentsCoords=FALSE); - void killDragTimer(); - void handleDragSelection(); - void end(); - void home(); - bool hasSelection(); - void moveCursorTo(int idx,bool bRepaint = true); - void returnPressed(bool bRepaint = true); - void completion(bool bShift); - void standardNickCompletion(bool bAddMask,QString &word,bool bFirstWordInLine); - void recalcFontMetrics(QFontMetrics * pFm); - void internalCursorRight(bool bShift); - void internalCursorLeft(bool bShift); -public slots: - void iconPopupActivated(int id); - void copyToSelection(bool bDonNotCopyToClipboard=true); - void copyToClipboard(); - void removeSelected(); - void cut(); - void pasteClipboardWithConfirmation(); - void pasteSelectionWithConfirmation(); - void pasteSlow(); - void stopPasteSlow(); - void pasteFile(); - void selectAll(); - void clear(); -signals: - void escapePressed(); - void enterPressed(); -protected: - virtual void drawContents(QPainter *); - //virtual void resizeEvent(QResizeEvent *); - virtual void timerEvent(QTimerEvent *e); - virtual void focusInEvent(QFocusEvent *); - virtual void focusOutEvent(QFocusEvent *); - virtual void keyPressEvent(QKeyEvent *e); - virtual void keyReleaseEvent(QKeyEvent *e); - virtual void mousePressEvent(QMouseEvent *e); - virtual void mouseReleaseEvent(QMouseEvent *); - virtual void dragEnterEvent(QDragEnterEvent *e); - virtual void dropEvent(QDropEvent *e); - virtual void imStartEvent(QIMEvent *e); - virtual void imComposeEvent(QIMEvent *e); - virtual void imEndEvent(QIMEvent *e); -#ifdef COMPILE_USE_QT4 - virtual void paintEvent(QPaintEvent *e); -#endif -}; - -class KviScriptEditor; - -class KVIRC_API KviInput : public QWidget -{ - Q_OBJECT -public: - KviInput(KviWindow *par,KviUserListView * view = 0); - ~KviInput(); -public: - KviWindow * m_pWindow; - KviInputEditor * m_pInputEditor; - KviScriptEditor * m_pMultiLineEditor; - KviTalHBox * m_pButtonContainer; - QToolButton * m_pMultiEditorButton; - QToolButton * m_pHistoryButton; - QToolButton * m_pIconButton; - QToolButton * m_pCommandlineModeButton; - QToolButton * m_pHideToolsButton; -protected: -// virtual void resizeEvent(QResizeEvent * e); - virtual void focusInEvent(QFocusEvent * e); - virtual void setFocusProxy(QWidget * w); - virtual void keyPressEvent(QKeyEvent * e); -public slots: - void multilineEditorButtonToggled(bool bOn); - void historyButtonClicked(); - void iconButtonClicked(); - void inputEditorEnterPressed(); - void toggleToolButtons(); -public: - virtual void setFocus(); - void multiLinePaste(const QString &text); - bool isUserFriendly() { return m_pCommandlineModeButton->isOn(); }; - void setUserFriendly(bool bSet) { m_pCommandlineModeButton->setOn(bSet); }; - int heightHint() const; - void setText(const QString &text); - void insertChar(char c); - void insertText(const QString & text); - void applyOptions(); - bool isButtonsHidden(); - void setButtonsHidden(bool bHidden); - //const QString & text(); - QString text(); -}; - -#endif //_KVI_INPUT_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_ipeditor.cpp b/3.4.0/src/kvirc/ui/kvi_ipeditor.cpp deleted file mode 100644 index 951b0a3af8..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_ipeditor.cpp +++ /dev/null @@ -1,453 +0,0 @@ -// -// File : kvi_ipeditor.cpp -// Creation date : Wed Jun 12 2000 14:16:49 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_ipeditor.h" -#include "kvi_qcstring.h" - -#include <qapplication.h> -#include <qlineedit.h> -#include <qlabel.h> -#include <qframe.h> -#include <ctype.h> -#include <qevent.h> - - -// FIXME: #warning "THIS COULD GO INTO libkvioptions ?" - -KviIpEditor::KviIpEditor(QWidget * parent,AddressType addrType,const QString &ipAddr,const char *name) -:QFrame(parent,name) -{ - - for(int i=0;i<7;i++) - { - m_pEdit[i] = 0; - m_pLabel[i] = 0; - } - m_pEdit[7] = 0; - setFrameStyle(QFrame::Sunken|QFrame::StyledPanel); - -#ifdef COMPILE_USE_QT4 - setBackgroundRole(QPalette::Base); -#else - setBackgroundMode(QWidget::PaletteBase); -#endif - - setAddressType(addrType); - - setAddress(ipAddr); -} - -KviIpEditor::~KviIpEditor() -{ - -} - -void KviIpEditor::setEnabled(bool bEnabled) -{ - QFrame::setEnabled(bEnabled); - for(int i=0;i<8;i++) - { - if(m_pEdit[i])m_pEdit[i]->setEnabled(bEnabled); - if(i<7)if(m_pLabel[i]) - { - // Is this the right way ? -#ifdef COMPILE_USE_QT4 - m_pLabel[i]->setBackgroundRole(isEnabled() ? QPalette::Base : QPalette::Background); -#else - m_pLabel[i]->setBackgroundMode(isEnabled() ? QWidget::PaletteBase : QWidget::PaletteBackground); -#endif - m_pLabel[i]->setEnabled(bEnabled); - } - } -#ifdef COMPILE_USE_QT4 - setBackgroundRole(isEnabled() ? QPalette::Base : QPalette::Background); -#else - setBackgroundMode(isEnabled() ? QWidget::PaletteBase : QWidget::PaletteBackground); -#endif -} - -void KviIpEditor::setAddressType(AddressType addrType) -{ - if((addrType != IpV4) && (addrType != IpV6))m_addrType = IpV4; - else m_addrType = addrType; - recreateChildren(); -} - -KviIpEditor::AddressType KviIpEditor::addressType() const -{ - return m_addrType; -} - -bool KviIpEditor::hasEmptyFields() const -{ - bool bHasEF = false; - for(int i=0;i<8;i++) - { - if(m_pEdit[i]) - { - if(m_pEdit[i]->text().isEmpty())bHasEF = true; - } - } - return bHasEF; -} - -void KviIpEditor::clear() -{ - if(!m_pEdit[0])return; - int maxW = (m_addrType == IpV4) ? 4 : 8; - for(int i=0;i< maxW ;i++) - { - m_pEdit[i]->setText(""); - } -} - -bool KviIpEditor::setAddress(const QString &ipAddr) -{ - // FIXME We could check if the addres - // is valid before effectively setting the fields - clear(); - - KviQCString ip = ipAddr.ascii(); // ip addresses are digits & latin letters abcdef (IpV6) - - ip = ip.stripWhiteSpace(); - const char * c = ip.data(); - - if(!c)return false; // huh ?....(should never happen at this point) - - if(m_addrType == IpV4) - { - for(int i=0;i<4;i++) - { - const char *anchor = c; - while(isdigit(*c))c++; - if(c == anchor)return false; // Invalid empty field - KviQCString str(anchor,(c - anchor) + 1); - bool bOk; - int num = str.toInt(&bOk); - if(!bOk)return false; // should never happen , but just to be sure - if((num < 0) || (num > 255))return false; // Invalid field - m_pEdit[i]->setText(str.data()); - if(i < 3){ - if(*c == '.')c++; - else return false; // missing separator - } - } - } else { - for(int i=0;i<8;i++) - { - const char *anchor = c; - while(isdigit(*c) || ((tolower(*c) >= 'a') && (tolower(*c) <= 'f')) || ((tolower(*c) >= 'A') && (tolower(*c) <= 'F')))c++; - KviQCString str(anchor,(c - anchor) + 1); - if(str.length() > 4)return false; // Too long - m_pEdit[i]->setText(str.data()); - if(i < 7){ - if(*c == ':')c++; - else return false; // missing separator - } - } - } - if(*c)return false; // trailing garbage (we could avoid this) - return true; -} - -QString KviIpEditor::address() const -{ - QString ret; - - if(m_addrType == IpV6) - { - for(int i=0;i<8;i++) - { - ret.append(m_pEdit[i]->text()); - if(i < 7)ret.append(":"); - } - } else { - for(int i=0;i<4;i++) - { - QString tmp = m_pEdit[i]->text(); - bool bOk; - int num = tmp.toInt(&bOk); - if(!bOk)num = 0; - tmp.setNum(num); - ret.append(tmp); - if(i < 3)ret.append("."); - } - } - return ret; -} - -void KviIpEditor::recreateChildren() -{ - // A bit slow , but compact - bool bIpV4 = (m_addrType == IpV4); - int max = bIpV4 ? 4 : 8; - QFontMetrics fm(font()); - //int minWidth = fm.width(bIpV4 ? "000" : "AAAA") + 4; - for(int i=0;i<max;i++) - { - if(!m_pEdit[i]){ - m_pEdit[i] = new QLineEdit(this); - m_pEdit[i]->installEventFilter(this); - m_pEdit[i]->setFrame(false); - m_pEdit[i]->setAlignment(Qt::AlignCenter); - } - //m_pEdit[i]->setMinimumWidth(minWidth); - m_pEdit[i]->setMaxLength(bIpV4 ? 3 : 4); - m_pEdit[i]->show(); - if(i < (max - 1)) - { - if(!m_pLabel[i])m_pLabel[i] = new QLabel(this); - m_pLabel[i]->setText(bIpV4 ? "." : ":"); - m_pLabel[i]->show(); - // Is this the right way ? setBackgroundMode seems to not work well -#ifdef COMPILE_USE_QT4 - m_pLabel[i]->setBackgroundRole(isEnabled() ? QPalette::Base : QPalette::Background); -#else - m_pLabel[i]->setBackgroundMode(isEnabled() ? QWidget::PaletteBase : QWidget::PaletteBackground); -#endif - } - } - // Kill the unused widgets , if any - if(bIpV4) - { - for(int i=4;i<8;i++) - { - if(m_pEdit[i]) - { - delete m_pEdit[i]; - m_pEdit[i] = 0; - } - if(m_pLabel[i - 1]) - { - delete m_pLabel[i - 1]; - m_pLabel[i - 1] = 0; - } - } - } - //setMinimumWidth(4 + (max * minWidth) + ((max - 1) * m_pLabel[0]->sizeHint().width())); - setMinimumHeight(m_pLabel[0]->sizeHint().height() + 4); - resizeEvent(0); -} - -bool KviIpEditor::eventFilter(QObject * o,QEvent *e) -{ - if(o->inherits("QLineEdit")) - { - if(e->type() == QEvent::KeyPress) - { - QString s; - // find the editor - int edIdx = -1; - for(int i=0;i<8;i++) - { - if(m_pEdit[i] == o) - { - edIdx = i; - break; - } - } - if(edIdx == -1)return QFrame::eventFilter(o,e); // user added QLineEdit child ? - int edMax = (m_addrType == IpV4) ? 3 : 7; - int cursorPos = ((QLineEdit *)o)->cursorPosition(); - switch(((QKeyEvent *)e)->key()) - { - case Qt::Key_Right: - s = ((QLineEdit *)o)->text(); - if(((unsigned int)cursorPos) == s.length()) - { - if(edIdx < edMax) - { - m_pEdit[++edIdx]->setCursorPosition(0); - m_pEdit[edIdx]->setFocus(); - return true; - } - } - break; - case Qt::Key_Left: - case Qt::Key_Backspace: - if(cursorPos == 0) - { - if(edIdx > 0) - { - s = m_pEdit[--edIdx]->text(); - m_pEdit[edIdx]->setCursorPosition(s.length()); - m_pEdit[edIdx]->setFocus(); - return true; - } - } - return QFrame::eventFilter(o,e); - break; - case Qt::Key_End: - case Qt::Key_Home: - case Qt::Key_Delete: - case Qt::Key_Tab: - return QFrame::eventFilter(o,e); - break; - default: - // a normal key (this part substitutes a QValidator) - const char c = tolower(((QKeyEvent *)e)->ascii()); - if(m_addrType == IpV4) - { - if((c >= '0') && (c <= '9')) - { -#if QT_VERSION >= 300 - if(m_pEdit[edIdx]->hasSelectedText())m_pEdit[edIdx]->cut(); -#else - if(m_pEdit[edIdx]->hasMarkedText())m_pEdit[edIdx]->cut(); -#endif - cursorPos = m_pEdit[edIdx]->cursorPosition(); - s = m_pEdit[edIdx]->text(); - s.insert(cursorPos,c); - bool bOk = false; - int num = s.toInt(&bOk); - if(!bOk)return true; //should never happen , but just to be sure - if((num < 0) || (num > 255))return true; //invalid field - m_pEdit[edIdx]->setText(s); - if(num > 25) - { - // The focus goes to the next editor - if(edIdx < edMax) - { - m_pEdit[++edIdx]->setFocus(); - m_pEdit[edIdx]->selectAll(); - //m_pEdit[edIdx]->setCursorPosition(0); - return true; - } - } -#if QT_VERSION >= 300 - m_pEdit[edIdx]->cursorForward(false); -#else - m_pEdit[edIdx]->cursorRight(false); -#endif - } else { - if((c == '.') && (edIdx < edMax)) - { -#if QT_VERSION >= 300 - if(!m_pEdit[edIdx]->hasSelectedText()) -#else - if(!m_pEdit[edIdx]->hasMarkedText()) -#endif - { - m_pEdit[++edIdx]->setFocus(); - m_pEdit[edIdx]->selectAll(); - } - } - } - } else { - if( ((c >= '0') && (c <= '9')) || ((c >= 'a') && (c <= 'f')) ) - { -#if QT_VERSION >= 300 - if(m_pEdit[edIdx]->hasSelectedText())m_pEdit[edIdx]->cut(); -#else - if(m_pEdit[edIdx]->hasMarkedText())m_pEdit[edIdx]->cut(); -#endif - cursorPos = m_pEdit[edIdx]->cursorPosition(); - s = m_pEdit[edIdx]->text(); - - if(s.length() == 4) - { - if((cursorPos == 4) && (edIdx < edMax)) - { - // the char goes in the next editor - s = c; - m_pEdit[++edIdx]->setText(s); - m_pEdit[edIdx]->end(false); - m_pEdit[edIdx]->setFocus(); - } // else either no space or invalid place in the string - } else { - // ok .. can insert - s.insert(cursorPos,c); - m_pEdit[edIdx]->setText(s); - if((s.length() == 4) && (edIdx < edMax)) - { - // the focus now goes to the next editor - m_pEdit[++edIdx]->setFocus(); - m_pEdit[edIdx]->selectAll(); - //m_pEdit[edIdx]->setCursorPosition(0); - } else { -#if QT_VERSION >= 300 - m_pEdit[edIdx]->cursorForward(false); -#else - m_pEdit[edIdx]->cursorRight(false); -#endif - } - } - } else { - if((c == ':') && (edIdx < edMax)) - { -#if QT_VERSION >= 300 - if(!m_pEdit[edIdx]->hasSelectedText()) -#else - if(!m_pEdit[edIdx]->hasMarkedText()) -#endif - { - m_pEdit[++edIdx]->setFocus(); - m_pEdit[edIdx]->selectAll(); - } - } - } - } - return true; - break; - } - } - } - return QFrame::eventFilter(o,e); -} - -void KviIpEditor::resizeEvent(QResizeEvent *e) -{ - if(m_pEdit[0]) - { - int maxW = (m_addrType == IpV4) ? 4 : 8; - int labHint = m_pLabel[0]->sizeHint().width(); - int hghHint = height() - 4; - int ediWdth = ((width() - 4) - ((maxW - 1) * labHint)) / maxW; - int curX = 2; - for(int i=0;i<maxW;i++) - { - if(i > 0) - { - m_pLabel[i - 1]->setGeometry(curX,2,labHint,hghHint); - curX += labHint; - } - m_pEdit[i]->setGeometry(curX,2,ediWdth,hghHint); - curX += ediWdth; - } - } - if(e)QFrame::resizeEvent(e); -} - -QSize KviIpEditor::sizeHint() -{ - if(m_pEdit[0]) - { - int labHint = m_pLabel[0]->sizeHint().width(); - int hghHint = m_pEdit[0]->sizeHint().height(); - int ediHint = m_pEdit[0]->sizeHint().width(); - if(m_addrType == IpV4)return QSize((labHint * 3) + (ediHint * 4) + 4,hghHint + 4); - else return QSize((labHint * 7) + (ediHint * 8) + 4,hghHint + 4); - } else return QFrame::sizeHint(); -} - - -#include "kvi_ipeditor.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_ipeditor.h b/3.4.0/src/kvirc/ui/kvi_ipeditor.h deleted file mode 100644 index 0279def974..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_ipeditor.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef _KVI_IPEDITOR_H_ -#define _KVI_IPEDITOR_H_ - -// -// File : kvi_ipeditor.h -// Creation date : Wed Jun 12 2000 14:16:02 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qwidget.h> -#include <qstring.h> -#include <qframe.h> - -class QLineEdit; -class QLabel; - -class KVIRC_API KviIpEditor : public QFrame -{ - Q_OBJECT -public: - enum AddressType { IpV4 , IpV6 }; - KviIpEditor(QWidget * parent,AddressType = IpV4,const QString &ipAddr = QString::null,const char *name = 0); - ~KviIpEditor(); -private: - QLabel * m_pLabel[7]; - QLineEdit * m_pEdit[8]; - AddressType m_addrType; -public: - bool setAddress(const QString &ipAddr); - QString address() const; - void setAddressType(AddressType addrType); - AddressType addressType() const; - bool hasEmptyFields() const; - void clear(); - virtual void setEnabled(bool bEnabled); -protected: - virtual bool eventFilter(QObject * o,QEvent *e); - virtual void resizeEvent(QResizeEvent *e); - virtual QSize sizeHint(); -private: - void recreateChildren(); -}; - -#endif //_KVI_IPEDITOR_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_irctoolbar.cpp b/3.4.0/src/kvirc/ui/kvi_irctoolbar.cpp deleted file mode 100644 index 8950cc7b5e..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_irctoolbar.cpp +++ /dev/null @@ -1,441 +0,0 @@ -//============================================================================= -// -// File : kvi_irctoolbar.cpp -// Creation date : Thu Oct 29 2000 14:13:13 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_irctoolbar.h" -#include "kvi_console.h" -#include "kvi_frame.h" -#include "kvi_locale.h" -#include "kvi_iconmanager.h" -#include "kvi_settings.h" -#include "kvi_options.h" -#include "kvi_frame.h" -#include "kvi_app.h" -#include "kvi_dynamictooltip.h" -#include "kvi_ircurl.h" -#include "kvi_internalcmd.h" -#include "kvi_pointerlist.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_irccontext.h" -#include "kvi_lagmeter.h" - -#include <qstyle.h> -#include <qpainter.h> -#include "kvi_tal_popupmenu.h" -#include <qlayout.h> - -#ifdef COMPILE_USE_QT4 - #include <qevent.h> -#endif - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - extern QPixmap * g_pShadedChildGlobalDesktopBackground; -#endif - -static QPixmap * g_pIccMemBuffer = 0; -static KviPointerList<KviToolBarGraphicalApplet> * g_pToolBarGraphicalAppletList = 0; - -KviToolBarGraphicalApplet::KviToolBarGraphicalApplet(QWidget * par,const char * name) -: QToolButton(par,name) -{ - if(!g_pToolBarGraphicalAppletList) - { - g_pToolBarGraphicalAppletList = new KviPointerList<KviToolBarGraphicalApplet>(); - g_pToolBarGraphicalAppletList->setAutoDelete(false); - g_pIccMemBuffer = new QPixmap(1,1); - } - - g_pToolBarGraphicalAppletList->append(this); -#ifdef COMPILE_USE_QT4 - setAutoFillBackground(false); -#else - setBackgroundMode(QWidget::NoBackground); -#endif - - setMouseTracking(true); - m_bResizeMode = false; - - m_sizeHint = QSize(180,32); - m_bSizeLoaded = false; -} - -unsigned int KviToolBarGraphicalApplet::loadAppletWidth() -{ - if(KVI_OPTION_UINT(KviOption_uintIrcContextAppletWidth) < 32) - KVI_OPTION_UINT(KviOption_uintIrcContextAppletWidth) = 32; - return KVI_OPTION_UINT(KviOption_uintIrcContextAppletWidth); -} - -void KviToolBarGraphicalApplet::saveAppletWidth(unsigned int uWidth) -{ - KVI_OPTION_UINT(KviOption_uintIrcContextAppletWidth) = uWidth; -} - -void KviToolBarGraphicalApplet::setupSizeHint() -{ - m_sizeHint = QSize(loadAppletWidth(),22); - m_bSizeLoaded = true; -} - -QSize KviToolBarGraphicalApplet::sizeHint() const -{ - // forget constness :( - KviToolBarGraphicalApplet * that = (KviToolBarGraphicalApplet *)this; - if(!m_bSizeLoaded)that->setupSizeHint(); - return m_sizeHint; -} - -/* -toolbar.define(default) -{ - applet(thisandthat); - applet(thisandthat); - applet(thisandthat); - applet(thisandthat); -} -*/ - - -void KviToolBarGraphicalApplet::mouseMoveEvent(QMouseEvent * e) -{ - if(e->state() & Qt::LeftButton) - { - if(m_bResizeMode) - { - int w = e->pos().x(); - if(w < 32)w = 32; - if(w > 480)w = 480; - m_sizeHint = QSize(w,22); - resize(w,height()); - g_pApp->postEvent(parentWidget(),new QEvent(QEvent::LayoutHint)); - } - } else { - if(e->pos().x() > width() - 4) - setCursor(Qt::sizeHorCursor); - else - setCursor(Qt::arrowCursor); - } -} - -void KviToolBarGraphicalApplet::mousePressEvent(QMouseEvent * e) -{ - if(e->button() & Qt::LeftButton) - { - m_bResizeMode = (e->pos().x() > (width() - 4)); - } -} - -void KviToolBarGraphicalApplet::mouseReleaseEvent(QMouseEvent * e) -{ - m_bResizeMode = false; -} - - -KviToolBarGraphicalApplet::~KviToolBarGraphicalApplet() -{ - saveAppletWidth(m_sizeHint.width()); - g_pToolBarGraphicalAppletList->removeRef(this); - if(g_pToolBarGraphicalAppletList->isEmpty()) - { - delete g_pToolBarGraphicalAppletList; - g_pToolBarGraphicalAppletList = 0; - delete g_pIccMemBuffer; - g_pIccMemBuffer = 0; - } else { - // resize the mem buffer to match the maximum width / height of the applets - resizeMemBuffer(); - } -} - -void KviToolBarGraphicalApplet::resizeMemBuffer() -{ - int uMaxW = 0; - int uMaxH = 0; - for(KviToolBarGraphicalApplet * a = g_pToolBarGraphicalAppletList->first();a;a = g_pToolBarGraphicalAppletList->next()) - { - if(uMaxW < a->width())uMaxW = a->width(); - if(uMaxH < a->height())uMaxH = a->height(); - } - g_pIccMemBuffer->resize(uMaxW,uMaxH); -} - -void KviToolBarGraphicalApplet::paintEvent(QPaintEvent *e) -{ - if(!isVisible())return; - - QPainter pa(g_pIccMemBuffer); - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - if(g_pShadedChildGlobalDesktopBackground) - { - QPoint pnt = mapToGlobal(QPoint(0,0)); - pa.drawTiledPixmap(e->rect().left(),e->rect().top(),e->rect().width(),e->rect().height(),*g_pShadedChildGlobalDesktopBackground,pnt.x(),pnt.y()); - } else { -#endif - if(KVI_OPTION_PIXMAP(KviOption_pixmapIrcToolBarAppletBackground).pixmap()) - { - QPoint pnt = mapToGlobal(QPoint(0,0)); - pa.drawTiledPixmap(e->rect().left(),e->rect().top(),e->rect().width(),e->rect().height(),*(KVI_OPTION_PIXMAP(KviOption_pixmapIrcToolBarAppletBackground).pixmap()),pnt.x(),pnt.y()); - } else { - pa.fillRect(e->rect().left(),e->rect().top(),e->rect().width(),e->rect().height(),KVI_OPTION_COLOR(KviOption_colorIrcToolBarAppletBackground)); - } -#ifdef COMPILE_PSEUDO_TRANSPARENCY - } -#endif - - drawContents(&pa); - - //Need to draw the sunken rect around the view now... - pa.setPen(colorGroup().dark()); - pa.drawLine(0,0,width(),0); - pa.drawLine(0,0,0,width()); - pa.setPen(colorGroup().light()); - pa.drawLine(1,height() - 1,width() - 1,height() - 1); - pa.drawLine(width() - 1,1,width() - 1,height()); - -#ifdef COMPILE_USE_QT4 - QPainter qt4SucksBecauseItNeedsAnAdditionalQPainter(this); - qt4SucksBecauseItNeedsAnAdditionalQPainter.drawPixmap(e->rect().left(),e->rect().top(),e->rect().width(),e->rect().height(),*g_pIccMemBuffer,e->rect().left(),e->rect().top(),e->rect().width(),e->rect().height()); -#else - bitBlt(this,e->rect().left(),e->rect().top(),g_pIccMemBuffer,e->rect().left(),e->rect().top(),e->rect().width(),e->rect().height(),Qt::CopyROP); -#endif -} - -void KviToolBarGraphicalApplet::drawContents(QPainter *) -{ - // nothing here -} - -void KviToolBarGraphicalApplet::resizeEvent(QResizeEvent *e) -{ - unsigned int uBufferW = g_pIccMemBuffer->width(); - unsigned int uBufferH = g_pIccMemBuffer->height(); - unsigned int uW = width(); - unsigned int uH = height(); - - if((uBufferW != uW) || (uBufferH != uH)) - { - if((uBufferW < uW) && (uBufferH < uH))g_pIccMemBuffer->resize(uW,uH); - else resizeMemBuffer(); - } -} - - -////////////////////////////////////////////////////////////////////////////// -// -// KviIrcContextDisplay -// -// Main applet of all irc contexts -// Displays the server connection status, server name -// nickname, user mode and the graphical indication of the context -// -////////////////////////////////////////////////////////////////////////////// - -KviIrcContextDisplay::KviIrcContextDisplay(QWidget * par,const char * name) -: KviToolBarGraphicalApplet(par,name) -{ - KviDynamicToolTip * tip = new KviDynamicToolTip(this); - connect(tip,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &))); -} - - -KviIrcContextDisplay::~KviIrcContextDisplay() -{ -} - -void KviIrcContextDisplay::tipRequest(KviDynamicToolTip * tip,const QPoint &) -{ - QString txt; - - KviConsole * c = g_pActiveWindow->console(); - - static QString b = "<b>"; - static QString nb = "</b>"; - static QString br = "<br>"; - - if(c) - { - KviIrcConnection * ic = c->connection(); - - txt = b; - - if(!ic) - { - txt += __tr2qs("No connection"); - txt += nb; - txt += br; - } else { - KviStr nickAndMode = ic->userInfo()->nickName(); - if(!(ic->userInfo()->userMode().isEmpty()))nickAndMode.append(KviStr::Format," (+%s)",ic->userInfo()->userMode().utf8().data()); - - txt += ic->currentServerName(); - txt += nb; - txt += br; - txt += nickAndMode.ptr(); - txt += br; - } - - QString szNum; - szNum.setNum(c->ircContextId()); - - QString szIrcContext = QChar('('); - szIrcContext += __tr2qs("IRC Context"); - szIrcContext += QChar(' '); - szIrcContext += szNum; - szIrcContext += QChar(')'); - txt += szIrcContext; - - if(ic && ic->lagMeter() && (KVI_OPTION_BOOL(KviOption_boolShowLagOnContextDisplay))) - { - txt += br; - int lll; - if((lll = ic->lagMeter()->lag()) > 0) - { - int llls = lll / 1000; - int llld = (lll % 1000) / 100; - int lllc = (lll % 100) / 10; - KviQString::appendFormatted(txt,__tr2qs("Lag: %d.%d%d"),llls,llld,lllc); - } else { - txt += __tr2qs("Lag: ?.??"); - } - } - } else { - txt = b; - txt += __tr2qs("No IRC context"); - txt += nb; - } - - tip->tip(rect(),txt); -} - - -/* -QSize KviIrcContextDisplay::sizeHint() const -{ - return QSize(160,22); -} -*/ - -#define KVI_APPLETIRCCONTEXTINDICATORWIDTH 12 - -void KviIrcContextDisplay::drawContents(QPainter * p) -{ - // The context indicator - KviWindow * wnd = g_pActiveWindow; - KviConsole * c = wnd ? wnd->console() : 0; - - if(c) - { - QString serv,nick; - QString tmp; - if(!c->connection()) - { - serv = __tr2qs("Not connected"); - } else { - if(c->isConnected()) - { - KviIrcConnection * ic = c->connection(); - nick = ic->currentNickName(); - if(!ic->userInfo()->userMode().isEmpty()) - { - static QString spp(" (+"); - nick += spp; - nick += ic->userInfo()->userMode(); - if(ic->userInfo()->isAway()) - { - nick += QChar(' '); - nick += __tr2qs("away"); - } - nick += QChar(')'); - } else { - if(ic->userInfo()->isAway()) - { - static QString ugly(" ("); - nick += ugly; - nick += __tr2qs("away"); - nick += QChar(')'); - } - } - serv = ic->currentServerName(); - if(ic->lagMeter() && (KVI_OPTION_BOOL(KviOption_boolShowLagOnContextDisplay))) - { - nick += " "; - int lll; - if((lll = ic->lagMeter()->lag()) > 0) - { - int llls = lll / 1000; - int llld = (lll % 1000) / 100; - int lllc = (lll % 100) / 10; - KviQString::appendFormatted(nick,__tr2qs("Lag: %d.%d%d"),llls,llld,lllc); - } else { - nick += __tr2qs("Lag: ?.??"); - } - } - } else { - serv = __tr2qs("In progress..."); - } - } - - p->setPen(KVI_OPTION_COLOR(KviOption_colorIrcToolBarAppletForegroundHighContrastActive1)); - - p->setClipRect(KVI_APPLETIRCCONTEXTINDICATORWIDTH + 2,2,width() - (KVI_APPLETIRCCONTEXTINDICATORWIDTH + 4),height() - 4); - - if(height() < 30) - { - static QString xxx(" ["); - serv += xxx; - serv += nick; - serv += QChar(']'); - p->drawText(KVI_APPLETIRCCONTEXTINDICATORWIDTH + 4,16,serv,serv.length()); - } else { - p->drawText(KVI_APPLETIRCCONTEXTINDICATORWIDTH + 4,16,serv,serv.length()); - p->drawText(KVI_APPLETIRCCONTEXTINDICATORWIDTH + 4,30,nick,nick.length()); - } - - p->setClipping(false); - - QColor base = colorGroup().background(); - QColor cntx = KVI_OPTION_ICCOLOR(c->ircContextId() % KVI_NUM_ICCOLOR_OPTIONS); - base.setRgb((base.red() + cntx.red()) >> 1,(base.green() + cntx.green()) >> 1, - (base.blue() + cntx.blue()) >> 1); - - p->fillRect(2,2, KVI_APPLETIRCCONTEXTINDICATORWIDTH - 2,height() - 4,base); - } - - p->setPen(KVI_OPTION_COLOR(KviOption_colorIrcToolBarAppletForegroundMidContrast)); - p->drawLine(1,1,width() - 1,1); - p->drawLine(1,1,1,height() - 1); - p->drawLine(2,height() - 2,width() - 1,height() - 2); - p->drawLine(width() - 2,1,width() - 2,height()); - p->drawLine(KVI_APPLETIRCCONTEXTINDICATORWIDTH,2,KVI_APPLETIRCCONTEXTINDICATORWIDTH,height() - 2); - -} - - -#ifdef Bool - #undef Bool -#endif - -#include "kvi_irctoolbar.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_irctoolbar.h b/3.4.0/src/kvirc/ui/kvi_irctoolbar.h deleted file mode 100644 index 0ea2dd6576..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_irctoolbar.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef _KVI_IRCTOOLBAR_H_ -#define _KVI_IRCTOOLBAR_H_ - -// -// File : kvi_irctoolbar.h -// Creation date : Thu Oct 29 2000 14:09:11 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_string.h" -#include "kvi_toolbar.h" -#include "kvi_console.h" - -#include "kvi_pointerlist.h" -#include <qwidget.h> -#include <qtoolbutton.h> -#include "kvi_tal_widgetstack.h" -#include <qlabel.h> - -class KviTalPopupMenu; - - -// -// Basic graphical applet -// -// Thinks about the "common" background (handles transparency stuff & co.) -// Can be a child of any AppletContainer -// - -class KVIRC_API KviToolBarGraphicalApplet : public QToolButton -{ - Q_OBJECT -public: - KviToolBarGraphicalApplet(QWidget * par,const char * name = 0); - ~KviToolBarGraphicalApplet(); -private: - bool m_bResizeMode; - bool m_bSizeLoaded; - QSize m_sizeHint; -private: - void resizeMemBuffer(); -protected: - void setupSizeHint(); - - virtual unsigned int loadAppletWidth(); - virtual void saveAppletWidth(unsigned int uWidth); - virtual QSize sizeHint() const; - virtual void mouseMoveEvent(QMouseEvent *e); - virtual void mousePressEvent(QMouseEvent *e); - virtual void mouseReleaseEvent(QMouseEvent *e); - - virtual void paintEvent(QPaintEvent *e); - virtual void drawContents(QPainter * p); - virtual void resizeEvent(QResizeEvent *e); -}; - - -class KviDynamicToolTip; - -class KVIRC_API KviIrcContextDisplay : public KviToolBarGraphicalApplet -{ - Q_OBJECT -public: - KviIrcContextDisplay(QWidget * par,const char * name = 0); - ~KviIrcContextDisplay(); -protected: - virtual void drawContents(QPainter * p); -protected slots: - void tipRequest(KviDynamicToolTip * tip,const QPoint &); -}; - - - - - - -#endif //_KVI_IRCTOOLBAR_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_ircview.cpp b/3.4.0/src/kvirc/ui/kvi_ircview.cpp deleted file mode 100644 index be58f0afb6..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_ircview.cpp +++ /dev/null @@ -1,5161 +0,0 @@ -//============================================================================= -// -// File : kvi_ircview.cpp -// Creation date : Tue Jul 6 1999 14:45:20 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -// Damn complex class ...but it works :) -// #include <brain.h> -// -// #define HOPE_THAT_IT_WILL_NEVER_NEED_TO_BE_MODIFIED :) - -// 07 May 1999 , -// Already forgot how this damn thing works , -// and spent 1 hour over a stupid bug. -// I had to recreate the whole thing in my mind......ooooouh... -// How did I wrote it ? -// Just take a look to paintEvent() or to calculateLineWraps()... -// Anyway...I've solved the bug. - -// 23 Nov 1999 , -// Well , not so bad...I seem to still remember how it works -// So just for fun , complicated the things a little bit more. -// Added precaclucaltion of the text blocks and word wrapping -// and a fast scrolling mode (3 lines at once) for consecutive -// appendText() calls. -// Now the code becomes really not understandable...:) - -// 29 Jun 2000 21:02 , -// Here we go again... I have to adjust this stuff for 3.0.0 -// Will I make this thingie work ? -// 01 Jul 2000 04:20 (AM!) , -// Yes....I got it to work just now -// and YES , complicated the things yet more. -// This time made some paint event code completely unreadable -// by placing two monster macros... -// I hope that you have a smart compiler (such as gcc is). - -// 09 Dec 2000 -// This is my C-asm-optimisation-hack playground -// Expect Bad Programming(tm) , Ugly Code(tm) , Unreadable Macros (tm) -// and massive usage of the Evil(tm) goto. - -// 25 Sep 2001 -// This stuff is going to be ported to Windoze -// A conditionally compiled code will use only Qt calls...let's see :) -// - - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// Here we go... a huge set of includes -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "kvi_ircview.h" -#include "kvi_ircviewtools.h" -#include "kvi_ircviewprivate.h" -#include "kvi_styled_controls.h" -#include "kvi_debug.h" -#include "kvi_app.h" -#include "kvi_settings.h" -#include "kvi_options.h" -#include "kvi_mirccntrl.h" -#include "kvi_defaults.h" -#include "kvi_window.h" -#include "kvi_locale.h" -#include "kvi_frame.h" -#include "kvi_malloc.h" -#include "kvi_memmove.h" -#include "kvi_iconmanager.h" -#include "kvi_out.h" -#include "kvi_parameterlist.h" -#include "kvi_console.h" -#include "kvi_ircuserdb.h" -#include "kvi_channel.h" -#include "kvi_topicw.h" -#include "kvi_query.h" -#include "kvi_filedialog.h" -#include "kvi_msgbox.h" -#include "kvi_texticonmanager.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectiontarget.h" -#include "kvi_mdimanager.h" -#include "kvi_userinput.h" -#include "kvi_kvs_eventtriggers.h" -#include "kvi_doublebuffer.h" -#include "kvi_ircurl.h" -#include "kvi_draganddrop.h" -#include "kvi_qcstring.h" -// FIXME: #warning "There should be an option to preserve control codes in copied text (clipboard) (mIrc = CTRL+Copy->with colors)" - -#include <qbitmap.h> -#include <qpainter.h> -#include <qregexp.h> -#include <qfile.h> -#include <qtoolbutton.h> -#include <qfontmetrics.h> // needed -#include <qapplication.h> -#include "kvi_tal_popupmenu.h" -#include <qmessagebox.h> -#include <qtextcodec.h> -#include <qdatetime.h> -#include <qevent.h> - -//#include <qcolor.h> // needed - -// FIXME: #warning "There are problems with the selection and wrapped lines: you can select something on the first line and get the second highlighted" -// FIXME: #warning "This hack is temporary...later remove it" - -#if QT_VERSION >= 300 - #ifndef QT_CLEAN_NAMESPACE - #define QT_CLEAN_NAMESPACE - #include <qcursor.h> - #undef QT_CLEAN_NAMESPACE - #else - #include <qcursor.h> - #endif -#else - #include <qcursor.h> -#endif - -#include <qclipboard.h> -#include <qdatetime.h> -#include <qmessagebox.h> -#include <qscrollbar.h> -#include <qfontdialog.h> - -#include <time.h> - -#ifdef COMPILE_USE_QT4 - #include <q3mimefactory.h> - #define QMimeSourceFactory Q3MimeSourceFactory -#endif - - -#ifdef COMPILE_ON_WINDOWS - #pragma warning(disable: 4102) -#endif - -#ifdef __STRICT_ANSI__ - #ifdef COMPILE_USE_DYNAMIC_LABELS - // incompatible with -ansi - #undef COMPILE_USE_DYNAMIC_LABELS - #endif -#endif - -#ifdef COMPILE_ZLIB_SUPPORT - #include <zlib.h> -#endif - -#define KVI_DEF_BACK 200 - -// FIXME: #warning "The scrollbar should NOT have a fixed size : the KDE styles can configure the size (sizeHint() ?)" - -// -// FIXME: PgUp and PgDn scrolls a fixed number of lines! -// Make it view height dependant -// -// FIXME: This widget is quite slow on a 300 MHz processor -// - - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// Globals -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -// Stuff declared in kvi_app.cpp and managed by KviApp class - - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - extern QPixmap * g_pShadedChildGlobalDesktopBackground; -#endif - - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// Internal constants -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - -// Maximum size of the internal buffer for each window -// This is the default value -//#define KVI_IRCVIEW_MAX_LINES 1024 -// Borders...just do not set it to 0 -#define KVI_IRCVIEW_HORIZONTAL_BORDER 4 -#define KVI_IRCVIEW_VERTICAL_BORDER 4 -// A little bit more than the scroll-bar... -// Qt+X have strange interactions that I can not understand when I try to move the splitter -// to the maximum on the left , Maybe the cache pixmap size becomes negative ? (I don't think so) -// Anyway , when the scroll bar position becomes negative (or the IrcView has smaller width than -// the scroll bar) X aborts with a funny -// X Error: BadDrawable (invalid Pixmap or Window parameter) 9 -// Major opcode: 55 -// Program received signal SIGABRT, Aborted. -// Do not change unless you're sure that it will not happen :) -#define KVI_IRCVIEW_MINIMUM_WIDTH 22 -//16+4+(2*4) * Do not change -#define KVI_IRCVIEW_PIXMAP_AND_SEPARATOR 20 -#define KVI_IRCVIEW_PIXMAP_SEPARATOR_AND_DOUBLEBORDER_WIDTH 28 -#define KVI_IRCVIEW_SELECT_REPAINT_INTERVAL 100 -#define KVI_IRCVIEW_SIZEHINT_WIDTH 150 -#define KVI_IRCVIEW_SIZEHINT_HEIGHT 150 - -#define KVI_IRCVIEW_BLOCK_SELECTION_TOTAL 0 -#define KVI_IRCVIEW_BLOCK_SELECTION_LEFT 1 -#define KVI_IRCVIEW_BLOCK_SELECTION_RIGHT 2 -#define KVI_IRCVIEW_BLOCK_SELECTION_CENTRAL 3 -#define KVI_IRCVIEW_BLOCK_SELECTION_ICON 4 - -#define KVI_IRCVIEW_PIXMAP_SIZE 16 - -#define KVI_IRCVIEW_ESCAPE_TAG_URLLINK 'u' -#define KVI_IRCVIEW_ESCAPE_TAG_NICKLINK 'n' -#define KVI_IRCVIEW_ESCAPE_TAG_SERVERLINK 's' -#define KVI_IRCVIEW_ESCAPE_TAG_HOSTLINK 'h' -#define KVI_IRCVIEW_ESCAPE_TAG_GENERICESCAPE '[' - -// FIXME: Get rid of this!!!!!!!!! -#define WSTRINGCONFIG_SAFE_TO_MEMCPY_QCHAR - -#define _WSTRING_WMEMCPY(_dst,_src,_len) kvi_fastmoveodd((void *)(_dst),(const void *)(_src),sizeof(kvi_wchar_t) * (_len)) - -void kvi_appendWCharToQStringWithLength(QString * qstrptr,const kvi_wchar_t * ptr,kvi_wslen_t len) -{ - kvi_wslen_t oldLen = qstrptr->length(); - qstrptr->setLength(oldLen + len); - #ifdef WSTRINGCONFIG_SAFE_TO_MEMCPY_QCHAR - _WSTRING_WMEMCPY(qstrptr->unicode() + oldLen,ptr,len); - #else // !WSTRINGCONFIG_SAFE_TO_MEMCPY_QCHAR - QChar * c = (qstrptr->unicode() + oldLen); - while(*ptr) - { - c->unicode() = *ptr; - ptr++; - c++; - } - #endif // !WSTRINGCONFIG_SAFE_TO_MEMCPY_QCHAR -} - - - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// Info about escape syntax -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -// escape commands: -// -// <cr>!<escape_command><cr><visible parameters<cr> -// -// <escape_command> ::= u <--- url link -// <escape_command> ::= n <--- nick link -// <escape_command> ::= s <--- server link -// <escape_command> ::= h <--- host link -// <escape_command> ::= [... <--- generic escape "rbt" | "mbt" | "dbl" | "txt" -// - - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// The IrcView : construct and destroy -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -KviIrcView::KviIrcView(QWidget *parent,KviFrame *pFrm,KviWindow *pWnd) -: QWidget(parent,"irc_view") -{ - // Ok...here we go - // initialize the initializable - -#ifdef COMPILE_USE_QT4 - setAttribute(Qt::WA_NoSystemBackground); // This disables automatic qt double buffering - setAttribute(Qt::WA_OpaquePaintEvent); - //setAttribute(Qt::WA_PaintOnScreen); // disable qt backing store (that would force us to trigger repaint() instead of the 10 times faster paintEvent(0)) -#endif - - m_iFlushTimer = 0; - m_pToolsPopup = 0; - m_pFirstLine = 0; - m_pCurLine = 0; - m_pLastLine = 0; - m_pCursorLine = 0; - m_uLineMarkLineIndex = KVI_IRCVIEW_INVALID_LINE_MARK_INDEX; - m_bHaveUnreadedHighlightedMessages = false; - m_bHaveUnreadedMessages = false; - m_iNumLines = 0; - m_iMaxLines = KVI_OPTION_UINT(KviOption_uintIrcViewMaxBufferSize); - - m_uNextLineIndex = 0; - - if(m_iMaxLines < 32) - { - m_iMaxLines = 32; - KVI_OPTION_UINT(KviOption_uintIrcViewMaxBufferSize) = 32; - } - - m_bMouseIsDown = false; - - //m_bShowImages = KVI_OPTION_BOOL(KviOption_boolIrcViewShowImages); - - m_iSelectTimer = 0; - m_iMouseTimer = 0; - //m_iTipTimer = 0; - //m_bTimestamp = KVI_OPTION_BOOL(KviOption_boolIrcViewTimestamp); - - m_bAcceptDrops = false; - m_pPrivateBackgroundPixmap = 0; - m_bSkipScrollBarRepaint = false; - m_pLogFile = 0; - m_pKviWindow = pWnd; - m_pFrm = pFrm; - - m_iUnprocessedPaintEventRequests = 0; - m_bPostedPaintEventPending = false; - - m_pLastLinkUnderMouse = 0; - m_iLastLinkRectTop = -1; - m_iLastLinkRectHeight = -1; - - m_pMasterView = 0; - - m_pToolWidget = 0; - - m_pWrappedBlockSelectionInfo = new KviIrcViewWrappedBlockSelectionInfo; - - - m_pMessagesStoppedWhileSelecting = new KviPointerList<KviIrcViewLine>; - m_pMessagesStoppedWhileSelecting->setAutoDelete(false); - - // say qt to avoid erasing on repaint -#ifdef COMPILE_USE_QT4 - setAutoFillBackground(false); -#else - setBackgroundMode(NoBackground); -#endif - - m_pFm = 0; // will be updated in the first paint event - - m_pToolTip = new KviIrcViewToolTip(this); - - // Create the scroll bar -#ifdef COMPILE_USE_QT4 - m_pScrollBar = new QScrollBar(0,0,1,10,0,Qt::Vertical,this,"irc_view_scrollbar"); -#else - m_pScrollBar = new QScrollBar(0,0,1,10,0,QScrollBar::Vertical,this,"irc_view_scrollbar"); -#endif - m_pScrollBar->setTracking(true); - m_pScrollBar->show(); - - m_pScrollBar->setFocusProxy(this); - - - m_pToolsButton = new KviStyledToolButton(this,"btntools"); -#ifdef COMPILE_USE_QT4 - QIcon is1(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_POPUPMENU))); - m_pToolsButton->setAutoRaise(true); -#else - QIconSet is1(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_POPUPMENU)),QIconSet::Small); -#endif - m_pToolsButton->setIconSet(is1); - - KviTalToolTip::add(m_pToolsButton,__tr2qs("Search tools")); - m_pToolsButton->setFocusProxy(this); - - connect(m_pToolsButton,SIGNAL(clicked()),this,SLOT(showToolsPopup())); - m_pToolsButton->show(); - - connect(m_pScrollBar,SIGNAL(valueChanged(int)),this,SLOT(scrollBarPositionChanged(int))); - m_iLastScrollBarValue = 0; - - // set the minimum width - setMinimumWidth(KVI_IRCVIEW_MINIMUM_WIDTH); - // and catch all mouse events - setMouseTracking(true); - // let's go! - applyOptions(); - - if(KVI_OPTION_UINT(KviOption_uintAutoFlushLogs)) //m_iFlushTimer - { - m_iFlushTimer = startTimer(KVI_OPTION_UINT(KviOption_uintAutoFlushLogs)*60*1000); - } - -// if(pWnd->input()) setFocusProxy(pWnd->input()); - -} - -static inline void delete_text_line(KviIrcViewLine * l) -{ - for(unsigned int i=0;i<l->uChunkCount;i++) - { - if((l->pChunks[i].type == KVI_TEXT_ESCAPE) || (l->pChunks[i].type == KVI_TEXT_ICON)) - { - if( (l->pChunks[i].type == KVI_TEXT_ICON) && (l->pChunks[i].szPayload!=l->pChunks[i].szSmileId) ) - kvi_free(l->pChunks[i].szSmileId); - kvi_free(l->pChunks[i].szPayload); - } - } - kvi_free(l->pChunks); //free attributes data - if(l->iBlockCount)kvi_free(l->pBlocks); - delete l; -} - -KviIrcView::~KviIrcView() -{ - // kill any pending timer - if(m_iFlushTimer) killTimer(m_iFlushTimer); - if(m_iSelectTimer)killTimer(m_iSelectTimer); - if(m_iMouseTimer)killTimer(m_iMouseTimer); - // and close the log file (flush!) - stopLogging(); - if(m_pToolWidget)delete m_pToolWidget; - // don't forget the bacgkround pixmap! - if(m_pPrivateBackgroundPixmap)delete m_pPrivateBackgroundPixmap; - // and to remove all the text lines - emptyBuffer(false); - // the pending ones too! - while(KviIrcViewLine * l = m_pMessagesStoppedWhileSelecting->first()) - { - m_pMessagesStoppedWhileSelecting->removeFirst(); - delete_text_line(l); - } - delete m_pMessagesStoppedWhileSelecting; - if(m_pFm)delete m_pFm; - delete m_pToolTip; - delete m_pWrappedBlockSelectionInfo; -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// The IrcView : options -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void KviIrcView::setFont(const QFont &f) -{ - if(m_pFm) - { - // force an update to the font variables - delete m_pFm; - m_pFm = 0; - } - KviIrcViewLine * l = m_pFirstLine; - while(l) - { - l->iMaxLineWidth = -1; - l = l->pNext; - } - QWidget::setFont(f); - update(); -} - -void KviIrcView::applyOptions() -{ - flushLog(); - setFont(KVI_OPTION_FONT(KviOption_fontIrcView)); - if(m_iFlushTimer) killTimer(m_iFlushTimer); - if(KVI_OPTION_UINT(KviOption_uintAutoFlushLogs)) - { - m_iFlushTimer = startTimer(KVI_OPTION_UINT(KviOption_uintAutoFlushLogs)*60*1000); - } -} - - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// The IrcView : DnD //2005.Resurection by Grifisx & Noldor -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void KviIrcView::enableDnd(bool bEnable) -{ - setAcceptDrops(bEnable); - m_bAcceptDrops = bEnable; -} - -void KviIrcView::dragEnterEvent(QDragEnterEvent *e) -{ - if(!m_bAcceptDrops)return; - e->accept(KviUriDrag::canDecode(e)); - emit dndEntered(); -} - -void KviIrcView::dropEvent(QDropEvent *e) -{ - if(!m_bAcceptDrops)return; - QStringList list; - if(KviUriDrag::decodeLocalFiles(e,list)) - { - if(!list.isEmpty()) - { - QStringList::ConstIterator it = list.begin(); //kewl ! :) - for( ; it != list.end(); ++it ) - { - QString tmp = *it; //wow :) - #ifndef COMPILE_ON_WINDOWS - if(tmp[0] != '/')tmp.prepend("/"); //HACK HACK HACK for Qt bug (?!?) - #endif - emit fileDropped(tmp); - } - } - } -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// The IrcView : Logging -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - -void KviIrcView::stopLogging() -{ - if(m_pLogFile) - { - QString szLogEnd; - szLogEnd.sprintf(__tr2qs("### Log session terminated at %s ###"),QDateTime::currentDateTime().toString().utf8().data()); - - add2Log(szLogEnd); - m_pLogFile->close(); -#ifdef COMPILE_ZLIB_SUPPORT - if(KVI_OPTION_BOOL(KviOption_boolGzipLogs)) - { - if(m_pLogFile->open(IO_ReadOnly)) - { - QByteArray bytes; - bytes=m_pLogFile->readAll(); - m_pLogFile->close(); - QFileInfo fi(*m_pLogFile); - QString szFname=fi.dirPath(true)+QString("/")+fi.baseName(true); - gzFile file=gzopen(QTextCodec::codecForLocale()->fromUnicode(szFname).data(),"ab9"); - if(file) - { - gzwrite(file,bytes.data(),bytes.size()); - gzclose(file); - m_pLogFile->remove(); - } else { - debug("Cannot open compressed stream"); - } - } - } -#endif - delete m_pLogFile; - m_pLogFile = 0; - } -} - -void KviIrcView::getLogFileName(KviStr &buffer) -{ - if(m_pLogFile)buffer.append(m_pLogFile->name()); -} - -void KviIrcView::getLogFileName(QString &buffer) -{ - if(m_pLogFile) buffer=m_pLogFile->name(); -} - -void KviIrcView::getTextBuffer(QString &buffer) -{ - // FIXME: #warning "This does not merge the KviChannel::m_pMessageView buffer!" - buffer = ""; - if(!m_pLastLine)return; - for(KviIrcViewLine *l=m_pFirstLine;l;l=l->pNext) - { - buffer.append(l->szText); - buffer.append("\n"); - } -} - -void KviIrcView::flushLog() -{ - if(m_pLogFile) { -#ifdef COMPILE_ZLIB_SUPPORT - if(KVI_OPTION_BOOL(KviOption_boolGzipLogs)) - { - m_pLogFile->close(); - if(m_pLogFile->open(IO_ReadOnly)) - { - QByteArray bytes; - bytes=m_pLogFile->readAll(); - m_pLogFile->close(); - QFileInfo fi(*m_pLogFile); - QString szFname=fi.dirPath(true)+QString("/")+fi.baseName(true); - gzFile file=gzopen(QTextCodec::codecForLocale()->fromUnicode(szFname).data(),"ab9"); - if(file) - { - gzwrite(file,bytes.data(),bytes.size()); - gzclose(file); - m_pLogFile->remove(); - } else { - debug("Cannot open compressed stream"); - } - } - m_pLogFile->open(IO_Append|IO_WriteOnly); - } else -#endif - m_pLogFile->flush(); - } - else if(m_pMasterView)m_pMasterView->flushLog(); -} - -const QString & KviIrcView::lastMessageText() -{ - KviIrcViewLine * pCur=m_pLastLine; - while(pCur) - { - switch(pCur->iMsgType) - { - case KVI_OUT_CHANPRIVMSG: - case KVI_OUT_CHANPRIVMSGCRYPTED: - case KVI_OUT_CHANNELNOTICE: - case KVI_OUT_CHANNELNOTICECRYPTED: - case KVI_OUT_ACTION: - case KVI_OUT_OWNPRIVMSG: - case KVI_OUT_OWNPRIVMSGCRYPTED: - case KVI_OUT_HIGHLIGHT: - return pCur->szText; - } - pCur=pCur->pPrev; - } - return KviQString::empty; -} - -const QString & KviIrcView::lastLineOfText() -{ - if(!m_pLastLine)return KviQString::empty; - return m_pLastLine->szText; -} - -//void KviIrcView::toggleLogging() -//{ -// if(isLogging())stopLogging(); -// else { -//#warning "FIX THIS COMMENTED STUFF" -// -// KviStr tmp; -// m_pKviWindow->getDefaultLogName(tmp); -// startLogging(tmp.ptr()); -// -// } -//} - -void KviIrcView::setMasterView(KviIrcView * v) -{ - if(m_pMasterView)disconnect(this,SLOT(masterDead())); - m_pMasterView = v; - if(m_pMasterView)connect(m_pMasterView,SIGNAL(destroyed()),this,SLOT(masterDead())); -} - -void KviIrcView::masterDead() -{ - m_pMasterView = 0; -} - -bool KviIrcView::startLogging(const QString& fname,bool bPrependCurBuffer) -{ - stopLogging(); - QString szFname(fname); - - if(fname.isEmpty()) - { - if(!m_pKviWindow)return false; - m_pKviWindow->getDefaultLogFileName(szFname); - } - -#ifdef COMPILE_ZLIB_SUPPORT - if(KVI_OPTION_BOOL(KviOption_boolGzipLogs)) - szFname+=".tmp"; -#endif - - m_pLogFile = new QFile(szFname); - - if(m_pLogFile->exists()) - { - if(!m_pLogFile->open(IO_Append|IO_WriteOnly)) - { - delete m_pLogFile; - m_pLogFile = 0; - return false; - } - } else { - if(!m_pLogFile->open(IO_WriteOnly)) - { - delete m_pLogFile; - m_pLogFile = 0; - return false; - } - } - - QString szLogStart; - szLogStart.sprintf(__tr2qs("### Log session started at %s ###"),QDateTime::currentDateTime().toString().utf8().data()); - add2Log(szLogStart); - if(bPrependCurBuffer) - { - add2Log(__tr2qs("### Existing data buffer:")); - QString buffer; - getTextBuffer(buffer); - add2Log(buffer); - add2Log(__tr2qs("### End of existing data buffer.")); - m_pLogFile->flush(); - } - - return true; -} - -void KviIrcView::add2Log(const QString &szBuffer,int iMsgType) -{ - QString szToWrite=QString("%1 %2\n").arg(iMsgType).arg(szBuffer); - KviQCString szTmp = KviQString::toUtf8(szToWrite); - if(m_pLogFile->writeBlock(szTmp.data(),szTmp.length())==-1) debug("WARNING : Can not write to the log file."); -} - -//============================================================================= -// -// Some slots -// - -//void KviIrcView::saveBufferToFile() -//{ -// // Yeah....this is powerful! :) -//// KviStr cmd = "/DIALOG (savefile,Choose a file name,$deflogfile($window).savebuf,$window) " -//// "if(\"$dialogresult\" != \"\")window $dialogmagic savebuffer $dialogresult"; -//// m_pFrm->m_pUserParser->parseUserCommand(cmd,m_pKviWindow); -//} -/* -void KviIrcView::toggleTimestamp() -{ - setTimestamp(!timestamp()); -} - -void KviIrcView::toggleImages() -{ - setShowImages(!imagesVisible()); -}*/ - -void KviIrcView::clearBuffer() -{ - emptyBuffer(true); -} - -bool KviIrcView::saveBuffer(const char *filename) -{ - QFile f(QString::fromUtf8(filename)); - if(!f.open(IO_WriteOnly|IO_Truncate))return false; - QString tmp; - getTextBuffer(tmp); - KviQCString tmpx = KviQString::toUtf8(tmp); - f.writeBlock(tmpx.data(),tmpx.length()); - f.close(); - return true; -} - -void KviIrcView::prevLine(){ m_pScrollBar->subtractLine(); } -void KviIrcView::nextLine(){ m_pScrollBar->addLine(); } -void KviIrcView::prevPage(){ m_pScrollBar->subtractPage(); } -void KviIrcView::nextPage(){ m_pScrollBar->addPage(); } - -void KviIrcView::setPrivateBackgroundPixmap(const QPixmap &pixmap,bool bRepaint) -{ - if(m_pPrivateBackgroundPixmap) - { - delete m_pPrivateBackgroundPixmap; - m_pPrivateBackgroundPixmap=0; - } - if(!pixmap.isNull())m_pPrivateBackgroundPixmap = new QPixmap(pixmap); - - if(bRepaint) - update(); -} - -void KviIrcView::emptyBuffer(bool bRepaint) -{ - while(m_pLastLine != 0)removeHeadLine(); - if(bRepaint) - update(); -} - -void KviIrcView::clearLineMark(bool bRepaint) -{ - m_uLineMarkLineIndex = KVI_IRCVIEW_INVALID_LINE_MARK_INDEX; - clearUnreaded(); - if(bRepaint) - update(); -} - -void KviIrcView::checkLogDate() -{ - QDate::currentDate(); -} - -void KviIrcView::clearUnreaded() -{ - m_bHaveUnreadedHighlightedMessages = false; - m_bHaveUnreadedMessages = false; - - if(m_pFrm) - if(m_pFrm->dockExtension()) - m_pFrm->dockExtension()->refresh(); -} - -void KviIrcView::setMaxBufferSize(int maxBufSize,bool bRepaint) -{ - if(maxBufSize < 32)maxBufSize = 32; - m_iMaxLines = maxBufSize; - while(m_iNumLines > m_iMaxLines)removeHeadLine(); - m_pScrollBar->setRange(0,m_iNumLines); - if(bRepaint) - update(); -} - -/* -void KviIrcView::setShowImages(bool bShow,bool bRepaint) -{ - if(m_bShowImages!=bShow) - { - m_bShowImages=bShow; - if(bRepaint)paintEvent(0); - } -} -*/ -/* -void KviIrcView::setTimestamp(bool bTimestamp) -{ - m_bTimestamp = bTimestamp; - - -// STATS FOR A BUFFER FULL OF HIGHLY COLORED STRINGS , HIGHLY WRAPPED -// -// Lines = 1024 (322425 bytes - 314 KB) (avg 314 bytes per line) , well :) -// string bytes = 87745 (85 KB) -// attributes = 3576 (42912 bytes - 41 KB) -// blocks = 12226 (146712 bytes - 143 KB) -// -// unsigned long int nAlloc = 0; -// unsigned long int nLines = 0; -// unsigned long int nStringBytes = 0; -// unsigned long int nAttrBytes = 0; -// unsigned long int nBlockBytes = 0; -// unsigned long int nBlocks = 0; -// unsigned long int nAttributes = 0; -// KviIrcViewLine * l=m_pFirstLine; -// while(l){ -// nLines++; -// nAlloc += sizeof(KviIrcViewLine); -// nStringBytes += l->data_len + 1; -// nAlloc += l->data_len + 1; -// nAlloc += (l->uChunkCount * sizeof(KviIrcViewLineChunk)); -// nAttrBytes +=(l->uChunkCount * sizeof(KviIrcViewLineChunk)); -// nAlloc += (l->iBlockCount * sizeof(KviIrcViewLineChunk)); -// nBlockBytes += (l->iBlockCount * sizeof(KviIrcViewLineChunk)); -// nBlocks += (l->iBlockCount); -// nAttributes += (l->uChunkCount); -// l = l->pNext; -// } -// debug("\n\nLines = %u (%u bytes - %u KB) (avg %u bytes per line)",nLines,nAlloc,nAlloc / 1024,nLines ? (nAlloc / nLines) : 0); -// debug("string bytes = %u (%u KB)",nStringBytes,nStringBytes / 1024); -// debug("attributes = %u (%u bytes - %u KB)",nAttributes,nAttrBytes,nAttrBytes / 1024); -// debug("blocks = %u (%u bytes - %u KB)\n",nBlocks,nBlockBytes,nBlockBytes / 1024); - -} -*/ -void KviIrcView::scrollBarPositionChanged(int newValue) -{ - if(!m_pCurLine)return; - int diff = 0; - if(newValue > m_iLastScrollBarValue) - { - while(newValue > m_iLastScrollBarValue) - { - if(m_pCurLine->pNext) - { - m_pCurLine=m_pCurLine->pNext; - diff++; - } - m_iLastScrollBarValue++; - } - } else { - while(newValue < m_iLastScrollBarValue) - { - if(m_pCurLine->pPrev)m_pCurLine=m_pCurLine->pPrev; - m_iLastScrollBarValue--; - } - } - if(!m_bSkipScrollBarRepaint) - repaint(); - //update(); -// if(!m_bSkipScrollBarRepaint)postUpdateEvent(); -} - -bool KviIrcView::event(QEvent *e) -{ - if(e->type() == QEvent::User) - { - __range_valid(m_bPostedPaintEventPending); - if(m_iUnprocessedPaintEventRequests) - repaint(); - // else we just had a pointEvent that did the job - m_bPostedPaintEventPending = false; - return true; - } - return QWidget::event(e); -} - -void KviIrcView::wheelEvent(QWheelEvent *e) -{ -#ifdef COMPILE_USE_QT4 - static bool bHere = false; - if(bHere)return; - bHere = true; // Qt4 tends to jump into infinite recursion here -#endif - g_pApp->sendEvent(m_pScrollBar,e); -#ifdef COMPILE_USE_QT4 - bHere = false; -#endif -} - - -void KviIrcView::postUpdateEvent() -{ - // This will post a QEvent with a full repaint request - if(!m_bPostedPaintEventPending) - { - m_bPostedPaintEventPending = true; - QEvent *e = new QEvent(QEvent::User); - g_pApp->postEvent(this,e); // queue a repaint - } - - m_iUnprocessedPaintEventRequests++; // paintEvent() will set it to 0 - - if(m_iUnprocessedPaintEventRequests == 3) - { - // Three unprocessed paint events...do it now -#ifdef COMPILE_PSEUDO_TRANSPARENCY - if(! ((KVI_OPTION_PIXMAP(KviOption_pixmapIrcViewBackground).pixmap()) || m_pPrivateBackgroundPixmap || g_pShadedChildGlobalDesktopBackground)) - fastScroll(3); -#else - if(! ((KVI_OPTION_PIXMAP(KviOption_pixmapIrcViewBackground).pixmap()) || m_pPrivateBackgroundPixmap)) - fastScroll(3); -#endif - else - repaint(); - } -} - -void KviIrcView::appendLine(KviIrcViewLine *ptr,bool bRepaint) -{ - //This one appends a KviIrcViewLine to - //the buffer list (at the end) - if(m_bMouseIsDown) - { - // Do not move the view! - // So we append the text line to a temp queue - // and then we'll add it when the mouse button is released - m_pMessagesStoppedWhileSelecting->append(ptr); - return; - } - - // First log the line and assign the index - // Don't use add2log here!...we must go as fast as possible, so we avoid some push and pop calls, and also a couple of branches - if(m_pLogFile && KVI_OPTION_BOOL(KviOption_boolStripControlCodesInLogs)) - { - // a slave view has no log files! - if(KVI_OPTION_MSGTYPE(ptr->iMsgType).logEnabled()) - { - add2Log(ptr->szText,ptr->iMsgType); - // If we fail...this has been already reported! - } - // mmh.. when this overflows... we have problems (find doesn't work anymore :() - // but it overflows at 2^32 lines... 2^32 = 4.294.967.296 lines - // to spit it out in a year you'd need to print 1360 lines per second... that's insane :D - // a really fast but reasonable rate of printed lines might be 10 per second - // thus 429.496.730 seconds would be needed to make this var overflow - // that means more or less 13 years of text spitting at full rate :D - // I think that we can safely assume that this will NOT overflow ... your cpu (or you) - // will get mad before. Well.. it is not that dangerous after all... - ptr->uIndex = m_uNextLineIndex; - m_uNextLineIndex++; - } else { - // no log: we could have master view! - if(m_pMasterView) - { - if(m_pMasterView->m_pLogFile && KVI_OPTION_BOOL(KviOption_boolStripControlCodesInLogs)) - { - if(KVI_OPTION_MSGTYPE(ptr->iMsgType).logEnabled()) - { - m_pMasterView->add2Log(ptr->szText,ptr->iMsgType); - } - } - ptr->uIndex = m_pMasterView->m_uNextLineIndex; - m_pMasterView->m_uNextLineIndex++; - } else { - ptr->uIndex = m_uNextLineIndex; - m_uNextLineIndex++; - } - } - - if(m_pLastLine) - { - // There is at least one line in the view - m_pLastLine->pNext=ptr; - ptr->pPrev =m_pLastLine; - ptr->pNext =0; - m_iNumLines++; - - if(m_iNumLines > m_iMaxLines) - { - // Too many lines in the view...remove one - removeHeadLine(); - if(m_pCurLine==m_pLastLine) - { - m_pCurLine=ptr; - if(bRepaint) - postUpdateEvent(); - } else { - // the cur line remains the same - // the scroll bar must move up one place to be in sync - m_bSkipScrollBarRepaint = true; - if(m_pScrollBar->value() > 0) - { - m_iLastScrollBarValue--; - __range_valid(m_iLastScrollBarValue >= 0); - m_pScrollBar->subtractLine(); - } // else will stay in sync - m_bSkipScrollBarRepaint = false; - } - } else { - // Just append - m_pScrollBar->setRange(0,m_iNumLines); - if(m_pCurLine==m_pLastLine) - { - m_bSkipScrollBarRepaint = true; - m_pScrollBar->addLine(); - m_bSkipScrollBarRepaint = false; - if(bRepaint) - postUpdateEvent(); - } - } - m_pLastLine=ptr; - } else { - //First line - m_pLastLine = ptr; - m_pFirstLine = ptr; - m_pCurLine = ptr; - ptr->pPrev = 0; - ptr->pNext = 0; - m_iNumLines = 1; - m_pScrollBar->setRange(0,1); - m_pScrollBar->addLine(); - if(bRepaint) - postUpdateEvent(); - } -} - -//============== removeHeadLine ===============// - -void KviIrcView::removeHeadLine(bool bRepaint) -{ - //Removes the first line of the text buffer - if(!m_pLastLine)return; - if(m_pFirstLine == m_pCursorLine)m_pCursorLine = 0; - - if(m_pFirstLine->pNext) - { - KviIrcViewLine *aux_ptr=m_pFirstLine->pNext; //get the next line - aux_ptr->pPrev=0; //becomes the first - if(m_pFirstLine==m_pCurLine)m_pCurLine=aux_ptr; //move the cur line if necessary - delete_text_line(m_pFirstLine); //delete the struct - m_pFirstLine=aux_ptr; //set the last - m_iNumLines--; //and decrement the count - } else { //unique line - m_pCurLine = 0; - delete_text_line(m_pFirstLine); - m_pFirstLine = 0; - m_iNumLines = 0; - m_pLastLine = 0; - } - if(bRepaint) - repaint(); -} - -void KviIrcView::splitMessagesTo(KviIrcView *v) -{ - v->emptyBuffer(false); - - KviIrcViewLine * l = m_pFirstLine; - KviIrcViewLine * tmp; - while(l) - switch(l->iMsgType) - { - case KVI_OUT_CHANPRIVMSG: - case KVI_OUT_CHANPRIVMSGCRYPTED: - case KVI_OUT_CHANNELNOTICE: - case KVI_OUT_CHANNELNOTICECRYPTED: - case KVI_OUT_ACTION: - case KVI_OUT_OWNPRIVMSG: - case KVI_OUT_OWNPRIVMSGCRYPTED: - case KVI_OUT_HIGHLIGHT: - { - m_iNumLines--; - v->m_iNumLines++; - - if(l->pNext)l->pNext->pPrev = l->pPrev; - if(l->pPrev)l->pPrev->pNext = l->pNext; - if(l == m_pFirstLine)m_pFirstLine = l->pNext; - if(l == m_pLastLine)m_pLastLine = l->pPrev; - if(v->m_pLastLine) - { - v->m_pLastLine->pNext = l; - l->pPrev = v->m_pLastLine; - v->m_pLastLine = l; - } else { - v->m_pFirstLine = l; - l->pPrev = 0; - v->m_pLastLine = l; - } - tmp = l->pNext; - l->pNext = 0; - l = tmp; - } - break; - default: - l = l->pNext; - break; - } - v->m_pCurLine = v->m_pLastLine; - m_pCurLine = m_pLastLine; - - v->m_pCursorLine = 0; - m_pCursorLine = 0; - - m_iLastScrollBarValue = m_iNumLines; - m_pScrollBar->setRange(0,m_iNumLines); - m_pScrollBar->setValue(m_iNumLines); - - repaint(); - - v->m_iLastScrollBarValue = v->m_iNumLines; - v->m_pScrollBar->setRange(0,v->m_iNumLines); - v->m_pScrollBar->setValue(v->m_iNumLines); - v->repaint(); - -} - -void KviIrcView::appendMessagesFrom(KviIrcView *v) -{ - if(!m_pLastLine) - { - m_pFirstLine = v->m_pFirstLine; - } else { - m_pLastLine->pNext = v->m_pFirstLine; - v->m_pFirstLine->pPrev = m_pLastLine; - } - m_pLastLine = v->m_pLastLine; - m_pCurLine = m_pLastLine; - m_pCursorLine = 0; - v->m_pFirstLine = 0; - v->m_pLastLine = 0; - v->m_pCurLine = 0; - v->m_pCursorLine = 0; - m_iNumLines += v->m_iNumLines; - v->m_iNumLines = 0; -// v->m_pScrollBar->setRange(0,0); -// v->m_pScrollBar->setValue(0); - m_iLastScrollBarValue = m_iNumLines; - m_pScrollBar->setRange(0,m_iNumLines); - m_pScrollBar->setValue(m_iNumLines); - - repaint(); -} - -void KviIrcView::joinMessagesFrom(KviIrcView *v) -{ - KviIrcViewLine * l1 = m_pFirstLine; - KviIrcViewLine * l2 = v->m_pFirstLine; - KviIrcViewLine * tmp; - - while(l2) - { - if(l1) - { - if(l2->uIndex < l1->uIndex) - { - // the external message is older than the current internal one - l2->pPrev = l1->pPrev; - if(l1->pPrev)l1->pPrev->pNext = l2; - else m_pFirstLine = l2; - l1->pPrev = l2; - tmp = l2->pNext; - l2->pNext = l1; - l2 = tmp; - } else { - // the external message is younger than the current internal one - l1 = l1->pNext; - } - } else { - // There is no current internal message (ran over the end) - // merge at the end then - if(m_pFirstLine) - { - m_pLastLine->pNext = l2; - l2->pPrev = m_pLastLine; - } else { - m_pFirstLine = l2; - l2->pPrev = 0; - } - tmp = l2->pNext; - l2->pNext = 0; - m_pLastLine = l2; - l2 = tmp; - } - } - - m_pCurLine = m_pLastLine; - m_pCursorLine = 0; - v->m_pFirstLine = 0; - v->m_pLastLine = 0; - v->m_pCurLine = 0; - v->m_pCursorLine = 0; - m_iNumLines += v->m_iNumLines; - v->m_iNumLines = 0; -// v->m_pScrollBar->setRange(0,0); -// v->m_pScrollBar->setValue(0); - - m_iLastScrollBarValue = m_iNumLines; - m_pScrollBar->setRange(0,m_iNumLines); - m_pScrollBar->setValue(m_iNumLines); - - repaint(); -} - -void KviIrcView::appendText(int iMsgType,const kvi_wchar_t *data_ptr,int iFlags) -{ - //appends a text string to the buffer list - //splits the lines - __range_valid(data_ptr); - m_pLastLinkUnderMouse = 0; - - while(*data_ptr) - { //Have more data - KviIrcViewLine *line_ptr=new KviIrcViewLine; //create a line struct - line_ptr->iMsgType=iMsgType; - line_ptr->iMaxLineWidth=-1; - line_ptr->iBlockCount=0; - - if(!KVI_OPTION_BOOL(KviOption_boolStripControlCodesInLogs)) - { - QString szBuffer; - kvi_appendWCharToQStringWithLength(&szBuffer,data_ptr,kvi_wstrlen(data_ptr)); - szBuffer.prepend(QDateTime::currentDateTime().toString("[h:mm:ss] ")); - if(m_pLogFile && KVI_OPTION_MSGTYPE(iMsgType).logEnabled()) - { - add2Log(szBuffer,iMsgType); - } else if(m_pMasterView) { - if(m_pMasterView->m_pLogFile && KVI_OPTION_MSGTYPE(iMsgType).logEnabled()) - { - m_pMasterView->add2Log(szBuffer,iMsgType); - } - } - } - - data_ptr=getTextLine(iMsgType,data_ptr,line_ptr,!(iFlags & NoTimestamp)); - appendLine(line_ptr,!(iFlags & NoRepaint)); - if(iFlags & SetLineMark) - { - if(KVI_OPTION_BOOL(KviOption_boolTrackLastReadTextViewLine)) - { - m_uLineMarkLineIndex = line_ptr->uIndex; - iFlags &= ~SetLineMark; - } - m_bHaveUnreadedHighlightedMessages = m_bHaveUnreadedHighlightedMessages || iMsgType == KVI_OUT_HIGHLIGHT; - m_bHaveUnreadedMessages = m_bHaveUnreadedMessages || - iMsgType == KVI_OUT_CHANPRIVMSG || - iMsgType == KVI_OUT_CHANPRIVMSGCRYPTED || - iMsgType == KVI_OUT_CHANNELNOTICE || - iMsgType == KVI_OUT_CHANNELNOTICECRYPTED || - iMsgType == KVI_OUT_ACTION || - iMsgType == KVI_OUT_OWNPRIVMSGCRYPTED || - iMsgType == KVI_OUT_HIGHLIGHT; - } - } -} - - -void KviIrcView::getLinkEscapeCommand(QString &buffer,const QString &szPayload,const QString &escape_label) -{ - if(szPayload.isEmpty())return; - - int idx = szPayload.find(escape_label); - if(idx == -1)return; - idx += escape_label.length(); - - int idx2 = szPayload.find("[!",idx); - int len = idx2 == -1 ? szPayload.length() - idx : idx2 - idx; - - buffer = szPayload.mid(idx,len); -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// The IrcView : Get text line -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - -static kvi_wchar_t case_xtx_XX[256] = -{ - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, - 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000 -}; - -static kvi_wchar_t case_ltu_00[256] = -{ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0130, 0x004A, 0x212A, 0x004C, 0x004D, 0x004E, 0x004F, - 0x0050, 0x0051, 0x0052, 0x017F, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x212B, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, - 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x0000, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x0178 -}; - - -static kvi_wchar_t case_ltu_01[256] = -{ - 0x0000, 0x0100, 0x0000, 0x0102, 0x0000, 0x0104, 0x0000, 0x0106, 0x0000, 0x0108, 0x0000, 0x010A, 0x0000, 0x010C, 0x0000, 0x010E, - 0x0000, 0x0110, 0x0000, 0x0112, 0x0000, 0x0114, 0x0000, 0x0116, 0x0000, 0x0118, 0x0000, 0x011A, 0x0000, 0x011C, 0x0000, 0x011E, - 0x0000, 0x0120, 0x0000, 0x0122, 0x0000, 0x0124, 0x0000, 0x0126, 0x0000, 0x0128, 0x0000, 0x012A, 0x0000, 0x012C, 0x0000, 0x012E, - 0x0000, 0x0049, 0x0000, 0x0132, 0x0000, 0x0134, 0x0000, 0x0136, 0x0000, 0x0000, 0x0139, 0x0000, 0x013B, 0x0000, 0x013D, 0x0000, - 0x013F, 0x0000, 0x0141, 0x0000, 0x0143, 0x0000, 0x0145, 0x0000, 0x0147, 0x0000, 0x0000, 0x014A, 0x0000, 0x014C, 0x0000, 0x014E, - 0x0000, 0x0150, 0x0000, 0x0152, 0x0000, 0x0154, 0x0000, 0x0156, 0x0000, 0x0158, 0x0000, 0x015A, 0x0000, 0x015C, 0x0000, 0x015E, - 0x0000, 0x0160, 0x0000, 0x0162, 0x0000, 0x0164, 0x0000, 0x0166, 0x0000, 0x0168, 0x0000, 0x016A, 0x0000, 0x016C, 0x0000, 0x016E, - 0x0000, 0x0170, 0x0000, 0x0172, 0x0000, 0x0174, 0x0000, 0x0176, 0x0000, 0x0000, 0x0179, 0x0000, 0x017B, 0x0000, 0x017D, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0182, 0x0000, 0x0184, 0x0000, 0x0000, 0x0187, 0x0000, 0x0000, 0x0000, 0x018B, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0191, 0x0000, 0x0000, 0x01F6, 0x0000, 0x0000, 0x0000, 0x0198, 0x0000, 0x0000, 0x0000, 0x0000, 0x0220, 0x0000, - 0x0000, 0x01A0, 0x0000, 0x01A2, 0x0000, 0x01A4, 0x0000, 0x0000, 0x01A7, 0x0000, 0x0000, 0x0000, 0x0000, 0x01AC, 0x0000, 0x0000, - 0x01AF, 0x0000, 0x0000, 0x0000, 0x01B3, 0x0000, 0x01B5, 0x0000, 0x0000, 0x01B8, 0x0000, 0x0000, 0x0000, 0x01BC, 0x0000, 0x01F7, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x01C5, 0x0000, 0x0000, 0x01C8, 0x0000, 0x0000, 0x01CB, 0x0000, 0x01CD, 0x0000, - 0x01CF, 0x0000, 0x01D1, 0x0000, 0x01D3, 0x0000, 0x01D5, 0x0000, 0x01D7, 0x0000, 0x01D9, 0x0000, 0x01DB, 0x018E, 0x0000, 0x01DE, - 0x0000, 0x01E0, 0x0000, 0x01E2, 0x0000, 0x01E4, 0x0000, 0x01E6, 0x0000, 0x01E8, 0x0000, 0x01EA, 0x0000, 0x01EC, 0x0000, 0x01EE, - 0x0000, 0x0000, 0x0000, 0x01F2, 0x0000, 0x01F4, 0x0000, 0x0000, 0x0000, 0x01F8, 0x0000, 0x01FA, 0x0000, 0x01FC, 0x0000, 0x01FE -}; - - -static kvi_wchar_t case_ltu_02[256] = -{ - 0x0000, 0x0200, 0x0000, 0x0202, 0x0000, 0x0204, 0x0000, 0x0206, 0x0000, 0x0208, 0x0000, 0x020A, 0x0000, 0x020C, 0x0000, 0x020E, - 0x0000, 0x0210, 0x0000, 0x0212, 0x0000, 0x0214, 0x0000, 0x0216, 0x0000, 0x0218, 0x0000, 0x021A, 0x0000, 0x021C, 0x0000, 0x021E, - 0x0000, 0x0000, 0x0000, 0x0222, 0x0000, 0x0224, 0x0000, 0x0226, 0x0000, 0x0228, 0x0000, 0x022A, 0x0000, 0x022C, 0x0000, 0x022E, - 0x0000, 0x0230, 0x0000, 0x0232, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0181, 0x0186, 0x0000, 0x0189, 0x018A, 0x0000, 0x018F, 0x0000, 0x0190, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0193, 0x0000, 0x0000, 0x0194, 0x0000, 0x0000, 0x0000, 0x0000, 0x0197, 0x0196, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x019C, - 0x0000, 0x0000, 0x019D, 0x0000, 0x0000, 0x019F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x01A6, 0x0000, 0x0000, 0x01A9, 0x0000, 0x0000, 0x0000, 0x0000, 0x01AE, 0x0000, 0x01B1, 0x01B2, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x01B7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_ltu_03[256] = -{ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0386, 0x0388, 0x0389, 0x038A, - 0x0000, 0x0391, 0x03D0, 0x0393, 0x0394, 0x03F5, 0x0396, 0x0397, 0x03F4, 0x1FBE, 0x03F0, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, - 0x03D6, 0x03F1, 0x0000, 0x03F2, 0x03A4, 0x03A5, 0x03D5, 0x03A7, 0x03A8, 0x2126, 0x03AA, 0x03AB, 0x038C, 0x038E, 0x038F, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03D8, 0x0000, 0x03DA, 0x0000, 0x03DC, 0x0000, 0x03DE, - 0x0000, 0x03E0, 0x0000, 0x03E2, 0x0000, 0x03E4, 0x0000, 0x03E6, 0x0000, 0x03E8, 0x0000, 0x03EA, 0x0000, 0x03EC, 0x0000, 0x03EE, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_ltu_04[256] = -{ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, - 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, - 0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, 0x040D, 0x040E, 0x040F, - 0x0000, 0x0460, 0x0000, 0x0462, 0x0000, 0x0464, 0x0000, 0x0466, 0x0000, 0x0468, 0x0000, 0x046A, 0x0000, 0x046C, 0x0000, 0x046E, - 0x0000, 0x0470, 0x0000, 0x0472, 0x0000, 0x0474, 0x0000, 0x0476, 0x0000, 0x0478, 0x0000, 0x047A, 0x0000, 0x047C, 0x0000, 0x047E, - 0x0000, 0x0480, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x048A, 0x0000, 0x048C, 0x0000, 0x048E, - 0x0000, 0x0490, 0x0000, 0x0492, 0x0000, 0x0494, 0x0000, 0x0496, 0x0000, 0x0498, 0x0000, 0x049A, 0x0000, 0x049C, 0x0000, 0x049E, - 0x0000, 0x04A0, 0x0000, 0x04A2, 0x0000, 0x04A4, 0x0000, 0x04A6, 0x0000, 0x04A8, 0x0000, 0x04AA, 0x0000, 0x04AC, 0x0000, 0x04AE, - 0x0000, 0x04B0, 0x0000, 0x04B2, 0x0000, 0x04B4, 0x0000, 0x04B6, 0x0000, 0x04B8, 0x0000, 0x04BA, 0x0000, 0x04BC, 0x0000, 0x04BE, - 0x0000, 0x0000, 0x04C1, 0x0000, 0x04C3, 0x0000, 0x04C5, 0x0000, 0x04C7, 0x0000, 0x04C9, 0x0000, 0x04CB, 0x0000, 0x04CD, 0x0000, - 0x0000, 0x04D0, 0x0000, 0x04D2, 0x0000, 0x04D4, 0x0000, 0x04D6, 0x0000, 0x04D8, 0x0000, 0x04DA, 0x0000, 0x04DC, 0x0000, 0x04DE, - 0x0000, 0x04E0, 0x0000, 0x04E2, 0x0000, 0x04E4, 0x0000, 0x04E6, 0x0000, 0x04E8, 0x0000, 0x04EA, 0x0000, 0x04EC, 0x0000, 0x04EE, - 0x0000, 0x04F0, 0x0000, 0x04F2, 0x0000, 0x04F4, 0x0000, 0x0000, 0x0000, 0x04F8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_ltu_05[256] = -{ - 0x0000, 0x0500, 0x0000, 0x0502, 0x0000, 0x0504, 0x0000, 0x0506, 0x0000, 0x0508, 0x0000, 0x050A, 0x0000, 0x050C, 0x0000, 0x050E, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0531, 0x0532, 0x0533, 0x0534, 0x0535, 0x0536, 0x0537, 0x0538, 0x0539, 0x053A, 0x053B, 0x053C, 0x053D, 0x053E, 0x053F, - 0x0540, 0x0541, 0x0542, 0x0543, 0x0544, 0x0545, 0x0546, 0x0547, 0x0548, 0x0549, 0x054A, 0x054B, 0x054C, 0x054D, 0x054E, 0x054F, - 0x0550, 0x0551, 0x0552, 0x0553, 0x0554, 0x0555, 0x0556, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_ltu_1E[256] = -{ - 0x0000, 0x1E00, 0x0000, 0x1E02, 0x0000, 0x1E04, 0x0000, 0x1E06, 0x0000, 0x1E08, 0x0000, 0x1E0A, 0x0000, 0x1E0C, 0x0000, 0x1E0E, - 0x0000, 0x1E10, 0x0000, 0x1E12, 0x0000, 0x1E14, 0x0000, 0x1E16, 0x0000, 0x1E18, 0x0000, 0x1E1A, 0x0000, 0x1E1C, 0x0000, 0x1E1E, - 0x0000, 0x1E20, 0x0000, 0x1E22, 0x0000, 0x1E24, 0x0000, 0x1E26, 0x0000, 0x1E28, 0x0000, 0x1E2A, 0x0000, 0x1E2C, 0x0000, 0x1E2E, - 0x0000, 0x1E30, 0x0000, 0x1E32, 0x0000, 0x1E34, 0x0000, 0x1E36, 0x0000, 0x1E38, 0x0000, 0x1E3A, 0x0000, 0x1E3C, 0x0000, 0x1E3E, - 0x0000, 0x1E40, 0x0000, 0x1E42, 0x0000, 0x1E44, 0x0000, 0x1E46, 0x0000, 0x1E48, 0x0000, 0x1E4A, 0x0000, 0x1E4C, 0x0000, 0x1E4E, - 0x0000, 0x1E50, 0x0000, 0x1E52, 0x0000, 0x1E54, 0x0000, 0x1E56, 0x0000, 0x1E58, 0x0000, 0x1E5A, 0x0000, 0x1E5C, 0x0000, 0x1E5E, - 0x0000, 0x1E9B, 0x0000, 0x1E62, 0x0000, 0x1E64, 0x0000, 0x1E66, 0x0000, 0x1E68, 0x0000, 0x1E6A, 0x0000, 0x1E6C, 0x0000, 0x1E6E, - 0x0000, 0x1E70, 0x0000, 0x1E72, 0x0000, 0x1E74, 0x0000, 0x1E76, 0x0000, 0x1E78, 0x0000, 0x1E7A, 0x0000, 0x1E7C, 0x0000, 0x1E7E, - 0x0000, 0x1E80, 0x0000, 0x1E82, 0x0000, 0x1E84, 0x0000, 0x1E86, 0x0000, 0x1E88, 0x0000, 0x1E8A, 0x0000, 0x1E8C, 0x0000, 0x1E8E, - 0x0000, 0x1E90, 0x0000, 0x1E92, 0x0000, 0x1E94, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x1EA0, 0x0000, 0x1EA2, 0x0000, 0x1EA4, 0x0000, 0x1EA6, 0x0000, 0x1EA8, 0x0000, 0x1EAA, 0x0000, 0x1EAC, 0x0000, 0x1EAE, - 0x0000, 0x1EB0, 0x0000, 0x1EB2, 0x0000, 0x1EB4, 0x0000, 0x1EB6, 0x0000, 0x1EB8, 0x0000, 0x1EBA, 0x0000, 0x1EBC, 0x0000, 0x1EBE, - 0x0000, 0x1EC0, 0x0000, 0x1EC2, 0x0000, 0x1EC4, 0x0000, 0x1EC6, 0x0000, 0x1EC8, 0x0000, 0x1ECA, 0x0000, 0x1ECC, 0x0000, 0x1ECE, - 0x0000, 0x1ED0, 0x0000, 0x1ED2, 0x0000, 0x1ED4, 0x0000, 0x1ED6, 0x0000, 0x1ED8, 0x0000, 0x1EDA, 0x0000, 0x1EDC, 0x0000, 0x1EDE, - 0x0000, 0x1EE0, 0x0000, 0x1EE2, 0x0000, 0x1EE4, 0x0000, 0x1EE6, 0x0000, 0x1EE8, 0x0000, 0x1EEA, 0x0000, 0x1EEC, 0x0000, 0x1EEE, - 0x0000, 0x1EF0, 0x0000, 0x1EF2, 0x0000, 0x1EF4, 0x0000, 0x1EF6, 0x0000, 0x1EF8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_ltu_1F[256] = -{ - 0x1F08, 0x1F09, 0x1F0A, 0x1F0B, 0x1F0C, 0x1F0D, 0x1F0E, 0x1F0F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1F18, 0x1F19, 0x1F1A, 0x1F1B, 0x1F1C, 0x1F1D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1F28, 0x1F29, 0x1F2A, 0x1F2B, 0x1F2C, 0x1F2D, 0x1F2E, 0x1F2F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1F38, 0x1F39, 0x1F3A, 0x1F3B, 0x1F3C, 0x1F3D, 0x1F3E, 0x1F3F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1F48, 0x1F49, 0x1F4A, 0x1F4B, 0x1F4C, 0x1F4D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x1F59, 0x0000, 0x1F5B, 0x0000, 0x1F5D, 0x0000, 0x1F5F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1F68, 0x1F69, 0x1F6A, 0x1F6B, 0x1F6C, 0x1F6D, 0x1F6E, 0x1F6F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1FBA, 0x1FBB, 0x1FC8, 0x1FC9, 0x1FCA, 0x1FCB, 0x1FDA, 0x1FDB, 0x1FF8, 0x1FF9, 0x1FEA, 0x1FEB, 0x1FFA, 0x1FFB, 0x0000, 0x0000, - 0x1F88, 0x1F89, 0x1F8A, 0x1F8B, 0x1F8C, 0x1F8D, 0x1F8E, 0x1F8F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1F98, 0x1F99, 0x1F9A, 0x1F9B, 0x1F9C, 0x1F9D, 0x1F9E, 0x1F9F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1FA8, 0x1FA9, 0x1FAA, 0x1FAB, 0x1FAC, 0x1FAD, 0x1FAE, 0x1FAF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1FB8, 0x1FB9, 0x0000, 0x1FBC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x1FCC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1FD8, 0x1FD9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1FE8, 0x1FE9, 0x0000, 0x0000, 0x0000, 0x1FEC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x1FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_ltu_21[256] = -{ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x2160, 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0x216A, 0x216B, 0x216C, 0x216D, 0x216E, 0x216F, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_ltu_24[256] = -{ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x24B6, 0x24B7, 0x24B8, 0x24B9, 0x24BA, 0x24BB, 0x24BC, 0x24BD, 0x24BE, 0x24BF, 0x24C0, 0x24C1, 0x24C2, 0x24C3, 0x24C4, 0x24C5, - 0x24C6, 0x24C7, 0x24C8, 0x24C9, 0x24CA, 0x24CB, 0x24CC, 0x24CD, 0x24CE, 0x24CF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_ltu_FF[256] = -{ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0xFF21, 0xFF22, 0xFF23, 0xFF24, 0xFF25, 0xFF26, 0xFF27, 0xFF28, 0xFF29, 0xFF2A, 0xFF2B, 0xFF2C, 0xFF2D, 0xFF2E, 0xFF2F, - 0xFF30, 0xFF31, 0xFF32, 0xFF33, 0xFF34, 0xFF35, 0xFF36, 0xFF37, 0xFF38, 0xFF39, 0xFF3A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -kvi_wchar_t * kvirc_case_map_ltu[256] = -{ - case_ltu_00, case_ltu_01, case_ltu_02, case_ltu_03, case_ltu_04, case_ltu_05, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_ltu_1E, case_ltu_1F, - case_xtx_XX, case_ltu_21, case_xtx_XX, case_xtx_XX, case_ltu_24, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_ltu_FF -}; - - -static kvi_wchar_t case_utl_00[256] = -{ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0131, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03BC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, - 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x0000, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_utl_01[256] = -{ - 0x0101, 0x0000, 0x0103, 0x0000, 0x0105, 0x0000, 0x0107, 0x0000, 0x0109, 0x0000, 0x010B, 0x0000, 0x010D, 0x0000, 0x010F, 0x0000, - 0x0111, 0x0000, 0x0113, 0x0000, 0x0115, 0x0000, 0x0117, 0x0000, 0x0119, 0x0000, 0x011B, 0x0000, 0x011D, 0x0000, 0x011F, 0x0000, - 0x0121, 0x0000, 0x0123, 0x0000, 0x0125, 0x0000, 0x0127, 0x0000, 0x0129, 0x0000, 0x012B, 0x0000, 0x012D, 0x0000, 0x012F, 0x0000, - 0x0069, 0x0000, 0x0133, 0x0000, 0x0135, 0x0000, 0x0137, 0x0000, 0x0000, 0x013A, 0x0000, 0x013C, 0x0000, 0x013E, 0x0000, 0x0140, - 0x0000, 0x0142, 0x0000, 0x0144, 0x0000, 0x0146, 0x0000, 0x0148, 0x0000, 0x0000, 0x014B, 0x0000, 0x014D, 0x0000, 0x014F, 0x0000, - 0x0151, 0x0000, 0x0153, 0x0000, 0x0155, 0x0000, 0x0157, 0x0000, 0x0159, 0x0000, 0x015B, 0x0000, 0x015D, 0x0000, 0x015F, 0x0000, - 0x0161, 0x0000, 0x0163, 0x0000, 0x0165, 0x0000, 0x0167, 0x0000, 0x0169, 0x0000, 0x016B, 0x0000, 0x016D, 0x0000, 0x016F, 0x0000, - 0x0171, 0x0000, 0x0173, 0x0000, 0x0175, 0x0000, 0x0177, 0x0000, 0x00FF, 0x017A, 0x0000, 0x017C, 0x0000, 0x017E, 0x0000, 0x0073, - 0x0000, 0x0253, 0x0183, 0x0000, 0x0185, 0x0000, 0x0254, 0x0188, 0x0000, 0x0256, 0x0257, 0x018C, 0x0000, 0x0000, 0x01DD, 0x0259, - 0x025B, 0x0192, 0x0000, 0x0260, 0x0263, 0x0000, 0x0269, 0x0268, 0x0199, 0x0000, 0x0000, 0x0000, 0x026F, 0x0272, 0x0000, 0x0275, - 0x01A1, 0x0000, 0x01A3, 0x0000, 0x01A5, 0x0000, 0x0280, 0x01A8, 0x0000, 0x0283, 0x0000, 0x0000, 0x01AD, 0x0000, 0x0288, 0x01B0, - 0x0000, 0x028A, 0x028B, 0x01B4, 0x0000, 0x01B6, 0x0000, 0x0292, 0x01B9, 0x0000, 0x0000, 0x0000, 0x01BD, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x01C6, 0x01C6, 0x0000, 0x01C9, 0x01C9, 0x0000, 0x01CC, 0x01CC, 0x0000, 0x01CE, 0x0000, 0x01D0, - 0x0000, 0x01D2, 0x0000, 0x01D4, 0x0000, 0x01D6, 0x0000, 0x01D8, 0x0000, 0x01DA, 0x0000, 0x01DC, 0x0000, 0x0000, 0x01DF, 0x0000, - 0x01E1, 0x0000, 0x01E3, 0x0000, 0x01E5, 0x0000, 0x01E7, 0x0000, 0x01E9, 0x0000, 0x01EB, 0x0000, 0x01ED, 0x0000, 0x01EF, 0x0000, - 0x0000, 0x01F3, 0x01F3, 0x0000, 0x01F5, 0x0000, 0x0195, 0x01BF, 0x01F9, 0x0000, 0x01FB, 0x0000, 0x01FD, 0x0000, 0x01FF, 0x0000 -}; - - -static kvi_wchar_t case_utl_02[256] = -{ - 0x0201, 0x0000, 0x0203, 0x0000, 0x0205, 0x0000, 0x0207, 0x0000, 0x0209, 0x0000, 0x020B, 0x0000, 0x020D, 0x0000, 0x020F, 0x0000, - 0x0211, 0x0000, 0x0213, 0x0000, 0x0215, 0x0000, 0x0217, 0x0000, 0x0219, 0x0000, 0x021B, 0x0000, 0x021D, 0x0000, 0x021F, 0x0000, - 0x019E, 0x0000, 0x0223, 0x0000, 0x0225, 0x0000, 0x0227, 0x0000, 0x0229, 0x0000, 0x022B, 0x0000, 0x022D, 0x0000, 0x022F, 0x0000, - 0x0231, 0x0000, 0x0233, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_utl_03[256] = -{ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03B9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03AC, 0x0000, 0x03AD, 0x03AE, 0x03AF, 0x0000, 0x03CC, 0x0000, 0x03CD, 0x03CE, - 0x0000, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, - 0x03C0, 0x03C1, 0x0000, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x03C3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x03B2, 0x03B8, 0x0000, 0x0000, 0x0000, 0x03C6, 0x03C0, 0x0000, 0x03D9, 0x0000, 0x03DB, 0x0000, 0x03DD, 0x0000, 0x03DF, 0x0000, - 0x03E1, 0x0000, 0x03E3, 0x0000, 0x03E5, 0x0000, 0x03E7, 0x0000, 0x03E9, 0x0000, 0x03EB, 0x0000, 0x03ED, 0x0000, 0x03EF, 0x0000, - 0x03BA, 0x03C1, 0x03C3, 0x0000, 0x03B8, 0x03B5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_utl_04[256] = -{ - 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x045D, 0x045E, 0x045F, - 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, - 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0461, 0x0000, 0x0463, 0x0000, 0x0465, 0x0000, 0x0467, 0x0000, 0x0469, 0x0000, 0x046B, 0x0000, 0x046D, 0x0000, 0x046F, 0x0000, - 0x0471, 0x0000, 0x0473, 0x0000, 0x0475, 0x0000, 0x0477, 0x0000, 0x0479, 0x0000, 0x047B, 0x0000, 0x047D, 0x0000, 0x047F, 0x0000, - 0x0481, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x048B, 0x0000, 0x048D, 0x0000, 0x048F, 0x0000, - 0x0491, 0x0000, 0x0493, 0x0000, 0x0495, 0x0000, 0x0497, 0x0000, 0x0499, 0x0000, 0x049B, 0x0000, 0x049D, 0x0000, 0x049F, 0x0000, - 0x04A1, 0x0000, 0x04A3, 0x0000, 0x04A5, 0x0000, 0x04A7, 0x0000, 0x04A9, 0x0000, 0x04AB, 0x0000, 0x04AD, 0x0000, 0x04AF, 0x0000, - 0x04B1, 0x0000, 0x04B3, 0x0000, 0x04B5, 0x0000, 0x04B7, 0x0000, 0x04B9, 0x0000, 0x04BB, 0x0000, 0x04BD, 0x0000, 0x04BF, 0x0000, - 0x0000, 0x04C2, 0x0000, 0x04C4, 0x0000, 0x04C6, 0x0000, 0x04C8, 0x0000, 0x04CA, 0x0000, 0x04CC, 0x0000, 0x04CE, 0x0000, 0x0000, - 0x04D1, 0x0000, 0x04D3, 0x0000, 0x04D5, 0x0000, 0x04D7, 0x0000, 0x04D9, 0x0000, 0x04DB, 0x0000, 0x04DD, 0x0000, 0x04DF, 0x0000, - 0x04E1, 0x0000, 0x04E3, 0x0000, 0x04E5, 0x0000, 0x04E7, 0x0000, 0x04E9, 0x0000, 0x04EB, 0x0000, 0x04ED, 0x0000, 0x04EF, 0x0000, - 0x04F1, 0x0000, 0x04F3, 0x0000, 0x04F5, 0x0000, 0x0000, 0x0000, 0x04F9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_utl_05[256] = -{ - 0x0501, 0x0000, 0x0503, 0x0000, 0x0505, 0x0000, 0x0507, 0x0000, 0x0509, 0x0000, 0x050B, 0x0000, 0x050D, 0x0000, 0x050F, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567, 0x0568, 0x0569, 0x056A, 0x056B, 0x056C, 0x056D, 0x056E, 0x056F, - 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, 0x0578, 0x0579, 0x057A, 0x057B, 0x057C, 0x057D, 0x057E, 0x057F, - 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_utl_1E[256] = -{ - 0x1E01, 0x0000, 0x1E03, 0x0000, 0x1E05, 0x0000, 0x1E07, 0x0000, 0x1E09, 0x0000, 0x1E0B, 0x0000, 0x1E0D, 0x0000, 0x1E0F, 0x0000, - 0x1E11, 0x0000, 0x1E13, 0x0000, 0x1E15, 0x0000, 0x1E17, 0x0000, 0x1E19, 0x0000, 0x1E1B, 0x0000, 0x1E1D, 0x0000, 0x1E1F, 0x0000, - 0x1E21, 0x0000, 0x1E23, 0x0000, 0x1E25, 0x0000, 0x1E27, 0x0000, 0x1E29, 0x0000, 0x1E2B, 0x0000, 0x1E2D, 0x0000, 0x1E2F, 0x0000, - 0x1E31, 0x0000, 0x1E33, 0x0000, 0x1E35, 0x0000, 0x1E37, 0x0000, 0x1E39, 0x0000, 0x1E3B, 0x0000, 0x1E3D, 0x0000, 0x1E3F, 0x0000, - 0x1E41, 0x0000, 0x1E43, 0x0000, 0x1E45, 0x0000, 0x1E47, 0x0000, 0x1E49, 0x0000, 0x1E4B, 0x0000, 0x1E4D, 0x0000, 0x1E4F, 0x0000, - 0x1E51, 0x0000, 0x1E53, 0x0000, 0x1E55, 0x0000, 0x1E57, 0x0000, 0x1E59, 0x0000, 0x1E5B, 0x0000, 0x1E5D, 0x0000, 0x1E5F, 0x0000, - 0x1E61, 0x0000, 0x1E63, 0x0000, 0x1E65, 0x0000, 0x1E67, 0x0000, 0x1E69, 0x0000, 0x1E6B, 0x0000, 0x1E6D, 0x0000, 0x1E6F, 0x0000, - 0x1E71, 0x0000, 0x1E73, 0x0000, 0x1E75, 0x0000, 0x1E77, 0x0000, 0x1E79, 0x0000, 0x1E7B, 0x0000, 0x1E7D, 0x0000, 0x1E7F, 0x0000, - 0x1E81, 0x0000, 0x1E83, 0x0000, 0x1E85, 0x0000, 0x1E87, 0x0000, 0x1E89, 0x0000, 0x1E8B, 0x0000, 0x1E8D, 0x0000, 0x1E8F, 0x0000, - 0x1E91, 0x0000, 0x1E93, 0x0000, 0x1E95, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1E61, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1EA1, 0x0000, 0x1EA3, 0x0000, 0x1EA5, 0x0000, 0x1EA7, 0x0000, 0x1EA9, 0x0000, 0x1EAB, 0x0000, 0x1EAD, 0x0000, 0x1EAF, 0x0000, - 0x1EB1, 0x0000, 0x1EB3, 0x0000, 0x1EB5, 0x0000, 0x1EB7, 0x0000, 0x1EB9, 0x0000, 0x1EBB, 0x0000, 0x1EBD, 0x0000, 0x1EBF, 0x0000, - 0x1EC1, 0x0000, 0x1EC3, 0x0000, 0x1EC5, 0x0000, 0x1EC7, 0x0000, 0x1EC9, 0x0000, 0x1ECB, 0x0000, 0x1ECD, 0x0000, 0x1ECF, 0x0000, - 0x1ED1, 0x0000, 0x1ED3, 0x0000, 0x1ED5, 0x0000, 0x1ED7, 0x0000, 0x1ED9, 0x0000, 0x1EDB, 0x0000, 0x1EDD, 0x0000, 0x1EDF, 0x0000, - 0x1EE1, 0x0000, 0x1EE3, 0x0000, 0x1EE5, 0x0000, 0x1EE7, 0x0000, 0x1EE9, 0x0000, 0x1EEB, 0x0000, 0x1EED, 0x0000, 0x1EEF, 0x0000, - 0x1EF1, 0x0000, 0x1EF3, 0x0000, 0x1EF5, 0x0000, 0x1EF7, 0x0000, 0x1EF9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_utl_1F[256] = -{ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1F00, 0x1F01, 0x1F02, 0x1F03, 0x1F04, 0x1F05, 0x1F06, 0x1F07, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1F10, 0x1F11, 0x1F12, 0x1F13, 0x1F14, 0x1F15, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1F20, 0x1F21, 0x1F22, 0x1F23, 0x1F24, 0x1F25, 0x1F26, 0x1F27, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1F30, 0x1F31, 0x1F32, 0x1F33, 0x1F34, 0x1F35, 0x1F36, 0x1F37, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1F40, 0x1F41, 0x1F42, 0x1F43, 0x1F44, 0x1F45, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1F51, 0x0000, 0x1F53, 0x0000, 0x1F55, 0x0000, 0x1F57, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1F60, 0x1F61, 0x1F62, 0x1F63, 0x1F64, 0x1F65, 0x1F66, 0x1F67, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1F80, 0x1F81, 0x1F82, 0x1F83, 0x1F84, 0x1F85, 0x1F86, 0x1F87, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1F90, 0x1F91, 0x1F92, 0x1F93, 0x1F94, 0x1F95, 0x1F96, 0x1F97, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1FA0, 0x1FA1, 0x1FA2, 0x1FA3, 0x1FA4, 0x1FA5, 0x1FA6, 0x1FA7, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1FB0, 0x1FB1, 0x1F70, 0x1F71, 0x1FB3, 0x0000, 0x03B9, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1F72, 0x1F73, 0x1F74, 0x1F75, 0x1FC3, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1FD0, 0x1FD1, 0x1F76, 0x1F77, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1FE0, 0x1FE1, 0x1F7A, 0x1F7B, 0x1FE5, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1F78, 0x1F79, 0x1F7C, 0x1F7D, 0x1FF3, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_utl_21[256] = -{ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03C9, 0x0000, 0x0000, 0x0000, 0x006B, 0x00E5, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x217A, 0x217B, 0x217C, 0x217D, 0x217E, 0x217F, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_utl_24[256] = -{ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x24D0, 0x24D1, 0x24D2, 0x24D3, 0x24D4, 0x24D5, 0x24D6, 0x24D7, 0x24D8, 0x24D9, - 0x24DA, 0x24DB, 0x24DC, 0x24DD, 0x24DE, 0x24DF, 0x24E0, 0x24E1, 0x24E2, 0x24E3, 0x24E4, 0x24E5, 0x24E6, 0x24E7, 0x24E8, 0x24E9, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -static kvi_wchar_t case_utl_FF[256] = -{ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47, 0xFF48, 0xFF49, 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, - 0xFF50, 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57, 0xFF58, 0xFF59, 0xFF5A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -}; - - -kvi_wchar_t * kvirc_case_map_utl[256] = -{ - case_utl_00, case_utl_01, case_utl_02, case_utl_03, case_utl_04, case_utl_05, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_utl_1E, case_utl_1F, - case_xtx_XX, case_utl_21, case_xtx_XX, case_xtx_XX, case_utl_24, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, - case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_xtx_XX, case_utl_FF -}; - - -// Case mapping tables are 13824 bytes long - - - -kvi_wchar_t kvi_wtolower(kvi_wchar_t c) -{ - kvi_wchar_t l = kvirc_case_map_utl[c >> 8][c & 0xff]; - return l ? l : c; -} - -bool kvi_hstrEqualCIN(const kvi_wchar_t *str1,const char *str2,int len) -{ - while(len-- && *str1)if(kvi_wtolower(*str1++) != (kvi_wchar_t)tolower(*str2++))return false; - return (len < 0); -} - - -const kvi_wchar_t * KviIrcView::getTextLine(int iMsgType, - const kvi_wchar_t * data_ptr, - KviIrcViewLine *line_ptr, - bool bEnableTimeStamp) -{ - const kvi_wchar_t* pUnEscapeAt = 0; - // Splits the text data in lines (separated by '\n') - - // NOTE: This function may be NOT reentrant - // ... no function in this file is supposed to be thread safe anyway - - int iTextIdx = 0; //we're at the beginning in the buffer - int iCurChunk = 0; - int blockLen; - - register const kvi_wchar_t *p= data_ptr; - - //Alloc the first attribute - line_ptr->uChunkCount = 1; - line_ptr->pChunks = (KviIrcViewLineChunk *)kvi_malloc(sizeof(KviIrcViewLineChunk)); - //And fill it up - line_ptr->pChunks[0].type = KVI_TEXT_COLOR; - line_ptr->pChunks[0].iTextStart = 0; - line_ptr->pChunks[0].colors.back = KVI_OPTION_MSGTYPE(iMsgType).back(); - line_ptr->pChunks[0].colors.fore = KVI_OPTION_MSGTYPE(iMsgType).fore(); - line_ptr->pChunks[0].customFore=QColor(); - - if(bEnableTimeStamp && KVI_OPTION_BOOL(KviOption_boolIrcViewTimestamp)) - { - QString szTimestamp; - szTimestamp=QDateTime::currentDateTime ( - KVI_OPTION_BOOL(KviOption_boolIrcViewTimestampUTC) ? Qt::UTC : Qt::LocalTime ).toString( - KVI_OPTION_STRING(KviOption_stringIrcViewTimestampFormat) ); - szTimestamp.append(' '); - int iTimeStampLength=szTimestamp.length(); - - if(KVI_OPTION_BOOL(KviOption_boolUseSpecialColorForTimestamp)) - { - // we need three chunks: the first one uses the default colors - // for the message type, the second one the special colors - // of the timestamp and the third one goes back to the defaults - line_ptr->pChunks[0].iTextLen = 0; - - line_ptr->uChunkCount=3; - line_ptr->pChunks=(KviIrcViewLineChunk *)kvi_realloc((void *)line_ptr->pChunks,3 * sizeof(KviIrcViewLineChunk)); - - line_ptr->pChunks[1].type = KVI_TEXT_COLOR; - line_ptr->pChunks[1].iTextStart = 0; - line_ptr->pChunks[1].iTextLen = iTimeStampLength-1; - line_ptr->pChunks[1].colors.back = KVI_OPTION_UINT(KviOption_uintTimeStampBackground); - line_ptr->pChunks[1].colors.fore = KVI_OPTION_UINT(KviOption_uintTimeStampForeground); - - line_ptr->pChunks[2].type = KVI_TEXT_COLOR; - line_ptr->pChunks[2].iTextStart = iTimeStampLength-1; - line_ptr->pChunks[2].iTextLen = 1; - line_ptr->pChunks[2].colors.back = KVI_OPTION_MSGTYPE(iMsgType).back(); - line_ptr->pChunks[2].colors.fore = KVI_OPTION_MSGTYPE(iMsgType).fore(); - line_ptr->pChunks[2].customFore=QColor(); - iCurChunk+=2; - } else { - // only one chunk - line_ptr->pChunks[0].iTextLen = iTimeStampLength; - } - - // We need the timestamp string to be added - // alloc the necessary space - line_ptr->szText.setLength(iTimeStampLength); - - iTextIdx = iTimeStampLength; // the rest of the string will begin 11 chars later - - // throw away const: we WANT to set the chars :D - register QChar * data_ptr_aux = (QChar *)line_ptr->szText.unicode(); - register QChar * stamp_ptr_aux = (QChar *)szTimestamp.unicode(); - - for(int i=0;i<iTimeStampLength;i++) - *data_ptr_aux++ = *stamp_ptr_aux++; - } else { - // Timestamp not needed... but we don't want null strings floating around - line_ptr->szText = ""; - line_ptr->pChunks[0].iTextLen = 0; - } - - // - // Ok... a couple of macros that occur really frequently - // in the following code... - // these could work well as functions too...but the macros are a lot faster :) - // - -#define APPEND_LAST_TEXT_BLOCK(__data_ptr,__data_len) \ - blockLen = (__data_len); \ - line_ptr->pChunks[iCurChunk].iTextLen += blockLen; \ - kvi_appendWCharToQStringWithLength(&(line_ptr->szText),__data_ptr,__data_len); \ - iTextIdx+=blockLen; - -#define APPEND_LAST_TEXT_BLOCK_HIDDEN_FROM_NOW(__data_ptr,__data_len) \ - blockLen = (__data_len); \ - kvi_appendWCharToQStringWithLength(&(line_ptr->szText),__data_ptr,__data_len); \ - iTextIdx+=blockLen; - - -#define APPEND_ZERO_LENGTH_BLOCK(__data_ptr) /* does nothing */ - -#define NEW_LINE_CHUNK(_chunk_type) \ - line_ptr->uChunkCount++; \ - line_ptr->pChunks=(KviIrcViewLineChunk *)kvi_realloc((void *)line_ptr->pChunks, \ - line_ptr->uChunkCount * sizeof(KviIrcViewLineChunk)); \ - iCurChunk++; \ - line_ptr->pChunks[iCurChunk].type = _chunk_type; \ - line_ptr->pChunks[iCurChunk].iTextStart = iTextIdx; \ - line_ptr->pChunks[iCurChunk].iTextLen = 0; \ - line_ptr->pChunks[iCurChunk].customFore=iCurChunk ? line_ptr->pChunks[iCurChunk-1].customFore : QColor(); - - // EOF Macros - - int partLen; - -#ifdef COMPILE_USE_DYNAMIC_LABELS - - // Herezy :) - - // This is not only usage of the *Evil Goto(tm)* - // This is also a *rather unclear* use of the *Really Evil Goto(tm)* - // char_to_check_jump_table is a table of dynamic label addresses... - // we use it to jump to the proper check - // loop_begin is a dynamic label, and we use it to - // return to the appropriate loop - // This is again BAD PROGRAMMING(TM) :).... but it is faster than - // the version with no dynamic gotos, and really faster - // that any version without gotos that comed into my mind... - // - // This code will prolly work only with GCC...(and even needs a "smart" one) - - // Again did two versions... the first was: - // - // if(void * jmp_address = char_to_check_jump_table[*((unsigned char *)p)])goto *jmp_address; - // 18a3: 8b 55 f0 movl 0xfffffff0(%ebp),%edx - // 18a6: 31 c0 xorl %eax,%eax - // 18a8: 8a 02 movb (%edx),%al - // 18aa: 8b 04 85 20 00 00 00 movl 0x20(,%eax,4),%eax - // 18b1: 85 c0 testl %eax,%eax - // 18b3: 74 02 je 18b7 <KviIrcView::getTextLine(int, char const *, KviIrcViewLine *)+0x1f3> - // 18b5: ff e0 jmp *%eax - // - // I even had a nicer version: - // - // goto *(char_to_check_jump_table[*((unsigned char *)p)]); - // 18a3: 8b 55 f0 movl 0xfffffff0(%ebp),%edx - // 18a6: 31 c0 xorl %eax,%eax - // 18a8: 8a 02 movb (%edx),%al - // 18aa: ff 24 85 20 00 00 00 jmp *0x20(,%eax,4) - // - // but sth tells me that "jmp *0x20(,%eax,4)" takes a loooooot of clock ticks... - // ...we have less instructions , but the code takes longer to execute (7-8% longer) - // it might be also due to pipeline tricks, jump "next instruction precalculation" stuff... - - // So we end up using the fist version here - - void * loop_begin; - - static void * char_to_check_jump_table[256]= - { - &&found_end_of_buffer ,0 ,&&found_mirc_escape ,&&found_color_escape , - 0 ,0 ,0 ,0 , - 0 ,0 ,&&found_end_of_line ,0 , - 0 ,&&found_command_escape ,0 ,&&found_mirc_escape , - 0 ,0 ,0 ,0 , - 0 ,0 ,&&found_mirc_escape ,0 , - 0 ,0 ,0 ,0 , - 0 ,&&found_icon_escape ,0 ,&&found_mirc_escape , // 000-031 - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , // 032-047 - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,&&check_emoticon_char ,&&check_emoticon_char , - 0 ,&&check_emoticon_char ,0 ,0 , // 048-063 // 61='=' , 59=';' , 58=':' - 0 ,0 ,0 ,0 , - 0 ,&&check_e2k_url ,&&check_file_or_ftp_url,0 , - &&check_http_url ,&&check_irc_url ,0 ,0 , - 0 ,&&check_mailto_url ,0 ,0 , // 064-079 // 070==F 072==H 073==I 077==M - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,&&check_www_url , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , // 080-095 // 087==W - 0 ,0 ,0 ,0 , - 0 ,&&check_e2k_url ,&&check_file_or_ftp_url,0 , - &&check_http_url ,&&check_irc_url ,0 ,0 , - 0 ,&&check_mailto_url ,0 ,0 , // 096-111 // 101=e 102=f 104=h 105=i 109==m - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,&&check_www_url , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , // 112-127 // 119==w - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , // 128-133 - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , // 134-159 - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , // 160-175 - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , // 176-191 - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , // 192-207 - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , // 208-223 - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , // 224-239 - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 // 240-255 - }; - - if(KVI_OPTION_BOOL(KviOption_boolIrcViewUrlHighlighting)) - { - loop_begin = &&highlighting_check_loop; // get the address of the return label - // forewer loop -highlighting_check_loop: - // yet more optimized - if(*((unsigned short *)p) < 0xff) - if(void * jmp_address = char_to_check_jump_table[*((unsigned short *)p)])goto *jmp_address; - // goto *(char_to_check_jump_table[*((unsigned char *)p)]); <--- replace 0 with ¬hing_found -//nothing_found: - p++; - goto highlighting_check_loop; - // newer here - } else { - loop_begin = &&escape_check_loop; // get the address of the return label - // forever loop -escape_check_loop: - while(*((unsigned short *)p) > 31)p++; - goto check_escape_switch; // returns to escape_check_loop or returns from the function at all - // newer here - } - // newer here - - -#else // !COMPILE_USE_DYNAMIC_LABELS - - // No way to have a jump table, nor a dynamic return jump - // Anyway...we can have sth similar to a jump table... - // Note: this could be substituted by a compiler generated jump table - // for a switch command... but this is STILL faster - - static char char_to_check_table[256]= - { - 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, // 000-015 - 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, // 016-031 - 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, // 032-047 - 0,0,0,0,0,0,0,0, 0,0,7,7,0,7,0,0, // 048-063 - 0,0,0,0,0,8,3,0, 2,5,0,0,0,6,0,0, // 064-079 // 070==F 072==H 073==I 077==M - 0,0,0,0,0,0,0,4, 0,0,0,0,0,0,0,0, // 080-095 // 087==W - 0,0,0,0,0,8,3,0, 2,5,0,0,0,6,0,0, // 096-111 // 102==f 104==h 105==i 109==m - 0,0,0,0,0,0,0,4, 0,0,0,0,0,0,0,0, // 112-127 // 119==w - 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, // 128-133 - 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, // 134-159 - 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, // 160-175 - 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, // 176-191 - 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, // 192-207 - 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, // 208-223 - 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, // 224-239 - 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0 // 240-255 - }; - -check_char_loop: - if(KVI_OPTION_BOOL(KviOption_boolIrcViewUrlHighlighting)) - { - for(;;) - { - if(*((unsigned short *)p) < 0xff) - if(unsigned int chk = char_to_check_table[*((unsigned short *)p)]) - { - switch(chk) - { - case 1: goto check_escape_switch; break; // returns to check_char_loop or returns from the function at all - case 2: goto check_http_url; break; // returns to check_char_loop - case 3: goto check_file_or_ftp_url; break; // returns to check_char_loop - case 4: goto check_www_url; break; // returns to check_char_loop - case 5: goto check_irc_url; break; // returns to check_char_loop - case 6: goto check_mailto_url; break; // returns to check_char_loop - case 7: goto check_emoticon_char; break; // returns to check_char_loop - case 8: goto check_e2k_url; break; - } - } - p++; - } - } else { - while(((unsigned short)*p) > 31)p++; - goto check_escape_switch; // returns to check_char_loop - } - -#endif // !COMPILE_USE_DYNAMIC_LABELS - -check_escape_switch: - switch(*p) - { - case '\0': -#ifdef COMPILE_USE_DYNAMIC_LABELS -found_end_of_buffer: -#endif //COMPILE_USE_DYNAMIC_LABELS - APPEND_LAST_TEXT_BLOCK(data_ptr,p - data_ptr) - return p; - break; - case '\n': -#ifdef COMPILE_USE_DYNAMIC_LABELS -found_end_of_line: -#endif //COMPILE_USE_DYNAMIC_LABELS - // Found the end of a line - APPEND_LAST_TEXT_BLOCK(data_ptr,p - data_ptr) - // terminate the string - // move the current pointer to the next character... - // if it is '\0' we will simply stop - p++; - return p; - break; - case '\r': -#ifdef COMPILE_USE_DYNAMIC_LABELS -found_command_escape: -#endif //COMPILE_USE_DYNAMIC_LABELS - if (p==pUnEscapeAt) { - APPEND_LAST_TEXT_BLOCK(data_ptr,p - data_ptr); - NEW_LINE_CHUNK(KVI_TEXT_UNESCAPE); - pUnEscapeAt = 0; - p++; - data_ptr=p; - break; - } - // Command escape sequence - // \r!<escape_cmd>\r<visible parameters string>\r - p++; - if(*p == '!') - { - const kvi_wchar_t * next_cr = p; - // lookup the next carriage return - while(*next_cr && (*next_cr != '\r'))next_cr++; - if(*next_cr) - { - const kvi_wchar_t * term_cr = next_cr; - term_cr++; - while(*term_cr && (*term_cr != '\r'))term_cr++; - if(*term_cr) - { - // ok....the format is right: - // \r! ... \r ... \r - // ^p ^next_cr ^term_cr - p--; - // \r! ... \r ... \r - // ^p ^next_cr ^term_cr - APPEND_LAST_TEXT_BLOCK(data_ptr,p - data_ptr) - NEW_LINE_CHUNK(KVI_TEXT_ESCAPE) - - p+=2; //point after \r! - - blockLen = (next_cr - p); - line_ptr->pChunks[iCurChunk].szPayload = (kvi_wchar_t *)kvi_malloc(((next_cr - p) + 1) * sizeof(kvi_wchar_t)); - kvi_fastmoveodd((void *)(line_ptr->pChunks[iCurChunk].szPayload),p,blockLen * sizeof(kvi_wchar_t)); - - line_ptr->pChunks[iCurChunk].szPayload[blockLen] = 0; - - ++next_cr; //point after the middle \r - - pUnEscapeAt = term_cr; - - bool bColorSetted=false; - if((line_ptr->pChunks[iCurChunk].szPayload[0]=='n') && KVI_OPTION_BOOL(KviOption_boolUseUserListColorsAsNickColors) && (!KVI_OPTION_BOOL(KviOption_boolColorNicks))) - { - if(m_pKviWindow->type()==KVI_WINDOW_TYPE_CHANNEL && m_pKviWindow) - { - if(line_ptr->pChunks[iCurChunk].szPayload[1]=='c' && ((KviChannel*)m_pKviWindow)->userListView()) - { - KviUserListEntry *e = ((KviChannel*)m_pKviWindow)->userListView()->findEntry(QString((QChar*)next_cr,term_cr-next_cr)); - if(e) - { - line_ptr->pChunks[iCurChunk].colors.fore = KVI_COLOR_CUSTOM; e->color(line_ptr->pChunks[iCurChunk].customFore); - bColorSetted=true; - } - } - } - else if(m_pKviWindow->type()==KVI_WINDOW_TYPE_QUERY && m_pKviWindow && line_ptr->pChunks[iCurChunk].szPayload[1]=='c') - { - QString m_szNick = QString((QChar*)next_cr,term_cr-next_cr); - if(m_szNick==m_pKviWindow->connection()->currentNickName()) { - line_ptr->pChunks[iCurChunk].colors.fore = KVI_COLOR_OWN; - bColorSetted=true; - } - } - } - if(!bColorSetted) - { - line_ptr->pChunks[iCurChunk].colors.fore=KVI_NOCHANGE; - } - - /*APPEND_LAST_TEXT_BLOCK(next_cr,term_cr - next_cr) - NEW_LINE_CHUNK(KVI_TEXT_UNESCAPE)*/ - - p=next_cr; - data_ptr=p; - } - } - } - break; - case KVI_TEXT_COLOR: -#ifdef COMPILE_USE_DYNAMIC_LABELS -found_color_escape: -#endif //COMPILE_USE_DYNAMIC_LABELS - //Color control code...need a new attribute struct - APPEND_LAST_TEXT_BLOCK(data_ptr,p - data_ptr) - NEW_LINE_CHUNK(*p) - p++; - p=getColorBytesW(p,&(line_ptr->pChunks[iCurChunk].colors.fore), - &(line_ptr->pChunks[iCurChunk].colors.back)); - data_ptr=p; - break; - case KVI_TEXT_ICON: -#ifdef COMPILE_USE_DYNAMIC_LABELS -found_icon_escape: -#endif //COMPILE_USE_DYNAMIC_LABELS - p++; - if(*p > 32) - { - // Icon control word... need a new attribute struct - const kvi_wchar_t * beginPtr = p - 1; - const kvi_wchar_t * icon_name = p; - while(*p > 32)p++; - int datalen = p - icon_name; - kvi_wchar_t save = *p; - // throw away constness! - *((kvi_wchar_t *)p) = 0; - // FIXME: this has to be changed! : lookupTextIcon must use wide characters! - QString tmpQ; - tmpQ.setUnicodeCodes(icon_name,datalen); - KviTextIcon * icon = g_pTextIconManager->lookupTextIcon(tmpQ); - // throw away constness! - *((kvi_wchar_t *)p) = save; - //if(*p == KVI_TEXT_ICON)p++; // ending delimiter - if(icon) - { - APPEND_LAST_TEXT_BLOCK(data_ptr,beginPtr - data_ptr) - NEW_LINE_CHUNK(KVI_TEXT_ICON) - line_ptr->pChunks[iCurChunk].szPayload = (kvi_wchar_t *)kvi_malloc((datalen + 1) * sizeof(kvi_wchar_t)); - kvi_fastmoveodd((void *)(line_ptr->pChunks[iCurChunk].szPayload),icon_name,datalen * sizeof(kvi_wchar_t)); - line_ptr->pChunks[iCurChunk].szPayload[datalen] = 0; - line_ptr->pChunks[iCurChunk].szSmileId=line_ptr->pChunks[iCurChunk].szPayload; - - APPEND_LAST_TEXT_BLOCK_HIDDEN_FROM_NOW(icon_name,datalen) - - data_ptr = p; - NEW_LINE_CHUNK(KVI_TEXT_UNICON) - } - } - break; - case KVI_TEXT_BOLD: - case KVI_TEXT_UNDERLINE: - case KVI_TEXT_REVERSE: - case KVI_TEXT_RESET: -#ifdef COMPILE_USE_DYNAMIC_LABELS -found_mirc_escape: -#endif //COMPILE_USE_DYNAMIC_LABELS - APPEND_LAST_TEXT_BLOCK(data_ptr,p - data_ptr) - NEW_LINE_CHUNK(*p) - data_ptr=++p; - break; - default: - p++; - break; - } -#ifdef COMPILE_USE_DYNAMIC_LABELS - goto *loop_begin; -#else // !COMPILE_USE_DYNAMIC_LABELS - goto check_char_loop; -#endif // !COMPILE_USE_DYNAMIC_LABELS - -check_http_url: - p++; - if((*p == 't') || (*p == 'T')) - { - p--; - if(kvi_hstrEqualCIN(p,"http://",7)) - { - partLen = 7; - goto got_url; - } - if(kvi_hstrEqualCIN(p,"https://",8)) - { - partLen = 8; - goto got_url; - } - p++; - } -#ifdef COMPILE_USE_DYNAMIC_LABELS - goto *loop_begin; -#else // !COMPILE_USE_DYNAMIC_LABELS - goto check_char_loop; -#endif // !COMPILE_USE_DYNAMIC_LABELS - - -check_file_or_ftp_url: - p++; - if((*p == 'i') || (*p == 'I')) - { - p--; - if(kvi_hstrEqualCIN(p,"file://",7)) - { - partLen = 7; - goto got_url; - } - p++; - } else if((*p == 't') || (*p == 'T')) - { - p--; - if(kvi_hstrEqualCIN(p,"ftp://",6)) - { - partLen = 6; - goto got_url; - } - if(kvi_hstrEqualCIN(p,"ftp.",4)) - { - partLen = 4; - goto got_url; - } - p++; - } - -#ifdef COMPILE_USE_DYNAMIC_LABELS - goto *loop_begin; -#else // !COMPILE_USE_DYNAMIC_LABELS - goto check_char_loop; -#endif // !COMPILE_USE_DYNAMIC_LABELS - -check_e2k_url: - p++; - if((*p == 'd') || (*p == 'D')) - { - p--; - if(kvi_hstrEqualCIN(p,"ed2k://",7)) - { - partLen = 7; - goto got_url; - } - p++; - } - -#ifdef COMPILE_USE_DYNAMIC_LABELS - goto *loop_begin; -#else // !COMPILE_USE_DYNAMIC_LABELS - goto check_char_loop; -#endif // !COMPILE_USE_DYNAMIC_LABELS - -check_www_url: - p++; - if((*p == 'w') || (*p == 'W')) - { - p--; - if(kvi_hstrEqualCIN(p,"www.",4)) - { - partLen = 4; - goto got_url; - } - p++; - } - -#ifdef COMPILE_USE_DYNAMIC_LABELS - goto *loop_begin; -#else // !COMPILE_USE_DYNAMIC_LABELS - goto check_char_loop; -#endif // !COMPILE_USE_DYNAMIC_LABELS - -check_irc_url: - p++; - if((*p == 'r') || (*p == 'R')) - { - p--; - if(kvi_hstrEqualCIN(p,"irc://",6)) - { - partLen = 6; - goto got_url; - } - if(kvi_hstrEqualCIN(p,"irc6://",7)) - { - partLen = 7; - goto got_url; - } - if(kvi_hstrEqualCIN(p,"ircs://",7)) - { - partLen = 7; - goto got_url; - } - if(kvi_hstrEqualCIN(p,"ircs6://",8)) - { - partLen = 8; - goto got_url; - } - p++; - } - -#ifdef COMPILE_USE_DYNAMIC_LABELS - goto *loop_begin; -#else // !COMPILE_USE_DYNAMIC_LABELS - goto check_char_loop; -#endif // !COMPILE_USE_DYNAMIC_LABELS - -check_mailto_url: - p++; - if((*p == 'a') || (*p == 'A')) - { - p--; - if(kvi_hstrEqualCIN(p,"mailto:",7)) - { - partLen = 7; - goto got_url; - } - p++; - } -#ifdef COMPILE_USE_DYNAMIC_LABELS - goto *loop_begin; -#else // !COMPILE_USE_DYNAMIC_LABELS - goto check_char_loop; -#endif // !COMPILE_USE_DYNAMIC_LABELS - - - -got_url: - //Url highlighting block - if(*(p + partLen) < 47) - { - p+=partLen; - APPEND_LAST_TEXT_BLOCK(data_ptr,p - data_ptr) - } else { - APPEND_LAST_TEXT_BLOCK(data_ptr,p - data_ptr) - NEW_LINE_CHUNK(KVI_TEXT_ESCAPE) -// FIXME: #warning "Option for the URL escape...double click and right button!!!" -// int urlLen = KVI_OPTION_STRING(KviOption_stringUrlLinkCommand).len() + 1; - line_ptr->pChunks[iCurChunk].szPayload = (kvi_wchar_t *)kvi_malloc(2 * sizeof(kvi_wchar_t)); - line_ptr->pChunks[iCurChunk].szPayload[0] = 'u'; - line_ptr->pChunks[iCurChunk].szPayload[1] = 0x0; - line_ptr->pChunks[iCurChunk].colors.fore = KVI_OPTION_MSGTYPE(KVI_OUT_URL).fore(); - //and run until the presumed end of the url - data_ptr=p; - p+=partLen; - // Question : What characters are NOT allowed in an URL ? - // I assume [] () {} 'and chars below 33 (space too , and negative chars too! (for signed char systems)) - // [] and () are used in ed2k links often - - // These characters are "{", "}", "|", "\", "^", "~", "[", "]", and "`". (RFC1738) - while((*p > 32) && (*p != '[') && (*p != '|') && (*p != '{') && (*p != '>') && - (*p != ']') && (*p != '}') && (*p != '<') && (*p != '"'))p++; - - if(m_pKviWindow) - { - QString tmp; - tmp.setUnicodeCodes(data_ptr,p-data_ptr); - KVS_TRIGGER_EVENT_1(KviEvent_OnUrl,m_pKviWindow,tmp); - } - - APPEND_LAST_TEXT_BLOCK(data_ptr,p - data_ptr) - NEW_LINE_CHUNK(KVI_TEXT_UNESCAPE) - - } - data_ptr=p; - -#ifdef COMPILE_USE_DYNAMIC_LABELS - goto *loop_begin; -#else // !COMPILE_USE_DYNAMIC_LABELS - goto check_char_loop; -#endif // !COMPILE_USE_DYNAMIC_LABELS - - //FIXME #warning: Add more emoticons, and more intelligent code to detect when they're not really emoticons - -check_emoticon_char: - // What about this ? - - const kvi_wchar_t * begin = p; - p++; - if(KVI_OPTION_BOOL(KviOption_boolDrawEmoticons)) - switch(iMsgType) - { - case KVI_OUT_CHANPRIVMSG: - case KVI_OUT_ACTION: - case KVI_OUT_OWNPRIVMSG: - case KVI_OUT_QUERYPRIVMSG: - case KVI_OUT_QUERYPRIVMSGCRYPTED: - case KVI_OUT_QUERYNOTICE: - case KVI_OUT_QUERYNOTICECRYPTED: - case KVI_OUT_CHANPRIVMSGCRYPTED: - case KVI_OUT_CHANNELNOTICE: - case KVI_OUT_CHANNELNOTICECRYPTED: - case KVI_OUT_OWNPRIVMSGCRYPTED: - case KVI_OUT_HIGHLIGHT: - case KVI_OUT_DCCCHATMSG: - { - // Pragma: 31.05.2002 : I had to kill the 8 prefix - // It happens really too often to have an 8 followed by a parenthesis - // that is not an emoticon - - // *begin can be one of ':' , ';' , '=' - if(*p == '-')p++; // FIXME: we could handle also 'o' as a nose ??? (extreme: also '+' ?) - // FIXME: use a "jump-like-check-table" here ? .... it would be surely faster - // FIXME: handle also '[',']','\\','p','@','#','<','>','|' ??? - switch(*p) - { - case ')': - case '(': - case '/': - case 'D': - case 'P': - case 'S': - case 'O': - case '*': - case '|': - case 176: // '°' -> alt 176 : teardrop - { - const kvi_wchar_t * item = p; - const kvi_wchar_t * item2 = 0; - p++; - while(*p == *item)p++; - int count = (p - item) - 1; - if(*item == 176) - { - if(*p == ')') - { - item2 = p; - p++; - } - } - if(!*p || (*p == ' ')) - { - // ok! this is an emoticon (sequence) ! - // We lookup simplified versions of the emoticons... - - // FIXME: this sould become UNICODE!!! - QString lookupstring; - kvi_wchar_t ng[3]; - ng[0] = *begin; - ng[1] = *item; - if(item2)ng[2] = *item2; - lookupstring.setUnicodeCodes(ng,item2 ? 3 : 2); - - KviTextIcon * icon = g_pTextIconManager->lookupTextIcon(lookupstring); - // do we have that emoticon-icon association ? - if(icon) - { - // we got an icon for this emoticon - // the tooltip will carry the original emoticon source text - APPEND_LAST_TEXT_BLOCK(data_ptr,begin - data_ptr) - NEW_LINE_CHUNK(KVI_TEXT_ICON) - - int emolen = p - begin; - int reallen=item2 ? 3 : 2; - - line_ptr->pChunks[iCurChunk].szPayload = (kvi_wchar_t *)kvi_malloc((emolen + 1) * sizeof(kvi_wchar_t)); - kvi_fastmoveodd(line_ptr->pChunks[iCurChunk].szPayload,begin,emolen * sizeof(kvi_wchar_t)); - line_ptr->pChunks[iCurChunk].szPayload[emolen] = 0; - - line_ptr->pChunks[iCurChunk].szSmileId = (kvi_wchar_t *)kvi_malloc((reallen + 1) * sizeof(kvi_wchar_t)); - kvi_fastmoveodd(line_ptr->pChunks[iCurChunk].szSmileId,ng,reallen * sizeof(kvi_wchar_t)); - line_ptr->pChunks[iCurChunk].szSmileId[reallen] = 0; - - APPEND_LAST_TEXT_BLOCK_HIDDEN_FROM_NOW(begin,emolen) - data_ptr = p; - // let's also handle thingies like :DDDD - item++; - while(count > 0) - { - NEW_LINE_CHUNK(KVI_TEXT_ICON) - line_ptr->pChunks[iCurChunk].szPayload = (kvi_wchar_t *)kvi_malloc((emolen + 1) * sizeof(kvi_wchar_t)); - kvi_fastmoveodd(line_ptr->pChunks[iCurChunk].szPayload,begin,emolen * sizeof(kvi_wchar_t)); - line_ptr->pChunks[iCurChunk].szPayload[emolen] = 0; - - line_ptr->pChunks[iCurChunk].szSmileId = (kvi_wchar_t *)kvi_malloc((reallen + 1) * sizeof(kvi_wchar_t)); - kvi_fastmoveodd(line_ptr->pChunks[iCurChunk].szSmileId,ng,reallen * sizeof(kvi_wchar_t)); - line_ptr->pChunks[iCurChunk].szSmileId[reallen] = 0; - - APPEND_ZERO_LENGTH_BLOCK(data_ptr) - count--; - } - NEW_LINE_CHUNK(KVI_TEXT_UNICON) - } // we don't even need to skip back... the text eventually parsed is ok to be in a single block for sure - } // we don't even need to skip back... the text eventually parsed is ok to be in a single block for sure - } // we don't even need to skip back... the text eventually parsed is ok to be in a single block for sure - break; - } // switch(*p) - } break; - - } - - -#ifdef COMPILE_USE_DYNAMIC_LABELS - goto *loop_begin; -#else // !COMPILE_USE_DYNAMIC_LABELS - goto check_char_loop; -#endif // !COMPILE_USE_DYNAMIC_LABELS - - // never here - return p; - -} - -void KviIrcView::fastScroll(int lines) -{ - m_iUnprocessedPaintEventRequests = 0; - - if(!isVisible())return; - - if(!m_pFm) - { - // We must get the metrics from a real paint event :/ - // must do a full repaint to get them... - repaint(); - return; - } - - // Ok...the current line is the last one here - // It is the only one that needs to be repainted - int widgetWidth = width()-m_pScrollBar->width(); - if(widgetWidth < KVI_IRCVIEW_PIXMAP_SEPARATOR_AND_DOUBLEBORDER_WIDTH+10)return; //can't show stuff here - int widgetHeight = height(); - int maxLineWidth = widgetWidth; - int defLeftCoord=KVI_IRCVIEW_HORIZONTAL_BORDER; - if(KVI_OPTION_BOOL(KviOption_boolIrcViewShowImages)) - { - maxLineWidth -= KVI_IRCVIEW_PIXMAP_SEPARATOR_AND_DOUBLEBORDER_WIDTH; - defLeftCoord+=KVI_IRCVIEW_PIXMAP_AND_SEPARATOR; - } - - - int heightToPaint = 1; - KviIrcViewLine * l = m_pCurLine; - while(lines > 0) - { - if(l) - { - if(maxLineWidth != l->iMaxLineWidth)calculateLineWraps(l,maxLineWidth); - heightToPaint += l->uLineWraps * m_iFontLineSpacing; - heightToPaint += (m_iFontLineSpacing + m_iFontDescent); - lines--; - l = l->pPrev; - } else lines = 0; - } - -#ifdef COMPILE_USE_QT4 - scroll(0,-(heightToPaint-1),QRect(1,1,widgetWidth-2,widgetHeight-2)); -#else - bitBlt(this,1,1,this,1,heightToPaint,widgetWidth -2,widgetHeight - (heightToPaint + KVI_IRCVIEW_VERTICAL_BORDER)); - - QRect r(0,widgetHeight - (heightToPaint + KVI_IRCVIEW_VERTICAL_BORDER), - widgetWidth,heightToPaint + KVI_IRCVIEW_VERTICAL_BORDER); - - QPaintEvent * e = new QPaintEvent(r); - paintEvent(e); - delete e; -#endif - - if(m_iLastLinkRectHeight > -1) - { - // need to kill the last highlighted link - m_iLastLinkRectTop -= heightToPaint; - if(m_iLastLinkRectTop < 0) - { - m_iLastLinkRectHeight += m_iLastLinkRectTop; - m_iLastLinkRectTop = 0; - } - } - -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// The IrcView : THE paint event -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void KviIrcView::paintEvent(QPaintEvent *p) -{ - // - // THIS FUNCTION IS A MONSTER - // - - int scrollbarWidth = m_pScrollBar->width(); - int widgetWidth = width() - scrollbarWidth; - if(!isVisible() || (widgetWidth < 20)) - { - m_iUnprocessedPaintEventRequests = 0; // assume a full repaint when this widget is shown... - return; //can't show stuff here - } - - // if the mdiManager is in SDI mode - // and this window is attacched but is not the toplevel one - // then it is hidden completely behind the other windows - // and we can avoid to paint it :) - if(g_pFrame->mdiManager()->isInSDIMode() && - (m_pKviWindow->mdiParent() != g_pFrame->mdiManager()->topChild()) && - (m_pKviWindow->mdiParent())) - { - m_iUnprocessedPaintEventRequests = 0; // assume a full repaint when this widget is shown... - return; // totally hidden behind other windows - } - - int widgetHeight = height(); - - static QRect r; // static: avoid calling constructor and destructor every time... - - if(p) - { - r=p->rect(); // app triggered , or self triggered from fastScroll (in that case m_iUnprocessedPaintEventRequests is set to 0 there) - if(r == rect()) - m_iUnprocessedPaintEventRequests = 0; // only full repaints reset - } else { - // A self triggered event - m_iUnprocessedPaintEventRequests = 0; // only full repaints reset - r = rect(); - } - - int rectLeft = r.x(); - int rectTop = r.y(); - int rectHeight = r.height(); - int rectBottom = rectTop + rectHeight; - int rectWidth = r.width(); - if(rectWidth > widgetWidth)rectWidth = widgetWidth; - -#ifdef COMPILE_USE_QT4 - QPainter pa(this); // we use qt4 double buffering -#else - KviDoubleBuffer doublebuffer(width(),height()); - QPixmap * pDoubleBufferPixmap = doublebuffer.pixmap(); - - QPainter pa(pDoubleBufferPixmap); -#endif - SET_ANTI_ALIASING(pa); - - pa.setFont(font()); - if(!m_pFm) - { - // note that QFontMetrics(pa.font()) may be not the same as QFontMetrics(font()) - // because the painter might effectively use an approximation of the QFont specified - // by font(). - recalcFontVariables(QFontMetrics(pa.font()),pa.fontInfo()); - } - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - if(g_pShadedChildGlobalDesktopBackground) - { - QPoint pnt = mapToGlobal(QPoint(rectLeft,rectTop)); - pa.drawTiledPixmap(rectLeft,rectTop,rectWidth,rectHeight,*g_pShadedChildGlobalDesktopBackground,pnt.x(),pnt.y()); - } else { -#endif - QPixmap * pix = m_pPrivateBackgroundPixmap; - - if(!pix) - pix = KVI_OPTION_PIXMAP(KviOption_pixmapIrcViewBackground).pixmap(); - - pa.fillRect(rectLeft,rectTop,rectWidth,rectHeight,KVI_OPTION_COLOR(KviOption_colorIrcViewBackground)); - if(pix) - KviPixmapUtils::drawPixmapWithPainter(&pa,pix,KVI_OPTION_UINT(KviOption_uintIrcViewPixmapAlign),r,widgetWidth,widgetHeight); -#ifdef COMPILE_PSEUDO_TRANSPARENCY - } -#endif - - //Have lines visible - int curBottomCoord = widgetHeight - KVI_IRCVIEW_VERTICAL_BORDER; - int maxLineWidth = widgetWidth; - int defLeftCoord = KVI_IRCVIEW_HORIZONTAL_BORDER; - int lineWrapsHeight; - - if(KVI_OPTION_BOOL(KviOption_boolIrcViewShowImages)) - { - maxLineWidth -= KVI_IRCVIEW_PIXMAP_SEPARATOR_AND_DOUBLEBORDER_WIDTH; - defLeftCoord += KVI_IRCVIEW_PIXMAP_AND_SEPARATOR; - } - - KviIrcViewLine *pCurTextLine = m_pCurLine; - - if(m_bMouseIsDown) - { - m_szLastSelectionLine = ""; - m_szLastSelection = ""; - } - - //Make sure that we have enough space to paint something... - if(maxLineWidth < m_iMinimumPaintWidth)pCurTextLine=0; - - bool bLineMarkPainted = !KVI_OPTION_BOOL(KviOption_boolTrackLastReadTextViewLine); - - - //And loop thru lines until we not run over the upper bound of the view - while((curBottomCoord >= KVI_IRCVIEW_VERTICAL_BORDER) && pCurTextLine) - { - //Paint pCurTextLine - if(maxLineWidth != pCurTextLine->iMaxLineWidth) - { - // Width of the widget or the font has been changed - // from the last time that this line was painted - calculateLineWraps(pCurTextLine,maxLineWidth); - } - - // the evil multiplication - // in an i486 it can get up to 42 clock cycles - lineWrapsHeight = (pCurTextLine->uLineWraps) * m_iFontLineSpacing; - curBottomCoord -= lineWrapsHeight; - - if((curBottomCoord - m_iFontLineSpacing) > rectBottom) - { - // not in update rect... skip - curBottomCoord -= (m_iFontLineSpacing + m_iFontDescent); - pCurTextLine = pCurTextLine->pPrev; - continue; - } - - if(KVI_OPTION_BOOL(KviOption_boolIrcViewShowImages)) - { - //Paint the pixmap first - //Calculate the position of the image - //imageYPos = curBottomCoord - (pixmapHeight(16) + ((m_iFontLineSpacing - 16)/2) ); - int imageYPos = curBottomCoord - m_iRelativePixmapY; - //Set the mask if needed - int iPixId = KVI_OPTION_MSGTYPE(pCurTextLine->iMsgType).pixId(); - if(iPixId > 0) - pa.drawPixmap(KVI_IRCVIEW_HORIZONTAL_BORDER,imageYPos,*(g_pIconManager->getSmallIcon(iPixId))); - } - - if(m_pToolWidget) - { - if(!m_pToolWidget->messageEnabled(pCurTextLine->iMsgType)) - { - // not in update rect... skip - curBottomCoord -= (m_iFontLineSpacing + m_iFontDescent); - pCurTextLine = pCurTextLine->pPrev; - continue; - } - } - - // Initialize for drawing this line of text - // The first block is always an attribute block - char defaultBack = pCurTextLine->pBlocks->pChunk->colors.back; - char defaultFore = pCurTextLine->pBlocks->pChunk->colors.fore; - bool curBold = false; - bool curUnderline = false; - char foreBeforeEscape= KVI_BLACK; - bool curLink = false; - bool bacWasTransp = false; - char curFore = defaultFore; - char curBack = defaultBack; - int curLeftCoord = defLeftCoord; - curBottomCoord -= m_iFontDescent; //rise up the text... - - // - // Single text line loop (paint all text blocks) - // (May correspond to more physical lines on the display if the text is wrapped) - // - - for(int i=0;i < pCurTextLine->iBlockCount;i++) - { - register KviIrcViewWrappedBlock * block = &(pCurTextLine->pBlocks[i]); - - // Play with the attributes - if(block->pChunk) - { - //normal block - switch(block->pChunk->type) - { - case KVI_TEXT_COLOR: - if(block->pChunk->colors.fore != KVI_NOCHANGE) - { - curFore = block->pChunk->colors.fore; - if(block->pChunk->colors.back != KVI_NOCHANGE) - curBack = block->pChunk->colors.back; - } else { - // only a CTRL+K... reset - curFore = defaultFore; - curBack = defaultBack; - } - // Begin Edit by GMC-jimmy: Added - // When KVIrc encounters a CTRL+K code without any trailing numbers, we then use KVIrc's default color value - // defined by the user in the Options dialog. - // This is to allow KVIrc to handle mIRC color codes in a similar fashion to most other modern irc clients. - // See also kvi_input.cpp - - // Pragma: optimized: moved the code above (avoided duplicate if()) - // Pragma(05.03.2003): fixed again: reset ONLY if CTRL+K without numbers - // otherwise leave the background unchanged - - //if(block->pChunk->colors.fore == KVI_NOCHANGE) - // curFore = defaultFore; - //if(block->pChunk->colors.back == KVI_NOCHANGE) - // curBack = defaultBack; - // End Edit - break; - case KVI_TEXT_ESCAPE: - foreBeforeEscape = curFore; - if(block->pChunk->colors.fore != KVI_NOCHANGE) - curFore = block->pChunk->colors.fore; - if(m_pLastLinkUnderMouse == block)curLink = true; - break; - case KVI_TEXT_UNESCAPE: - curLink = false; - curFore = foreBeforeEscape; - break; - case KVI_TEXT_BOLD: - curBold = !curBold; - break; - case KVI_TEXT_UNDERLINE: - curUnderline = !curUnderline; - break; - case KVI_TEXT_RESET: - curBold = false; - curUnderline = false; - curFore = defaultFore; - curBack = defaultBack; - break; - case KVI_TEXT_REVERSE: //Huh ? - char aux = curBack; - if(bacWasTransp == true) - { - curBack = KVI_TRANSPARENT; - } else { - curBack = curFore; - } - if(aux == KVI_TRANSPARENT) - { - curFore = (char)KVI_DEF_BACK; - } else { - curFore = aux; - } - bacWasTransp = (aux == KVI_TRANSPARENT); -/* if(curBack != KVI_TRANSPARENT) - { - char aux =curFore; - curFore = curBack; - curBack = aux; - } else { - curBack = curFore; - switch(curBack) - { - case KVI_WHITE: - case KVI_ORANGE: - case KVI_YELLOW: - case KVI_LIGHTGREEN: - case KVI_BLUEMARINE: - case KVI_LIGHTBLUE: - case KVI_LIGHTVIOLET: - case KVI_LIGHTGRAY: - curFore=KVI_BLACK; - break; - default: //transparent too - curFore=KVI_LIGHTGREEN; - break; - } - } -*/ - break; - //case KVI_TEXT_ICON: - //case KVI_TEXT_UNICON: - // does nothing - //debug("Have a block with ICON/UNICON attr"); - //break; - } - - } else { - // no attributes , it is a line wrap - curLeftCoord = defLeftCoord; - if(KVI_OPTION_BOOL(KviOption_boolIrcViewWrapMargin))curLeftCoord+=m_iWrapMargin; - curBottomCoord += m_iFontLineSpacing; - } - -// -// Here we run really out of bounds :))))) -// A couple of macros that could work well as functions... -// but since there are really many params to be passed -// and push & pop calls take clock cycles -// my paranoic mind decided to go for the macro way. -// This is NOT good programming -// - -#define SET_PEN(_color,_custom)\ - if( ((unsigned char)_color) < 16 )\ - {\ - pa.setPen(KVI_OPTION_MIRCCOLOR((unsigned char)_color));\ - } else {\ - switch((unsigned char)_color)\ - {\ - case KVI_COLOR_EXT_USER_OP:\ - pa.setPen(KVI_OPTION_COLOR(KviOption_colorUserListViewOpForeground));\ - break;\ - case KVI_COLOR_EXT_USER_HALFOP:\ - pa.setPen(KVI_OPTION_COLOR(KviOption_colorUserListViewHalfOpForeground));\ - break;\ - case KVI_COLOR_EXT_USER_ADMIN:\ - pa.setPen(KVI_OPTION_COLOR(KviOption_colorUserListViewChanAdminForeground));\ - break;\ - case KVI_COLOR_EXT_USER_OWNER:\ - pa.setPen(KVI_OPTION_COLOR(KviOption_colorUserListViewChanOwnerForeground));\ - break;\ - case KVI_COLOR_EXT_USER_VOICE:\ - pa.setPen(KVI_OPTION_COLOR(KviOption_colorUserListViewVoiceForeground));\ - break;\ - case KVI_COLOR_EXT_USER_USEROP:\ - pa.setPen(KVI_OPTION_COLOR(KviOption_colorUserListViewUserOpForeground));\ - break;\ - case KVI_COLOR_EXT_USER_NORMAL:\ - pa.setPen(KVI_OPTION_COLOR(KviOption_colorUserListViewNormalForeground));\ - break;\ - case KVI_DEF_BACK :\ - pa.setPen(KVI_OPTION_COLOR(KviOption_colorIrcViewBackground));\ - break;\ - case KVI_COLOR_CUSTOM :\ - pa.setPen(_custom);\ - break;\ - case KVI_COLOR_OWN :\ - pa.setPen(KVI_OPTION_COLOR(KviOption_colorUserListViewOwnForeground));\ - break;\ - }\ - } - -#define DRAW_SELECTED_TEXT(_text_str,_text_idx,_text_len,_text_width) \ - SET_PEN(KVI_OPTION_MSGTYPE(KVI_OUT_SELECT).fore(),block->pChunk ? block->pChunk->customFore : QColor()); \ - { \ - int theWdth = _text_width; \ - if(theWdth < 0) \ - theWdth=width()-(curLeftCoord+KVI_IRCVIEW_HORIZONTAL_BORDER+scrollbarWidth); \ - pa.fillRect(curLeftCoord,curBottomCoord - m_iFontLineSpacing + m_iFontDescent,theWdth,m_iFontLineSpacing,KVI_OPTION_MIRCCOLOR(KVI_OPTION_MSGTYPE(KVI_OUT_SELECT).back())); \ - } \ - pa.drawText(curLeftCoord,curBottomCoord,_text_str,_text_idx,_text_len); \ - m_szLastSelectionLine.append(_text_str.mid(_text_idx,_text_len)); \ - curLeftCoord += _text_width; - -#define DRAW_NORMAL_TEXT(_text_str,_text_idx,_text_len,_text_width) \ - SET_PEN(curFore,block->pChunk ? block->pChunk->customFore : QColor()); \ - if(curBack != KVI_TRANSPARENT){ \ - int theWdth = _text_width; \ - if(theWdth < 0) \ - theWdth=width()-(curLeftCoord+KVI_IRCVIEW_HORIZONTAL_BORDER+scrollbarWidth); \ - pa.fillRect(curLeftCoord,curBottomCoord - m_iFontLineSpacing + m_iFontDescent,theWdth,m_iFontLineSpacing,KVI_OPTION_MIRCCOLOR((unsigned char)curBack)); \ - } \ - pa.drawText(curLeftCoord,curBottomCoord,_text_str,_text_idx,_text_len); \ - if(curBold)pa.drawText(curLeftCoord+1,curBottomCoord,_text_str,_text_idx,_text_len); \ - if(curUnderline){ \ - int theWdth = _text_width; \ - if(theWdth < 0) \ - theWdth=width()-(curLeftCoord+KVI_IRCVIEW_HORIZONTAL_BORDER+scrollbarWidth); \ - pa.drawLine(curLeftCoord,curBottomCoord+2,curLeftCoord+theWdth,curBottomCoord+2); \ - } \ - curLeftCoord += _text_width; - - -// EOF macro declarations - - if(m_bMouseIsDown) - { - //Check if the block or a part of it is selected - if(checkSelectionBlock(pCurTextLine,curLeftCoord,curBottomCoord,i)) - { - //Selected in some way - //__range_valid(g_pOptions->m_cViewOutSeleFore != KVI_TRANSPARENT); - //__range_valid(g_pOptions->m_cViewOutSeleBack != KVI_TRANSPARENT); - - if(m_bShiftPressed && i && block->pChunk && - ((m_pWrappedBlockSelectionInfo->selection_type == KVI_IRCVIEW_BLOCK_SELECTION_TOTAL) || - (m_pWrappedBlockSelectionInfo->selection_type == KVI_IRCVIEW_BLOCK_SELECTION_LEFT)) - ) - { - switch(block->pChunk->type) - { - case KVI_TEXT_BOLD: - case KVI_TEXT_UNDERLINE: - case KVI_TEXT_REVERSE: - case KVI_TEXT_RESET: - m_szLastSelectionLine.append(QChar(block->pChunk->type)); - break; - case KVI_TEXT_COLOR: - m_szLastSelectionLine.append(QChar(block->pChunk->type)); - if((block->pChunk->colors.fore != KVI_NOCHANGE) && (block->pChunk->colors.fore != KVI_TRANSPARENT)) - { - if(curFore > 9)m_szLastSelectionLine.append(QChar('1')); - m_szLastSelectionLine.append(QChar((curFore%10)+'0')); - } - if((block->pChunk->colors.back != KVI_NOCHANGE) && (block->pChunk->colors.back != KVI_TRANSPARENT) ) - { - m_szLastSelectionLine.append(QChar(',')); - if(curBack > 9)m_szLastSelectionLine.append(QChar('1')); - m_szLastSelectionLine.append(QChar((curBack%10)+'0')); - } - break; - } - } - - switch(m_pWrappedBlockSelectionInfo->selection_type) - { - case KVI_IRCVIEW_BLOCK_SELECTION_TOTAL: - DRAW_SELECTED_TEXT(pCurTextLine->szText,block->block_start, - block->block_len,block->block_width) - break; - case KVI_IRCVIEW_BLOCK_SELECTION_LEFT: - DRAW_SELECTED_TEXT(pCurTextLine->szText,block->block_start, - m_pWrappedBlockSelectionInfo->part_1_length, - m_pWrappedBlockSelectionInfo->part_1_width) - DRAW_NORMAL_TEXT(pCurTextLine->szText,block->block_start+m_pWrappedBlockSelectionInfo->part_1_length, - m_pWrappedBlockSelectionInfo->part_2_length, - m_pWrappedBlockSelectionInfo->part_2_width) - break; - case KVI_IRCVIEW_BLOCK_SELECTION_RIGHT: - DRAW_NORMAL_TEXT(pCurTextLine->szText,block->block_start, - m_pWrappedBlockSelectionInfo->part_1_length, - m_pWrappedBlockSelectionInfo->part_1_width) - DRAW_SELECTED_TEXT(pCurTextLine->szText,block->block_start+m_pWrappedBlockSelectionInfo->part_1_length, - m_pWrappedBlockSelectionInfo->part_2_length, - m_pWrappedBlockSelectionInfo->part_2_width) - break; - case KVI_IRCVIEW_BLOCK_SELECTION_CENTRAL: - DRAW_NORMAL_TEXT(pCurTextLine->szText,block->block_start, - m_pWrappedBlockSelectionInfo->part_1_length, - m_pWrappedBlockSelectionInfo->part_1_width) - DRAW_SELECTED_TEXT(pCurTextLine->szText,block->block_start+m_pWrappedBlockSelectionInfo->part_1_length, - m_pWrappedBlockSelectionInfo->part_2_length, - m_pWrappedBlockSelectionInfo->part_2_width) - DRAW_NORMAL_TEXT(pCurTextLine->szText,block->block_start+m_pWrappedBlockSelectionInfo->part_1_length+m_pWrappedBlockSelectionInfo->part_2_length, - m_pWrappedBlockSelectionInfo->part_3_length, - m_pWrappedBlockSelectionInfo->part_3_width) - break; - case KVI_IRCVIEW_BLOCK_SELECTION_ICON: - { - int theWdth = block->block_width; - if(theWdth < 0)theWdth=width()-(curLeftCoord+KVI_IRCVIEW_HORIZONTAL_BORDER+scrollbarWidth); - pa.fillRect(curLeftCoord,curBottomCoord - m_iFontLineSpacing + m_iFontDescent,theWdth,m_iFontLineSpacing,KVI_OPTION_MIRCCOLOR(KVI_OPTION_MSGTYPE(KVI_OUT_SELECT).back())); - kvi_wslen_t the_len = kvi_wstrlen(block->pChunk->szPayload); - m_szLastSelectionLine.append(QChar(block->pChunk->type)); - QString tmp; - tmp.setUnicodeCodes(block->pChunk->szPayload,the_len); - m_szLastSelectionLine.append(tmp); - goto no_selection_paint; - } - break; - } - } else { - if(block->pChunk && block->pChunk->type == KVI_TEXT_ICON)goto no_selection_paint; - int wdth = block->block_width; - if(wdth == 0) - { - // Last block before a word wrap , or a zero characters attribute block ? - if(i < (pCurTextLine->iBlockCount - 1)) - { - // There is another block... - // Check if it is a wrap... - if(pCurTextLine->pBlocks[i+1].pChunk == 0)wdth = widgetWidth-(curLeftCoord+KVI_IRCVIEW_HORIZONTAL_BORDER); - // else simply a zero characters block - } - // else simply a zero characters block - } - DRAW_NORMAL_TEXT(pCurTextLine->szText,block->block_start,block->block_len,wdth) - } - } else { - //No selection ...go fast! -no_selection_paint: - if(block->pChunk && block->pChunk->type == KVI_TEXT_ICON) - { - int wdth = block->block_width; - if(wdth < 0)wdth = widgetWidth - (curLeftCoord + KVI_IRCVIEW_HORIZONTAL_BORDER); - int imageYPos = curBottomCoord - m_iRelativePixmapY; - //Set the mask if needed - if(curBack != KVI_TRANSPARENT && curBack < 16) - { - pa.fillRect(curLeftCoord,curBottomCoord - m_iFontLineSpacing + m_iFontDescent,wdth,m_iFontLineSpacing,KVI_OPTION_MIRCCOLOR((unsigned char)curBack)); - } - QString tmpQ; - tmpQ.setUnicodeCodes(block->pChunk->szSmileId,kvi_wstrlen(block->pChunk->szSmileId)); - QPixmap * daIcon =0; - KviTextIcon* pIcon = g_pTextIconManager->lookupTextIcon(tmpQ); - if(pIcon) - { - daIcon = pIcon->pixmap(); - } - if(!daIcon) - { - // this should never happen since we do a check - // when building the text icon block , but.. better safe than sorry: - // so... we lost some icons ? wrong associations ? - // recover it by displaying the "question mark" icon - daIcon = g_pIconManager->getSmallIcon(KVI_SMALLICON_HELP); // must be there, eventually null pixmap :D - } - int moredown = 1; //used to center imager vertically (pixels which the image is moved more down) - moredown += ((m_iFontLineSpacing - daIcon->height()) / 2); - pa.drawPixmap(curLeftCoord + m_iIconSideSpacing,imageYPos + moredown,*(daIcon)); - - //debug("SHifting by %d",block->block_width); - curLeftCoord += block->block_width; - } else { - - int wdth = block->block_width; - if(wdth < 0)wdth = widgetWidth - (curLeftCoord + KVI_IRCVIEW_HORIZONTAL_BORDER); - - // FIXME: We could avoid this XSetForeground if the curFore was not changed.... - - SET_PEN(curFore,block->pChunk ? block->pChunk->customFore : QColor()); - - if(curBack != KVI_TRANSPARENT && curBack < 16 ) - { - pa.fillRect(curLeftCoord,curBottomCoord - m_iFontLineSpacing + m_iFontDescent,wdth,m_iFontLineSpacing,KVI_OPTION_MIRCCOLOR((unsigned char)curBack)); - } - - if(curLink) - { - SET_PEN(KVI_OPTION_MSGTYPE(KVI_OUT_LINK).fore(),block->pChunk ? block->pChunk->customFore : QColor()); - pa.drawText(curLeftCoord,curBottomCoord,pCurTextLine->szText,block->block_start,block->block_len); - pa.drawText(curLeftCoord+1,curBottomCoord,pCurTextLine->szText,block->block_start,block->block_len); - pa.drawLine(curLeftCoord,curBottomCoord+2,curLeftCoord+wdth,curBottomCoord+2); - } else if(curBold) { - //Draw doubled font (simulate bold) - pa.drawText(curLeftCoord,curBottomCoord,pCurTextLine->szText,block->block_start,block->block_len); - pa.drawText(curLeftCoord + 1,curBottomCoord,pCurTextLine->szText,block->block_start,block->block_len); - } else { - pa.drawText(curLeftCoord,curBottomCoord,pCurTextLine->szText,block->block_start,block->block_len); - } - - if(curUnderline) - { - //Draw a line under the text block.... - pa.drawLine(curLeftCoord,curBottomCoord+2,curLeftCoord+wdth,curBottomCoord+2); - } - curLeftCoord += block->block_width; - } - } - } - - if(pCurTextLine == m_pCursorLine) - { - // paint the cursor line - int iH = lineWrapsHeight + m_iFontLineSpacing; -#ifdef COMPILE_USE_QT4 - pa.setCompositionMode(QPainter::CompositionMode_SourceOut); -#else - pa.setRasterOp(NotROP); -#endif - pa.fillRect(0,curBottomCoord - iH,widgetWidth,iH + (m_iFontDescent << 1),Qt::black); -#ifdef COMPILE_USE_QT4 - pa.setCompositionMode(QPainter::CompositionMode_SourceOver); -#else - pa.setRasterOp(CopyROP); -#endif - } - - if(m_bMouseIsDown) - { - if(!m_szLastSelectionLine.isEmpty()) - { - if(!m_szLastSelection.isEmpty())m_szLastSelection.prepend("\n"); - m_szLastSelection.prepend(m_szLastSelectionLine); - m_szLastSelectionLine = ""; - } - } - - curBottomCoord -= (lineWrapsHeight + m_iFontLineSpacing); - - if(pCurTextLine->uIndex == m_uLineMarkLineIndex) - { - if((curBottomCoord >= KVI_IRCVIEW_VERTICAL_BORDER) && !bLineMarkPainted) - { - // visible! - bLineMarkPainted = true; - //pa.setRasterOp(NotROP); -#ifdef COMPILE_USE_QT4 - pa.setPen(QPen(KVI_OPTION_COLOR(KviOption_colorIrcViewMarkLine),1,Qt::DotLine)); -#else - pa.setPen(QPen(KVI_OPTION_COLOR(KviOption_colorIrcViewMarkLine),1,QPen::DotLine)); -#endif - pa.drawLine(0,curBottomCoord,widgetWidth,curBottomCoord); - //pa.setRasterOp(CopyROP); - } // else was partially visible only - } - - pCurTextLine = pCurTextLine->pPrev; - } - - if(!bLineMarkPainted && pCurTextLine && (rectTop <= (KVI_IRCVIEW_VERTICAL_BORDER + 5))) - { - // the line mark hasn't been painted yet - // need to find out if the mark is above the display - // the mark might be somewhere before the current text line - // find the first line that can't be painted in the view at all - while((curBottomCoord >= KVI_IRCVIEW_VERTICAL_BORDER) && pCurTextLine) - { - // the line wraps for the visible lines MUST have been already calculated - // for this view width - lineWrapsHeight = (pCurTextLine->uLineWraps) * m_iFontLineSpacing; - curBottomCoord -= lineWrapsHeight + m_iFontLineSpacing + m_iFontDescent; - pCurTextLine = pCurTextLine->pPrev; - } - - if(pCurTextLine) - { - // this is the first NOT visible - // so pCurTextLine->pNext is the last visible one - if(pCurTextLine->pNext) - { - if(pCurTextLine->pNext->uIndex >= m_uLineMarkLineIndex) - bLineMarkPainted = true; // yes, its somewhere before or on this line - } else { - // no next line ? hm... compare to the not visible one.. but this should never happen - if(pCurTextLine->uIndex >= m_uLineMarkLineIndex) - bLineMarkPainted = true; // yes, its somewhere before or on this line - } - if(bLineMarkPainted) - { - // need to mark it! - //pa.setRasterOp(NotROP); - //pa.setPen(Qt::black); -#ifdef COMPILE_USE_QT4 - pa.setPen(QPen(KVI_OPTION_COLOR(KviOption_colorIrcViewMarkLine),1,Qt::DotLine)); -#else - pa.setPen(QPen(KVI_OPTION_COLOR(KviOption_colorIrcViewMarkLine),1,QPen::DotLine)); -#endif - int x = widgetWidth - 8; - int y = KVI_IRCVIEW_VERTICAL_BORDER; - pa.drawLine(x,y,x,y); - y++; pa.drawLine(x-1,y,x+1,y); - y++; pa.drawLine(x-2,y,x+2,y); - y++; pa.drawLine(x-3,y,x+3,y); - y++; pa.drawLine(x-4,y,x+4,y); - //pa.setRasterOp(CopyROP); - } - } - } - - //Need to draw the sunken rect around the view now... - pa.setPen(colorGroup().dark()); - pa.drawLine(0,0,widgetWidth,0); - pa.drawLine(0,0,0,widgetHeight); - pa.setPen(colorGroup().light()); - widgetWidth--; - pa.drawLine(1,widgetHeight-1,widgetWidth,widgetHeight-1); - pa.drawLine(widgetWidth,1,widgetWidth,widgetHeight); - - // COPY TO THE DISPLAY -#ifndef COMPILE_USE_QT4 - bitBlt(this,rectLeft,rectTop,pDoubleBufferPixmap,rectLeft,rectTop,rectWidth,rectHeight,Qt::CopyROP); -#endif -// else we use the Qt4 native double buffering -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// The IrcView : calculate line wraps -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#define IRCVIEW_WCHARWIDTH(__c) (((__c).unicode() < 0xff) ? m_iFontCharacterWidth[(__c).unicode()] : m_pFm->width(__c)) - -void KviIrcView::calculateLineWraps(KviIrcViewLine *ptr,int maxWidth) -{ - // - // Another monster - // - - if(maxWidth<=0) return; - - if(ptr->iBlockCount != 0)kvi_free(ptr->pBlocks); // free any previous wrap blocks - ptr->pBlocks = (KviIrcViewWrappedBlock *)kvi_malloc(sizeof(KviIrcViewWrappedBlock)); // alloc one block - ptr->iMaxLineWidth = maxWidth; // calculus for this width - ptr->iBlockCount = 0; // it will be ++ - ptr->uLineWraps = 0; // no line wraps yet - - unsigned int curAttrBlock = 0; // Current attribute block - int curLineWidth = 0; - - // init the first block - ptr->pBlocks->block_start = 0; - ptr->pBlocks->block_len = 0; - ptr->pBlocks->block_width = 0; - ptr->pBlocks->pChunk = &(ptr->pChunks[0]); // always an attribute block - - int maxBlockLen = ptr->pChunks->iTextLen; // ptr->pChunks[0].iTextLen - - const QChar * unicode = ptr->szText.unicode(); - - for(;;) - { - //Calculate the block_width - register const QChar * p = unicode + ptr->pBlocks[ptr->iBlockCount].block_start; - int curBlockLen = 0; - int curBlockWidth = 0; - - if(ptr->pChunks[curAttrBlock].type == KVI_TEXT_ICON) - { - curBlockWidth = m_iIconWidth; - } else { - while(curBlockLen < maxBlockLen) - { - // FIXME: this is ugly :/ - curBlockWidth += IRCVIEW_WCHARWIDTH(*p); - curBlockLen++; - p++; - } - } - //Check the length - curLineWidth += curBlockWidth; - - if(curLineWidth < maxWidth) - { - //debug("Block of %d pix and len %d with type %d",ptr->pBlocks[ptr->iBlockCount].block_width,ptr->pBlocks[ptr->iBlockCount].block_len,ptr->pChunks[curAttrBlock].type); - //Ok....proceed to next block - ptr->pBlocks[ptr->iBlockCount].block_len = curBlockLen; - ptr->pBlocks[ptr->iBlockCount].block_width = curBlockWidth; - curAttrBlock++; - ptr->iBlockCount++; - //Process the next block of data in the next loop or return if have no more blocks - if(curAttrBlock < ptr->uChunkCount) - { - ptr->pBlocks = (KviIrcViewWrappedBlock *)kvi_realloc(ptr->pBlocks,(ptr->iBlockCount + 1) * sizeof(KviIrcViewWrappedBlock)); - ptr->pBlocks[ptr->iBlockCount].block_start = ptr->pChunks[curAttrBlock].iTextStart; - ptr->pBlocks[ptr->iBlockCount].block_len = 0; - ptr->pBlocks[ptr->iBlockCount].block_width = 0; - ptr->pBlocks[ptr->iBlockCount].pChunk = &(ptr->pChunks[curAttrBlock]); - maxBlockLen = ptr->pBlocks[ptr->iBlockCount].pChunk->iTextLen; - } else return; - } else { - //Need word wrap - //First go back to an admissible width - while((curLineWidth >= maxWidth) && curBlockLen) - { - p--; - curBlockLen--; - curLineWidth-=IRCVIEW_WCHARWIDTH(*p); - } - //Now look for a space - while((*p != ' ') && curBlockLen) - { - p--; - curBlockLen--; - curLineWidth-=IRCVIEW_WCHARWIDTH(*p); - } - - //If we ran up to the beginning of the block.... - if(curBlockLen == 0) - { - if(ptr->pChunks[curAttrBlock].type == KVI_TEXT_ICON) - { - // This is an icon block: needs to be wrapped differently: - // The wrap block goes BEFORE the icon itself - ptr->pBlocks[ptr->iBlockCount].pChunk = 0; - ptr->pBlocks[ptr->iBlockCount].block_width = 0; - ptr->iBlockCount++; - ptr->pBlocks = (KviIrcViewWrappedBlock *)kvi_realloc(ptr->pBlocks,(ptr->iBlockCount + 1) * sizeof(KviIrcViewWrappedBlock)); - ptr->pBlocks[ptr->iBlockCount].block_start = p - unicode; - ptr->pBlocks[ptr->iBlockCount].block_len = 0; - ptr->pBlocks[ptr->iBlockCount].block_width = 0; - ptr->pBlocks[ptr->iBlockCount].pChunk = &(ptr->pChunks[curAttrBlock]); - goto wrap_line; - } - //Don't like it....forced wrap here... - //Go ahead up to the biggest possible string - if(maxBlockLen > 0) - { - do - { - curBlockLen++; - p++; - curLineWidth+=IRCVIEW_WCHARWIDTH(*p); - } while((curLineWidth < maxWidth) && (curBlockLen < maxBlockLen)); - //Now overrunned , go back 1 char - p--; - curBlockLen--; - } - //K...wrap - } else { - //found a space... - //include it in the first block - p++; - curBlockLen++; - } - - ptr->pBlocks[ptr->iBlockCount].block_len = curBlockLen; - ptr->pBlocks[ptr->iBlockCount].block_width = -1; // word wrap --> negative block_width - maxBlockLen-=curBlockLen; - ptr->iBlockCount++; - ptr->pBlocks = (KviIrcViewWrappedBlock *)kvi_realloc(ptr->pBlocks,(ptr->iBlockCount + 1) * sizeof(KviIrcViewWrappedBlock)); - ptr->pBlocks[ptr->iBlockCount].block_start = p - unicode; - ptr->pBlocks[ptr->iBlockCount].block_len = 0; - ptr->pBlocks[ptr->iBlockCount].block_width = 0; - ptr->pBlocks[ptr->iBlockCount].pChunk = 0; -wrap_line: - curLineWidth = 0; - ptr->uLineWraps++; - if(ptr->uLineWraps == 1) - { - if(KVI_OPTION_BOOL(KviOption_boolIrcViewWrapMargin))maxWidth-=m_iWrapMargin; - if(maxWidth<=0) return; - } - } - } - - ptr->iBlockCount++; -} - -//================= calculateSelectionBounds ==================// - -void KviIrcView::calculateSelectionBounds() -{ - if(m_mousePressPos.y() < m_mouseCurrentPos.y()) - { - m_iSelectionTop = m_mousePressPos.y(); - m_iSelectionBottom = m_mouseCurrentPos.y(); - m_iSelectionBegin = m_mousePressPos.x(); - m_iSelectionEnd = m_mouseCurrentPos.x(); - } else { - m_iSelectionTop = m_mouseCurrentPos.y(); - m_iSelectionBottom = m_mousePressPos.y(); - m_iSelectionBegin = m_mouseCurrentPos.x(); - m_iSelectionEnd = m_mousePressPos.x(); - } - - if(m_iSelectionBegin < m_iSelectionEnd) - { - m_iSelectionLeft = m_iSelectionBegin; - m_iSelectionRight = m_iSelectionEnd; - } else { - m_iSelectionLeft = m_iSelectionEnd; - m_iSelectionRight = m_iSelectionBegin; - } -} - - -//=============== checkSelectionBlock ===============// - -bool KviIrcView::checkSelectionBlock(KviIrcViewLine * line,int left,int bottom,int bufIndex) -{ - // - // Yahoo!!!! - // - const QChar * unicode = line->szText.unicode(); - register const QChar * p = unicode + line->pBlocks[bufIndex].block_start; - - int top = bottom-m_iFontLineSpacing; - int right = ((line->pBlocks[bufIndex].block_width >= 0) ? \ - left+line->pBlocks[bufIndex].block_width : width()-(KVI_IRCVIEW_HORIZONTAL_BORDER + m_pScrollBar->width())); - if(bottom < m_iSelectionTop)return false; //The selection starts under this line - if(top > m_iSelectionBottom)return false; //The selection ends over this line - if((top >= m_iSelectionTop)&&(bottom < m_iSelectionBottom)) - { - //Whole line selected - if(line->pBlocks[bufIndex].pChunk && line->pBlocks[bufIndex].pChunk->type == KVI_TEXT_ICON) - m_pWrappedBlockSelectionInfo->selection_type = KVI_IRCVIEW_BLOCK_SELECTION_ICON; - else - m_pWrappedBlockSelectionInfo->selection_type = KVI_IRCVIEW_BLOCK_SELECTION_TOTAL; - return true; - } - if((top < m_iSelectionTop) && (bottom >= m_iSelectionBottom)) - { - //Selection begins and ends in this line - if(right < m_iSelectionLeft)return false; - if(left > m_iSelectionRight)return false; - if(line->pBlocks[bufIndex].pChunk && line->pBlocks[bufIndex].pChunk->type == KVI_TEXT_ICON) - { - m_pWrappedBlockSelectionInfo->selection_type = KVI_IRCVIEW_BLOCK_SELECTION_ICON; - return true; - } - if((right <= m_iSelectionRight) && (left > m_iSelectionLeft)) - { - //Whole line selected - m_pWrappedBlockSelectionInfo->selection_type = KVI_IRCVIEW_BLOCK_SELECTION_TOTAL; - return true; - } - if((right > m_iSelectionRight) && (left <= m_iSelectionLeft)) - { - //Selection ends and begins in THIS BLOCK! - m_pWrappedBlockSelectionInfo->selection_type = KVI_IRCVIEW_BLOCK_SELECTION_CENTRAL; - m_pWrappedBlockSelectionInfo->part_1_length = 0; - m_pWrappedBlockSelectionInfo->part_1_width = 0; - while((left <= m_iSelectionLeft) && (m_pWrappedBlockSelectionInfo->part_1_length < line->pBlocks[bufIndex].block_len)){ - int www = IRCVIEW_WCHARWIDTH(*p); - left += www; - m_pWrappedBlockSelectionInfo->part_1_width += www; - p++; - m_pWrappedBlockSelectionInfo->part_1_length++; - } - //Need to include the first character - if(m_pWrappedBlockSelectionInfo->part_1_length > 0) - { - m_pWrappedBlockSelectionInfo->part_1_length--; - p--; - int www = IRCVIEW_WCHARWIDTH(*p); - left -= www; - m_pWrappedBlockSelectionInfo->part_1_width -= www; - } - int maxLenNow = line->pBlocks[bufIndex].block_len-m_pWrappedBlockSelectionInfo->part_1_length; - int maxWidthNow = line->pBlocks[bufIndex].block_width-m_pWrappedBlockSelectionInfo->part_1_width; - m_pWrappedBlockSelectionInfo->part_2_length = 0; - m_pWrappedBlockSelectionInfo->part_2_width = 0; - while((left < m_iSelectionRight) && (m_pWrappedBlockSelectionInfo->part_2_length < maxLenNow)) - { - int www = IRCVIEW_WCHARWIDTH(*p); - left += www; - m_pWrappedBlockSelectionInfo->part_2_width += www; - p++; - m_pWrappedBlockSelectionInfo->part_2_length++; - } - m_pWrappedBlockSelectionInfo->part_3_length = maxLenNow-m_pWrappedBlockSelectionInfo->part_2_length; - m_pWrappedBlockSelectionInfo->part_3_width = maxWidthNow-m_pWrappedBlockSelectionInfo->part_2_width; - return true; - } - if(right > m_iSelectionRight) - { - //Selection ends in THIS BLOCK! - m_pWrappedBlockSelectionInfo->selection_type = KVI_IRCVIEW_BLOCK_SELECTION_LEFT; - m_pWrappedBlockSelectionInfo->part_1_length = 0; - m_pWrappedBlockSelectionInfo->part_1_width = 0; - while((left < m_iSelectionRight) && (m_pWrappedBlockSelectionInfo->part_1_length < line->pBlocks[bufIndex].block_len)) - { - int www = IRCVIEW_WCHARWIDTH(*p); - left += www; - m_pWrappedBlockSelectionInfo->part_1_width += www; - p++; - m_pWrappedBlockSelectionInfo->part_1_length++; - } - m_pWrappedBlockSelectionInfo->part_2_length = line->pBlocks[bufIndex].block_len-m_pWrappedBlockSelectionInfo->part_1_length; - m_pWrappedBlockSelectionInfo->part_2_width = line->pBlocks[bufIndex].block_width-m_pWrappedBlockSelectionInfo->part_1_width; - //debug("%d",m_pWrappedBlockSelectionInfo->part_2_width); - return true; - } - //Selection begins in THIS BLOCK! - m_pWrappedBlockSelectionInfo->selection_type = KVI_IRCVIEW_BLOCK_SELECTION_RIGHT; - m_pWrappedBlockSelectionInfo->part_1_length = 0; - m_pWrappedBlockSelectionInfo->part_1_width = 0; - while((left <= m_iSelectionLeft) && (m_pWrappedBlockSelectionInfo->part_1_length < line->pBlocks[bufIndex].block_len)) - { - int www = IRCVIEW_WCHARWIDTH(*p); - left += www; - m_pWrappedBlockSelectionInfo->part_1_width += www; - p++; - m_pWrappedBlockSelectionInfo->part_1_length++; - } - //Need to include the first character - if(m_pWrappedBlockSelectionInfo->part_1_length > 0) - { - m_pWrappedBlockSelectionInfo->part_1_length--; - p--; - int www = IRCVIEW_WCHARWIDTH(*p); - left -= www; - m_pWrappedBlockSelectionInfo->part_1_width -= www; - } - m_pWrappedBlockSelectionInfo->part_2_length = line->pBlocks[bufIndex].block_len-m_pWrappedBlockSelectionInfo->part_1_length; - m_pWrappedBlockSelectionInfo->part_2_width = line->pBlocks[bufIndex].block_width-m_pWrappedBlockSelectionInfo->part_1_width; - return true; - } - - if(top < m_iSelectionTop) - { - //Selection starts in this line - if(right < m_iSelectionBegin)return false; - if(line->pBlocks[bufIndex].pChunk && line->pBlocks[bufIndex].pChunk->type == KVI_TEXT_ICON) - { - m_pWrappedBlockSelectionInfo->selection_type = KVI_IRCVIEW_BLOCK_SELECTION_ICON; - return true; - } - if(left > m_iSelectionBegin) - { - //Whole block selected - m_pWrappedBlockSelectionInfo->selection_type = KVI_IRCVIEW_BLOCK_SELECTION_TOTAL; - return true; - } - //Selection begins in THIS BLOCK! - m_pWrappedBlockSelectionInfo->selection_type = KVI_IRCVIEW_BLOCK_SELECTION_RIGHT; - m_pWrappedBlockSelectionInfo->part_1_length = 0; - m_pWrappedBlockSelectionInfo->part_1_width = 0; - while((left <= m_iSelectionBegin) && (m_pWrappedBlockSelectionInfo->part_1_length < line->pBlocks[bufIndex].block_len)) - { - int www = IRCVIEW_WCHARWIDTH(*p); - left += www; - m_pWrappedBlockSelectionInfo->part_1_width += www; - p++; - m_pWrappedBlockSelectionInfo->part_1_length++; - } - //Need to include the first character - if(m_pWrappedBlockSelectionInfo->part_1_length > 0) - { - m_pWrappedBlockSelectionInfo->part_1_length--; - p--; - int www = IRCVIEW_WCHARWIDTH(*p); - left -= www; - m_pWrappedBlockSelectionInfo->part_1_width -= www; - } - m_pWrappedBlockSelectionInfo->part_2_length = line->pBlocks[bufIndex].block_len-m_pWrappedBlockSelectionInfo->part_1_length; - m_pWrappedBlockSelectionInfo->part_2_width = line->pBlocks[bufIndex].block_width-m_pWrappedBlockSelectionInfo->part_1_width; - return true; - } - //Selection ends in this line - if(left > m_iSelectionEnd)return false; - if(line->pBlocks[bufIndex].pChunk && line->pBlocks[bufIndex].pChunk->type == KVI_TEXT_ICON) - { - m_pWrappedBlockSelectionInfo->selection_type = KVI_IRCVIEW_BLOCK_SELECTION_ICON; - return true; - } - if(right < m_iSelectionEnd) - { - //Whole block selected - m_pWrappedBlockSelectionInfo->selection_type = KVI_IRCVIEW_BLOCK_SELECTION_TOTAL; - return true; - } - //Selection ends in THIS BLOCK! - m_pWrappedBlockSelectionInfo->selection_type = KVI_IRCVIEW_BLOCK_SELECTION_LEFT; - m_pWrappedBlockSelectionInfo->part_1_length = 0; - m_pWrappedBlockSelectionInfo->part_1_width = 0; - while((left < m_iSelectionEnd) && (m_pWrappedBlockSelectionInfo->part_1_length < line->pBlocks[bufIndex].block_len)) - { - int www = IRCVIEW_WCHARWIDTH(*p); - left += www; - m_pWrappedBlockSelectionInfo->part_1_width += www; - p++; - m_pWrappedBlockSelectionInfo->part_1_length++; - } - m_pWrappedBlockSelectionInfo->part_2_length = line->pBlocks[bufIndex].block_len-m_pWrappedBlockSelectionInfo->part_1_length; - m_pWrappedBlockSelectionInfo->part_2_width = line->pBlocks[bufIndex].block_width-m_pWrappedBlockSelectionInfo->part_1_width; - return true; -} - -//============ recalcFontVariables ==============// - -void KviIrcView::recalcFontVariables(const QFontMetrics &fm,const QFontInfo &fi) -{ - // FIXME: #warning "OPTIMIZE THIS: GLOBAL VARIABLES" - if(m_pFm)delete m_pFm; - m_pFm = new QFontMetrics(fm); - m_iFontLineSpacing = m_pFm->lineSpacing(); - if(m_iFontLineSpacing < KVI_IRCVIEW_PIXMAP_SIZE && KVI_OPTION_BOOL(KviOption_boolIrcViewShowImages)) - { - m_iFontLineSpacing = KVI_IRCVIEW_PIXMAP_SIZE; - } - m_iFontDescent =m_pFm->descent(); - m_iFontLineWidth =m_pFm->lineWidth(); - // cache the first 256 characters - for(unsigned short i=0;i<256;i++) - { - m_iFontCharacterWidth[i]=m_pFm->width(QChar(i)); - } - if(m_iFontLineWidth==0)m_iFontLineWidth=1; - m_iWrapMargin = m_pFm->width("wwww"); - //for(int i=0;i<256;i++)m_iFontCharacterWidth[i]=fm.width((char)i); - m_iMinimumPaintWidth = (m_pFm->width('w') << 1)+m_iWrapMargin; - m_iRelativePixmapY = (m_iFontLineSpacing + KVI_IRCVIEW_PIXMAP_SIZE) >> 1; - m_iIconWidth = m_pFm->width("w"); - - if(fi.fixedPitch() && (m_iIconWidth > 0)) - { - while(m_iIconWidth < 18)m_iIconWidth += m_iIconWidth; - m_iIconSideSpacing = (m_iIconWidth - 16) >> 1; - } else { - m_iIconWidth = 18; - m_iIconSideSpacing = 1; - } -} - -//================ resizeEvent ===============// - -void KviIrcView::resizeEvent(QResizeEvent *) -{ - int iScr = m_pScrollBar->sizeHint().width(); - int iLeft = width()-iScr; - m_pToolsButton->setGeometry(iLeft,0,iScr,iScr); - m_pScrollBar->setGeometry(iLeft,iScr,iScr,height() - iScr); - - if(m_pToolWidget) - { - if( ((m_pToolWidget->x() + m_pToolWidget->width()) > (iLeft - 1)) || - ((m_pToolWidget->y() + m_pToolWidget->height()) > (height() - 1))) - { - m_pToolWidget->move(10,10); - } - } -} - -QSize KviIrcView::sizeHint() const -{ - QSize ret(KVI_IRCVIEW_SIZEHINT_WIDTH,KVI_IRCVIEW_SIZEHINT_HEIGHT); - return ret; -} - -void KviIrcView::showToolsPopup() -{ - if(!m_pToolsPopup) - m_pToolsPopup = new KviTalPopupMenu(this); - - m_pToolsPopup->clear(); - - if(m_pToolWidget) - m_pToolsPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SEARCH)),__tr2qs("Hide Find Window"),this,SLOT(toggleToolWidget())); - else - m_pToolsPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SEARCH)),__tr2qs("Show Find Window"),this,SLOT(toggleToolWidget())); - m_pToolsPopup->insertSeparator(); - m_pToolsPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_PLUS)),__tr2qs("Zoom In"),this,SLOT(increaseFontSize())); - m_pToolsPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MINUS)),__tr2qs("Zoom Out"),this,SLOT(decreaseFontSize())); - m_pToolsPopup->insertItem(__tr2qs("Choose Temporary Font..."),this,SLOT(chooseFont())); - m_pToolsPopup->insertItem(__tr2qs("Choose Temporary Background..."),this,SLOT(chooseBackground())); - int id = m_pToolsPopup->insertItem(__tr2qs("Reset Temporary Background"),this,SLOT(resetBackground())); - m_pToolsPopup->setItemEnabled(id,m_pPrivateBackgroundPixmap != 0); - m_pToolsPopup->insertSeparator(); - m_pToolsPopup->insertItem(__tr2qs("Clear Buffer"),this,SLOT(clearBuffer())); - - QSize s = m_pToolsPopup->sizeHint(); - - m_pToolsPopup->popup(m_pToolsButton->mapToGlobal(QPoint(m_pToolsButton->width() - s.width(),m_pToolsButton->height()))); -} - -void KviIrcView::increaseFontSize() -{ - QFont f = font(); - f.setPointSize(f.pointSize() + 1); - setFont(f); -} - -void KviIrcView::decreaseFontSize() -{ - QFont f = font(); - int p = f.pointSize(); - if(p > 2)p--; - f.setPointSize(p); - setFont(f); -} - -void KviIrcView::chooseFont() -{ - bool bOk; - QFont f = QFontDialog::getFont(&bOk,font(),this); - if(!bOk)return; - setFont(f); -} - -void KviIrcView::chooseBackground() -{ - QString f; - if(!KviFileDialog::askForOpenFileName(f,__tr2qs("Choose the background image...")))return; - if(f.isEmpty())return; - QPixmap p(f); - if(p.isNull()) - { - QMessageBox::information(this,__tr2qs("Invalid image"),__tr2qs("Failed to load the selected image"),__tr2qs("Ok")); - return; - } - setPrivateBackgroundPixmap(p); -} - -void KviIrcView::resetBackground() -{ - setPrivateBackgroundPixmap(0); -} - -void KviIrcView::toggleToolWidget() -{ - if(m_pToolWidget) - { - delete m_pToolWidget; - m_pToolWidget = 0; - m_pCursorLine = 0; - repaint(); - - } else { - m_pToolWidget = new KviIrcViewToolWidget(this); - int w = m_pToolWidget->sizeHint().width(); - m_pToolWidget->move(width() - (w + 40),10); - m_pToolWidget->show(); - } -} - - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// The IrcView : find -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - -void KviIrcView::setCursorLine(KviIrcViewLine * l) -{ - m_pCursorLine = l; - if(m_pCursorLine == m_pCurLine) - { - - repaint(); - - return; - } - int sc = m_pScrollBar->value(); - l = m_pCurLine; - if(m_pCursorLine->uIndex > m_pCurLine->uIndex) - { - // The cursor line is below the current line - while(l && (l != m_pCursorLine)) - { - l = l->pNext; - sc++; - } - if(!l)return; - if(sc != m_pScrollBar->value()) - { - m_pCurLine = m_pCursorLine; - m_iLastScrollBarValue = sc; - m_pScrollBar->setValue(sc); - } else { - repaint(); - } - } else { - // The cursor line is over the current line - // Here we're in trouble :D - int curBottomCoord = height() - KVI_IRCVIEW_VERTICAL_BORDER; - int maxLineWidth = width(); - if(KVI_OPTION_BOOL(KviOption_boolIrcViewShowImages))maxLineWidth -= KVI_IRCVIEW_PIXMAP_SEPARATOR_AND_DOUBLEBORDER_WIDTH; - //Make sure that we have enough space to paint something... - if(maxLineWidth < m_iMinimumPaintWidth)return; // ugh - //And loop thru lines until we not run over the upper bound of the view - KviIrcViewLine * curLine = m_pCurLine; - while(l) - { - if(maxLineWidth != l->iMaxLineWidth)calculateLineWraps(l,maxLineWidth); - curBottomCoord -= (l->uLineWraps + 1) * m_iFontLineSpacing; - while(curLine && (curBottomCoord < KVI_IRCVIEW_VERTICAL_BORDER)) - { - if(curLine->iMaxLineWidth != maxLineWidth)calculateLineWraps(curLine,maxLineWidth); - curBottomCoord += ((curLine->uLineWraps + 1) * m_iFontLineSpacing) + m_iFontDescent; - curLine = curLine->pPrev; - sc--; - } - if(l == m_pCursorLine)break; - curBottomCoord -= m_iFontDescent; - l = l->pPrev; - } - if(!curLine)return; - if(sc != m_pScrollBar->value()) - { - m_pCurLine = curLine; - m_iLastScrollBarValue = sc; - m_pScrollBar->setValue(sc); - } else { - repaint(); - } - } -} - -void KviIrcView::findNext(const QString& szText,bool bCaseS,bool bRegExp,bool bExtended) -{ - KviIrcViewLine * l = m_pCursorLine; - if(!l)l = m_pCurLine; - if(l) - { - l = l->pNext; - if(!l)l = m_pFirstLine; - KviIrcViewLine * start = l; - - int idx = -1; - - do{ - if(m_pToolWidget) - { - if(!(m_pToolWidget->messageEnabled(l->iMsgType)))goto do_pNext; - } - - if(bRegExp) - { - QRegExp re(szText,bCaseS,!bExtended); -#if QT_VERSION >= 300 - idx = re.search(l->szText,0); -#else - idx = re.find(l->szText,0); -#endif - } else { - QString tmp = l->szText; - idx = tmp.find(szText,0,bCaseS); - } - - if(idx != -1) - { - setCursorLine(l); - if(m_pToolWidget) - { - QString tmp; - KviQString::sprintf(tmp,__tr2qs("Pos %d"),idx); - m_pToolWidget->setFindResult(tmp); - } - return; - } - -do_pNext: - - l = l->pNext; - if(!l)l = m_pFirstLine; - - } while(l != start); - } - m_pCursorLine = 0; - repaint(); - if(m_pToolWidget)m_pToolWidget->setFindResult(__tr2qs("Not found")); -} - - -void KviIrcView::findPrev(const QString& szText,bool bCaseS,bool bRegExp,bool bExtended) -{ - KviIrcViewLine * l = m_pCursorLine; - if(!l)l = m_pCurLine; - if(l) - { - l = l->pPrev; - if(!l)l = m_pLastLine; - KviIrcViewLine * start = l; - - int idx = -1; - - do{ - - if(m_pToolWidget) - { - if(!(m_pToolWidget->messageEnabled(l->iMsgType)))goto do_pPrev; - } - - if(bRegExp) - { - QRegExp re(szText,bCaseS,!bExtended); -#if QT_VERSION >= 300 - idx = re.search(l->szText,0); -#else - idx = re.find(l->szText,0); -#endif - } else { - QString tmp = l->szText; - idx = tmp.find(szText,0,bCaseS);; - } - - if(idx != -1) - { - setCursorLine(l); - if(m_pToolWidget) - { - QString tmp; - KviQString::sprintf(tmp,__tr2qs("Pos %d"),idx); - m_pToolWidget->setFindResult(tmp); - } - return; - } - -do_pPrev: - - l = l->pPrev; - if(!l)l = m_pLastLine; - - } while(l != start); - } - m_pCursorLine = 0; - - repaint(); - if(m_pToolWidget)m_pToolWidget->setFindResult(__tr2qs("Not found")); -} - -/* -void KviIrcView::findClosestPositionInText(int xCursorPos,int yCursorPos,KviIrcViewPositionInText &pos) -{ - pos.pLine = getVisibleLineAt(xCursorPos,uCursorPos); -} -*/ - - -KviIrcViewLine * KviIrcView::getVisibleLineAt(int xPos,int yPos) -{ - KviIrcViewLine * l = m_pCurLine; - int iTop = height() + m_iFontDescent - KVI_IRCVIEW_VERTICAL_BORDER; - - while(iTop > yPos) - { - if(l) - { - iTop -= ((l->uLineWraps + 1) * m_iFontLineSpacing) + m_iFontDescent; - if(iTop <= yPos)return l; - l = l->pPrev; - } else return 0; - } - return 0; -} - -KviIrcViewWrappedBlock * KviIrcView::getLinkUnderMouse(int xPos,int yPos,QRect * pRect,QString * linkCmd,QString * linkText) -{ - KviIrcViewLine * l = m_pCurLine; - int iTop = height() + m_iFontDescent - KVI_IRCVIEW_VERTICAL_BORDER; - - while(iTop > yPos) - { - if(!l)return 0; - - iTop -= ((l->uLineWraps + 1) * m_iFontLineSpacing) + m_iFontDescent; - - if(iTop > yPos) - { - // still below the mouse - l = l->pPrev; - continue; - } - - // got the right KviIrcViewLine - int iLeft = KVI_IRCVIEW_HORIZONTAL_BORDER; - if(KVI_OPTION_BOOL(KviOption_boolIrcViewShowImages))iLeft += KVI_IRCVIEW_PIXMAP_AND_SEPARATOR; - int firstRowTop = iTop; - int i = 0; - - for(;;) - { - if(yPos <= iTop + m_iFontLineSpacing) - { - // exactly this row of this line - if(iTop != firstRowTop) - if(KVI_OPTION_BOOL(KviOption_boolIrcViewWrapMargin))iLeft+=m_iWrapMargin; - if(xPos < iLeft)return 0; - int iBlockWidth = 0; - int iLastEscapeBlock = -1; - int iLastEscapeBlockTop = -1; - for(;;) - { - int iLastLeft = iLeft; - if(i >= l->iBlockCount)return 0; - if(l->pBlocks[i].pChunk) - if(l->pBlocks[i].pChunk->type == KVI_TEXT_ESCAPE) - { - iLastEscapeBlock=i; - iLastEscapeBlockTop=iTop; - } - if(l->pBlocks[i].pChunk) - if(l->pBlocks[i].pChunk->type == KVI_TEXT_UNESCAPE) iLastEscapeBlock=-1; - if(l->pBlocks[i].block_width > 0) - { - iBlockWidth = l->pBlocks[i].block_width; - iLeft += iBlockWidth; - } else { - if(i < (l->iBlockCount - 1)) - { - // There is another block... - // Check if it is a wrap... - if(l->pBlocks[i+1].pChunk == 0) - { - iBlockWidth = width() - iLastLeft; - iLeft = width(); - } - // else simply a zero characters block - } - } - if(xPos < iLeft) - { - // Got it! - // link ? - bool bHadWordWraps = false; - while(l->pBlocks[i].pChunk == 0) - { - // word wrap ? - if(i >= 0) - { - i--; - bHadWordWraps = true; - } else return 0; // all word wraps ?!!! - } - if(iLastEscapeBlock != -1) - { - int iLeftBorder=iLeft; - int k; - for(k = i ; k>=iLastEscapeBlock ; k--) - iLeftBorder-=l->pBlocks[k].block_width; - int iRightBorder=0; - unsigned int uLineWraps = 0; - for(k = iLastEscapeBlock;; k++) - { - if(l->pBlocks[k].pChunk) - if(l->pBlocks[k].pChunk->type != KVI_TEXT_UNESCAPE) - iRightBorder+=l->pBlocks[k].block_width; - else - break; - else - { - uLineWraps++; - bHadWordWraps=1; - } - } - if(pRect) - { - *pRect = QRect(iLeftBorder, - bHadWordWraps ? iLastEscapeBlockTop : iTop, - iRightBorder, - ((uLineWraps + 1) * m_iFontLineSpacing) + m_iFontDescent); - } - if(linkCmd) - { - linkCmd->setUnicodeCodes(l->pBlocks[iLastEscapeBlock].pChunk->szPayload,kvi_wstrlen(l->pBlocks[iLastEscapeBlock].pChunk->szPayload)); - linkCmd->stripWhiteSpace(); - if((*linkCmd)=="nc") (*linkCmd)="n"; - } - if(linkText) - { - QString szLink; - int iEndOfLInk = iLastEscapeBlock; - while(1) - { - if(l->pBlocks[iEndOfLInk].pChunk) - if(l->pBlocks[iEndOfLInk].pChunk->type != KVI_TEXT_UNESCAPE) - { - switch(l->pBlocks[iEndOfLInk].pChunk->type) - { - case KVI_TEXT_BOLD: - case KVI_TEXT_UNDERLINE: - case KVI_TEXT_REVERSE: - case KVI_TEXT_RESET: - szLink.append(QChar(l->pBlocks[iEndOfLInk].pChunk->type)); - break; - case KVI_TEXT_COLOR: - szLink.append(QChar(KVI_TEXT_COLOR)); - if(l->pBlocks[iEndOfLInk].pChunk->colors.fore != KVI_NOCHANGE) - { - szLink.append(QString("%1").arg((int)(l->pBlocks[iEndOfLInk].pChunk->colors.fore))); - } - if(l->pBlocks[iEndOfLInk].pChunk->colors.back != KVI_NOCHANGE) - { - szLink.append(QChar(',')); - szLink.append(QString("%1").arg((int)(l->pBlocks[iEndOfLInk].pChunk->colors.back))); - } - break; - } - szLink.append(l->szText.mid(l->pBlocks[iEndOfLInk].block_start,l->pBlocks[iEndOfLInk].block_len)); - } else - break; - iEndOfLInk++; - - } - *linkText=szLink; - // grab the rest of the link visible string - // Continue while we do not find a non word wrap block block - for(int bufIndex = (i + 1);bufIndex < l->iBlockCount;bufIndex++) - { - if(l->pBlocks[bufIndex].pChunk ) break; //finished : not a word wrap - else { - linkText->append(l->szText.mid(l->pBlocks[bufIndex].block_start,l->pBlocks[bufIndex].block_len)); - } - } - } - return &(l->pBlocks[iLastEscapeBlock]); - } - if(l->pBlocks[i].pChunk->type == KVI_TEXT_ICON) - { - if(pRect) - { - *pRect = QRect(iLastLeft, - bHadWordWraps ? firstRowTop : iTop, - iBlockWidth, - ((l->uLineWraps + 1) * m_iFontLineSpacing) + m_iFontDescent); - } - if(linkCmd) - { - *linkCmd = "[!txt]"; - QString tmp; - tmp.setUnicodeCodes(l->pBlocks[i].pChunk->szPayload,kvi_wstrlen(l->pBlocks[i].pChunk->szPayload)); - linkCmd->append(tmp); - linkCmd->stripWhiteSpace(); - } - if(linkText) - { - *linkText = ""; - } - return &(l->pBlocks[i]); - } - return 0; - } - i++; - } - } else { - // run until a word wrap block - i++; //at least one block! - while(i < l->iBlockCount) - { - // still ok to run right - if(l->pBlocks[i].pChunk == 0) - { -// i++; - break; - } else i++; - } - if(i >= l->iBlockCount)return 0; - iTop += m_iFontLineSpacing; - } - } - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Mouse handling routines -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/* - @doc: escape_sequences - @title: - Escape sequences and clickable links - @type: - generic - @body: - The KVIrc view widgets support clickable links.[br] - The links can be created using special escape sequences in the text - passed to the [cmd]echo[/cmd] command.[br] - KVIrc uses some escape sequences in the text "echoed" internally.[br] - The simplest way to explain it is to use an example:[br] - [example] - [cmd]echo[/cmd] This is a [fnc]$cr[/fnc]![!dbl][cmd]echo[/cmd] You have clicked it![fnc]$cr[/fnc]\clickable link$cr ! - [/example] - The example above will show the following text line: "This is a clickable link". - If you move the mouse over the words "clickable link", you will see the text highlighted.[br] - Once you double-click one of that words, the command "[cmd]echo[/cmd] You have clicked it!" will be executed.[br] - The format looks complex ?... it is not...just read on.[br] - - <cr>!<link_type><cr><visible text><cr> - <cr>!<escape_command><cr><visible text><cr> - - [big]Escape format[/big] - The whole escape sequence format is the following:[br] - [b]<cr>!<escape_command><cr><visible text><cr>[/b][br] - <cr> is the carriage return character. You can obtain it by using the [fnc]]$cr[/fnc] function.[br] - <visible text> is the text that will appear as "link" when you move the mouse over it.[br] - <escape_command> is the description of the actions to be taken when the user interacts with the link.[br] - <escape_command> has the two following syntactic forms:[br] - [b]<escape_command> ::= <user_defined_commands>[/b][br] - [b]<escape_command> ::= <builtin_link_description>[/b] - - [big]User defined links[/big][br] - The user defined links allow you to perform arbitrary commands when the user interacts with the link.[br] - The commands are specified in the <escape_command> part by using the following syntax:[br] - <escape_command> ::= <user_defined_commands>[br] - <user_defined_commands> ::= <command_rule> [<user_defined_commands>][br] - <command_rule> ::= <action_tag><command>[br] - <action_tag> ::= "[!" <action> "]"[br] - <action> ::= "rbt" | "mbt" | "dbl" | "txt"[br] - <command> ::= any kvirc command (see notes below)[br] - - [big]Builtin links[/big][br] - The builtin links have builtin actions performed when the user interact with the link.[br] - These links are used internally in KVIrc , but you can use them too.[br] - The <escape_command> is a single letter this time: it defines the type of the link.[br] - Currently KVIrc uses six types of builtin links : 'n' for nickname links, 'u' for url links, - 'c' for channel links, 'h' for hostname links, 'm' for mask links and 's' for server links.[br] - Theoretically you can also use your own link types: just use any other letter or digit (you can't use ']' and <cr>), - but probably you will prefer a completely user defined link in that case anyway.[br] - Once the user interacts with the link , kvirc executes the predefined events:[br] - On right-click the event OnBuiltinLinkRightClicked is triggered: the first parameter is the link type, - the second parameter is the <visible text> (as a single parameter!!!)[br] - On middle-click the event OnBuiltinLinkMiddleClicked is triggered: the parameters are similar to the previous one.[br] - In the same way you have OnBuiltinLinkDoubleClicked.[br] - - [big]A shortcut[/big] - You may have a look at the [fnc]$fmtlink[/fnc] function: it does automatically some of the job explained - in this document.[br] - -*/ - -// FIXME: #warning "Finish the doc above!! Maybe some examples ?!" - - -void KviIrcView::mouseDoubleClickEvent(QMouseEvent *e) -{ - QString cmd; - QString linkCmd; - QString linkText; - - if(m_iMouseTimer) - { - killTimer(m_iMouseTimer); - m_iMouseTimer=0; - delete m_pLastEvent; - m_pLastEvent = 0; - } - - getLinkUnderMouse(e->pos().x(),e->pos().y(),0,&linkCmd,&linkText); - - if(linkCmd.isEmpty()) - { - KVS_TRIGGER_EVENT_0(KviEvent_OnTextViewDoubleClicked,m_pKviWindow); - return; - } - - QString szCmd(linkCmd); - szCmd.remove(0,1); - - KviKvsVariantList * pParams = new KviKvsVariantList(); - if(!szCmd.isEmpty()) pParams->append(szCmd); - else pParams->append(linkText); - pParams->append(linkText); - pParams->append(szCmd); - - - switch(linkCmd[0].unicode()) - { - case 'n': - { - bool bTrigger = false; - switch(m_pKviWindow->type()) - { - case KVI_WINDOW_TYPE_CHANNEL: - if(((KviChannel *)m_pKviWindow)->isOn(linkText)) - { - KVS_TRIGGER_EVENT(KviEvent_OnChannelNickDefaultActionRequest,m_pKviWindow,pParams); - } else bTrigger = true; - break; - case KVI_WINDOW_TYPE_QUERY: - if(KviQString::equalCI(((KviQuery *)m_pKviWindow)->windowName(),linkText)) - { - KVS_TRIGGER_EVENT(KviEvent_OnQueryNickDefaultActionRequest,m_pKviWindow,pParams); - } else bTrigger = true; - break; - default: - bTrigger = true; - break; - } - if(bTrigger) - { - if(console()) - { - KVS_TRIGGER_EVENT(KviEvent_OnNickLinkDefaultActionRequest,m_pKviWindow,pParams); - } - } - } - break; - case 'm': - if((linkCmd.length() > 2) && (m_pKviWindow->type() == KVI_WINDOW_TYPE_CHANNEL)) - { - if(((KviChannel *)m_pKviWindow)->isMeOp()) - { - QChar plmn = linkCmd[1]; - if((plmn.unicode() == '+') || (plmn.unicode() == '-')) - { - QString target(m_pKviWindow->windowName()); - target.replace("\\","\\\\"); - target.replace("\"","\\\""); - target.replace(";","\\;"); - target.replace("$","\\$"); - target.replace("%","\\%"); - QChar flag = linkCmd[2]; - switch(flag.unicode()) - { - case 'o': - case 'v': - // We can do nothing here... - break; - - case 'b': - case 'I': - case 'e': - case 'k': - KviQString::sprintf(cmd,"mode %Q %c%c $0",&target,plmn.latin1(),flag.latin1()); - break; - default: - KviQString::sprintf(cmd,"mode %Q %c%c",&target,plmn.latin1(),flag.latin1()); - break; - } - } - } - } - break; - case 'h': - m_pKviWindow->output(KVI_OUT_HOSTLOOKUP,__tr2qs("Looking up host %Q..."),&linkText); - cmd = "host -a $0"; - break; - case 'u': - { - QString urlText; - if(!szCmd.isEmpty()) urlText=szCmd; - else urlText=linkText; - if( - !KviQString::cmpCIN(urlText,"irc://",6) || - !KviQString::cmpCIN(urlText,"irc6://",7) || - !KviQString::cmpCIN(urlText,"ircs://",7) || - !KviQString::cmpCIN(urlText,"ircs6://",8) - ) - { - KviIrcUrl::run(urlText,KviIrcUrl::TryCurrentContext | KviIrcUrl::DoNotPartChans, console()); - } else { - cmd = "openurl $0"; - } - } - break; - case 'c': - { - if(console() && console()->connection()) - { - QString szChan=linkText; - if(szCmd.length()>0) szChan=szCmd; - if(KviChannel * c = console()->connection()->findChannel(szChan)) - { - // FIXME: #warning "Is this ok ?" - c->raise(); - c->setFocus(); - } else { - cmd = QString("join %1").arg(szChan); - } - } - } - break; - case 's': - cmd = "motd $0"; - break; - default: - { - getLinkEscapeCommand(cmd,linkCmd,"[!dbl]"); - if(cmd.isEmpty()) - { - KVS_TRIGGER_EVENT_0(KviEvent_OnTextViewDoubleClicked,m_pKviWindow); - } - } - break; - } - if(!cmd.isEmpty()) - { - KviKvsScript::run(cmd,m_pKviWindow,pParams); - } - delete pParams; -} - -void KviIrcView::mousePressEvent(QMouseEvent *e) -{ - if(m_pKviWindow->input()) m_pKviWindow->input()->setFocus(); - - if(e->button() & Qt::LeftButton) - { - // This is the beginning of a selection... - // We just set the mouse to be "down" and - // await mouseMove events... - - if(m_pToolWidget) - { - m_pCursorLine = getVisibleLineAt(e->pos().x(),e->pos().y()); - repaint(); - } - - m_mousePressPos = e->pos(); - m_mouseCurrentPos = e->pos(); - - m_bMouseIsDown = true; - - m_bShiftPressed = (e->state() & Qt::ShiftButton); - - calculateSelectionBounds(); - } - - if(e->button() & Qt::LeftButton) - { - if(m_iMouseTimer) - { - killTimer(m_iMouseTimer); - m_iMouseTimer=0; - delete m_pLastEvent; - m_pLastEvent = 0; - } else { - m_iMouseTimer = startTimer(QApplication::doubleClickInterval()); - m_pLastEvent = new QMouseEvent(*e); - } - } else { - mouseRealPressEvent(e); - } -} - -void KviIrcView::mouseRealPressEvent(QMouseEvent *e) -{ - QString linkCmd; - QString linkText; - getLinkUnderMouse(e->pos().x(),e->pos().y(),0,&linkCmd,&linkText); - - QString szCmd(linkCmd); - szCmd.remove(0,1); - - KviKvsVariantList * pParams = new KviKvsVariantList(); - if(!szCmd.isEmpty()) pParams->append(szCmd); - else pParams->append(linkText); - pParams->append(linkText); - pParams->append(szCmd); - - - if(!(e->state() & Qt::ControlButton))//(e->button() & Qt::RightButton) && ( - { - if(!linkCmd.isEmpty()) - { - switch(linkCmd[0].unicode()) - { - case 'n': - { - bool bTrigger = false; - switch(m_pKviWindow->type()) - { - case KVI_WINDOW_TYPE_CHANNEL: - if(((KviChannel *)m_pKviWindow)->isOn(linkText)) - { - if(e->button() & Qt::RightButton) - KVS_TRIGGER_EVENT(KviEvent_OnChannelNickPopupRequest,m_pKviWindow,pParams); - if(e->button() & Qt::LeftButton) { - KVS_TRIGGER_EVENT(KviEvent_OnChannelNickLinkClick,m_pKviWindow,pParams); - if(m_pKviWindow) - { - if(m_pKviWindow->inherits("KviChannel")) { - KviChannel *c = (KviChannel*)m_pKviWindow; - QString nick; - if(pParams->firstAsString(nick)) - c->userListView()->select(nick); - } - } - } - } else bTrigger = true; - break; - case KVI_WINDOW_TYPE_QUERY: - if(KviQString::equalCI(((KviQuery *)m_pKviWindow)->windowName(),linkText)) - { - if(e->button() & Qt::RightButton) - KVS_TRIGGER_EVENT(KviEvent_OnQueryNickPopupRequest,m_pKviWindow,pParams); - if(e->button() & Qt::LeftButton) - KVS_TRIGGER_EVENT(KviEvent_OnQueryNickLinkClick,m_pKviWindow,pParams); - } else bTrigger = true; - break; - default: - bTrigger = true; - break; - } - if(bTrigger) - { - if(console()) - { - if(e->button() & Qt::RightButton) - KVS_TRIGGER_EVENT(KviEvent_OnNickLinkPopupRequest,m_pKviWindow,pParams); - if(e->button() & Qt::LeftButton) - KVS_TRIGGER_EVENT(KviEvent_OnConsoleNickLinkClick,m_pKviWindow,pParams); - } else emit rightClicked(); - } - } - break; - case 'h': - if(e->button() & Qt::RightButton) - KVS_TRIGGER_EVENT(KviEvent_OnHostLinkPopupRequest,m_pKviWindow,pParams); - if(e->button() & Qt::LeftButton) - KVS_TRIGGER_EVENT(KviEvent_OnHostLinkClick,m_pKviWindow,pParams); - break; - case 'u': - if(e->button() & Qt::RightButton) - KVS_TRIGGER_EVENT(KviEvent_OnUrlLinkPopupRequest,m_pKviWindow,pParams); - if(e->button() & Qt::LeftButton) - KVS_TRIGGER_EVENT(KviEvent_OnUrlLinkClick,m_pKviWindow,pParams); - break; - case 'c': - if(e->button() & Qt::RightButton) - KVS_TRIGGER_EVENT(KviEvent_OnChannelLinkPopupRequest,m_pKviWindow,pParams); - if(e->button() & Qt::LeftButton) - KVS_TRIGGER_EVENT(KviEvent_OnChannelLinkClick,m_pKviWindow,pParams); - break; - case 's': - if(e->button() & Qt::RightButton) - KVS_TRIGGER_EVENT(KviEvent_OnServerLinkPopupRequest,m_pKviWindow,pParams); - if(e->button() & Qt::LeftButton) - KVS_TRIGGER_EVENT(KviEvent_OnServerLinkClick,m_pKviWindow,pParams); - break; - default: - { - if(e->button() & Qt::RightButton) - { - QString tmp; - getLinkEscapeCommand(tmp,linkCmd,"[!rbt]"); - if(!tmp.isEmpty()) - { - KviKvsScript::run(tmp,m_pKviWindow,pParams); - } else emit rightClicked(); - } - } - break; - } - } else if(e->button() & Qt::RightButton) emit rightClicked(); - - } else if((e->button() & Qt::MidButton) || ((e->button() & Qt::RightButton) && (e->state() & Qt::ControlButton))) - { - QString tmp; - getLinkEscapeCommand(tmp,linkCmd,QString("[!mbt]")); - if(!tmp.isEmpty()) - { - KviKvsScript::run(tmp,m_pKviWindow,pParams); - } else { - KVS_TRIGGER_EVENT_0(KviEvent_OnWindowPopupRequest,m_pKviWindow); - } - } - delete pParams; -} - -//================ mouseReleaseEvent ===============// - -void KviIrcView::mouseReleaseEvent(QMouseEvent *) -{ - if(m_iSelectTimer) - { - killTimer(m_iSelectTimer); - m_iSelectTimer = 0; - QClipboard * c = QApplication::clipboard(); - if(c) - { - // copy to both! - c->setText(m_szLastSelection,QClipboard::Clipboard); - if(c->supportsSelection()) - c->setText(m_szLastSelection,QClipboard::Selection); - } - } - - if(m_bMouseIsDown) - { - m_bMouseIsDown = false; - m_bShiftPressed = false; - // Insert the lines blocked while selecting - while(KviIrcViewLine * l = m_pMessagesStoppedWhileSelecting->first()) - { - m_pMessagesStoppedWhileSelecting->removeFirst(); - appendLine(l,false); - } - repaint(); - } -} - -// FIXME: #warning "The tooltip timeout should be small, because the view scrolls!" - -void KviIrcView::mouseMoveEvent(QMouseEvent *e) -{ -// debug("Pos : %d,%d",e->pos().x(),e->pos().y()); - if(m_bMouseIsDown && (e->state() & Qt::LeftButton)) // m_bMouseIsDown MUST BE true...(otherwise the mouse entered the window with the button pressed ?) - { - - if(m_iSelectTimer == 0)m_iSelectTimer = startTimer(KVI_IRCVIEW_SELECT_REPAINT_INTERVAL); - - /*if(m_iMouseTimer) - { - killTimer(m_iMouseTimer); - m_iMouseTimer=0; - mouseRealPressEvent(m_pLastEvent); - delete m_pLastEvent; - m_pLastEvent=0; - }*/ - } else { - if(m_iSelectTimer) - { - killTimer(m_iSelectTimer); - m_iSelectTimer = 0; - } - - int yPos = e->pos().y(); - int rectTop; - int rectHeight; - QRect rctLink; - KviIrcViewWrappedBlock * newLinkUnderMouse = getLinkUnderMouse(e->pos().x(),yPos,&rctLink); - - rectTop = rctLink.y(); - rectHeight = rctLink.height(); - - if(newLinkUnderMouse != m_pLastLinkUnderMouse) - { - //abortTip(); - //m_iTipTimer = startTimer(KVI_OPTION_UINT(KviOption_uintIrcViewToolTipTimeoutInMsec)); - m_pLastLinkUnderMouse = newLinkUnderMouse; - if(m_pLastLinkUnderMouse) - { - setCursor(Qt::PointingHandCursor); - if(rectTop < 0)rectTop = 0; - if((rectTop + rectHeight) > height())rectHeight = height() - rectTop; - - if(m_iLastLinkRectHeight > -1) - { - // prev link - int top = (rectTop < m_iLastLinkRectTop) ? rectTop : m_iLastLinkRectTop; - int lastBottom = m_iLastLinkRectTop + m_iLastLinkRectHeight; - int thisBottom = rectTop + rectHeight; - QRect r(0,top,width(),((lastBottom > thisBottom) ? lastBottom : thisBottom) - top); - repaint(r); - } else { - // no prev link - QRect r(0,rectTop,width(),rectHeight); - repaint(r); - } - m_iLastLinkRectTop = rectTop; - m_iLastLinkRectHeight = rectHeight; - } else { - setCursor(Qt::ArrowCursor); - if(m_iLastLinkRectHeight > -1) - { - // There was a previous bottom rect - QRect r(0,m_iLastLinkRectTop,width(),m_iLastLinkRectHeight); - repaint(r); - m_iLastLinkRectTop = -1; - m_iLastLinkRectHeight = -1; - } - } - - } - } -} - -KviConsole * KviIrcView::console() -{ - return m_pKviWindow->console(); -} - -void KviIrcView::doLinkToolTip(const QRect &rct,QString &linkCmd,QString &linkText) -{ - if(linkCmd.isEmpty())return; - - QString szCmd(linkCmd); - szCmd.remove(0,1); - - QString tip; - - switch(linkCmd[0].unicode()) - { - case 'u': // url link - { - tip = "<table width=\"100%\">" \ - "<tr><td valign=\"center\"><img src=\"url_icon\"> <u><font color=\"blue\"><nowrap>"; - if(linkText.length() > 50) - { - tip += linkText.left(47); - tip += "..."; - } else { - tip += linkText; - } - tip+="</nowrap></font></u></td></tr><tr><td>"; - QMimeSourceFactory::defaultFactory()->setPixmap("url_icon",*(g_pIconManager->getSmallIcon(KVI_SMALLICON_URL))); - tip += __tr2qs("Double-click to open this link"); - tip += "</td></tr></table>"; - } - break; - case 'h': // host link - { - tip = "<table width=\"100%\">" \ - "<tr><td valign=\"center\"><img src=\"host_icon\"> <u><font color=\"blue\"><nowrap>"; - if(linkText.length() > 50) - { - tip += linkText.left(47); - tip += "..."; - } else { - tip += linkText; - } - tip+="</nowrap></font></u></td></tr><tr><td>"; - QMimeSourceFactory::defaultFactory()->setPixmap("host_icon",*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SERVER))); - - if(linkText.find('*') != -1) - { - if(linkText.length() > 1)tip += __tr2qs("Unable to look it up hostname: Hostname appears to be masked"); - else tip += __tr2qs("Unable to look it up hostname: Unknown host"); - } else { - tip += __tr2qs("Double-click to look up this hostname<br>Right-click to view other options"); - } - tip += "</td></tr></table>"; - } - break; - case 's': // server link - { - // FIXME: #warning "Spit out some server info...hub ?...registered ?" - - tip = "<table width=\"100%\">" \ - "<tr><td valign=\"center\"><img src=\"server_icon\"> <u><font color=\"blue\"><nowrap>"; - QMimeSourceFactory::defaultFactory()->setPixmap("server_icon",*(g_pIconManager->getSmallIcon(KVI_SMALLICON_IRC))); - if(linkText.length() > 50) - { - tip += linkText.left(47); - tip += "..."; - } else { - tip += linkText; - } - tip+="</nowrap></font></u></td></tr><tr><td>"; - - if(linkText.find('*') != -1) - { - if(linkText.length() > 1)tip += __tr2qs("Server appears to be a network hub<br>"); - else tip += __tr2qs("Unknown server<br>"); // might happen... - } - - tip.append(__tr2qs("Double-click to read the MOTD<br>Right-click to view other options")); - tip += "</td></tr></table>"; - } - break; - case 'm': // mode link - { - if((linkCmd.length() > 2) && (m_pKviWindow->type() == KVI_WINDOW_TYPE_CHANNEL)) - { - if(((KviChannel *)m_pKviWindow)->isMeOp()) - { - QChar plmn = linkCmd[1]; - if((plmn.unicode() == '+') || (plmn.unicode() == '-')) - { - tip = __tr2qs("Double-click to set<br>"); - QChar flag = linkCmd[2]; - switch(flag.unicode()) - { - case 'o': - case 'v': - // We can do nothing here... - tip = ""; - break; - case 'b': - case 'I': - case 'e': - case 'k': - KviQString::appendFormatted(tip,QString("<b>mode %Q %c%c %Q</b>"),&(m_pKviWindow->windowName()),plmn.latin1(),flag.latin1(),&linkText); - break; - default: - KviQString::appendFormatted(tip,QString("<b>mode %Q %c%c</b>"),&(m_pKviWindow->windowName()),plmn.latin1(),flag.latin1()); - break; - } - } - } else { - // I'm not op...no way - tip = __tr2qs("You're not an operator: You may not change channel modes"); - } - } - } - break; - case 'n': // nick link - { - if(console()) - { - if(console()->connection()) - { - KviIrcUserEntry * e = console()->connection()->userDataBase()->find(linkText); - if(e) - { - QString buffer; - console()->getUserTipText(linkText,e,buffer); - tip = buffer; - } else KviQString::sprintf(tip,__tr2qs("Nothing known about %Q"),&linkText); - } else KviQString::sprintf(tip,__tr2qs("Nothing known about %Q (no connection)"),&linkText); - } - } - break; - case 'c': // channel link - { - if(console() && console()->connection()) - { - QString szChan = linkText; - QString buf; - tip = "<img src=\"chan_icon\"> "; - QMimeSourceFactory::defaultFactory()->setPixmap("chan_icon",*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL))); - - if(szCmd.length()>0) szChan=szCmd; - KviChannel * c = console()->connection()->findChannel(szChan); - QString szUrl; - if(c) - { - QString chanMode; - c->getChannelModeString(chanMode); - QString topic = KviMircCntrl::stripControlBytes(c->topicWidget()->topic()); - topic.replace("<","<"); - topic.replace(">",">"); - KviIrcUrl::join(szUrl,console()->connection()->target()->server()); - szUrl.append(szChan); - KviQString::sprintf(buf,__tr2qs("<b>%Q</b> (<u><font color=\"blue\"><nowrap>" - "%Q</nowrap></font></u>): <br><nowrap>+%Q (%u users)<hr>%Q</nowrap>"),&szChan,&szUrl,&chanMode, - c->count(),&topic); - } else { - KviIrcUrl::join(szUrl,console()->connection()->target()->server()); - szUrl.append(szChan); - KviQString::sprintf(buf,__tr2qs("<b>%Q</b> (<u><font color=\"blue\"><nowrap>" - "%Q</nowrap></font></u>)<hr>Double-click to join %Q<br>Right click to view other options"),&szChan,&szUrl,&szChan); - } - - tip += buf; - } - } - break; - default: - { - QString dbl,rbt,txt,mbt; - getLinkEscapeCommand(dbl,linkCmd,"[!dbl]"); - getLinkEscapeCommand(rbt,linkCmd,"[!rbt]"); - getLinkEscapeCommand(txt,linkCmd,"[!txt]"); - getLinkEscapeCommand(mbt,linkCmd,"[!mbt]"); - - if(!txt.isEmpty())tip = txt; - if(tip.isEmpty() && (!dbl.isEmpty())) - { - if(!tip.isEmpty())tip.append("<hr>"); - KviQString::appendFormatted(tip,__tr2qs("<b>Double-click:</b><br>%Q"),&dbl); - } - if(tip.isEmpty() && (!mbt.isEmpty())) - { - if(!tip.isEmpty())tip.append("<hr>"); - KviQString::appendFormatted(tip,__tr2qs("<b>Middle-click:</b><br>%Q"),&mbt); - } - if(tip.isEmpty() && (!rbt.isEmpty())) - { - if(!tip.isEmpty())tip.append("<hr>"); - KviQString::appendFormatted(tip,__tr2qs("<b>Right-click:</b><br>%Q"),&rbt); - } - } - break; - } - - if(tip.isEmpty())return; - - m_pToolTip->doTip(rct,tip); -} -void KviIrcView::leaveEvent ( QEvent * ) -{ - if(m_pLastLinkUnderMouse) - { - m_pLastLinkUnderMouse=0; - update(); - } -} -void KviIrcView::timerEvent(QTimerEvent *e) -{ - m_mouseCurrentPos = mapFromGlobal(QCursor::pos()); - - if(e->timerId() == m_iSelectTimer) - { - calculateSelectionBounds(); - repaint(); - } - if(e->timerId() == m_iMouseTimer) - { - killTimer(m_iMouseTimer); - m_iMouseTimer=0; - mouseRealPressEvent(m_pLastEvent); - delete m_pLastEvent; - m_pLastEvent=0; - } - if(e->timerId() == m_iFlushTimer) - { - flushLog(); - } -} - -void KviIrcView::keyPressEvent(QKeyEvent *e) -{ - switch(e->key()) - { - case Qt::Key_PageUp: - prevPage(); - e->accept(); - break; - case Qt::Key_PageDown: - nextPage(); - e->accept(); - break; - default: - e->ignore(); - } -} - -void KviIrcView::maybeTip(const QPoint &pnt) -{ - QString linkCmd; - QString linkText; - - QRect rctLink; - - KviIrcViewWrappedBlock * linkUnderMouse = getLinkUnderMouse(pnt.x(),pnt.y(),&rctLink,&linkCmd,&linkText); - - if((linkUnderMouse == m_pLastLinkUnderMouse) && linkUnderMouse)doLinkToolTip(rctLink,linkCmd,linkText); - else m_pLastLinkUnderMouse = 0; // -} - -#include "kvi_ircview.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_ircview.h b/3.4.0/src/kvirc/ui/kvi_ircview.h deleted file mode 100644 index 26097f0dbf..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_ircview.h +++ /dev/null @@ -1,252 +0,0 @@ -#ifndef _KVI_IRCVIEW_H_ -#define _KVI_IRCVIEW_H_ -//========================================================================================================= -// -// File : kvi_ircview.h -// Creation date : Fri Mar 19 1999 05:39:01 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" -#include "kvi_pointerlist.h" - -#include <qwidget.h> -#include <qpixmap.h> // needed - -class QScrollBar; -class QLineEdit; -class QFile; -class QToolButton; -class QFontMetrics; -class KviTalPopupMenu; - -class KviWindow; -class KviFrame; -class KviConsole; -class KviIrcViewToolWidget; -class KviIrcViewToolTip; - -typedef struct _KviIrcViewLineChunk KviIrcViewLineChunk; -typedef struct _KviIrcViewWrappedBlock KviIrcViewWrappedBlock; -typedef struct _KviIrcViewLine KviIrcViewLine; -typedef struct _KviIrcViewWrappedBlockSelectionInfoTag KviIrcViewWrappedBlockSelectionInfo; - -#define KVI_IRCVIEW_INVALID_LINE_MARK_INDEX 0xffffffff - -class KVIRC_API KviIrcView : public QWidget -{ - Q_OBJECT - Q_PROPERTY(int TransparencyCapable READ dummyRead) - // we cannot #ifdef due to a bug in moc - Q_PROPERTY(bool usePaintOnScreen READ getPaintOnScreen WRITE setPaintOnScreen) -public: - friend class KviIrcViewToolTip; - friend class KviIrcViewToolWidget; -public: - KviIrcView(QWidget *parent,KviFrame *pFrm,KviWindow *pWnd); - ~KviIrcView(); -public: - int dummyRead() const { return 0; }; -#ifdef COMPILE_USE_QT4 - bool getPaintOnScreen() const { return testAttribute(Qt::WA_PaintOnScreen);}; - void setPaintOnScreen(bool bFlag){setAttribute(Qt::WA_PaintOnScreen,bFlag);} ; -#else - // hack to fix moc bug on win qt4 - bool getPaintOnScreen() const { return 0;}; - void setPaintOnScreen(bool bFlag){} ; -#endif -private: -// QDate m_lastLogDay; - int m_iFlushTimer; - KviIrcViewLine * m_pFirstLine; - KviIrcViewLine * m_pCurLine; // Bottom line in the view - KviIrcViewLine * m_pLastLine; - KviIrcViewLine * m_pCursorLine; - unsigned int m_uLineMarkLineIndex; - - // Highliting of links - KviIrcViewWrappedBlock * m_pLastLinkUnderMouse; - int m_iLastLinkRectTop; - int m_iLastLinkRectHeight; - - int m_iNumLines; - int m_iMaxLines; - - unsigned int m_uNextLineIndex; - - QPixmap * m_pPrivateBackgroundPixmap; - QScrollBar * m_pScrollBar; - QToolButton * m_pToolsButton; - KviTalPopupMenu * m_pToolsPopup; - - KviIrcViewToolWidget * m_pToolWidget; - - int m_iLastScrollBarValue; - - // Font related stuff (needs precalculation!) - int m_iFontLineSpacing; - int m_iFontLineWidth; - int m_iFontDescent; - int m_iFontCharacterWidth[256]; //1024 bytes fixed - - int m_iWrapMargin; - int m_iMinimumPaintWidth; - int m_iRelativePixmapY; - int m_iIconWidth; - int m_iIconSideSpacing; - - QPoint m_mousePressPos; - QPoint m_mouseCurrentPos; - - // Selection - int m_iSelectionBegin; - int m_iSelectionTop; - int m_iSelectionEnd; - int m_iSelectionBottom; - int m_iSelectionLeft; - int m_iSelectionRight; - - bool m_bMouseIsDown; - bool m_bShiftPressed; - - bool m_bSkipScrollBarRepaint; - int m_iSelectTimer; - int m_iMouseTimer; - //int m_iTipTimer; - QString m_szLastSelection; - QString m_szLastSelectionLine; - KviWindow * m_pKviWindow; - KviIrcViewWrappedBlockSelectionInfo * m_pWrappedBlockSelectionInfo; - QFile * m_pLogFile; - KviFrame * m_pFrm; - bool m_bAcceptDrops; - int m_iUnprocessedPaintEventRequests; - bool m_bPostedPaintEventPending; - KviPointerList<KviIrcViewLine> * m_pMessagesStoppedWhileSelecting; - KviIrcView * m_pMasterView; - QFontMetrics * m_pFm; // assume this valid only inside a paint event (may be 0 in other circumstances) - - QMouseEvent * m_pLastEvent; - - KviIrcViewToolTip * m_pToolTip; - bool m_bHaveUnreadedHighlightedMessages; - bool m_bHaveUnreadedMessages; -public: - void checkLogDate(); - void clearUnreaded(); - void applyOptions(); - void enableDnd(bool bEnable); - bool haveUnreadedMessages() { return m_bHaveUnreadedMessages; }; - bool haveUnreadedHighlightedMessages() { return m_bHaveUnreadedHighlightedMessages; }; - enum AppendTextFlags { NoRepaint = 1, NoTimestamp = 2, SetLineMark = 4 }; - void appendText(int msg_type,const kvi_wchar_t *data_ptr,int iFlags = 0); - void clearLineMark(bool bRepaint=false); - bool hasLineMark(){ return m_uLineMarkLineIndex != KVI_IRCVIEW_INVALID_LINE_MARK_INDEX; }; - void removeHeadLine(bool bRepaint=false); - void emptyBuffer(bool bRepaint=true); - void getTextBuffer(QString &buffer); - void setMaxBufferSize(int maxBufSize,bool bRepaint=true); - int maxBufferSize(){ return m_iMaxLines; }; //Never used ? - bool saveBuffer(const char *filename); - void findNext(const QString& szText,bool bCaseS = false,bool bRegExp = false,bool bExtended = false); - void findPrev(const QString& szText,bool bCaseS = false,bool bRegExp = false,bool bExtended = false); - KviWindow * parentKviWindow(){ return m_pKviWindow; }; - KviConsole * console(); - // A null pixmap passed here unsets the private backgrdound. - void setPrivateBackgroundPixmap(const QPixmap &pixmap,bool bRepaint=true); - bool hasPrivateBackgroundPixmap(){ return (m_pPrivateBackgroundPixmap != 0); }; - - //============================================================================================== - // Logging - // Stops previous logging session too... - bool startLogging(const QString& fname = QString::null,bool bPrependCurBuffer = false); - void stopLogging(); - bool isLogging(){ return (m_pLogFile != 0); }; - void getLogFileName(KviStr &buffer); - void getLogFileName(QString &buffer); - //void add2Log(const char *buffer,int buf_len=-1); - void add2Log(const QString &szBuffer,int iMsgType=0); - - //============================================================================================== - // Channel view splitting - void setMasterView(KviIrcView * v); - void splitMessagesTo(KviIrcView * v); - void joinMessagesFrom(KviIrcView * v); - void appendMessagesFrom(KviIrcView * v); - - void prevLine(); - void nextLine(); - void nextPage(); - void prevPage(); - virtual QSize sizeHint() const; - const QString & lastLineOfText(); - const QString & lastMessageText(); - virtual void setFont(const QFont &f); -public slots: - void flushLog(); - void showToolsPopup(); - void clearBuffer(); - void toggleToolWidget(); - void increaseFontSize(); - void decreaseFontSize(); - void chooseFont(); - void chooseBackground(); - void resetBackground(); -signals: - void rightClicked(); - void dndEntered(); - void fileDropped(const char *); -private: - void setCursorLine(KviIrcViewLine * l); - KviIrcViewLine * getVisibleLineAt(int xPos,int yPos); - void getLinkEscapeCommand(QString &buffer,const QString &escape_cmd,const QString &escape_label); - void appendLine(KviIrcViewLine *ptr,bool bRepaint); - void postUpdateEvent(); - void fastScroll(int lines = 1); - const kvi_wchar_t * getTextLine(int msg_type,const kvi_wchar_t * data_ptr,KviIrcViewLine *line_ptr,bool bEnableTimeStamp = true); - void calculateLineWraps(KviIrcViewLine *ptr,int maxWidth); - void recalcFontVariables(const QFontMetrics &fm,const QFontInfo &fi); - bool checkSelectionBlock(KviIrcViewLine * line,int left,int bottom,int bufIndex); - void calculateSelectionBounds(); - KviIrcViewWrappedBlock * getLinkUnderMouse(int xPos,int yPos,QRect * pRect = 0,QString * linkCmd = 0,QString * linkText = 0); - void doLinkToolTip(const QRect &rct,QString &linkCmd,QString &linkText); -protected: - virtual void paintEvent(QPaintEvent *); - virtual void resizeEvent(QResizeEvent *); - virtual void mousePressEvent(QMouseEvent *e); - virtual void mouseRealPressEvent(QMouseEvent *e); - virtual void mouseReleaseEvent(QMouseEvent *); - virtual void mouseDoubleClickEvent(QMouseEvent *e); - virtual void mouseMoveEvent(QMouseEvent *e); - virtual void timerEvent(QTimerEvent *e); - virtual void dragEnterEvent(QDragEnterEvent *e); - virtual void dropEvent(QDropEvent *e); - virtual bool event(QEvent *e); - virtual void wheelEvent(QWheelEvent *e); - virtual void keyPressEvent(QKeyEvent *e); - void maybeTip(const QPoint &pnt); - virtual void leaveEvent ( QEvent * ); -protected slots: - virtual void scrollBarPositionChanged(int newValue); - void masterDead(); -}; - -#endif //_KVI_IRCVIEW_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_ircviewprivate.h b/3.4.0/src/kvirc/ui/kvi_ircviewprivate.h deleted file mode 100644 index 453b6272c1..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_ircviewprivate.h +++ /dev/null @@ -1,164 +0,0 @@ -#ifndef _KVI_IRCVIEWPRIVATE_H_ -#define _KVI_IRCVIEWPRIVATE_H_ -//========================================================================================================= -// -// File : kvi_ircviewprivate.h -// Creation date : Sat Oct 9 2004 16:29:01 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include <qstring.h> - -//========================================================================================================= -// Internal data structures -//========================================================================================================= - -// Force the structs to be packed... -#ifdef COMPILE_ON_WINDOWS - #pragma pack(push,old_packing,1) - #define _KVI_PACKED -#else //!COMPILE_ON_WIDNOWS - // this works only on gcc - #ifdef __GNUC__ - #define _KVI_PACKED __attribute__((__packed__)) - #else - #define _KVI_PACKED - #endif -#endif //!COMPILE_ON_WINDOWS - -// -// The LineChunk structure contains informations about -// an attribute change, an icon or a link -// -// type can be one of: -// -// KVI_TEXT_ICON: -// the uIconId member is the icon to be shown -// szPayload contains the text that triggered this icon was triggered by -// KVI_TEXT_UNICON: -// the text block after an icon -// KVI_TEXT_ESCAPE: -// szPayload contains the encoded escape command -// colors.fore contains the new text color -// KVI_TEXT_UNESCAPE: -// the text block after an escape -// KVI_TEXT_COLOR: -// the colors.back and colors.fore members indicate the color change -// KVI_TEXT_BOLD: -// toggles the bold flag -// KVI_TEXT_UNDERLINE: -// toggles the underline flag -// KVI_TEXT_REVERSE: -// inverts the current fore and back colors -// KVI_TEXT_RESET: -// resets the color, bold and underline flags -// - -typedef struct _KviIrcViewLineChunk -{ - unsigned char type; // chunk type - int iTextStart; // index in the szText string of the beginning of the block - int iTextLen; // length in chars of the block (excluding the terminator) - kvi_wchar_t * szPayload; // KVI_TEXT_ESCAPE attribute command buffer and KVI_TEXT_ICON icon name (non zeroed for other attributes!!!) - kvi_wchar_t * szSmileId; - struct { - unsigned char back; // optional background color for KVI_TEXT_COLOR attribute - unsigned char fore; // optional foreground color for KVI_TEXT_COLOR attribute (used also for KVI_TEXT_ESCAPE!!!) - } _KVI_PACKED colors; // anonymous -// QColor customBack; - QColor customFore; -} /*_KVI_PACKED*/ KviIrcViewLineChunk; - -// -// The wrapped paintable data block -// - -typedef struct _KviIrcViewWrappedBlock -{ - KviIrcViewLineChunk * pChunk; // pointer to real line chunk or 0 for word wraps - int block_start; // this is generally different than pAttribute->block_idx! - int block_len; // length if the block in characters - int block_width; // width of the block in pixels -} _KVI_PACKED KviIrcViewWrappedBlock; - - -typedef struct _KviIrcViewLine -{ - // this is a text line in the IrcView's memory - unsigned int uIndex; // index of the text line (needed for find and splitting) - QString szText; // data string without color codes nor escapes... - int iMsgType; // type of the line (defines icon and colors) - - // At line instert time the szData text is splitted in parts which - // signal attribute changes (or icons) - unsigned int uChunkCount; // number of allocated chunks - KviIrcViewLineChunk * pChunks; // pointer to the allocated structures - - // At paint time the data is re-splitted in drawable chunks which - // are either real data chunks or line wraps. - // The algorightm that does this is lazy and computes it - // only once for a given widget width (iMaxLineWidth) - unsigned int uLineWraps; // number of line wraps (lines - 1) - int iMaxLineWidth; // width that the blocks were calculated for (lazy calculation) - int iBlockCount; // number of allocated paintable blocks - KviIrcViewWrappedBlock * pBlocks; // pointer to the re-splitted paintable blocks - - // next and previous line - struct _KviIrcViewLine * pPrev; - struct _KviIrcViewLine * pNext; -} KviIrcViewLine; - -typedef struct _KviIrcViewWrappedBlockSelectionInfoTag -{ - int selection_type; - /*struct { - int length; - int width; - } part[3];*/ - int part_1_length; - int part_1_width; - int part_2_length; - int part_2_width; - int part_3_length; - int part_3_width; -} KviIrcViewWrappedBlockSelectionInfo; - -#ifdef COMPILE_ON_WINDOWS - #pragma pack(pop,old_packing) -#else //!COMPILE_ON_WINDOWS - #undef _KVI_PACKED -#endif //!COMPILE_ON_WINDOWS - -//========================================================================================================= -// Screen layout -//========================================================================================================= - -//FIRST LINE (prev_line = 0) <---m_pFirstLine -//LINE -//--------------------SCREEN-- -//LINE -//LINE -//LINE -//LINE <-------------------------m_pCurLine -//--------------------SCREEN-- -//LAST LINE (next_line = 0) <----m_pLastLine - -#endif //!_KVI_IRCVIEWPRIVATE_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_ircviewtools.cpp b/3.4.0/src/kvirc/ui/kvi_ircviewtools.cpp deleted file mode 100644 index 9b7f7c8ccd..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_ircviewtools.cpp +++ /dev/null @@ -1,348 +0,0 @@ -//============================================================================= -// -// File : kvi_ircviewtools.cpp -// Creation date : Sat Oct 9 2004 16:03:01 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_ircviewtools.h" -#include "kvi_ircview.h" -#include "kvi_styled_controls.h" -#include "kvi_iconmanager.h" -#include "kvi_options.h" -#include "kvi_locale.h" -#include "kvi_malloc.h" -#include "kvi_msgbox.h" -#include "kvi_filedialog.h" -#include "kvi_app.h" -#include "kvi_memmove.h" - -#include <qtoolbutton.h> -#include <qtabwidget.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qpushbutton.h> -#ifdef COMPILE_USE_QT4 - #include <q3header.h> -#else - #include <qheader.h> -#endif -#include <qlineedit.h> -#include <qcursor.h> -#include "kvi_accel.h" -#include <qevent.h> - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// Tool widget implementation -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - -KviIrcMessageCheckListItem::KviIrcMessageCheckListItem(KviTalListView * par,KviIrcViewToolWidget * w,int id) -: KviTalCheckListItem(par,QString::null,KviTalCheckListItem::CheckBox) -{ - m_iId = id; - m_pToolWidget = 0; - setPixmap(0,*(g_pIconManager->getSmallIcon(KVI_OPTION_MSGTYPE(id).pixId()))); - setOn(true); - m_pToolWidget = w; -} - -KviIrcMessageCheckListItem::~KviIrcMessageCheckListItem() -{ -} - -void KviIrcMessageCheckListItem::stateChange(bool bOn) -{ - KviTalCheckListItem::stateChange(bOn); - if(!m_pToolWidget)return; - m_pToolWidget->forceRepaint(); -} - - - -KviIrcViewToolWidget::KviIrcViewToolWidget(KviIrcView * par) -: QFrame(par) -{ - m_pIrcView = par; - setFrameStyle(QFrame::StyledPanel | QFrame::Raised); - - QGridLayout * gl = new QGridLayout(this,2,2,4,2); - - QLabel * l = new QLabel(__tr2qs("<b><font color=\"#EAEAEA\" size=\"-1\">Find Text</font></b>"),this); - l->setMaximumHeight(14); - l->setBackgroundColor(Qt::black); - gl->addWidget(l,0,0); - - QToolButton *tb = new QToolButton(Qt::DownArrow,this,"down_arrow"); - tb->setFixedSize(14,14); - tb->setAutoRepeat(false); - connect(tb,SIGNAL(clicked()),m_pIrcView,SLOT(toggleToolWidget())); - gl->addWidget(tb,0,1); - - - QTabWidget * tw = new QTabWidget(this); - - - - // Find tab - QWidget * w = new QWidget(tw); - - QGridLayout * g = new QGridLayout(w,6,2,2,1); - - m_pStringToFind = new QLineEdit(w); - g->addMultiCellWidget(m_pStringToFind,0,0,0,2); - connect(m_pStringToFind,SIGNAL(returnPressed()),this,SLOT(findNext())); - - m_pRegExp = new KviStyledCheckBox(__tr2qs("&Regular expression"),w); - g->addMultiCellWidget(m_pRegExp,1,1,0,2); - - m_pExtendedRegExp = new KviStyledCheckBox(__tr2qs("E&xtended regexp."),w); - g->addMultiCellWidget(m_pExtendedRegExp,2,2,0,2); - m_pExtendedRegExp->setEnabled(false); - connect(m_pRegExp,SIGNAL(toggled(bool)),m_pExtendedRegExp,SLOT(setEnabled(bool))); - - m_pCaseSensitive = new KviStyledCheckBox(__tr2qs("C&ase sensitive"),w); - g->addMultiCellWidget(m_pCaseSensitive,3,3,0,2); - - QPushButton * pb = new QPushButton(__tr2qs("Find &Prev."),w); - connect(pb,SIGNAL(clicked()),this,SLOT(findPrev())); - g->addWidget(pb,4,0); - - pb = new QPushButton(__tr2qs("&Find Next"),w); - pb->setDefault(true); - connect(pb,SIGNAL(clicked()),this,SLOT(findNext())); - g->addMultiCellWidget(pb,4,4,1,2); - - m_pFindResult = new QLabel(w); - m_pFindResult->setFrameStyle(QFrame::Sunken | QFrame::StyledPanel); - g->addMultiCellWidget(m_pFindResult,5,5,0,2); - - //g->setResizeMode(QGridLayout::Fixed); - - tw->addTab(w,__tr2qs("Find")); - - // Filter tab - QWidget * w1 = new QWidget(tw); - - g = new QGridLayout(w1,5,2,2,1); - - m_pFilterView = new KviTalListView(w1); - m_pFilterView->addColumn(__tr2qs("Type")); - m_pFilterView->header()->hide(); - m_pFilterView->setMinimumSize(QSize(10,10)); - - g->addMultiCellWidget(m_pFilterView,0,4,0,0); - - - m_pFilterItems = (KviIrcMessageCheckListItem **)kvi_malloc(KVI_NUM_MSGTYPE_OPTIONS * sizeof(KviIrcMessageCheckListItem *)); - - for(int i=0;i<KVI_NUM_MSGTYPE_OPTIONS;i++) - { - m_pFilterItems[i] = new KviIrcMessageCheckListItem(m_pFilterView,this,i); - } - - pb = new QPushButton(__tr2qs("Set &All"),w1); - connect(pb,SIGNAL(clicked()),this,SLOT(filterEnableAll())); - g->addWidget(pb,0,1); - - pb = new QPushButton(__tr2qs("Set &None"),w1); - connect(pb,SIGNAL(clicked()),this,SLOT(filterEnableNone())); - g->addWidget(pb,1,1); - - pb = new QPushButton(__tr2qs("&Load From..."),w1); - connect(pb,SIGNAL(clicked()),this,SLOT(filterLoad())); - g->addWidget(pb,2,1); - - pb = new QPushButton(__tr2qs("&Save As..."),w1); - connect(pb,SIGNAL(clicked()),this,SLOT(filterSave())); - g->addWidget(pb,3,1); - - tw->addTab(w1,__tr2qs("Filter")); - - gl->addMultiCellWidget(tw,1,1,0,1); - - gl->setResizeMode(QGridLayout::Fixed); - m_pStringToFind->setFocus(); - tw->showPage(w); - KviAccel *a = new KviAccel( this ); - a->connectItem( a->insertItem(Qt::Key_Escape), this,SLOT(close()) ); -} - -KviIrcViewToolWidget::~KviIrcViewToolWidget() -{ - kvi_free((void *)m_pFilterItems); -} - -void KviIrcViewToolWidget::filterEnableAll() -{ - for(int i=0;i<KVI_NUM_MSGTYPE_OPTIONS;i++) - { - m_pFilterItems[i]->setToolWidget(0); - m_pFilterItems[i]->setOn(true); - m_pFilterItems[i]->setToolWidget(this); - } - forceRepaint(); -} - -void KviIrcViewToolWidget::filterEnableNone() -{ - for(int i=0;i<KVI_NUM_MSGTYPE_OPTIONS;i++) - { - m_pFilterItems[i]->setToolWidget(0); - m_pFilterItems[i]->setOn(false); - m_pFilterItems[i]->setToolWidget(this); - } - forceRepaint(); -} - -void KviIrcViewToolWidget::hideEvent ( QHideEvent * ){ - m_pIrcView->toggleToolWidget(); -} - -void KviIrcViewToolWidget::closeEvent ( QCloseEvent * e ){ - m_pIrcView->toggleToolWidget(); -} - -void KviIrcViewToolWidget::filterLoad() -{ - QString szFile; - QString szInit; - g_pApp->getLocalKvircDirectory(szInit,KviApp::Filters); - - if(KviFileDialog::askForOpenFileName(szFile,__tr2qs("Select a Filter File"),szInit)) - { - QFile f(szFile); - if(f.open(IO_ReadOnly)) - { - char buffer[KVI_NUM_MSGTYPE_OPTIONS]; - kvi_memset(buffer,0,KVI_NUM_MSGTYPE_OPTIONS); - f.readBlock(buffer,KVI_NUM_MSGTYPE_OPTIONS); - f.close(); - for(int i=0;i<KVI_NUM_MSGTYPE_OPTIONS;i++) - { - m_pFilterItems[i]->setToolWidget(0); - m_pFilterItems[i]->setOn(buffer[i]); - m_pFilterItems[i]->setToolWidget(this); - } - forceRepaint(); - } else { - KviMessageBox::warning(__tr2qs("Can't open the filter file %s for reading."),&szFile); - } - } -} - -void KviIrcViewToolWidget::filterSave() -{ - QString szFile; - QString szInit; - g_pApp->getLocalKvircDirectory(szInit,KviApp::Filters,"filter.kvf"); - if(KviFileDialog::askForSaveFileName(szFile,__tr2qs("Select a Name for the Filter File"),szInit,0,false,true)) - { - QFile f(szFile); - if(f.open(IO_WriteOnly)) - { - char buffer[KVI_NUM_MSGTYPE_OPTIONS]; - for(int i=0;i<KVI_NUM_MSGTYPE_OPTIONS;i++) - { - buffer[i] = messageEnabled(i) ? 1 : 0; - } - if(f.writeBlock(buffer,KVI_NUM_MSGTYPE_OPTIONS) < KVI_NUM_MSGTYPE_OPTIONS) - KviMessageBox::warning(__tr2qs("Failed to write the filter file %Q (IO Error)"),&szFile); - f.close(); - } else KviMessageBox::warning(__tr2qs("Can't open the filter file %Q for writing"),&szFile); - } -} - -void KviIrcViewToolWidget::forceRepaint() -{ - #if defined(COMPILE_USE_QT4) && defined(COMPILE_ON_WINDOWS) - m_pIrcView->repaint(); - #else - m_pIrcView->paintEvent(0); - #endif - -} - -void KviIrcViewToolWidget::setFindResult(const QString & text) -{ - m_pFindResult->setText(text); -} - -void KviIrcViewToolWidget::findPrev() -{ - bool bRegExp = m_pRegExp->isChecked(); - m_pIrcView->findPrev(m_pStringToFind->text(),m_pCaseSensitive->isChecked(),bRegExp,bRegExp && m_pExtendedRegExp->isChecked()); -} - -void KviIrcViewToolWidget::findNext() -{ - bool bRegExp = m_pRegExp->isChecked(); - m_pIrcView->findNext(m_pStringToFind->text(),m_pCaseSensitive->isChecked(),bRegExp,bRegExp && m_pExtendedRegExp->isChecked()); -} - - -void KviIrcViewToolWidget::mousePressEvent(QMouseEvent *e) -{ - m_pressPoint = e->pos(); -} - -void KviIrcViewToolWidget::mouseMoveEvent(QMouseEvent *) -{ - QPoint p=m_pIrcView->mapFromGlobal(QCursor::pos()); - p-=m_pressPoint; - if(p.x() < 1)p.setX(1); - else { - int www = (m_pIrcView->width() - (m_pIrcView->m_pScrollBar->width() + 1)); - if((p.x() + width()) > www)p.setX(www - width()); - } - if(p.y() < 1)p.setY(1); - else { - int hhh = (m_pIrcView->height() - 1); - if((p.y() + height()) > hhh)p.setY(hhh - height()); - } - move(p); -} - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// Link tip label implementation -// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -KviIrcViewToolTip::KviIrcViewToolTip(KviIrcView * pView) -: KviTalToolTip(pView) -{ - m_pView = pView; -} - -KviIrcViewToolTip::~KviIrcViewToolTip() -{ -} - -void KviIrcViewToolTip::maybeTip(const QPoint &pnt) -{ - m_pView->maybeTip(pnt); -} - diff --git a/3.4.0/src/kvirc/ui/kvi_ircviewtools.h b/3.4.0/src/kvirc/ui/kvi_ircviewtools.h deleted file mode 100644 index e3f848728b..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_ircviewtools.h +++ /dev/null @@ -1,119 +0,0 @@ -#ifndef _KVI_IRCVIEWTOOLS_H_ -#define _KVI_IRCVIEWTOOLS_H_ -//========================================================================================================= -// -// File : kvi_ircviewtools.h -// Creation date : Sat Oct 9 2004 16:03:01 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_tal_tooltip.h" -#include <qframe.h> -#include "kvi_tal_listview.h" -#include <qstring.h> - -class QLabel; -//class KviStyledCheckBox; -#include "kvi_styled_controls.h" -class QLineEdit; - -class KviIrcView; - -class KviIrcViewToolTip : public KviTalToolTip -{ -public: - KviIrcViewToolTip(KviIrcView * pView); - virtual ~KviIrcViewToolTip(); -protected: - KviIrcView * m_pView; -protected: - virtual void maybeTip(const QPoint &pnt); -public: - void doTip(const QRect &rct,const QString &str){ tip(rct,str); }; -}; - -//========================================================================================================= -// Item for the filter list view -//========================================================================================================= - -class KviIrcViewToolWidget; - -class KviIrcMessageCheckListItem : public KviTalCheckListItem -{ -public: - KviIrcMessageCheckListItem(KviTalListView * par,KviIrcViewToolWidget * w,int id); - ~KviIrcMessageCheckListItem(); -private: - int m_iId; - KviIrcViewToolWidget * m_pToolWidget; -public: - void setToolWidget(KviIrcViewToolWidget * w){ m_pToolWidget = w; }; - virtual void stateChange(bool bOn); -}; - -//========================================================================================================= -// Search tools widget -//========================================================================================================= - -class KviIrcView; - -class KviIrcViewToolWidget : public QFrame -{ - friend class KviIrcView; - Q_OBJECT -protected: - KviIrcViewToolWidget(KviIrcView * par); - ~KviIrcViewToolWidget(); -protected: - KviIrcView * m_pIrcView; - QLineEdit * m_pStringToFind; - QPoint m_pressPoint; - - KviStyledCheckBox * m_pCaseSensitive; - KviStyledCheckBox * m_pRegExp; - KviStyledCheckBox * m_pExtendedRegExp; - - QLabel * m_pFindResult; - - KviTalListView * m_pFilterView; - - KviIrcMessageCheckListItem ** m_pFilterItems; - -public: - void setFindResult(const QString & text); - inline bool messageEnabled(int msg_type){ return m_pFilterItems[msg_type]->isOn(); } - void forceRepaint(); -protected slots: - void findPrev(); - void findNext(); - void filterEnableAll(); - void filterEnableNone(); - void filterSave(); - void filterLoad(); -protected: - virtual void hideEvent( QHideEvent * ); - virtual void closeEvent( QCloseEvent * e ); - virtual void mouseMoveEvent(QMouseEvent *); - virtual void mousePressEvent(QMouseEvent *); -}; - -#endif //!_KVI_IRCVIEWTOOLS_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_listview.cpp b/3.4.0/src/kvirc/ui/kvi_listview.cpp deleted file mode 100644 index eaa3d768ae..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_listview.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// -// File : kvi_listview.cpp -// Creation date : 19 Jan 2006 GMT by Alexey Uzhva -// -// This toolbar is part of the KVirc irc client distribution -// Copyright (C) 2006 Alexey Uzhva -// Copyright (C) 2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_listview.h" - -#include <qpainter.h> -#include <qpixmap.h> - -#include "kvi_doublebuffer.h" - -KviListView::KviListView( QWidget * parent, const char * name) -:KviTalListView(parent) -{ - m_pBackgroundOverlayPixmap=0; - m_iBackgroundOverlayAlignment=Qt::AlignAuto; -} - -KviListView::~KviListView() -{ - if(m_pBackgroundOverlayPixmap) - delete m_pBackgroundOverlayPixmap; -} - -void KviListView::setBackgroundOverlayPixmap(QPixmap * pix,int iAlignmentFlags) -{ - setStaticBackground(TRUE); -#ifdef COMPILE_USE_QT4 - viewport()->setAutoFillBackground(false); -#else - viewport()->setBackgroundMode(QWidget::NoBackground); -#endif - m_pBackgroundOverlayPixmap=new QPixmap(*pix); - m_iBackgroundOverlayAlignment= Qt::AlignRight | Qt::AlignBottom; - repaintContents(); -} - - - -void KviListView::drawContentsOffset(QPainter * p,int ox,int oy,int cx,int cy,int cw,int ch) -{ - if(!m_pBackgroundOverlayPixmap) - { - KviTalListView::drawContentsOffset(p,ox,oy,cx,cy,cw,ch); - return; - } - - if(cw <= 0)return; // this does happen - if(ch <= 0)return; // this does happen - - KviDoubleBuffer pix(viewport()->width(),viewport()->height()); - - QPixmap * pMemPixmap = pix.pixmap(); - - QPainter pa(pMemPixmap); - - int xx = cx - ox; - int yy = cy - oy; - - pa.fillRect(QRect(xx,yy,cw,ch),viewport()->backgroundColor()); - - //KviTalListView::paintEmptyArea(&pa,); - - // compute the pixmap position - int x,y; - if(m_iBackgroundOverlayAlignment == Qt::AlignAuto) - x=y=0; - else { - if(m_iBackgroundOverlayAlignment & Qt::AlignLeft) - x=0; - else if ( m_iBackgroundOverlayAlignment & Qt::AlignRight ) - x=viewport()->width() - m_pBackgroundOverlayPixmap->width(); - else if( m_iBackgroundOverlayAlignment & Qt::AlignHCenter ) - x=(viewport()->width() - m_pBackgroundOverlayPixmap->width())/2; - else - x=0; - - if( m_iBackgroundOverlayAlignment & Qt::AlignTop ) - y=0; - else if ( m_iBackgroundOverlayAlignment & Qt::AlignBottom ) - y=viewport()->height() - m_pBackgroundOverlayPixmap->height(); - else if ( m_iBackgroundOverlayAlignment & Qt::AlignVCenter ) - y=(viewport()->height() - m_pBackgroundOverlayPixmap->height())/2; - else - y=0; - } - - pa.drawPixmap(xx,yy,*m_pBackgroundOverlayPixmap,xx-x,yy-y,cw,ch); - - // Qt's auto double buffering is buggy and can't be disabled... too bad :/ - // - // The Qt source for the listview painting is also totally unreadable - // (maybe that's why they have thrown this cool widget away in Qt4: unmantainable) - // - // Anyway, I've noticed that when double buffering is choosen (and - // Qt seems to have a really complex logic to choose when to enable it - // and when not) then the painter passed to paintCell() of the - // list view items is NOT this painter. It's the internal painter - // of the QSharedDoubleBuffer private Qt class. It's screwed - // because of the multiple coordinate translations. With this - // widget we screw it even more just because our paintEmptyArea() - // does nothing and we do double buffering ourselves. - - KviTalListView::drawContentsOffset(&pa,ox,oy,cx,cy,cw,ch); - - p->drawPixmap(xx,yy,*pMemPixmap,xx,yy,cw,ch); - - //p->drawPixmap(cx-ox,cy-oy,*pMemPixmap,0,0,cw,ch); - //KviTalListView::drawContentsOffset(p,ox,oy,cx,cy,cw,ch); -} - - -void KviListView::paintEmptyArea(QPainter * p,const QRect & rect) -{ - if(!m_pBackgroundOverlayPixmap) - { - KviTalListView::paintEmptyArea(p,rect); - return; - } - - // otherwise just do nothing (we're filling the background in drawContentsOffset) - - /* - KviDoubleBuffer pix(rect.right()+1,rect.bottom()+1); - - QPixmap * pMemPixmap = pix.pixmap(); - - QPainter pa(pMemPixmap); - - pa.fillRect(rect,viewport()->backgroundColor()); - - KviTalListView::paintEmptyArea(&pa,rect); - - QPoint realTopLeft = p->xForm(rect.topLeft()); - - // compute the pixmap position - int x,y; - if(m_iBackgroundOverlayAlignment == Qt::AlignAuto) - x=y=0; - else { - if(m_iBackgroundOverlayAlignment & Qt::AlignLeft) - x=0; - else if ( m_iBackgroundOverlayAlignment & Qt::AlignRight ) - x=viewport()->width() - m_pBackgroundOverlayPixmap->width(); - else if( m_iBackgroundOverlayAlignment & Qt::AlignHCenter ) - x=(viewport()->width() - m_pBackgroundOverlayPixmap->width())/2; - else - x=0; - - if( m_iBackgroundOverlayAlignment & Qt::AlignTop ) - y=0; - else if ( m_iBackgroundOverlayAlignment & Qt::AlignBottom ) - y=viewport()->height() - m_pBackgroundOverlayPixmap->height(); - else if ( m_iBackgroundOverlayAlignment & Qt::AlignVCenter ) - y=(viewport()->height() - m_pBackgroundOverlayPixmap->height())/2; - else - y=0; - } - - pa.drawPixmap(rect.x(),rect.y(),*m_pBackgroundOverlayPixmap,realTopLeft.x()-x,realTopLeft.y()-y,rect.width(),rect.height()); - - p->drawPixmap(rect.x(),rect.y(),*pMemPixmap,rect.x(),rect.y(),rect.width(),rect.height()); - */ -} - -void KviListView::resizeEvent(QResizeEvent * e) -{ - KviTalListView::resizeEvent(e); - if(m_pBackgroundOverlayPixmap) - repaintContents(); // force a full repaint (otherwise qt does not honor static background here) -} - -#ifdef COMPILE_ON_WINDOWS - -void KviListView::focusInEvent(QFocusEvent * e) -{ - KviTalListView::focusInEvent(e); - if(m_pBackgroundOverlayPixmap) - repaintContents(); -} - -void KviListView::focusOutEvent(QFocusEvent * e) -{ - KviTalListView::focusOutEvent(e); - if(m_pBackgroundOverlayPixmap) - repaintContents(); -} - -#endif diff --git a/3.4.0/src/kvirc/ui/kvi_listview.h b/3.4.0/src/kvirc/ui/kvi_listview.h deleted file mode 100644 index ee194d48d0..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_listview.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef _KVI_LISTVIEW_H_ -#define _KVI_LISTVIEW_H_ - -/////////////////////////////////////////////////////////////////////////////// -// -// File : kvi_listview.h -// Creation date : 19 Jan 2006 GMT by Alexey Uzhva -// -// This toolbar is part of the KVirc irc client distribution -// Copyright (C) 2006 Alexey Uzhva -// Copyright (C) 2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_heapobject.h" - -#include "kvi_tal_listview.h" - -class QPainter; - -class KVIRC_API KviListView : public KviTalListView -{ - Q_OBJECT -public: - KviListView( QWidget * parent = 0, const char * name = 0); - ~KviListView(); -protected: - QPixmap * m_pBackgroundOverlayPixmap; - int m_iBackgroundOverlayAlignment; -public: - virtual void setBackgroundOverlayPixmap(QPixmap* pix,int iAlignmentFlags = Qt::AlignAuto); -public: - void publicUpdateContents(){ updateContents(); }; // <-- unscrewContents(); :D -protected: - virtual void paintEmptyArea(QPainter * p, const QRect & rect ); - virtual void drawContentsOffset(QPainter * p,int ox,int oy,int cx,int cy,int cw,int ch); - virtual void resizeEvent(QResizeEvent * e); -#ifdef COMPILE_ON_WINDOWS - virtual void focusInEvent(QFocusEvent * e); - virtual void focusOutEvent(QFocusEvent * e); -#endif -}; - -#endif //!_KVI_LISTVIEW_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_maskeditor.cpp b/3.4.0/src/kvirc/ui/kvi_maskeditor.cpp deleted file mode 100644 index c9224a7428..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_maskeditor.cpp +++ /dev/null @@ -1,350 +0,0 @@ -//============================================================================= -// -// File : kvi_maskeditor.cpp -// Creation date : Tue Aug 30 2000 12:24:59 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_maskeditor.h" -#include "kvi_locale.h" -#include "kvi_iconmanager.h" -#include "kvi_qstring.h" -#include "kvi_channel.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_toolwindows_container.h" -#include "kvi_channel.h" - -#include <qlayout.h> -#include <qlabel.h> -#include <qvalidator.h> - -KviMaskItem::KviMaskItem(KviTalListView* parent,KviMaskEntry* entry) -:KviTalListViewItem(parent), m_Mask(*entry) -{ - QDateTime date; - date.setTime_t(mask()->uSetAt); - setText(0,mask()->szMask); - setText(1,mask()->szSetBy); - setText(2,date.toString()); -} - -KviMaskItem::~KviMaskItem() -{ -} -#ifdef COMPILE_USE_QT4 -int KviMaskItem::compare ( KviTalListViewItem * i, int col, bool ascending ) const -#else -int KviMaskItem::compare ( QListViewItem * i, int col, bool ascending ) const -#endif -{ - if(col==2) - { - if( ((KviMaskItem*)i)->mask()->uSetAt > m_Mask.uSetAt ) return -1; - if( ((KviMaskItem*)i)->mask()->uSetAt == m_Mask.uSetAt ) return 0; - if( ((KviMaskItem*)i)->mask()->uSetAt < m_Mask.uSetAt ) return 1; - } - return KviTalListViewItem::compare(i,col,ascending); -} - -KviMaskInputDialog::KviMaskInputDialog(const QString &szMask,KviMaskEditor* pEditor,KviChannel * pChannel) -:QDialog(pEditor) -{ - m_pChannel=pChannel; - m_pEditor=pEditor; - setModal(1); - m_szOldMask=szMask; - - setCaption(__tr2qs("Mask editor - KVirc")); - - QGridLayout * g = new QGridLayout(this,2,3,5,5); - - QLabel * tl = new QLabel(__tr2qs("New mask must match an *!*@* expression"),this); - g->addMultiCellWidget(tl,0,0,0,3); - - m_pEdit=new QLineEdit(szMask,this); - g->addMultiCellWidget(m_pEdit,1,1,0,3); - - m_pOkButton= new QPushButton(__tr2qs("Ok"),this); - connect(m_pOkButton,SIGNAL(clicked()), this, SLOT(accept())); - g->addWidget(m_pOkButton,2,1); - m_pOkButton->setIconSet(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT))); - - m_pChancelButton= new QPushButton(__tr2qs("Cancel"),this); - connect(m_pChancelButton,SIGNAL(clicked()), this, SLOT(reject())); - g->addWidget(m_pChancelButton,2,2); - m_pChancelButton->setIconSet(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DISCARD))); - - QRegExp rx( "*!*@*", false,true ); - QValidator* validator = new QRegExpValidator( rx, this ); - - m_pEdit->setValidator( validator ); -} - -KviMaskInputDialog::~KviMaskInputDialog() -{ -} - -void KviMaskInputDialog::accept() -{ - if(m_szOldMask.isEmpty()) - { - m_pChannel->connection()->sendFmtData("MODE %s +%c %s", - m_pChannel->connection()->encodeText(m_pChannel->name()).data(), - m_pEditor->flag(), - m_pChannel->connection()->encodeText(m_pEdit->text()).data() - ); - } else { - m_pChannel->connection()->sendFmtData("MODE %s -%c+%c %s %s", - m_pChannel->connection()->encodeText(m_pChannel->name()).data(), - m_pEditor->flag(), - m_pEditor->flag(), - m_pChannel->connection()->encodeText(m_szOldMask).data(), - m_pChannel->connection()->encodeText(m_pEdit->text()).data() - ); - } - QDialog::accept(); -} - -KviMaskEditor::KviMaskEditor(QWidget * par,KviWindowToolPageButton* button,KviPointerList<KviMaskEntry> * maskList,char flag,const char * nam) -: KviWindowToolWidget(par,button) -{ - bool isEnabled=1; - - QObject * w = parent(); - while(w) - { - if(w->inherits("KviChannel")) - { - KviChannel *chan = ((KviChannel *)w); - if(!( chan->isMeHalfOp() || chan->isMeOp() || chan->isMeChanOwner() || chan->isMeChanAdmin() || chan->connection()->userInfo()->hasUserMode('o') || chan->connection()->userInfo()->hasUserMode('O') ) ) isEnabled=0; - break; - } - w = w->parent(); - } - -#ifdef COMPILE_USE_QT4 - setFocusPolicy(Qt::ClickFocus); -#else - setFocusPolicy(QWidget::ClickFocus); -#endif - - QGridLayout *g = new QGridLayout(this,4,2,2,2); - - m_cFlag = flag; - - QString txt; - switch(flag) - { - case 'b': - txt = __tr2qs("Active Bans"); - m_iIconId = KVI_SMALLICON_BAN; - break; - case 'I': - txt = __tr2qs("Active Invite Exceptions"); - m_iIconId = KVI_SMALLICON_INVITEEXCEPT; - break; - case 'e': - txt = __tr2qs("Active Ban Exceptions"); - m_iIconId = KVI_SMALLICON_BANEXCEPT; - break; - default: - txt = "?"; - m_iIconId = KVI_SMALLICON_UNHANDLED; - break; - } - - QLabel * l = new QLabel("",this); - l->setPixmap(*(g_pIconManager->getSmallIcon(m_iIconId))); - g->addWidget(l,0,0); - - l = new QLabel(txt,this); - g->addWidget(l,0,1); - - KviTalHBox * hb = new KviTalHBox(this); - g->addMultiCellWidget(hb,1,1,0,1); - - new QLabel(__tr2qs("Filter:"),hb); - m_pSearch = new QLineEdit(hb); - connect(m_pSearch,SIGNAL(textChanged ( const QString & ) ),this,SLOT(searchTextChanged ( const QString & ))); - - l = new QLabel(__tr2qs("Use doubleclick to edit item"),this); - g->addWidget(l,1,1); - g->addMultiCellWidget(l,2,2,0,1); - - m_pMaskBox = new KviTalListView(this); -#ifdef COMPILE_USE_QT4 - m_pMaskBox->setFocusPolicy(Qt::ClickFocus); -#else - m_pMaskBox->setFocusPolicy(QWidget::ClickFocus); -#endif - m_pMaskBox->setFocusProxy(this); - m_pMaskBox->setFrameStyle(QFrame::StyledPanel|QFrame::Sunken); - m_pMaskBox->addColumn(__tr2qs("Mask")); - m_pMaskBox->addColumn(__tr2qs("Set by")); - m_pMaskBox->addColumn(__tr2qs("Set at")); - m_pMaskBox->setMultiSelection(true); - m_pMaskBox->setAllColumnsShowFocus(true); - m_pMaskBox->setShowSortIndicator(true); - m_pMaskBox->setSorting(2,false); - connect(m_pMaskBox,SIGNAL(doubleClicked ( KviTalListViewItem * )),this,SLOT(listViewDoubleClicked( KviTalListViewItem * ))); - g->addMultiCellWidget(m_pMaskBox,3,3,0,1); - - m_pRemoveMask = new QPushButton(__tr2qs("Re&move"),this); - m_pRemoveMask->setEnabled(isEnabled); -#ifdef COMPILE_USE_QT4 - m_pRemoveMask->setFocusPolicy(Qt::ClickFocus); -#else - m_pRemoveMask->setFocusPolicy(QWidget::ClickFocus); -#endif - m_pRemoveMask->setFocusProxy(this); - g->addWidget(m_pRemoveMask,4,1); - connect(m_pRemoveMask,SIGNAL(clicked()),this,SLOT(removeClicked())); - m_pRemoveMask->setIconSet(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DELETEITEM))); - - m_pAddButton = new QPushButton(__tr2qs("Add"),this); - m_pAddButton->setEnabled(isEnabled); -#ifdef COMPILE_USE_QT4 - m_pAddButton->setFocusPolicy(Qt::ClickFocus); -#else - m_pAddButton->setFocusPolicy(QWidget::ClickFocus); -#endif - m_pAddButton->setFocusProxy(this); - g->addWidget(m_pAddButton,4,0); - connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked())); - m_pAddButton->setIconSet(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NEWITEM))); - - g->setColStretch(3,1); - - for(KviMaskEntry * e = maskList->first();e;e = maskList->next()) addMask(e); - registerSelf(); -} - -KviMaskEditor::~KviMaskEditor() -{ - -} - -void KviMaskEditor::searchTextChanged ( const QString & text) -{ - KviTalListViewItem *pItem=m_pMaskBox->firstChild(); - KviMaskItem *pMaskItem; - bool bEmpty = text.isEmpty(); - while(pItem) - { - pMaskItem = (KviMaskItem *)pItem; - if(bEmpty) - { - pMaskItem->setVisible(true); - } else { - if(pMaskItem->mask()->szMask.contains(text)) - pMaskItem->setVisible(true); - else - pMaskItem->setVisible(false); - } - pItem=pItem->nextSibling(); - } -} - -void KviMaskEditor::removeClicked() -{ - KviPointerList<KviMaskEntry> * l = new KviPointerList<KviMaskEntry>; - l->setAutoDelete(true); - KviMaskItem * it = (KviMaskItem *)(m_pMaskBox->firstChild()); - while(it) - { - if(it->isSelected()) - { - KviMaskEntry * e = new KviMaskEntry; - e->szMask = it->mask()->szMask; - e->szSetBy = it->mask()->szSetBy; - e->uSetAt = it->mask()->uSetAt; - l->append(e); - } - it = (KviMaskItem *)(it->nextSibling()); - } - if(l->count() > 0)emit removeMasks(this,l); - delete l; -} - -void KviMaskEditor::addClicked() -{ - QObject * w = parent(); - while(w) - { - if(w->inherits("KviChannel")) - { - KviChannel *chan = ((KviChannel *)w); - if(chan->isMeHalfOp() || chan->isMeOp() || chan->isMeChanAdmin() || chan->isMeChanOwner() || chan->connection()->userInfo()->hasUserMode('o') || chan->connection()->userInfo()->hasUserMode('O')) - { - KviMaskInputDialog* pDialog=new KviMaskInputDialog("",this,chan); - pDialog->show(); - } - break; - } - w = w->parent(); - } -} - -void KviMaskEditor::addMask(KviMaskEntry *e) -{ -// debug("%s %s %i",__FILE__,__FUNCTION__,__LINE__); - KviMaskItem *it; - it = new KviMaskItem(m_pMaskBox,e); - it->setPixmap(0,*(g_pIconManager->getSmallIcon(m_iIconId))); -} - -void KviMaskEditor::removeMask(KviMaskEntry *e) -{ - KviMaskItem * it =(KviMaskItem *)(m_pMaskBox->firstChild()); - while(it) - { - if(KviQString::equalCI(it->mask()->szMask,e->szMask)) - { - delete it; - return; - } - it = (KviMaskItem *)(it->nextSibling()); - } -} - -void KviMaskEditor::listViewDoubleClicked( KviTalListViewItem * pItem) -{ - if(pItem) - { - QObject * w = parent(); - while(w) - { - if(w->inherits("KviChannel")) - { - KviChannel *chan = ((KviChannel *)w); - if(chan->isMeHalfOp() || chan->isMeOp() || chan->isMeChanAdmin() || chan->isMeChanOwner() || chan->connection()->userInfo()->hasUserMode('o') || chan->connection()->userInfo()->hasUserMode('O')) - { - KviMaskInputDialog* pDialog=new KviMaskInputDialog(pItem->text(0),this,chan); - pDialog->show(); - } - break; - } - w = w->parent(); - } - } -} - -#include "kvi_maskeditor.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_maskeditor.h b/3.4.0/src/kvirc/ui/kvi_maskeditor.h deleted file mode 100644 index 32b710f5a4..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_maskeditor.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef _KVI_MASKEDITOR_H_ -#define _KVI_MASKEDITOR_H_ - -// -// File : kvi_maskeditor.h -// Creation date : Tue Aug 30 2000 12:20:10 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include <qdialog.h> -#include <qlineedit.h> -#include <qwidget.h> -#include "kvi_tal_listview.h" -#include <qpushbutton.h> -#include "kvi_pointerlist.h" - -#include "kvi_string.h" -#include "kvi_toolwindows_container.h" - -class KviMaskEditor; -class KviChannel; - -typedef struct _KviMaskEntry -{ - QString szMask; - QString szSetBy; - unsigned int uSetAt; -} KviMaskEntry; - -class KviMaskItem: public KviTalListViewItem -{ -public: - KviMaskItem(KviTalListView* parent,KviMaskEntry* entry); - ~KviMaskItem(); - - KviMaskEntry* mask() { return &m_Mask; }; -#ifdef COMPILE_USE_QT4 - virtual int compare ( KviTalListViewItem * i, int col, bool ascending ) const; -#else - virtual int compare ( QListViewItem * i, int col, bool ascending ) const; -#endif -protected: - KviMaskEntry m_Mask; - -}; - -class KviMaskInputDialog : public QDialog -{ - Q_OBJECT -public: - KviMaskInputDialog(const QString &szMask,KviMaskEditor* pEditor,KviChannel * pChannel); - ~KviMaskInputDialog(); -protected: - QLineEdit * m_pEdit; - QPushButton * m_pOkButton; - QPushButton * m_pChancelButton; - QString m_szOldMask; - KviChannel * m_pChannel; - KviMaskEditor * m_pEditor; -protected slots: - virtual void accept(); -}; - -class KVIRC_API KviMaskEditor : public KviWindowToolWidget -{ - Q_OBJECT -public: - KviMaskEditor(QWidget * par,KviWindowToolPageButton* button,KviPointerList<KviMaskEntry> * maskList, - char flag,const char * nam); - ~KviMaskEditor(); -protected: - KviTalListView * m_pMaskBox; - QPushButton * m_pRemoveMask; - QPushButton * m_pAddButton; - QLineEdit * m_pSearch; - char m_cFlag; - int m_iIconId; -public: - char flag(){ return m_cFlag; }; - void addMask(KviMaskEntry *e); - void removeMask(KviMaskEntry *e); -protected slots: - void removeClicked(); - void addClicked(); - void listViewDoubleClicked( KviTalListViewItem * ); - void searchTextChanged ( const QString & ); -signals: - void removeMasks(KviMaskEditor *,KviPointerList<KviMaskEntry> *); -}; - -#endif //_KVI_MASKEDITOR_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_mdicaption.cpp b/3.4.0/src/kvirc/ui/kvi_mdicaption.cpp deleted file mode 100644 index e166edc400..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_mdicaption.cpp +++ /dev/null @@ -1,285 +0,0 @@ -//================================================================================================= -// -// File : kvi_mdicaption.cpp -// Creation date : Tue Sep 2 2003 02:35:45 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#define _KVI_DEBUG_CHECK_RANGE_ -#include "kvi_debug.h" -#include "kvi_mdichild.h" -#include "kvi_mdimanager.h" -#include "kvi_string.h" -#include "kvi_locale.h" -#include "kvi_options.h" -#include "kvi_settings.h" -#include "kvi_iconmanager.h" -#include "kvi_window.h" -#include "kvi_mdicaption.h" - -#include <qcursor.h> -#include <qnamespace.h> -#include <qapplication.h> -#include <qfontmetrics.h> -#include "kvi_pointerlist.h" -#include <qpixmap.h> -#include <qstyle.h> -#include <qpainter.h> -#include "kvi_tal_popupmenu.h" -#ifdef COMPILE_USE_QT4 - #include <q3simplerichtext.h> - #define QSimpleRichText Q3SimpleRichText - #include <qstyleoption.h> -#else - #include <qsimplerichtext.h> -#endif -#include <qdrawutil.h> -#include <qevent.h> - -KviMdiCaptionButton::KviMdiCaptionButton(const QPixmap &pix,QWidget * parent,const char * name) -: QToolButton(parent,name) -{ - setPixmap(pix); - //setAutoRaise(true); - setMinimumSize(18,18); -} - -KviMdiCaptionButton::~KviMdiCaptionButton() -{ -} - - -#ifdef COMPILE_USE_QT4 -void KviMdiCaptionButton::paintEvent(QPaintEvent *e) -{ - QPainter painter(this); - drawButton(&painter); -} -#endif - -void KviMdiCaptionButton::drawButton(QPainter *p) -{ -#ifdef COMPILE_USE_QT4 - QBrush b(parentWidget()->palette().window()); -#else - QBrush b(parentWidget()->colorGroup().background()); -#endif - - if(isDown()) - qDrawShadePanel(p,0,0,width(),height(),colorGroup(),true,1,&b); - else - p->fillRect(0,0,width(),height(),b); - -#ifdef COMPILE_USE_QT4 - int x = (width() - 16) / 2; - int y = (width() - 16) / 2; - p->drawPixmap(x,y,16,16,icon().pixmap(16,16),0,0,16,16); -#else - drawButtonLabel(p); -#endif -} - - - - - - - -KviMdiCaption::KviMdiCaption(KviMdiChild * parent,const char * name) -: QWidget(parent,name) -{ - m_pMaximizeButton = new KviMdiCaptionButton(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MAXIMIZE)),this,"maximize_button"); - connect(m_pMaximizeButton,SIGNAL(clicked()),parent,SLOT(maximize())); - m_pMinimizeButton = new KviMdiCaptionButton(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MINIMIZE)),this,"minimize_button"); - connect(m_pMinimizeButton,SIGNAL(clicked()),parent,SLOT(minimize())); - m_pCloseButton = new KviMdiCaptionButton(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CLOSE)),this,"close_button"); - connect(m_pCloseButton,SIGNAL(clicked()),parent,SLOT(closeRequest())); - m_pSystemButton = new KviMdiCaptionButton(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DEFAULTICON)),this,"icon_button"); - connect(m_pSystemButton,SIGNAL(clicked()),parent,SLOT(systemPopupSlot())); - - m_lastMousePos = QPoint(-1,-1); - m_bMouseGrabbed = true; - m_bActive = false; - calcLineSpacing(); -#ifdef COMPILE_USE_QT4 - setAutoFillBackground(false); -#endif -} - -KviMdiCaption::~KviMdiCaption() -{ -} - -void KviMdiCaption::reloadImages() -{ - m_pMaximizeButton->setIconSet(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MAXIMIZE))); - m_pMinimizeButton->setIconSet(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MINIMIZE))); - m_pCloseButton->setIconSet(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CLOSE))); -} - -void KviMdiCaption::calcLineSpacing() -{ - QFontMetrics fm(font()); - m_iLineSpacing = fm.lineSpacing() + 3; - if(m_iLineSpacing < 20)m_iLineSpacing = 20; -} - -int KviMdiCaption::heightHint() -{ - return m_iLineSpacing; -} - -void KviMdiCaption::setActive(bool bActive) -{ - m_bActive = bActive; - - QPalette pal(Qt::white,m_bActive ? KVI_OPTION_COLOR(KviOption_colorMdiCaptionActive) : KVI_OPTION_COLOR(KviOption_colorMdiCaptionInactive)); - setPalette(pal); - //update(); - m_pSystemButton->update(); - m_pCloseButton->update(); - m_pMinimizeButton->update(); - m_pMaximizeButton->update(); -} - -void KviMdiCaption::fontChange(const QFont &old) -{ - calcLineSpacing(); - QWidget::fontChange(old); - ((KviMdiChild *)parent())->resizeEvent(0); -} - -void KviMdiCaption::mousePressEvent(QMouseEvent *e) -{ - m_bMouseGrabbed = true; - m_lastMousePos = QCursor::pos(); -#ifdef COMPILE_USE_QT4 - setCursor(Qt::SizeAllCursor); -#else - setCursor(QCursor::sizeAllCursor); -#endif - ((KviMdiChild *)parent())->activate(true); -} - -void KviMdiCaption::mouseMoveEvent(QMouseEvent *) -{ - if(m_bMouseGrabbed) - { - QPoint p = QCursor::pos(); - int dx = m_lastMousePos.x() - p.x(); - int dy = m_lastMousePos.y() - p.y(); - KviMdiChild * c = (KviMdiChild *)parent(); - - int nx = c->manager()->childX(c) - dx; - int ny = c->manager()->childY(c) - dy; - - if((nx < 0) || (ny < 0)) - { - int cx = p.x(); - int cy = p.y(); - if(nx < 0) - { - cx -= nx; - nx = 0; - } - if(ny < 0) - { - cy -= ny; - ny = 0; - } - - QCursor::setPos(cx,cy); - m_lastMousePos = QPoint(cx,cy); - } else { - m_lastMousePos = p; - } - - c->manager()->moveChild(c,nx,ny); - c->manager()->childMoved(c); - } -} - -void KviMdiCaption::mouseDoubleClickEvent(QMouseEvent *e) -{ - ((KviMdiChild *)parent())->maximize(); -} - -void KviMdiCaption::paintEvent(QPaintEvent * e) -{ - QRect r = e->rect(); - QPainter p(this); - p.fillRect(r,m_bActive ? KVI_OPTION_COLOR(KviOption_colorMdiCaptionActive) : KVI_OPTION_COLOR(KviOption_colorMdiCaptionInactive)); - QSimpleRichText rt(m_bActive ? ((KviMdiChild *)parent())->xmlActiveCaption() : ((KviMdiChild *)parent())->xmlInactiveCaption(),font()); - rt.draw(&p,height() + 2,-1,rect(),colorGroup()); -} - -void KviMdiCaption::mouseReleaseEvent(QMouseEvent *) -{ - m_bMouseGrabbed = false; -#ifdef COMPILE_USE_QT4 - setCursor(Qt::arrowCursor); -#else - setCursor(QCursor::arrowCursor); -#endif -// releaseMouse(); -} - -void KviMdiCaption::setFocusProxy(QWidget * w) -{ - QWidget::setFocusProxy(w); - m_pSystemButton->setFocusProxy(w); - m_pMinimizeButton->setFocusProxy(w); - m_pMaximizeButton->setFocusProxy(w); - m_pCloseButton->setFocusProxy(w); -} - -void KviMdiCaption::resizeEvent(QResizeEvent * e) -{ - int s = height() - 2; - m_pSystemButton->setGeometry(1,1,s,s); - m_pCloseButton->setGeometry(width() - (s + 1), - 1,s,s); - m_pMaximizeButton->setGeometry(width() - ((s << 1) + 2), - 1,s,s); - m_pMinimizeButton->setGeometry(width() - ((s * 3) + 3), - 1,s,s); -} - - - -KviMenuBarToolButton::KviMenuBarToolButton(QWidget * par,const QPixmap &img, const char * name) -: KviStyledToolButton(par) -{ - setProperty("name","name"); - setIconSet(img); - setAutoRaise(true); -} - -KviMenuBarToolButton::~KviMenuBarToolButton() -{ -} - -QSize KviMenuBarToolButton::sizeHint() const -{ - return QSize(20,20); -} - diff --git a/3.4.0/src/kvirc/ui/kvi_mdicaption.h b/3.4.0/src/kvirc/ui/kvi_mdicaption.h deleted file mode 100644 index fcd642cee4..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_mdicaption.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef _KVI_MDICAPTION_H_ -#define _KVI_MDICAPTION_H_ -//================================================================================================= -// -// File : kvi_mdicaption.h -// Creation date : Tue Sep 2 2003 02:35:45 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qtoolbutton.h> -#include <qlabel.h> -#include "kvi_styled_controls.h" - -class KviMdiManager; -class KviMdiChild; - - -class KVIRC_API KviMdiCaptionButton : public QToolButton -{ - Q_OBJECT -public: - KviMdiCaptionButton(const QPixmap &pix,QWidget * parent,const char * name); - ~KviMdiCaptionButton(); -protected: - virtual void drawButton(QPainter * p); -#ifdef COMPILE_USE_QT4 - virtual void paintEvent(QPaintEvent *e); -#endif -}; - - -class KviMenuBarToolButton : public KviStyledToolButton -{ - Q_OBJECT -public: - KviMenuBarToolButton(QWidget * par,const QPixmap &img, const char * name); - ~KviMenuBarToolButton(); -public: - virtual QSize sizeHint() const; -}; - - -class KVIRC_API KviMdiCaption : public QWidget -{ - friend class KviMdiChild; - Q_OBJECT -public: - KviMdiCaption(KviMdiChild * parent,const char * name); - ~KviMdiCaption(); -protected: - QPoint m_lastMousePos; - bool m_bMouseGrabbed; - int m_iLineSpacing; - bool m_bActive; - KviMdiCaptionButton * m_pSystemButton; - KviMdiCaptionButton * m_pMinimizeButton; - KviMdiCaptionButton * m_pMaximizeButton; - KviMdiCaptionButton * m_pCloseButton; - QPixmap m_pixSystemIcon; -public: - int heightHint(); - void setActive(bool bActive); - bool active(){ return m_bActive; }; - void setSystemIcon(const QPixmap &pix){ m_pSystemButton->setPixmap(pix); m_pixSystemIcon = pix; }; - const QPixmap * systemIcon(){ return &m_pixSystemIcon; }; - void enableClose(bool bEnable){ m_pCloseButton->setEnabled(bEnable); }; - bool closeEnabled(){ return m_pCloseButton->isEnabled(); }; - virtual void setFocusProxy(QWidget * w); -protected: - void calcLineSpacing(); - virtual void fontChange(const QFont &old); - virtual void mousePressEvent(QMouseEvent *e); - virtual void mouseDoubleClickEvent(QMouseEvent *e); - virtual void mouseMoveEvent(QMouseEvent *e); - virtual void mouseReleaseEvent(QMouseEvent *e); - virtual void paintEvent(QPaintEvent * e); - virtual void resizeEvent(QResizeEvent * e); - void reloadImages(); -}; - - -#endif //_KVI_MDICAPTION_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_mdichild.cpp b/3.4.0/src/kvirc/ui/kvi_mdichild.cpp deleted file mode 100644 index 7581844c60..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_mdichild.cpp +++ /dev/null @@ -1,576 +0,0 @@ -//============================================================================= -// -// File : kvi_mdichild.cpp -// Creation date : Wed Jun 21 2000 17:35:45 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#define _KVI_DEBUG_CHECK_RANGE_ -#include "kvi_debug.h" -#include "kvi_mdichild.h" -#include "kvi_mdimanager.h" -#include "kvi_string.h" -#include "kvi_locale.h" -#include "kvi_options.h" -#include "kvi_settings.h" -#include "kvi_iconmanager.h" -#include "kvi_window.h" -#include "kvi_mdicaption.h" - -#include <qcursor.h> -#include <qnamespace.h> -#include <qapplication.h> -#include <qfontmetrics.h> -#include "kvi_pointerlist.h" -#include <qpixmap.h> -#include <qstyle.h> -#include <qpainter.h> -#include "kvi_tal_popupmenu.h" -#ifndef COMPILE_USE_QT4 - #include <qobjectlist.h> -#endif -#include <qevent.h> - -#ifdef Q_OS_MACX -#include "kvi_app.h" //Needed for g_pApp -#ifdef COMPILE_USE_QT4 - #include <QDesktopWidget> -#endif -#endif - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - extern QPixmap * g_pShadedChildGlobalDesktopBackground; -#endif - - -#define KVI_MDI_NORESIZE 0 -#define KVI_MDI_RESIZE_TOP 1 -#define KVI_MDI_RESIZE_LEFT 2 -#define KVI_MDI_RESIZE_RIGHT 4 -#define KVI_MDI_RESIZE_BOTTOM 8 -#define KVI_MDI_RESIZE_TOPLEFT (1|2) -#define KVI_MDI_RESIZE_TOPRIGHT (1|4) -#define KVI_MDI_RESIZE_BOTTOMLEFT (8|2) -#define KVI_MDI_RESIZE_BOTTOMRIGHT (8|4) - - -KviMdiChild::KviMdiChild(KviMdiManager * par,const char * name) -: QFrame(par->viewport(),name ? name : "mdi_child") -{ - setFrameStyle(QFrame::StyledPanel | QFrame::Raised); - setFrameShape(NoFrame); - m_pManager = par; - - m_pCaption = new KviMdiCaption(this,"mdi_caption"); - - m_bResizeMode = false; - m_iResizeCorner = KVI_MDI_NORESIZE; - m_iLastCursorCorner = KVI_MDI_NORESIZE; - - m_pClient = 0; - m_state = Normal; - m_restoredGeometry = QRect(10,10,100,100); - - setMouseTracking(true); - setMinimumSize(KVI_MDICHILD_MIN_WIDTH,KVI_MDICHILD_MIN_HEIGHT); - -#ifdef COMPILE_USE_QT4 - setAutoFillBackground(true); -#endif - -} - -KviMdiChild::~KviMdiChild() -{ - if(m_pClient)delete m_pClient; -} - -void KviMdiChild::reloadImages() -{ - m_pCaption->reloadImages(); -} - -QRect KviMdiChild::restoredGeometry() -{ - if(m_state == Maximized)return m_restoredGeometry; - else return QRect(x(),y(),width(),height()); -// else return geometry(); - -} - -#ifdef COMPILE_USE_QT4 -void KviMdiChild::setBackgroundRole(QPalette::ColorRole) -{ - // hack - QFrame::setBackgroundRole(QPalette::Window); -} -#else -void KviMdiChild::setBackgroundMode(QWidget::BackgroundMode) -{ - // hack - QFrame::setBackgroundMode(QWidget::PaletteBackground); -} -#endif - -void KviMdiChild::setIcon(const QPixmap &pix) -{ - m_pCaption->setSystemIcon(pix); - - if((m_state == Maximized) && (m_pManager->topChild() == this)) - { - m_pManager->updateSDIMode(); - } -} - -const QPixmap * KviMdiChild::icon() -{ - return m_pCaption->systemIcon(); -} - -void KviMdiChild::enableClose(bool bEnable) -{ - m_pCaption->enableClose(bEnable); - if((m_state == Maximized) && (m_pManager->topChild() == this)) - { - m_pManager->updateSDIMode(); - } - -} - -bool KviMdiChild::closeEnabled() -{ - return m_pCaption->closeEnabled(); -} - -void KviMdiChild::setCaption(const QString & plain,const QString & xmlActive,const QString & xmlInactive) -{ - m_szPlainCaption = plain; - m_szXmlActiveCaption = xmlActive; - m_szXmlInactiveCaption = xmlInactive; - //m_pCaptionLabel->setActive(m_pCaptionLabel->active()); - m_pCaption->update(); -} - -void KviMdiChild::maximize() -{ - if(m_state == Minimized)restore(); // restore first - if(m_state == Normal)m_restoredGeometry = geometry(); - m_state = Maximized; - manager()->maximizeChild(this); -} - -void KviMdiChild::restore() -{ - if(m_restoredGeometry.x() < 0)m_restoredGeometry.setX(0); - if(m_restoredGeometry.y() < 0)m_restoredGeometry.setY(0); - // ensure coherency - if(m_restoredGeometry.width() < 5)m_restoredGeometry.setWidth(5); - if(m_restoredGeometry.height() < 5)m_restoredGeometry.setHeight(5); - - /* - if((m_restoredGeometry.x() + m_restoredGeometry.width()) > m_pManager->width()) - m_restoredGeometry.setWidth(m_pManager->width() - m_restoredGeometry.x()); - if((m_restoredGeometry.y() + m_restoredGeometry.height()) > m_pManager->height()) - m_restoredGeometry.setHeight(m_pManager->height() - m_restoredGeometry.y()); - */ - - switch(m_state) - { - case Maximized: - m_pManager->moveChild(this,m_restoredGeometry.x(),m_restoredGeometry.y()); - resize(m_restoredGeometry.width(),m_restoredGeometry.height()); - m_state = Normal; - m_pManager->childRestored(this,true); - break; - case Minimized: - m_pManager->moveChild(this,m_restoredGeometry.x(),m_restoredGeometry.y()); - resize(m_restoredGeometry.width(),m_restoredGeometry.height()); - show(); - m_state = Normal; - m_pManager->childRestored(this,false); - break; - case Normal: - m_state = Normal; - if(!isVisible())show(); - return; - break; - } -} - -void KviMdiChild::minimize() -{ - switch(m_state) - { - case Maximized: - hide(); - m_state = Minimized; - m_pManager->childMinimized(this,true); - break; - case Normal: - m_restoredGeometry = geometry(); - hide(); - m_state = Minimized; - m_pManager->childMinimized(this,false); - break; - case Minimized: - m_state = Minimized; - if(isVisible())hide(); - return; - break; - } -} - -void KviMdiChild::closeRequest() -{ - if(closeEnabled())if(m_pClient)m_pClient->close(); -} -/* -void KviMdiChild::systemPopupAboutToShow() -{ - m_pSystemPopup->clear(); - if(m_state != Maximized)m_pSystemPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MAXIMIZE)),__tr("&Maximize"),this,SLOT(maximize())); - if(m_state != Minimized)m_pSystemPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MINIMIZE)),__tr("M&inimize"),this,SLOT(minimize())); - if(m_state != Normal)m_pSystemPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_RESTORE)),__tr("&Restore"),this,SLOT(restore())); - if(closeEnabled()) - { - m_pSystemPopup->insertSeparator(); - m_pSystemPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CLOSE)),__tr("&Close"),this,SLOT(closeRequest())); - } -} -*/ -void KviMdiChild::moveEvent(QMoveEvent *e) -{ -#ifdef COMPILE_PSEUDO_TRANSPARENCY - if(m_pClient && g_pShadedChildGlobalDesktopBackground) - { - if(m_pClient->inherits("KviWindow")) // actually this is always the case - { - ((KviWindow *)m_pClient)->updateBackgrounds(); - } - } -#endif - QFrame::moveEvent(e); -} - -void KviMdiChild::systemPopupSlot() -{ - if(sender()->inherits("QToolButton")) - { - emit systemPopupRequest(((QToolButton *)sender())->mapToGlobal(QPoint(0,((QToolButton *)sender())->height()))); - } else { - emit systemPopupRequest(m_pCaption->mapToGlobal(QPoint(5,5))); - } -} - -void KviMdiChild::resizeEvent(QResizeEvent *e) -{ - int s = m_pCaption->heightHint(); - m_pCaption->setGeometry(KVI_MDICHILD_BORDER,KVI_MDICHILD_BORDER, - width() - (KVI_MDICHILD_BORDER << 1),s); - - if(m_pClient) - { - int yPos = KVI_MDICHILD_BORDER + s + KVI_MDICHILD_SPACING; - m_pClient->setGeometry(KVI_MDICHILD_BORDER,yPos, - width() - (KVI_MDICHILD_BORDER << 1),height() - (yPos + KVI_MDICHILD_BORDER)); - } - QFrame::resizeEvent(e); -} - -void KviMdiChild::mousePressEvent(QMouseEvent *e) -{ - if(m_state == Maximized)return; - m_iResizeCorner=getResizeCorner(e->pos().x(),e->pos().y()); - if(m_iResizeCorner != KVI_MDI_NORESIZE) - { - grabMouse(getResizeCursor(m_iResizeCorner)); - m_bResizeMode = true; - } -} - -void KviMdiChild::mouseReleaseEvent(QMouseEvent *) -{ - m_iResizeCorner=KVI_MDI_NORESIZE; - m_iLastCursorCorner=KVI_MDI_NORESIZE; - - if(m_bResizeMode) - { - m_bResizeMode = false; - releaseMouse(); - } - - //if(QApplication::overrideCursor())QApplication::restoreOverrideCursor(); -} - -QCursor KviMdiChild::getResizeCursor(int resizeCorner) -{ - switch (resizeCorner) - { - case KVI_MDI_RESIZE_LEFT: - case KVI_MDI_RESIZE_RIGHT: - return Qt::sizeHorCursor; - break; - case KVI_MDI_RESIZE_TOP: - case KVI_MDI_RESIZE_BOTTOM: - return Qt::sizeVerCursor; - break; - case KVI_MDI_RESIZE_TOPLEFT: - case KVI_MDI_RESIZE_BOTTOMRIGHT: - return Qt::sizeFDiagCursor; - break; - case KVI_MDI_RESIZE_BOTTOMLEFT: - case KVI_MDI_RESIZE_TOPRIGHT: - return Qt::sizeBDiagCursor; - break; - default: - return Qt::arrowCursor; - break; - } -} - -void KviMdiChild::mouseMoveEvent(QMouseEvent *e) -{ - if(e->state() & Qt::LeftButton) - { - if(m_iResizeCorner && (m_state != Maximized))resizeWindowOpaque(m_iResizeCorner); - } else { - setResizeCursor(getResizeCorner(e->pos().x(), e->pos().y())); - } -} - -void KviMdiChild::setResizeCursor(int resizeCorner) -{ - if(resizeCorner == m_iLastCursorCorner) - return; //Don't do it twice - m_iLastCursorCorner = resizeCorner; - if(resizeCorner == KVI_MDI_NORESIZE) - { - setCursor(getResizeCursor(resizeCorner)); - //if(QApplication::overrideCursor())QApplication::restoreOverrideCursor(); - } else { - if(m_state != Maximized) - { - setCursor(getResizeCursor(resizeCorner)); - //QApplication::setOverrideCursor(getResizeCursor(resizeCorner),true); - } - } -} - -void KviMdiChild::leaveEvent(QEvent *) -{ - if(!m_bResizeMode) - { - m_iResizeCorner=KVI_MDI_NORESIZE; - m_iLastCursorCorner=KVI_MDI_NORESIZE; - //if(QApplication::overrideCursor())QApplication::restoreOverrideCursor(); - } else { - if(m_iResizeCorner != KVI_MDI_NORESIZE)resizeWindowOpaque(m_iResizeCorner); - } -} - -void KviMdiChild::calculateResizeRect(int resizeCorner,QPoint mousePos,QRect &resizeRect,int minWidth,int minHeight) -{ - switch(resizeCorner) - { - case KVI_MDI_RESIZE_LEFT: - resizeRect.setLeft(mousePos.x() - 1); - if(resizeRect.width() < minWidth)resizeRect.setLeft(resizeRect.right() - minWidth); - if(resizeRect.x() < 0)resizeRect.setX(0); - break; - case KVI_MDI_RESIZE_RIGHT: - resizeRect.setRight(mousePos.x() + 1); - if(resizeRect.width() < minWidth)resizeRect.setRight(resizeRect.left() + minWidth); - break; - case KVI_MDI_RESIZE_TOP: - resizeRect.setTop(mousePos.y() - 1); - if(resizeRect.height() < minHeight)resizeRect.setTop(resizeRect.bottom() - minHeight); - if(resizeRect.y() < 0)resizeRect.setY(0); - break; - case KVI_MDI_RESIZE_BOTTOM: - resizeRect.setBottom(mousePos.y() + 1); - if(resizeRect.height() < minHeight)resizeRect.setBottom(resizeRect.top() + minHeight); - break; - case KVI_MDI_RESIZE_BOTTOMRIGHT: - resizeRect.setBottom(mousePos.y() + 1); - if(resizeRect.height() < minHeight)resizeRect.setBottom(resizeRect.top() + minHeight); - resizeRect.setRight(mousePos.x() + 1); - if(resizeRect.width() < minWidth)resizeRect.setRight(resizeRect.left() + minWidth); - break; - case KVI_MDI_RESIZE_TOPRIGHT: - resizeRect.setTop(mousePos.y() - 1); - if(resizeRect.height() < minHeight)resizeRect.setTop(resizeRect.bottom() - minHeight); - if(resizeRect.y() < 0)resizeRect.setY(0); - resizeRect.setRight(mousePos.x() + 1); - if(resizeRect.width() < minWidth)resizeRect.setRight(resizeRect.left() + minWidth); - break; - case KVI_MDI_RESIZE_BOTTOMLEFT: - resizeRect.setBottom(mousePos.y() + 1); - if(resizeRect.height() < minHeight)resizeRect.setBottom(resizeRect.top() + minHeight); - resizeRect.setLeft(mousePos.x() - 1); - if(resizeRect.width() < minWidth)resizeRect.setLeft(resizeRect.right() - minWidth); - if(resizeRect.x() < 0)resizeRect.setX(0); - break; - case KVI_MDI_RESIZE_TOPLEFT: - resizeRect.setTop(mousePos.y() - 1); - if(resizeRect.height() < minHeight)resizeRect.setTop(resizeRect.bottom() - minHeight); - if(resizeRect.y() < 0)resizeRect.setY(0); - resizeRect.setLeft(mousePos.x() - 1); - if(resizeRect.width() < minWidth)resizeRect.setLeft(resizeRect.right() - minWidth); - if(resizeRect.x() < 0)resizeRect.setX(0); - break; - } -} - -void KviMdiChild::calculateMinimumSize(int &minWidth,int &minHeight) -{ - if(m_pClient){ - minWidth = m_pClient->minimumSize().width() + (KVI_MDICHILD_BORDER << 1); - minHeight = m_pClient->minimumSize().height()+ (KVI_MDICHILD_BORDER << 1)+ - m_pCaption->heightHint() + KVI_MDICHILD_SPACING; - } - if(minWidth<KVI_MDICHILD_MIN_WIDTH)minWidth=KVI_MDICHILD_MIN_WIDTH; - if(minHeight<KVI_MDICHILD_MIN_HEIGHT)minHeight=KVI_MDICHILD_MIN_HEIGHT; -} - -void KviMdiChild::resizeWindowOpaque(int resizeCorner) -{ - int minWidth=0; - int minHeight=0; - QRect resizeRect(m_pManager->childX(this),m_pManager->childY(this),width(),height()); - calculateMinimumSize(minWidth,minHeight); - QPoint mousePos = m_pManager->viewportToContents(m_pManager->viewport()->mapFromGlobal(QCursor::pos())); - calculateResizeRect(resizeCorner,mousePos,resizeRect,minWidth,minHeight); - m_pManager->moveChild(this,resizeRect.x(),resizeRect.y()); - resize(resizeRect.width(),resizeRect.height()); - m_pManager->childMoved(this); - - if(m_state == Maximized) - { - m_state=Normal; - m_pManager->childRestored(this,true); - } - -} - -int KviMdiChild::getResizeCorner(int ax,int ay) -{ - int ret = KVI_MDI_NORESIZE; - if((ax>0)&&(ax<(KVI_MDICHILD_BORDER+2))) ret |= KVI_MDI_RESIZE_LEFT; - if((ax<width())&&(ax>(width()-(KVI_MDICHILD_BORDER+2)))) ret |= KVI_MDI_RESIZE_RIGHT; - if((ay>0)&&(ay<(KVI_MDICHILD_BORDER+2))) ret |= KVI_MDI_RESIZE_TOP; - if((ay<(height()))&&(ay>(height()-(KVI_MDICHILD_BORDER+2)))) ret |= KVI_MDI_RESIZE_BOTTOM; - return ret; -} - -void KviMdiChild::setClient(QWidget *w) -{ - __range_valid(m_pClient==0); - __range_valid(w!=0); - - m_pClient = w; - //resize to match the client - int clientYPos=m_pCaption->heightHint()+KVI_MDICHILD_SPACING+KVI_MDICHILD_BORDER; - resize(w->width()+(KVI_MDICHILD_BORDER << 1),w->height()+KVI_MDICHILD_BORDER+clientYPos); - - //Reparent if needed - if(w->parent()!=this){ - //reparent to this widget , no flags , point , show it - QPoint pnt2(KVI_MDICHILD_BORDER,clientYPos); - w->reparent(this,pnt2,true); - } else w->move(KVI_MDICHILD_BORDER,clientYPos); - - setFocusProxy(w); - m_pCaption->setFocusProxy(w); - -/* - m_pMinimizeButton->setFocusProxy(w); - m_pMaximizeButton->setFocusProxy(w); - m_pCloseButton->setFocusProxy(w); - m_pIconButton->setFocusProxy(w); -*/ - //linkChildren(w); - - if(m_pClient->minimumSize().width() > KVI_MDICHILD_MIN_WIDTH && - m_pClient->minimumSize().height() > KVI_MDICHILD_MIN_HEIGHT){ - setMinimumWidth(m_pClient->minimumSize().width() + (KVI_MDICHILD_BORDER << 1)); - setMinimumHeight(m_pClient->minimumSize().height()+ (KVI_MDICHILD_BORDER << 1) + - m_pCaption->heightHint() + KVI_MDICHILD_SPACING); - } - - KviStr tmp(KviStr::Format,"mdi_child_%s",w->name()); - setName(tmp.ptr()); -} - -void KviMdiChild::unsetClient() -{ - __range_valid(m_pClient!=0); - if(!m_pClient)return; - //reparent to desktop widget , no flags , point , show it - //unlinkChildren(m_pClient); - setFocusProxy(0); //remove the focus proxy... - //Kewl...the reparent function has a small prob now.. - //the new toplelvel widgets gets not reenabled for dnd -#ifndef Q_OS_MACX - m_pClient->reparent(0,m_pClient->mapToGlobal(QPoint(0,0)),true); -#else - QRect r = g_pApp->desktop()->availableGeometry(m_pClient); - r.moveBy(0, 22); - m_pClient->reparent(0,r.topLeft(),true); -#endif - m_pClient=0; - setName("mdi_child"); -} - - - -void KviMdiChild::activate(bool bSetFocus) -{ - if(!m_pCaption->active())m_pCaption->setActive(true); - if(m_pManager->topChild() != this) - m_pManager->setTopChild(this,bSetFocus); - else if(bSetFocus)setFocus(); -} - -void KviMdiChild::focusInEvent(QFocusEvent *) -{ - // We gained focus by click , tab or from the caption label - // Bring this child to top - m_pCaption->setActive(true); - m_pManager->setTopChild(this,false); //Do not focus by now... - /*The client is our focusProxy ! it should be focused by Qt !*/ -#ifdef _KVI_DEBUG_CLASS_NAME_ - __range_valid(focusProxy() == m_pClient); -#endif -} - -QSize KviMdiChild::sizeHint() -{ - if(m_pClient) - { - QSize s = m_pClient->sizeHint(); - QSize ret(s.width() + (KVI_MDICHILD_BORDER << 1), - s.height() + (KVI_MDICHILD_BORDER << 1) + KVI_MDICHILD_SPACING + m_pCaption->heightHint()); - return ret; - } - return QFrame::sizeHint(); -} - - diff --git a/3.4.0/src/kvirc/ui/kvi_mdichild.h b/3.4.0/src/kvirc/ui/kvi_mdichild.h deleted file mode 100644 index 6f11897923..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_mdichild.h +++ /dev/null @@ -1,122 +0,0 @@ -#ifndef _KVI_MDICHILD_H_ -#define _KVI_MDICHILD_H_ -//================================================================================================= -// -// File : kvi_mdichild.h -// Creation date : Wed Jun 21 2000 17:35:04 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" - -#include <qframe.h> -#include <qtoolbutton.h> -#include <qlabel.h> - - -class KviMdiManager; -class KviMdiChild; -class KviMdiCaption; - -class QCursor; - - - -class KVIRC_API KviMdiChild : public QFrame -{ - friend class KviMdiManager; - friend class KviMdiCaption; - Q_OBJECT -public: - KviMdiChild(KviMdiManager* par,const char * name = 0); - ~KviMdiChild(); -public: - enum MdiChildState { Maximized , Minimized , Normal }; -protected: - KviMdiManager * m_pManager; - KviMdiCaption * m_pCaption; -private: - int m_iResizeCorner; - int m_iLastCursorCorner; - bool m_bResizeMode; - QWidget * m_pClient; - MdiChildState m_state; - QRect m_restoredGeometry; - - QString m_szXmlActiveCaption; - QString m_szXmlInactiveCaption; - QString m_szPlainCaption; -public: - QRect restoredGeometry(); - void setRestoredGeometry(const QRect &r){ m_restoredGeometry = r; }; - void setClient(QWidget * w); - QWidget * client(){ return m_pClient; }; - void unsetClient(); - KviMdiCaption * captionLabel(){ return m_pCaption; }; - MdiChildState state(){ return m_state; }; - const QString & plainCaption(){ return m_szPlainCaption; }; - const QString & xmlActiveCaption(){ return m_szXmlActiveCaption; }; - const QString & xmlInactiveCaption(){ return m_szXmlInactiveCaption; }; - void setCaption(const QString & plain,const QString & xmlActive,const QString & xmlInactive); - virtual QSize sizeHint(); - void setIcon(const QPixmap &pix); - const QPixmap * icon(); - void enableClose(bool bEnable); - bool closeEnabled(); - KviMdiManager * manager(){ return m_pManager; }; - void activate(bool bSetFocus); - void reloadImages(); -public slots: - void maximize(); - void minimize(); - void restore(); - void systemPopupSlot(); - void closeRequest(); -signals: - void systemPopupRequest(const QPoint & pnt); -protected: -#ifdef COMPILE_USE_QT4 - virtual void setBackgroundRole(QPalette::ColorRole); -#else - virtual void setBackgroundMode(QWidget::BackgroundMode bgmd); -#endif - virtual void resizeEvent(QResizeEvent *e); - virtual void mousePressEvent(QMouseEvent *e); - virtual void mouseMoveEvent(QMouseEvent *e); - virtual void mouseReleaseEvent(QMouseEvent *e); - virtual void leaveEvent(QEvent *e); - virtual void focusInEvent(QFocusEvent *); - virtual void moveEvent(QMoveEvent *e); -// bool eventFilter(QObject *o,QEvent *e); - void emitSystemPopupRequest(const QPoint & pnt){ emit systemPopupRequest(pnt); }; -private: -// void linkChildren(QWidget *w); -// void unlinkChildren(QWidget *w); - QCursor getResizeCursor(int resizeCorner); - void resizeWindowOpaque(int resizeCorner); - int getResizeCorner(int ax,int ay); - void calculateMinimumSize(int &minWidth,int &minHeight); - void setResizeCursor(int resizeCorner); - void calculateResizeRect(int resizeCorner,QPoint mousePos,QRect &resizeRect,int minWidth,int minHeight); -}; - - -#endif //_KVI_MDICHILD_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_mdimanager.cpp b/3.4.0/src/kvirc/ui/kvi_mdimanager.cpp deleted file mode 100644 index 1d00dae5ac..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_mdimanager.cpp +++ /dev/null @@ -1,1126 +0,0 @@ -//============================================================================= -// -// File : kvi_mdimanager.cpp -// Creation date : Wed Jun 21 2000 17:28:04 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2003 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_debug.h" -#include "kvi_settings.h" -#include "kvi_mdimanager.h" -#include "kvi_mdichild.h" -#include "kvi_locale.h" -#include "kvi_options.h" -#include "kvi_iconmanager.h" -#include "kvi_frame.h" -#include "kvi_menubar.h" -#include "kvi_mdicaption.h" -#include "kvi_app.h" - -#include "kvi_tal_popupmenu.h" -#include <qmenubar.h> -#include <qlayout.h> -#include <qpainter.h> -#include <math.h> -#include <qcursor.h> -#include <qdrawutil.h> -#include <qevent.h> - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_hbox.h" -#endif - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - #include <qpixmap.h> - extern QPixmap * g_pShadedParentGlobalDesktopBackground; -#endif - - - - -KviMdiManager::KviMdiManager(QWidget * parent,KviFrame * pFrm,const char * name) -: KviTalScrollView(parent) -{ - setFrameShape(NoFrame); - m_pZ = new KviPointerList<KviMdiChild>; - m_pZ->setAutoDelete(true); - - m_pFrm = pFrm; - - m_iSdiIconItemId = 0; - m_iSdiCloseItemId = 0; - m_iSdiRestoreItemId = 0; - m_iSdiMinimizeItemId = 0; - m_pSdiIconButton = 0; - m_pSdiCloseButton = 0; - m_pSdiRestoreButton = 0; - m_pSdiMinimizeButton = 0; -#ifdef COMPILE_USE_QT4 - m_pSdiControls = 0; -#endif - - m_pWindowPopup = new KviTalPopupMenu(this); - connect(m_pWindowPopup,SIGNAL(activated(int)),this,SLOT(menuActivated(int))); - connect(m_pWindowPopup,SIGNAL(aboutToShow()),this,SLOT(fillWindowPopup())); - m_pTileMethodPopup = new KviTalPopupMenu(this); - connect(m_pTileMethodPopup,SIGNAL(activated(int)),this,SLOT(tileMethodMenuActivated(int))); - -#ifdef COMPILE_USE_QT4 - viewport()->setAutoFillBackground(false); -#else - viewport()->setBackgroundMode(QWidget::NoBackground); -#endif - setStaticBackground(true); - resizeContents(width(),height()); - -#ifdef COMPILE_USE_QT4 - setFocusPolicy(Qt::NoFocus); - viewport()->setFocusPolicy(Qt::NoFocus); -#else - setFocusPolicy(QWidget::NoFocus); - viewport()->setFocusPolicy(QWidget::NoFocus); -#endif - - connect(g_pApp,SIGNAL(reloadImages()),this,SLOT(reloadImages())); -} - -KviMdiManager::~KviMdiManager() -{ - delete m_pZ; -} - -void KviMdiManager::reloadImages() -{ - for(KviMdiChild * c = m_pZ->first();c;c = m_pZ->next()) - { - c->reloadImages(); - } -} - -bool KviMdiManager::focusNextPrevChild(bool bNext) -{ - //bug("FFFFFF"); - // this is a QScrollView bug... it doesn't pass this - // event to the toplevel window - return m_pFrm->focusNextPrevChild(bNext); -} - -void KviMdiManager::drawContents(QPainter *p,int x,int y,int w,int h) -{ - //debug("MY DRAW CONTENTS (%d,%d,%d,%d)",x,y,w,h); - QRect r(x,y,w,h); - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - if(g_pShadedParentGlobalDesktopBackground) - { - QPoint pnt = viewport()->mapToGlobal(contentsToViewport(r.topLeft())); - p->drawTiledPixmap(r,*(g_pShadedParentGlobalDesktopBackground),pnt); - return; - } -#endif - - if(KVI_OPTION_PIXMAP(KviOption_pixmapMdiBackground).pixmap()) - { - p->drawTiledPixmap(r,*(KVI_OPTION_PIXMAP(KviOption_pixmapMdiBackground).pixmap())); - } else { - p->fillRect(r,KVI_OPTION_COLOR(KviOption_colorMdiBackground)); - } -} - -void KviMdiManager::manageChild(KviMdiChild * lpC,bool bCascade,QRect *setGeom) -{ - __range_valid(lpC); - - m_pZ->insert(0,lpC); //hidden -> last in the Z order - - if(bCascade) - { - QPoint p = getCascadePoint(m_pZ->count()-1); - addChild(lpC,p.x(),p.y()); - } else { - // FIXME: is this right ? - QPoint p = lpC->pos(); - if(p.x() < 0)p.setX(0); - if(p.y() < 0)p.setY(0); - addChild(lpC,p.x(),p.y()); - - if(setGeom) - { - if(setGeom->left() < 0)setGeom->setLeft(0); - if(setGeom->top() < 0)setGeom->setTop(0); - moveChild(lpC,setGeom->x(),setGeom->y()); - lpC->setGeometry(*setGeom); - } - } - - if(KVI_OPTION_BOOL(KviOption_boolAutoTileWindows))tile(); -} - -void KviMdiManager::showAndActivate(KviMdiChild * lpC) -{ - lpC->show(); - setTopChild(lpC,true); - if(KVI_OPTION_BOOL(KviOption_boolAutoTileWindows))tile(); -} - -void KviMdiManager::setTopChild(KviMdiChild *lpC,bool bSetFocus) -{ - __range_valid(lpC); - // The following check fails safely at startup.... - // __range_valid(lpC->isVisible() || lpC->testWState(WState_ForceHide)); - - KviMdiChild * pOldTop = m_pZ->last(); - if(pOldTop != lpC) - { - m_pZ->setAutoDelete(false); - - if(!m_pZ->removeRef(lpC)) - { - m_pZ->setAutoDelete(true); - return; // no such child ? - } - - // disable the labels of all the other children - //for(KviMdiChild *pC=m_pZ->first();pC;pC=m_pZ->next()) - //{ - // pC->captionLabel()->setActive(false); - //} - KviMdiChild * pMaximizedChild = pOldTop; - if(pOldTop) - { - pOldTop->captionLabel()->setActive(false); - if(pOldTop->m_state != KviMdiChild::Maximized)pMaximizedChild=0; - } - - m_pZ->setAutoDelete(true); - m_pZ->append(lpC); - - if(pMaximizedChild)lpC->maximize(); //do not animate the change - lpC->raise(); - if(pMaximizedChild)pMaximizedChild->restore(); - } - - if(bSetFocus) - { - if(!lpC->hasFocus()) - { - lpC->setFocus(); - /* - if(topLevelWidget()->isActiveWindow()) - { - - } - */ - } - } -} - -void KviMdiManager::focusInEvent(QFocusEvent *) -{ - focusTopChild(); -} - -void KviMdiManager::destroyChild(KviMdiChild *lpC,bool bFocusTopChild) -{ - bool bWasMaximized = lpC->state() == KviMdiChild::Maximized; - disconnect(lpC); - lpC->blockSignals(true); -#ifdef _KVI_DEBUG_CHECK_RANGE_ - //Report invalid results in a debug session - __range_valid(m_pZ->removeRef(lpC)); -#else - m_pZ->removeRef(lpC); -#endif - if(bWasMaximized) - { - KviMdiChild * c=topChild(); - if(c) - { - if(c->state() != KviMdiChild::Minimized)c->maximize(); - else { - // minimized top child...the last one - leaveSDIMode(); - } - } else { - // SDI state change - leaveSDIMode(); - } - } - if(bFocusTopChild)focusTopChild(); - - if(KVI_OPTION_BOOL(KviOption_boolAutoTileWindows))tile(); - updateContentsSize(); -} - -KviMdiChild * KviMdiManager::highestChildExcluding(KviMdiChild * pChild) -{ - KviMdiChild * c = m_pZ->last(); - while(c && (c == pChild))c = m_pZ->prev(); - return c; -} - -QPoint KviMdiManager::getCascadePoint(int indexOfWindow) -{ - QPoint pnt(0,0); - if(indexOfWindow==0)return pnt; - KviMdiChild *lpC=m_pZ->first(); - int step=(lpC ? (lpC->captionLabel()->heightHint()+KVI_MDICHILD_BORDER) : 20); - int availableHeight=viewport()->height()-(lpC ? lpC->minimumSize().height() : KVI_MDICHILD_MIN_HEIGHT); - int availableWidth=viewport()->width()-(lpC ? lpC->minimumSize().width() : KVI_MDICHILD_MIN_WIDTH); - int ax=0; - int ay=0; - for(int i=0;i<indexOfWindow;i++) - { - ax+=step; - ay+=step; - if(ax>availableWidth)ax=0; - if(ay>availableHeight)ay=0; - } - pnt.setX(ax); - pnt.setY(ay); - return pnt; -} - -void KviMdiManager::mousePressEvent(QMouseEvent *e) -{ - //Popup the window menu - if(e->button() & Qt::RightButton)m_pWindowPopup->popup(mapToGlobal(e->pos())); -} - -void KviMdiManager::childMoved(KviMdiChild *) -{ - updateContentsSize(); -} - -void KviMdiManager::maximizeChild(KviMdiChild * lpC) -{ - // the children must be moved once by the means of QScrollView::moveChild() - // so the QScrollView internal structures get updated with the negative - // position of the widget, otherwise, when restoring with moveChild() - // it will refuse to move it back to the original position - resizeContents(visibleWidth(),visibleHeight()); - updateScrollBars(); - g_pApp->sendPostedEvents(); - if(g_pApp->closingDown())return; - - moveChild(lpC,-KVI_MDICHILD_HIDDEN_EDGE, - -(KVI_MDICHILD_HIDDEN_EDGE + KVI_MDICHILD_SPACING + lpC->m_pCaption->heightHint())); - - lpC->setGeometry( - -KVI_MDICHILD_HIDDEN_EDGE, - -(KVI_MDICHILD_HIDDEN_EDGE + KVI_MDICHILD_SPACING + lpC->m_pCaption->heightHint()), - viewport()->width() + (KVI_MDICHILD_HIDDEN_EDGE * 2), //KVI_MDICHILD_DOUBLE_HIDDEN_EDGE, - viewport()->height() + (KVI_MDICHILD_HIDDEN_EDGE * 2) + lpC->m_pCaption->heightHint() + KVI_MDICHILD_SPACING); - - if(isInSDIMode())updateSDIMode(); - else { - enterSDIMode(lpC); - // make sure that the child is focused - lpC->setFocus(); - } - - // fixme: we could hide all the other children now! -} - - - -void KviMdiManager::resizeEvent(QResizeEvent *e) -{ - //If we have a maximized children at the top , adjust its size - KviTalScrollView::resizeEvent(e); - KviMdiChild *lpC=m_pZ->last(); - if(lpC) - { - if(lpC->state()==KviMdiChild::Maximized) - { - // SDI mode - lpC->resize(viewport()->width() + (KVI_MDICHILD_HIDDEN_EDGE * 2), - viewport()->height() + lpC->m_pCaption->heightHint() + (KVI_MDICHILD_HIDDEN_EDGE * 2) + KVI_MDICHILD_SPACING); - return; - } else { - if(KVI_OPTION_BOOL(KviOption_boolAutoTileWindows))tile(); - } - } - updateContentsSize(); -} - - -/* -void KviMdiManager::childMaximized(KviMdiChild * lpC) -{ - if(lpC == m_pZ->last()) - { - enterSDIMode(lpC); - } - updateContentsSize(); -} -*/ - -void KviMdiManager::childMinimized(KviMdiChild * lpC,bool bWasMaximized) -{ - __range_valid(lpC); - if(m_pZ->findRef(lpC) == -1)return; - if(m_pZ->count() > 1) - { - m_pZ->setAutoDelete(false); -#ifdef _KVI_DEBUG_CHECK_RANGE_ - //Report invalid results in a debug session - __range_valid(m_pZ->removeRef(lpC)); -#else - m_pZ->removeRef(lpC); -#endif - m_pZ->setAutoDelete(true); - m_pZ->insert(0,lpC); - if(bWasMaximized) - { - // Need to maximize the top child - lpC = m_pZ->last(); - if(!lpC)return; //?? - if(lpC->state()==KviMdiChild::Minimized) - { - if(bWasMaximized)leaveSDIMode(); - return; - } - lpC->maximize(); //do nrot animate the change - } else { - if(KVI_OPTION_BOOL(KviOption_boolAutoTileWindows))tile(); - } - focusTopChild(); - } else { - // Unique window minimized...it won't loose the focus...!! - setFocus(); //Remove focus from the child - if(bWasMaximized)leaveSDIMode(); - } - updateContentsSize(); -} - -void KviMdiManager::childRestored(KviMdiChild * lpC,bool bWasMaximized) -{ - if(bWasMaximized) - { - if(lpC != m_pZ->last())return; // do nothing in this case - leaveSDIMode(); - updateContentsSize(); - } - if(KVI_OPTION_BOOL(KviOption_boolAutoTileWindows))tile(); -} - -void KviMdiManager::focusTopChild() -{ - KviMdiChild *lpC=m_pZ->last(); - if(!lpC)return; - if(!lpC->isVisible())return; - // if(lpC->state()==KviMdiChild::Minimized)return; - // debug("Focusing top child %s",lpC->name()); - //disable the labels of all the other children - for(KviMdiChild *pC=m_pZ->first();pC;pC=m_pZ->next()) - { - if(pC != lpC) - pC->captionLabel()->setActive(false); - } - lpC->raise(); - if(!lpC->hasFocus())lpC->setFocus(); -} - -void KviMdiManager::minimizeActiveChild() -{ - KviMdiChild * lpC = m_pZ->last(); - if(!lpC)return; - if(lpC->state() != KviMdiChild::Minimized)lpC->minimize(); -} - -void KviMdiManager::restoreActiveChild() -{ - KviMdiChild * lpC = m_pZ->last(); - if(!lpC)return; - if(lpC->state() == KviMdiChild::Maximized)lpC->restore(); -} - -void KviMdiManager::closeActiveChild() -{ - KviMdiChild * lpC = m_pZ->last(); - if(!lpC)return; - lpC->closeRequest(); -} - -void KviMdiManager::updateContentsSize() -{ - KviMdiChild * c = m_pZ->last(); - if(c) - { - if(c->state() == KviMdiChild::Maximized) - { - return; - } - } - - int fw = frameWidth() * 2; - int mx = width() - fw; - int my = height() - fw; - - for(c = m_pZ->first();c;c = m_pZ->next()) - { - if(c->isVisible()) - { - int x = childX(c) + c->width(); - if(x > mx)mx = x; - int y = childY(c) + c->height(); - if(y > my)my = y; - } - } - - resizeContents(mx,my); -} - - -void KviMdiManager::updateSDIMode() -{ - - KviMdiChild * lpC = m_pZ->last(); - - if(m_pSdiCloseButton) - m_pSdiCloseButton->setEnabled(lpC ? lpC->closeEnabled() : false); - -// This would result in an addictional main menu bar entry on MacOSX which would trigger a popup menu and not -// a submenu. Due to the optical reasons it is removed here. -// The same popup is triggered by right clicking on the window name in the channel window list. -#ifndef Q_OS_MACX - KviMenuBar * b = m_pFrm->mainMenuBar(); - - const QPixmap * pix = lpC ? lpC->icon() : 0; - if(!pix)pix = g_pIconManager->getSmallIcon(KVI_SMALLICON_NONE); - else if(pix->isNull())pix = g_pIconManager->getSmallIcon(KVI_SMALLICON_NONE); - - if(!m_pSdiIconButton) - { - m_pSdiIconButton = new KviMenuBarToolButton(b,*pix,"nonne"); - connect(m_pSdiIconButton,SIGNAL(clicked()),this,SLOT(activeChildSystemPopup())); -#ifdef COMPILE_USE_QT4 - // This is an obscure, undocumented and internal function in QT4 QMenuBar - // I won't be surprised if this disappears.... - b->setCornerWidget(m_pSdiIconButton,Qt::TopLeftCorner); - m_pSdiIconButton->show(); -#else - m_iSdiIconItemId = b->insertItem(m_pSdiIconButton,-1,0); -#endif - connect(m_pSdiIconButton,SIGNAL(destroyed()),this,SLOT(sdiIconButtonDestroyed())); - } else { - m_pSdiIconButton->setPixmap(*pix); - } -#endif //Q_OS_MACX -} - -void KviMdiManager::activeChildSystemPopup() -{ - KviMdiChild * lpC = m_pZ->last(); - if(!lpC)return; - QPoint pnt; - if(m_pSdiIconButton) - { - pnt = m_pSdiIconButton->mapToGlobal(QPoint(0,m_pSdiIconButton->height())); - } else { - pnt = QCursor::pos(); - } - lpC->emitSystemPopupRequest(pnt); -} - -bool KviMdiManager::isInSDIMode() -{ - return (m_pSdiCloseButton != 0); -} - - -void KviMdiManager::enterSDIMode(KviMdiChild *lpC) -{ - if(!m_pSdiCloseButton) - { - KviMenuBar * b = m_pFrm->mainMenuBar(); - - QWidget * pButtonParent; - -#ifdef COMPILE_USE_QT4 - m_pSdiControls = new KviTalHBox(b); - m_pSdiControls->setMargin(0); - m_pSdiControls->setSpacing(2); - m_pSdiControls->setAutoFillBackground(false); - pButtonParent = m_pSdiControls; -#else - pButtonParent = b; -#endif - m_pSdiMinimizeButton = new KviMenuBarToolButton(pButtonParent,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MINIMIZE)),"btnminimize"); - connect(m_pSdiMinimizeButton,SIGNAL(clicked()),this,SLOT(minimizeActiveChild())); -#ifndef COMPILE_USE_QT4 - m_iSdiMinimizeItemId = b->insertItem(m_pSdiMinimizeButton,-1,b->count()); -#endif - connect(m_pSdiMinimizeButton,SIGNAL(destroyed()),this,SLOT(sdiMinimizeButtonDestroyed())); - - m_pSdiRestoreButton = new KviMenuBarToolButton(pButtonParent,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_RESTORE)),"btnrestore"); - connect(m_pSdiRestoreButton,SIGNAL(clicked()),this,SLOT(restoreActiveChild())); -#ifndef COMPILE_USE_QT4 - m_iSdiRestoreItemId = b->insertItem(m_pSdiRestoreButton,-1,b->count()); -#endif - connect(m_pSdiRestoreButton,SIGNAL(destroyed()),this,SLOT(sdiRestoreButtonDestroyed())); - - m_pSdiCloseButton = new KviMenuBarToolButton(pButtonParent,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CLOSE)),"btnclose"); - connect(m_pSdiCloseButton,SIGNAL(clicked()),this,SLOT(closeActiveChild())); -#ifndef COMPILE_USE_QT4 - m_iSdiCloseItemId = b->insertItem(m_pSdiCloseButton,-1,b->count()); -#endif - connect(m_pSdiCloseButton,SIGNAL(destroyed()),this,SLOT(sdiCloseButtonDestroyed())); - -#ifdef COMPILE_USE_QT4 - // This is an obscure, undocumented and internal function in QT4 QMenuBar - // I won't be surprised if this disappears.... - b->setCornerWidget(m_pSdiControls,Qt::TopRightCorner); - // The show below SHOULD force a re-layout of the menubar.. - // but it doesn't work when the KviFrame is still hidden (at startup) - // We handle this BUG in showEvent() - m_pSdiControls->show(); -#else - m_pSdiRestoreButton->show(); - m_pSdiMinimizeButton->show(); - m_pSdiCloseButton->show(); -#endif - emit enteredSdiMode(); - - setVScrollBarMode(KviTalScrollView::AlwaysOff); - setHScrollBarMode(KviTalScrollView::AlwaysOff); - } - - updateSDIMode(); -} -void KviMdiManager::relayoutMenuButtons() -{ -#ifdef COMPILE_USE_QT4 - // force a re-layout of the menubar in Qt4 (see the note in enterSDIMode()) - // by resetting the corner widget - if(m_pSdiControls) - { - m_pFrm->mainMenuBar()->setCornerWidget(0,Qt::TopRightCorner); - m_pFrm->mainMenuBar()->setCornerWidget(m_pSdiControls,Qt::TopRightCorner); - } - // also force an activation of the top MdiChild since it probably didn't get it yet - KviMdiChild * c = topChild(); - if(c) - c->activate(false); -#endif -} - - -void KviMdiManager::sdiIconButtonDestroyed() -{ - m_iSdiIconItemId = 0; - m_pSdiIconButton = 0; -} - -void KviMdiManager::sdiMinimizeButtonDestroyed() -{ - m_iSdiMinimizeItemId = 0; - m_pSdiMinimizeButton = 0; -} - -void KviMdiManager::sdiRestoreButtonDestroyed() -{ - m_iSdiRestoreItemId = 0; - m_pSdiRestoreButton = 0; -} - -void KviMdiManager::sdiCloseButtonDestroyed() -{ - m_iSdiCloseItemId = 0; - m_pSdiCloseButton = 0; -} - -void KviMdiManager::leaveSDIMode() -{ - __range_valid(m_pSdiCloseButton); - -#ifdef COMPILE_USE_QT4 - if(m_pSdiControls) - { - delete m_pSdiControls; - m_pSdiControls = 0; - } - if(m_pSdiIconButton) - { - m_pSdiIconButton->hide(); // this will force a QMenuBar relayout - delete m_pSdiIconButton; - m_pSdiIconButton = 0; - } -#else - if(m_iSdiIconItemId != 0)m_pFrm->mainMenuBar()->removeItem(m_iSdiIconItemId); - if(m_iSdiCloseItemId != 0)m_pFrm->mainMenuBar()->removeItem(m_iSdiCloseItemId); - if(m_iSdiRestoreItemId != 0)m_pFrm->mainMenuBar()->removeItem(m_iSdiRestoreItemId); - if(m_iSdiMinimizeItemId != 0)m_pFrm->mainMenuBar()->removeItem(m_iSdiMinimizeItemId); -#endif - - setVScrollBarMode(KviTalScrollView::Auto); - setHScrollBarMode(KviTalScrollView::Auto); - - emit leftSdiMode(); -} - -#define KVI_TILE_METHOD_ANODINE 0 -#define KVI_TILE_METHOD_PRAGMA4HOR 1 -#define KVI_TILE_METHOD_PRAGMA4VER 2 -#define KVI_TILE_METHOD_PRAGMA6HOR 3 -#define KVI_TILE_METHOD_PRAGMA6VER 4 -#define KVI_TILE_METHOD_PRAGMA9HOR 5 -#define KVI_TILE_METHOD_PRAGMA9VER 6 - -#define KVI_NUM_TILE_METHODS 7 - -void KviMdiManager::fillWindowPopup() -{ - m_pWindowPopup->clear(); - - m_pWindowPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CASCADEWINDOWS)),(__tr2qs("&Cascade Windows")),this,SLOT(cascadeWindows())); - m_pWindowPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CASCADEWINDOWS)),(__tr2qs("Cascade &Maximized")),this,SLOT(cascadeMaximized())); - - m_pWindowPopup->insertSeparator(); - m_pWindowPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TILEWINDOWS)),(__tr2qs("&Tile Windows")),this,SLOT(tile())); - - m_pTileMethodPopup->clear(); - int id = m_pTileMethodPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_AUTOTILEWINDOWS)),(__tr2qs("&Auto Tile")),this,SLOT(toggleAutoTile())); - m_pTileMethodPopup->setItemChecked(id,KVI_OPTION_BOOL(KviOption_boolAutoTileWindows)); - m_pTileMethodPopup->setItemParameter(id,-1); - m_pTileMethodPopup->insertSeparator(); - int ids[KVI_NUM_TILE_METHODS]; - ids[KVI_TILE_METHOD_ANODINE] = m_pTileMethodPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TILEWINDOWS)),(__tr2qs("Anodine's Full Grid"))); - m_pTileMethodPopup->setItemParameter(ids[KVI_TILE_METHOD_ANODINE],KVI_TILE_METHOD_ANODINE); - ids[KVI_TILE_METHOD_PRAGMA4HOR] = m_pTileMethodPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TILEWINDOWS)),(__tr2qs("Pragma's Horizontal 4-Grid"))); - m_pTileMethodPopup->setItemParameter(ids[KVI_TILE_METHOD_PRAGMA4HOR],KVI_TILE_METHOD_PRAGMA4HOR); - ids[KVI_TILE_METHOD_PRAGMA4VER] = m_pTileMethodPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TILEWINDOWS)),(__tr2qs("Pragma's Vertical 4-Grid"))); - m_pTileMethodPopup->setItemParameter(ids[KVI_TILE_METHOD_PRAGMA4VER],KVI_TILE_METHOD_PRAGMA4VER); - ids[KVI_TILE_METHOD_PRAGMA6HOR] = m_pTileMethodPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TILEWINDOWS)),(__tr2qs("Pragma's Horizontal 6-Grid"))); - m_pTileMethodPopup->setItemParameter(ids[KVI_TILE_METHOD_PRAGMA6HOR],KVI_TILE_METHOD_PRAGMA6HOR); - ids[KVI_TILE_METHOD_PRAGMA6VER] = m_pTileMethodPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TILEWINDOWS)),(__tr2qs("Pragma's Vertical 6-Grid"))); - m_pTileMethodPopup->setItemParameter(ids[KVI_TILE_METHOD_PRAGMA6VER],KVI_TILE_METHOD_PRAGMA6VER); - ids[KVI_TILE_METHOD_PRAGMA9HOR] = m_pTileMethodPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TILEWINDOWS)),(__tr2qs("Pragma's Horizontal 9-Grid"))); - m_pTileMethodPopup->setItemParameter(ids[KVI_TILE_METHOD_PRAGMA9HOR],KVI_TILE_METHOD_PRAGMA9HOR); - ids[KVI_TILE_METHOD_PRAGMA9VER] = m_pTileMethodPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TILEWINDOWS)),(__tr2qs("Pragma's Vertical 9-Grid"))); - m_pTileMethodPopup->setItemParameter(ids[KVI_TILE_METHOD_PRAGMA9VER],KVI_TILE_METHOD_PRAGMA9VER); - - if(KVI_OPTION_UINT(KviOption_uintTileMethod) >= KVI_NUM_TILE_METHODS)KVI_OPTION_UINT(KviOption_uintTileMethod) = KVI_TILE_METHOD_PRAGMA9HOR; - m_pTileMethodPopup->setItemChecked(ids[KVI_OPTION_UINT(KviOption_uintTileMethod)],true); - - m_pWindowPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TILEWINDOWS)),(__tr2qs("Tile Met&hod")),m_pTileMethodPopup); - - m_pWindowPopup->insertSeparator(); - m_pWindowPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MAXVERTICAL)),(__tr2qs("Expand &Vertically")),this,SLOT(expandVertical())); - m_pWindowPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MAXHORIZONTAL)),(__tr2qs("Expand &Horizontally")),this,SLOT(expandHorizontal())); - - m_pWindowPopup->insertSeparator(); - m_pWindowPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MINIMIZE)),(__tr2qs("Mi&nimize All")),this,SLOT(minimizeAll())); -// m_pWindowPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_RESTORE)),(__tr2qs("&Restore all")),this,SLOT(restoreAll())); -// - m_pWindowPopup->insertSeparator(); - int i=100; - QString szItem; - QString szCaption; - for(KviMdiChild *lpC=m_pZ->first();lpC;lpC=m_pZ->next()) - { - szItem.setNum(((uint)i)-99); - szItem+=". "; - - szCaption = lpC->plainCaption(); - if(szCaption.length() > 30) - { - QString trail = szCaption.right(12); - szCaption.truncate(12); - szCaption+="..."; - szCaption+=trail; - } - - if(lpC->state()==KviMdiChild::Minimized) - { - szItem+="("; - szItem+=szCaption; - szItem+=")"; - } else szItem+=szCaption; - const QPixmap * pix = lpC->icon(); - if(pix && !(pix->isNull()))m_pWindowPopup->insertItem(*pix,szItem,i); - else m_pWindowPopup->insertItem(szItem,i); - m_pWindowPopup->setItemChecked(i,((uint)i)==(m_pZ->count()+99)); - i++; - } -} - -void KviMdiManager::menuActivated(int id) -{ - if(id<100)return; - id-=100; - __range_valid(((uint)id) < m_pZ->count()); - KviMdiChild *lpC=m_pZ->at(id); - if(!lpC)return; - if(lpC->state()==KviMdiChild::Minimized)lpC->restore(); - setTopChild(lpC,true); -} - -void KviMdiManager::ensureNoMaximized() -{ - KviMdiChild * lpC; - - for(lpC=m_pZ->first();lpC;lpC=m_pZ->next()) - { - if(lpC->state()==KviMdiChild::Maximized)lpC->restore(); - } -} - -void KviMdiManager::tileMethodMenuActivated(int id) -{ - int idx = m_pTileMethodPopup->itemParameter(id); - if(idx < 0)idx = 0; - if(idx >= KVI_NUM_TILE_METHODS)idx = KVI_TILE_METHOD_PRAGMA9VER; - KVI_OPTION_UINT(KviOption_uintTileMethod) = idx; - if(KVI_OPTION_BOOL(KviOption_boolAutoTileWindows))tile(); -} - -void KviMdiManager::cascadeWindows() -{ - ensureNoMaximized(); - // this hack is needed to ensure that the scrollbars are hidden and the viewport()->width() and height() are correct - resizeContents(visibleWidth(),visibleHeight()); - updateScrollBars(); - g_pApp->sendPostedEvents(); - if(g_pApp->closingDown())return; - - int idx=0; - KviPointerList<KviMdiChild> list(*m_pZ); - list.setAutoDelete(false); - while(!list.isEmpty()) - { - KviMdiChild *lpC=list.first(); - if(lpC->state() != KviMdiChild::Minimized) - { - QPoint p = getCascadePoint(idx); - moveChild(lpC,p.x(),p.y()); - lpC->resize(lpC->sizeHint()); - idx++; - } - list.removeFirst(); - } - focusTopChild(); - updateContentsSize(); -} - -void KviMdiManager::cascadeMaximized() -{ - ensureNoMaximized(); - // this hack is needed to ensure that the scrollbars are hidden and the viewport()->width() and height() are correct - resizeContents(visibleWidth(),visibleHeight()); - updateScrollBars(); - g_pApp->sendPostedEvents(); - if(g_pApp->closingDown())return; - - int idx=0; - KviPointerList<KviMdiChild> list(*m_pZ); - - list.setAutoDelete(false); - while(!list.isEmpty()) - { - KviMdiChild *lpC=list.first(); - if(lpC->state() != KviMdiChild::Minimized) - { - QPoint pnt(getCascadePoint(idx)); - moveChild(lpC,pnt.x(),pnt.y()); - QSize curSize(viewport()->width() - pnt.x(),viewport()->height() - pnt.y()); - if((lpC->minimumSize().width() > curSize.width()) || - (lpC->minimumSize().height() > curSize.height()))lpC->resize(lpC->minimumSize()); - else lpC->resize(curSize); - idx++; - } - list.removeFirst(); - } - focusTopChild(); - updateContentsSize(); -} - -void KviMdiManager::expandVertical() -{ - ensureNoMaximized(); - // this hack is needed to ensure that the scrollbars are hidden and the viewport()->width() and height() are correct - resizeContents(visibleWidth(),visibleHeight()); - updateScrollBars(); - g_pApp->sendPostedEvents(); - if(g_pApp->closingDown())return; - - KviPointerList<KviMdiChild> list(*m_pZ); - list.setAutoDelete(false); - while(!list.isEmpty()) - { - KviMdiChild *lpC=list.first(); - if(lpC->state() != KviMdiChild::Minimized) - { - moveChild(lpC,lpC->x(),0); - lpC->resize(lpC->width(),viewport()->height()); - } - list.removeFirst(); - } - - focusTopChild(); - updateContentsSize(); -} - -void KviMdiManager::expandHorizontal() -{ - ensureNoMaximized(); - // this hack is needed to ensure that the scrollbars are hidden and the viewport()->width() and height() are correct - resizeContents(visibleWidth(),visibleHeight()); - updateScrollBars(); - g_pApp->sendPostedEvents(); - if(g_pApp->closingDown())return; - - KviPointerList<KviMdiChild> list(*m_pZ); - list.setAutoDelete(false); - while(!list.isEmpty()) - { - KviMdiChild *lpC=list.first(); - if(lpC->state() != KviMdiChild::Minimized) - { - moveChild(lpC,0,lpC->y()); - lpC->resize(viewport()->width(),lpC->height()); - } - list.removeFirst(); - } - focusTopChild(); - updateContentsSize(); -} - -void KviMdiManager::minimizeAll() -{ - KviPointerList<KviMdiChild> list(*m_pZ); - list.setAutoDelete(false); - m_pFrm->setActiveWindow((KviWindow*)m_pFrm->firstConsole()); - while(!list.isEmpty()) - { - KviMdiChild *lpC=list.first(); - if(lpC->state() != KviMdiChild::Minimized)lpC->minimize(); - list.removeFirst(); - } - focusTopChild(); - updateContentsSize(); -} - -/* -void KviMdiManager::restoreAll() -{ - int idx=0; - KviPointerList<KviMdiChild> list(*m_pZ); - list.setAutoDelete(false); - while(!list.isEmpty()) - { - KviMdiChild *lpC=list.first(); - if(lpC->state() != KviMdiChild::Normal && (!(lpC->plainCaption()).contains("CONSOLE") )) - lpC->restore(); - list.removeFirst(); - } - focusTopChild(); - updateContentsSize(); -} -*/ - -int KviMdiManager::getVisibleChildCount() -{ - int cnt=0; - for(KviMdiChild *lpC=m_pZ->first();lpC;lpC=m_pZ->next()) - { - if(lpC->state() != KviMdiChild::Minimized)cnt++; - } - return cnt; -} - -void KviMdiManager::tile() -{ - switch(KVI_OPTION_UINT(KviOption_uintTileMethod)) - { - case KVI_TILE_METHOD_ANODINE: tileAnodine(); break; - case KVI_TILE_METHOD_PRAGMA4HOR: tileAllInternal(4,true); break; - case KVI_TILE_METHOD_PRAGMA4VER: tileAllInternal(4,false); break; - case KVI_TILE_METHOD_PRAGMA6HOR: tileAllInternal(6,true); break; - case KVI_TILE_METHOD_PRAGMA6VER: tileAllInternal(6,false); break; - case KVI_TILE_METHOD_PRAGMA9HOR: tileAllInternal(9,true); break; - case KVI_TILE_METHOD_PRAGMA9VER: tileAllInternal(9,false); break; - default: - KVI_OPTION_UINT(KviOption_uintTileMethod) = KVI_TILE_METHOD_PRAGMA9HOR; - tileAllInternal(9,true); - break; - } -} - -void KviMdiManager::toggleAutoTile() -{ - if(KVI_OPTION_BOOL(KviOption_boolAutoTileWindows)) - { - KVI_OPTION_BOOL(KviOption_boolAutoTileWindows) = false; - } else { - KVI_OPTION_BOOL(KviOption_boolAutoTileWindows) = true; - tile(); - } -} - - -void KviMdiManager::tileAllInternal(int maxWnds,bool bHorizontal) -{ - //NUM WINDOWS = 1,2,3,4,5,6,7,8,9 - static int colstable[9]={ 1,1,1,2,2,2,3,3,3 }; //num columns - static int rowstable[9]={ 1,2,3,2,3,3,3,3,3 }; //num rows - static int lastwindw[9]={ 1,1,1,1,2,1,3,2,1 }; //last window multiplier - static int colrecall[9]={ 0,0,0,3,3,3,6,6,6 }; //adjust self - static int rowrecall[9]={ 0,0,0,0,4,4,4,4,4 }; //adjust self - - int * pColstable = bHorizontal ? colstable : rowstable; - int * pRowstable = bHorizontal ? rowstable : colstable; - int * pColrecall = bHorizontal ? colrecall : rowrecall; - int * pRowrecall = bHorizontal ? rowrecall : colrecall; - - ensureNoMaximized(); - // this hack is needed to ensure that the scrollbars are hidden and the viewport()->width() and height() are correct - resizeContents(visibleWidth(),visibleHeight()); - updateScrollBars(); - g_pApp->sendPostedEvents(); - if(g_pApp->closingDown())return; - - KviMdiChild *lpTop=topChild(); - int numVisible=getVisibleChildCount(); - - if(numVisible<1)return; - - int numToHandle=((numVisible > maxWnds) ? maxWnds : numVisible); - int xQuantum=viewport()->width()/pColstable[numToHandle-1]; - if(xQuantum < ((lpTop->minimumSize().width() > KVI_MDICHILD_MIN_WIDTH) ? lpTop->minimumSize().width() : KVI_MDICHILD_MIN_WIDTH)){ - if(pColrecall[numToHandle-1]==0)debug("Tile : Not enouh space"); - else tileAllInternal(pColrecall[numToHandle-1],bHorizontal); - return; - } - int yQuantum=viewport()->height()/pRowstable[numToHandle-1]; - if(yQuantum < ((lpTop->minimumSize().height() > KVI_MDICHILD_MIN_HEIGHT) ? lpTop->minimumSize().height() : KVI_MDICHILD_MIN_HEIGHT)){ - if(pRowrecall[numToHandle-1]==0)debug("Tile : Not enough space"); - else tileAllInternal(pRowrecall[numToHandle-1],bHorizontal); - return; - } - int curX=0; - int curY=0; - int curRow=1; - int curCol=1; - int curWin=1; - - for(KviMdiChild * lpC=m_pZ->first();lpC;lpC=m_pZ->next()) - { - if(lpC->state()!=KviMdiChild::Minimized) - { - if((curWin%numToHandle)==0) - { - moveChild(lpC,curX,curY); - lpC->resize(xQuantum * lastwindw[numToHandle-1],yQuantum); - } else { - moveChild(lpC,curX,curY); - lpC->resize(xQuantum,yQuantum); - } - //example : 12 windows : 3 cols 3 rows - if(curCol<pColstable[numToHandle-1]) - { //curCol<3 - curX+=xQuantum; //add a column in the same row - curCol++; //increase current column - } else { - curX=0; //new row - curCol=1; //column 1 - if(curRow<pRowstable[numToHandle-1]) - { //curRow<3 - curY+=yQuantum; //add a row - curRow++; // - } else { - curY=0; //restart from beginning - curRow=1; // - } - } - curWin++; - } - } - if(lpTop)lpTop->setFocus(); - updateContentsSize(); -} - -void KviMdiManager::tileAnodine() -{ - ensureNoMaximized(); - // this hack is needed to ensure that the scrollbars are hidden and the viewport()->width() and height() are correct - resizeContents(visibleWidth(),visibleHeight()); - updateScrollBars(); - g_pApp->sendPostedEvents(); - if(g_pApp->closingDown())return; - - KviMdiChild *lpTop=topChild(); - int numVisible=getVisibleChildCount(); // count visible windows - if(numVisible<1)return; - int numCols=int(sqrt((double)numVisible)); // set columns to square root of visible count - // create an array to form grid layout - int *numRows=new int[numCols]; - int numCurCol=0; - while(numCurCol<numCols) - { - numRows[numCurCol]=numCols; // create primary grid values - numCurCol++; - } - int numDiff=numVisible-(numCols*numCols); // count extra rows - int numCurDiffCol=numCols; // set column limiting for grid updates - while(numDiff>0) - { - numCurDiffCol--; - numRows[numCurDiffCol]++; // add extra rows to column grid - if(numCurDiffCol<1)numCurDiffCol=numCols; // rotate through the grid - numDiff--; - } - numCurCol=0; - int numCurRow=0; - int curX=0; - int curY=0; - // the following code will size everything based on my grid above - // there is no limit to the number of windows it will handle - // it's great when a kick-ass theory works!!! // Pragma :) - int xQuantum=viewport()->width()/numCols; - int yQuantum=viewport()->height()/numRows[numCurCol]; - - for(KviMdiChild * lpC=m_pZ->first();lpC;lpC=m_pZ->next()) - { - if(lpC->state() != KviMdiChild::Minimized) - { - moveChild(lpC,curX,curY); - lpC->resize(xQuantum,yQuantum); - numCurRow++; - curY+=yQuantum; - if(numCurRow==numRows[numCurCol]) - { - numCurRow=0; - numCurCol++; - curY=0; - curX+=xQuantum; - if(numCurCol!=numCols)yQuantum=viewport()->height()/numRows[numCurCol]; - } - } - } - delete[] numRows; - if(lpTop)lpTop->setFocus(); - updateContentsSize(); -} - - diff --git a/3.4.0/src/kvirc/ui/kvi_mdimanager.h b/3.4.0/src/kvirc/ui/kvi_mdimanager.h deleted file mode 100644 index dba19b0ee3..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_mdimanager.h +++ /dev/null @@ -1,144 +0,0 @@ -#ifndef _KVI_MDIMANAGER_H_ -#define _KVI_MDIMANAGER_H_ -//============================================================================= -// -// File : kvi_mdimanager.h -// Creation date : Wed Jun 21 2000 17:28:04 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_pointerlist.h" - -#include <qwidget.h> -#include <qframe.h> -#include <qpixmap.h> -#include <qtoolbutton.h> - -#include "kvi_tal_scrollview.h" - -#define KVI_MDICHILD_BORDER 4 -#define KVI_MDICHILD_SPACING 2 -#define KVI_MDICHILD_MIN_WIDTH 100 -#define KVI_MDICHILD_MIN_HEIGHT 40 -#define KVI_MDICHILD_HIDDEN_EDGE 3 - -#ifdef COMPILE_ON_WINDOWS - #include "kvi_mdichild.h" -#else - class KviMdiChild; -#endif -//class KviMdiCaptionButton; -class KviFrame; - -class KviTalPopupMenu; -class KviTalHBox; -class KviSdiButtonBox; -class KviMenuBarToolButton; - -class KVIRC_API KviMdiManager : public KviTalScrollView -{ - friend class KviMdiChild; - friend class KviMdiCaption; - Q_OBJECT -public: - KviMdiManager(QWidget * parent,KviFrame * pFrm,const char * name); - ~KviMdiManager(); -public: - KviMdiChild * topChild(){ return m_pZ->last(); }; - KviMdiChild * highestChildExcluding(KviMdiChild * pChild); - void manageChild(KviMdiChild * lpC,bool bCascade = true,QRect * setGeom = 0); - void setTopChild(KviMdiChild *lpC,bool bSetFocus); - void showAndActivate(KviMdiChild * lpC); - KviTalPopupMenu * windowPopup(){ return m_pWindowPopup; }; - void focusTopChild(); - void destroyChild(KviMdiChild *lpC,bool bFocusTopChild = true); - int getVisibleChildCount(); - bool isInSDIMode(); -protected: - KviPointerList<KviMdiChild> * m_pZ; // topmost child is the last in the list - - KviMenuBarToolButton * m_pSdiRestoreButton; - KviMenuBarToolButton * m_pSdiMinimizeButton; - KviMenuBarToolButton * m_pSdiCloseButton; - KviMenuBarToolButton * m_pSdiIconButton; - -#ifdef COMPILE_USE_QT4 - KviTalHBox * m_pSdiControls; -#endif - int m_iSdiIconItemId; - int m_iSdiRestoreItemId; - int m_iSdiMinimizeItemId; - int m_iSdiCloseItemId; - - KviTalPopupMenu * m_pWindowPopup; - KviTalPopupMenu * m_pTileMethodPopup; - KviFrame * m_pFrm; -protected: - void updateContentsSize(); - //void childMaximized(KviMdiChild *lpC); - void childMinimized(KviMdiChild *lpC,bool bWasMaximized); - void childRestored(KviMdiChild *lpC,bool bWasMaximized); - void childMoved(KviMdiChild * lpC); - void maximizeChild(KviMdiChild * lpC); - virtual void focusInEvent(QFocusEvent *e); - virtual void mousePressEvent(QMouseEvent *e); - virtual void resizeEvent(QResizeEvent *e); - virtual void drawContents(QPainter * p,int x,int y,int w,int h); - virtual bool focusNextPrevChild(bool pNext); -public slots: - void relayoutMenuButtons(); - void cascadeWindows(); - void cascadeMaximized(); - void expandVertical(); - void expandHorizontal(); - void minimizeAll(); -// void restoreAll(); <-- this does nothing - void tile(); - void toggleAutoTile(); - - void tileAnodine(); - void reloadImages(); -protected slots: - void minimizeActiveChild(); - void restoreActiveChild(); - void closeActiveChild(); - void activeChildSystemPopup(); - void menuActivated(int id); - void tileMethodMenuActivated(int id); - void fillWindowPopup(); - void sdiMinimizeButtonDestroyed(); - void sdiRestoreButtonDestroyed(); - void sdiCloseButtonDestroyed(); - void sdiIconButtonDestroyed(); -private: - void ensureNoMaximized(); - void tileAllInternal(int maxWnds,bool bHorizontal); - QPoint getCascadePoint(int indexOfWindow); - void enterSDIMode(KviMdiChild *lpC); - void leaveSDIMode(); - void updateSDIMode(); -signals: - void enteredSdiMode(); - void leftSdiMode(); -}; - -#endif //_KVI_MDIMANAGER_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_menubar.cpp b/3.4.0/src/kvirc/ui/kvi_menubar.cpp deleted file mode 100644 index a219b204ac..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_menubar.cpp +++ /dev/null @@ -1,415 +0,0 @@ -//============================================================================= -// -// File : kvi_menubar.cpp -// Creation date : Wen Jun 21 2000 13:12:11 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2005 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_menubar.h" -#include "kvi_app.h" -#include "kvi_locale.h" -#include "kvi_frame.h" -#include "kvi_mdimanager.h" -#include "kvi_iconmanager.h" -#include "kvi_internalcmd.h" -#include "kvi_settings.h" -#include "kvi_ircurl.h" -#include "kvi_console.h" -#include "kvi_kvs_popupmenu.h" -#include "kvi_malloc.h" -#include "kvi_moduleextension.h" -#include "kvi_actionmanager.h" -#include "kvi_coreactionnames.h" -#include "kvi_kvs_script.h" - -#include "kvi_tal_popupmenu.h" - -KviMenuBar::KviMenuBar(KviFrame * par,const char * name) - : KviTalMenuBar(par,name) -{ - m_pFrm = par; - - m_iNumDefaultItems = 0; - m_pDefaultItemId = 0; - - KviTalPopupMenu * pop = new KviTalPopupMenu(this,"KVIrc"); - connect(pop,SIGNAL(aboutToShow()),this,SLOT(setupMainPopup())); -#ifndef Q_OS_MACX - addDefaultItem("&KVIrc",pop); -#else - // Qt/Mac creates already a "KVirc" menu item on its own, and we don't like double entries ;-) - addDefaultItem("&IRC",pop); -#endif //Q_OS_MACX - m_pRecentServersPopup = new KviTalPopupMenu(this,"recentservers"); - connect(m_pRecentServersPopup,SIGNAL(aboutToShow()),this,SLOT(setupRecentServersPopup())); - connect(m_pRecentServersPopup,SIGNAL(activated(int)),this,SLOT(newConnectionToServer(int))); - - m_pScriptItemList = 0; - - pop = new KviTalPopupMenu(this,"scripting"); - connect(pop,SIGNAL(aboutToShow()),this,SLOT(setupScriptingPopup())); - addDefaultItem(__tr2qs("Scri&pting"),pop); - - pop = new KviTalPopupMenu(this,"tools"); - connect(pop,SIGNAL(aboutToShow()),this,SLOT(setupToolsPopup())); - connect(pop,SIGNAL(activated(int)),this,SLOT(toolsPopupSelected(int))); - addDefaultItem(__tr2qs("&Tools"),pop); - - m_pToolbarsPopup = new KviTalPopupMenu(this,"toolbars"); - connect(m_pToolbarsPopup,SIGNAL(aboutToShow()),this,SLOT(setupToolbarsPopup())); - - pop = new KviTalPopupMenu(this,"settings"); - connect(pop,SIGNAL(aboutToShow()),this,SLOT(setupSettingsPopup())); - addDefaultItem(__tr2qs("&Settings"),pop); - - addDefaultItem(__tr2qs("&Window"),par->mdiManager()->windowPopup()); - - pop = new KviTalPopupMenu(this,"help"); - connect(pop,SIGNAL(aboutToShow()),this,SLOT(setupHelpPopup())); - addDefaultItem(__tr2qs("&Help"),pop); -} - -KviMenuBar::~KviMenuBar() -{ - if(m_pScriptItemList)delete m_pScriptItemList; - if(m_pDefaultItemId)kvi_free(m_pDefaultItemId); -} - -void KviMenuBar::showEvent(QShowEvent *e) -{ -#ifdef COMPILE_USE_QT4 - debug("menubar show"); - // force a re-layout of the menubar in Qt4 (see the note in enterSDIMode()) - // by resetting the corner widget - m_pFrm->mdiManager()->relayoutMenuButtons(); -#endif -} - -void KviMenuBar::addDefaultItem(const QString &text,KviTalPopupMenu * pop) -{ - m_iNumDefaultItems++; - m_pDefaultItemId = (int *)kvi_realloc((void *)m_pDefaultItemId,sizeof(int) * m_iNumDefaultItems); - m_pDefaultItemId[m_iNumDefaultItems - 1] = insertItem(text,pop); -} - -void KviMenuBar::setupHelpPopup() -{ - KviTalPopupMenu * help = (KviTalPopupMenu *)sender(); - help->clear(); - - // FIXME: Convert these to actions! - int id = help->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_HELP)),__tr2qs("&Help Browser (Panel)"),m_pFrm,SLOT(executeInternalCommand(int))); - help->setItemParameter(id,KVI_INTERNALCOMMAND_HELP_NEWSTATICWINDOW); - id = help->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MDIHELP)),__tr2qs("Help Browser (&Window)"),m_pFrm,SLOT(executeInternalCommand(int))); - help->setItemParameter(id,KVI_INTERNALCOMMAND_HELP_NEWMDIWINDOW); - help->insertSeparator(); - id = help->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_IDEA)),__tr2qs("&Tip of the Day"),m_pFrm,SLOT(executeInternalCommand(int))); - help->setItemParameter(id,KVI_INTERNALCOMMAND_TIP_OPEN); - help->insertSeparator(); - id = help->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_KVIRC)),__tr2qs("About &KVIrc"),m_pFrm,SLOT(executeInternalCommand(int))); - help->setItemParameter(id,KVI_INTERNALCOMMAND_ABOUT_ABOUTKVIRC); - help->insertSeparator(); - id = help->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_HOMEPAGE)),__tr2qs("KVIrc Home&page"),m_pFrm,SLOT(executeInternalCommand(int))); - help->setItemParameter(id,KVI_INTERNALCOMMAND_KVIRC_HOMEPAGE); - if(kvi_strEqualCIN(KviLocale::localeName(),"ru",2)) - { - id = help->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_HOMEPAGE)),__tr2qs("KVIrc Russian Home&page"),m_pFrm,SLOT(executeInternalCommand(int))); - help->setItemParameter(id,KVI_INTERNALCOMMAND_KVIRC_HOMEPAGE_RU); - } - if(kvi_strEqualCIN(KviLocale::localeName(),"fr",2)) - { - id = help->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_HOMEPAGE)),__tr2qs("KVIrc French Home&page"),m_pFrm,SLOT(executeInternalCommand(int))); - help->setItemParameter(id,KVI_INTERNALCOMMAND_KVIRC_HOMEPAGE_FR); - } - help->insertSeparator(); - id = help->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MESSAGE)),__tr2qs("Subscribe to the Mailing List"),m_pFrm,SLOT(executeInternalCommand(int))); - help->setItemParameter(id,KVI_INTERNALCOMMAND_OPENURL_KVIRC_MAILINGLIST); - id = help->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_BOMB)),__tr2qs("Report a Bug / Propose Improvements"),m_pFrm,SLOT(executeInternalCommand(int))); - help->setItemParameter(id,KVI_INTERNALCOMMAND_OPENURL_KVIRC_BUGTRACK); - help->insertSeparator(); - id = help->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)),__tr2qs("Join KVIrc International Channel on Freenode"),m_pFrm,SLOT(executeInternalCommand(int))); - help->setItemParameter(id,KVI_INTERNALCOMMAND_OPENURL_KVIRC_ON_FREENODE); - id = help->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)),__tr2qs("Join KVIrc International Channel on IRCNet"),m_pFrm,SLOT(executeInternalCommand(int))); - help->setItemParameter(id,KVI_INTERNALCOMMAND_OPENURL_KVIRC_ON_IRCNET); - if(kvi_strEqualCIN(KviLocale::localeName(),"it",2)) - { - // join #kvirc.net on azzurra - id = help->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)),__tr2qs("Join KVIrc Italian Channel on AzzurraNet"),m_pFrm,SLOT(executeInternalCommand(int))); - help->setItemParameter(id,KVI_INTERNALCOMMAND_OPENURL_KVIRC_IT_ON_AZZURRA); - } - if(kvi_strEqualCIN(KviLocale::localeName(),"fr",2)) - { - // join #kvirc-fr on freenode - id = help->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)),__tr2qs("Join KVIrc French Channel on Freenode"),m_pFrm,SLOT(executeInternalCommand(int))); - help->setItemParameter(id,KVI_INTERNALCOMMAND_OPENURL_KVIRC_FR_ON_FREENODE); - // join #kvirc on europnet - id = help->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)),__tr2qs("Join KVIrc French Channel on EuropNet"),m_pFrm,SLOT(executeInternalCommand(int))); - help->setItemParameter(id,KVI_INTERNALCOMMAND_OPENURL_KVIRC_FR_ON_EUROPNET); - } - // add your localized #kvirc channels here... -} - -void KviMenuBar::setupSettingsPopup() -{ - // FIXME: Move everything to actions! - - KviTalPopupMenu * opt = (KviTalPopupMenu *)sender(); - opt->clear(); - - opt->insertItem(__tr2qs("Toolbars"),m_pToolbarsPopup); - - int id = opt->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_STATUSBAR)),__tr2qs("Show StatusBar"),m_pFrm,SLOT(toggleStatusBar())); - opt->setItemChecked(id,m_pFrm->mainStatusBar()); - - - opt->insertSeparator(); - // FIXME: #warning "Toggle these items on the fly ?" - ACTION_POPUP_ITEM(KVI_COREACTION_GENERALOPTIONS,opt) - ACTION_POPUP_ITEM(KVI_COREACTION_THEMEOPTIONS,opt) - ACTION_POPUP_ITEM(KVI_COREACTION_MANAGETHEMES,opt) - ACTION_POPUP_ITEM(KVI_COREACTION_MANAGEADDONS,opt) - ACTION_POPUP_ITEM(KVI_COREACTION_SERVEROPTIONS,opt) - ACTION_POPUP_ITEM(KVI_COREACTION_TOOLBAREDITOR,opt) - ACTION_POPUP_ITEM(KVI_COREACTION_EDITREGUSERS,opt) - - opt->insertSeparator(); - opt->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_FLOPPY)),__tr2qs("&Save Configuration"),g_pApp,SLOT(saveConfiguration())); -} - -void KviMenuBar::setupScriptingPopup() -{ - KviTalPopupMenu * script = (KviTalPopupMenu *)sender(); - script->clear(); - - ACTION_POPUP_ITEM(KVI_COREACTION_ACTIONEDITOR,script) - ACTION_POPUP_ITEM(KVI_COREACTION_ALIASEDITOR,script) - ACTION_POPUP_ITEM(KVI_COREACTION_EVENTEDITOR,script) - ACTION_POPUP_ITEM(KVI_COREACTION_POPUPEDITOR,script) - ACTION_POPUP_ITEM(KVI_COREACTION_RAWEDITOR,script) - script->insertSeparator(); - ACTION_POPUP_ITEM(KVI_COREACTION_CODETESTER,script) - script->insertSeparator(); - ACTION_POPUP_ITEM(KVI_COREACTION_EXECUTEKVS,script) - - script->insertSeparator(); - script->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TEXTEXCLAMATIVE)),__tr2qs("Restore &Default Script"),g_pApp,SLOT(restoreDefaultScript())); -} - -void KviMenuBar::setupMainPopup() -{ - KviTalPopupMenu * main = (KviTalPopupMenu *)sender(); - main->clear(); - - ACTION_POPUP_ITEM(KVI_COREACTION_NEWIRCCONTEXT,main) - if(m_pFrm->activeContext()) - if(m_pFrm->activeContext()->state()==KviIrcContext::Connected) - { - int id = main->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_QUIT)),__tr2qs("Disconnect"),m_pFrm,SLOT(executeInternalCommand(int))); - main->setItemParameter(id,KVI_INTERNALCOMMAND_QUIT); - } - main->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_WORLD)),__tr2qs("New &Connection To"),m_pRecentServersPopup); - - main->insertSeparator(); - - if(m_pFrm->dockExtension()) - { - int id = main->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DOCKWIDGET)),__tr2qs("Hide &Dock Icon"),m_pFrm,SLOT(executeInternalCommand(int))); - main->setItemParameter(id,KVI_INTERNALCOMMAND_DOCKWIDGET_HIDE); - } else { - int id = main->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DOCKWIDGET)),__tr2qs("Show &Dock Icon"),m_pFrm,SLOT(executeInternalCommand(int))); - main->setItemParameter(id,KVI_INTERNALCOMMAND_DOCKWIDGET_SHOW); - } - -// Qt/Mac creates a Quit item on its own -#ifndef Q_OS_MACX - main->insertSeparator(); - - main->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_QUITAPP)),__tr2qs("&Quit"),g_pApp,SLOT(quit())); -#endif //Q_OS_MACX -} - - -void KviMenuBar::setupRecentServersPopup() -{ - KviTalPopupMenu * m = (KviTalPopupMenu *)sender(); - g_pApp->fillRecentServersPopup(m); - m->insertSeparator(); - m->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SERVER)),__tr2qs("&Other...")); -} - -void KviMenuBar::newConnectionToServer(int id) -{ - QString text = m_pRecentServersPopup->text(id); - if(!text.isEmpty()) - { - // the gentoo qt 3.3.4-r2 is broken - // since it adds random & characters to the popup texts... - if(text == __tr2qs("&Other...")) - { - KviKvsScript::run("options.edit KviServerOptionsWidget",m_pFrm->firstConsole()); - } else { - text.replace(QString("&"),QString("")); - KviStr szCommand; - if(KviIrcUrl::parse(text.utf8().data(),szCommand,KVI_IRCURL_CONTEXT_NEW)) - KviKvsScript::run(szCommand.ptr(),m_pFrm->firstConsole()); - } - } -} - -void KviMenuBar::setupToolsPopup() -{ - KviTalPopupMenu * m = (KviTalPopupMenu *)sender(); - if(!m)return; - - m->clear(); - - KviModuleExtensionDescriptorList * l = g_pModuleExtensionManager->getExtensionList("tool"); - if(l) - { - for(KviModuleExtensionDescriptor * d = l->first();d;d = l->next()) - { - int id; - if(d->icon())id = m->insertItem(*(d->icon()),d->visibleName()); - else id = m->insertItem(d->visibleName()); - //m->setItemChecked(id,(m_pFrm->moduleExtensionToolBar(d->id()))); - m->setItemParameter(id,d->id()); - } - } - m->insertSeparator(); - ACTION_POPUP_ITEM(KVI_COREACTION_SOCKETSPY,m) - ACTION_POPUP_ITEM(KVI_COREACTION_NETWORKLINKS,m) - ACTION_POPUP_ITEM(KVI_COREACTION_CHANNELLIST,m) - m->insertSeparator(); - - ACTION_POPUP_ITEM(KVI_COREACTION_SCREENSHOT,m) - - // moved the old tools here - m->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ICONMANAGER)),__tr2qs("Show &Icon Table"),g_pIconManager,SLOT(showIconWidget())); -#ifdef COMPILE_KDE_SUPPORT - int id; - id = m->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TERMINAL)),__tr2qs("Open &Terminal"),m_pFrm,SLOT(executeInternalCommand(int))); - m->setItemParameter(id,KVI_INTERNALCOMMAND_TERM_OPEN); -#endif - - - KviPointerList<KviAction> list; - KviActionManager::instance()->listActionsByCategory("tools",&list); - if(!list.isEmpty()) - { - m->insertSeparator(); - for(KviAction * ac = list.first();ac;ac = list.next()) - ac->addToPopupMenu(m); - } -} - -void KviMenuBar::toolsPopupSelected(int id) -{ - KviTalPopupMenu * m = (KviTalPopupMenu *)sender(); - if(!m)return; - int idext = m->itemParameter(id); - g_pModuleExtensionManager->allocateExtension("tool",idext,m_pFrm->firstConsole()); -} - - -void KviMenuBar::setupToolbarsPopup() -{ - m_pFrm->fillToolBarsPopup(m_pToolbarsPopup); -} - - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// Script items -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -int KviMenuBar::getDefaultItemRealIndex(int iDefaultIndex) -{ - if(iDefaultIndex < 0)iDefaultIndex = 0; - if(iDefaultIndex >= m_iNumDefaultItems) - return indexOf(m_pDefaultItemId[m_iNumDefaultItems - 1]) + 1; - return indexOf(m_pDefaultItemId[iDefaultIndex]); -} - -KviScriptMenuBarItem * KviMenuBar::findMenu(const QString &text) -{ - if(!m_pScriptItemList)return 0; - for(KviScriptMenuBarItem * i = m_pScriptItemList->first();i;i = m_pScriptItemList->next()) - { - if(KviQString::equalCI(i->szText,text))return i; - } - return 0; -} - -KviScriptMenuBarItem * KviMenuBar::findMenu(KviKvsPopupMenu * p) -{ - if(!m_pScriptItemList)return 0; - for(KviScriptMenuBarItem * i = m_pScriptItemList->first();i;i = m_pScriptItemList->next()) - { - if(i->pPopup == p)return i; - } - return 0; -} - -bool KviMenuBar::removeMenu(const QString &text) -{ - KviScriptMenuBarItem * i = findMenu(text); - if(i) - { - disconnect(i->pPopup,SIGNAL(destroyed()),this,SLOT(menuDestroyed())); - removeItem(i->id); - m_pScriptItemList->removeRef(i); - return true; - } - return false; -} - -void KviMenuBar::menuDestroyed() -{ - KviScriptMenuBarItem * i = findMenu(((KviKvsPopupMenu *)sender())); - if(i) - { - removeItem(i->id); - m_pScriptItemList->removeRef(i); - } -} - -void KviMenuBar::addMenu(const QString &text,KviKvsPopupMenu * p,int index) -{ - if(!m_pScriptItemList) - { - m_pScriptItemList = new KviPointerList<KviScriptMenuBarItem>; - m_pScriptItemList->setAutoDelete(true); - }/* else { - removeMenu(text); - }*/ - KviScriptMenuBarItem * it = new KviScriptMenuBarItem; - it->szText = text; - it->szPopupName = p->name(); - it->pPopup = p; - it->id = insertItem(text,p,-1,index); - connect(p,SIGNAL(destroyed()),this,SLOT(menuDestroyed())); - m_pScriptItemList->append(it); -} - -#include "kvi_menubar.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_menubar.h b/3.4.0/src/kvirc/ui/kvi_menubar.h deleted file mode 100644 index 32cce86652..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_menubar.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef _KVI_MENUBAR_H_ -#define _KVI_MENUBAR_H_ - -//============================================================================= -// -// File : kvi_menubar.h -// Creation date : Wen Jun 21 2000 13:11:24 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2005 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_tal_menubar.h" -#include "kvi_string.h" - -#include "kvi_pointerlist.h" - -class KviFrame; -class KviTalPopupMenu; -class KviKvsPopupMenu; - -typedef struct _KviScriptMenuBarItem -{ - int id; - KviStr szPopupName; - KviKvsPopupMenu * pPopup; - KviStr szText; -} KviScriptMenuBarItem; - - -class KVIRC_API KviMenuBar : public KviTalMenuBar -{ - Q_OBJECT -public: - KviMenuBar(KviFrame * par,const char * name); - ~KviMenuBar(); -protected: - KviTalPopupMenu * m_pToolbarsPopup; - KviTalPopupMenu * m_pRecentServersPopup; - KviFrame * m_pFrm; - KviPointerList<KviScriptMenuBarItem> * m_pScriptItemList; - int m_iNumDefaultItems; - int * m_pDefaultItemId; -protected: - KviScriptMenuBarItem * findMenu(const QString &text); - KviScriptMenuBarItem * findMenu(KviKvsPopupMenu * p); - void addDefaultItem(const QString &text,KviTalPopupMenu * pop); - virtual void showEvent(QShowEvent *e); -public: - int getDefaultItemRealIndex(int iDefaultIndex); - void addMenu(const QString &text,KviKvsPopupMenu * p,int index); - bool removeMenu(const QString &text); -protected slots: - void menuDestroyed(); - void setupMainPopup(); - void setupSettingsPopup(); - void setupHelpPopup(); - void setupRecentServersPopup(); - void setupScriptingPopup(); - void newConnectionToServer(int id); - void setupToolbarsPopup(); - void setupToolsPopup(); - void toolsPopupSelected(int id); -}; - -#endif //_KVI_MENUBAR_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_modeeditor.cpp b/3.4.0/src/kvirc/ui/kvi_modeeditor.cpp deleted file mode 100644 index 0bb34ab23a..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_modeeditor.cpp +++ /dev/null @@ -1,336 +0,0 @@ -// -// File : kvi_modeeditor.cpp -// Creation date : Sat Apr 14 2001 13:52:11 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_modeeditor.h" -#include "kvi_iconmanager.h" -#include "kvi_locale.h" -#include "kvi_qstring.h" -#include "kvi_console.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionserverinfo.h" -#include "kvi_channel.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_styled_controls.h" -#include "kvi_toolwindows_container.h" -#include "kvi_tal_scrollview.h" - -#include <qlayout.h> -#include <qlabel.h> - - -////////////////////////////////////////////////////////////////////// -// class KviModeEditor -// -////////////////////////////////////////////////////////////////////// - -//static char checkable_modes_table[KVI_NUM_CHECKABLE_MODES] = { 'p','s','t','n','m','i'}; - -// FIXME: This widget should use a KviTalScrollView! - -KviModeEditor::KviModeEditor(QWidget * par,KviWindowToolPageButton* button,const char * nam,KviConsole * c,const char * mode,const char * key,const char * limit) -: KviWindowToolWidget(par,button) -{ - m_szMode = mode; - m_szKey = key; - m_szLimit = limit; - bool isEnabled=1; - - QObject * w = parent(); - while(w) - { - if(w->inherits("KviChannel")) - { - KviChannel *chan = ((KviChannel *)w); - if(!( chan->isMeHalfOp() || chan->isMeOp() || chan->isMeChanOwner() || chan->isMeChanAdmin() || chan->connection()->userInfo()->hasUserMode('o') || chan->connection()->userInfo()->hasUserMode('O') ) ) isEnabled=0; - break; - } - w = w->parent(); - } - - QGridLayout *pMasterLayout = new QGridLayout(this,2,1,2,2); - -#ifdef COMPILE_USE_QT4 - setFocusPolicy(Qt::ClickFocus); -#else - setFocusPolicy(QWidget::ClickFocus); -#endif - - KviTalScrollView *pScrollView = new KviTalScrollView(this); -#ifdef COMPILE_USE_QT4 - pScrollView->viewport()->setBackgroundRole(QPalette::Background); -#else - pScrollView->viewport()->setBackgroundMode(QWidget::PaletteBackground); -#endif - - pMasterLayout->addWidget(pScrollView,0,0); - - pMasterLayout->setRowStretch(1,1); - QPushButton * b; - if(isEnabled) b = new QPushButton(__tr2qs("&Apply"),this); - else b = new QPushButton(__tr2qs("Close"),this); - - pMasterLayout->addWidget(b,1,0); - connect(b,SIGNAL(clicked()),this,SLOT(commit())); - - QWidget * pBackground = new QWidget(pScrollView->viewport()); - - QGridLayout *g = new QGridLayout(pBackground,20,3,2,2); - - QLabel * l = new QLabel("",pBackground); - l->setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MODE))); - g->addWidget(l,0,0); - - l = new QLabel(__tr2qs("Channel Modes"),pBackground); - g->addMultiCellWidget(l,0,0,1,2); - - QFrame * f = new QFrame(pBackground); - f->setFrameStyle(QFrame::HLine | QFrame::Sunken); - g->addMultiCellWidget(f,1,1,0,2); - - int i = 1; - QString tmp; - - m_pCheckBoxes = new KviPointerList<KviStyledCheckBox>; - m_pCheckBoxes->setAutoDelete(false); - - - // first che basic checkable modes pstnmi - QString szModes = "pstnmi"; - - while(!szModes.isEmpty()) - { - QChar ccc = szModes[0]; - szModes.remove(0,1); - - KviQString::sprintf(tmp,"%c: %Q",ccc.unicode(),&(c->connection()->serverInfo()->getChannelModeDescription(ccc))); - KviStyledCheckBox * cb = new KviStyledCheckBox(tmp,pBackground); - cb->setEnabled(isEnabled); - m_pCheckBoxes->append(cb); - cb->setChecked(m_szMode.contains((char)ccc.unicode())); - i++; - g->addMultiCellWidget(cb,i,i,0,2); - } - - KviQString::sprintf(tmp,"l: %Q",&(c->connection()->serverInfo()->getChannelModeDescription('l'))); - m_pLimitBox = new KviStyledCheckBox(tmp,pBackground); - m_pLimitBox->setEnabled(isEnabled); - i++; - g->addMultiCellWidget(m_pLimitBox,i,i,0,2); - connect(m_pLimitBox,SIGNAL(toggled(bool)),this,SLOT(limitBoxToggled(bool))); - m_pLimitEdit = new QLineEdit(pBackground); - m_pLimitEdit->setEnabled(isEnabled); - i++; - g->addMultiCellWidget(m_pLimitEdit,i,i,1,2); - if(m_szLimit.hasData()) - { - m_pLimitBox->setChecked(true); -// m_pLimitEdit->setEnabled(true); - m_pLimitEdit->setText(m_szLimit.ptr()); - } else { - m_pLimitEdit->setEnabled(false); - } - - KviQString::sprintf(tmp,"k: %Q",&(c->connection()->serverInfo()->getChannelModeDescription('k'))); - m_pKeyBox = new KviStyledCheckBox(tmp,pBackground); - m_pKeyBox->setEnabled(isEnabled); - i++; - g->addMultiCellWidget(m_pKeyBox,i,i,0,2); - connect(m_pKeyBox,SIGNAL(toggled(bool)),this,SLOT(keyBoxToggled(bool))); - m_pKeyEdit = new QLineEdit(pBackground); - m_pKeyEdit->setEnabled(isEnabled); - i++; - g->addMultiCellWidget(m_pKeyEdit,i,i,1,2); - if(m_szKey.hasData()) - { - m_pKeyBox->setChecked(true); -// m_pLimitEdit->setEnabled(true); - m_pKeyEdit->setText(m_szKey.ptr()); - } else { - m_pKeyEdit->setEnabled(false); - } - - if(c->connection()) - { - if(c->connection()->serverInfo()) - szModes = c->connection()->serverInfo()->supportedChannelModes(); - } - - int idx = szModes.findRev(','); - if(idx != -1)szModes.remove(0,idx+1); - - szModes.replace("p",""); - szModes.replace("s",""); - szModes.replace("t",""); - szModes.replace("n",""); - szModes.replace("m",""); - szModes.replace("i",""); - szModes.replace(",",""); - szModes.replace("b",""); - szModes.replace("k",""); - szModes.replace("l",""); - - while(!szModes.isEmpty()) - { - QChar ccc = szModes[0]; - szModes.remove(0,1); - - KviQString::sprintf(tmp,"%c: %Q",(char)ccc.unicode(),&(c->connection()->serverInfo()->getChannelModeDescription(ccc))); - KviStyledCheckBox * cb = new KviStyledCheckBox(tmp,pBackground); - cb->setEnabled(isEnabled); - m_pCheckBoxes->append(cb); - cb->setChecked(m_szMode.contains((char)ccc.unicode())); - i++; - g->addMultiCellWidget(cb,i,i,0,2); - } - - i++; - - g->setRowStretch(i,1); - g->setColStretch(2,1); - - pScrollView->addChild(pBackground,0,0); - registerSelf(); -} - -KviModeEditor::~KviModeEditor() -{ - delete m_pCheckBoxes; -} - -void KviModeEditor::limitBoxToggled(bool bChecked) -{ - m_pLimitEdit->setEnabled(bChecked); -} - -void KviModeEditor::keyBoxToggled(bool bChecked) -{ - m_pKeyEdit->setEnabled(bChecked); -} - -void KviModeEditor::commit() -{ - KviStr szPlusModes; - KviStr szMinusModes; - - if(m_szKey.hasData()) - { - // had a key before - if(m_pKeyBox->isChecked()) - { - // still have it - KviStr tmp = m_pKeyEdit->text(); - tmp.stripWhiteSpace(); - if(tmp.hasData()) - { - if(!kvi_strEqualCI(tmp.ptr(),m_szKey.ptr())) - { - // not the same key! - // set the new one - KviStr mode(KviStr::Format,"-k %s",m_szKey.ptr()); - emit setMode(mode.ptr()); - mode.sprintf("+k %s",tmp.ptr()); - emit setMode(mode.ptr()); - } - } - } else { - // no key now! reset - KviStr mode(KviStr::Format,"-k %s",m_szKey.ptr()); - emit setMode(mode.ptr()); - } - } else { - // there was no key before - if(m_pKeyBox->isChecked()) - { - KviStr tmp = m_pKeyEdit->text(); - tmp.stripWhiteSpace(); - if(tmp.hasData()) - { - // new key to be set - KviStr mode(KviStr::Format,"+k %s",tmp.ptr()); - emit setMode(mode.ptr()); - } - } - } - - if(m_szLimit.hasData()) - { - // had a limit before - if(m_pLimitBox->isChecked()) - { - // still have it - KviStr tmp = m_pLimitEdit->text(); - tmp.stripWhiteSpace(); - if(tmp.hasData() && tmp.isUnsignedNum()) - { - if(!kvi_strEqualCI(tmp.ptr(),m_szLimit.ptr())) - { - // not the same limit! - KviStr mode(KviStr::Format,"+l %s",tmp.ptr()); - emit setMode(mode.ptr()); - } - } - } else { - // no limit now! reset - szMinusModes.append('l'); - } - } else { - // there was no limit before - if(m_pLimitBox->isChecked()) - { - KviStr tmp = m_pLimitEdit->text(); - tmp.stripWhiteSpace(); - if(tmp.hasData() && tmp.isUnsignedNum()) - { - // new limit to be set - KviStr mode(KviStr::Format,"+l %s",tmp.ptr()); - emit setMode(mode.ptr()); - } - } - } - - - for(KviStyledCheckBox * cb = m_pCheckBoxes->first();cb;cb = m_pCheckBoxes->next()) - { - QString sz = cb->text(); - sz.replace("&",""); - if(sz.length() > 0) - { - QChar ccc = sz[0]; - if(cb->isChecked()) - { - if(!m_szMode.contains((char)ccc.unicode()))szPlusModes.append((char)ccc.unicode()); - } else { - if(m_szMode.contains((char)ccc.unicode()))szMinusModes.append((char)ccc.unicode()); - } - } - } - - KviStr szModes; - - if(szMinusModes.hasData())szModes.sprintf("-%s",szMinusModes.ptr()); - if(szPlusModes.hasData())szModes.append(KviStr::Format,"+%s",szPlusModes.ptr()); - if(szModes.hasData())emit setMode(szModes.ptr()); - - emit done(); -} - -#include "kvi_modeeditor.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_modeeditor.h b/3.4.0/src/kvirc/ui/kvi_modeeditor.h deleted file mode 100644 index 49bc2f06c0..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_modeeditor.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef _KVI_MODEEDITOR_H_ -#define _KVI_MODEEDITOR_H_ - -// -// File : kvi_modeeditor.h -// Creation date : Sat Apr 14 2001 13:50:12 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qwidget.h> -#include <qpushbutton.h> -#include <qcheckbox.h> -#include <qlineedit.h> -#include <qlabel.h> - -#include "kvi_string.h" -#include "kvi_pointerlist.h" -#include "kvi_styled_controls.h" -#include "kvi_toolwindows_container.h" - -class KviConsole; - -////////////////////////////////////////////////////////////////////// -// class KviModeEditor -// -////////////////////////////////////////////////////////////////////// - -class KVIRC_API KviModeEditor : public KviWindowToolWidget -{ - Q_OBJECT -public: - KviModeEditor(QWidget * par,KviWindowToolPageButton* button,const char * nam,KviConsole * c,const char * mode,const char * key,const char * limit); - ~KviModeEditor(); -protected: // fields - KviStr m_szMode; - KviStr m_szKey; - KviStr m_szLimit; - KviPointerList<KviStyledCheckBox> * m_pCheckBoxes; - KviStyledCheckBox * m_pLimitBox; - QLineEdit * m_pLimitEdit; - KviStyledCheckBox * m_pKeyBox; - QLineEdit * m_pKeyEdit; -signals: - void setMode(const char *); - void done(); -protected slots: - void limitBoxToggled(bool bChecked); - void keyBoxToggled(bool bChecked); - void commit(); -}; - -#endif //_KVI_MODEEDITOR_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_modew.cpp b/3.4.0/src/kvirc/ui/kvi_modew.cpp deleted file mode 100755 index ceffe80871..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_modew.cpp +++ /dev/null @@ -1,175 +0,0 @@ -//============================================================================ -// -// File : kvi_modew.cpp -// Creation date : 12.11.2005 23.50 by Uzhva Alexey -// -// This file is part of the KVirc irc client distribution -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_themedlabel.h" -#include "kvi_channel.h" -#include "kvi_options.h" -#include "kvi_ircconnectionserverinfo.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_qcstring.h" - -#include <qframe.h> -#include <qlineedit.h> -#include "kvi_tal_hbox.h" -#include <qevent.h> - -KviModeWidget::KviModeWidget(QWidget * par,KviChannel* chan,const char * name) -:QFrame(par,name) -{ - m_pChannel=chan; - m_pLabel=0; - m_pLineEdit=0; -#ifdef COMPILE_USE_QT4 - setAutoFillBackground(false); -#else - setBackgroundMode(QWidget::NoBackground); -#endif - reset(); -} - -KviModeWidget::~KviModeWidget() -{ -} - -void KviModeWidget::reset() -{ - if(m_pLineEdit) - { - delete m_pLineEdit; - m_pLineEdit=0; - } - if(!m_pLabel) - m_pLabel=new KviThemedLabel(this,0); - refreshModes(); - m_pLabel->show(); - connect(m_pLabel,SIGNAL(doubleClicked()),this,SLOT(labelDoubleClick())); - QResizeEvent* ev=new QResizeEvent(size(),size()); - resizeEvent(ev); - delete ev; - if(m_pChannel->input()) - m_pChannel->setFocus(); -} - -void KviModeWidget::refreshModes() -{ - QString szMode=m_pChannel->channelMode(); - if(!m_pChannel->channelKey().isEmpty()) - szMode+=QString(" k:%1").arg(m_pChannel->channelKey()); - if(!m_pChannel->channelLimit().isEmpty()) - szMode+=QString(" l:%1").arg(m_pChannel->channelLimit().ptr()); - if(m_pLabel) - m_pLabel->setText(szMode); -} - -void KviModeWidget::applyOptions() -{ - if(m_pLabel) - m_pLabel->applyOptions(); -} - -void KviModeWidget::resizeEvent(QResizeEvent *e) -{ - if(e)QFrame::resizeEvent(e); - if(m_pLabel) - { - m_pLabel->setGeometry(0,0,width(),height()); - } - if(m_pLineEdit) - { - m_pLineEdit->setGeometry(0,0,width(),height()); - } -} - -void KviModeWidget::labelDoubleClick() -{ - if(m_pLabel && ( m_pChannel->isMeHalfOp() || m_pChannel->isMeOp() || m_pChannel->isMeChanOwner() || m_pChannel->isMeChanAdmin() || m_pChannel->connection()->userInfo()->hasUserMode('o') || m_pChannel->connection()->userInfo()->hasUserMode('O')) ) - { - delete m_pLabel; - m_pLabel=0; - m_pLineEdit = new QLineEdit(this,0); - m_pLineEdit->setText(m_pChannel->channelMode()); - m_pLineEdit->show(); - m_pLineEdit->setFocus(); - resizeEvent(new QResizeEvent(size(),size())); - m_pLineEdit->installEventFilter( this ); - connect(m_pLineEdit,SIGNAL(textChanged ( const QString & ) ),this,SLOT(editorTextChanged( const QString & ))); - } -} - -bool KviModeWidget::eventFilter( QObject *obj, QEvent *ev ) -{ - if( (obj==m_pLineEdit) && ( ev->type() == QEvent::KeyPress ) ) - { - QKeyEvent *keyEvent = (QKeyEvent*)ev; - switch(keyEvent->key()) - { - case Qt::Key_Return: - case Qt::Key_Enter: - editorReturnPressed(); - return TRUE; - case Qt::Key_Escape: - reset(); - return TRUE; - } - } - return QFrame::eventFilter( obj, ev ); -} - -void KviModeWidget::editorReturnPressed() -{ - QString szCurModes=m_pChannel->channelMode(); - QString szNewModes=m_pLineEdit->text(); - QString szMinusModes; - for(int i=0; i<szCurModes.length(); i++) - { - if(szNewModes.contains(szCurModes[i])) - szNewModes.remove(szCurModes[i]); - else - szMinusModes+=szCurModes[i]; - } - QString mode; - if(!szMinusModes.isEmpty()) mode+=QString("-"+szMinusModes); - if(!szNewModes.isEmpty()) mode+=QString("+"+szNewModes); - if(!mode.isEmpty()) - { - KviQCString chan = m_pChannel->connection()->encodeText(m_pChannel->name()); - m_pChannel->connection()->sendFmtData("MODE %s %s",chan.data(),mode.utf8().data()); - } - reset(); -} - -void KviModeWidget::editorTextChanged( const QString & text) -{ - int i = 0; - QString szText=text; - for(i=0;i<szText.length();i++) - { - if( !m_pChannel->connection()->serverInfo()->supportedPlainModes().contains(szText[i]) || - szText.find(szText[i])<i ) - szText.remove(i,1); - } - m_pLineEdit->setText(szText); -} - -#include "kvi_modew.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_modew.h b/3.4.0/src/kvirc/ui/kvi_modew.h deleted file mode 100755 index 6e52bbdc24..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_modew.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef _KVI_MODEW_H_ -#define _KVI_MODEW_H_ - -//============================================================================ -// -// File : kvi_modew.h -// Creation date : 12.11.2005 23.50 by Uzhva Alexey -// -// This file is part of the KVirc irc client distribution -// -// 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 opinion) 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 "kvi_themedlabel.h" -#include "kvi_channel.h" - -#include <qframe.h> -#include <qlineedit.h> -#include "kvi_tal_hbox.h" - -class KVIRC_API KviModeWidget : public QFrame -{ - Q_OBJECT - -public: - KviModeWidget(QWidget * par,KviChannel* chan,const char * name=0); - ~KviModeWidget(); - void reset(); - void refreshModes(); - void applyOptions(); -private: - KviChannel * m_pChannel; - KviThemedLabel * m_pLabel; - QLineEdit * m_pLineEdit; -protected: - void resizeEvent(QResizeEvent *e); - bool eventFilter( QObject *obj, QEvent *ev ); -public slots: - void labelDoubleClick(); - void editorReturnPressed(); - void editorTextChanged( const QString & ); -}; - -#endif //_KVI_MODEW_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_msgbox.cpp b/3.4.0/src/kvirc/ui/kvi_msgbox.cpp deleted file mode 100644 index b2ed8fde99..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_msgbox.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// -// File : kvi_msgbox.cpp -// Creation date : Tue Jun 20 2000 12:49:41 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_msgbox.h" - -// FIXME: #warning "This should go into TAL as layer ...then maybe a wrapper in KviApp!" - -#ifdef COMPILE_KDE_SUPPORT - #include <kmessagebox.h> -#else - #include <qmessagebox.h> -#endif //!COMPILE_WITH_KDE - -#include "kvi_malloc.h" -#include "kvi_string.h" -#include "kvi_locale.h" - -// FIXME: #warning "This could go into KviApp" - -namespace KviMessageBox -{ - void warning(const QString &fmt,...) - { - kvi_va_list list; - kvi_va_start_by_reference(list,fmt); - QString s; - KviQString::vsprintf(s,fmt,list); - kvi_va_end(list); -#ifdef COMPILE_KDE_SUPPORT - KMessageBox::error(0,s,"KVIrc"); -#else - QMessageBox::warning(0,"KVIrc",s); -#endif - } - - void information(const QString &fmt,...) - { - kvi_va_list list; - kvi_va_start_by_reference(list,fmt); - QString s; - KviQString::vsprintf(s,fmt,list); - kvi_va_end(list); -#ifdef COMPILE_KDE_SUPPORT - KMessageBox::information(0,s,"KVIrc"); -#else - QMessageBox::information(0,"KVIrc",s); -#endif - } - - bool yesNo(const QString &caption,const QString &fmt,...) - { - kvi_va_list list; - kvi_va_start_by_reference(list,fmt); - QString s; - KviQString::vsprintf(s,fmt,list); - kvi_va_end(list); - bool bRet; -#ifdef COMPILE_KDE_SUPPORT - bRet = (KMessageBox::questionYesNo(0,s,caption) == KMessageBox::Yes); -#else - bRet = (QMessageBox::information(0,caption,s, - QMessageBox::Yes | QMessageBox::Default, - QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes); -#endif - return bRet; - } -}; - - - diff --git a/3.4.0/src/kvirc/ui/kvi_msgbox.h b/3.4.0/src/kvirc/ui/kvi_msgbox.h deleted file mode 100644 index fe0fab227b..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_msgbox.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef _KVI_MSGBOX_H_ -#define _KVI_MSGBOX_H_ - -// -// File : kvi_msgbox.h -// Creation date : Sun Jan 17 1999 13:55:41 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_qstring.h" -/* -class KviMessageBox : public KviTalMessageBox -{ - enum Result { Yes , No , Ok , Cancel }; - enum ButtonResult { Button1 , Button2 , Button3 }; - - KVIRC_API void warning(const char * fmt,...); - KVIRC_API void information(const char * fmt,...); - - KVIRC_API Result yesNo(const char * fmt,...); - KVIRC_API Result yesNoCancel(const char * fmt,...); - - KVIRC_API ButtonResult oneButton(const char * btnTxt,const char * fmt,...); - KVIRC_API ButtonResult twoButtons(const char * btnTxt1,const char * btnTxt2,const char * fmt,...); - KVIRC_API ButtonResult threeButtons(const char * btnTxt1,const char * btnTxt2,const char * btnTxt3,const char * fmt,...); -}; -*/ - -namespace KviMessageBox -{ - KVIRC_API void warning(const QString &fmt,...); - KVIRC_API void information(const QString &fmt,...); - KVIRC_API bool yesNo(const QString &caption,const QString &fmt,...); -}; - -#endif //!_KVI_MSGBOX_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_optionswidget.cpp b/3.4.0/src/kvirc/ui/kvi_optionswidget.cpp deleted file mode 100644 index 3dda8fda9a..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_optionswidget.cpp +++ /dev/null @@ -1,722 +0,0 @@ -//============================================================================= -// -// File : kvi_optionswidget.h -// Creation date : Mon Jun 10 2000 17:47:33 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2006 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_optionswidget.h" - -#define _WANT_OPTION_FLAGS_ -#include "kvi_options.h" - -#include "kvi_locale.h" - -#include "kvi_app.h" - -#include "kvi_tal_tooltip.h" - -#define KVI_OPTIONSWIDGET_GRIDLAYOUT_BORDER 4 -#define KVI_OPTIONSWIDGET_GRIDLAYOUT_SPACE 6 - -QString KviOptionsWidget::m_szBasicTipStart; // empty decl -QString KviOptionsWidget::m_szBasicTipEnd; - -KviOptionsWidget::KviOptionsWidget(QWidget * parent,const char * name,bool bSunken) -: QFrame(parent,name), KviSelectorInterface() -{ - if(m_szBasicTipStart.isEmpty()) - { - m_szBasicTipStart = "<center><font color=\"#a0a0a0\">"; - m_szBasicTipStart += __tr2qs("This option is also available as"); - m_szBasicTipStart += "<br><nobr>/option <b> "; - m_szBasicTipEnd = "</b></nobr></font></center>"; - - } - // FIXME: The bSunken value is ignored! - //if(bSunken)setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); - //setFrameStyle(QFrame::StyledPanel | QFrame::Plain); - m_pLayout = 0; - m_pTabWidget = 0; - m_iResetFlags = 0; - m_iSelectors = 0; - m_pSelectorInterfaceList = new KviPointerList<KviSelectorInterface>; - m_pSelectorInterfaceList->setAutoDelete(false); -} - -KviOptionsWidget::~KviOptionsWidget() -{ - delete m_pSelectorInterfaceList; -} - -void KviOptionsWidget::mergeTip(QWidget * w,const QString &tip) -{ - static QString begin = "<table width=\"100%\" align=\"center\"><tr><td bgcolor=\"#fefef0\">"; - static QString mid = "</td></tr><tr><td>"; - static QString end = "</td></tr></table>"; -#ifdef COMPILE_USE_QT4 - QString s = w->toolTip(); -#else - QString s = KviTalToolTip::textFor(w); -#endif - if(s.isEmpty())KviTalToolTip::add(w,tip); - else { - QString tmp = begin; - tmp += tip; - tmp += mid; - tmp += s; - tmp += end; - KviTalToolTip::add(w,tmp); - } -} - -void KviOptionsWidget::createLayout(int rows,int cols) -{ - if(m_pLayout)delete m_pLayout; - m_pLayout = new QGridLayout(this,rows,cols,KVI_OPTIONSWIDGET_GRIDLAYOUT_BORDER,KVI_OPTIONSWIDGET_GRIDLAYOUT_SPACE); -} - -void KviOptionsWidget::createTabbedPage() -{ - createLayout(1,1); - layout()->setMargin(0); - layout()->setSpacing(0); - m_pTabWidget = new QTabWidget(this); - addWidgetToLayout(m_pTabWidget,0,0,0,0); -} - -void KviOptionsWidget::addOptionsWidget(const QString &szText,const QIconSet &iconSet,KviOptionsWidget * pWidget) -{ - if(pWidget->layout()) - pWidget->layout()->setMargin(10); - m_pTabWidget->addTab(pWidget,iconSet,szText); - m_pSelectorInterfaceList->append(pWidget); -} - - -void KviOptionsWidget::addWidgetToLayout(QWidget * w,int x1,int y1,int x2,int y2) -{ - if((x1 == x2) && (y1 == y2))layout()->addWidget(w,y1,x1); - else layout()->addMultiCellWidget(w,y1,y2,x1,x2); -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// - -KviDirectorySelector * KviOptionsWidget::addDirectorySelector(int x1,int y1,int x2,int y2,const QString & txt,QString *pOption,bool bEnabled) -{ - KviDirectorySelector * d = new KviDirectorySelector(this,txt,pOption,bEnabled); - addWidgetToLayout(d,x1,y1,x2,y2); - m_pSelectorInterfaceList->append(d); - return d; -} - -KviDirectorySelector * KviOptionsWidget::addDirectorySelector(QWidget * pParent,const QString & txt,QString *pOption,bool bEnabled) -{ - KviDirectorySelector * d = new KviDirectorySelector(pParent,txt,pOption,bEnabled); - //addWidgetToLayout(d,x1,y1,x2,y2); - m_pSelectorInterfaceList->append(d); - return d; -} - -KviDirectorySelector * KviOptionsWidget::addDirectorySelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_stringOptionsTable[optId].flags & KviOption_resetMask); - KviDirectorySelector * d = addDirectorySelector(x1,y1,x2,y2,txt,&(KVI_OPTION_STRING(optId)),bEnabled); - - QString tmp = m_szBasicTipStart; - tmp += g_stringOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - - return d; -} - -KviDirectorySelector * KviOptionsWidget::addDirectorySelector(QWidget * pParent,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_stringOptionsTable[optId].flags & KviOption_resetMask); - KviDirectorySelector * d = addDirectorySelector(pParent,txt,&(KVI_OPTION_STRING(optId)),bEnabled); - - QString tmp = m_szBasicTipStart; - tmp += g_stringOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - - return d; -} - - -/////////////////////////////////////////////////////////////////////////////////////////////////// - - -KviFileSelector * KviOptionsWidget::addFileSelector(int x1,int y1,int x2,int y2,const QString & txt,QString *pOption,bool bEnabled) -{ - KviFileSelector * d = new KviFileSelector(this,txt,pOption,bEnabled); - addWidgetToLayout(d,x1,y1,x2,y2); - m_pSelectorInterfaceList->append(d); - return d; -} - -KviFileSelector * KviOptionsWidget::addFileSelector(QWidget * pParent,const QString & txt,QString *pOption,bool bEnabled) -{ - KviFileSelector * d = new KviFileSelector(pParent,txt,pOption,bEnabled); - m_pSelectorInterfaceList->append(d); - return d; -} - -KviFileSelector * KviOptionsWidget::addFileSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_stringOptionsTable[optId].flags & KviOption_resetMask); - KviFileSelector * d = addFileSelector(x1,y1,x2,y2,txt,&(KVI_OPTION_STRING(optId)),bEnabled); - - QString tmp = m_szBasicTipStart; - tmp += g_stringOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - - return d; -} - -KviFileSelector * KviOptionsWidget::addFileSelector(QWidget * pParent,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_stringOptionsTable[optId].flags & KviOption_resetMask); - KviFileSelector * d = addFileSelector(pParent,txt,&(KVI_OPTION_STRING(optId)),bEnabled); - - QString tmp = m_szBasicTipStart; - tmp += g_stringOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - - return d; -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// - - -KviSoundSelector * KviOptionsWidget::addSoundSelector(int x1,int y1,int x2,int y2,const QString & txt,QString *pOption,bool bEnabled) -{ - KviSoundSelector * d = new KviSoundSelector(this,txt,pOption,bEnabled); - addWidgetToLayout(d,x1,y1,x2,y2); - m_pSelectorInterfaceList->append(d); - return d; -} - -KviSoundSelector * KviOptionsWidget::addSoundSelector(QWidget * pParent,const QString & txt,QString *pOption,bool bEnabled) -{ - KviSoundSelector * d = new KviSoundSelector(pParent,txt,pOption,bEnabled); - m_pSelectorInterfaceList->append(d); - return d; -} - -KviSoundSelector * KviOptionsWidget::addSoundSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_stringOptionsTable[optId].flags & KviOption_resetMask); - KviSoundSelector * d = addSoundSelector(x1,y1,x2,y2,txt,&(KVI_OPTION_STRING(optId)),bEnabled); - - QString tmp = m_szBasicTipStart; - tmp += g_stringOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - - return d; -} - -KviSoundSelector * KviOptionsWidget::addSoundSelector(QWidget * pParent,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_stringOptionsTable[optId].flags & KviOption_resetMask); - KviSoundSelector * d = addSoundSelector(pParent,txt,&(KVI_OPTION_STRING(optId)),bEnabled); - - QString tmp = m_szBasicTipStart; - tmp += g_stringOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - - return d; -} - - -/////////////////////////////////////////////////////////////////////////////////////////////////// - -KviBoolSelector * KviOptionsWidget::addBoolSelector(int x1,int y1,int x2,int y2,const QString & txt,bool *pOption,bool bEnabled) -{ - KviBoolSelector * b = new KviBoolSelector(this,txt,pOption,bEnabled); - addWidgetToLayout(b,x1,y1,x2,y2); - m_pSelectorInterfaceList->append(b); - return b; -} - -KviBoolSelector * KviOptionsWidget::addBoolSelector(QWidget * pParent,const QString & txt,bool *pOption,bool bEnabled) -{ - KviBoolSelector * b = new KviBoolSelector(pParent,txt,pOption,bEnabled); - m_pSelectorInterfaceList->append(b); - return b; -} - -KviBoolSelector * KviOptionsWidget::addBoolSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_boolOptionsTable[optId].flags & KviOption_resetMask); - KviBoolSelector * d = addBoolSelector(x1,y1,x2,y2,txt,&(KVI_OPTION_BOOL(optId)),bEnabled); - QString tmp = m_szBasicTipStart; - tmp += g_boolOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - return d; -} - -KviBoolSelector * KviOptionsWidget::addBoolSelector(QWidget * pParent,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_boolOptionsTable[optId].flags & KviOption_resetMask); - KviBoolSelector * d = addBoolSelector(pParent,txt,&(KVI_OPTION_BOOL(optId)),bEnabled); - QString tmp = m_szBasicTipStart; - tmp += g_boolOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - return d; -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// - - -KviPixmapSelector * KviOptionsWidget::addPixmapSelector(int x1,int y1,int x2,int y2,const QString & txt,KviPixmap *pOption,bool bEnabled) -{ - KviPixmapSelector * b = new KviPixmapSelector(this,txt,pOption,bEnabled); - addWidgetToLayout(b,x1,y1,x2,y2); - m_pSelectorInterfaceList->append(b); - return b; -} - -KviPixmapSelector * KviOptionsWidget::addPixmapSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_pixmapOptionsTable[optId].flags & KviOption_resetMask); - KviPixmapSelector * d = addPixmapSelector(x1,y1,x2,y2,txt,&(KVI_OPTION_PIXMAP(optId)),bEnabled); - QString tmp = m_szBasicTipStart; - tmp += g_pixmapOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - return d; -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// - - -KviUIntSelector * KviOptionsWidget::addUIntSelector(int x1,int y1,int x2,int y2,const QString & txt, - unsigned int * pOption,unsigned int uLowBound, - unsigned int uHighBound,unsigned int uDefault,bool bEnabled) -{ - KviUIntSelector * u = new KviUIntSelector(this,txt,pOption,uLowBound,uHighBound,uDefault,bEnabled,false); - addWidgetToLayout(u,x1,y1,x2,y2); - m_pSelectorInterfaceList->append(u); - return u; -} - -KviUIntSelector * KviOptionsWidget::addUIntSelector(QWidget * pParent,const QString & txt, - unsigned int * pOption,unsigned int uLowBound, - unsigned int uHighBound,unsigned int uDefault,bool bEnabled) -{ - KviUIntSelector * u = new KviUIntSelector(pParent,txt,pOption,uLowBound,uHighBound,uDefault,bEnabled,false); - m_pSelectorInterfaceList->append(u); - return u; -} - -KviUIntSelector * KviOptionsWidget::addUIntSelector(int x1,int y1,int x2,int y2,const QString & txt, - int optId,unsigned int uLowBound, - unsigned int uHighBound,unsigned int uDefault,bool bEnabled) -{ - m_iResetFlags |= (g_uintOptionsTable[optId].flags & KviOption_resetMask); - KviUIntSelector * d = addUIntSelector(x1,y1,x2,y2,txt,&(KVI_OPTION_UINT(optId)),uLowBound,uHighBound,uDefault,bEnabled); - QString tmp = m_szBasicTipStart; - tmp += g_uintOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - return d; -} - -KviUIntSelector * KviOptionsWidget::addUIntSelector(QWidget * pParent,const QString & txt, - int optId,unsigned int uLowBound, - unsigned int uHighBound,unsigned int uDefault,bool bEnabled) -{ - m_iResetFlags |= (g_uintOptionsTable[optId].flags & KviOption_resetMask); - KviUIntSelector * d = addUIntSelector(pParent,txt,&(KVI_OPTION_UINT(optId)),uLowBound,uHighBound,uDefault,bEnabled); - QString tmp = m_szBasicTipStart; - tmp += g_uintOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - return d; -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - -KviUIntSelector * KviOptionsWidget::addUShortIntSelector(int x1,int y1,int x2,int y2,const QString & txt, - unsigned short int * pOption,unsigned int uLowBound, - unsigned int uHighBound,unsigned int uDefault,bool bEnabled) -{ - KviUIntSelector * u = new KviUIntSelector(this,txt,(unsigned int *)pOption,uLowBound,uHighBound,uDefault,bEnabled,true); - addWidgetToLayout(u,x1,y1,x2,y2); - m_pSelectorInterfaceList->append(u); - return u; -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - - -KviStringSelector * KviOptionsWidget::addStringSelector(int x1,int y1,int x2,int y2,const QString & txt,QString *pOption,bool bEnabled) -{ - KviStringSelector * d = new KviStringSelector(this,txt,pOption,bEnabled); - addWidgetToLayout(d,x1,y1,x2,y2); - m_pSelectorInterfaceList->append(d); - return d; -} - -KviStringSelector * KviOptionsWidget::addStringSelector(QWidget * pParent,const QString & txt,QString *pOption,bool bEnabled) -{ - KviStringSelector * d = new KviStringSelector(pParent,txt,pOption,bEnabled); - m_pSelectorInterfaceList->append(d); - return d; -} - -KviStringSelector * KviOptionsWidget::addStringSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_stringOptionsTable[optId].flags & KviOption_resetMask); - KviStringSelector * d = addStringSelector(x1,y1,x2,y2,txt,&(KVI_OPTION_STRING(optId)),bEnabled); - QString tmp = m_szBasicTipStart; - tmp += g_stringOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - return d; -} - -KviStringSelector * KviOptionsWidget::addStringSelector(QWidget * pParent,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_stringOptionsTable[optId].flags & KviOption_resetMask); - KviStringSelector * d = addStringSelector(pParent,txt,&(KVI_OPTION_STRING(optId)),bEnabled); - QString tmp = m_szBasicTipStart; - tmp += g_stringOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - return d; -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - - -KviPasswordSelector * KviOptionsWidget::addPasswordSelector(int x1,int y1,int x2,int y2,const QString & txt,QString *pOption,bool bEnabled) -{ - KviPasswordSelector * d = new KviPasswordSelector(this,txt,pOption,bEnabled); - addWidgetToLayout(d,x1,y1,x2,y2); - m_pSelectorInterfaceList->append(d); - return d; -} - -KviPasswordSelector * KviOptionsWidget::addPasswordSelector(QWidget * pParent,const QString & txt,QString *pOption,bool bEnabled) -{ - KviPasswordSelector * d = new KviPasswordSelector(pParent,txt,pOption,bEnabled); - m_pSelectorInterfaceList->append(d); - return d; -} - -KviPasswordSelector * KviOptionsWidget::addPasswordSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_stringOptionsTable[optId].flags & KviOption_resetMask); - KviPasswordSelector * d = addPasswordSelector(x1,y1,x2,y2,txt,&(KVI_OPTION_STRING(optId)),bEnabled); - QString tmp = m_szBasicTipStart; - tmp += g_stringOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - return d; -} - -KviPasswordSelector * KviOptionsWidget::addPasswordSelector(QWidget * pParent,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_stringOptionsTable[optId].flags & KviOption_resetMask); - KviPasswordSelector * d = addPasswordSelector(pParent,txt,&(KVI_OPTION_STRING(optId)),bEnabled); - QString tmp = m_szBasicTipStart; - tmp += g_stringOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - return d; -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - - -KviStringListSelector * KviOptionsWidget::addStringListSelector(int x1,int y1,int x2,int y2,const QString & txt,QStringList * pOption,bool bEnabled) -{ - KviStringListSelector * d = new KviStringListSelector(this,txt,pOption,bEnabled); - addWidgetToLayout(d,x1,y1,x2,y2); - m_pSelectorInterfaceList->append(d); - return d; -} - -KviStringListSelector * KviOptionsWidget::addStringListSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_stringlistOptionsTable[optId].flags & KviOption_resetMask); - KviStringListSelector * d = addStringListSelector(x1,y1,x2,y2,txt,&(KVI_OPTION_STRINGLIST(optId)),bEnabled); - QString tmp = m_szBasicTipStart; - tmp += g_stringlistOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - return d; -} - -//////////////////////////////////////////////////////////////////////////////////////////////// - - -KviColorSelector * KviOptionsWidget::addColorSelector(int x1,int y1,int x2,int y2,const QString & txt,QColor * pOption,bool bEnabled) -{ - KviColorSelector * s = new KviColorSelector(this,txt,pOption,bEnabled); - addWidgetToLayout(s,x1,y1,x2,y2); - m_pSelectorInterfaceList->append(s); - return s; -} - -KviColorSelector * KviOptionsWidget::addColorSelector(QWidget * pParent,const QString & txt,QColor * pOption,bool bEnabled) -{ - KviColorSelector * s = new KviColorSelector(pParent,txt,pOption,bEnabled); - m_pSelectorInterfaceList->append(s); - return s; -} - -KviColorSelector * KviOptionsWidget::addColorSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_colorOptionsTable[optId].flags & KviOption_resetMask); - KviColorSelector * d = addColorSelector(x1,y1,x2,y2,txt,&(KVI_OPTION_COLOR(optId)),bEnabled); - QString tmp = m_szBasicTipStart; - tmp += g_colorOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - return d; -} - -KviColorSelector * KviOptionsWidget::addColorSelector(QWidget * pParent,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_colorOptionsTable[optId].flags & KviOption_resetMask); - KviColorSelector * d = addColorSelector(pParent,txt,&(KVI_OPTION_COLOR(optId)),bEnabled); - QString tmp = m_szBasicTipStart; - tmp += g_colorOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - return d; -} - -///////////////////////////////////////////////////////////////////////////////////////////////// - - -KviMircTextColorSelector * KviOptionsWidget::addMircTextColorSelector(int x1,int y1,int x2,int y2,const QString & txt,unsigned int *uFore,unsigned int *uBack,bool bEnabled) -{ - KviMircTextColorSelector * s = new KviMircTextColorSelector(this,txt,uFore,uBack,bEnabled); - addWidgetToLayout(s,x1,y1,x2,y2); - m_pSelectorInterfaceList->append(s); - return s; -} - -KviMircTextColorSelector * KviOptionsWidget::addMircTextColorSelector(QWidget * pParent,const QString & txt,unsigned int *uFore,unsigned int *uBack,bool bEnabled) -{ - KviMircTextColorSelector * s = new KviMircTextColorSelector(pParent,txt,uFore,uBack,bEnabled); - m_pSelectorInterfaceList->append(s); - return s; -} - -KviMircTextColorSelector * KviOptionsWidget::addMircTextColorSelector(int x1,int y1,int x2,int y2,const QString & txt,int optForeId,int optBackId,bool bEnabled) -{ - m_iResetFlags |= (g_uintOptionsTable[optForeId].flags & KviOption_resetMask); - m_iResetFlags |= (g_uintOptionsTable[optBackId].flags & KviOption_resetMask); - KviMircTextColorSelector * d = addMircTextColorSelector(x1,y1,x2,y2,txt,&(KVI_OPTION_UINT(optForeId)),&(KVI_OPTION_UINT(optBackId)),bEnabled); - QString tmp = m_szBasicTipStart; - tmp += g_uintOptionsTable[optForeId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - return d; -} - -KviMircTextColorSelector * KviOptionsWidget::addMircTextColorSelector(QWidget * pParent,const QString & txt,int optForeId,int optBackId,bool bEnabled) -{ - m_iResetFlags |= (g_uintOptionsTable[optForeId].flags & KviOption_resetMask); - m_iResetFlags |= (g_uintOptionsTable[optBackId].flags & KviOption_resetMask); - KviMircTextColorSelector * d = addMircTextColorSelector(pParent,txt,&(KVI_OPTION_UINT(optForeId)),&(KVI_OPTION_UINT(optBackId)),bEnabled); - QString tmp = m_szBasicTipStart; - tmp += g_uintOptionsTable[optForeId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - return d; -} - - -//////////////////////////////////////////////////////////////////////////////////////////////// - - -KviFontSelector * KviOptionsWidget::addFontSelector(int x1,int y1,int x2,int y2,const QString & txt,QFont * pOption,bool bEnabled) -{ - KviFontSelector * f = new KviFontSelector(this,txt,pOption,bEnabled); - addWidgetToLayout(f,x1,y1,x2,y2); - m_pSelectorInterfaceList->append(f); - return f; -} - -KviFontSelector * KviOptionsWidget::addFontSelector(QWidget * pParent,const QString & txt,QFont * pOption,bool bEnabled) -{ - KviFontSelector * f = new KviFontSelector(pParent,txt,pOption,bEnabled); - m_pSelectorInterfaceList->append(f); - return f; -} - -KviFontSelector * KviOptionsWidget::addFontSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_fontOptionsTable[optId].flags & KviOption_resetMask); - KviFontSelector * d = addFontSelector(x1,y1,x2,y2,txt,&(KVI_OPTION_FONT(optId)),bEnabled); - QString tmp = m_szBasicTipStart; - tmp += g_fontOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - return d; -} - -KviFontSelector * KviOptionsWidget::addFontSelector(QWidget * pParent,const QString & txt,int optId,bool bEnabled) -{ - m_iResetFlags |= (g_fontOptionsTable[optId].flags & KviOption_resetMask); - KviFontSelector * d = addFontSelector(pParent,txt,&(KVI_OPTION_FONT(optId)),bEnabled); - QString tmp = m_szBasicTipStart; - tmp += g_fontOptionsTable[optId].name; - tmp += m_szBasicTipEnd; - KviTalToolTip::add(d,tmp); - return d; -} - -//#define DECLARE_COMMIT_FUNCTION(__fnc,__class,__classString) -// void KviOptionsWidget::__fnc() -// { -// QObjectList * l = queryList(__classString); -// if(!l)return; -// QObjectListIt it(*l); -// while(it.current()) -// { -// ((__class *)it.current())->commit(); -// ++it; -// } -// delete l; -// } - -//DECLARE_COMMIT_FUNCTION(commitBoolSelectors,KviBoolSelector,"KviBoolSelector") -//DECLARE_COMMIT_FUNCTION(commitUIntSelectors,KviUIntSelector,"KviUIntSelector") -//DECLARE_COMMIT_FUNCTION(commitStringSelectors,KviStringSelector,"KviStringSelector") -//DECLARE_COMMIT_FUNCTION(commitPixmapSelectors,KviPixmapSelector,"KviPixmapSelector") - -void KviOptionsWidget::addRowSpacer(int x1,int y1,int x2,int y2) -{ - QWidget * w = new QWidget(this); - addWidgetToLayout(w,x1,y1,x2,y2); - layout()->setRowStretch(y1,1); -} - -QLabel * KviOptionsWidget::addLabel(int x1,int y1,int x2,int y2,const QString & text,bool bEnabled) -{ - QLabel * l = new QLabel(text,this); -#ifdef COMPILE_USE_QT4 - l->setWordWrap(true); -#endif - l->setEnabled(bEnabled); - addWidgetToLayout(l,x1,y1,x2,y2); - return l; -} - -QLabel * KviOptionsWidget::addLabel(QWidget * pParent,const QString & text,bool bEnabled) -{ - QLabel * l = new QLabel(text,pParent); -#ifdef COMPILE_USE_QT4 - l->setWordWrap(true); -#endif - l->setEnabled(bEnabled); - return l; -} - -QLineEdit * KviOptionsWidget::addLineEdit(int x1,int y1,int x2,int y2,bool bEnabled) -{ - QLineEdit * l = new QLineEdit(this); - l->setEnabled(bEnabled); - addWidgetToLayout(l,x1,y1,x2,y2); - return l; -} - -QFrame * KviOptionsWidget::addSeparator(int x1,int y1,int x2,int y2) -{ - QFrame * f = new QFrame(this); - f->setFrameStyle(QFrame::HLine | QFrame::Sunken); - addWidgetToLayout(f,x1,y1,x2,y2); - return f; -} - -#ifdef COMPILE_USE_QT4 -KviTalGroupBox * KviOptionsWidget::addGroupBox(int x1,int y1,int x2,int y2,int nStrips,Qt::Orientation o,const QString &txt,bool bEnabled) -#else -KviTalGroupBox * KviOptionsWidget::addGroupBox(int x1,int y1,int x2,int y2,int nStrips,KviTalGroupBox::Orientation o,const QString &txt,bool bEnabled) -#endif -{ - KviTalGroupBox * g = new KviTalGroupBox(nStrips,o,txt,this); - g->setEnabled(bEnabled); - addWidgetToLayout(g,x1,y1,x2,y2); - return g; -} - -void KviOptionsWidget::addAdvancedButton(int x1,int y1,int x2,int y2) -{ - QWidget * w = topLevelWidget(); - if(!w)return; - if(!w->inherits("KviGeneralOptionsDialog"))return; - - QPushButton * b = new QPushButton(__tr2qs("Advanced..."),this); - connect(b,SIGNAL(clicked()),this,SLOT(switchToAdvancedPage())); - addWidgetToLayout(b,x1,y1,x2,y2); -} - - -void KviOptionsWidget::commitSelectors() -{ -// if(m_iSelectors & KVI_OPTIONSELECTOR_TYPE_BOOL)commitBoolSelectors(); -// if(m_iSelectors & KVI_OPTIONSELECTOR_TYPE_UINT)commitUIntSelectors(); -// if(m_iSelectors & KVI_OPTIONSELECTOR_TYPE_STRING)commitStringSelectors(); -// if(m_iSelectors & KVI_OPTIONSELECTOR_TYPE_PIXMAP)commitPixmapSelectors(); -// m_iSelectors = 0; - for(KviSelectorInterface * i = m_pSelectorInterfaceList->first();i;i = m_pSelectorInterfaceList->next()) - { - i->commit(); - } -} - -void KviOptionsWidget::commitOptionsReset() -{ - if(m_iResetFlags)g_pApp->optionResetUpdate(m_iResetFlags); - //m_iResetFlags = 0; -} - -void KviOptionsWidget::commit() -{ - commitSelectors(); - commitOptionsReset(); -} - -void KviOptionsWidget::switchToAdvancedPage() -{ - // FIXME: what happens if we're toplevel ???? - // (so nobody listens to this signal....) - - emit wantToSwitchToAdvancedPage(this); -} - -#include "kvi_optionswidget.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_optionswidget.h b/3.4.0/src/kvirc/ui/kvi_optionswidget.h deleted file mode 100644 index dd6f28f972..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_optionswidget.h +++ /dev/null @@ -1,163 +0,0 @@ -#ifndef _KVI_OPTIONSWIDGET_H_ -#define _KVI_OPTIONSWIDGET_H_ - -//============================================================================= -// -// File : kvi_optionswidget.h -// Creation date : Mon Jun 10 2000 17:47:33 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qframe.h> -#include <qlayout.h> -#include "kvi_pointerlist.h" -#include <qlineedit.h> -#include <kvi_tal_groupbox.h> -#include <qtabwidget.h> -#include "kvi_tal_groupbox.h" -#include "kvi_selectors.h" - -class KVIRC_API KviOptionsWidget : public QFrame, public KviSelectorInterface -{ - Q_OBJECT -public: - KviOptionsWidget(QWidget * parent,const char * name = 0,bool bSunken = true); - ~KviOptionsWidget(); -private: - QGridLayout * m_pLayout; - QTabWidget * m_pTabWidget; - int m_iResetFlags; - int m_iSelectors; - KviPointerList<KviSelectorInterface> * m_pSelectorInterfaceList; - static QString m_szBasicTipStart; - static QString m_szBasicTipEnd; -public: - void mergeResetFlag(int flag){ m_iResetFlags |= flag; }; - void createLayout(int rows,int columns); - QGridLayout * layout(){ return m_pLayout; }; -protected: - void commitSelectors(); - void commitOptionsReset(); -public: - void mergeTip(QWidget * w,const QString &tip); - - // tabbed page paradigm - void createTabbedPage(); - void addOptionsWidget(const QString &szText,const QIconSet &iconSet,KviOptionsWidget * pWidget); - QTabWidget * tabWidget(){ return m_pTabWidget; }; - - // non tabbed page paradigm - KviBoolSelector * addBoolSelector(int x1,int y1,int x2,int y2,const QString & txt,bool * pOption,bool bEnabled = true); - KviBoolSelector * addBoolSelector(QWidget * pParent,const QString & txt,bool * pOption,bool bEnabled = true); - KviBoolSelector * addBoolSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled = true); - KviBoolSelector * addBoolSelector(QWidget * pParnt,const QString & txt,int optId,bool bEnabled = true); - - KviColorSelector * addColorSelector(int x1,int y1,int x2,int y2,const QString & txt,QColor * pOption,bool bEnabled = true); - KviColorSelector * addColorSelector(QWidget * pParent,const QString & txt,QColor * pOption,bool bEnabled = true); - KviColorSelector * addColorSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled = true); - KviColorSelector * addColorSelector(QWidget * pParent,const QString & txt,int optId,bool bEnabled = true); - - KviMircTextColorSelector * addMircTextColorSelector(int x1,int y1,int x2,int y2,const QString & txt,unsigned int *uFore,unsigned int *uBack,bool bEnabled = true); - KviMircTextColorSelector * addMircTextColorSelector(QWidget * pParent,const QString & txt,unsigned int *uFore,unsigned int *uBack,bool bEnabled = true); - KviMircTextColorSelector * addMircTextColorSelector(int x1,int y1,int x2,int y2,const QString & txt,int optForeId,int optBackId,bool bEnabled = true); - KviMircTextColorSelector * addMircTextColorSelector(QWidget * pParent,const QString & txt,int optForeId,int optBackId,bool bEnabled = true); - - KviDirectorySelector * addDirectorySelector(int x1,int y1,int x2,int y2,const QString & txt,QString * pOption,bool bEnabled = true); - KviDirectorySelector * addDirectorySelector(QWidget * pParent,const QString & txt,QString * pOption,bool bEnabled = true); - KviDirectorySelector * addDirectorySelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled = true); - KviDirectorySelector * addDirectorySelector(QWidget * pParent,const QString & txt,int optId,bool bEnabled = true); - - KviFileSelector * addFileSelector(int x1,int y1,int x2,int y2,const QString & txt,QString * pOption,bool bEnabled = true); - KviFileSelector * addFileSelector(QWidget * pParent,const QString & txt,QString * pOption,bool bEnabled = true); - KviFileSelector * addFileSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled = true); - KviFileSelector * addFileSelector(QWidget * pParent,const QString & txt,int optId,bool bEnabled = true); - - KviSoundSelector * addSoundSelector(int x1,int y1,int x2,int y2,const QString & txt,QString * pOption,bool bEnabled = true); - KviSoundSelector * addSoundSelector(QWidget * pParent,const QString & txt,QString * pOption,bool bEnabled = true); - KviSoundSelector * addSoundSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled = true); - KviSoundSelector * addSoundSelector(QWidget * pParent,const QString & txt,int optId,bool bEnabled = true); - - - KviFontSelector * addFontSelector(int x1,int y1,int x2,int y2,const QString & txt,QFont * pOption,bool bEnabled = true); - KviFontSelector * addFontSelector(QWidget * pParent,const QString & txt,QFont * pOption,bool bEnabled = true); - KviFontSelector * addFontSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled = true); - KviFontSelector * addFontSelector(QWidget * pParent,const QString & txt,int optId,bool bEnabled = true); - - KviPasswordSelector * addPasswordSelector(int x1,int y1,int x2,int y2,const QString & txt,QString * pOption,bool bEnabled = true); - KviPasswordSelector * addPasswordSelector(QWidget * pParent,const QString & txt,QString * pOption,bool bEnabled = true); - KviPasswordSelector * addPasswordSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled = true); - KviPasswordSelector * addPasswordSelector(QWidget * pParent,const QString & txt,int optId,bool bEnabled = true); - - KviPixmapSelector * addPixmapSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled = true); - KviPixmapSelector * addPixmapSelector(int x1,int y1,int x2,int y2,const QString & txt,KviPixmap * pOption,bool bEnabled = true); - - KviStringListSelector * addStringListSelector(int x1,int y1,int x2,int y2,const QString & txt,QStringList * pOption,bool bEnabled = true); - KviStringListSelector * addStringListSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled = true); - - KviStringSelector * addStringSelector(int x1,int y1,int x2,int y2,const QString & txt,QString * pOption,bool bEnabled = true); - KviStringSelector * addStringSelector(QWidget * pParent,const QString & txt,QString * pOption,bool bEnabled = true); - KviStringSelector * addStringSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId,bool bEnabled = true); - KviStringSelector * addStringSelector(QWidget * pParent,const QString & txt,int optId,bool bEnabled = true); - - KviUIntSelector * addUIntSelector(int x1,int y1,int x2,int y2,const QString & txt,unsigned int * pOption, - unsigned int uLowBound,unsigned int uHighBound,unsigned int uDefault,bool bEnabled = true); - KviUIntSelector * addUIntSelector(QWidget * pParent,const QString & txt,unsigned int * pOption, - unsigned int uLowBound,unsigned int uHighBound,unsigned int uDefault,bool bEnabled = true); - KviUIntSelector * addUIntSelector(int x1,int y1,int x2,int y2,const QString & txt,int optId, - unsigned int uLowBound,unsigned int uHighBound,unsigned int uDefault,bool bEnabled = true); - KviUIntSelector * addUIntSelector(QWidget * pParent,const QString & txt,int optId, - unsigned int uLowBound,unsigned int uHighBound,unsigned int uDefault,bool bEnabled = true); - - - KviUIntSelector * addUShortIntSelector(int x1,int y1,int x2,int y2,const QString & txt,unsigned short int * pOption, - unsigned int uLowBound,unsigned int uHighBound,unsigned int uDefault,bool bEnabled = true); - - QLabel * addLabel(int x1,int y1,int x2,int y2,const QString & text,bool bEnabled = true); - QLabel * addLabel(QWidget * pParent,const QString & text,bool bEnabled = true); - QLineEdit * addLineEdit(int x1,int y1,int x2,int y2,bool bEnabled = true); -#ifdef COMPILE_USE_QT4 - KviTalGroupBox * addGroupBox(int x1,int y1,int x2,int y2,int nStrips,Qt::Orientation o,const QString &txt,bool bEnabled = true); -#else - KviTalGroupBox * addGroupBox(int x1,int y1,int x2,int y2,int nStrips,KviTalGroupBox::Orientation o,const QString &txt,bool bEnabled = true); -#endif - QFrame * addSeparator(int x1,int y1,int x2,int y2); - void addRowSpacer(int x1,int y1,int x2,int y2); - - void addWidgetToLayout(QWidget * w,int x1,int y1,int x2,int y2); - - // this does NOT add the advanced button if this page is not inside a KviGeneralOptionsDialog - // this is because nobody listens to the "switchToAdvancedPage" requests.... - void addAdvancedButton(int x1,int y1,int x2,int y2); - - virtual void commit(); -protected slots: - // this is internal to the options dialog (options module) - // it attempts to show all the hidden subitems (usually the "Advanced...") page - // and switch to the first of them - void switchToAdvancedPage(); -signals: - // internal signal used for the stuff above - void wantToSwitchToAdvancedPage(KviOptionsWidget *); -}; - - -#endif //!_KVI_OPTIONSWIDGET_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_query.cpp b/3.4.0/src/kvirc/ui/kvi_query.cpp deleted file mode 100644 index cbb3de0249..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_query.cpp +++ /dev/null @@ -1,659 +0,0 @@ -//============================================================================= -// -// File : kvi_query.cpp -// Creation date : Tue Aug 7 2000 14:23:22 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_query.h" -#include "kvi_console.h" -#include "kvi_iconmanager.h" -#include "kvi_ircview.h" -#include "kvi_input.h" -#include "kvi_options.h" -#include "kvi_locale.h" -#include "kvi_settings.h" -#include "kvi_ircsocket.h" -#include "kvi_out.h" -#include "kvi_taskbar.h" -#include "kvi_config.h" -#include "kvi_mirccntrl.h" -#include "kvi_settings.h" -#include "kvi_themedlabel.h" -#include "kvi_useraction.h" -#include "kvi_parameterlist.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_sparser.h" -#include "kvi_ircuserdb.h" -#include "kvi_mirccntrl.h" -#include "kvi_toolwindows_container.h" -#include "kvi_qcstring.h" - -#ifdef COMPILE_CRYPT_SUPPORT - #include "kvi_crypt.h" - #include "kvi_cryptcontroller.h" -#endif - -#include "kvi_kvs_eventtriggers.h" - -#include <qpixmap.h> -#include <qsplitter.h> -#include "kvi_tal_hbox.h" -#include <qtoolbutton.h> -#include "kvi_draganddrop.h" -#include "kvi_valuelist.h" - -KviQuery::KviQuery(KviFrame * lpFrm,KviConsole * lpConsole,const QString &nick) -: KviWindow(KVI_WINDOW_TYPE_QUERY,lpFrm,nick,lpConsole) -{ - - m_iFlags = 0; - connection()->registerQuery(this); - - //m_pTopSplitter = new QSplitter(QSplitter::Horizontal,this,"top_splitter"); - m_pButtonBox = new KviTalHBox(this); - m_pLabel = new KviThemedLabel(m_pButtonBox,"query_label"); - m_pLabel->setAutoHeight(1); - updateLabelText(); - m_pButtonBox->setStretchFactor(m_pLabel,1); - - // The button box on the right - //KviTalHBox * box = new KviTalHBox(m_pTopSplitter,"button_box"); - if(KVI_OPTION_BOOL(KviOption_boolShowExtendedInfoInQueryLabel)) - m_pButtonGrid= (QFrame*) new KviTalGrid(2,Qt::Horizontal,m_pButtonBox); - else - m_pButtonGrid= (QFrame*) new KviTalGrid(4,Qt::Horizontal,m_pButtonBox); - - createTextEncodingButton(m_pButtonGrid); - -#ifdef COMPILE_USE_QT4 - m_pSplitter = new QSplitter(Qt::Horizontal,this,"main_splitter"); -#else - m_pSplitter = new QSplitter(QSplitter::Horizontal,this,"main_splitter"); -#endif - m_pIrcView = new KviIrcView(m_pSplitter,lpFrm,this); - connect(m_pIrcView,SIGNAL(rightClicked()),this,SLOT(textViewRightClicked())); - //m_pEditorsContainer= new KviToolWindowsContainer(m_pSplitter); - - - m_pListViewButton = new KviWindowToolPageButton(KVI_SMALLICON_HIDELISTVIEW,KVI_SMALLICON_SHOWLISTVIEW,__tr2qs("Show User List"),buttonContainer(),true,"list_view_button"); - connect(m_pListViewButton,SIGNAL(clicked()),this,SLOT(toggleListView())); - -#ifdef COMPILE_CRYPT_SUPPORT - createCryptControllerButton(m_pButtonGrid); -#endif - - m_pUserListView = new KviUserListView(m_pSplitter,m_pListViewButton,connection()->userDataBase(),this,7,__tr2qs("Query Targets"),"user_list_view"); - - m_pInput = new KviInput(this,m_pUserListView); - - if(KVI_OPTION_BOOL(KviOption_boolAutoLogQueries)) m_pIrcView->startLogging(); - // FIXME: #warning "Maybe tell the user all that we know about the remote end(s)....channels..." - - m_pIrcView->enableDnd(TRUE); - connect(m_pIrcView,SIGNAL(fileDropped(const char *)),this,SLOT(slotDndEvents(const char *))); - - updateCaption(); -} - -KviQuery::~KviQuery() -{ - m_pUserListView->partAll(); - if(type() == KVI_WINDOW_TYPE_DEADQUERY) - context()->unregisterDeadQuery(this); - else - connection()->unregisterQuery(this); -} - -void KviQuery::updateLabelText() -{ - QString szText=getInfoLabelText(); - if(szText!=m_pLabel->text()) - { - m_pLabel->setText(szText); - KviTalToolTip::add(m_pLabel,getInfoLabelTipText()); - } -} - -QString KviQuery::getInfoLabelTipText() -{ - QString txt; - KviIrcUserEntry * e = connection()->userDataBase()->find(m_szName); - if(e) - { - QString tmp; - QString szMask; - if(e->hasUser()) - szMask+=e->user(); - else - szMask+="*"; - szMask+="@"; - if(e->hasHost()) - szMask+=e->host(); - else - szMask+="*"; - tmp+="\n"; - QString szChans; - connection()->getCommonChannels(m_szName,szChans,0); - if(console()->connection()) - { - - txt = "<html>" \ - "<body>" \ - "<table width=\"100%\">"; - - txt += START_TABLE_BOLD_ROW; - txt += __tr2qs("Query target:"); - txt += END_TABLE_BOLD_ROW; - txt += "<tr><td>"; - - if(e->hasRealName()) - tmp=__tr2qs("%1 is %2 (%3)").arg(m_szName).arg(szMask).arg(KviMircCntrl::stripControlBytes(e->realName())); - else - tmp=__tr2qs("%1 is %2").arg(m_szName).arg(szMask); - - tmp.replace('&',"&"); - tmp.replace('<',"<"); - tmp.replace('>',">"); - - txt += tmp; - - txt += "</td></tr>"; - - if(e->hasServer()) - { - txt+="<tr><td>"; - if(e->hasHops()) - txt+=__tr2qs("%1 is using irc server: %2 (%3 hops)").arg(m_szName).arg(e->server()).arg(e->hops()); - else - txt+=__tr2qs("%1 is using irc server: %2").arg(m_szName).arg(e->server()); - txt+="</td></tr>"; - } - - if(e->isAway()) - { - txt+="<tr><td>"; - txt+=__tr2qs("%1 is probably away").arg(m_szName); - txt+="</td></tr>"; - } - - txt+="<tr><td>"; - tmp=__tr2qs("Common channels with %1: %2").arg(m_szName).arg(szChans); - - tmp.replace('&',"&"); - tmp.replace('<',"<"); - tmp.replace('>',">"); - - txt+=tmp; - txt +="</td></tr>"; - - txt += "</table>" \ - "</body>" \ - "<html>"; - } else { - txt=__tr2qs("[Dead Query]"); - } - } - return txt; -} - -QString KviQuery::getInfoLabelText() -{ - QString tmp; - if(KVI_OPTION_BOOL(KviOption_boolShowExtendedInfoInQueryLabel)) - { - KviIrcUserEntry * e = connection()->userDataBase()->find(m_szName); - if(e) - { - QString szMask; - if(console()->connection()) - { - if(e->hasUser()) - szMask+=e->user(); - else - szMask+="*"; - szMask+="@"; - if(e->hasHost()) - szMask+=e->host(); - else - szMask+="*"; - if(e->hasRealName()) - tmp=__tr2qs("Query with %1!%2 (%3)").arg(m_szName).arg(szMask).arg(KviMircCntrl::stripControlBytes(e->realName())); - else - tmp=__tr2qs("Query with %1!%2").arg(m_szName).arg(szMask); - if(e->hasServer()) - tmp+=__tr2qs(", using server %1").arg(e->server()); - if(e->hasHops()) - tmp+=__tr2qs(" (%1 hops)").arg(e->hops()); - if(e->isAway()) - tmp+=__tr2qs(", probably away"); - tmp+="\n"; - QString szChans; - connection()->getCommonChannels(m_szName,szChans,0); - tmp+=__tr2qs("Common channels: %2").arg(szChans); - } else { - tmp=__tr2qs("[Dead Query]"); - } - } - } - return tmp; -} -void KviQuery::slotDndEvents(const char *file) -{ - KVS_TRIGGER_EVENT_1(KviEvent_OnQueryFileDropped,this,QString(file)); -} - -void KviQuery::triggerCreationEvents() -{ - if(!KVI_OPTION_STRING(KviOption_stringOnNewQueryOpenedSound).isEmpty()) KviKvsScript::run("snd.play $0",0,new KviKvsVariantList(new KviKvsVariant(KVI_OPTION_STRING(KviOption_stringOnNewQueryOpenedSound)))); - KVS_TRIGGER_EVENT_0(KviEvent_OnQueryWindowCreated,this); -} - -void KviQuery::getBaseLogFileName(QString &buffer) -{ - if(console()->connection()) - { - buffer=windowName(); - buffer += "."; - buffer += console()->currentNetworkName(); - } else { - buffer=windowName(); - buffer+="."; - buffer+=console()->ircContextId(); - } -} - -void KviQuery::mergeQuery(KviQuery * q) -{ - m_pIrcView->appendMessagesFrom(q->m_pIrcView); - updateLabelText(); -} - -void KviQuery::textViewRightClicked() -{ - KVS_TRIGGER_EVENT_0(KviEvent_OnQueryPopupRequest,this); -} - -void KviQuery::saveProperties(KviConfig *cfg) -{ - KviWindow::saveProperties(cfg); - cfg->writeEntry("Splitter",m_pSplitter->sizes()); - cfg->writeEntry("UserListViewVisible",m_pUserListView->isVisible()); -} - -void KviQuery::loadProperties(KviConfig *cfg) -{ - int w = width(); - KviWindow::loadProperties(cfg); - KviValueList<int> def; - def.append((w * 80) / 100); - def.append((w * 20) / 100); - m_pSplitter->setSizes(cfg->readIntListEntry("Splitter",def)); - showListView(cfg->readBoolEntry("UserListViewVisible",false)); -} - -void KviQuery::notifyTargetChange(const QString &oldNick,const QString &oldUser,const QString &oldHost,const QString &nick,const QString &user,const QString &host) -{ - QString oldN = oldNick.isEmpty() ? QString("*") : oldNick; - QString oldU = oldUser.isEmpty() ? QString("*") : oldUser; - QString oldH = oldHost.isEmpty() ? QString("*") : oldHost; - output(KVI_OUT_QUERYTRACE, - __tr2qs("The target of this query has changed from \r!n\r%Q\r [%Q@\r!h\r%Q\r] to \r!n\r%Q\r [%Q@\r!h\r%Q\r]"), - &oldN,&oldU,&oldH,&nick,&user,&host); - updateLabelText(); -} - - -void KviQuery::userAction(const QString &nick,const QString &user,const QString &host,unsigned int uActionType) -{ - int iTemperature = kvi_getUserActionTemperature(uActionType); - if(KVI_OPTION_BOOL(KviOption_boolEnableQueryTracing)) - { - QString oldUser,oldHost; - if(!m_pUserListView->userActionVerifyMask(nick,user,host,iTemperature,oldUser,oldHost)) - notifyTargetChange(nick,oldUser,oldHost,nick,user,host); - } else { - m_pUserListView->userAction(nick,user,host,iTemperature); - } - updateLabelText(); -} - - -void KviQuery::userAction(const QString &nick,unsigned int uActionType) -{ - int iTemperature = kvi_getUserActionTemperature(uActionType); - m_pUserListView->userAction(nick,iTemperature); - updateLabelText(); -} - -void KviQuery::userAction(KviIrcMask *user,unsigned int uActionType) -{ - int iTemperature = kvi_getUserActionTemperature(uActionType); - if(KVI_OPTION_BOOL(KviOption_boolEnableQueryTracing)) - { - QString oldUser,oldHost; - if(!m_pUserListView->userActionVerifyMask(user->nick(),user->user(),user->host(),iTemperature,oldUser,oldHost)) - notifyTargetChange(user->nick(),oldUser,oldHost,user->nick(),user->user(),user->host()); - } else { - m_pUserListView->userAction(user,iTemperature); - } - updateLabelText(); -} - - -KviUserListEntry * KviQuery::setTarget(const QString &nick,const QString &user,const QString &host) -{ - KviUserListEntry * e = m_pUserListView->join(nick,user,host); - if((!e->globalData()->avatar()) && (!user.isEmpty()) && (user != "*")) - m_pConsole->checkDefaultAvatar(e->globalData(),nick,user,host); - - setWindowName(nick); - updateCaption(); - - if(KVI_OPTION_BOOL(KviOption_boolEnableQueryTracing)) - { - QString szChans; - int iChans = m_pConsole->connection()->getCommonChannels(nick,szChans); - notifyCommonChannels(nick,user,host,iChans,szChans); - } - - KVS_TRIGGER_EVENT_3(KviEvent_OnQueryTargetAdded,this,nick,user,host); - updateLabelText(); - return e; -} - -void KviQuery::notifyCommonChannels(const QString &nick,const QString &user,const QString &host,int iChans,const QString &szChans) -{ - static QString star("*"); - if(iChans > 0) - { - output(KVI_OUT_QUERYTRACE,__tr2qs("Common channels for \r!n\r%Q\r [%Q@\r!h\r%Q\r]: %Q"), - &nick,user.isEmpty() ? &star : &user,host.isEmpty() ? &star : &host,&szChans); - } else { - output(KVI_OUT_QUERYTRACE,__tr2qs("No common channels for \r!n\r%Q\r [%Q@\r!h\r%Q\r]"), - &nick,user.isEmpty() ? &star : &user,host.isEmpty() ? &star : &host); - } - updateLabelText(); -} - - - - -/*void KviQuery::updateTargets() -{ - QString szName; - - if(targetCount() > 0) - { - KviPointerHashTableIterator<QString,KviUserListEntry> it(*(m_pUserListView->entryDict())); - if(it.current())szName = it.currentKey(); - } - - if(szName.isEmpty())szName = __tr2qs("[No targets]"); - - setWindowName(szName); - - updateCaption(); -}*/ - -void KviQuery::fillCaptionBuffers() -{ - static QString begin("<nobr><font color=\""); - static QString boldbegin("\"><b>"); - static QString endofbold("</b></font> <font color=\""); - static QString endoffont("\">"); - static QString end("</font></nobr>"); - - if(!console()->connection()) - { - QString dead = __tr2qs("[Dead query]"); - - m_szPlainTextCaption = windowName(); - m_szPlainTextCaption += " : "; - m_szPlainTextCaption += dead; - - m_szHtmlActiveCaption = begin; - m_szHtmlActiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name(); - m_szHtmlActiveCaption += boldbegin; - m_szHtmlActiveCaption += windowName(); - m_szHtmlActiveCaption += endofbold; - m_szHtmlActiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextActive2).name(); - m_szHtmlActiveCaption += endoffont; - m_szHtmlActiveCaption += dead; - m_szHtmlActiveCaption += end; - - m_szHtmlInactiveCaption = begin; - m_szHtmlInactiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name(); - m_szHtmlInactiveCaption += boldbegin; - m_szHtmlInactiveCaption += windowName(); - m_szHtmlInactiveCaption += endofbold; - m_szHtmlInactiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive2).name(); - m_szHtmlInactiveCaption += endoffont; - m_szHtmlInactiveCaption += dead; - m_szHtmlInactiveCaption += end; - - return; - } - - QString szNickOnServer = QChar('['); - szNickOnServer += connection()->currentNickName(); - szNickOnServer += __tr2qs(" on "); - szNickOnServer += connection()->currentServerName(); - szNickOnServer += QChar(']'); - - m_szPlainTextCaption = windowName(); - m_szPlainTextCaption += QChar(' '); - m_szPlainTextCaption += szNickOnServer; - - m_szHtmlActiveCaption = begin; - m_szHtmlActiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name(); - m_szHtmlActiveCaption += boldbegin; - m_szHtmlActiveCaption += windowName(); - m_szHtmlActiveCaption += endofbold; - m_szHtmlActiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextActive2).name(); - m_szHtmlActiveCaption += endoffont; - m_szHtmlActiveCaption += szNickOnServer; - m_szHtmlActiveCaption += end; - - m_szHtmlInactiveCaption = begin; - m_szHtmlInactiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name(); - m_szHtmlInactiveCaption += boldbegin; - m_szHtmlInactiveCaption += windowName(); - m_szHtmlInactiveCaption += endofbold; - m_szHtmlInactiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive2).name(); - m_szHtmlInactiveCaption += endoffont; - m_szHtmlInactiveCaption += szNickOnServer; - m_szHtmlInactiveCaption += end; -} - -bool KviQuery::nickChange(const QString &oldNick,const QString &newNick) -{ - bool bRet = m_pUserListView->nickChange(oldNick,newNick); - if(!bRet)return false; // ugh!! ? - setWindowName(newNick); - updateCaption(); - updateLabelText(); - return bRet; -} - -void KviQuery::showListView(bool bShow) -{ - if(!bShow) - { - m_pUserListView->hide(); - if(m_pListViewButton->isOn())m_pListViewButton->setOn(false); - } else { - m_pUserListView->show(); - if(!(m_pListViewButton->isOn()))m_pListViewButton->setOn(true); - } -} - -void KviQuery::toggleListView() -{ - showListView(!m_pUserListView->isVisible()); -} - -void KviQuery::setDeadQuery() -{ - m_iFlags |= KVI_QUERY_FLAG_DEAD; - - m_pUserListView->enableUpdates(false); - m_pUserListView->partAll(); - m_pUserListView->enableUpdates(true); - m_pUserListView->setUserDataBase(0); - connection()->unregisterQuery(this); - context()->registerDeadQuery(this); - setType(KVI_WINDOW_TYPE_DEADQUERY); - - updateIcon(); - updateCaption(); - updateLabelText(); -}; - -void KviQuery::setAliveQuery() -{ - m_iFlags &= ~KVI_QUERY_FLAG_DEAD; - m_pUserListView->setUserDataBase(connection()->userDataBase()); - setType(KVI_WINDOW_TYPE_QUERY); - context()->unregisterDeadQuery(this); - connection()->registerQuery(this); - // Update log file name - if(m_pIrcView->isLogging()) m_pIrcView->startLogging(); - updateIcon(); - updateCaption(); - updateLabelText(); -} - -void KviQuery::applyOptions() -{ - m_pUserListView->applyOptions(); - updateLabelText(); - // this applies options for IrcView and Input and forces the window to relayout - KviWindow::applyOptions(); -} - -QPixmap * KviQuery::myIconPtr() -{ - return g_pIconManager->getSmallIcon(isDeadQuery() ? KVI_SMALLICON_DEADQUERY : KVI_SMALLICON_QUERY); -} - -void KviQuery::resizeEvent(QResizeEvent *e) -{ - int hght = m_pInput->heightHint(); - int hght2 = m_pButtonBox->sizeHint().height(); - m_pButtonBox->setGeometry(0,0,width(),hght2); - m_pSplitter->setGeometry(0,hght2,width(),height() - (hght + hght2)); - m_pInput->setGeometry(0,height() - hght,width(),hght); -} - -QSize KviQuery::sizeHint() const -{ - QSize ret(m_pSplitter->sizeHint().width(),m_pIrcView->sizeHint().height() + m_pInput->heightHint()); - return ret; -} - -void KviQuery::ownMessage(const QString &buffer) -{ - if(!connection()) - { - outputNoFmt(KVI_OUT_SYSTEMWARNING,__tr2qs("This query has no active targets, no message sent")); - return; - } - - KviQCString szName = connection()->encodeText(windowName()); - KviQCString szData = encodeText(buffer); - - const char * d = szData.data(); - if(!d)return; - -#ifdef COMPILE_CRYPT_SUPPORT - if(cryptSessionInfo()) - { - if(cryptSessionInfo()->bDoEncrypt) - { - if(*d != KVI_TEXT_CRYPTESCAPE) - { - KviStr encrypted; - cryptSessionInfo()->pEngine->setMaxEncryptLen(500 - szName.length()); - switch(cryptSessionInfo()->pEngine->encrypt(d,encrypted)) - { - case KviCryptEngine::Encrypted: - if(!connection()->sendFmtData("PRIVMSG %s :%s",szName.data(),encrypted.ptr()))return; - m_pConsole->outputPrivmsg(this,KVI_OUT_OWNPRIVMSGCRYPTED, - QString::null,QString::null,QString::null,buffer,KviConsole::NoNotifications); - break; - case KviCryptEngine::Encoded: - { - if(!connection()->sendFmtData("PRIVMSG %s :%s",szName.data(),encrypted.ptr()))return; - // ugly ,but we must redecode here - QString szRedecoded = decodeText(encrypted.ptr()); - m_pConsole->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG, - QString::null,QString::null,QString::null,szRedecoded,KviConsole::NoNotifications); - } - break; - default: // also case KviCryptEngine::EncryptError - { - QString szEngineError = cryptSessionInfo()->pEngine->lastError(); - output(KVI_OUT_SYSTEMERROR, - __tr2qs("The crypto engine was unable to encrypt the current message (%Q): %s, no data sent to the server"), - &buffer,&szEngineError); - } - break; - } - userAction(connection()->currentNickName(),KVI_USERACTION_PRIVMSG); - return; - } else { - d++; //eat the escape code - QString tmp = buffer.right(buffer.length() - 1); - if(!connection()->sendFmtData("PRIVMSG %s :%s",szName.data(),d))return; - m_pConsole->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG,QString::null,QString::null,QString::null,tmp,KviConsole::NoNotifications); - userAction(connection()->currentNickName(),KVI_USERACTION_PRIVMSG); - return; - } - } - } -#endif - - if(!connection()->sendFmtData("PRIVMSG %s :%s",szName.data(),d))return; - m_pConsole->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG,QString::null,QString::null,QString::null,buffer,KviConsole::NoNotifications); - userAction(connection()->currentNickName(),KVI_USERACTION_PRIVMSG); -} - -void KviQuery::ownAction(const QString &buffer) -{ - if(!connection()) - { - outputNoFmt(KVI_OUT_SYSTEMWARNING,__tr2qs("This query has no active targets, no message sent")); - } else { - KviQCString szBuffer = encodeText(buffer); - if(!szBuffer.data())return; - KviQCString sz = connection()->encodeText(windowName()); - if(sz.isEmpty())return; - if(!connection()->sendFmtData("PRIVMSG %s :%cACTION %s%c", - sz.data(),0x01,szBuffer.data(),0x01))return; - if(KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnMeAction,this,QString(szBuffer.data())))return; - output(KVI_OUT_ACTION,"\r!nc\r%Q\r %Q",&(connection()->currentNickName()),&buffer); - m_pUserListView->userAction(connection()->currentNickName(),KVI_USERACTION_ACTION); - } -} - -#include "kvi_query.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_query.h b/3.4.0/src/kvirc/ui/kvi_query.h deleted file mode 100644 index 19659d0fab..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_query.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef _KVI_QUERY_H_ -#define _KVI_QUERY_H_ -//============================================================================= -// -// File : kvi_query.h -// Creation date : Mon Aug 7 2000 14:19:00 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_window.h" -#include "kvi_string.h" -#include "kvi_ircuserdb.h" -#include "kvi_userlistview.h" -#include "kvi_themedlabel.h" - -#include "kvi_pointerhashtable.h" -#include "kvi_tal_grid.h" - -class KviConsole; -class KviConfig; -class QSplitter; -class KviWindowToolPageButton; - -#define KVI_QUERY_FLAG_DEAD 1 - -class KVIRC_API KviQuery : public KviWindow -{ - Q_OBJECT -public: - KviQuery(KviFrame * lpFrm,KviConsole * lpConsole,const QString &nick); - ~KviQuery(); -protected: - KviUserListView * m_pUserListView; - KviWindowToolPageButton * m_pListViewButton; - int m_iFlags; - KviThemedLabel * m_pLabel; - QFrame * m_pButtonGrid; -protected: - virtual QPixmap * myIconPtr(); - virtual void fillCaptionBuffers(); - virtual void resizeEvent(QResizeEvent *e); - virtual void loadProperties(KviConfig * cfg); - virtual void saveProperties(KviConfig * cfg); - virtual void getBaseLogFileName(QString &buffer); - virtual void triggerCreationEvents(); -public: - void setDeadQuery(); - void setAliveQuery(); - bool isDeadQuery(){ return m_iFlags & KVI_QUERY_FLAG_DEAD; }; - virtual QSize sizeHint() const; - virtual const QString & target(){ return windowName(); }; - virtual void applyOptions(); - KviUserListEntry * setTarget(const QString &nick,const QString &user,const QString &host); - void userAction(KviIrcMask *user,unsigned int uActionType); - void userAction(const QString &nick,unsigned int uActionType); - void userAction(const QString &nick,const QString &user,const QString &host,unsigned int uActionType); - bool nickChange(const QString &oldNick,const QString &newNick); - void ownMessage(const QString &buffer); - void ownAction(const QString &buffer); - int selectedCount(){ return m_pUserListView->selectedCount(); }; - bool avatarChanged(const QString &nick){ return m_pUserListView->avatarChanged(nick); }; - void notifyCommonChannels(const QString &nick,const QString &user,const QString &host,int iChans,const QString &szChans); - void showListView(bool bShow); - void mergeQuery(KviQuery * q); - void updateLabelText(); - QFrame * buttonContainer() { return (QFrame*)m_pButtonGrid; }; -protected: - void notifyTargetChange(const QString &oldNick,const QString &oldUser,const QString &oldHost,const QString &nick,const QString &user,const QString &host); - QString getInfoLabelText(); - QString getInfoLabelTipText(); -protected slots: - void textViewRightClicked(); - void toggleListView(); - void slotDndEvents(const char *); -}; - -#endif //_KVI_CHANNEL_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_scriptbutton.cpp b/3.4.0/src/kvirc/ui/kvi_scriptbutton.cpp deleted file mode 100644 index e1b8391195..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_scriptbutton.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// -// File : kvi_scriptbutton.cpp -// Creation date : Wed Nov 14 15:43:41 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_scriptbutton.h" -#include "kvi_irctoolbar.h" -#include "kvi_window.h" -#include "kvi_console.h" -#include "kvi_app.h" -#include "kvi_parameterlist.h" -#include "kvi_kvs_variantlist.h" -#include "kvi_kvs_script.h" - - -KviScriptUserButton::KviScriptUserButton(QWidget * par,const char * name) -: KviStyledToolButton(par,name) -{ - m_pScript = 0; -// setAutoRaise(true); - connect(this,SIGNAL(clicked()),this,SLOT(btnClicked())); - setAutoRaise(true); -} - -KviScriptUserButton::~KviScriptUserButton() -{ - if(m_pScript)delete m_pScript; -} - -KviWindow * KviScriptUserButton::window() -{ - return g_pActiveWindow; -} - -void KviScriptUserButton::setButtonCode(KviKvsScript * pScript) -{ - if(m_pScript)delete m_pScript; - m_pScript = pScript; -} - - -void KviScriptUserButton::btnClicked() -{ - KviWindow * pWnd = window(); - if(!pWnd)return; // ops... - QPoint pos = mapToGlobal(QPoint(0,height())); - - KviKvsVariantList vList; - vList.append((kvs_int_t)pos.x()); - vList.append((kvs_int_t)pos.y()); - m_pScript->run(pWnd,&vList,0,KviKvsScript::PreserveParams); -} -/* - -KviIrcToolBarScriptButton::KviIrcToolBarScriptButton(QToolBar * p,const char * name) -: KviScriptUserButton(p,name) -{ - setAutoRaise(true); -} - -KviIrcToolBarScriptButton::~KviIrcToolBarScriptButton() -{ -} - -KviWindow * KviIrcToolBarScriptButton::window() -{ - return g_pActiveWindow; -} -*/ - -KviWindowScriptButton::KviWindowScriptButton(QWidget * p,KviWindow * wnd,const char * name) -: KviScriptUserButton(p,name) -{ - m_pWnd = wnd; -} - -KviWindowScriptButton::~KviWindowScriptButton() -{ -} - -#include "kvi_scriptbutton.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_scriptbutton.h b/3.4.0/src/kvirc/ui/kvi_scriptbutton.h deleted file mode 100644 index da014820a4..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_scriptbutton.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef _KVI_SCRIPTBUTTON_H_ -#define _KVI_SCRIPTBUTTON_H_ -// -// File : kvi_scriptbutton.h -// Creation date : Wed Nov 14 15:43:39 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" -#include "kvi_styled_controls.h" - -#include <qtoolbutton.h> -#include <qtoolbar.h> - -class KviKvsScript; -class KviWindow; - -class KVIRC_API KviScriptUserButton : public KviStyledToolButton -{ - Q_OBJECT -public: - KviScriptUserButton(QWidget * par,const char * name); - ~KviScriptUserButton(); -protected: - KviKvsScript * m_pScript; -public: - void setButtonCode(KviKvsScript * pScript); - virtual void setButtonPixmap(const QPixmap & pix){ setIconSet(pix); }; - void setButtonText(const char * text){ setTextLabel(text); }; - virtual KviWindow * window(); -protected slots: - void btnClicked(); -}; - -/* -class KVIRC_API KviIrcToolBarScriptButton : public KviScriptUserButton -{ - Q_OBJECT -public: - KviIrcToolBarScriptButton(QToolBar * p,const char * name); - ~KviIrcToolBarScriptButton(); -protected: - KviStr m_szCode; -public: - virtual KviWindow * window(); -}; -*/ - -class KVIRC_API KviWindowScriptButton : public KviScriptUserButton -{ - Q_OBJECT -public: - KviWindowScriptButton(QWidget * p,KviWindow * wnd,const char * name); - ~KviWindowScriptButton(); -protected: - KviWindow * m_pWnd; -public: - virtual void setButtonPixmap(const QPixmap & pix){ setIconSet(pix); setUsesBigPixmap(false); }; - virtual KviWindow * window(){ return m_pWnd; }; -}; - -#endif //_KVI_SCRIPTBUTTON_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_scripteditor.cpp b/3.4.0/src/kvirc/ui/kvi_scripteditor.cpp deleted file mode 100644 index a873bf049b..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_scripteditor.cpp +++ /dev/null @@ -1,139 +0,0 @@ -// -// File : kvi_scripteditor.cpp -// Creation date : Sun Mar 28 1999 16:12:41 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#define _KVI_SCRIPTEDITOR_CPP_ - -#define _KVI_DEBUG_CHECK_RANGE_ -#include "kvi_debug.h" - -#include "kvi_scripteditor.h" -#include "kvi_modulemanager.h" - - -KviScriptEditor::KviScriptEditor(QWidget * par) -: QWidget(par) -{ -} - - -KviScriptEditor::~KviScriptEditor() -{ -} - -void KviScriptEditor::setText(const char * txt) -{ - setText(KviQCString(txt)); -} - -void KviScriptEditor::setText(const KviQCString &txt) -{ -} - -void KviScriptEditor::setText(const QString &txt) -{ - setText(KviQCString(txt.utf8())); -} - -void KviScriptEditor::setFindText(const QString &text) -{ -} -void KviScriptEditor::setInfoText(const QString &text) -{ -} - -void KviScriptEditor::setFindLineeditReadOnly(bool b) -{ -} - -void KviScriptEditor::getText(KviQCString &txt) -{ -} - -void KviScriptEditor::setCursorPosition(QPoint) -{ -} - -bool KviScriptEditor::isModified() -{ - return false; -} - -QPoint KviScriptEditor::getCursor() -{ - return QPoint(0,0); -} -void KviScriptEditor::getText(QString &txt) -{ - KviQCString tmp; - getText(tmp); - txt = QString::fromUtf8(tmp.data()); -} - -KviScriptEditor * KviScriptEditor::getDummyEditor(QWidget * par) -{ - return new KviScriptEditor(par); -} - - -static KviScriptEditor * (*editorModuleCreateScriptEditor)(QWidget *); -static void (*editorModuleDestroyScriptEditor)(KviScriptEditor *); - - -KviScriptEditor * KviScriptEditor::createInstance(QWidget * par) -{ - KviModule * m = g_pModuleManager->getModule("editor"); - // If the module can't be loaded...return a dummy widget -// FIXME: #warning "Maybe provide some sort of basic default editable widget ?" - if(!m)return KviScriptEditor::getDummyEditor(par); // dummy implementation - - - editorModuleCreateScriptEditor = (KviScriptEditor * (*)(QWidget *)) m->getSymbol("editor_module_createScriptEditor"); - - if(!editorModuleCreateScriptEditor)return KviScriptEditor::getDummyEditor(par); - - return editorModuleCreateScriptEditor(par); - -} - -void KviScriptEditor::destroyInstance(KviScriptEditor * e) -{ - KviModule * m = g_pModuleManager->getModule("editor"); - if(!m) - { - delete e; - return; - } - - editorModuleDestroyScriptEditor = (void (*)(KviScriptEditor *)) m->getSymbol("editor_module_destroyScriptEditor"); - - if(!editorModuleDestroyScriptEditor) - { - delete e; - return; - } - - editorModuleDestroyScriptEditor(e); -} - -#include "kvi_scripteditor.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_scripteditor.h b/3.4.0/src/kvirc/ui/kvi_scripteditor.h deleted file mode 100644 index 37237a4314..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_scripteditor.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef _KVI_SCRIPTEDITOR_H_ -#define _KVI_SCRIPTEDITOR_H_ - -// -// File : kvi_scripteditor.h -// Creation date : Sun Mar 28 1999 16:11:48 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include <qwidget.h> -#include <qlineedit.h> -#include "kvi_qcstring.h" - -// -// This is the basic interface of a script editor widget -// -// Actually the REAL script editor is implemented in an -// external module called "libkvieditor", and it is a really -// huge class. -// The constructor of this thing is protected: forget -// about instantiating it directly -// - - -class KVIRC_API KviScriptEditor : public QWidget -{ - Q_OBJECT -protected: - KviScriptEditor(QWidget * par); - ~KviScriptEditor(); -protected: - QLineEdit * m_pFindLineedit; -public: - virtual void setText(const char * txt); - virtual void setText(const KviQCString &txt); - virtual void setText(const QString &txt); - virtual void getText(KviQCString &txt); - virtual void getText(QString &txt); - virtual void setInfoText(const QString &text); - virtual void setFindText(const QString &text); - virtual void setCursorPosition(QPoint); - virtual QPoint getCursor(); - virtual void setFindLineeditReadOnly(bool b); - virtual bool isModified(); - - static KviScriptEditor * getDummyEditor(QWidget * par); - static KviScriptEditor * createInstance(QWidget * par); - static void destroyInstance(KviScriptEditor * e); -}; - - -#endif //!_KVI_SCRIPTEDITOR_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_selectors.cpp b/3.4.0/src/kvirc/ui/kvi_selectors.cpp deleted file mode 100644 index e619a3c2c3..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_selectors.cpp +++ /dev/null @@ -1,839 +0,0 @@ -//============================================================================= -// -// File : kvi_selectors.cpp -// Creation date : Mon Nov 13 2000 15:22:12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#define _KVI_SELECTORS_CPP_ - -#include "kvi_selectors.h" -#include "kvi_locale.h" -#include "kvi_options.h" -#include "kvi_mirccntrl.h" -#include "kvi_filedialog.h" -#include "kvi_kvs_script.h" - -#include <qlabel.h> -#include <qpainter.h> -#include <qlayout.h> -#include <qcolordialog.h> -#include <qpalette.h> -#include <qfontdialog.h> -#include "kvi_tal_popupmenu.h" - -KviBoolSelector::KviBoolSelector(QWidget * par,const QString & txt,bool *pOption,bool bEnabled) -: KviStyledCheckBox(txt,par), KviSelectorInterface() -{ - setEnabled(bEnabled); - setChecked(*pOption); - m_pOption = pOption; -} - -void KviBoolSelector::setNotEnabled(bool bNotEnabled) -{ - setEnabled(!bNotEnabled); -} - -void KviBoolSelector::commit() -{ - *m_pOption = isChecked(); -} - -KviUIntSelector::KviUIntSelector(QWidget * par,const QString & txt,unsigned int *pOption, - unsigned int uLowBound,unsigned int uHighBound,unsigned int uDefault,bool bEnabled,bool bShortInt) -: KviTalHBox(par) , KviSelectorInterface() -{ - m_pLabel = new QLabel(txt,this); - //m_pLineEdit = new QLineEdit(this); - //m_pLineEdit->setMaximumWidth(150); - m_pSpinBox = new QSpinBox(this); - - m_bIsShortInt = bShortInt; - - setEnabled(bEnabled); - - m_pOption = pOption; - - m_uLowBound = uLowBound; - m_uHighBound = uHighBound; - m_uDefault = uDefault; - - m_pSpinBox->setMinValue(m_uLowBound); - m_pSpinBox->setMaxValue(m_uHighBound); - - //KviStr tmp(KviStr::Format,"%u",bShortInt ? (unsigned int) *((unsigned short int *)pOption) : *pOption); - //m_pLineEdit->setText(tmp.ptr()); - m_pSpinBox->setValue(bShortInt ? (unsigned int) *((unsigned short int *)pOption) : *pOption); - - setSpacing(4); - setStretchFactor(m_pLabel,1); -} - -void KviUIntSelector::setPrefix(const QString & txt) -{ - m_pSpinBox->setPrefix(txt); -} - -void KviUIntSelector::setSuffix(const QString & txt) -{ - m_pSpinBox->setSuffix(txt); -} - -void KviUIntSelector::commit() -{ - KviStr tmp = m_pSpinBox->cleanText(); - bool bOk; - unsigned int val = tmp.toUInt(&bOk); - if(!bOk)val = m_uDefault; - if(m_uHighBound > m_uLowBound) - { - if(val < m_uLowBound)val = m_uLowBound; - else if(val > m_uHighBound)val = m_uHighBound; - } - - if(m_bIsShortInt)*((unsigned short int *)m_pOption) = (unsigned short int)val; - else *m_pOption = val; -} - - -void KviUIntSelector::setEnabled(bool bEnabled) -{ - KviTalHBox::setEnabled(bEnabled); - m_pLabel->setEnabled(bEnabled); - m_pSpinBox->setEnabled(bEnabled); -} - - - -KviStringSelector::KviStringSelector(QWidget * par,const QString & txt,QString * pOption,bool bEnabled) -: KviTalHBox(par) , KviSelectorInterface() -{ - m_pLabel = new QLabel(txt,this); - m_pLineEdit = new QLineEdit(this); - //m_pLineEdit->setMinimumWidth(200); - QString tmp = *pOption; - m_pLineEdit->setText(tmp); - - setSpacing(4); - setStretchFactor(m_pLineEdit,1); - - m_pOption = pOption; - - setEnabled(bEnabled); -} - -KviStringSelector::~KviStringSelector() -{ -} - -void KviStringSelector::commit() -{ - QString tmp = m_pLineEdit->text(); - *m_pOption = tmp; -} - -void KviStringSelector::setEnabled(bool bEnabled) -{ - KviTalHBox::setEnabled(bEnabled); - m_pLineEdit->setEnabled(bEnabled); - m_pLabel->setEnabled(bEnabled); -} - -void KviStringSelector::setText(const QString& text){ - m_pLineEdit->setText(text); -} - -KviPasswordSelector::KviPasswordSelector(QWidget * par,const QString & txt,QString *pOption,bool bEnabled) -: KviStringSelector(par,txt,pOption,bEnabled) -{ - m_pLineEdit->setEchoMode(QLineEdit::Password); -} - - - - -KviPixmapPreview::KviPixmapPreview(QWidget * par) -: KviTalScrollView(par) -{ - m_pPixmap = 0; - resizeContents(0,0); -} - - -KviPixmapPreview::~KviPixmapPreview() -{ -} - -void KviPixmapPreview::setPixmap(KviPixmap * pix) -{ - m_pPixmap = pix; - if(m_pPixmap) - { - if(m_pPixmap->pixmap()) - { - resizeContents(m_pPixmap->pixmap()->width(),m_pPixmap->pixmap()->height()); - update(); - return; - } - } - resizeContents(0,0); - update(); -} - -void KviPixmapPreview::drawContents(QPainter * p, int clipx, int clipy, int clipw, int cliph) -{ - if(m_pPixmap) - { - if(m_pPixmap->pixmap()) - { - p->drawPixmap(clipx,clipy,*(m_pPixmap->pixmap()),clipx,clipy,clipw,cliph); - } - } -} - - -KviPixmapSelector::KviPixmapSelector(QWidget * par,const QString & txt,KviPixmap * pOption,bool bEnabled) -: QWidget(par), KviSelectorInterface() -{ - QGridLayout * g = new QGridLayout(this,3,2,4,8); - m_pOption = pOption; - - m_localPixmap = *pOption; - - m_pCheckBox = new KviStyledCheckBox(txt,this); - m_pCheckBox->setChecked(m_localPixmap.pixmap()); - connect(m_pCheckBox,SIGNAL(toggled(bool)),this,SLOT(checkBoxToggled(bool))); - g->addMultiCellWidget(m_pCheckBox,0,0,0,1); - - m_pPreview = new KviPixmapPreview(this); - m_pPreview->setPixmap(&m_localPixmap); - g->addMultiCellWidget(m_pPreview,1,1,0,1); - - m_pFileNameLabel = new QLabel(this); - m_pFileNameLabel->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); - if(m_localPixmap.pixmap())m_pFileNameLabel->setText(m_localPixmap.path()); - g->addWidget(m_pFileNameLabel,2,0); - - m_pChooseButton = new QPushButton("...",this); - g->addWidget(m_pChooseButton,2,1); - connect(m_pChooseButton,SIGNAL(clicked()),this,SLOT(choosePixmap())); - - g->setRowStretch(1,1); - g->setColStretch(0,1); - - setEnabled(bEnabled); -} - -KviPixmapSelector::~KviPixmapSelector() -{ -} - - -void KviPixmapSelector::checkBoxToggled(bool bEnabled) -{ - setEnabled(isEnabled()); -} - -void KviPixmapSelector::commit() -{ - if(m_pCheckBox->isChecked()) - { - *m_pOption = m_localPixmap; - } else { - *m_pOption = KviPixmap(); // null pixmap - } -} - -void KviPixmapSelector::choosePixmap() -{ -// KviStr tmp; - QString tmp; - if(KviFileDialog::askForOpenFileName(tmp,__tr("Choose an Image File - KVIrc"))) - { - setImagePath(tmp); - } -} - -void KviPixmapSelector::setImagePath(const char * path) -{ - m_localPixmap.load(path); - m_pPreview->setPixmap(&m_localPixmap); - - if(m_localPixmap.isNull()) - { - KviStr tmp2(KviStr::Format,__tr("Unloadable: %s"),path); - m_pFileNameLabel->setText(tmp2.ptr()); - m_pCheckBox->setChecked(false); - } else { - m_pCheckBox->setChecked(true); - m_pFileNameLabel->setText(path); - } - - setEnabled(isEnabled()); -} - -void KviPixmapSelector::setEnabled(bool bEnabled) -{ - QWidget::setEnabled(bEnabled); - m_pCheckBox->setEnabled(bEnabled); - m_pPreview->setEnabled(bEnabled && m_pCheckBox->isChecked()); - m_pFileNameLabel->setEnabled(bEnabled && m_pCheckBox->isChecked()); - m_pChooseButton->setEnabled(bEnabled && m_pCheckBox->isChecked()); -} - - - -// FIXME: #warning "Option for DIR_MUST_EXISTS...(this widget could be turned into a file selector too)" -KviFileSelector::KviFileSelector(QWidget * par,const QString & txt,QString * pOption,bool bEnabled,unsigned int uFlags,const QString &szFilter) -: KviTalHBox(par), KviSelectorInterface() -{ - m_uFlags = uFlags; - m_szFilter = szFilter; - m_pLabel = new QLabel(txt,this); - m_pLineEdit = new QLineEdit(this); - //m_pLineEdit->setMinimumWidth(200); - m_pLineEdit->setText(*pOption); - m_pButton = new QPushButton(__tr2qs("&Browse..."),this); - connect(m_pButton,SIGNAL(clicked()),this,SLOT(browseClicked())); - - setSpacing(4); - setStretchFactor(m_pLineEdit,1); - - m_pOption = pOption; - - setEnabled(bEnabled); -} - - -void KviFileSelector::commit() -{ - *m_pOption = m_pLineEdit->text(); -} - -void KviFileSelector::setEnabled(bool bEnabled) -{ - KviTalHBox::setEnabled(bEnabled); - m_pLineEdit->setEnabled(bEnabled); - m_pLabel->setEnabled(bEnabled); - m_pButton->setEnabled(bEnabled); -} - -void KviFileSelector::browseClicked() -{ - select(); -} - -void KviFileSelector::setSelection(const QString &szSelection) -{ - m_pLineEdit->setText(szSelection); -} - - -void KviFileSelector::select() -{ - //KviStr tmp; - QString tmp = *m_pOption; - if(m_uFlags & ChooseSaveFileName) - { - if(KviFileDialog::askForSaveFileName(tmp,__tr2qs("Choose a File - KVIrc"),tmp,m_szFilter,true,!(m_uFlags & DontConfirmOverwrite))) - { - m_pLineEdit->setText(tmp); - emit selectionChanged(tmp); - } - } else { - if(KviFileDialog::askForOpenFileName(tmp,__tr2qs("Choose a File - KVIrc"),tmp,m_szFilter,true)) - { - m_pLineEdit->setText(tmp); - emit selectionChanged(tmp); - } - } - -} - - -KviDirectorySelector::KviDirectorySelector(QWidget * par,const QString & txt,QString * pOption,bool bEnabled) -: KviFileSelector(par,txt,pOption,bEnabled) -{ -} - -void KviDirectorySelector::select() -{ - QString tmp; - if(KviFileDialog::askForDirectoryName(tmp,__tr2qs("Choose a Directory - KVIrc"),"")) - { - m_pLineEdit->setText(tmp); - } - -} - - - - - - - - -KviStringListSelector::KviStringListSelector(QWidget * par,const QString & txt,QStringList * pOption,bool bEnabled) -: KviTalVBox(par), KviSelectorInterface() -{ - m_pLabel = new QLabel(txt,this); - m_pListBox = new KviTalListBox(this); - m_pLineEdit = new QLineEdit(this); - connect(m_pLineEdit,SIGNAL(textChanged(const QString &)),this,SLOT(textChanged(const QString &))); - connect(m_pLineEdit,SIGNAL(returnPressed()),this,SLOT(addClicked())); - KviTalHBox * hBox = new KviTalHBox(this); - m_pAddButton = new QPushButton(__tr2qs("A&dd"),hBox); - connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked())); - m_pRemoveButton = new QPushButton(__tr2qs("Re&move"),hBox); - connect(m_pRemoveButton,SIGNAL(clicked()),this,SLOT(removeClicked())); - m_pOption = pOption; - m_pListBox->insertStringList(*pOption); - m_pListBox->setSelectionMode(KviTalListBox::Extended); - connect(m_pListBox,SIGNAL(selectionChanged()),this,SLOT(selectionChanged())); - setSpacing(4); - setStretchFactor(m_pListBox,1); - setEnabled(bEnabled); -} - -KviStringListSelector::~KviStringListSelector() -{ -} - -void KviStringListSelector::selectionChanged() -{ - unsigned int uCount = m_pListBox->count(); - bool bSomeSelected = false; - for(unsigned int u=0;u<uCount;u++) - { - if(m_pListBox->isSelected(u)) - { - bSomeSelected = true; - break; - } - } - m_pRemoveButton->setEnabled(isEnabled() && bSomeSelected); -} - -void KviStringListSelector::textChanged(const QString &str) -{ - str.stripWhiteSpace(); - m_pAddButton->setEnabled((str.length() > 0) && isEnabled()); -} - -void KviStringListSelector::setEnabled(bool bEnabled) -{ - KviTalVBox::setEnabled(bEnabled); - m_pLineEdit->setEnabled(bEnabled); - m_pLabel->setEnabled(bEnabled); - QString txt = m_pLineEdit->text(); - txt.stripWhiteSpace(); - m_pAddButton->setEnabled(bEnabled && (txt.length() > 0)); - unsigned int uCount = m_pListBox->count(); - bool bSomeSelected = false; - for(unsigned int u=0;u<uCount;u++) - { - if(m_pListBox->isSelected(u)) - { - bSomeSelected = true; - break; - } - } - m_pRemoveButton->setEnabled(bEnabled && bSomeSelected); - m_pListBox->setEnabled(bEnabled); -} - -void KviStringListSelector::commit() -{ - unsigned int uCount = m_pListBox->count(); - m_pOption->clear(); - for(unsigned int u=0;u<uCount;u++) - { - QString str = m_pListBox->text(u); - str.stripWhiteSpace(); - if(str.length() > 0)m_pOption->append(str); - } -} - -void KviStringListSelector::addClicked() -{ - QString str = m_pLineEdit->text(); - str.stripWhiteSpace(); - if(str.length() > 0)m_pListBox->insertItem(str); - m_pLineEdit->setText(""); -} - -void KviStringListSelector::removeClicked() -{ - unsigned int uCount = m_pListBox->count(); - for(unsigned int u=0;u<uCount;u++) - { - while(m_pListBox->isSelected(u))m_pListBox->removeItem(u); - } -} - - -KviColorSelector::KviColorSelector(QWidget * par,const QString & txt,QColor * pOption,bool bEnabled) -: KviTalHBox(par), KviSelectorInterface() -{ - m_pLabel = new QLabel(txt,this); - - m_pButton = new QPushButton(" ",this); - // m_pButton->setMinimumWidth(150); - connect(m_pButton,SIGNAL(clicked()),this,SLOT(changeClicked())); - - setSpacing(4); - setStretchFactor(m_pLabel,1); - - setButtonPalette(pOption); - - m_pOption = pOption; - - setEnabled(bEnabled); -} - -void KviColorSelector::setButtonPalette(QColor * pOption) -{ - QPalette pal(*pOption,colorGroup().background()); - m_memColor = *pOption; - m_pButton->setPalette(pal); - - QPixmap pix(16,16); - pix.fill(*pOption); - m_pButton->setIconSet(pix); -} - -void KviColorSelector::forceColor(QColor clr) -{ - setButtonPalette(&clr); -} - -void KviColorSelector::changeClicked() -{ - QColor tmp = QColorDialog::getColor(m_memColor); - if(tmp.isValid())setButtonPalette(&tmp); -} - -void KviColorSelector::commit() -{ - *m_pOption = m_memColor; -} - -void KviColorSelector::setEnabled(bool bEnabled) -{ - KviTalHBox::setEnabled(bEnabled); - m_pLabel->setEnabled(bEnabled); - m_pButton->setEnabled(bEnabled); -} - - -KviFontSelector::KviFontSelector(QWidget * par,const QString & txt,QFont * pOption,bool bEnabled) -: KviTalHBox(par), KviSelectorInterface() -{ - m_pLabel = new QLabel(txt,this); - - m_pButton = new QPushButton("",this); - // m_pButton->setMinimumWidth(150); - connect(m_pButton,SIGNAL(clicked()),this,SLOT(changeClicked())); - - setSpacing(4); - setStretchFactor(m_pLabel,1); - - setButtonFont(pOption); - - m_pOption = pOption; - - setEnabled(bEnabled); -} - -void KviFontSelector::setButtonFont(QFont * pOption) -{ - m_pButton->setText(pOption->family()); - m_pButton->setFont(*pOption); -} - -void KviFontSelector::changeClicked() -{ - bool bOk; - QFont tmp = QFontDialog::getFont(&bOk,m_pButton->font()); - if(bOk)setButtonFont(&tmp); -} - -void KviFontSelector::commit() -{ - *m_pOption = m_pButton->font(); -} - -void KviFontSelector::setEnabled(bool bEnabled) -{ - KviTalHBox::setEnabled(bEnabled); - m_pLabel->setEnabled(bEnabled); - m_pButton->setEnabled(bEnabled); -} - - - - - -KviMircTextColorSelector::KviMircTextColorSelector(QWidget * par,const QString &txt,unsigned int * uFore,unsigned int * uBack,bool bEnabled) -: KviTalHBox(par), KviSelectorInterface() -{ - m_pLabel = new QLabel(txt,this); - - m_pButton = new QPushButton(__tr2qs("Sample Text"),this); - // m_pButton->setMinimumWidth(150); - connect(m_pButton,SIGNAL(clicked()),this,SLOT(buttonClicked())); - - setSpacing(4); - setStretchFactor(m_pLabel,1); - - m_pUFore = uFore; - m_pUBack = uBack; - - m_uBack = *uBack; - m_uFore = *uFore; - - setButtonPalette(); - - setEnabled(bEnabled); - - m_pContextPopup = new KviTalPopupMenu(this); - - m_pForePopup = new KviTalPopupMenu(this); - connect(m_pForePopup,SIGNAL(activated(int)),this,SLOT(foreSelected(int))); - int i; - for(i=0;i<KVI_MIRCCOLOR_MAX_FOREGROUND;i++) - { - QPixmap tmp(120,16); - tmp.fill(KVI_OPTION_MIRCCOLOR(i)); -#ifdef COMPILE_USE_QT4 - int id = m_pForePopup->insertItem(tmp,QString("x")); -#else - int id = m_pForePopup->insertItem(tmp); -#endif - m_pForePopup->setItemParameter(id,i); - } - m_pContextPopup->insertItem(__tr2qs("Foreground"),m_pForePopup); - - m_pBackPopup = new KviTalPopupMenu(this); - connect(m_pBackPopup,SIGNAL(activated(int)),this,SLOT(backSelected(int))); - i = m_pBackPopup->insertItem(__tr2qs("Transparent")); - m_pBackPopup->setItemParameter(i,KVI_TRANSPARENT); - for(i=0;i<KVI_MIRCCOLOR_MAX_BACKGROUND;i++) - { - QPixmap tmp(120,16); - tmp.fill(KVI_OPTION_MIRCCOLOR(i)); -#ifdef COMPILE_USE_QT4 - int id = m_pForePopup->insertItem(tmp,QString("x")); -#else - int id = m_pBackPopup->insertItem(tmp); -#endif - m_pBackPopup->setItemParameter(id,i); - } - m_pContextPopup->insertItem(__tr2qs("Background"),m_pBackPopup); -} - -KviMircTextColorSelector::~KviMircTextColorSelector() -{ -} - -void KviMircTextColorSelector::commit() -{ - *m_pUFore = m_uFore; - *m_pUBack = m_uBack; -} - -void KviMircTextColorSelector::setEnabled(bool bEnabled) -{ - KviTalHBox::setEnabled(bEnabled); - m_pLabel->setEnabled(bEnabled); - m_pButton->setEnabled(bEnabled); -} - -void KviMircTextColorSelector::setButtonPalette() -{ - QPalette pal; - - if(m_uBack > KVI_MIRCCOLOR_MAX_BACKGROUND) - { - if(m_uBack != KVI_TRANSPARENT)m_uBack = KVI_TRANSPARENT; - pal = palette(); - } else { - pal = QPalette(KVI_OPTION_MIRCCOLOR(m_uBack)); - } - - if(m_uFore > KVI_MIRCCOLOR_MAX_FOREGROUND)m_uFore = KVI_MIRCCOLOR_MAX_FOREGROUND; - - pal.setColor(QColorGroup::ButtonText,KVI_OPTION_MIRCCOLOR(m_uFore)); - pal.setColor(QColorGroup::Text,KVI_OPTION_MIRCCOLOR(m_uFore)); - - m_pButton->setPalette(pal); -} - -void KviMircTextColorSelector::buttonClicked() -{ - QPoint p = m_pButton->mapToGlobal(QPoint(0,m_pButton->height())); - m_pContextPopup->popup(p); -} - -void KviMircTextColorSelector::foreSelected(int id) -{ - if(m_pForePopup) - m_uFore = m_pForePopup->itemParameter(id); - setButtonPalette(); -} - -void KviMircTextColorSelector::backSelected(int id) -{ - if(m_pBackPopup) - m_uBack = m_pBackPopup->itemParameter(id); - setButtonPalette(); -} - -KviSoundSelector::KviSoundSelector(QWidget * par,const QString & txt,QString * pOption,bool bEnabled) -:KviFileSelector(par,txt,pOption,bEnabled) -{ - m_pPlayButton = new QPushButton(__tr2qs("Play"),this); - connect(m_pPlayButton,SIGNAL(clicked()),this,SLOT(playSound())); -} - -KviSoundSelector::~KviSoundSelector() -{ -} - -void KviSoundSelector::playSound() -{ - KviKvsScript::run("snd.play $0",0,new KviKvsVariantList(new KviKvsVariant(m_pLineEdit->text()))); -} - -void KviSoundSelector::setEnabled(bool bEnabled) -{ - KviFileSelector::setEnabled(bEnabled); - m_pPlayButton->setEnabled(bEnabled); -} - -KviChanListViewItem::KviChanListViewItem(KviTalListView* pList,QString szChan,QString szPass) -:KviTalListViewItem(pList,szChan) -{ - m_szPass=szPass; - QString mask; - mask.fill('*',szPass.length()); - setText(1,mask); -} - -KviCahnnelListSelector::KviCahnnelListSelector(QWidget * par,const QString & txt,QStringList * pOption,bool bEnabled) -: KviTalVBox(par), KviSelectorInterface() -{ - m_pLabel = new QLabel(txt,this); - m_pListView = new KviTalListView(this); - m_pListView->addColumn(__tr2qs("Channel name")); - m_pListView->addColumn(__tr2qs("Channel password")); - - KviTalHBox* pEditsHBox = new KviTalHBox(this); - - m_pChanLineEdit = new QLineEdit(pEditsHBox); - connect(m_pChanLineEdit,SIGNAL(textChanged(const QString &)),this,SLOT(textChanged(const QString &))); - connect(m_pChanLineEdit,SIGNAL(returnPressed()),this,SLOT(addClicked())); - - m_pPassLineEdit = new QLineEdit(pEditsHBox); - m_pPassLineEdit->setEchoMode(QLineEdit::Password); - connect(m_pPassLineEdit,SIGNAL(textChanged(const QString &)),this,SLOT(textChanged(const QString &))); - connect(m_pPassLineEdit,SIGNAL(returnPressed()),this,SLOT(addClicked())); - - - KviTalHBox * hBox = new KviTalHBox(this); - m_pAddButton = new QPushButton(__tr2qs("A&dd"),hBox); - connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked())); - m_pRemoveButton = new QPushButton(__tr2qs("Re&move"),hBox); - connect(m_pRemoveButton,SIGNAL(clicked()),this,SLOT(removeClicked())); - m_pOption = pOption; - - for ( QStringList::Iterator it = pOption->begin(); it != pOption->end(); ++it ) { - new KviChanListViewItem(m_pListView,(*it).section(':',0,0),(*it).section(':',1)); - } - - m_pListView->setSelectionMode(KviTalListView::Extended); - m_pListView->setAllColumnsShowFocus(TRUE); - connect(m_pListView,SIGNAL(selectionChanged()),this,SLOT(selectionChanged())); - setSpacing(4); - setStretchFactor(m_pListView,1); - setEnabled(bEnabled); -} - -KviCahnnelListSelector::~KviCahnnelListSelector() -{ -} - -void KviCahnnelListSelector::commit() -{ - m_pOption->clear(); - register KviChanListViewItem* pItem; - KviTalListViewItemIterator it( m_pListView); - while ( it.current() ) { - pItem = (KviChanListViewItem*)( it.current() ); - m_pOption->append(pItem->text(0)+":"+pItem->pass()); - ++it; - } -} - -void KviCahnnelListSelector::setEnabled(bool bEnabled) -{ - m_pLabel->setEnabled(bEnabled); - m_pListView->setEnabled(bEnabled); - m_pChanLineEdit->setEnabled(bEnabled); - m_pPassLineEdit->setEnabled(bEnabled); - m_pAddButton->setEnabled(bEnabled); - m_pRemoveButton->setEnabled(bEnabled); -} - -void KviCahnnelListSelector::textChanged(const QString &str) -{ - m_pAddButton->setEnabled(!m_pChanLineEdit->text().isEmpty()); -} - -void KviCahnnelListSelector::selectionChanged() -{ -} - -void KviCahnnelListSelector::addClicked() -{ - if(!m_pChanLineEdit->text().isEmpty()) - { - new KviChanListViewItem(m_pListView,m_pChanLineEdit->text().stripWhiteSpace(),m_pPassLineEdit->text().stripWhiteSpace()); - m_pChanLineEdit->clear(); - m_pPassLineEdit->clear(); - } -} - -void KviCahnnelListSelector::removeClicked() -{ - KviPointerList<KviTalListViewItem> lst; - KviTalListViewItemIterator it( m_pListView, KviTalListViewItemIterator::Selected ); - while ( it.current() ) { - lst.append((KviTalListViewItem *)it.current() ); - ++it; - } - lst.setAutoDelete(TRUE); - lst.clear(); -} - -#include "kvi_selectors.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_selectors.h b/3.4.0/src/kvirc/ui/kvi_selectors.h deleted file mode 100644 index 790410e2ea..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_selectors.h +++ /dev/null @@ -1,367 +0,0 @@ -#ifndef _KVI_SELECTORS_H_ -#define _KVI_SELECTORS_H_ - -//============================================================================= -// -// File : kvi_selectors.h -// Creation date : Mon Now 13 2000 15:21:10 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qcheckbox.h> -#include "kvi_tal_hbox.h" -#include "kvi_tal_vbox.h" -#include <qlineedit.h> -#include <qlabel.h> -#include "kvi_tal_scrollview.h" -#include <qpushbutton.h> -#include <qcolor.h> -#include <qfont.h> -#include "kvi_tal_listbox.h" -#include "kvi_tal_listview.h" -#include <qspinbox.h> -#include <qstringlist.h> -#include <qvalidator.h> - -#include "kvi_string.h" -#include "kvi_pixmap.h" -#include "kvi_styled_controls.h" - -//#ifndef _KVI_SELECTORS_CPP_ -// extern void commitAllSelectors(QWidget * par,const char * classname); -//#endif - - -// -// This is the common KviSelectorInterface -// -// Note: I'm always learning -// Today I have discovered that: -// QObject * o = new KviBoolSelector(...) -// ((KviSelectorInterface *)o)->commit() -// Does not work (SIGSEGV when jumping into commit(): bad vtable entry) -// But the following works fine: -// KviBoolSelector * b = new KviBoolSelector(...) -// ((KviSelectorInterface *)b)->commit(); -// Mmmmmh.... the assembler generated by gcc -// uses two different vtable offsets in the two cases -// why ? -// - -class KVIRC_API KviSelectorInterface -{ -public: - KviSelectorInterface(){}; - virtual ~KviSelectorInterface(){}; -public: - virtual void commit(){}; -}; - -class KVIRC_API KviBoolSelector : public KviStyledCheckBox, public KviSelectorInterface -{ - Q_OBJECT -public: - KviBoolSelector(QWidget * par,const QString & txt,bool *pOption,bool bEnabled); - ~KviBoolSelector(){}; -private: - bool * m_pOption; -public: - virtual void commit(); -public slots: - void setNotEnabled(bool bNotEnabled); -}; - -class KVIRC_API KviStringSelector : public KviTalHBox, public KviSelectorInterface -{ - Q_OBJECT -public: - KviStringSelector(QWidget * par,const QString & txt,QString * pOption,bool bEnabled); - ~KviStringSelector(); -protected: - QLabel * m_pLabel; - QLineEdit * m_pLineEdit; - QString * m_pOption; -public: - void setValidator(QValidator * v){ m_pLineEdit->setValidator(v); }; - void setMinimumLabelWidth(unsigned int uWidth){ m_pLabel->setMinimumWidth(uWidth); }; - virtual void commit(); - virtual void setEnabled(bool bEnabled); - void setText(const QString& text); -}; - - -class KVIRC_API KviPasswordSelector : public KviStringSelector -{ - Q_OBJECT -public: - KviPasswordSelector(QWidget * par,const QString & txt,QString * pOption,bool bEnabled); - ~KviPasswordSelector(){}; -}; - -class KVIRC_API KviPixmapPreview : public KviTalScrollView -{ - Q_OBJECT -public: - KviPixmapPreview(QWidget * par); - ~KviPixmapPreview(); -protected: - KviPixmap * m_pPixmap; -public: - void setPixmap(KviPixmap * pix); -protected: - virtual void drawContents(QPainter * p, int clipx, int clipy, int clipw, int cliph); - -}; - -class KVIRC_API KviPixmapSelector : public QWidget, public KviSelectorInterface -{ - Q_OBJECT -public: - KviPixmapSelector(QWidget * par,const QString & txt,KviPixmap * pOption,bool bEnabled); - ~KviPixmapSelector(); -private: - KviStyledCheckBox * m_pCheckBox; - QLabel * m_pFileNameLabel; - KviPixmapPreview * m_pPreview; - QPushButton * m_pChooseButton; - KviPixmap * m_pOption; - KviPixmap m_localPixmap; -public: - void setImagePath(const char * path); - virtual void commit(); - virtual void setEnabled(bool bEnabled); -protected slots: - void checkBoxToggled(bool bEnabled); - void choosePixmap(); -}; - -class KVIRC_API KviUIntSelector : public KviTalHBox, public KviSelectorInterface -{ - Q_OBJECT -public: - KviUIntSelector(QWidget * par,const QString & txt,unsigned int *pOption, - unsigned int uLowBound,unsigned int uHighBound,unsigned int uDefault,bool bEnabled,bool bShortInt = false); - ~KviUIntSelector(){}; -private: - QLabel * m_pLabel; - QSpinBox * m_pSpinBox; - unsigned int * m_pOption; - unsigned int m_uLowBound; - unsigned int m_uHighBound; - unsigned int m_uDefault; - bool m_bIsShortInt; -public: - virtual void setPrefix(const QString & txt); - virtual void setSuffix(const QString & txt); - virtual void commit(); - virtual void setEnabled(bool bEnabled); -}; - - -class KVIRC_API KviFileSelector : public KviTalHBox, public KviSelectorInterface -{ - Q_OBJECT -public: - KviFileSelector(QWidget * par,const QString & txt,QString * pOption,bool bEnabled,unsigned int uFlags = 0,const QString &szFilter = QString::null); - ~KviFileSelector(){}; -public: - enum Flags { - ChooseSaveFileName = 1, - DontConfirmOverwrite = 2 - }; -protected: - QLabel * m_pLabel; - QLineEdit * m_pLineEdit; - QPushButton * m_pButton; - QString * m_pOption; - unsigned int m_uFlags; - QString m_szFilter; -public: - virtual void commit(); - virtual void setEnabled(bool bEnabled); - void setSelection(const QString &szSelection); -signals: - void selectionChanged(const QString &szNewValue); -private slots: - void browseClicked(); -protected: - virtual void select(); -}; - -class KVIRC_API KviDirectorySelector : public KviFileSelector -{ - Q_OBJECT -public: - KviDirectorySelector(QWidget * par,const QString & txt,QString * pOption,bool bEnabled); - ~KviDirectorySelector(){}; -protected: - virtual void select(); -}; - - -class KVIRC_API KviColorSelector : public KviTalHBox, public KviSelectorInterface -{ - Q_OBJECT -public: - KviColorSelector(QWidget * par,const QString & txt,QColor * pOption,bool bEnabled); - ~KviColorSelector(){}; -private: - QLabel * m_pLabel; - QColor * m_pOption; - QColor m_memColor; - QPushButton * m_pButton; -public: - virtual void commit(); - virtual void setEnabled(bool bEnabled); - QColor getColor(){ return m_memColor; }; - void forceColor(QColor clr); -private: - void setButtonPalette(QColor * pOption); -private slots: - void changeClicked(); -}; - -class KVIRC_API KviFontSelector : public KviTalHBox, public KviSelectorInterface -{ - Q_OBJECT -public: - KviFontSelector(QWidget * par,const QString & txt,QFont * pOption,bool bEnabled); - ~KviFontSelector(){}; -private: - QLabel * m_pLabel; - QFont * m_pOption; - QPushButton * m_pButton; -public: - virtual void commit(); - virtual void setEnabled(bool bEnabled); -private: - void setButtonFont(QFont * pOption); -private slots: - void changeClicked(); -}; - -class KVIRC_API KviStringListSelector : public KviTalVBox, public KviSelectorInterface -{ - Q_OBJECT -public: - KviStringListSelector(QWidget * par,const QString & txt,QStringList * pOption,bool bEnabled); - ~KviStringListSelector(); -private: - QLabel * m_pLabel; - KviTalListBox * m_pListBox; - QLineEdit * m_pLineEdit; - QPushButton * m_pAddButton; - QPushButton * m_pRemoveButton; - QStringList * m_pOption; -public: - virtual void commit(); - virtual void setEnabled(bool bEnabled); -private slots: - void textChanged(const QString &str); - void selectionChanged(); - void addClicked(); - void removeClicked(); -}; - -class KviTalPopupMenu; - -class KVIRC_API KviMircTextColorSelector : public KviTalHBox, public KviSelectorInterface -{ - Q_OBJECT -public: - KviMircTextColorSelector(QWidget * par,const QString &txt,unsigned int * uFore,unsigned int * uBack,bool bEnabled); - ~KviMircTextColorSelector(); -private: - QLabel *m_pLabel; - QPushButton * m_pButton; - unsigned int * m_pUFore; - unsigned int * m_pUBack; - unsigned int m_uFore; - unsigned int m_uBack; - KviTalPopupMenu * m_pContextPopup; - KviTalPopupMenu * m_pForePopup; - KviTalPopupMenu * m_pBackPopup; -public: - virtual void commit(); - virtual void setEnabled(bool bEnabled); -protected slots: - void buttonClicked(); - void foreSelected(int); - void backSelected(int); -protected: - void setButtonPalette(); -}; - - -class KVIRC_API KviSoundSelector : public KviFileSelector -{ - Q_OBJECT -public: - KviSoundSelector(QWidget * par,const QString & txt,QString * pOption,bool bEnabled); - ~KviSoundSelector(); -protected: - QPushButton *m_pPlayButton; -private slots: - void playSound(); -public: - virtual void setEnabled(bool bEnabled); -}; - -class KVIRC_API KviChanListViewItem : public KviTalListViewItem -{ -private: - QString m_szPass; -public: - KviChanListViewItem(KviTalListView* pList,QString szChan,QString szPass); - ~KviChanListViewItem() {}; - - const QString& pass() { return m_szPass; } -}; - -class KVIRC_API KviCahnnelListSelector : public KviTalVBox, public KviSelectorInterface -{ - Q_OBJECT -public: - KviCahnnelListSelector(QWidget * par,const QString & txt,QStringList * pOption,bool bEnabled); - ~KviCahnnelListSelector(); -private: - QLabel * m_pLabel; - KviTalListView * m_pListView; - QLineEdit * m_pChanLineEdit; - QLineEdit * m_pPassLineEdit; - QPushButton * m_pAddButton; - QPushButton * m_pRemoveButton; - QStringList * m_pOption; -public: - virtual void commit(); - virtual void setEnabled(bool bEnabled); -private slots: - void textChanged(const QString &str); - void selectionChanged(); - void addClicked(); - void removeClicked(); -}; - - - -#endif //!_KVI_SELECTORS_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_splash.cpp b/3.4.0/src/kvirc/ui/kvi_splash.cpp deleted file mode 100644 index 9a90d36328..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_splash.cpp +++ /dev/null @@ -1,222 +0,0 @@ -//============================================================================= -// -// File : kvi_splash.cpp -// Creation date : Wed Aug 8 2001 17:46:10 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_string.h" -#include "kvi_app.h" -#include "kvi_defaults.h" -#include "kvi_splash.h" -#include "kvi_locale.h" -#include "kvi_fileutils.h" -#include <qsplashscreen.h> - -#ifdef COMPILE_USE_QT4 - #include <qdesktopwidget.h> -#endif - -#include <qpixmap.h> -#include <qpainter.h> -#include <qlayout.h> - -#include <stdio.h> - - -KviSplashScreen::KviSplashScreen() -: QSplashScreen(QPixmap(1,1),Qt::WStyle_NoBorder | Qt::WType_TopLevel | Qt::WStyle_Customize | Qt::WStyle_StaysOnTop | Qt::WStyle_Splash) -{ - QString szPix; - QPixmap * pix = 0; - - // check for the current theme splash screen pointer - QString szPointerFile; - g_pApp->getLocalKvircDirectory(szPointerFile,KviApp::Themes,"current-splash"); - if(KviFileUtils::fileExists(szPointerFile)) - { - QString szBuf; - KviFileUtils::readFile(szPointerFile,szBuf); - if(!szBuf.isEmpty()) - { - g_pApp->getLocalKvircDirectory(szPix,KviApp::Themes,szBuf); - KviQString::ensureLastCharIs(szPix,KVI_PATH_SEPARATOR_CHAR); - szPix.append("kvi_splash.png"); - pix = new QPixmap(szPix); - if(pix->isNull()) - { - // no way.. - delete pix; - pix = 0; - } else { - // else we might have a themed splash screen -// g_pApp->getLocalKvircDirectory(szPix,KviApp::Themes,szBuf); - KviQString::ensureLastCharIs(szPix,KVI_PATH_SEPARATOR_CHAR); - szPix.append("kvi_splash_overlay.png"); - m_pOverlay = new QPixmap(szPix); - if(m_pOverlay->isNull()) - { - // no way.. - delete pix; - pix = 0; - delete m_pOverlay; - m_pOverlay = 0; - } - } - } - } - - if(!pix) - { - if(g_pApp->findImage(szPix,"kvi_splash.png")) - { - pix = new QPixmap(szPix); - } else { - // dummy image - pix = new QPixmap(300,200); - } - - if(g_pApp->findImage(szPix,"kvi_splash_overlay.png")) - { - m_pOverlay = new QPixmap(szPix); - } else { - m_pOverlay = new QPixmap(300,20); - } - } - - setPixmap(*pix); - m_pTimer = new QTimer(this); - connect(m_pTimer,SIGNAL(timeout()),this,SLOT(suicide())); - delete pix; - -#ifdef COMPILE_USE_QT4 - setWindowOpacity(0); - m_bIncreasing=true; - m_rTransparency=0; - m_pFadeTimer= new QTimer(this); - connect(m_pFadeTimer,SIGNAL(timeout()),this,SLOT(fadeTimerShot())); - m_pFadeTimer->start(6); -#endif -} - -// We don't need messages on the splash: they just add work to the translators and nobody can read them anyway :D -//void KviSplashScreen::message(QString szMessage) -//{ - //QSplashScreen::message(szMessage, Qt::AlignRight | Qt::AlignBottom, Qt::white); -//} - -KviSplashScreen::~KviSplashScreen() -{ - g_pSplashScreen = 0; // make sure it's true - delete m_pTimer; - delete m_pOverlay; -} - - -void KviSplashScreen::showEvent(QShowEvent *e) -{ - move((g_pApp->desktop()->width() - width())/2, - (g_pApp->desktop()->height() - height())/2); - m_creationTime = QTime::currentTime(); -} - -void KviSplashScreen::hideEvent(QHideEvent *e) -{ - suicide(); -} - -void KviSplashScreen::setProgress(int progress) -{ -#ifdef COMPILE_USE_QT4 - QPixmap slowQt4Copy = pixmap(); - QPainter painter(&slowQt4Copy); - QSize size = slowQt4Copy.size(); - int w = (m_pOverlay->width() * progress) / 100; - painter.drawPixmap(0,size.height() - m_pOverlay->height(),w,m_pOverlay->height(),*m_pOverlay,0,0,w,m_pOverlay->height()); - painter.end(); - setPixmap(slowQt4Copy); -#else - QPainter painter(pixmap()); - QSize size = pixmap()->size(); - painter.drawPixmap(0,size.height() - m_pOverlay->height(),*m_pOverlay,0,0,(m_pOverlay->width() * progress) / 100,m_pOverlay->height()); - painter.end(); -#endif - //raise(); - repaint(); - g_pApp->processEvents(); //damn... -} - -#define KVI_SPLASH_SCREEN_MINIMUM_TIMEOUT_IN_MSECS 2000 - -void KviSplashScreen::die() -{ -#ifdef COMPILE_USE_QT4 - m_bIncreasing = false; - m_pFadeTimer->start(6); -#else - QTime now = QTime::currentTime(); - int mSecs = m_creationTime.msecsTo(now); - int mRemaining = KVI_SPLASH_SCREEN_MINIMUM_TIMEOUT_IN_MSECS - mSecs; - if(mRemaining < 0)mRemaining = 0; - m_pTimer->start(mRemaining,true); -#endif -} - - -void KviSplashScreen::suicide() -{ - if(!g_pSplashScreen)return; // already in suicide ? - //g_pApp->collectGarbage(this); - g_pSplashScreen = 0; - deleteLater(); - //delete this; -} - - -void KviSplashScreen::fadeTimerShot() -{ -#ifdef COMPILE_USE_QT4 - if(m_bIncreasing) - { - m_rTransparency+=0.05; - setWindowOpacity(m_rTransparency); - if(m_rTransparency>=1) - { - m_pFadeTimer->stop(); - m_bIncreasing=false; - } - - - } else { - m_rTransparency-=0.02; - setWindowOpacity(m_rTransparency); - if(m_rTransparency<=0) - { - m_pFadeTimer->stop(); - m_bIncreasing=true; - suicide(); - } - } -#endif -} - - -#include "kvi_splash.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_splash.h b/3.4.0/src/kvirc/ui/kvi_splash.h deleted file mode 100644 index 2e7da11ad2..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_splash.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef _KVI_SPLASH_H_ -#define _KVI_SPLASH_H_ -//============================================================================= -// -// File : kvi_splash.h -// Creation date : Wed Aug 8 2001 17:45:12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001-2005 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - - -#include <qframe.h> - -#include <qprogressbar.h> -#include <qlabel.h> -#include <qtimer.h> -#include <qdatetime.h> -#include <qsplashscreen.h> -#include <qpixmap.h> - -class KVIRC_API KviSplashScreen : public QSplashScreen -{ - Q_OBJECT -public: - KviSplashScreen(); - virtual ~KviSplashScreen(); -private: - QTimer * m_pTimer; - QTime m_creationTime; - QPixmap * m_pOverlay; -#ifdef COMPILE_USE_QT4 - bool m_bIncreasing; - qreal m_rTransparency; - QTimer * m_pFadeTimer; -#endif -protected: - virtual void showEvent(QShowEvent * e); - virtual void hideEvent(QHideEvent * e); -public: - void setProgress(int progress); - void die(); - //void message(QString); -protected slots: - void suicide(); - void fadeTimerShot(); -}; - -extern KVIRC_API KviSplashScreen * g_pSplashScreen; - -#define KVI_SPLASH_SET_PROGRESS(__val) if(g_pSplashScreen)g_pSplashScreen->setProgress(__val); -//#define KVI_SPLASH_SET_TEXT(__txt) if(g_pSplashScreen){ g_pSplashScreen->message(__txt); debug(__txt.latin1()); } - - -#endif //_KVI_SPLASH_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_statusbar.cpp b/3.4.0/src/kvirc/ui/kvi_statusbar.cpp deleted file mode 100644 index 6bdab2d427..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_statusbar.cpp +++ /dev/null @@ -1,643 +0,0 @@ -//============================================================================= -// -// File : kvi_statusbar.cpp -// Created on Tue 07 Sep 2004 03:56:46 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_statusbar.h" -#include "kvi_frame.h" - -#include <qlabel.h> - -#include "kvi_iconmanager.h" -#include "kvi_window.h" -#include "kvi_irccontext.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_locale.h" -#include "kvi_app.h" -#include "kvi_config.h" -#include "kvi_modulemanager.h" -#include "kvi_statusbarapplet.h" -#include "kvi_dynamictooltip.h" - -#include <qpainter.h> -#include <qstyle.h> -#include <qlayout.h> -#include <qtimer.h> -#include <qcursor.h> -#include "kvi_tal_popupmenu.h" -#include <qpixmap.h> - -#ifdef COMPILE_USE_QT4 - #include <qevent.h> -#endif - -// This class COULD be derived also from KStatusBar but in fact -// it adds no graphic functionality and it has only useless methods for us. -// ... for now let's keep it simple :) - - -#include "kvi_time.h" -#include "kvi_qstring.h" - -#include <qfont.h> - -/* - IDEAS: - - Countdown timer -*/ - - - - - -KviStatusBar::KviStatusBar(KviFrame * pFrame) -: QStatusBar(pFrame) -{ - - setProperty("name","statusbar"); - m_pFrame = pFrame; - // ugh :D - setSizeGripEnabled(false); - - m_pContextPopup = 0; - m_pAppletsPopup = 0; - - m_pClickedApplet = 0; - - m_pAppletDescriptors = new KviPointerHashTable<QString,KviStatusBarAppletDescriptor>; - m_pAppletDescriptors->setAutoDelete(true); - - KviStatusBarClock::selfRegister(this); - KviStatusBarAwayIndicator::selfRegister(this); - KviStatusBarLagIndicator::selfRegister(this); - KviStatusBarConnectionTimer::selfRegister(this); - KviStatusBarSeparator::selfRegister(this); - - m_pAppletList = new KviPointerList<KviStatusBarApplet>; - m_pAppletList->setAutoDelete(false); - - m_pMessageQueue = new KviPointerList<KviStatusBarMessage>; - m_pMessageQueue->setAutoDelete(true); - - m_pMessageTimer = 0; - - m_pMessageLabel = new QLabel("<b>[x]</b> x",this,"msgstatuslabel"); - m_pMessageLabel->setMargin(1); -#ifdef COMPILE_USE_QT4 - m_pMessageLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); -#else - m_pMessageLabel->setAlignment(SingleLine | Qt::AlignVCenter | Qt::AlignLeft); -#endif - m_pMessageLabel->setMinimumWidth(350); - - m_iLastMinimumHeight = 0; - m_bStopLayoutOnAddRemove = true; - - connect(m_pFrame,SIGNAL(activeContextChanged()),this,SLOT(setPermanentMessage())); - connect(m_pFrame,SIGNAL(activeContextStateChanged()),this,SLOT(setPermanentMessage())); - connect(m_pFrame,SIGNAL(activeConnectionUserModeChanged()),this,SLOT(setPermanentMessage())); - connect(m_pFrame,SIGNAL(activeConnectionNickNameChanged()),this,SLOT(setPermanentMessage())); - setPermanentMessage(); - - m_bStopLayoutOnAddRemove = false; - - m_pToolTip = new KviDynamicToolTip(this); - connect(m_pToolTip,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &))); - - updateLayout(); -} - -KviStatusBar::~KviStatusBar() -{ - save(); - - m_bStopLayoutOnAddRemove = true; - - if(m_pMessageTimer)delete m_pMessageTimer; - delete m_pMessageQueue; - delete m_pAppletDescriptors; - delete m_pAppletList; -} - -void KviStatusBar::load() -{ - KviStr szBuf; - if(!g_pApp->getReadOnlyConfigPath(szBuf,"statusbar.kvc"))return; // no config file at all - - KviConfig cfg(szBuf.ptr(),KviConfig::Read); - cfg.setGroup("Applets"); - - int nApplets = cfg.readIntEntry("Count",0); - for(int i=0;i<nApplets;i++) - { - KviStr prefix(KviStr::Format,"Applet%d",i); - KviStr tmp(KviStr::Format,"%s_InternalName",prefix.ptr()); - QString szInternalName = cfg.readEntry(tmp.ptr(),""); - if(!szInternalName.isEmpty()) - { - tmp.sprintf("%s_PreloadModule",prefix.ptr()); - QString szPreloadModule = cfg.readEntry(tmp.ptr(),""); - if(!szPreloadModule.isEmpty()) - g_pModuleManager->getModule(szPreloadModule.utf8().data()); - - KviStatusBarApplet * a = createApplet(szInternalName); - if (a) - a->loadState(prefix.ptr(),&cfg); - else - debug("warning: failed to create applet %s (preload: %s)!", - szInternalName.utf8().data(), szPreloadModule.utf8().data()); - } - } -} - -void KviStatusBar::save() -{ - // FIXME: This will preserve the settings of the last saved KviFrame's statusbar only :/ - KviStr szBuf; - g_pApp->getLocalKvircDirectory(szBuf,KviApp::Config,"statusbar.kvc"); - - KviConfig cfg(szBuf.ptr(),KviConfig::Write); - cfg.setGroup("Applets"); - - cfg.writeEntry("Count",m_pAppletList->count()); - - int i = 0; - for(KviStatusBarApplet * a = m_pAppletList->first();a;a = m_pAppletList->next()) - { - KviStr prefix(KviStr::Format,"Applet%d",i); - KviStr tmp(KviStr::Format,"%s_InternalName",prefix.ptr()); - cfg.writeEntry(tmp.ptr(),a->descriptor()->internalName()); - a->saveState(prefix.ptr(),&cfg); - if(!(a->descriptor()->preloadModule().isEmpty())) - { - tmp.sprintf("%s_PreloadModule",prefix.ptr()); - cfg.writeEntry(tmp.ptr(),a->descriptor()->preloadModule()); - } - i++; - } -} - -#define VMARGIN 3 -#define HMARGIN 4 -#define SPACING 3 -#define RICHTEXTLABELTRICK 2 - -void KviStatusBar::layoutChildren() -{ - int x = width() - HMARGIN; - int h = height() - (VMARGIN * 2); - for(KviStatusBarApplet * a = m_pAppletList->last();a;a = m_pAppletList->prev()) - { - int w = a->sizeHint().width(); - x -= w; - a->setGeometry(x,VMARGIN,w,h); - x -= SPACING; - } - // trick to center vertically the rich text label: make it some pixels smaller - m_pMessageLabel->setGeometry(HMARGIN,VMARGIN,x - HMARGIN,h - RICHTEXTLABELTRICK); -} - -void KviStatusBar::resizeEvent(QResizeEvent * e) -{ - layoutChildren(); -} - -bool KviStatusBar::event(QEvent * e) -{ - if(e->type() == QEvent::LayoutHint) - { - updateLayout(); - return false; // send to parents too! - } - return QStatusBar::event(e); -} - -void KviStatusBar::recalcMinimumHeight() -{ - int s = 18; - int h = m_pMessageLabel->sizeHint().height(); - if(h > s)s = h; - for(KviStatusBarApplet * a = m_pAppletList->last();a;a = m_pAppletList->prev()) - { - h = a->sizeHint().height(); - if(h > s)s = h; - } - s += (VMARGIN * 2) + RICHTEXTLABELTRICK; - if(m_iLastMinimumHeight != s) - { - m_iLastMinimumHeight = s; - setMinimumHeight(s); - QLayout * l = layout(); - if(l) - if(l->inherits("QBoxLayout")) - ((QBoxLayout *)l)->addStrut(s); - // FIXME: do QMainWindow need setUpLayout() here ? - } -} - -bool KviStatusBar::appletExists(KviStatusBarApplet * pApplet) -{ - return (m_pAppletList->findRef(pApplet) != -1); -} - -KviStatusBarApplet * KviStatusBar::appletAt(const QPoint &pnt,bool bBestMatch) -{ - QPoint local = mapFromGlobal(pnt); - if(bBestMatch) - { - for(KviStatusBarApplet * a = m_pAppletList->first();a;a = m_pAppletList->next()) - { - if(local.x() <= (a->x() + a->width()))return a; - } - return m_pAppletList->last(); // last anyway - } - - for(KviStatusBarApplet * a = m_pAppletList->first();a;a = m_pAppletList->next()) - { - if((local.x() >= a->x()) && (local.y() >= a->y())) - { - if((local.x() <= (a->x() + a->width())) && (local.y() <= (a->y() + a->height()))) - { - return a; - } - } - } - return 0; -} - -void KviStatusBar::tipRequest(KviDynamicToolTip *pTip,const QPoint &pnt) -{ - KviStatusBarApplet * a = appletAt(mapToGlobal(pnt)); - QString szTip; - QRect r; - if(a) - { - szTip = "<table width=\"100%\"><tr><td bgcolor=\"#303030\" align=\"center\"><font color=\"#ffffff\"><b>" + a->descriptor()->visibleName() + "</b></font></td></tr>"; - - QString szTipx = a->tipText(a->mapFromGlobal(mapToGlobal(pnt))); - if(!szTipx.isEmpty()) - { - szTip += "<tr><td>"; - szTip += szTipx; - szTip += "</td></tr><tr><td align=\"center\"><hr></td></tr>"; - } - - szTip += "<tr><td align=\"center\"><font color=\"#808080\" size=\"-1\">"; - szTip += __tr2qs("<b>Shift+Drag</b> or <b>Ctrl+Drag</b> to move the applet around<br><b>Right click</b> to see the other options"); - szTip += "</font></td></tr></table>"; - r = QRect(a->x(),a->y(),a->width(),a->height()); - } else { - szTip = "<center>"; - szTip += __tr2qs("<b>Right click</b> to add/remove applets"); - szTip += "</center>"; - r = QRect(m_pMessageLabel->x(),m_pMessageLabel->y(),m_pMessageLabel->width(),m_pMessageLabel->height()); - } - pTip->tip(r,szTip); -} - -KviTalPopupMenu * KviStatusBar::contextPopup() -{ - if(!m_pContextPopup) - { - m_pContextPopup = new KviTalPopupMenu(this); - connect(m_pContextPopup,SIGNAL(aboutToShow()),this,SLOT(contextPopupAboutToShow())); - } - m_pClickedApplet = appletAt(QCursor::pos()); - return m_pContextPopup; -} - -void KviStatusBar::contextPopupAboutToShow() -{ - if(!m_pContextPopup)return; - m_pContextPopup->clear(); - - - if(appletExists(m_pClickedApplet)) - { - QString app = m_pClickedApplet->descriptor()->visibleName(); - - QString tmp; - KviQString::sprintf(tmp,"<center><b>%Q</b></center>",&app); - -#ifndef COMPILE_USE_QT4 - // FIXME: This is not supported under Qt4.. :( - QLabel * l = new QLabel(tmp,m_pContextPopup); - l->setFrameStyle(QFrame::Raised | QFrame::StyledPanel); - m_pContextPopup->insertItem(l); -#endif - - m_pClickedApplet->fillContextPopup(m_pContextPopup); - - KviQString::sprintf(tmp,__tr2qs("Remove %Q"),&app); - m_pContextPopup->insertSeparator(); - m_pContextPopup->insertItem(tmp,this,SLOT(removeClickedApplet())); - } - - if(!m_pAppletsPopup) - { - m_pAppletsPopup = new KviTalPopupMenu(this); - connect(m_pAppletsPopup,SIGNAL(aboutToShow()),this,SLOT(appletsPopupAboutToShow())); - connect(m_pAppletsPopup,SIGNAL(activated(int)),this,SLOT(appletsPopupActivated(int))); - } - - m_pContextPopup->insertItem(__tr2qs("Add Applet"),m_pAppletsPopup); -} - -void KviStatusBar::removeClickedApplet() -{ - if(!appletExists(m_pClickedApplet))return; - delete m_pClickedApplet; - m_pClickedApplet = 0; -} - -void KviStatusBar::appletsPopupAboutToShow() -{ - if(!m_pAppletsPopup)return; - m_pAppletsPopup->clear(); - - // FIXME: could we cache the module results in some way ? - g_pModuleManager->loadModulesByCaps("statusbarapplet"); - - KviPointerHashTableIterator<QString,KviStatusBarAppletDescriptor> it(*m_pAppletDescriptors); - while(KviStatusBarAppletDescriptor * d = it.current()) - { - int id; - QPixmap * pix = d->icon(); - if(pix)id = m_pAppletsPopup->insertItem(*pix,d->visibleName()); - else id = m_pAppletsPopup->insertItem(d->visibleName()); - m_pAppletsPopup->setItemParameter(id,d->id()); - ++it; - } -} - -KviStatusBarApplet * KviStatusBar::createApplet(const QString &szInternalName) -{ - KviStatusBarAppletDescriptor * d = m_pAppletDescriptors->find(szInternalName); - if(!d)return 0; - return d->create(this); -} - -void KviStatusBar::showLayoutHelp() -{ - queueMessage(new KviStatusBarMessage(__tr2qs("Drag the applet while holding the Shift or Ctrl key to move it to the desired position"))); -} - -void KviStatusBar::appletsPopupActivated(int id) -{ - // FIXME: In fact the applet descriptors in modules could - // have been unloaded while the popup was being shown... - // For now we just assume that this never happens :D - - if(!m_pAppletsPopup)return; - int par = m_pAppletsPopup->itemParameter(id); - KviPointerHashTableIterator<QString,KviStatusBarAppletDescriptor> it(*m_pAppletDescriptors); - while(KviStatusBarAppletDescriptor * d = it.current()) - { - if(par == d->id()) - { - if(m_pClickedApplet) - { - int idx = m_pAppletList->findRef(m_pClickedApplet); - if(idx != -1) - { - // try to put the new applet just after the clicked one - bool bSave = m_bStopLayoutOnAddRemove; - m_bStopLayoutOnAddRemove = true; - KviStatusBarApplet * a = d->create(this); - m_pAppletList->removeRef(a); - m_pAppletList->insert(idx + 1,a); - m_bStopLayoutOnAddRemove = bSave; - if(!m_bStopLayoutOnAddRemove)updateLayout(); - showLayoutHelp(); - return; - } - } - d->create(this); - showLayoutHelp(); - return; - } - ++it; - } -} - -void KviStatusBar::registerAppletDescriptor(KviStatusBarAppletDescriptor * d) -{ - m_pAppletDescriptors->replace(d->internalName(),d); -} - -void KviStatusBar::registerApplet(KviStatusBarApplet * a) -{ - m_pAppletList->append(a); - if(!a->isVisible())a->show(); - if(!m_bStopLayoutOnAddRemove)updateLayout(); -} - -void KviStatusBar::unregisterApplet(KviStatusBarApplet * a) -{ - if(!a)return; - m_pAppletList->removeRef(a); - if(a->isVisible())a->hide(); - if(!m_bStopLayoutOnAddRemove)updateLayout(); -} - - -void KviStatusBar::paintEvent(QPaintEvent * e) -{ - // avoid the ugly rectangle around the widgets painted by QStatusBar -// QPainter p(this); -// style().drawPrimitive(QStyle::PE_Panel,&p,rect(),colorGroup(),QStyle::Style_Raised,QStyleOption(1,1)); - //QStatusBar::paintEvent(e); - //qDrawWinPanel(&p,0,0,width(),height(),colorGroup(),false,0); -} - -void KviStatusBar::mousePressEvent(QMouseEvent * e) -{ - m_pClickedApplet = 0; - if(e->button() & Qt::RightButton) - { - contextPopup()->popup(QCursor::pos()); - return; - } - if((e->button() & Qt::LeftButton) && (e->state() & (Qt::ShiftButton | Qt::ControlButton))) - { - // move! - m_pClickedApplet = appletAt(mapToGlobal(e->pos())); - if(!m_pClickedApplet)return; - m_pClickedApplet->select(); -#ifdef COMPILE_USE_QT4 - g_pApp->setOverrideCursor(Qt::SizeAllCursor); -#else - g_pApp->setOverrideCursor(sizeAllCursor); -#endif - } -} - -void KviStatusBar::mouseMoveEvent(QMouseEvent * e) -{ - if(!m_pClickedApplet)return; - if(!appletExists(m_pClickedApplet))return; - QPoint g = mapToGlobal(e->pos()); - KviStatusBarApplet * a = appletAt(g,true); - if(a == m_pClickedApplet)return; - // move! - if(!a) - { - a = m_pAppletList->first(); - if(!a)return; // ops! - - if(e->pos().x() < (a->x() + a->width())) - { - if(a == m_pClickedApplet)return; // don't move - } else { - a = m_pAppletList->last(); - if(!a)return; - if(a == m_pClickedApplet)return; // no way to move - } - } - - m_pAppletList->removeRef(m_pClickedApplet); - int idx = m_pAppletList->findRef(a); - if(idx == -1)m_pAppletList->append(m_pClickedApplet); // uhg ? - else { - QPoint p = a->mapFromGlobal(g); - if(p.x() > (a->width() / 2))idx++; // just after - m_pAppletList->insert(idx,m_pClickedApplet); - } - layoutChildren(); -} - -void KviStatusBar::mouseReleaseEvent(QMouseEvent * e) -{ - if(e->button() & Qt::LeftButton) - { - if(m_pClickedApplet && appletExists(m_pClickedApplet)) - { - m_pClickedApplet->select(false); - g_pApp->restoreOverrideCursor(); - } - } -} - -void KviStatusBar::queueMessage(KviStatusBarMessage * pMsg) -{ - // FIXME: the priority of the message!!! - m_pMessageQueue->append(pMsg); - if(!m_pMessageTimer)showFirstMessageInQueue(); - // else we wait for the message timer to shot -} - -void KviStatusBar::messageTimerFired() -{ - if(m_pMessageTimer)m_pMessageTimer->stop(); - - if(!m_pMessageQueue->isEmpty()) - { - // the first message in queue is currently visible - // kill it - m_pMessageQueue->removeFirst(); - if(!m_pMessageQueue->isEmpty()) - { - // something to show - showFirstMessageInQueue(); - } - } - // nothing else to show - delete m_pMessageTimer; - m_pMessageTimer = 0; - - setPermanentMessage(); -} - -void KviStatusBar::showFirstMessageInQueue() -{ - KviStatusBarMessage * pMsg = m_pMessageQueue->first(); - if(!pMsg) - { - if(m_pMessageTimer) - { - delete m_pMessageTimer; - m_pMessageTimer = 0; - } - return; - } - - if(!m_pMessageTimer) - { - m_pMessageTimer = new QTimer(this); - QObject::connect(m_pMessageTimer,SIGNAL(timeout()),this,SLOT(messageTimerFired())); - } else { - m_pMessageTimer->stop(); - } - - m_pMessageLabel->setText("<nobr>" + pMsg->text() + "</nobr>"); - m_pMessageTimer->start(pMsg->timeout()); -} - - -void KviStatusBar::setPermanentMessage() -{ - if(m_pMessageTimer)return; // something is being actually shown! - - KviIrcContext * c = m_pFrame->activeContext(); - - QString txt = "<nobr>"; - - if(c) - { - switch(c->state()) - { - case KviIrcContext::Connected: - txt += "<b>["; - txt += c->connection()->currentServerName(); - txt += "]</b> "; - txt += c->connection()->currentNickName(); - if(!c->connection()->userInfo()->userMode().isEmpty()) - { - txt += " (+"; - txt += c->connection()->userInfo()->userMode(); - txt += ")"; - } - break; - case KviIrcContext::Connecting: - txt += __tr2qs("Connection in progress..."); - break; - case KviIrcContext::LoggingIn: - txt += "<b>["; - txt += c->connection()->currentServerName(); - txt += "]</b> "; - txt += __tr2qs("Login in progress..."); - break; - default: - txt += __tr2qs("Not connected"); - break; - } - } else { - txt += __tr2qs("No IRC context"); - } - - txt += "</nobr>"; - - m_pMessageLabel->setText(txt); -} diff --git a/3.4.0/src/kvirc/ui/kvi_statusbar.h b/3.4.0/src/kvirc/ui/kvi_statusbar.h deleted file mode 100644 index 0569e27606..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_statusbar.h +++ /dev/null @@ -1,130 +0,0 @@ -#ifndef _KVI_STATUSBAR_H_ -#define _KVI_STATUSBAR_H_ -//============================================================================= -// -// File : kvi_statusbar.h -// Created on Tue 07 Sep 2004 03:56:46 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_pointerlist.h" -#include "kvi_heapobject.h" - -#include <qstring.h> -#include "kvi_pointerhashtable.h" -#include <qstatusbar.h> - -class KviFrame; - -class QTimer; -class QLabel; -class KviTalPopupMenu; - -class KVIRC_API KviStatusBarMessage : public KviHeapObject -{ - friend class KviStatusBar; -protected: - QString m_szText; - unsigned int m_uTimeout; - unsigned int m_uPriority; -public: - KviStatusBarMessage(const QString &szText,unsigned int uTimeout = 8000,unsigned int uPriority = 0) - : KviHeapObject(), m_szText(szText), m_uTimeout(uTimeout), m_uPriority(uPriority) {}; - ~KviStatusBarMessage(){}; -public: - const QString & text(){ return m_szText; }; - unsigned int timeout(){ return m_uTimeout; }; - unsigned int priority(){ return m_uPriority; }; -}; - - -class KviStatusBarApplet; -class KviStatusBarAppletDescriptor; -class KviIrcContext; -class KviDynamicToolTip; - -class KVIRC_API KviStatusBar : public QStatusBar -{ - friend class KviStatusBarApplet; - friend class KviFrame; - Q_OBJECT -public: - KviStatusBar(KviFrame * pFrame); - ~KviStatusBar(); -protected: - KviFrame * m_pFrame; - KviPointerList<KviStatusBarMessage> * m_pMessageQueue; - QTimer * m_pMessageTimer; - QLabel * m_pMessageLabel; - KviPointerList<KviStatusBarApplet> * m_pAppletList; - KviPointerHashTable<QString,KviStatusBarAppletDescriptor> * m_pAppletDescriptors; - KviTalPopupMenu * m_pContextPopup; - KviTalPopupMenu * m_pAppletsPopup; - KviStatusBarApplet * m_pClickedApplet; - int m_iLastMinimumHeight; - bool m_bStopLayoutOnAddRemove; - KviDynamicToolTip * m_pToolTip; -public: - KviFrame * frame(){ return m_pFrame; }; -protected slots: - void messageTimerFired(); -protected: - void showFirstMessageInQueue(); - virtual void paintEvent(QPaintEvent * e); - virtual void mousePressEvent(QMouseEvent * e); - virtual void mouseMoveEvent(QMouseEvent * e); - virtual void mouseReleaseEvent(QMouseEvent * e); - virtual void resizeEvent(QResizeEvent * e); - virtual bool event(QEvent * e); - void registerApplet(KviStatusBarApplet * a); - void unregisterApplet(KviStatusBarApplet * a); - void recalcMinimumHeight(); - void layoutChildren(); - void updateLayout(){ recalcMinimumHeight(); layoutChildren(); }; - void save(); - void load(); - KviStatusBarApplet * createApplet(const QString &szInternalName); - void showLayoutHelp(); -public: - bool appletExists(KviStatusBarApplet * pApplet); - // pnt is global! - KviStatusBarApplet * appletAt(const QPoint &pnt,bool bBestMatch = false); - - KviTalPopupMenu * contextPopup(); - // takes the ownership of pMsg - void queueMessage(KviStatusBarMessage * pMsg); - // called by KviFrame - void activeWindowChanged(); - - void registerAppletDescriptor(KviStatusBarAppletDescriptor * d); - - //void addApplet(KviStatusBarApplet * pApplet); - //void removeApplet(KviStatusBarApplet * pApplet); -protected slots: - void contextPopupAboutToShow(); - void appletsPopupAboutToShow(); - void appletsPopupActivated(int id); - void removeClickedApplet(); - void setPermanentMessage(); - void tipRequest(KviDynamicToolTip *pTip,const QPoint &pnt); -}; - -#endif //!_KVI_STATUSBAR_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_statusbarapplet.cpp b/3.4.0/src/kvirc/ui/kvi_statusbarapplet.cpp deleted file mode 100644 index 11f0a194a9..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_statusbarapplet.cpp +++ /dev/null @@ -1,563 +0,0 @@ -//=============================================================================// -// File : kvi_statusbarapplet.cpp -// Created on Tue 07 Sep 2004 03:56:46 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_statusbarapplet.h" -#include "kvi_frame.h" -#include "kvi_iconmanager.h" -#include "kvi_window.h" -#include "kvi_irccontext.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_ircconnectionstatistics.h" -#include "kvi_locale.h" -#include "kvi_app.h" -#include "kvi_config.h" -#include "kvi_modulemanager.h" -#include "kvi_console.h" -#include "kvi_lagmeter.h" -#include "kvi_options.h" -#include "kvi_kvs_script.h" - -#include <qpainter.h> -#include <qstyle.h> -#include <qlayout.h> -#include <qtimer.h> -#include <qcursor.h> -#include "kvi_tal_popupmenu.h" -#include <qpixmap.h> -#ifdef COMPILE_USE_QT4 - #include <qevent.h> -#endif - -// This class COULD be derived also from KStatusBar but in fact -// it adds no graphic functionality and it has only useless methods for us. -// ... for now let's keep it simple :) - - -// FIXME: Applets in modules SHOULD be unregistered automatically on unload! - -#include "kvi_time.h" -#include "kvi_qstring.h" - -#include <qfont.h> - -/* - IDEAS: - - Lag meter - - Countdown timer -*/ - -KviStatusBarAppletDescriptor::KviStatusBarAppletDescriptor(const QString &szVisibleName,const QString &szInternalName,CreateAppletCallback pProc,const QString &szPreloadModule,const QPixmap &pixIcon) -: KviHeapObject() -{ - static int s_iAppletDescriptorUniqueId = 0; - m_iId = s_iAppletDescriptorUniqueId; - s_iAppletDescriptorUniqueId++; - m_szVisibleName = szVisibleName; - m_szInternalName = szInternalName; - m_szPreloadModule = szPreloadModule; - m_pProc = pProc; - m_pAppletList = new KviPointerList<KviStatusBarApplet>; - m_pAppletList->setAutoDelete(false); - if(!pixIcon.isNull())m_pIcon = new QPixmap(pixIcon); - else m_pIcon = 0; -} - -KviStatusBarAppletDescriptor::~KviStatusBarAppletDescriptor() -{ - while(KviStatusBarApplet * a = m_pAppletList->first())delete a; - delete m_pAppletList; - if(m_pIcon)delete m_pIcon; -} - -KviStatusBarApplet * KviStatusBarAppletDescriptor::create(KviStatusBar * pBar) -{ - return m_pProc(pBar,this); -} - -void KviStatusBarAppletDescriptor::registerApplet(KviStatusBarApplet * a) -{ - m_pAppletList->append(a); -} - -void KviStatusBarAppletDescriptor::unregisterApplet(KviStatusBarApplet * a) -{ - m_pAppletList->removeRef(a); -} - - - - - - -KviStatusBarApplet::KviStatusBarApplet(KviStatusBar * pParent,KviStatusBarAppletDescriptor *pDescriptor) -: QLabel(pParent), m_pStatusBar(pParent), m_pDescriptor(pDescriptor) -{ - m_pDescriptor->registerApplet(this); - m_pStatusBar->registerApplet(this); - m_bSelected = false; -} - -KviStatusBarApplet::~KviStatusBarApplet() -{ - m_pDescriptor->unregisterApplet(this); - m_pStatusBar->unregisterApplet(this); -} - -QString KviStatusBarApplet::tipText(const QPoint &) -{ - return QString::null; -} - -void KviStatusBarApplet::paintEvent(QPaintEvent * e) -{ - QLabel::paintEvent(e); - setFont(KVI_OPTION_FONT(KviOption_fontIrcToolBarApplet)); - if(m_bSelected) - { - QPainter p(this); -#ifdef COMPILE_USE_QT4 - p.setCompositionMode(QPainter::CompositionMode_SourceOut); - p.fillRect(rect(),Qt::black); - p.setCompositionMode(QPainter::CompositionMode_SourceOver); -#else - p.setRasterOp(Qt::NotROP); - p.fillRect(rect(),Qt::black); - p.setRasterOp(Qt::CopyROP); -#endif - } -} - -void KviStatusBarApplet::select(bool bSelect) -{ - if(m_bSelected == bSelect)return; - m_bSelected = bSelect; - update(); -} - - - - -KviStatusBarAwayIndicator::KviStatusBarAwayIndicator(KviStatusBar * pParent,KviStatusBarAppletDescriptor *pDescriptor) -: KviStatusBarApplet(pParent,pDescriptor) -{ - m_bAwayOnAllContexts = false; - connect(pParent->frame(),SIGNAL(activeContextChanged()),this,SLOT(updateDisplay())); - connect(pParent->frame(),SIGNAL(activeContextStateChanged()),this,SLOT(updateDisplay())); - connect(pParent->frame(),SIGNAL(activeConnectionAwayStateChanged()),this,SLOT(updateDisplay())); - - updateDisplay(); - - if(!pixmap()) - setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NOTAWAY))); -} - -KviStatusBarAwayIndicator::~KviStatusBarAwayIndicator() -{ -} - -void KviStatusBarAwayIndicator::updateDisplay() -{ - KviIrcContext * c = statusBar()->frame()->activeContext(); - - if(c && c->isConnected()) - { - setPixmap(c->connection()->userInfo()->isAway() ? - *(g_pIconManager->getSmallIcon(KVI_SMALLICON_AWAY)) : *(g_pIconManager->getSmallIcon(KVI_SMALLICON_NOTAWAY))); - } else { - // FIXME: We'd like to appear disabled here... but then we - // no longer get mouse events :/ - setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_NOTAWAY))); - } -} - -void KviStatusBarAwayIndicator::toggleContext() -{ - m_bAwayOnAllContexts = !m_bAwayOnAllContexts; -} - -void KviStatusBarAwayIndicator::fillContextPopup(KviTalPopupMenu *p) -{ - int id = p->insertItem(__tr2qs("Apply to all IRC Contexts"),this,SLOT(toggleContext())); - p->setItemChecked(id,m_bAwayOnAllContexts); -} - -void KviStatusBarAwayIndicator::loadState(const char * prefix,KviConfig *cfg) -{ - KviStr tmp(KviStr::Format,"%s_AwayOnAllContexts",prefix); - m_bAwayOnAllContexts = cfg->readBoolEntry(tmp.ptr(),false); -} - -void KviStatusBarAwayIndicator::saveState(const char * prefix,KviConfig *cfg) -{ - KviStr tmp(KviStr::Format,"%s_AwayOnAllContexts",prefix); - cfg->writeEntry(tmp.ptr(),m_bAwayOnAllContexts); -} - -KviStatusBarApplet * CreateStatusBarAwayIndicator(KviStatusBar * pBar,KviStatusBarAppletDescriptor *pDescriptor) -{ - return new KviStatusBarAwayIndicator(pBar,pDescriptor); -} - -void KviStatusBarAwayIndicator::selfRegister(KviStatusBar * pBar) -{ - KviStatusBarAppletDescriptor * d = new KviStatusBarAppletDescriptor( - __tr2qs("Away Indicator"),"awayindicator",CreateStatusBarAwayIndicator,"",*(g_pIconManager->getSmallIcon(KVI_SMALLICON_AWAY))); - pBar->registerAppletDescriptor(d); -} - -// FIXME: Away on all context should know where user is not away/back before toggling status -void KviStatusBarAwayIndicator::mouseDoubleClickEvent(QMouseEvent * e) -{ - if(!(e->button() & Qt::LeftButton))return; - KviIrcConnection * c = statusBar()->frame()->activeConnection(); - if(!c)return; - if(c->state() != KviIrcConnection::Connected)return; - QString command; - if(m_bAwayOnAllContexts) - command = "if($away)back -a; else away -a"; - else - command = "if($away)back; else away"; - KviKvsScript::run(command,c->console()); -} - -QString KviStatusBarAwayIndicator::tipText(const QPoint &) -{ - KviIrcConnection * c = statusBar()->frame()->activeConnection(); - QString ret = "<center><b>"; - if(!c)goto not_connected; - if(c->state() != KviIrcConnection::Connected)goto not_connected; - if(c->userInfo()->isAway()) - { - QString tmp = KviTimeUtils::formatTimeInterval(kvi_unixTime() - c->userInfo()->awayTime(),KviTimeUtils::NoLeadingEmptyIntervals); - ret += __tr2qs("Away since"); - ret += ' '; - ret += tmp; - ret += "</b><br>"; - ret += __tr2qs("Double click to leave away mode"); - } else { - ret += __tr2qs("Not away"); - ret += "</b><br>"; - ret += __tr2qs("Double click to enter away mode"); - } - ret += "</center>"; - return ret; - -not_connected: - ret += __tr2qs("Not connected"); - ret += "</b></center>"; - return ret; -} - - -KviStatusBarLagIndicator::KviStatusBarLagIndicator(KviStatusBar * pParent,KviStatusBarAppletDescriptor *pDescriptor) -: KviStatusBarApplet(pParent,pDescriptor) -{ - connect(pParent->frame(),SIGNAL(activeContextChanged()),this,SLOT(updateDisplay())); - connect(pParent->frame(),SIGNAL(activeContextStateChanged()),this,SLOT(updateDisplay())); - connect(pParent->frame(),SIGNAL(activeConnectionLagChanged()),this,SLOT(updateDisplay())); - - updateDisplay(); - - QFont f = font(); - f.setFixedPitch(true); - f.setFamily("fixed"); - setFont(f); - - updateDisplay(); -} - -KviStatusBarLagIndicator::~KviStatusBarLagIndicator() -{ -} - -void KviStatusBarLagIndicator::mouseDoubleClickEvent(QMouseEvent *e) -{ - if(!(e->button() & Qt::LeftButton))return; - - KviIrcConnection * c = statusBar()->frame()->activeConnection(); - if(!c)return; - if(c->state() != KviIrcConnection::Connected)return; - if(!c->lagMeter()) - { - KVI_OPTION_BOOL(KviOption_boolUseLagMeterEngine) = true; - g_pApp->restartLagMeters(); - } -} - - -QString KviStatusBarLagIndicator::tipText(const QPoint &) -{ - KviIrcConnection * c = statusBar()->frame()->activeConnection(); - QString ret = "<center><b>"; - if(!c)goto not_connected; - if(c->state() != KviIrcConnection::Connected)goto not_connected; - if(c->lagMeter()) - { - int lll; - if((lll = c->lagMeter()->lag()) > 0) - { - int llls = lll / 1000; - int llld = (lll % 1000) / 100; - int lllc = (lll % 100) / 10; - KviQString::appendFormatted(ret,__tr2qs("Lag: %d.%d%d"),llls,llld,lllc); - ret += "</b><br>"; - int vss = c->lagMeter()->secondsSinceLastCompleted(); - int vmm = vss / 60; - vss = vss % 60; - KviQString::appendFormatted(ret,__tr2qs("Last checked %d mins %d secs ago"),vmm,vss); - } else { - ret += __tr2qs("Lag measure not available yet"); - ret += "</b>"; - } - } else { - ret += __tr2qs("Lag meter engine disabled"); - ret += "</b><br>"; - ret += __tr2qs("Double click to enable it"); - } - ret += "</center>"; - return ret; - -not_connected: - ret += __tr2qs("Not connected"); - ret += "</b></center>"; - return ret; -} - -void KviStatusBarLagIndicator::updateDisplay() -{ - KviIrcContext * c = statusBar()->frame()->activeContext(); - if(!c)return; - if(c->isConnected()) - { - KviIrcConnection * ic = c->connection(); - if(ic->lagMeter()) - { - int lll; - if((lll = ic->lagMeter()->lag()) > 0) - { - int llls = lll / 1000; - int llld = (lll % 1000) / 100; - int lllc = (lll % 100) / 10; - QString tmp; - KviQString::sprintf(tmp,__tr2qs("Lag: %d.%d%d"),llls,llld,lllc); - if(lll > 60000) - { - // one minute lag! - // paint it in red - tmp.prepend("<nobr><font color=\"#e00000\">"); - tmp.append("</font></nobr>"); - } - setText(tmp); - return; - } - } - } - // no lag available - setText(__tr2qs("Lag: ?.??")); -} - -KviStatusBarApplet * CreateStatusBarLagIndicator(KviStatusBar * pBar,KviStatusBarAppletDescriptor *pDescriptor) -{ - return new KviStatusBarLagIndicator(pBar,pDescriptor); -} - - -void KviStatusBarLagIndicator::selfRegister(KviStatusBar * pBar) -{ - KviStatusBarAppletDescriptor * d = new KviStatusBarAppletDescriptor( - __tr2qs("Lag Indicator"),"lagindicator",CreateStatusBarLagIndicator,"",*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SERVERPING))); - pBar->registerAppletDescriptor(d); -} - - - -KviStatusBarClock::KviStatusBarClock(KviStatusBar * pParent,KviStatusBarAppletDescriptor *pDescriptor) -: KviStatusBarApplet(pParent,pDescriptor) -{ - m_bUtc = false; - - startTimer(1000); - - QFont f = font(); - f.setFixedPitch(true); - f.setFamily("fixed"); - setFont(f); -} - -KviStatusBarClock::~KviStatusBarClock() -{ -} - -void KviStatusBarClock::timerEvent(QTimerEvent *) -{ - kvi_time_t tt = kvi_unixTime(); - struct tm * t = m_bUtc ? gmtime(&tt) : localtime(&tt); - QString tmp; - KviQString::sprintf(tmp,"%d%d:%d%d:%d%d", - t->tm_hour / 10, - t->tm_hour % 10, - t->tm_min / 10, - t->tm_min % 10, - t->tm_sec / 10, - t->tm_sec % 10); - setText(tmp); -} - -void KviStatusBarClock::fillContextPopup(KviTalPopupMenu * p) -{ - int id = p->insertItem("UTC",this,SLOT(toggleUtc())); - p->setItemChecked(id,m_bUtc); -} - -void KviStatusBarClock::toggleUtc() -{ - m_bUtc = !m_bUtc; - timerEvent(0); -} - -void KviStatusBarClock::loadState(const char * prefix,KviConfig *cfg) -{ - KviStr tmp(KviStr::Format,"%s_Utc",prefix); - m_bUtc = cfg->readBoolEntry(tmp.ptr(),false); -} - -void KviStatusBarClock::saveState(const char * prefix,KviConfig *cfg) -{ - KviStr tmp(KviStr::Format,"%s_Utc",prefix); - cfg->writeEntry(tmp.ptr(),m_bUtc); -} - -KviStatusBarApplet * CreateStatusBarClock(KviStatusBar * pBar,KviStatusBarAppletDescriptor *pDescriptor) -{ - return new KviStatusBarClock(pBar,pDescriptor); -} - -void KviStatusBarClock::selfRegister(KviStatusBar * pBar) -{ - KviStatusBarAppletDescriptor * d = new KviStatusBarAppletDescriptor( - __tr2qs("Simple Clock"),"clock",CreateStatusBarClock,"",*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TIME))); - pBar->registerAppletDescriptor(d); -} - - -KviStatusBarConnectionTimer::KviStatusBarConnectionTimer(KviStatusBar * pParent,KviStatusBarAppletDescriptor *pDescriptor) -: KviStatusBarApplet(pParent,pDescriptor) -{ - startTimer(1000); - m_bTotal=0; -} - -KviStatusBarConnectionTimer::~KviStatusBarConnectionTimer() -{ -} -//g_pApp->topmostConnectedConsole() -void KviStatusBarConnectionTimer::timerEvent(QTimerEvent * e) -{ - if(m_bTotal) - { - setText(KviTimeUtils::formatTimeInterval(KVI_OPTION_UINT(KviOption_uintTotalConnectionTime))); - } else { - if(g_pActiveWindow) - { - KviIrcContext * c = g_pActiveWindow->context(); - if(c) - { - if(c->isConnected()) - { - KviIrcConnection * cnn = c->connection(); - if(cnn) - { - setText(KviTimeUtils::formatTimeInterval(kvi_unixTime() - cnn->statistics()->connectionStartTime())); - return; - } - } - } - } - - setText(KviTimeUtils::formatTimeInterval(0,KviTimeUtils::FillWithHypens)); - } - return; -} - -void KviStatusBarConnectionTimer::toggleTotal() -{ - m_bTotal = !m_bTotal; -} - -void KviStatusBarConnectionTimer::fillContextPopup(KviTalPopupMenu *p) -{ - int id = p->insertItem(__tr2qs("Show total connection time"),this,SLOT(toggleTotal())); - p->setItemChecked(id,m_bTotal); -} - -void KviStatusBarConnectionTimer::loadState(const char * prefix,KviConfig *cfg) -{ - KviStr tmp(KviStr::Format,"%s_Total",prefix); - m_bTotal = cfg->readBoolEntry(tmp.ptr(),false); -} - -void KviStatusBarConnectionTimer::saveState(const char * prefix,KviConfig *cfg) -{ - KviStr tmp(KviStr::Format,"%s_Total",prefix); - cfg->writeEntry(tmp.ptr(),m_bTotal); -} - -KviStatusBarApplet * CreateStatusBarConnectionTimer(KviStatusBar * pBar,KviStatusBarAppletDescriptor *pDescriptor) -{ - return new KviStatusBarConnectionTimer(pBar,pDescriptor); -} - -void KviStatusBarConnectionTimer::selfRegister(KviStatusBar * pBar) -{ - KviStatusBarAppletDescriptor * d = new KviStatusBarAppletDescriptor( - __tr2qs("Connection Timer"),"connectiontimer",CreateStatusBarConnectionTimer,"",*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TIME))); - pBar->registerAppletDescriptor(d); -} - - - -KviStatusBarSeparator::KviStatusBarSeparator(KviStatusBar * pParent,KviStatusBarAppletDescriptor *pDescriptor) -: KviStatusBarApplet(pParent,pDescriptor) -{ - setFrameStyle(QFrame::VLine | QFrame::Sunken); -} - -KviStatusBarSeparator::~KviStatusBarSeparator() -{ -} - -KviStatusBarApplet * CreateStatusBarSeparator(KviStatusBar * pBar,KviStatusBarAppletDescriptor *pDescriptor) -{ - return new KviStatusBarSeparator(pBar,pDescriptor); -} - -void KviStatusBarSeparator::selfRegister(KviStatusBar * pBar) -{ - KviStatusBarAppletDescriptor * d = new KviStatusBarAppletDescriptor( - __tr2qs("Separator"),"separator",CreateStatusBarSeparator); - pBar->registerAppletDescriptor(d); -} - diff --git a/3.4.0/src/kvirc/ui/kvi_statusbarapplet.h b/3.4.0/src/kvirc/ui/kvi_statusbarapplet.h deleted file mode 100644 index 3e37fb67cf..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_statusbarapplet.h +++ /dev/null @@ -1,195 +0,0 @@ -#ifndef _KVI_STATUSBARAPPLET_H_ -#define _KVI_STATUSBARAPPLET_H_ -//============================================================================= -// -// File : kvi_statusbarapplet.h -// Created on Tue 07 Sep 2004 03:56:46 by Szymon Stefanek -// -// This file is part of the KVIrc IRC client distribution -// Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net> -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_pointerlist.h" -#include "kvi_heapobject.h" -#include "kvi_statusbar.h" - -#include <qstring.h> -#include "kvi_pointerhashtable.h" -#include <qstatusbar.h> -#include <qlabel.h> -#include <qpixmap.h> - -class QTimer; -class QLabel; -class KviTalPopupMenu; - -class KviConfig; -class KviFrame; -class KviIrcContext; -class KviIrcConnection; -class KviStatusBarApplet; -class KviStatusBarAppletDescriptor; - -typedef KviStatusBarApplet * (*CreateAppletCallback)(KviStatusBar *,KviStatusBarAppletDescriptor *); - -class KVIRC_API KviStatusBarAppletDescriptor : public KviHeapObject -{ - friend class KviStatusBar; - friend class KviStatusBarApplet; -protected: - QString m_szVisibleName; // visible name of the applet - QString m_szInternalName; // UNIQUE name of the applet - QString m_szPreloadModule; // name of the module that must be preloaded for this applet - CreateAppletCallback m_pProc; // creation callback - QPixmap * m_pIcon; - int m_iId; - KviPointerList<KviStatusBarApplet> * m_pAppletList; -public: - KviStatusBarAppletDescriptor(const QString &szVisibleName, - const QString &szInternalName, - CreateAppletCallback pProc, - const QString &szPreloadModule = QString::null, - const QPixmap &pixIcon = QPixmap()); - virtual ~KviStatusBarAppletDescriptor(); -public: - const QString &visibleName(){ return m_szVisibleName; }; - const QString &internalName(){ return m_szInternalName; }; - const QString &preloadModule(){ return m_szPreloadModule; }; - int id(){ return m_iId; }; - QPixmap * icon(){ return m_pIcon; }; -protected: - KviStatusBarApplet * create(KviStatusBar * pBar); - void registerApplet(KviStatusBarApplet * a); - void unregisterApplet(KviStatusBarApplet * a); -}; - - -class KVIRC_API KviStatusBarApplet : public QLabel -{ - friend class KviStatusBar; - Q_OBJECT -protected: - KviStatusBar * m_pStatusBar; - KviStatusBarAppletDescriptor * m_pDescriptor; - bool m_bSelected; -public: - KviStatusBarApplet(KviStatusBar * pParent,KviStatusBarAppletDescriptor *pDescriptor); - virtual ~KviStatusBarApplet(); -public: - KviStatusBar * statusBar(){ return m_pStatusBar; }; - KviFrame * frame(){ return m_pStatusBar->frame(); }; - KviStatusBarAppletDescriptor * descriptor(){ return m_pDescriptor; }; - void select(bool bSelect = true); - bool isSelected(){ return m_bSelected; }; -protected: - virtual void paintEvent(QPaintEvent *e); - virtual void fillContextPopup(KviTalPopupMenu *p){}; - virtual void loadState(const char * prefix,KviConfig *cfg){}; - virtual void saveState(const char * prefix,KviConfig *cfg){}; - virtual QString tipText(const QPoint &); -}; - - - -class KviStatusBarClock : public KviStatusBarApplet -{ - Q_OBJECT -public: - KviStatusBarClock(KviStatusBar * pParent,KviStatusBarAppletDescriptor *pDescriptor); - virtual ~KviStatusBarClock(); -protected: - bool m_bUtc; -public: - static void selfRegister(KviStatusBar * pBar); -protected: - virtual void fillContextPopup(KviTalPopupMenu * p); - virtual void timerEvent(QTimerEvent * e); - virtual void loadState(const char * prefix,KviConfig *cfg); - virtual void saveState(const char * prefix,KviConfig *cfg); -protected slots: - void toggleUtc(); -}; - -class KviStatusBarConnectionTimer : public KviStatusBarApplet -{ - Q_OBJECT -public: - KviStatusBarConnectionTimer(KviStatusBar * pParent,KviStatusBarAppletDescriptor *pDescriptor); - virtual ~KviStatusBarConnectionTimer(); -protected: - bool m_bTotal; -protected: - virtual void timerEvent(QTimerEvent * e); - virtual void fillContextPopup(KviTalPopupMenu *p); - virtual void loadState(const char * prefix,KviConfig *cfg); - virtual void saveState(const char * prefix,KviConfig *cfg); -public: - static void selfRegister(KviStatusBar * pBar); -protected slots: - void toggleTotal(); -}; - -class KviStatusBarSeparator : public KviStatusBarApplet -{ - Q_OBJECT -public: - KviStatusBarSeparator(KviStatusBar * pParent,KviStatusBarAppletDescriptor *pDescriptor); - virtual ~KviStatusBarSeparator(); -public: - static void selfRegister(KviStatusBar * pBar); -}; - -class KviStatusBarAwayIndicator : public KviStatusBarApplet -{ - Q_OBJECT -public: - KviStatusBarAwayIndicator(KviStatusBar * pParent,KviStatusBarAppletDescriptor *pDescriptor); - virtual ~KviStatusBarAwayIndicator(); -public: - static void selfRegister(KviStatusBar * pBar); -protected: - bool m_bAwayOnAllContexts; -protected: - virtual void mouseDoubleClickEvent(QMouseEvent *e); - virtual QString tipText(const QPoint &); - virtual void fillContextPopup(KviTalPopupMenu *p); - virtual void loadState(const char * prefix,KviConfig *cfg); - virtual void saveState(const char * prefix,KviConfig *cfg); -protected slots: - void updateDisplay(); - void toggleContext(); -}; - -class KviStatusBarLagIndicator : public KviStatusBarApplet -{ - Q_OBJECT -public: - KviStatusBarLagIndicator(KviStatusBar * pParent,KviStatusBarAppletDescriptor *pDescriptor); - virtual ~KviStatusBarLagIndicator(); -public: - static void selfRegister(KviStatusBar * pBar); -protected: - virtual void mouseDoubleClickEvent(QMouseEvent *e); - virtual QString tipText(const QPoint &); -protected slots: - void updateDisplay(); -}; - - -#endif //!_KVI_STATUSBARAPPLET_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_styled_controls.cpp b/3.4.0/src/kvirc/ui/kvi_styled_controls.cpp deleted file mode 100644 index e250c11c63..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_styled_controls.cpp +++ /dev/null @@ -1,373 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// -// File : kvi_styled_controls.cpp -// Creation date : 19 Jan 2006 GMT by Alexey Uzhva -// -// This toolbar is part of the KVirc irc client distribution -// Copyright (C) 2006 Alexey Uzhva -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_styled_controls.h" - -#ifndef COMPILE_USE_QT4 - -#include "kvi_iconmanager.h" -#include "kvi_app.h" -#include "kvi_options.h" -#include "kvi_doublebuffer.h" -#include "kvi_tal_toolbar.h" - -#include <qcheckbox.h> -#include <qpainter.h> -#include <qimage.h> -#include <qevent.h> -#include <qtimer.h> - - -KviStyledControlInternal::KviStyledControlInternal( KviStyledControl* control) -:QObject(0,0) -{ - m_pControl=control; -} - -KviStyledControlInternal::~KviStyledControlInternal() -{ - -} - -bool KviStyledControlInternal::eventFilter( QObject *obj, QEvent *ev ) -{ - if(ev->type()==QEvent::Enter) - { - m_pControl->enterEvent(ev); - } else if(ev->type()==QEvent::Leave) { - m_pControl->leaveEvent(ev); - } - return FALSE; -} - -void KviStyledControlInternal::paintTimerShot () -{ -// debug("%s %s %i",__FILE__,__FUNCTION__,__LINE__); -// debug("%s %i",__FUNCTION__,m_pControl->m_iStepNumber); - if(m_pControl->m_bMouseEnter) - { - m_pControl->m_iStepNumber++; - if(m_pControl->m_iStepNumber>=KVI_STYLE_NUM_STEPS) - { - m_pControl->m_iStepNumber=KVI_STYLE_NUM_STEPS; - m_pControl->m_pTimer->stop(); - } - } else { - m_pControl->m_iStepNumber--; - if(m_pControl->m_iStepNumber<=0) - { - m_pControl->m_iStepNumber=0; - m_pControl->m_pTimer->stop(); - } - } - m_pControl->m_pWidget->repaint( false ); -} - -KviStyledControl::KviStyledControl(QWidget* w) -{ - m_pWidget=w; - m_iStepNumber=0; - m_bMouseEnter=0; - m_pInternal=new KviStyledControlInternal(this); - m_pTimer = new QTimer(m_pInternal); - m_pWidget->installEventFilter(m_pInternal); -} - -KviStyledControl::~KviStyledControl() -{ - delete m_pTimer; - delete m_pInternal; -} - -void KviStyledControl::enterEvent ( QEvent * ) -{ -// debug("%s %s %i",__FILE__,__FUNCTION__,__LINE__); - if(m_pWidget->isEnabled() && KVI_OPTION_BOOL(KviOption_boolEnableVisualEffects)) - { - if(m_iStepNumber<KVI_STYLE_NUM_STEPS) - { - if(!m_pTimer->isActive()) - { - m_pTimer->connect( m_pTimer, SIGNAL(timeout()), m_pInternal, SLOT(paintTimerShot()) ); - m_pTimer->start(KVI_STYLE_TIMER_STEP); - } - } - m_bMouseEnter=1; - m_iStepNumber++; - m_pWidget->repaint( false ); - } -} - -void KviStyledControl::leaveEvent ( QEvent * ) -{ -// debug("%s %s %i",__FILE__,__FUNCTION__,__LINE__); - if(m_pWidget->isEnabled() && KVI_OPTION_BOOL(KviOption_boolEnableVisualEffects)) - { - if(m_iStepNumber>0) - { - if(!m_pTimer->isActive()) - { - m_pTimer->connect( m_pTimer, SIGNAL(timeout()), m_pInternal, SLOT(paintTimerShot()) ); - m_pTimer->start(KVI_STYLE_TIMER_STEP); - } - } - m_bMouseEnter=0; - m_iStepNumber--; - m_pWidget->repaint( false ); - } -} - - -KviStyledCheckBox::KviStyledCheckBox ( QWidget * parent, const char * name ) -: QCheckBox(parent,name), KviStyledControl(this) -{ - setWFlags(WNoAutoErase); - -} - -KviStyledCheckBox::KviStyledCheckBox ( const QString & text, QWidget * parent, const char * name ) -: QCheckBox(text,parent,name), KviStyledControl(this) -{ - setWFlags(WNoAutoErase); -} - -KviStyledCheckBox::~KviStyledCheckBox() -{ - -} - - -void KviStyledCheckBox::paintEvent ( QPaintEvent * event) -{ - //debug("%s %s %i %i %i",__FILE__,__FUNCTION__,__LINE__,m_bMouseEnter,m_iStepNumber); - if(KVI_OPTION_BOOL(KviOption_boolEnableVisualEffects)) - { - KviDoubleBuffer doublebuffer(event->rect().width(),event->rect().height()); - QPixmap * pDoubleBufferPixmap = doublebuffer.pixmap(); - - QRect rect=event->rect(); - pDoubleBufferPixmap->fill(this, rect.topLeft()); - - QPainter p(pDoubleBufferPixmap, this); - p.translate(-rect.x(), -rect.y()); - - QPixmap* pStoredPix = 0; - - if(isChecked()) - pStoredPix=g_pIconManager->getBigIcon("kvi_checkbox_selected.png"); - else - pStoredPix=g_pIconManager->getBigIcon("kvi_checkbox_unselected.png"); - //debug("%s %s %i %i %i",__FILE__,__FUNCTION__,__LINE__,m_bMouseEnter,m_iStepNumber); - if(pStoredPix) - { - //debug("%s %s %i %i %i",__FILE__,__FUNCTION__,__LINE__,m_bMouseEnter,m_iStepNumber); - QPixmap pix=*pStoredPix; - if(m_iStepNumber && isEnabled()) - { - QImage image = pix.convertToImage(); - for(int x=0; x<image.width(); x++) - for(int y=0; y<image.height(); y++) - { - QRgb rgb=image.pixel(x,y); - rgb=qRgba( - qRed(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber < 255 ? qRed(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber : 255 , - qGreen(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber < 255 ? qGreen(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber : 255, - qBlue(rgb), - qAlpha(rgb) - ); - image.setPixel(x,y,rgb); - } - p.drawImage(0,0,image); - } else if( !isEnabled()) { - QImage image = pix.convertToImage(); - for(int x=0; x<image.width(); x++) - for(int y=0; y<image.height(); y++) - { - //- From Black to Gray conversion for disabled mode. - QRgb rgb=image.pixel(x,y); - rgb=qRgba( - qRed(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber == 0 ? 180 : qRed(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber, - qGreen(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber == 0 ? 180 : qGreen(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber, - qBlue(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber == 0 ? 180 : qBlue(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber, - qAlpha(rgb) - ); - image.setPixel(x,y,rgb); - } - p.drawImage(0,0,image); - } else { - p.drawPixmap(0,0,pix); - } - //debug("%s %s %i %i %i",__FILE__,__FUNCTION__,__LINE__,m_bMouseEnter,m_iStepNumber); - QString szText=text(); - szText=szText.remove("&"); - p.drawText(pix.width()+3,0,width(),height(),0,szText); - bitBlt(this, rect.x(), rect.y(), pDoubleBufferPixmap, 0, 0, rect.width(), rect.height()); - //debug("%s %s %i %i %i",__FILE__,__FUNCTION__,__LINE__,m_bMouseEnter,m_iStepNumber); - } else { - QCheckBox::paintEvent(event); - } - } else - QCheckBox::paintEvent(event); -} - -KviStyledToolButton::KviStyledToolButton( QWidget * parent, const char * name ) -: QToolButton(parent,name), KviStyledControl(this), bShowSubmenuIndicator(false) -{ - setWFlags(WNoAutoErase); - resizeEvent(0); -} - -KviStyledToolButton::KviStyledToolButton ( const QIconSet & iconSet, const QString & textLabel, const QString & grouptext, QObject * receiver, const char * slot, KviTalToolBar * parent, const char * name ) -: QToolButton(iconSet,textLabel,grouptext,receiver,slot,parent,name), KviStyledControl(this), bShowSubmenuIndicator(false) -{ - setWFlags(WNoAutoErase); - resizeEvent(0); -} - -KviStyledToolButton::~KviStyledToolButton() -{ - -} - -void KviStyledToolButton::setShowSubmenuIndicator(bool bShow) -{ - bShowSubmenuIndicator=bShow; - resizeEvent(0); -} - -void KviStyledToolButton::paintEvent ( QPaintEvent * event) -{ - if(KVI_OPTION_BOOL(KviOption_boolEnableVisualEffects)) - { - QPixmap* pArrowPix = 0; - int iWidth=width(); - int iPixWidth=0; - if(bShowSubmenuIndicator) - { - if(pArrowPix=g_pIconManager->getBigIcon("kvi_toolbutton_menuindicator.png")) - iPixWidth=pArrowPix->width(); - } - bool bActive= isOn() || m_bMouseEnter; - KviDoubleBuffer doublebuffer(event->rect().width(),event->rect().height()); - QPixmap * pDoubleBufferPixmap = doublebuffer.pixmap(); - - QRect rect=event->rect(); - - pDoubleBufferPixmap->fill( - bActive ? QColor(206,215,223) : - colorGroup().background() - ); - - - QPainter p(pDoubleBufferPixmap, this); - p.translate(-rect.x(), -rect.y()); - - if(bActive) - { - p.setPen(QColor(185,190,195)); - p.drawRect(0,0,iWidth,height()); - } - - QPixmap pix=iconSet().pixmap( - usesBigPixmap() ? QIconSet::Large : QIconSet::Small, - isEnabled() ? QIconSet::Normal : - QIconSet::Disabled, - isOn() ? QIconSet::On : - QIconSet::Off); - QPoint pos((iWidth-iPixWidth-pix.width())/2,(height()-pix.height())/2); - if(!pix.isNull()) - { - if(m_iStepNumber && isEnabled()) - { - QImage image = pix.convertToImage(); - for(int x=0; x<image.width(); x++) - for(int y=0; y<image.height(); y++) - { - QRgb rgb=image.pixel(x,y); - rgb=qRgba( - qRed(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber < 255 ? qRed(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber : 255 , - qGreen(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber < 255 ? qGreen(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber : 255, - qBlue(rgb), - qAlpha(rgb) - ); - image.setPixel(x,y,rgb); - } - p.drawImage(pos,image); - } else if( !isEnabled()) { - QImage image = pix.convertToImage(); - for(int x=0; x<image.width(); x++) - for(int y=0; y<image.height(); y++) - { - //- From Black to Gray conversion for disabled mode. - QRgb rgb=image.pixel(x,y); - rgb=qRgba( - qRed(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber == 0 ? 180 : qRed(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber, - qGreen(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber == 0 ? 180 : qGreen(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber, - qBlue(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber == 0 ? 180 : qBlue(rgb)+KVI_STYLE_COLOR_DIFF/KVI_STYLE_NUM_STEPS*m_iStepNumber, - qAlpha(rgb) - ); - image.setPixel(x,y,rgb); - } - p.drawImage(pos,image); - } else { - p.drawPixmap(pos,pix); - } - } - - if(pArrowPix) - { - pos.setX(pix.width()+4); - pos.setY((height()-pArrowPix->height())/2); - p.drawPixmap(pos,*pArrowPix); - } - - bitBlt(this, rect.x(), rect.y(), pDoubleBufferPixmap, 0, 0, rect.width(), rect.height()); - - } else { - QToolButton::paintEvent(event); - } -} - -void KviStyledToolButton::resizeEvent ( QResizeEvent * e) -{ - QPixmap* pStoredPix = 0; - if(pStoredPix=g_pIconManager->getBigIcon("kvi_toolbutton_menuindicator.png")) - { - QPixmap pix=iconSet().pixmap( - usesBigPixmap() ? QIconSet::Large : QIconSet::Small, - isEnabled() ? QIconSet::Normal : - QIconSet::Disabled, - isOn() ? QIconSet::On : - QIconSet::Off); - - setMinimumWidth(bShowSubmenuIndicator ? pix.width()+8+pStoredPix->width() : pix.width()); - } -} - -#include "kvi_styled_controls.moc" - -#endif diff --git a/3.4.0/src/kvirc/ui/kvi_styled_controls.h b/3.4.0/src/kvirc/ui/kvi_styled_controls.h deleted file mode 100644 index b2bdf599f2..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_styled_controls.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef _KVI_STYLED_CONTROLS_H_ -#define _KVI_STYLED_CONTROLS_H_ - -/////////////////////////////////////////////////////////////////////////////// -// -// File : kvi_styled_controls.h -// Creation date : 19 Jan 2006 GMT by Alexey Uzhva -// -// This toolbar is part of the KVirc irc client distribution -// Copyright (C) 2006 Alexey Uzhva -// -// 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 opinion) 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 "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - // we use internal Qt4 styles for now - #include <qcheckbox.h> - #include <qtoolbutton.h> - - #define KviStyledCheckBox QCheckBox - #define KviStyledToolButton QToolButton -#else - -#include <qcheckbox.h> -#include <qtoolbutton.h> -#include <qevent.h> -#include <qtimer.h> -#include "kvi_heapobject.h" - -class KviTalToolBar; - -#define KVI_STYLE_NUM_STEPS 20 -#define KVI_STYLE_COLOR_DIFF 60 -#define KVI_STYLE_TIMER_STEP 18 - -class KviStyledControl; - -class KVIRC_API KviStyledControlInternal : public QObject -{ - Q_OBJECT -public: - KviStyledControlInternal( KviStyledControl* control ); - ~KviStyledControlInternal(); -public slots: - virtual void paintTimerShot(); -protected: - bool eventFilter( QObject *obj, QEvent *ev ); -protected: - KviStyledControl* m_pControl; -}; - -class KVIRC_API KviStyledControl -{ - friend class KviStyledControlInternal; -public: - KviStyledControl(QWidget*); - ~KviStyledControl(); -protected: - virtual void enterEvent ( QEvent * ); - virtual void leaveEvent ( QEvent * ); - - int m_bMouseEnter; - int m_iStepNumber; - QTimer* m_pTimer; - KviStyledControlInternal* m_pInternal; - QWidget *m_pWidget; -}; - -class KVIRC_API KviStyledCheckBox : public QCheckBox, public KviStyledControl -{ - Q_OBJECT -public: - KviStyledCheckBox ( QWidget * parent, const char * name = 0 ); - KviStyledCheckBox ( const QString & text, QWidget * parent, const char * name = 0 ); - ~KviStyledCheckBox(); -protected: - virtual void paintEvent ( QPaintEvent * ); -}; - -class KVIRC_API KviStyledToolButton : public QToolButton, public KviStyledControl -{ - Q_OBJECT -private: - bool bShowSubmenuIndicator; -public: - KviStyledToolButton ( QWidget * parent, const char * name = 0 ); - KviStyledToolButton ( const QIconSet & iconSet, const QString & textLabel, const QString & grouptext, QObject * receiver, const char * slot, KviTalToolBar * parent, const char * name = 0 ); - ~KviStyledToolButton(); - - void setShowSubmenuIndicator(bool bShow); -protected: - virtual void paintEvent ( QPaintEvent * ); - virtual void resizeEvent ( QResizeEvent * ) ; -}; - -#endif - -#endif diff --git a/3.4.0/src/kvirc/ui/kvi_taskbar.cpp b/3.4.0/src/kvirc/ui/kvi_taskbar.cpp deleted file mode 100644 index ebc8280a4c..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_taskbar.cpp +++ /dev/null @@ -1,1509 +0,0 @@ -//=============================================================================================== -// -// File : kvi_taskbar.cpp -// Last major modification : Thu Jan 7 1999 03:59:43 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -//#define KVI_TASKBARBUTTON_MIN_WIDTH 100 -#define KVI_TASKBARBUTTON_CONTEXTINDICATORHEIGHT 6 -#define KVI_TASKBAR_MIN_WIDTH 120 - -#define KVI_NUM_STEPS 20 -#define KVI_TIMER_DELAY 18 - - -#define _KVI_DEBUG_CHECK_RANGE_ -#include "kvi_debug.h" -#include "kvi_taskbar.h" -#include "kvi_frame.h" -#include "kvi_window.h" -#include "kvi_string.h" -#include "kvi_options.h" -#include "kvi_console.h" -#include "kvi_locale.h" -#include "kvi_dynamictooltip.h" -#include "kvi_settings.h" -#include "kvi_channel.h" -#include "kvi_ircconnection.h" -#include "kvi_doublebuffer.h" - -// FIXME: #warning "The tree taskbar min width should be configurable" -#include <qtimer.h> -#include <qfontmetrics.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qimage.h> -#include "kvi_tal_popupmenu.h" -#include <qcursor.h> - -#ifdef COMPILE_USE_QT4 - #include <q3header.h> -#else - #include <qheader.h> -#endif -#include <qevent.h> - -#ifdef COMPILE_USE_QT4 - #include <QPaintEvent> -#endif - - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - extern QPixmap * g_pShadedChildGlobalDesktopBackground; -#endif - -extern QPixmap * g_pActivityMeterPixmap; - -// FIXME: This should be renamed to "Window List" - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// KviTaskBarBase -// - -KviTaskBarBase::KviTaskBarBase() -#ifdef COMPILE_USE_QT4 -: QDockWidget(__tr2qs("Taskbar"),g_pFrame) -#else -: KviToolBar(__tr2qs("Taskbar"),QT_DOCK_BOTTOM,false,"taskbar") -#endif -{ - // FIXME: this timer should be started only if KVI_OPTION_BOOL(KviOption_boolUseTaskBarActivityMeter) -#ifdef COMPILE_USE_QT4 - setObjectName(__tr2qs("taskbar")); - setFeatures(QDockWidget::DockWidgetMovable); -#endif //COMPILE_USE_QT4 - m_pActivityMeterTimer = new QTimer(); - connect(m_pActivityMeterTimer,SIGNAL(timeout()),this,SLOT(updateActivityMeter())); - m_pActivityMeterTimer->start(5000); -} - -KviTaskBarBase::~KviTaskBarBase() -{ - delete m_pActivityMeterTimer; -} - -void KviTaskBarBase::updateActivityMeter() -{ -} - -void KviTaskBarBase::getTextForConsole(QString &szText,KviConsole * pConsole) -{ - if(pConsole->isConnected()) - { - if(KVI_OPTION_BOOL(KviOption_boolShowNetworkNameForConsoleTaskBarEntry)) - { - // FIXME: Should never show "Standalone Servers" or "orphan_servers". - // It would also be nice to have a number appended to - // multiple entries with the same server name...but this costs too much. - szText = pConsole->connection()->networkName(); - if(szText.isEmpty()) - szText = pConsole->connection()->currentServerName(); - } else { - szText = pConsole->connection()->currentServerName(); - } - } else { - szText = pConsole->statusString(); - } -} - - -KviTaskBarItem * KviTaskBarBase::item(int number) -{ - KviTaskBarItem * it = firstItem(); - if(!setIterationPointer(it))return 0; - - while(it && (number > 0)) - { - it = nextItem(); - number--; - } - return it; -} - -void KviTaskBarBase::switchWindow(bool bNext,bool bInContextOnly) -{ - if(!g_pActiveWindow)return; - - KviConsole * cons = g_pActiveWindow->console(); - KviTaskBarItem * cur = g_pActiveWindow->taskBarItem(); - KviTaskBarItem * it = cur; - - if(!setIterationPointer(cur))return; - - while(it) - { - it = bNext ? nextItem() : prevItem(); - if(!it)it = bNext ? firstItem() : lastItem(); - if(it) - { - if(bInContextOnly) - { - if(it->kviWindow()->console() == cons) - { - g_pFrame->setActiveWindow(it->kviWindow()); - return; - } - } else { - g_pFrame->setActiveWindow(it->kviWindow()); - return; - } - } - if(it == cur)return; // did a complete loop.... no window to switch to - } -} - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// KviTaskBarItem -// - -KviTaskBarItem::KviTaskBarItem(KviWindow * wnd) -{ - m_pWindow = wnd; - m_iHighlightLevel = 0; - m_iProgress = -1; -} - -KviTaskBarItem::~KviTaskBarItem() -{ - m_pWindow->m_pTaskBarItem = 0; -} - - - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// KviTaskBarButton -// - - -KviTaskBarButton::KviTaskBarButton(QWidget * par,KviWindow * wnd,const char * name) -: QPushButton(par,name) , KviTaskBarItem(wnd) -{ - m_bActive = false; - m_pTip = new KviDynamicToolTip(this); - connect(m_pTip,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &))); -// setBackgroundMode(QWidget::NoBackground); - setToggleButton (true); - setFlat ( KVI_OPTION_BOOL(KviOption_boolUseFlatClassicTaskbarButtons) ); -} - -KviTaskBarButton::~KviTaskBarButton() -{ - delete m_pTip; //not necessary ? -} - -void KviTaskBarButton::tipRequest(KviDynamicToolTip *,const QPoint &pnt) -{ - if(KVI_OPTION_BOOL(KviOption_boolShowTaskBarToolTips)) - { - QString szText; - m_pWindow->getTaskBarTipText(szText); - m_pTip->tip(rect(),szText); - } -} - -void KviTaskBarButton::mousePressEvent(QMouseEvent *e) -{ - if(e->button() & Qt::LeftButton) - { - if(e->state() & Qt::ShiftButton) - { - m_pWindow->delayedClose(); - } else { - if((g_pActiveWindow != m_pWindow) || (m_pWindow->isMinimized()))g_pFrame->setActiveWindow(m_pWindow); - else m_pWindow->minimize(); - } - } else m_pWindow->contextPopup(); -} - -#if QT_VERSION >= 300 -void KviTaskBarButton::contextMenuEvent(QContextMenuEvent *e) -{ - m_pWindow->contextPopup(); - e->accept(); -} -#endif - -void KviTaskBarButton::setActive(bool bActive) -{ - if(bActive) - { - m_bActive = true; - m_iHighlightLevel = 0; - } else { - if(m_bActive) - { - // was active... unset the highlighting if it was silently turned on while being active... - m_iHighlightLevel = 0; - } - m_bActive = false; - } - setOn(bActive); - update(); -} - -#ifdef COMPILE_USE_QT4 -void KviTaskBarButton::paintEvent(QPaintEvent * e) -{ - QPainter p(this); - QStyleOption opt; - opt.initFrom(this); - if(isOn()) - opt.state = QStyle::State_On | QStyle::State_Active; - style()->drawPrimitive(QStyle::PE_PanelButtonTool,&opt,&p,this); - drawButtonLabel(&p); -} -#endif - -void KviTaskBarButton::drawButtonLabel(QPainter * painter) -{ - QRect distRect = painter->window(); - int iHeight = distRect.height(); - int iWidth = distRect.width(); - - QPainter * pPainter; -#ifdef COMPILE_USE_QT4 - pPainter = painter; -#else //!COMPILE_USE_QT4 - KviDoubleBuffer db(iWidth,iHeight); - QPixmap * pMemBuffer = db.pixmap(); - QPainter p(pMemBuffer); - bitBlt(pMemBuffer,0,0,painter->device(),distRect.x(),distRect.y(),iWidth,iHeight); - pPainter = &p; -#endif //!COMPILE_USE_QT4 - if(KVI_OPTION_BOOL(KviOption_boolUseTaskBarIrcContextIndicator)) - { - iHeight -= KVI_TASKBARBUTTON_CONTEXTINDICATORHEIGHT; - QColor base = colorGroup().background(); - if(m_pWindow->console()) - { - QColor cntx = KVI_OPTION_ICCOLOR(m_pWindow->console()->ircContextId() % KVI_NUM_ICCOLOR_OPTIONS); - base.setRgb((base.red() + cntx.red()) >> 1,(base.green() + cntx.green()) >> 1, - (base.blue() + cntx.blue()) >> 1); - pPainter->fillRect(2,iHeight,iWidth - 4,KVI_TASKBARBUTTON_CONTEXTINDICATORHEIGHT - 2,base); - } else { - pPainter->fillRect(2,iHeight,iWidth - 4,KVI_TASKBARBUTTON_CONTEXTINDICATORHEIGHT - 2,colorGroup().brush(QColorGroup::Background)); - } - } - - int daX = 3; - - if(KVI_OPTION_BOOL(KviOption_boolUseTaskBarIcons)) - { - pPainter->drawPixmap(3,3,*(m_pWindow->myIconPtr())); - daX = 20; - } - - if(KVI_OPTION_BOOL(KviOption_boolUseTaskBarActivityMeter)) - { - unsigned int uActivityValue; - unsigned int uActivityTemperature; - if(m_pWindow->activityMeter(&uActivityValue,&uActivityTemperature)) - { - pPainter->drawPixmap(daX,3,*g_pActivityMeterPixmap,uActivityValue * 5,uActivityTemperature * 16,5,16); - daX = 27; - } - } - - QRect cRect(daX,3,iWidth - (20 + daX),iHeight - 6); - - if(m_iProgress >= 0) - { - // paint the progress bar - int wdth = (m_iProgress * cRect.width()) / 100; - pPainter->setPen(KVI_OPTION_COLOR(KviOption_colorTaskBarProgressBar)); - pPainter->drawRect(cRect); - pPainter->fillRect(daX,3,wdth,cRect.height(),KVI_OPTION_COLOR(KviOption_colorTaskBarProgressBar)); - } - - QRect bRect; - QString szText; - - bool bMinimized = m_pWindow->isMinimized(); - - if(m_bActive) - { - pPainter->setPen(KVI_OPTION_COLOR(KviOption_colorTaskBarNormalText)); - } else { - int iLevel; - - switch(m_iHighlightLevel) - { - case 0: iLevel = bMinimized ? KviOption_colorTaskBarMinimizedText : KviOption_colorTaskBarNormalText; break; - case 1: iLevel = KviOption_colorTaskBarHighlight1Text; break; - case 2: iLevel = KviOption_colorTaskBarHighlight2Text; break; - case 3: iLevel = KviOption_colorTaskBarHighlight3Text; break; - case 4: iLevel = KviOption_colorTaskBarHighlight4Text; break; - default: iLevel = KviOption_colorTaskBarHighlight5Text; break; - } - pPainter->setPen(KVI_OPTION_COLOR(iLevel)); - } - - pPainter->setFont(KVI_OPTION_FONT(KviOption_fontTaskbar)); - - switch(m_pWindow->type()) - { - case KVI_WINDOW_TYPE_CONSOLE: - { - QFont f = QFont(KVI_OPTION_FONT(KviOption_fontTaskbar)); - f.setBold(true); - pPainter->setFont(f); - KviTaskBarBase::getTextForConsole(szText,(KviConsole *)m_pWindow); - } - break; - case KVI_WINDOW_TYPE_CHANNEL: - case KVI_WINDOW_TYPE_DEADCHANNEL: - szText = ((KviChannel *)m_pWindow)->nameWithUserFlag(); - break; - case KVI_WINDOW_TYPE_QUERY: - case KVI_WINDOW_TYPE_DEADQUERY: - szText = m_pWindow->windowName(); - break; - default: - szText = m_pWindow->plainTextCaption(); - break; - } - - if(bMinimized) - { - QString tmp = QChar('('); - tmp += szText; - tmp += QChar(')'); - pPainter->drawText(cRect,Qt::AlignLeft | Qt::AlignTop,tmp,-1,&bRect); - } else { - pPainter->drawText(cRect,Qt::AlignLeft | Qt::AlignTop,szText,-1,&bRect); - } - - if(bRect.width() > cRect.width()) - { - pPainter->setClipRect(cRect.right(),cRect.y(),10,cRect.height()); - QColor base = pPainter->pen().color(); - QColor bg = colorGroup().color(QColorGroup::Background); - base.setRgb((base.red() + bg.red()) / 2,(base.green() + bg.green()) / 2,(base.blue() + bg.blue()) / 2); - pPainter->setPen(base); - cRect.setWidth(cRect.width() + 10); - pPainter->drawText(cRect,Qt::AlignLeft | Qt::AlignTop,szText,-1); - pPainter->setClipRect(cRect.right(),cRect.y(),5,cRect.height()); - base.setRgb((base.red() + bg.red()) / 2,(base.green() + bg.green()) / 2,(base.blue() + bg.blue()) / 2); - pPainter->setPen(base); - cRect.setWidth(cRect.width() + 10); - pPainter->drawText(cRect,Qt::AlignLeft | Qt::AlignTop,szText,-1); - } -#ifndef COMPILE_USE_QT4 - pPainter->setClipping(FALSE); - painter->drawPixmap(0,0,*pMemBuffer,distRect.x(),distRect.y(),iWidth,iHeight); -#endif -} - - -void KviTaskBarButton::captionChanged() -{ - update(); -} - -void KviTaskBarButton::setProgress(int progress) -{ - if(progress == m_iProgress)return; - m_iProgress = progress; - update(); // repaint(false) ? -} - -void KviTaskBarButton::unhighlight() -{ - if(m_iHighlightLevel < 1)return; - m_iHighlightLevel = 0; - if(g_pFrame->dockExtension())g_pFrame->dockExtension()->refresh(); - update(); -} - -void KviTaskBarButton::highlight(int iLevel) -{ - if(iLevel <= m_iHighlightLevel)return; - if(m_bActive && g_pFrame->isActiveWindow())return; - m_iHighlightLevel = iLevel; - if(g_pFrame->dockExtension())g_pFrame->dockExtension()->refresh(); - if(m_bActive)return; - update(); // repaint(false) ? -} - - - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// KviTaskBarToolTip -// -/* -KviTaskBarToolTip::KviTaskBarToolTip(KviTaskBarButton * b) -: KviTalToolTip(b,0) -{ - m_pTaskBarButton = b; -} - -KviTaskBarToolTip::~KviTaskBarToolTip() -{ -} - -void KviTaskBarToolTip::maybeTip(const QPoint &pnt) -{ - tip(m_pTaskBarButton->rect(),m_pTaskBarButton->m_pWindow->plainTextCaption()); -} -*/ - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// KviClasicTaskBar -// - - -KviClassicTaskBar::KviClassicTaskBar() -: KviTaskBarBase() -{ - m_pButtonList = new KviPointerList<KviTaskBarButton>; - m_pButtonList->setAutoDelete(true); - - calcButtonHeight(); - - m_pBase = new QWidget(this); -// m_pBase->setBackgroundMode(NoBackground); -#ifdef COMPILE_USE_QT4 - setWidget(m_pBase); - - m_pBase->setMinimumWidth(KVI_TASKBAR_MIN_WIDTH); - setMinimumWidth(KVI_TASKBAR_MIN_WIDTH); -#else //!COMPILE_USE_QT4 - setStretchableWidget(m_pBase); - - setVerticalStretchable(true); - setHorizontalStretchable(true); -#endif //!COMPILE_USE_QT4 - //m_pBase->setMinimumWidth(KVI_TASKBAR_MIN_WIDTH); - //setMinimumWidth(KVI_TASKBAR_MIN_WIDTH); - - m_pBase->setMinimumHeight(m_iButtonHeight+5); - setMinimumHeight(m_iButtonHeight+5); - -#ifndef COMPILE_USE_QT4 - setResizeEnabled( true ); - connect(this,SIGNAL(orientationChanged(Orientation)),this,SLOT(orientationChangedSlot(Orientation))); -#endif -} - -KviClassicTaskBar::~KviClassicTaskBar() -{ - delete m_pButtonList; - m_pButtonList = 0; -} - -void KviClassicTaskBar::orientationChangedSlot(Qt::Orientation o) -{ -#ifndef COMPILE_USE_QT4 - if (orientation() == Qt::Horizontal) m_pBase->setMinimumHeight(m_iButtonHeight); -#endif - doLayout(); -} - -/* -void KviClassicTaskBar::fontChange(const QFont &old) -{ - calcButtonHeight(); - doLayout(); - QToolBar::fontChange(old); -} -*/ - -void KviClassicTaskBar::updateActivityMeter() -{ - if(KVI_OPTION_BOOL(KviOption_boolUseTaskBarActivityMeter)) - { - for(KviTaskBarButton * btn = m_pButtonList->first();btn;btn = m_pButtonList->next()) - btn->update(); - } -} - -void KviClassicTaskBar::calcButtonHeight() -{ - QFontMetrics fm(KVI_OPTION_FONT(KviOption_fontTaskbar)); - m_iButtonHeight = fm.lineSpacing() + 6; - if(m_iButtonHeight < 22)m_iButtonHeight = 22; - if(KVI_OPTION_BOOL(KviOption_boolUseTaskBarIrcContextIndicator)) - m_iButtonHeight += KVI_TASKBARBUTTON_CONTEXTINDICATORHEIGHT; -} - -void KviClassicTaskBar::insertButton(KviTaskBarButton * b) -{ - int idx = 0; -// if(KVI_OPTION_BOOL(KviOption_boolSortTaskbarButtons)) -// { - // first sort by irc context - for(KviTaskBarButton * btn = m_pButtonList->first();btn;btn = m_pButtonList->next()) - { - if(btn->kviWindow()->console() == b->kviWindow()->console()) - { - // same irc context (or none) - // sort by type now - for(;btn;btn = m_pButtonList->next()) - { - if((btn->kviWindow()->type() > b->kviWindow()->type()) || - (btn->kviWindow()->console() != b->kviWindow()->console())) - { - // greater type or another irc context - m_pButtonList->insert(idx,b); - return; - } else if(btn->kviWindow()->type() == b->kviWindow()->type()) - { - // same type! - // sort by name - if(!KVI_OPTION_BOOL(KviOption_boolSortTaskBarItemsByName) || (KviQString::cmpCI(btn->kviWindow()->windowName(),b->kviWindow()->windowName()) > 0)) - { - // got a "higher one" - m_pButtonList->insert(idx,b); - return; - } - } - idx++; - } - // ran out of buttons - m_pButtonList->append(b); - return; - } else { - if(!(btn->kviWindow()->console()) && b->kviWindow()->console()) - { - // this must be a new console...insert before the contextless windows - __range_valid(b->kviWindow()->console() == b->kviWindow()); - m_pButtonList->insert(idx,b); - return; - } else idx++; // wrong irc contet...go on searching - } - } -// } - // no sorting selected , or no match for this irc context - m_pButtonList->append(b); -} - - -KviTaskBarItem * KviClassicTaskBar::addItem(KviWindow * wnd) -{ - KviTaskBarButton * b = new KviTaskBarButton(m_pBase,wnd,""); - insertButton(b); - b->show(); - doLayout(); - if(g_pFrame->dockExtension())g_pFrame->dockExtension()->refresh(); -/* if(b->width() < m_pBase->width()) m_pBase->setMinimumWidth(b->width()); - if(b->height() < m_pBase->height()) m_pBase->setMinimumWidth(b->height());*/ - return b; -} - -bool KviClassicTaskBar::removeItem(KviTaskBarItem * it) -{ - if(it) - { - m_pButtonList->removeRef((KviTaskBarButton *)it); - doLayout(); - if(g_pFrame->dockExtension())g_pFrame->dockExtension()->refresh(); - } - return true; -} - -void KviClassicTaskBar::setActiveItem(KviTaskBarItem * it) -{ - if(it) - { - for(KviTaskBarButton * b = m_pButtonList->first();b;b = m_pButtonList->next()) - { - b->setActive(((KviTaskBarButton *)it) == b); - } - if(g_pFrame->dockExtension())g_pFrame->dockExtension()->refresh(); - } -} - - -void KviClassicTaskBar::doLayout() -{ - if(!m_pButtonList->count())return; - - if(!m_pBase->isVisible()) - { - // handle a windows bug: sometimes this ugly thing happens - // this shouldn't hurt on other platforms - if(isVisible())m_pBase->show(); - } - - int baseWidth = m_pBase->width(); - int btnsInRow = baseWidth / KVI_OPTION_UINT(KviOption_uintTaskBarButtonMinWidth); - int totCount = m_pButtonList->count(); - //int btnsInRow = totCount * totCount * btnWidth * btnWidth / (wdth * wdth); - if(btnsInRow < 1)btnsInRow = 1; - - int rows = 0; - while(totCount > 0) - { - rows++; - totCount -= btnsInRow; - } - -#ifdef COMPILE_USE_QT4 - if(isFloating() || ((g_pFrame->dockWidgetArea(this) != Qt::BottomDockWidgetArea) && (g_pFrame->dockWidgetArea(this) != Qt::TopDockWidgetArea))) - { - QDockWidget::DockWidgetFeatures f = features(); - if(f & QDockWidget::DockWidgetVerticalTitleBar) - { - f &= ~QDockWidget::DockWidgetVerticalTitleBar; - setFeatures(f); - } - } else { - QDockWidget::DockWidgetFeatures f = features(); - if(!(f & QDockWidget::DockWidgetVerticalTitleBar)) - { - f |= QDockWidget::DockWidgetVerticalTitleBar; - setFeatures(f); - } - } -#endif - -#ifdef COMPILE_USE_QT4 - if ((width() > height()) && -#else - if ((orientation() == Qt::Horizontal) && -#endif - (((unsigned int)rows) > m_pBase->height() / m_iButtonHeight )) - { - rows = m_pBase->height() / m_iButtonHeight; - } - if(rows==0) rows=1; - totCount = m_pButtonList->count(); - btnsInRow = totCount / rows; - if(totCount % rows)btnsInRow++; - - //m_pBase->setMinimumHeight(rows * m_iButtonHeight); - - int theWidth = 0; - int theX = 0; - int theY = -m_iButtonHeight; - int btnIdx = 0; - int btnInRow = 1; - for(KviTaskBarButton * b = m_pButtonList->first();b;b = m_pButtonList->next()) - { - if((btnIdx % btnsInRow) == 0) - { - int inRow = ((totCount < btnsInRow ) ? totCount : btnsInRow); - theWidth = baseWidth / (inRow ? inRow : 1); - theX = 0; - theY += m_iButtonHeight; - btnInRow = 1; - } else { - if((btnInRow == btnsInRow) || (totCount == 1))theWidth = baseWidth - theX; - } - - if( KVI_OPTION_BOOL(KviOption_boolClassicTaskBarSetMaximumButtonWidth) && (theWidth > KVI_OPTION_UINT(KviOption_uintClassicTaskBarMaximumButtonWidth)) && -#ifdef COMPILE_USE_QT4 - (width() > height()) -#else - (orientation() == Qt::Horizontal) -#endif - ) - theWidth = KVI_OPTION_UINT(KviOption_uintClassicTaskBarMaximumButtonWidth); - - b->setGeometry(theX,theY,theWidth,m_iButtonHeight); - - if(btnInRow != btnsInRow) - { - theX += theWidth; - btnInRow++; - } - btnIdx++; - totCount--; - } -} - -void KviClassicTaskBar::applyOptions() -{ - for(KviTaskBarButton * b = m_pButtonList->first();b;b = m_pButtonList->next()) - { - b->setFlat(KVI_OPTION_BOOL(KviOption_boolUseFlatClassicTaskbarButtons)); - } - doLayout(); -} - -void KviClassicTaskBar::resizeEvent(QResizeEvent *e) -{ -/* -#ifdef COMPILE_USE_QT4 - if(orientation() == Qt::Horizontal) - { - int iRows = height()/m_iButtonHeight; - if(!iRows) iRows=1; - debug("%i %i",height(),iRows); - resize(width(),iRows*m_iButtonHeight); - } -#endif -*/ - KviTaskBarBase::resizeEvent(e); - doLayout(); -} - -inline KviTaskBarItem * KviClassicTaskBar::firstItem() -{ - return m_pButtonList->first(); -} - -inline KviTaskBarItem * KviClassicTaskBar::lastItem(void) -{ - return m_pButtonList->last(); -} - -inline KviTaskBarItem * KviClassicTaskBar::nextItem() -{ - return m_pButtonList->next(); -} - -inline KviTaskBarItem * KviClassicTaskBar::prevItem(void) -{ - return m_pButtonList->prev(); -} - -inline bool KviClassicTaskBar::setIterationPointer(KviTaskBarItem * it) -{ - return (m_pButtonList->findRef((const KviTaskBarButton *)it) != -1); -} - - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// KviTreeTaskBarItem -// - - -KviTreeTaskBarItem::KviTreeTaskBarItem(KviTalListView * par,KviWindow * wnd) -: KviTalListViewItem(par) , KviTaskBarItem(wnd) -{ - m_iStepNumber=0; - m_bIncreasing=0; - m_pInternal=new KviTreeTaskBarItemInternal(this); - m_pAnimTimer=new QTimer(); - QObject::connect( m_pAnimTimer, SIGNAL(timeout()), m_pInternal, SLOT(timerShot())); - applyOptions(); -} - -KviTreeTaskBarItem::KviTreeTaskBarItem(KviTreeTaskBarItem * par,KviWindow * wnd) -: KviTalListViewItem(par) , KviTaskBarItem(wnd) -{ - m_iStepNumber=0; - m_bIncreasing=0; - m_pInternal=new KviTreeTaskBarItemInternal(this); - m_pAnimTimer=new QTimer(); - QObject::connect( m_pAnimTimer, SIGNAL(timeout()), m_pInternal, SLOT(timerShot())); - applyOptions(); -} - -int KviTreeTaskBarItem::calculateColor(int col1,int col2) -{ - int result=col1+(col2-col1)/KVI_NUM_STEPS*m_iStepNumber; - return result<255 ? result :255; -} - -KviTreeTaskBarItem::~KviTreeTaskBarItem() -{ - KviTalListView* pView=(KviTalListView *)listView(); - if(pView) - if(((KviTreeTaskBarListView*)(pView))->m_pPrevItem==this) ((KviTreeTaskBarListView*)(listView()))->m_pPrevItem=0; - delete m_pAnimTimer; - delete m_pInternal; -} - -void KviTreeTaskBarItem::applyOptions() -{ - m_iRedDiff=(KVI_OPTION_COLOR(KviOption_colorTreeTaskBarActiveBackground).red()-KVI_OPTION_COLOR(KviOption_colorTreeTaskBarBackground).red())/KVI_NUM_STEPS; - m_iGreenDiff=(KVI_OPTION_COLOR(KviOption_colorTreeTaskBarActiveBackground).green()-KVI_OPTION_COLOR(KviOption_colorTreeTaskBarBackground).green())/KVI_NUM_STEPS; - m_iBlueDiff=(KVI_OPTION_COLOR(KviOption_colorTreeTaskBarActiveBackground).blue()-KVI_OPTION_COLOR(KviOption_colorTreeTaskBarBackground).blue())/KVI_NUM_STEPS; -} - -void KviTreeTaskBarItem::captionChanged() -{ - // FIXME: can we do better ? - repaint(); -} - -void KviTreeTaskBarItem::unhighlight() -{ - if(m_iHighlightLevel < 1)return; - m_iHighlightLevel = 0; - if(g_pFrame->dockExtension())g_pFrame->dockExtension()->refresh(); - repaint(); -} - -void KviTreeTaskBarItem::highlight(int iLevel) -{ - if(iLevel <= m_iHighlightLevel)return; - if(isSelected() && g_pFrame->isActiveWindow())return; - m_iHighlightLevel = iLevel; - if(g_pFrame->dockExtension())g_pFrame->dockExtension()->refresh(); - if(isSelected())return; - repaint(); // repaint(false) ? -} - -void KviTreeTaskBarItem::setProgress(int progress) -{ - if(progress == m_iProgress)return; - m_iProgress = progress; - repaint(); // repaint(false) ? -} - -void KviTreeTaskBarItem::setActive(bool bActive) -{ - if(bActive) - { -// m_bHighlighted = false; -// m_bAltColor = false; - m_iHighlightLevel = 0; - // was not selected: the listView will repaint it - } else { - if(isSelected()) - { - // was active... unset the highlighting if it was silently turned on while being active... -// m_bHighlighted = false; -// m_bAltColor = false; - m_iHighlightLevel = 0; - // was selected: the list view will repaint it - } - } -} - -#ifdef COMPILE_USE_QT4 -void KviTreeTaskBarItem::paintBranches(QPainter *p,const QColorGroup &,int w,int y,int h) -#else -void KviTreeTaskBarItem::paintBranches(QPainter *p,const QColorGroup &,int w,int y,int h,GUIStyle s) -#endif -{ - SET_ANTI_ALIASING(*p); - ((KviTreeTaskBarListView *)listView())->paintEmptyArea(p,QRect(0,y,w,totalHeight() - height())); -} - -void KviTreeTaskBarItem::paintCell(QPainter *painter,const QColorGroup &cg,int column,int width,int) -{ - KviDoubleBuffer db(width,height()); - QPixmap * pMemBuffer = db.pixmap(); - QPainter p(pMemBuffer); - SET_ANTI_ALIASING(p); - - if(isSelected()) - { - p.fillRect(0,0,width,height(),KVI_OPTION_COLOR(KviOption_colorTreeTaskBarActiveBackground)); - } else { - if(!m_iStepNumber) - { -#ifdef COMPILE_PSEUDO_TRANSPARENCY - if(g_pShadedChildGlobalDesktopBackground) - { - QPoint pnt = listView()->viewport()->mapToGlobal(QPoint(int(painter->worldMatrix().dx()),int(painter->worldMatrix().dy()))); - p.drawTiledPixmap(0,0,width,height(),*g_pShadedChildGlobalDesktopBackground,pnt.x(),pnt.y()); - } else { -#endif - p.fillRect(0,0,width,height(),KVI_OPTION_COLOR(KviOption_colorTreeTaskBarBackground)); -#ifdef COMPILE_PSEUDO_TRANSPARENCY - } -#endif - QPixmap * pix = KVI_OPTION_PIXMAP(KviOption_pixmapTreeTaskBarBackground).pixmap(); - if(pix) - { - QPoint pnt = listView()->viewportToContents(QPoint(int(painter->worldMatrix().dx()),int(painter->worldMatrix().dy()))); - //p.drawTiledPixmap(0,0,width,height(),*pix,pnt.x(),pnt.y()); -// debug("%i %i",pnt.x(),pnt.y()); - p.translate(-pnt.x(),-pnt.y()); - KviPixmapUtils::drawPixmapWithPainter(&p,pix,KVI_OPTION_UINT(KviOption_uintTreeTaskBarPixmapAlign),QRect(pnt.x(),pnt.y(),width,height()),listView()->width(),listView()->height()); - p.translate(pnt.x(),pnt.y()); - } - } else { - p.fillRect(0,0,width,height(), - QColor(KVI_OPTION_COLOR(KviOption_colorTreeTaskBarBackground).red()+m_iRedDiff*m_iStepNumber, - KVI_OPTION_COLOR(KviOption_colorTreeTaskBarBackground).green()+m_iGreenDiff*m_iStepNumber, - KVI_OPTION_COLOR(KviOption_colorTreeTaskBarBackground).blue()+m_iBlueDiff*m_iStepNumber - ) - ); - - } - } - - int h = height(); - int im = listView()->itemMargin(); - int yPixmap = (h - 16) >> 1; - - QString szText; - - QRect cRect(im + 3,0,width - (im << 1),height()); - - switch(m_pWindow->type()) - { - case KVI_WINDOW_TYPE_CONSOLE: - { - if(KVI_OPTION_BOOL(KviOption_boolUseTaskBarIrcContextIndicator)) - { - QColor base = cg.background(); - QColor cntx = KVI_OPTION_ICCOLOR(m_pWindow->console()->ircContextId() % KVI_NUM_ICCOLOR_OPTIONS); - base.setRgb((base.red() + cntx.red()) >> 1,(base.green() + cntx.green()) >> 1, - (base.blue() + cntx.blue()) >> 1); - p.fillRect(im + 2,yPixmap + 1,14,15,base); - //draw_frame_helper(&p,im + 1,yPixmap,im + 15,yPixmap + 15,base.light(180),base.dark()); - if(KVI_OPTION_BOOL(KviOption_boolUseTaskBarIcons)) - { - p.drawPixmap(im + 20,yPixmap,*(m_pWindow->myIconPtr())); - cRect.setLeft(cRect.left() + 37); - } else { - cRect.setLeft(cRect.left() + 20); - } - } else { - if(KVI_OPTION_BOOL(KviOption_boolUseTaskBarIcons)) - { - p.drawPixmap(im,yPixmap,*(m_pWindow->myIconPtr())); - cRect.setLeft(cRect.left() + 17); - } - } - QFont f = QFont(); - f.setBold(true); - p.setFont(f); - KviTaskBarBase::getTextForConsole(szText,(KviConsole *)m_pWindow); - } - break; - case KVI_WINDOW_TYPE_CHANNEL: - case KVI_WINDOW_TYPE_DEADCHANNEL: - szText = ((KviChannel *)m_pWindow)->nameWithUserFlag(); - if(KVI_OPTION_BOOL(KviOption_boolUseTaskBarIcons)) - { - p.drawPixmap(im,yPixmap,*(m_pWindow->myIconPtr())); - cRect.setLeft(cRect.left() + 17); - } - break; - case KVI_WINDOW_TYPE_QUERY: - case KVI_WINDOW_TYPE_DEADQUERY: - szText = m_pWindow->windowName(); - if(KVI_OPTION_BOOL(KviOption_boolUseTaskBarIcons)) - { - p.drawPixmap(im,yPixmap,*(m_pWindow->myIconPtr())); - cRect.setLeft(cRect.left() + 17); - } - break; - default: - szText = m_pWindow->plainTextCaption(); - if(KVI_OPTION_BOOL(KviOption_boolUseTaskBarIcons)) - { - p.drawPixmap(im,yPixmap,*(m_pWindow->myIconPtr())); - cRect.setLeft(cRect.left() + 17); - } - break; - } - - if(KVI_OPTION_BOOL(KviOption_boolUseTaskBarActivityMeter)) - { - unsigned int uActivityValue; - unsigned int uActivityTemperature; - if(m_pWindow->activityMeter(&uActivityValue,&uActivityTemperature)) - { - p.drawPixmap(cRect.left(),yPixmap,*g_pActivityMeterPixmap,uActivityValue * 5,uActivityTemperature * 16,5,16); - cRect.setLeft(cRect.left() + 7); - } - } - - if(m_iProgress >= 0) - { - // paint the progress bar - int wdth = (m_iProgress * cRect.width()) / 100; - p.fillRect(cRect.x(),cRect.y(),wdth,cRect.height(),KVI_OPTION_COLOR(KviOption_colorTreeTaskBarProgress)); - } - - if(isSelected()) - { - p.setPen(KVI_OPTION_COLOR(KviOption_colorTreeTaskBarActiveForeground)); - } else { - int iLevel; - switch(m_iHighlightLevel) - { - case 0: iLevel = KviOption_colorTreeTaskBarForeground; break; - case 1: iLevel = KviOption_colorTreeTaskBarHighlight1Foreground; break; - case 2: iLevel = KviOption_colorTreeTaskBarHighlight2Foreground; break; - case 3: iLevel = KviOption_colorTreeTaskBarHighlight3Foreground; break; - case 4: iLevel = KviOption_colorTreeTaskBarHighlight4Foreground; break; - default: iLevel = KviOption_colorTreeTaskBarHighlight5Foreground; break; - } - p.setPen( - QColor( - calculateColor(KVI_OPTION_COLOR(iLevel).red(),KVI_OPTION_COLOR(KviOption_colorTreeTaskBarActiveForeground).red()), - calculateColor(KVI_OPTION_COLOR(iLevel).green(),KVI_OPTION_COLOR(KviOption_colorTreeTaskBarActiveForeground).green()), - calculateColor(KVI_OPTION_COLOR(iLevel).blue(),KVI_OPTION_COLOR(KviOption_colorTreeTaskBarActiveForeground).blue()) - ) - ); - } - - if(m_pWindow->isMinimized()) - { - QString tmp = QChar('('); - tmp += szText; - tmp += QChar(')'); - p.drawText(cRect,Qt::AlignLeft | Qt::AlignVCenter,tmp,-1,0); - } else { - p.drawText(cRect,Qt::AlignLeft | Qt::AlignVCenter,szText,-1,0); - } - - painter->drawPixmap(0,0,*pMemBuffer,0,0,width,height()); - //bitBlt(painter->pixmap(),0,0,pMemBuffer,0,0,width,height(),Qt::CopyROP,false); -} - -QString KviTreeTaskBarItem::key(int,bool) const -{ - QString ret = m_pWindow->typeString(); - ret.append(m_pWindow->windowName()); - return ret; -} - -void KviTreeTaskBarItem::timerShot() -{ - if(m_bIncreasing) - m_iStepNumber++; - else - m_iStepNumber--; - - if((m_iStepNumber>=KVI_NUM_STEPS) && m_bIncreasing) - { - m_pAnimTimer->stop(); - m_iStepNumber=KVI_NUM_STEPS; //make shure, that we cannot get out of range - } else if((m_iStepNumber<=0) && !m_bIncreasing) { - m_pAnimTimer->stop(); - m_iStepNumber=0; //make shure, that we cannot get out of range - } - repaint(); -} - -void KviTreeTaskBarItem::mouseEnter() -{ - if(KVI_OPTION_BOOL(KviOption_boolEnableVisualEffects)) - { - m_bIncreasing=true; - if(!m_pAnimTimer->isActive()) m_pAnimTimer->start(KVI_TIMER_DELAY); - } -} - -void KviTreeTaskBarItem::mouseLeave() -{ - if(KVI_OPTION_BOOL(KviOption_boolEnableVisualEffects)) - { - m_bIncreasing=false; - if(!m_pAnimTimer->isActive()) m_pAnimTimer->start(KVI_TIMER_DELAY); - } -} - - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// KviTreeTaskBarListView -// - - -KviTreeTaskBarListView::KviTreeTaskBarListView(QWidget * par) -: KviTalListView(par) -{ - //setSorting(0); - setShowSortIndicator(true); - setItemMargin(2); - setFrameShape(NoFrame); - viewport()->setMouseTracking(TRUE); - m_pPrevItem=0; - setHScrollBarMode(KviTalListView::AlwaysOff); -} - -KviTreeTaskBarListView::~KviTreeTaskBarListView() -{ -} - -void KviTreeTaskBarListView::contentsMouseMoveEvent ( QMouseEvent * e ) -{ - if(!e) return; - KviTreeTaskBarItem* pCur=(KviTreeTaskBarItem*)(itemAt(contentsToViewport(e->pos()))); - if(pCur!=m_pPrevItem) - { - if(m_pPrevItem)m_pPrevItem->mouseLeave(); - if(pCur) pCur->mouseEnter(); - setCursor(Qt::PointingHandCursor); - m_pPrevItem=pCur; - } else if(!pCur) { - setCursor(Qt::ArrowCursor); - } -} -void KviTreeTaskBarListView::leaveEvent(QEvent *) -{ - if(m_pPrevItem) m_pPrevItem->mouseLeave(); - m_pPrevItem=0; - setCursor(Qt::ArrowCursor); -} - - -void KviTreeTaskBarListView::contentsMousePressEvent(QMouseEvent *e) -{ - KviTalListViewItem * it = (KviTalListViewItem *)itemAt(contentsToViewport(e->pos())); - if(it) - { - if(e->button() & Qt::LeftButton)emit leftMousePress(it); - else if(e->button() & Qt::RightButton)emit rightMousePress(it); - } else { - if(e->button() & Qt::RightButton) - { - KviTalPopupMenu* pPopup=new KviTalPopupMenu(); - pPopup->insertItem(__tr2qs("Sort"),this,SLOT(sort())); - pPopup->insertItem(__tr2qs("Reverse Sort"),this,SLOT(reverseSort())); - pPopup->popup(QCursor::pos()); - } - } -} - -void KviTreeTaskBarListView::sort() -{ - setSorting(0,TRUE); -} - -void KviTreeTaskBarListView::reverseSort() -{ - setSorting(0,FALSE); -} - -void KviTreeTaskBarListView::resizeEvent(QResizeEvent *e) -{ - KviTalListView::resizeEvent(e); - setColumnWidth(0,viewport()->width()); - resizeContents(viewport()->width(),contentsHeight()); -} - -//void KviTreeTaskBarListView::paintEmptyAreaInternal(QPainter * p,const QRect &viewportRect,const QRect &painterRect) -//{ -// -//} - -void KviTreeTaskBarListView::paintEmptyArea(QPainter * p,const QRect &rct) -{ - SET_ANTI_ALIASING(*p); -#ifdef COMPILE_PSEUDO_TRANSPARENCY - if(g_pShadedChildGlobalDesktopBackground) - { - QPoint pnt = viewport()->mapToGlobal(QPoint(rct.x() + int(p->worldMatrix().dx()),rct.y() + int(p->worldMatrix().dy()))); - p->drawTiledPixmap(rct.x(),rct.y(),rct.width(),rct.height(),*g_pShadedChildGlobalDesktopBackground,pnt.x(),pnt.y()); - } else { -#endif - p->fillRect(rct.x(),rct.y(),rct.width(),rct.height(),KVI_OPTION_COLOR(KviOption_colorTreeTaskBarBackground)); -#ifdef COMPILE_PSEUDO_TRANSPARENCY - } -#endif - - QPixmap * pix = KVI_OPTION_PIXMAP(KviOption_pixmapTreeTaskBarBackground).pixmap(); - if(pix) - { - QPoint pnt = viewportToContents(QPoint(rct.x() + int(p->worldMatrix().dx()),rct.y() + int(p->worldMatrix().dy()))); - //p->drawTiledPixmap(rct.x(),rct.y(),rct.width(),rct.height(),*pix,pnt.x(),pnt.y()); - KviPixmapUtils::drawPixmapWithPainter(p,pix,KVI_OPTION_UINT(KviOption_uintTreeTaskBarPixmapAlign),rct,viewport()->width(),viewport()->height(),pnt.x(),pnt.y()); - } -} - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// KviTreeTaskBar -// - -KviTreeTaskBar::KviTreeTaskBar() -: KviTaskBarBase() -{ - m_pListView = new KviTreeTaskBarListView(this); - m_pListView->addColumn(__tr2qs("Window List"),135); - m_pListView->setAllColumnsShowFocus(true); - m_pListView->setMultiSelection(false); - -#ifdef COMPILE_USE_QT4 - setWidget(m_pListView); -#else //!COMPILE_USE_QT4 - setStretchableWidget(m_pListView); - - setVerticalStretchable(true); - setHorizontalStretchable(true); -#endif //!COMPILE_USE_QT4 - - - // FIXME: this code is useless ? - if(KVI_OPTION_UINT(KviOption_uintTreeTaskBarMinimumWidth) < 48) - KVI_OPTION_UINT(KviOption_uintTreeTaskBarMinimumWidth) = 48; - int iMin = m_pListView->minimumSize().width() + 4; - if(((unsigned int)iMin) < KVI_OPTION_UINT(KviOption_uintTreeTaskBarMinimumWidth)) - iMin = KVI_OPTION_UINT(KviOption_uintTreeTaskBarMinimumWidth); - setMinimumWidth(iMin); - - // this is surely useful :) - m_pListView->setMinimumWidth(4); - - //setMaximumWidth(KVI_OPTION_UINT(KviOption_uintTreeTaskBarMaximumWidth)); - //m_pListView->setMinimumWidth(KVI_OPTION_UINT(KviOption_uintTreeTaskBarMinimumWidth)); - //m_pListView->setMaximumWidth(KVI_OPTION_UINT(KviOption_uintTreeTaskBarMaximumWidth)); -#ifdef COMPILE_USE_QT4 - m_pListView->setFocusPolicy(Qt::NoFocus); -#else - m_pListView->setFocusPolicy(QWidget::NoFocus); -#endif - m_pListView->setStaticBackground(true); -#ifdef COMPILE_USE_QT4 - m_pListView->viewport()->setAutoFillBackground(false); -#else - m_pListView->viewport()->setBackgroundMode(QWidget::NoBackground); -#endif - if(!KVI_OPTION_BOOL(KviOption_boolShowTreeTaskbarHeader)) - { - m_pListView->header()->hide(); - } - - m_pListView->header()->setResizeEnabled(true); - -#ifdef COMPILE_USE_QT4 - setMaximumWidth(600); -#endif - - m_pListView->viewport()->installEventFilter(this); - -#if QT_VERSION >= 300 -#ifndef COMPILE_USE_QT4 - setResizeEnabled(true); -#endif -#endif - - m_pToolTip = new KviDynamicToolTip(m_pListView->viewport(),"tree_taskbar_tooltip"); - connect(m_pToolTip,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &))); -} - -KviTreeTaskBar::~KviTreeTaskBar() -{ -} - -void KviTreeTaskBar::updatePseudoTransparency() -{ -#ifdef COMPILE_PSEUDO_TRANSPARENCY - m_pListView->viewport()->update(); -#endif -} - -void KviTreeTaskBar::moveEvent(QMoveEvent *) -{ -#ifdef COMPILE_PSEUDO_TRANSPARENCY - updatePseudoTransparency(); -#endif -} - -void KviTreeTaskBar::tipRequest(KviDynamicToolTip *,const QPoint &pnt) -{ - if(KVI_OPTION_BOOL(KviOption_boolShowTaskBarToolTips)) - { - KviTalListViewItem * it = (KviTalListViewItem *)m_pListView->itemAt(pnt); - if(it) - { - QString szText; - ((KviTreeTaskBarItem *)it)->m_pWindow->getTaskBarTipText(szText); - m_pToolTip->tip(m_pListView->itemRect(it),szText); - } - } -} - -bool KviTreeTaskBar::eventFilter(QObject * o,QEvent *e) -{ - if(o == m_pListView->viewport()) - { - if(e->type() == QEvent::MouseButtonPress) - { - QMouseEvent * ev = (QMouseEvent *)e; - KviTreeTaskBarItem * it = (KviTreeTaskBarItem *)m_pListView->itemAt(ev->pos()); - if(!it)return false; - KviWindow * wnd = it->kviWindow(); - if(wnd) - { - if(ev->button() & Qt::LeftButton) - { - if(ev->state() & Qt::ShiftButton) - { - wnd->delayedClose(); - } else { - if((g_pActiveWindow != wnd) || (wnd->isMinimized()))g_pFrame->setActiveWindow(wnd); - else wnd->minimize(); - } - } else { - wnd->contextPopup(); - } - } - return true; - } - } - return false; -} - - -KviTaskBarItem * KviTreeTaskBar::addItem(KviWindow * wnd) -{ - // complex insertion task - if(wnd->console()) - { - if(wnd->type() != KVI_WINDOW_TYPE_CONSOLE) - { - ((KviTreeTaskBarItem *)(wnd->console()->m_pTaskBarItem))->setOpen(true); - return new KviTreeTaskBarItem(((KviTreeTaskBarItem *)(wnd->console()->m_pTaskBarItem)),wnd); - } - } - - // console , or a window that has no irc context - return new KviTreeTaskBarItem(m_pListView,wnd); -} - -bool KviTreeTaskBar::removeItem(KviTaskBarItem * it) -{ - delete (KviTreeTaskBarItem *)it; - return true; -} - -void KviTreeTaskBar::setActiveItem(KviTaskBarItem * it) -{ - if(it) - { - KviTreeTaskBarItem * cur = (KviTreeTaskBarItem *)m_pListView->currentItem(); - if(cur && (cur != (KviTreeTaskBarItem *)it)) - { - cur->setActive(false); - } - if(((KviTreeTaskBarItem *)it)->parent()) - { - if(!((KviTreeTaskBarItem *)it)->parent()->isOpen())((KviTreeTaskBarItem *)it)->parent()->setOpen(true); - } - ((KviTreeTaskBarItem *)it)->setActive(true); - m_pListView->setSelected(((KviTreeTaskBarItem *)it),true); // this MUST go after it->setActive() - if(g_pFrame->dockExtension())g_pFrame->dockExtension()->refresh(); - } -} - -void KviTreeTaskBar::updateActivityMeter() -{ - if(KVI_OPTION_BOOL(KviOption_boolUseTaskBarActivityMeter)) - { - m_pListView->viewport()->update(); - } -} - -KviTaskBarItem * KviTreeTaskBar::firstItem() -{ - m_pCurrentItem = (KviTreeTaskBarItem *)m_pListView->firstChild(); - return m_pCurrentItem; -} - -KviTaskBarItem * KviTreeTaskBar::nextItem() -{ - if(!m_pCurrentItem)return 0; - - if(m_pCurrentItem->firstChild()) - { - m_pCurrentItem = (KviTreeTaskBarItem *)m_pCurrentItem->firstChild(); - } else { - // this item has no children: try the next sibling - if(m_pCurrentItem->nextSibling()) - { - m_pCurrentItem = (KviTreeTaskBarItem *)m_pCurrentItem->nextSibling(); - } else { - if(m_pCurrentItem->parent()) - { - // child with not siblings : try the sibling of the parent - m_pCurrentItem = (KviTreeTaskBarItem *)m_pCurrentItem->parent()->nextSibling(); - } else { - m_pCurrentItem = 0; // toplevel with no siblings - } - } - } - return m_pCurrentItem; -} - -KviTaskBarItem * KviTreeTaskBar::prevItem() -{ - KviTreeTaskBarItem * it; - - if(!m_pCurrentItem)return 0; - - if(m_pCurrentItem->parent()) - { - // a child item - it = (KviTreeTaskBarItem *)m_pCurrentItem->parent()->firstChild(); - - while(it) - { - if(((KviTreeTaskBarItem *)it->nextSibling()) == m_pCurrentItem)break; - else it = ((KviTreeTaskBarItem *)(it->nextSibling())); - } - if(!it) - { - it = (KviTreeTaskBarItem *)m_pCurrentItem->parent(); - } - - } else { - // a toplevel one - it = (KviTreeTaskBarItem *)m_pListView->firstChild(); - while(it) - { - if(((KviTreeTaskBarItem *)it->nextSibling()) == m_pCurrentItem)break; - else it = ((KviTreeTaskBarItem *)(it->nextSibling())); - } - if(it) - { - if(it->firstChild()) - { - it = ((KviTreeTaskBarItem *)(it->firstChild())); - while(it->nextSibling())it = ((KviTreeTaskBarItem *)(it->nextSibling())); - } - } - } - - m_pCurrentItem = it; - return it; -} - -KviTaskBarItem * KviTreeTaskBar::lastItem() -{ - // first find last toplevel item - m_pCurrentItem = (KviTreeTaskBarItem *)m_pListView->firstChild(); - for(;;) - { - if(m_pCurrentItem->nextSibling()) - { - m_pCurrentItem = (KviTreeTaskBarItem *)m_pCurrentItem->nextSibling(); - } else if(m_pCurrentItem->firstChild()) - { - m_pCurrentItem = (KviTreeTaskBarItem *)m_pCurrentItem->firstChild(); - } else return m_pCurrentItem; - } - return 0; -} - -bool KviTreeTaskBar::setIterationPointer(KviTaskBarItem * it) -{ - m_pCurrentItem = (KviTreeTaskBarItem *)it; - if(!it)return true; - if(((KviTalListView *)m_pListView) == ((KviTreeTaskBarItem *)it)->listView())return true; - m_pCurrentItem = 0; - return false; -} - -void KviTreeTaskBar::applyOptions() -{ - m_pListView->update(); - if(!KVI_OPTION_BOOL(KviOption_boolShowTreeTaskbarHeader)) - { - m_pListView->header()->hide(); - } else { - m_pListView->header()->show(); - } -} - -#include "kvi_taskbar.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_taskbar.h b/3.4.0/src/kvirc/ui/kvi_taskbar.h deleted file mode 100644 index 48d8a35835..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_taskbar.h +++ /dev/null @@ -1,312 +0,0 @@ -#ifndef _KVI_TASKBAR_H_ -#define _KVI_TASKBAR_H_ -//============================================================================= -// -// File : kvi_taskbar.h -// Creation date : Thu Jan 7 1999 03:56:50 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_pointerlist.h" -#include <qframe.h> -#include "kvi_tal_tooltip.h" -#include "kvi_tal_listview.h" -#include <qpushbutton.h> - - - -class KviWindow; -class KviFrame; -class QPixmap; -class KviDynamicToolTip; -class KviConsole; - -// -// KviTaskBarItem -// -// The base class for the taskBar items -// this is the only interface to an item visible to external classes -// - -class KVIRC_API KviTaskBarItem -{ -public: - KviTaskBarItem(KviWindow * wnd); - virtual ~KviTaskBarItem(); -protected: - KviWindow * m_pWindow; - int m_iHighlightLevel; - int m_iProgress; -public: - KviWindow * kviWindow(){ return m_pWindow; }; - virtual void captionChanged(){}; - virtual void highlight(int iLevel = 1){}; - virtual void setProgress(int progress){}; - virtual bool active(){ return false; }; - virtual void unhighlight(){}; - int progress(){ return m_iProgress; }; - int highlightLevel(){ return m_iHighlightLevel; }; -}; - -// -// KviTaskBarBase -// -// The base class for the taskbar implementations -// This is the basic interface that all the external classes should see -// - -// Please note that Qt3 moc skips the *_SKIP_BEGIN -> *_SKIP_END blocks -// while the Qt4 moc skips the Q_MOC_RUN ifdef block.. so... - -// Qt4 version - -// If you get failures (undefined references) in some non-autotools based -// build system that uses Qt4 then you must add the -DCOMPILE_USE_QT4 -// commandline parameter to moc (at leat) when parsing this file. - -// MOC_SKIP_BEGIN -#ifdef COMPILE_USE_QT4 - -#include <QDockWidget> - -class KVIRC_API KviTaskBarBase : public QDockWidget -{ - Q_OBJECT -#endif //COMPILE_USE_QT4 -// MOC_SKIP_END - -// Qt3 version -#ifndef Q_MOC_RUN -#ifndef COMPILE_USE_QT4 - -#include "kvi_toolbar.h" - -class KVIRC_API KviTaskBarBase : public KviToolBar -{ - Q_OBJECT -#endif -#endif - -public: - KviTaskBarBase(); - virtual ~KviTaskBarBase(); -protected: - KviFrame * m_pFrm; - QTimer * m_pActivityMeterTimer; -public: - virtual KviTaskBarItem * addItem(KviWindow *){ return 0; }; - virtual bool removeItem(KviTaskBarItem *){ return false; }; - virtual void setActiveItem(KviTaskBarItem *){}; - virtual KviTaskBarItem * firstItem(){ return 0; }; - virtual KviTaskBarItem * lastItem(void) { return 0; } - virtual KviTaskBarItem * nextItem(){ return 0; }; - virtual KviTaskBarItem * prevItem(void) { return 0; } - virtual KviTaskBarItem * item(int number); - virtual bool setIterationPointer(KviTaskBarItem * it){ return false; }; - virtual void switchWindow(bool bNext,bool bInContextOnly); - virtual void updatePseudoTransparency(){}; - virtual void applyOptions(){}; - static void getTextForConsole(QString &szText,KviConsole * pConsole); -protected slots: - virtual void updateActivityMeter(); -}; - -// -// Implementation details: the following classes should be -// never used directly (with just the exception of KviFrame -// that creates the taskbar) -// - -class KviClassicTaskBar; - -class KVIRC_API KviTaskBarButton : public QPushButton , KviTaskBarItem -{ - friend class KviClassicTaskBar; - Q_OBJECT -public: - KviTaskBarButton(QWidget * par,KviWindow * wnd,const char * name); - ~KviTaskBarButton(); -protected: - bool m_bActive; - KviDynamicToolTip * m_pTip; -protected: - virtual void mousePressEvent(QMouseEvent *e); -#if QT_VERSION >= 300 - virtual void contextMenuEvent(QContextMenuEvent *e); -#endif - virtual void drawButtonLabel(QPainter *p); -#ifdef COMPILE_USE_QT4 - virtual void paintEvent(QPaintEvent * e); -#endif -public: - virtual bool active(){ return m_bActive; }; - virtual void highlight(int iLevel = 1); - virtual void unhighlight(); - virtual void setProgress(int progress); - virtual void captionChanged(); -protected: - void setActive(bool bActive); -protected slots: - void tipRequest(KviDynamicToolTip *tip,const QPoint &pnt); -}; - - -class KVIRC_API KviClassicTaskBar : public KviTaskBarBase -{ - Q_OBJECT -public: - KviClassicTaskBar(); - ~KviClassicTaskBar(); -protected: - KviPointerList<KviTaskBarButton> * m_pButtonList; - int m_iButtonHeight; - QWidget * m_pBase; -protected: - void calcButtonHeight(); - void doLayout(); // called by KviFrame to adjust a bug on WIndows - void insertButton(KviTaskBarButton * b); -public: -// virtual void fontChange(const QFont & old); - virtual void resizeEvent(QResizeEvent *e); -public: - virtual KviTaskBarItem * addItem(KviWindow *); - virtual bool removeItem(KviTaskBarItem *); - virtual void setActiveItem(KviTaskBarItem *); - virtual KviTaskBarItem * firstItem(); - virtual KviTaskBarItem * lastItem(void); - virtual KviTaskBarItem * nextItem(); - virtual KviTaskBarItem * prevItem(void); - virtual bool setIterationPointer(KviTaskBarItem * it); - virtual void updateActivityMeter(); - virtual void applyOptions(); -protected slots: - void orientationChangedSlot(Qt::Orientation o); -}; - -class KviTreeTaskBar; -class KviTreeTaskBarItemInternal; - -class KVIRC_API KviTreeTaskBarItem : public KviTalListViewItem , public KviTaskBarItem -{ - friend class KviTreeTaskBar; - friend class KviTreeTaskBarListView; - friend class KviTreeTaskBarItemInternal; -public: - KviTreeTaskBarItem(KviTalListView * par,KviWindow * wnd); - KviTreeTaskBarItem(KviTreeTaskBarItem * par,KviWindow * wnd); - ~KviTreeTaskBarItem(); -protected: - int m_iStepNumber; - bool m_bIncreasing; - QTimer* m_pAnimTimer; - KviTreeTaskBarItemInternal *m_pInternal; - int m_iRedDiff; - int m_iGreenDiff; - int m_iBlueDiff; -public: - virtual QString key(int column,bool) const; - virtual void paintCell(QPainter *p,const QColorGroup &cg,int column,int width,int alignment); -#ifdef COMPILE_USE_QT4 - virtual void paintBranches(QPainter *p,const QColorGroup &cg,int w,int y,int h); -#else - virtual void paintBranches(QPainter *p,const QColorGroup &cg,int w,int y,int h,GUIStyle s); -#endif - virtual void captionChanged(); - virtual void highlight(int iLevel = 1); - virtual void unhighlight(); - virtual void setProgress(int progress); - virtual bool active(){ return isSelected(); }; - virtual void applyOptions(); -protected: - void setActive(bool bActive); - void mouseEnter(); - void mouseLeave(); - void timerShot(); - int calculateColor(int col1,int col2); -}; - -class KviTreeTaskBarItemInternal : public QObject -{ - Q_OBJECT -public: - KviTreeTaskBarItemInternal(KviTreeTaskBarItem* pItem):m_pItem(pItem) {}; - ~KviTreeTaskBarItemInternal() {}; -protected: - KviTreeTaskBarItem* m_pItem; -public slots: - void timerShot() { m_pItem->timerShot();}; -}; - -class KVIRC_API KviTreeTaskBarListView : public KviTalListView -{ - friend class KviTreeTaskBarItem; - Q_OBJECT - KviTreeTaskBarItem* m_pPrevItem; -public: - KviTreeTaskBarListView(QWidget * par); - ~KviTreeTaskBarListView(); -protected: - virtual void contentsMousePressEvent(QMouseEvent *e); - virtual void paintEmptyArea(QPainter * p,const QRect &rct); - virtual void resizeEvent(QResizeEvent *e); - virtual void contentsMouseMoveEvent ( QMouseEvent * e ); - virtual void leaveEvent(QEvent *); -signals: - void leftMousePress(KviTalListViewItem * it); - void rightMousePress(KviTalListViewItem * it); -public slots: - void sort(); - void reverseSort(); -}; - - -class KVIRC_API KviTreeTaskBar : public KviTaskBarBase -{ - Q_OBJECT -public: - KviTreeTaskBar(); - ~KviTreeTaskBar(); -private: - KviTreeTaskBarListView * m_pListView; - KviTreeTaskBarItem * m_pCurrentItem; - KviDynamicToolTip * m_pToolTip; -public: - virtual KviTaskBarItem * addItem(KviWindow *); - virtual bool removeItem(KviTaskBarItem *); - virtual void setActiveItem(KviTaskBarItem *); - virtual KviTaskBarItem * firstItem(); - virtual KviTaskBarItem * nextItem(void); - virtual KviTaskBarItem * lastItem(); - virtual KviTaskBarItem * prevItem(void); - virtual bool setIterationPointer(KviTaskBarItem * it); - virtual void updatePseudoTransparency(); - virtual bool eventFilter(QObject * o,QEvent *e); - virtual void updateActivityMeter(); - virtual void applyOptions(); -protected: - virtual void moveEvent(QMoveEvent *); -protected slots: - void tipRequest(KviDynamicToolTip *tip,const QPoint &pnt); -}; - - -#endif //_KVI_TASKBAR_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_texticonwin.cpp b/3.4.0/src/kvirc/ui/kvi_texticonwin.cpp deleted file mode 100644 index abd3f522b3..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_texticonwin.cpp +++ /dev/null @@ -1,283 +0,0 @@ -//============================================================================= -// -// File : kvi_texticonwin.cpp -// Creation date : Fri May 17 2002 02:35:20 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_texticonwin.h" -#include "kvi_texticonmanager.h" -#include "kvi_app.h" -#include "kvi_options.h" -#include "kvi_input.h" -#include "kvi_topicw.h" -#include "kvi_mirccntrl.h" -#include "kvi_iconmanager.h" - -#include <qnamespace.h> -#include <qlineedit.h> -#include <ctype.h> -#ifdef COMPILE_USE_QT4 - #include <qevent.h> -#endif - -KviTextIconWindow::KviTextIconWindow() -#ifdef COMPILE_USE_QT4 -: KviTalIconView(0,Qt::Popup) -#else -: KviTalIconView(0,Qt::WType_Popup) -#endif -{ - m_iTimerId = -1; - setGridX ( 40 ); - setFixedSize(KVI_TEXTICON_WIN_WIDTH,KVI_TEXTICON_WIN_HEIGHT); - m_pOwner = 0; - fill(); - connect(g_pTextIconManager,SIGNAL(changed()),this,SLOT(fill())); - connect(this,SIGNAL(doubleClicked( KviTalIconViewItem * )),this,SLOT(itemSelected(KviTalIconViewItem *))); - connect(this,SIGNAL(returnPressed ( KviTalIconViewItem * ) ),this,SLOT(itemSelected(KviTalIconViewItem *))); - m_bAltMode = false; - setWordWrapIconText(true); -} - -KviTextIconWindow::~KviTextIconWindow() -{ - if(m_iTimerId != -1) - { - killTimer(m_iTimerId); - m_iTimerId = -1; - } -// killTimers(); -// if(m_pOwner)m_pOwner->setFocus(); -} - -void KviTextIconWindow::fill() -{ - clear(); - KviPointerHashTable<QString,KviTextIcon> * d = g_pTextIconManager->textIconDict(); - KviPointerHashTableIterator<QString,KviTextIcon> it(*d); - while(KviTextIcon * i = it.current()) - { - QPixmap *pix = i->pixmap(); - if(pix)insertItem(new KviTalIconViewItem(this,it.currentKey(),*pix)); - ++it; - } - sort(); - setCurrentItem(0); -} - -void KviTextIconWindow::popup(QWidget *owner,bool bAltMode) -{ - if(m_pOwner)disconnect(m_pOwner,SIGNAL(destroyed()),this,SLOT(ownerDead())); - m_pOwner = owner; - m_szTypedSeq = ""; - m_bAltMode = bAltMode; - connect(m_pOwner,SIGNAL(destroyed()),this,SLOT(ownerDead())); - show(); -} - -bool KviTextIconWindow::findTypedSeq() -{ - int cnt = count(); - int max = 0; - KviTalIconViewItem *mit = 0; - bool bFullMax = false; - KviTalIconViewItem *item; - for ( item = (KviTalIconViewItem *)firstItem(); item; item = (KviTalIconViewItem *)item->nextItem() ) - { - QString szIt = item->text(); - int j; - for(j=0;j<((int)(szIt.length()));j++) - { - if(szIt[j].lower() != m_szTypedSeq[j].lower())break; - } - if(j < max) - { - goto got_mit; - } else { - if(j >= max) - { - bFullMax = (j == ((int)(szIt.length()))); - max = j; - mit = item; - } - } - } -got_mit: - setCurrentItem(mit); - m_szCurFullSeq = mit->text(); - return bFullMax; -} - -void KviTextIconWindow::keyPressEvent(QKeyEvent *e) -{ - switch(e->key()) - { - case Qt::Key_Up: - case Qt::Key_Down: - case Qt::Key_Left: - case Qt::Key_Right: - case Qt::Key_PageUp: - case Qt::Key_PageDown: - case Qt::Key_Return: - KviTalIconView::keyPressEvent(e); - return; - break; - case Qt::Key_Escape: - doHide(); - return; - break; - case Qt::Key_Backspace: - if(!m_szTypedSeq.isEmpty()) - { - m_szTypedSeq.remove(m_szTypedSeq.length() - 1,1); - findTypedSeq(); - } else { - doHide(); - if(m_pOwner)g_pApp->sendEvent(m_pOwner,e); - } - return; - break; - case Qt::Key_Space: - doHide(); - if(findTypedSeq()) - { - QString szItem = m_szTypedSeq; - szItem.append(' '); - if(m_pOwner) - { - if(m_pOwner->inherits("KviInputEditor")) - ((KviInputEditor *)m_pOwner)->insertText(szItem); - else if(m_pOwner->inherits("KviInput")) - ((KviInput *)m_pOwner)->insertText(szItem); - else if(m_pOwner->inherits("QLineEdit")) - { - QString tmp = ((QLineEdit *)m_pOwner)->text(); - tmp.insert(((QLineEdit *)m_pOwner)->cursorPosition(),szItem); - ((QLineEdit *)m_pOwner)->setText(tmp); - ((QLineEdit *)m_pOwner)->setCursorPosition(((QLineEdit *)m_pOwner)->cursorPosition() + szItem.length()); - } - } - } else { - if(m_pOwner)g_pApp->sendEvent(m_pOwner,e); - } - return; - break; - case Qt::Key_Tab: - doHide(); - findTypedSeq(); - QString szItem = m_szCurFullSeq; - szItem.append(' '); - if(m_bAltMode)szItem.prepend(KVI_TEXT_ICON); - if(m_pOwner->inherits("KviInputEditor")) - ((KviInputEditor *)m_pOwner)->insertText(szItem); - else if(m_pOwner->inherits("KviInput")) - ((KviInput *)m_pOwner)->insertText(szItem); - else if(m_pOwner->inherits("QLineEdit")) - { - QString tmp = ((QLineEdit *)m_pOwner)->text(); - tmp.insert(((QLineEdit *)m_pOwner)->cursorPosition(),szItem); - ((QLineEdit *)m_pOwner)->setText(tmp); - ((QLineEdit *)m_pOwner)->setCursorPosition(((QLineEdit *)m_pOwner)->cursorPosition() + szItem.length()); - } - return; - break; - } - - int as = e->ascii(); - if((as >= 'a' && as <= 'z') || (as >= 'A' && as <= 'Z') || (as >= '0' && as <= '9') - || (as == '?') || (as == '$') || (as == '.') || (as == ',') || (as == '!') || (as =='&')) - { - m_szTypedSeq.append((char)as); - findTypedSeq(); - } else { - if(m_pOwner)g_pApp->sendEvent(m_pOwner,e); - } -} - -void KviTextIconWindow::ownerDead() -{ - m_pOwner = 0; - doHide(); -} - -void KviTextIconWindow::show() -{ - m_iTimerId = startTimer(50000); //50 sec ...seems enough - QWidget::show(); -} - -void KviTextIconWindow::timerEvent(QTimerEvent *) -{ - doHide(); -} - -void KviTextIconWindow::doHide() -{ - if(m_iTimerId != -1) - { - killTimer(m_iTimerId); - m_iTimerId = -1; - } - hide(); - if(m_pOwner)m_pOwner->setFocus(); -} - -void KviTextIconWindow::itemSelected(KviTalIconViewItem * item) -{ - if(item) - { -// debug("%i %i %i %s",m_pOwner->inherits("KviInputEditor"),m_pOwner->inherits("KviInput"),m_pOwner->inherits("QLineEdit"),m_pOwner->className()); - doHide(); - QString szItem = item->text(); - szItem.append(' '); - if(m_bAltMode)szItem.prepend(KVI_TEXT_ICON); - if(m_pOwner->inherits("KviInputEditor")) - ((KviInputEditor *)m_pOwner)->insertText(szItem); - else if(m_pOwner->inherits("KviInput")) - ((KviInput *)m_pOwner)->insertText(szItem); - else if(m_pOwner->inherits("QLineEdit")) - { - QString tmp = ((QLineEdit *)m_pOwner)->text(); - tmp.insert(((QLineEdit *)m_pOwner)->cursorPosition(),szItem); - ((QLineEdit *)m_pOwner)->setText(tmp); - ((QLineEdit *)m_pOwner)->setCursorPosition(((QLineEdit *)m_pOwner)->cursorPosition() + szItem.length()); - } - } -} - -void KviTextIconWindow::mousePressEvent(QMouseEvent *e) -{ - if(e->pos().x() < 0)goto hideme; - if(e->pos().x() > width())goto hideme; - if(e->pos().y() < 0)goto hideme; - if(e->pos().y() > height())goto hideme; - - KviTalIconView::mousePressEvent(e); - return; - -hideme: - doHide(); -} - - -#include "kvi_texticonwin.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_texticonwin.h b/3.4.0/src/kvirc/ui/kvi_texticonwin.h deleted file mode 100644 index 541125ff28..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_texticonwin.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef _KVI_TEXTICONWIN_H_ -#define _KVI_TEXTICONWIN_H_ -//============================================================================= -// -// File : kvi_texticonwin.h -// Creation date : Fri May 17 2002 02:33:45 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" -#include "kvi_string.h" - -#include "kvi_tal_iconview.h" - - -#define KVI_TEXTICON_WIN_WIDTH 230 -#define KVI_TEXTICON_WIN_HEIGHT 200 - -class KVIRC_API KviTextIconWindow : public KviTalIconView -{ - Q_OBJECT -public: - KviTextIconWindow(); - ~KviTextIconWindow(); -private: - QWidget * m_pOwner; - QString m_szTypedSeq; - QString m_szCurFullSeq; - bool m_bAltMode; // in alt mode the itemSelected() string contains - // also the CTRL+I escape code - int m_iTimerId; -public: - void popup(QWidget *owner,bool bAltMode = false); -private: - void doHide(); - virtual void show(); - bool findTypedSeq(); // returns true if it is a complete word - virtual void keyPressEvent(QKeyEvent *e); - virtual void mousePressEvent(QMouseEvent *); - virtual void timerEvent(QTimerEvent *); -public slots: - void fill(); - void ownerDead(); - void itemSelected(KviTalIconViewItem * item); -}; - -#endif //_KVI_TEXTICONWIN_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_themedlabel.cpp b/3.4.0/src/kvirc/ui/kvi_themedlabel.cpp deleted file mode 100644 index 3e224800e2..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_themedlabel.cpp +++ /dev/null @@ -1,154 +0,0 @@ -// -// File : kvi_themedlabel.cpp -// Creation date : Tue Aug 29 2000 21:17:01 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#include "kvi_themedlabel.h" - -#include "kvi_options.h" -#include "kvi_settings.h" -#include "kvi_app.h" -#include "kvi_window.h" -#include <qpainter.h> - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - extern QPixmap * g_pShadedChildGlobalDesktopBackground; -#endif - -KviThemedLabel::KviThemedLabel(QWidget * par,const char * name) -: QFrame(par,name) -{ - setFrameStyle(QFrame::Sunken | QFrame::StyledPanel); - applyOptions(); - m_bAutoHeight=0; -} - -KviThemedLabel::~KviThemedLabel() -{ -} - -/*QSize KviThemedLabel::sizeHint() -{ - QSize size=QFrame::sizeHint(); - int iHeight=fontMetrics().height()*QStringList::split('\n',m_szText).count()+4; - size.setHeight(iHeight); - return size; -}*/ - -void KviThemedLabel::setText(const char * text) -{ - m_szText = QString(text); - if(m_bAutoHeight) - { - int iHeight=fontMetrics().height()*QStringList::split('\n',m_szText).count()+4; - setMinimumHeight(iHeight); - //g_pApp->postEvent(parent(),new QEvent(QEvent::Resize)); - } - update(); -} - -void KviThemedLabel::setText(const QString& text) -{ - m_szText = text; - if(m_bAutoHeight) - { - int iHeight=fontMetrics().height()*QStringList::split('\n',m_szText).count()+4; - setMinimumHeight(iHeight); - //g_pApp->postEvent(parent(),new QEvent(QEvent::Resize)); - } - update(); -} - -void KviThemedLabel::applyOptions() -{ - setFont(KVI_OPTION_FONT(KviOption_fontLabel)); - update(); -} - -#ifdef COMPILE_USE_QT4 -void KviThemedLabel::paintEvent ( QPaintEvent * event ) -{ - QFrame::paintEvent(event); - QPainter p(this); - SET_ANTI_ALIASING(p); -#ifdef COMPILE_PSEUDO_TRANSPARENCY - if(g_pShadedChildGlobalDesktopBackground) - { - QPoint pnt = mapToGlobal(contentsRect().topLeft()); - p.drawTiledPixmap(contentsRect(),*g_pShadedChildGlobalDesktopBackground,pnt); - } else { -#endif - - if(KVI_OPTION_PIXMAP(KviOption_pixmapLabelBackground).pixmap()) - { - p.drawTiledPixmap(contentsRect(),*(KVI_OPTION_PIXMAP(KviOption_pixmapLabelBackground).pixmap())); - } else { - p.fillRect(contentsRect(),KVI_OPTION_COLOR(KviOption_colorLabelBackground)); - } - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - } -#endif - - QRect r = contentsRect(); - r.setLeft(r.left() + 2); // some margin - - p.setPen(KVI_OPTION_COLOR(KviOption_colorLabelForeground)); - - p.drawText(r,Qt::AlignLeft | Qt::AlignVCenter,m_szText); -} -#else -void KviThemedLabel::drawContents(QPainter *p) -{ -#ifdef COMPILE_PSEUDO_TRANSPARENCY - if(g_pShadedChildGlobalDesktopBackground) - { - QPoint pnt = mapToGlobal(contentsRect().topLeft()); - p->drawTiledPixmap(contentsRect(),*g_pShadedChildGlobalDesktopBackground,pnt); - } else { -#endif - - if(KVI_OPTION_PIXMAP(KviOption_pixmapLabelBackground).pixmap()) - { - p->drawTiledPixmap(contentsRect(),*(KVI_OPTION_PIXMAP(KviOption_pixmapLabelBackground).pixmap())); - } else { - p->fillRect(contentsRect(),KVI_OPTION_COLOR(KviOption_colorLabelBackground)); - } - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - } -#endif - - QRect r = contentsRect(); - r.setLeft(r.left() + 2); // some margin - - p->setPen(KVI_OPTION_COLOR(KviOption_colorLabelForeground)); - - p->drawText(r,Qt::AlignLeft | Qt::AlignVCenter,m_szText); -} -#endif - -void KviThemedLabel::mouseDoubleClickEvent(QMouseEvent *) -{ - emit doubleClicked(); -} - - -#include "kvi_themedlabel.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_themedlabel.h b/3.4.0/src/kvirc/ui/kvi_themedlabel.h deleted file mode 100644 index 526c924168..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_themedlabel.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef _KVI_THEMEDLABEL_H_ -#define _KVI_THEMEDLABEL_H_ - -// -// File : kvi_themedlabel.h -// Creation date : Tue Aug 29 2000 21:12:12 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qframe.h> - -#include "kvi_string.h" - -class KVIRC_API KviThemedLabel : public QFrame -{ - Q_OBJECT - Q_PROPERTY(int TransparencyCapable READ dummyRead) -public: - KviThemedLabel(QWidget * par,const char * name); - ~KviThemedLabel(); -private: - QString m_szText; - bool m_bAutoHeight; -protected: -#ifdef COMPILE_USE_QT4 - virtual void paintEvent ( QPaintEvent * event ); -#else - virtual void drawContents(QPainter *p); -#endif - virtual void mouseDoubleClickEvent(QMouseEvent *e); -public: - int dummyRead() const { return 0; }; - void setText(const char * text); - void setText(const QString& text); - QString text() { return m_szText; }; - void setAutoHeight(bool value) { m_bAutoHeight=value; }; - void applyOptions(); - -// QSize sizeHint(); -signals: - void doubleClicked(); -}; - -#endif //_KVI_THEMEDLABEL_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_toolbar.cpp b/3.4.0/src/kvirc/ui/kvi_toolbar.cpp deleted file mode 100644 index fda5bdff34..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_toolbar.cpp +++ /dev/null @@ -1,160 +0,0 @@ -//============================================================================= -// -// File : kvi_toolbar.cpp -// Creation date : Tue Sep 17 02:00:17 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_toolbar.h" -#include "kvi_frame.h" -#include "kvi_locale.h" -#include "kvi_app.h" - -#include <qcursor.h> -#include "kvi_tal_popupmenu.h" - -#ifdef COMPILE_USE_QT4 - #include <qevent.h> -#endif - -static KviTalPopupMenu * g_pToolBarContextPopup = 0; -static KviTalPopupMenu * g_pToolBarWindowsPopup = 0; -static KviTalPopupMenu * g_pToolBarIconSizesPopup = 0; -static KviTalPopupMenu * g_pToolBarPositionsPopup = 0; - - -KviToolBar::KviToolBar(const QString &label,QT_TOOLBARDOCK_TYPE dock,bool bNewLine,const char * nam) -: KviTalToolBar(label,g_pFrame,dock,bNewLine,nam) -{ -} - -KviToolBar::~KviToolBar() -{ - if(g_pToolBarContextPopup)delete g_pToolBarContextPopup; - if(g_pToolBarIconSizesPopup)delete g_pToolBarIconSizesPopup; - if(g_pToolBarPositionsPopup)delete g_pToolBarPositionsPopup; - if(g_pToolBarWindowsPopup)delete g_pToolBarWindowsPopup; - - g_pToolBarContextPopup = 0; - g_pToolBarIconSizesPopup = 0; - g_pToolBarPositionsPopup = 0; - g_pToolBarWindowsPopup = 0; -} - -void KviToolBar::mousePressEvent(QMouseEvent *e) -{ - if(!(e->button() & Qt::RightButton)) - { - KviTalToolBar::mousePressEvent(e); - return; - } - - if(!g_pToolBarContextPopup)g_pToolBarContextPopup = new KviTalPopupMenu(); - if(!g_pToolBarIconSizesPopup)g_pToolBarIconSizesPopup = new KviTalPopupMenu(); - if(!g_pToolBarPositionsPopup)g_pToolBarPositionsPopup = new KviTalPopupMenu(); - if(!g_pToolBarWindowsPopup)g_pToolBarWindowsPopup = new KviTalPopupMenu(); - - g_pToolBarContextPopup->clear(); - g_pToolBarIconSizesPopup->clear(); - g_pToolBarPositionsPopup->clear(); - g_pToolBarWindowsPopup->clear(); - - g_pFrame->fillToolBarsPopup(g_pToolBarWindowsPopup); - g_pToolBarContextPopup->insertItem(__tr2qs("Toolbars"),g_pToolBarWindowsPopup); - - g_pToolBarContextPopup->insertItem(__tr2qs("Orientation"),g_pToolBarPositionsPopup); - - g_pToolBarPositionsPopup->insertItem(__tr2qs("Top"),this,SLOT(moveToTop())); - g_pToolBarPositionsPopup->insertItem(__tr2qs("Left"),this,SLOT(moveToLeft())); - g_pToolBarPositionsPopup->insertItem(__tr2qs("Right"),this,SLOT(moveToRight())); - g_pToolBarPositionsPopup->insertItem(__tr2qs("Bottom"),this,SLOT(moveToBottom())); - g_pToolBarPositionsPopup->insertSeparator(); - g_pToolBarPositionsPopup->insertItem(__tr2qs("Detached"),this,SLOT(moveToTornOff())); - g_pToolBarPositionsPopup->insertItem(__tr2qs("Flat"),this,SLOT(moveToMinimized())); - - g_pToolBarContextPopup->insertItem(__tr2qs("Icon Size"),g_pToolBarIconSizesPopup); - - g_pToolBarIconSizesPopup->insertItem(__tr2qs("Small (22x22)"),this,SLOT(setSmallIcons())); - g_pToolBarIconSizesPopup->insertItem(__tr2qs("Large (32x32)"),this,SLOT(setBigIcons())); - - g_pToolBarContextPopup->popup(QCursor::pos()); -} - -void KviToolBar::moveTo(QT_TOOLBARDOCK_TYPE dock) -{ - // FIXME: this should be hidden in Tal -#ifdef COMPILE_USE_QT4 - g_pFrame->removeToolBar(this); - g_pFrame->addToolBar(dock,this); -#else //!COMPILE_USE_QT4 -#if QT_VERSION >= 300 - g_pFrame->moveDockWindow(this,dock); -#else - g_pFrame->moveToolBar(this,dock); -#endif -#endif //!COMPILE_USE_QT4 -} - -void KviToolBar::moveToTop() -{ - moveTo(QT_DOCK_TOP); -} - -void KviToolBar::moveToLeft() -{ - moveTo(QT_DOCK_LEFT); -} - -void KviToolBar::moveToRight() -{ - moveTo(QT_DOCK_RIGHT); -} - -void KviToolBar::moveToBottom() -{ - moveTo(QT_DOCK_BOTTOM); -} - -void KviToolBar::moveToMinimized() -{ - moveTo(QT_DOCK_MINIMIZED); -} - -void KviToolBar::moveToTornOff() -{ - moveTo(QT_DOCK_TORNOFF); -} - -void KviToolBar::setBigIcons() -{ - g_pFrame->setUsesBigPixmaps(true); -} - -void KviToolBar::setSmallIcons() -{ - g_pFrame->setUsesBigPixmaps(false); -} - - - - -#include "kvi_toolbar.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_toolbar.h b/3.4.0/src/kvirc/ui/kvi_toolbar.h deleted file mode 100644 index f4c94db387..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_toolbar.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef _KVI_TOOLBAR_H_ -#define _KVI_TOOLBAR_H_ -//============================================================================= -// -// File : kvi_toolbar.h -// Creation date : Tue Sep 17 02:00:16 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2002-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_tal_toolbar.h" - -class KviFrame; - -class KVIRC_API KviToolBar : public KviTalToolBar -{ - Q_OBJECT -public: - KviToolBar(const QString &label,QT_TOOLBARDOCK_TYPE dock = QT_DOCK_TOP,bool bNewLine = false,const char * nam = 0); - ~KviToolBar(); -protected: - virtual void mousePressEvent(QMouseEvent *e); - void moveTo(QT_TOOLBARDOCK_TYPE dock); -public slots: - void moveToTop(); - void moveToLeft(); - void moveToRight(); - void moveToBottom(); - void moveToMinimized(); - void moveToTornOff(); - void setBigIcons(); - void setSmallIcons(); -}; - - -#endif //_KVI_TOOLBAR_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_toolwindows_container.cpp b/3.4.0/src/kvirc/ui/kvi_toolwindows_container.cpp deleted file mode 100644 index 270a7063a7..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_toolwindows_container.cpp +++ /dev/null @@ -1,140 +0,0 @@ -#define __KVIRC__ - - -#include <qlayout.h> -#include <qtoolbutton.h> -#include <qobjectcleanuphandler.h> -#include <qpushbutton.h> -#include "kvi_tal_vbox.h" -#include <qpainter.h> -#include <qapplication.h> - -#include "kvi_toolwindows_container.h" -#include "kvi_iconmanager.h" - - -KviWindowToolWidget::KviWindowToolWidget(QWidget * parent, KviWindowToolPageButton* button/*, const char * name, WFlags f*/ ) -:QWidget(parent/*,name,f*/) -{ -// m_pContainer=parent; - m_pButton=button; - m_bAutoDelete=1; - m_bHidden=0; - if(m_pButton) m_pButton->setOn(!isHidden()); -// m_ObjectHandler.add(button); -// setMinimumWidth(0); -} - -KviWindowToolWidget::~KviWindowToolWidget() -{ -// unregisterSelf(); -// m_ObjectHandler.remove(m_pButton); - -} - -void KviWindowToolWidget::registerSelf() -{ -/* m_pContainer->registerWidget(this); - if(!m_ObjectHandler.isEmpty()) - { - if(m_pButton) - m_pButton->setOn(true); - } else { - m_pButton=0; - }*/ -} - -void KviWindowToolWidget::unregisterSelf() -{ -/* if(!m_bHidden) - m_pContainer->unregisterWidget(this); - if(!m_ObjectHandler.isEmpty()) - { - if(m_pButton) - m_pButton->setOn(false); - } else { - m_pButton=0; - }*/ -} - -/*void KviWindowToolWidget::hide() -{ - if(m_bAutoDelete==0) - { - unregisterSelf(); - m_bHidden=1; - } - QWidget::hide(); -}*/ - -/*void KviWindowToolWidget::show() -{ - if(m_bHidden) - { - registerSelf(); - } - QWidget::show(); - m_bHidden=0; -}*/ - -KviWindowToolPageButton::KviWindowToolPageButton ( int pixon,int pixoff, const QString & text, QWidget * parent,bool bOn, const char * name ) -:TOOL_PAGE_PARENT(parent) -{ -#ifdef COMPILE_USE_QT4 - setFlat(true); - setObjectName("kvi_window_tool_button"); - setIcon(QIcon(*(g_pIconManager->getSmallIcon(pixon)))); -#else - QIconSet is1; - is1.setPixmap(*(g_pIconManager->getSmallIcon(pixon)),QIconSet::Small,QIconSet::Normal,QIconSet::On); - is1.setPixmap(*(g_pIconManager->getSmallIcon(pixoff)),QIconSet::Small,QIconSet::Normal,QIconSet::Off); - setIconSet(is1); - setUsesBigPixmap(false); -#endif - setToggleButton(true); - setOn(bOn); - -// setSizePolicy(QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Ignored)); -} - -KviWindowToolPageButton::~KviWindowToolPageButton() -{ - -} - -/*void KviWindowToolPageButton::drawButton ( QPainter * p) -{ - QPixmap pixmap( height(), width() ); - if(isOn()) - pixmap.fill(colorGroup().mid()); - else - pixmap.fill(colorGroup().button()); - QPainter painter( &pixmap ); - - QPixmap icon; - if(isOn()) - icon=iconSet()->pixmap(QIconSet::Small,QIconSet::Normal,QIconSet::On); - else - icon=iconSet()->pixmap(QIconSet::Small,QIconSet::Normal,QIconSet::Off); - - // Draw the frame - //painter.setPen( colorGroup().mid() ); - //if ( m_id != NUM_TABS - 1 ) painter.drawLine( 0, 0, 0, pixmap.height() - 1 ); - //painter.drawLine( 0, pixmap.height() - 1, pixmap.width() - 1, pixmap.height() - 1 ); - - // Draw the text - QFont font; - QString str = text(); - str.remove("&"); - const int textX = pixmap.width() / 2 - QFontMetrics( font ).width( str ) / 2; - painter.setPen( colorGroup().buttonText() ); - const QRect rect( textX + icon.width() / 2 + 2, 0, pixmap.width(), pixmap.height() ); - painter.drawText( rect, Qt::AlignLeft | Qt::AlignVCenter, str ); - - // Draw the icon - painter.drawPixmap( textX - icon.width() / 2 - 2, pixmap.height() / 2 - icon.height() / 2, icon ); - - // Paint to widget - p->rotate( -90 ); - p->drawPixmap( 1 - pixmap.width(), 0, pixmap ); -}*/ diff --git a/3.4.0/src/kvirc/ui/kvi_toolwindows_container.h b/3.4.0/src/kvirc/ui/kvi_toolwindows_container.h deleted file mode 100644 index ec131d9b3c..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_toolwindows_container.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef _KVI_TOOLWINDOWS_CONTAINER_H_ -#define _KVI_TOOLWINDOWS_CONTAINER_H_ - -#include "kvi_tal_widgetstack.h" -#include "kvi_tal_vbox.h" - -#include <qtoolbutton.h> -#include <qobjectcleanuphandler.h> -#include <qpushbutton.h> - -#include "kvi_heapobject.h" -#include "kvi_styled_controls.h" - -class KviWindowToolWidget; -class KviWindowToolPageButton; - -// FIXME: these classes are probably useless now... no ? - -// Pragma: KviWindowToolPageButton is actually used in kvi_window.h and others (need to fix the name and move -// it to its own file. - - - -class KVIRC_API KviWindowToolWidget : public QWidget -{ - Q_OBJECT -public: - KviWindowToolWidget( QWidget * parent,KviWindowToolPageButton* button/*, const char * name = 0, WFlags f = 0 */); - ~KviWindowToolWidget(); - - void setAutoDelete(bool b) { m_bAutoDelete=b; }; - bool autoDelete() { return m_bAutoDelete; }; - - virtual void registerSelf(); - virtual void unregisterSelf(); -/*public slots: - virtual void hide (); - virtual void show ();*/ -protected: -// KviToolWindowsContainer *m_pContainer; - KviWindowToolPageButton *m_pButton; - bool m_bAutoDelete; - bool m_bHidden; -// QObjectCleanupHandler m_ObjectHandler; - -}; - -#ifdef COMPILE_USE_QT4 - #define TOOL_PAGE_PARENT QPushButton -#else - #define TOOL_PAGE_PARENT KviStyledToolButton -#endif - - -class KVIRC_API KviWindowToolPageButton : public TOOL_PAGE_PARENT -{ - Q_OBJECT -public: - KviWindowToolPageButton ( int pixon,int pixoff, const QString & text, QWidget * parent,bool bOn=0,const char * name = 0 ); - ~KviWindowToolPageButton(); -/*protected: - virtual void drawButton ( QPainter * painter);*/ -}; - -#endif //_KVI_TOOLWINDOWS_CONTAINER_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_topicw.cpp b/3.4.0/src/kvirc/ui/kvi_topicw.cpp deleted file mode 100644 index 950324019a..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_topicw.cpp +++ /dev/null @@ -1,834 +0,0 @@ -//============================================================================= -// -// File : kvi_topicw.cpp -// Creation date : Fri Aug 4 2000 12:09:21 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2005 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ - -#include "kvi_topicw.h" -#include "kvi_options.h" -#include "kvi_mirccntrl.h" -#include "kvi_locale.h" -#include "kvi_defaults.h" -#include "kvi_settings.h" -#include "kvi_iconmanager.h" -#include "kvi_texticonmanager.h" -#include "kvi_app.h" -#include "kvi_colorwin.h" -#include "kvi_texticonwin.h" -#include "kvi_window.h" -#include "kvi_channel.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionserverinfo.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_mirccntrl.h" - -extern KviTextIconWindow * g_pTextIconWindow; -extern KviColorWindow * g_pColorWindow; -static int g_iInputFontCharWidth[256]; - -#include <qpainter.h> -#include <qfontmetrics.h> -#include "kvi_tal_tooltip.h" -#include <qlineedit.h> -#include "kvi_tal_listbox.h" -#include <qregexp.h> -#include <qclipboard.h> -#include "kvi_tal_popupmenu.h" -#include <qevent.h> - -// FIXME: #warning "The combo should disappear when it looses focus!...(how to do it ?)" - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - extern QPixmap * g_pShadedChildGlobalDesktopBackground; - -#endif - - -extern QStringList * g_pRecentTopicList; - -int KviListBoxTopicItem::width ( const KviTalListBox * lb ) const -{ - QFontMetrics fm(lb->font()); - return fm.width(KviMircCntrl::stripControlBytes(text())); -} - -void KviListBoxTopicItem::paint ( QPainter * p ) -{ - KviTopicWidget::paintColoredText(p,text(),listBox()->colorGroup(),height(listBox())); -} - - -KviTopicWidget::KviTopicWidget(QWidget * par,const char * name) -: QFrame(par,name) -{ - setFrameStyle(QFrame::Sunken | QFrame::StyledPanel); - setFont(KVI_OPTION_FONT(KviOption_fontLabel)); - m_pHistory = 0; - m_pAccept = 0; - m_pDiscard = 0; - m_pContextPopup = 0; - m_iCursorPosition = 0; - m_pInput = 0; -#ifdef COMPILE_USE_QT4 - setAutoFillBackground(false); -#else - setBackgroundMode(QWidget::NoBackground); -#endif - reset(); -#ifdef COMPILE_USE_QT4 - m_pCompletionBox=new KviTalListBox(this,Qt::Popup); -#else - m_pCompletionBox=new KviTalListBox(this,Qt::WType_Popup); -#endif - m_pCompletionBox->setFont( font() ); - m_pCompletionBox->setPalette( palette() ); -// m_pCompletionBox->setVScrollBarMode( KviTalListBox::AlwaysOff ); -// m_pCompletionBox->setHScrollBarMode( KviTalListBox::AlwaysOff ); - m_pCompletionBox->setFrameStyle( QFrame::Box | QFrame::Plain ); - m_pCompletionBox->setLineWidth( 1 ); - connect(m_pCompletionBox,SIGNAL(selected(int)),this,SLOT(complete(int))); - m_pCompletionBox->hide(); -} - -KviTopicWidget::~KviTopicWidget() -{ - delete m_pCompletionBox; -} - -void KviTopicWidget::popDownListBox() -{ - m_pCompletionBox->removeEventFilter( this ); - m_pCompletionBox->hide(); -} - -void KviTopicWidget::reset() -{ - KviTalToolTip::remove(this); - m_szTopic = __tr2qs("Unknown"); - KviTalToolTip::add(this,__tr2qs("No topic message has been received from the server yet")); - m_szSetAt = ""; - m_szSetBy = ""; - update(); -} - -void KviTopicWidget::applyOptions() -{ -// setFont(KVI_OPTION_FONT(KviOption_fontLabel)); -// if(m_pComboBox)m_pComboBox->setFont(KVI_OPTION_FONT(KviOption_fontLabel)); - resizeEvent(0); -} - -#define KVI_LABEL_DEF_BACK 100 -#define KVI_LABEL_DEF_FORE 101 - -QString convertToHtml(const QString &text) -{ - QString result; - bool curBold = false; - bool curUnderline = false; - unsigned char curFore = KVI_LABEL_DEF_FORE; //default fore - unsigned char curBack = KVI_LABEL_DEF_BACK; //default back - - unsigned int idx = 0; - - while(idx < text.length()) - { - unsigned short c = text[(int)idx].unicode(); - - unsigned int start = idx; - - while( - (c != KVI_TEXT_COLOR) && - (c != KVI_TEXT_BOLD) && - (c != KVI_TEXT_UNDERLINE) && - (c != KVI_TEXT_REVERSE) && - (c != KVI_TEXT_RESET) && - (c != KVI_TEXT_ICON) - ) - { - idx++; - if(idx >= text.length())break; - else c = text[(int)idx].unicode(); - } - - int len = idx - start; - - if(len > 0) - { - bool bOpened = FALSE; - QString szText = text.mid(start,len); - - if(curBold) result.append("<b>"); - if(curUnderline) result.append("<u>"); - - if(curFore != KVI_LABEL_DEF_FORE) - { - result.append("<font color=\""); - result.append(KVI_OPTION_MIRCCOLOR(curFore).name()); - result.append('"'); - bOpened = TRUE; - } - -/* if(curBack != KVI_LABEL_DEF_BACK) - { - if(!bOpened) - result.append("<font bgcolor="); - else - result.append(" bgcolor="); - result.append(KVI_OPTION_MIRCCOLOR(curBack).name()); - }*/ - - if(bOpened) result.append(">"); - - result.append(text.mid(start,len)); - - if( (curFore != KVI_LABEL_DEF_FORE) /*|| (curBack != KVI_LABEL_DEF_BACK)*/ ) - result.append("</font>"); - - if(curUnderline) result.append("</u>"); - if(curBold) result.append("</b>"); - - } - - switch(c) - { - case KVI_TEXT_BOLD: curBold = !curBold; ++idx; break; - case KVI_TEXT_UNDERLINE: curUnderline = !curUnderline; ++idx; break; - case KVI_TEXT_REVERSE: - { - char auxBack = curBack; - curBack = curFore; - curFore = auxBack; - } - ++idx; - break; - case KVI_TEXT_RESET: - curFore = KVI_LABEL_DEF_FORE; - curBack = KVI_LABEL_DEF_BACK; - curBold = false; - curUnderline = false; - ++idx; - break; - case KVI_TEXT_COLOR: - { - ++idx; - unsigned char fore; - unsigned char back; - idx = getUnicodeColorBytes(text,idx,&fore,&back); - if(fore != KVI_NOCHANGE) - { - curFore = fore; - if(back != KVI_NOCHANGE)curBack = back; - } else { - // only a CTRL+K - curBack = KVI_LABEL_DEF_BACK; - curFore = KVI_LABEL_DEF_FORE; - } - } - break; - case KVI_TEXT_ICON: - { - ++idx; - - unsigned int icoStart = idx; - while((idx < text.length()) && (text[(int)idx].unicode() > 32))idx++; - - KviStr lookupString = text.mid(icoStart,idx - icoStart); - - KviTextIcon * icon = g_pTextIconManager->lookupTextIcon(lookupString.ptr()); - if(icon) - { - //TODO: icons -/* QPixmap * pigzmap = icon->pixmap(); - p->drawPixmap(curX,(baseline + 2) - pigzmap->height(),*(pigzmap)); - curX += pigzmap->width();*/ - } else { - idx = icoStart; - } - } - break; - } - } - return result; -} - -void KviTopicWidget::paintColoredText(QPainter *p, QString text,const QColorGroup& cg,int height, int width) -{ - QFontMetrics fm(p->font()); - - if(height<0) height=p->window().height(); - if(width<0) width=p->window().width(); - - bool curBold = false; - bool curUnderline = false; - unsigned char curFore = KVI_LABEL_DEF_FORE; //default fore - unsigned char curBack = KVI_LABEL_DEF_BACK; //default back - int baseline = ((height + fm.ascent() - fm.descent() + 1) >> 1); - - int curX = p->window().x() + 2; //2 is the margin - - unsigned int idx = 0; - - while((idx < text.length()) && (curX < width)) - { - unsigned short c = text[(int)idx].unicode(); - - unsigned int start = idx; - - while((idx < text.length()) && - (c != KVI_TEXT_COLOR) && - (c != KVI_TEXT_BOLD) && - (c != KVI_TEXT_UNDERLINE) && - (c != KVI_TEXT_REVERSE) && - (c != KVI_TEXT_RESET) && - (c != KVI_TEXT_ICON) - ) - { - idx++; - c = text[(int)idx].unicode(); - } - - int len = idx - start; - int wdth; - - if(len > 0) - { - QString szText = text.mid(start,len); - - wdth = fm.width(szText); - - if(curFore == KVI_LABEL_DEF_FORE) - { - p->setPen(cg.text()); - } else { - if(curFore > 16)p->setPen(cg.background()); - else p->setPen(KVI_OPTION_MIRCCOLOR(curFore)); - } - - if(curBack != KVI_LABEL_DEF_BACK) - { - if(curBack > 16) - { - p->fillRect(curX,p->window().y() + 2,wdth,height - 4, - cg.text()); - } else { - p->fillRect(curX,p->window().y() + 2,wdth,height - 4, - KVI_OPTION_MIRCCOLOR(curBack)); - } - } - - p->drawText(curX,baseline,szText,0,len); - - if(curBold)p->drawText(curX+1,baseline,szText,0,len); - if(curUnderline) - { - p->drawLine(curX,baseline + 1,curX+wdth,baseline + 1); - } - } else { - wdth = 0; - } - - - curX += wdth; - - switch(c) - { - case KVI_TEXT_BOLD: curBold = !curBold; ++idx; break; - case KVI_TEXT_UNDERLINE: curUnderline = !curUnderline; ++idx; break; - case KVI_TEXT_REVERSE: - { - char auxBack = curBack; - curBack = curFore; - curFore = auxBack; - } - ++idx; - break; - case KVI_TEXT_RESET: - curFore = KVI_LABEL_DEF_FORE; - curBack = KVI_LABEL_DEF_BACK; - curBold = false; - curUnderline = false; - ++idx; - break; - case KVI_TEXT_COLOR: - { - ++idx; - unsigned char fore; - unsigned char back; - idx = getUnicodeColorBytes(text,idx,&fore,&back); - if(fore != KVI_NOCHANGE) - { - curFore = fore; - if(back != KVI_NOCHANGE)curBack = back; - } else { - // only a CTRL+K - curBack = KVI_LABEL_DEF_BACK; - curFore = KVI_LABEL_DEF_FORE; - } - } - break; - case KVI_TEXT_ICON: - { - ++idx; - - unsigned int icoStart = idx; - while((idx < text.length()) && (text[(int)idx].unicode() > 32))idx++; - - KviStr lookupString = text.mid(icoStart,idx - icoStart); - - KviTextIcon * icon = g_pTextIconManager->lookupTextIcon(lookupString.ptr()); - if(icon) - { - QPixmap * pigzmap = icon->pixmap(); - p->drawPixmap(curX,(baseline + 2) - pigzmap->height(),*(pigzmap)); - curX += pigzmap->width(); - } else { - idx = icoStart; - } - } - break; - } - } -} - -#ifdef COMPILE_USE_QT4 -void KviTopicWidget::paintEvent(QPaintEvent * e) -{ - QPainter pa(this); - drawFrame(&pa); - drawContents(&pa); -} -#endif - -void KviTopicWidget::drawContents(QPainter *p) -{ -#ifdef COMPILE_PSEUDO_TRANSPARENCY - if(g_pShadedChildGlobalDesktopBackground) - { - QPoint pnt = mapToGlobal(contentsRect().topLeft()); - p->drawTiledPixmap(contentsRect(),*g_pShadedChildGlobalDesktopBackground,pnt); - } else { -#endif - if(KVI_OPTION_PIXMAP(KviOption_pixmapLabelBackground).pixmap()) - { - p->drawTiledPixmap(contentsRect(),*(KVI_OPTION_PIXMAP(KviOption_pixmapLabelBackground).pixmap())); - } else { - p->fillRect(contentsRect(),KVI_OPTION_COLOR(KviOption_colorLabelBackground)); - } -#ifdef COMPILE_PSEUDO_TRANSPARENCY - } -#endif - QColorGroup colorGroup; - //colorGroup() - colorGroup.setColor(QColorGroup::Text,KVI_OPTION_COLOR(KviOption_colorLabelForeground)); - colorGroup.setColor(QColorGroup::Background,KVI_OPTION_COLOR(KviOption_colorLabelBackground)); - paintColoredText(p,m_szTopic,colorGroup); -} - -void KviTopicWidget::setTopic(const QString & topic) -{ - m_szTopic = topic; - bool bFound = false; - for(QStringList::Iterator it=g_pRecentTopicList->begin();it != g_pRecentTopicList->end(); ++it) - { - if(*it == m_szTopic) - { - bFound = true; - break; - } - } - if(!bFound && (!m_szTopic.isEmpty())) - { - if(g_pRecentTopicList->count() >= KVI_RECENT_TOPIC_ENTRIES) - { - g_pRecentTopicList->remove(g_pRecentTopicList->begin()); - } - g_pRecentTopicList->append(m_szTopic); - } - updateToolTip(); - update(); -} - -void KviTopicWidget::setTopicSetBy(const QString & setBy) -{ - m_szSetBy = setBy; - updateToolTip(); -} - -void KviTopicWidget::setTopicSetAt(const QString & setAt) -{ - m_szSetAt = setAt; - updateToolTip(); -} - -void KviTopicWidget::updateToolTip() -{ - KviTalToolTip::remove(this); - - QString txt = "<html>" \ - "<body>" \ - "<table width=\"100%\">"; - - if(!m_szTopic.isEmpty()) - { - txt += START_TABLE_BOLD_ROW; - txt += __tr2qs("Channel topic:"); - txt += END_TABLE_BOLD_ROW; - - txt += "<tr><td><center>"; - - QString tmp = m_szTopic; - - tmp.replace('&',"&"); - tmp.replace('<',"<"); - tmp.replace('>',">"); - tmp = convertToHtml(tmp); - - txt += tmp; - txt += "</center></td></tr>"; - - if(!m_szSetBy.isEmpty()) - { - txt += "<tr><td bgcolor=\"#D0D0D0\">"; - txt += __tr2qs("Set by") + " <b>" + m_szSetBy + "</b>"; - txt += "</td></tr>"; - - if(!m_szSetAt.isEmpty()) - { - txt += "<tr><td bgcolor=\"#D0D0D0\">"; - txt += __tr2qs("Set on") + " <b>" + m_szSetAt + "</b>"; - txt += "</td></tr>"; - } - } - - txt += "<tr><td>"; - txt += __tr2qs("Double-click to edit..."); - txt += "</td></tr>"; - - } else { - txt += "<tr><td>"; - txt += __tr2qs("No topic is set"); - txt += "</td></tr>"; - txt += "<tr><td>"; - txt += __tr2qs("Double-click to set..."); - txt += "</td></tr>"; - } - - txt += "</table>" \ - "</body>" \ - "<html>"; - - KviTalToolTip::add(this,txt); -} - -QSize KviTopicWidget::sizeHint() const -{ - QFontMetrics fm(font()); - int hght = fm.lineSpacing() + (frameWidth() << 1) + 4; - int baseline = ((hght + fm.ascent() - fm.descent() + 1) >> 1); - if(baseline < 16)hght += (16 - baseline); - return QSize(width(),hght); -} - -void KviTopicWidget::mouseDoubleClickEvent(QMouseEvent *) -{ - int maxlen=-1; - QObject * w = parent(); - QString szModes; - bool bCanEdit = TRUE; - while(w) - { - if(w->inherits("KviChannel")) - { - KviChannel *chan = ((KviChannel *)w); - maxlen=chan->connection()->serverInfo()->maxTopicLen(); - chan->getChannelModeString(szModes); - if(szModes.contains('t') && !( chan->isMeHalfOp() || chan->isMeOp() || chan->isMeChanOwner() || chan->isMeChanAdmin() || chan->connection()->userInfo()->hasUserMode('o') || chan->connection()->userInfo()->hasUserMode('O')) ) { - bCanEdit=false; - } - break; - } - w = w->parent(); - } - if(m_pInput == 0) - { - m_pInput=new KviInputEditor(this,0); - m_pInput->setReadOnly(!bCanEdit); - m_pInput->setMaxBufferSize(maxlen); - m_pInput->setGeometry(0,0,width() - (height() << 2)+height(),height()); - m_pInput->setText(m_szTopic); - connect(m_pInput,SIGNAL(enterPressed()),this,SLOT(acceptClicked())); - connect(m_pInput,SIGNAL(escapePressed()),this,SLOT(discardClicked())); - m_pInput->installEventFilter(this); - - m_pHistory = new QPushButton(this); - m_pHistory->setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TIME))); - m_pHistory->setGeometry(width() - (height() << 2)+height(),0,height(),height()); - KviTalToolTip::add(m_pHistory,__tr2qs("History")); - m_pHistory->show(); - connect(m_pHistory,SIGNAL(clicked()),this,SLOT(historyClicked())); - - m_pAccept = new QPushButton(this); - m_pAccept->setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT))); - m_pAccept->setGeometry(width() - (height() << 1),0,height(),height()); - m_pAccept->setEnabled(bCanEdit); - m_pAccept->show(); - KviTalToolTip::add(m_pAccept,__tr2qs("Commit Changes")); - connect(m_pAccept,SIGNAL(clicked()),this,SLOT(acceptClicked())); - - m_pDiscard = new QPushButton(this); - m_pDiscard->setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DISCARD))); - m_pDiscard->setGeometry(width() - height(),0,height(),height()); - KviTalToolTip::add(m_pDiscard,__tr2qs("Discard Changes")); - m_pDiscard->show(); - connect(m_pDiscard,SIGNAL(clicked()),this,SLOT(discardClicked())); - - m_pInput->show(); - m_pInput->setFocus(); - } -} - -void KviTopicWidget::mousePressEvent(QMouseEvent * e) -{ - - if(!(e->button() & Qt::RightButton))return; - if(!m_pContextPopup) - { - m_pContextPopup = new KviTalPopupMenu(this); - connect(m_pContextPopup,SIGNAL(aboutToShow()),this,SLOT(contextPopupAboutToShow())); - } - m_pContextPopup->popup(mapToGlobal(e->pos())); -} - -void KviTopicWidget::contextPopupAboutToShow() -{ - if(!m_pContextPopup)return; // hm ? - m_pContextPopup->clear(); - m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_COPY)),__tr2qs("Copy to clipboard"),this,SLOT(copy())); -} - -void KviTopicWidget::copy() -{ - QClipboard * c = QApplication::clipboard(); - if(!c)return; - if(c->supportsSelection())c->setText(m_szTopic,QClipboard::Selection); - c->setText(m_szTopic,QClipboard::Clipboard); -} - -bool KviTopicWidget::eventFilter(QObject *object,QEvent *e) -{ - if ( !e ) - return TRUE; - if(object==m_pCompletionBox) - { - switch( e->type() ) { - case QEvent::MouseButtonPress: - if ( m_pCompletionBox->rect().contains( ((QMouseEvent*)e)->pos() ) ) { - complete(m_pCompletionBox->index(m_pCompletionBox->itemAt(((QMouseEvent*)e)->pos()))); - return TRUE; - } - break; - case QEvent::MouseButtonRelease: - if ( m_pCompletionBox->rect().contains( ((QMouseEvent*)e)->pos() ) ) { - QMouseEvent tmp( QEvent::MouseButtonDblClick, - ((QMouseEvent*)e)->pos(), ((QMouseEvent*)e)->button(), ((QMouseEvent*)e)->state() ) ; - // will hide popup - QApplication::sendEvent( object, &tmp ); - return TRUE; - } else { - if ( m_pCompletionBox->isVisible() ) - popDownListBox(); - } - break; - case QEvent::KeyPress: - switch( ((QKeyEvent *)e)->key() ) { - case Qt::Key_Up: - case Qt::Key_Down: - if ( !(((QKeyEvent *)e)->state() & Qt::AltButton) ) - break; - case Qt::Key_F4: - case Qt::Key_Escape: - if ( m_pCompletionBox->isVisible() ) { - popDownListBox(); - return TRUE; - } - break; - default: - break; - } - break; - case QEvent::Hide: - popDownListBox(); - break; - default: - break; - } - } - return QFrame::eventFilter(object,e); -} - -bool KviTopicWidget::handleKeyPressEvent(QKeyEvent * e) -{ - return 1; -} - -void KviTopicWidget::keyPressEvent(QKeyEvent * e) -{ - if(handleKeyPressEvent(e)) - { - e->accept(); - return; - } -} - -void KviTopicWidget::resizeEvent(QResizeEvent *e) -{ - if(e)QFrame::resizeEvent(e); - if(m_pInput) - { - m_pInput->setGeometry(0,0,width() - (height() << 2)+height(),height()); - m_pHistory->setGeometry(width() - (height() << 2)+height(),0,height(),height()); - m_pAccept->setGeometry(width() - (height() << 1),0,height(),height()); - m_pDiscard->setGeometry(width() - height(),0,height(),height()); - } -} - -void KviTopicWidget::deactivate() -{ - popDownListBox(); - if(m_pInput) - { - delete m_pInput; - m_pInput = 0; - delete m_pHistory; - m_pHistory = 0; - delete m_pAccept; - m_pAccept = 0; - delete m_pDiscard; - m_pDiscard = 0; - } - - // try to find a KviWindow parent and give it the focus - - QObject * w = parent(); - while(w) - { - if(w->inherits("KviWindow")) - { - ((KviWindow *)w)->setFocus(); - return; - } - w = w->parent(); - } - - // no KviWindow on the path - w = parent(); - if(w) - { - if(w->inherits("QWidget")) - ((QWidget *)w)->setFocus(); - } -} - -void KviTopicWidget::discardClicked() -{ - deactivate(); -} - -void KviTopicWidget::historyClicked() -{ - if(g_pRecentTopicList) - { - m_pCompletionBox->installEventFilter( this ); - m_pCompletionBox->clear(); - for ( QStringList::Iterator it = g_pRecentTopicList->begin(); it != g_pRecentTopicList->end(); ++it ) { - KviListBoxTopicItem* item=new KviListBoxTopicItem(m_pCompletionBox,*it); - } - m_pCompletionBox->resize(m_pInput->width(),6*m_pCompletionBox->fontMetrics().height()+20); - QPoint point=m_pInput->mapToGlobal(QPoint(0,0)); - point+=QPoint(0,m_pInput->height()); - m_pCompletionBox->move(point); - m_pCompletionBox->show(); - } -} - -void KviTopicWidget::acceptClicked() -{ - if(!m_pInput->readOnly()) - { - QString tmp = m_pInput->text(); - if(tmp != m_szTopic)emit topicSelected(tmp); - } - deactivate(); -} - -void KviTopicWidget::insertChar(QChar c) -{ - insertText(QString(c)); -} - -void KviTopicWidget::insertText(const QString &c) -{ - if(m_pInput) - m_pInput->insertText(c); -} - -int KviTopicWidget::xCursorPostionCalculation(int xInd) -{ - return 0; -} -void KviTopicWidget::complete(int pos) -{ - m_pInput->setText(m_pCompletionBox->text(pos)); - popDownListBox(); -} - -QChar KviTopicWidget::getSubstituteChar(unsigned short control_code) -{ - switch(control_code) - { - case KVI_TEXT_COLOR: - return QChar('K'); - break; - case KVI_TEXT_BOLD: - return QChar('B'); - break; - case KVI_TEXT_RESET: - return QChar('O'); - break; - case KVI_TEXT_REVERSE: - return QChar('R'); - break; - case KVI_TEXT_UNDERLINE: - return QChar('U'); - break; - case KVI_TEXT_ICON: - return QChar('I'); - break; - default: - return QChar(control_code); - break; - } -} - -#include "kvi_topicw.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_topicw.h b/3.4.0/src/kvirc/ui/kvi_topicw.h deleted file mode 100644 index ca142760e3..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_topicw.h +++ /dev/null @@ -1,120 +0,0 @@ -#ifndef _KVI_TOPICW_H_ -#define _KVI_TOPICW_H_ - -//============================================================================ -// -// File : kvi_topicw.h -// Creation date : Fri Aug 4 2000 12:03:12 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include <qframe.h> -#include <qpushbutton.h> -#include "kvi_tal_listbox.h" - -#include "kvi_string.h" -#include "kvi_app.h" -#include "kvi_input.h" - -class QComboBox; -class KviChannel; -class KviTalPopupMenu; -class KviIrcConnection; -class KviTalListBox; - -class KVIRC_API KviListBoxTopicItem : public KviTalListBoxText -{ -public: - KviListBoxTopicItem( KviTalListBox * listbox = 0 , const QString & text = QString::null):KviTalListBoxText(listbox,text) { ; }; - virtual int width ( const KviTalListBox * lb ) const; -protected: - virtual void paint ( QPainter * p ); - -}; - -class KVIRC_API KviTopicWidget : public QFrame -{ - Q_OBJECT - Q_PROPERTY(int TransparencyCapable READ dummyRead) - friend class KviChannel; - -public: - KviTopicWidget(QWidget * par,const char * name); - ~KviTopicWidget(); - -private: - QString m_szTopic; - QString m_szSetBy; - QString m_szSetAt; - QPushButton * m_pAccept; - QPushButton * m_pDiscard; - QPushButton * m_pHistory; - KviTalPopupMenu * m_pContextPopup; - QChar getSubstituteChar(unsigned short control_code); - int xCursorPostionCalculation(int xInd); - KviInputEditor* m_pInput; - KviTalListBox* m_pCompletionBox; -protected: - int m_iCursorPosition; - virtual void drawContents(QPainter *p); - virtual void mouseDoubleClickEvent(QMouseEvent *e); - virtual void mousePressEvent(QMouseEvent *e); - virtual void keyPressEvent(QKeyEvent *e); - virtual void resizeEvent(QResizeEvent *e); -#ifdef COMPILE_USE_QT4 - virtual void paintEvent(QPaintEvent * e); -#endif - void updateToolTip(); - void deactivate(); - void iconButtonClicked(); - virtual bool eventFilter(QObject *o,QEvent *e); - bool handleKeyPressEvent(QKeyEvent * e); -public: - void insertChar(QChar c); - void insertText(const QString &s); - int dummyRead() const { return 0; }; - void reset(); - - void setTopic(const QString & szTopic); - void setTopicSetBy(const QString & setBy); - void setTopicSetAt(const QString & setAt); - - const QString & topic(){ return m_szTopic; }; - const QString & topicSetBy(){ return m_szSetBy; }; - const QString & topicSetAt(){ return m_szSetAt; }; - virtual QSize sizeHint() const; - void applyOptions(); - - static void paintColoredText(QPainter *p, QString text,const QColorGroup& cg, int h=-1, int w=-1); -protected slots: - void acceptClicked(); - void discardClicked(); - void historyClicked(); - void contextPopupAboutToShow(); - void copy(); - void complete(int); - void popDownListBox(); -signals: - void topicSelected(const QString &szTopic); -}; - -#endif //_KVI_TOPICW_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_userlistview.cpp b/3.4.0/src/kvirc/ui/kvi_userlistview.cpp deleted file mode 100644 index cfd466c33e..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_userlistview.cpp +++ /dev/null @@ -1,1972 +0,0 @@ -//============================================================================= -// -// File : kvi_userlistview.cpp -// Creation date : Tue Aug 1 2000 21:05:22 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#define _KVI_USERLISTVIEW_CPP_ - -#include "kvi_debug.h" -#include "kvi_userlistview.h" -#include "kvi_settings.h" -#include "kvi_locale.h" -#include "kvi_options.h" -#include "kvi_defaults.h" -#include "kvi_iconmanager.h" -#include "kvi_regusersdb.h" -#include "kvi_parameterlist.h" -#include "kvi_window.h" -#include "kvi_console.h" -#include "kvi_app.h" -#include "kvi_useraction.h" -#include "kvi_qstring.h" -#include "kvi_frame.h" -#include "kvi_mdimanager.h" -#include "kvi_kvs_eventtriggers.h" -#include "kvi_toolwindows_container.h" -#include "kvi_doublebuffer.h" -#include "kvi_stringconversion.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionserverinfo.h" - -#include <qlabel.h> -#include <qscrollbar.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qfontmetrics.h> -#include <qdatetime.h> -#include <qmime.h> -#include "kvi_styled_controls.h" -#include <qevent.h> - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - extern QPixmap * g_pShadedChildGlobalDesktopBackground; -#endif - - -// kvi_app.cpp (loaded and destroyed by KviIconManager) -extern QPixmap * g_pUserChanStatePixmap; - -// Yet another really complex widget :) - -#define KVI_USERLIST_BORDER_WIDTH 2 - -// FIXME: #warning "Button to show/hide avatars" -// FIXME: #warning "We want to be able to navigate the list with the keyboard!" - -KviUserListToolTip::KviUserListToolTip(KviUserListView * v,KviUserListViewArea * a) -: KviTalToolTip(a) -{ - m_pListView = v; -} - -KviUserListToolTip::~KviUserListToolTip() -{ -} - -void KviUserListToolTip::maybeTip(const QPoint &pnt) -{ - m_pListView->maybeTip(this,pnt); -} - - - - -KviUserListEntry::KviUserListEntry(KviUserListView * parent,const QString &nick, - KviIrcUserEntry * e,short int iFlags,bool bJoinTimeUnknown) -{ - m_pListView = parent; - m_szNick = nick; - m_pGlobalData = e; - m_iFlags = iFlags; - m_lastActionTime = (kvi_time_t)0; - m_joinTime = bJoinTimeUnknown ? (kvi_time_t)0 : kvi_unixTime(); - m_iTemperature = bJoinTimeUnknown ? 0 : KVI_USERACTION_JOIN; - - m_bSelected = false; - - recalcSize(); -} - -KviUserListEntry::~KviUserListEntry() -{ -} - -bool KviUserListEntry::color(QColor& color) -{ - // - // FIXME: Unused ? - // - KviRegisteredUser* pRegisteredUser=m_pListView->m_pKviWindow->connection()->userDataBase()->registeredUser(m_szNick); - if(pRegisteredUser) - { - if(m_pListView->m_pKviWindow->connection()->userDataBase()->haveCustomColor(m_szNick)) - { - color=*(m_pListView->m_pKviWindow->connection()->userDataBase()->customColor(m_szNick)); - return true; - } - } - if(KVI_OPTION_BOOL(KviOption_boolUseDifferentColorForOwnNick) && m_pListView->m_pKviWindow->connection()) - { - if(m_szNick==m_pListView->m_pKviWindow->connection()->currentNickName()) - { - color = KVI_OPTION_COLOR(KviOption_colorUserListViewOwnForeground); - return true; - } - } - if(m_iFlags == 0) - { - color=KVI_OPTION_COLOR(KviOption_colorUserListViewNormalForeground); - return true; - } else { - color = KVI_OPTION_COLOR((m_iFlags & KVI_USERFLAG_CHANOWNER) ? \ - KviOption_colorUserListViewChanOwnerForeground : ((m_iFlags & KVI_USERFLAG_CHANADMIN) ? \ - KviOption_colorUserListViewChanAdminForeground : ((m_iFlags & KVI_USERFLAG_OP) ? \ - KviOption_colorUserListViewOpForeground : ((m_iFlags & KVI_USERFLAG_HALFOP) ? \ - KviOption_colorUserListViewHalfOpForeground : ((m_iFlags & KVI_USERFLAG_VOICE) ? \ - KviOption_colorUserListViewVoiceForeground : KviOption_colorUserListViewUserOpForeground))))); - return true; - } - return true; -} - -void KviUserListEntry::recalcSize() -{ - KviAvatar * av = m_pGlobalData->avatar(); - m_iHeight = m_pListView->m_iFontHeight; - if(KVI_OPTION_BOOL(KviOption_boolShowUserChannelIcons) && (m_iHeight < 20))m_iHeight = 20; - - if(!KVI_OPTION_BOOL(KviOption_boolDisableAvatars))//G&N 2005 - { - if(av) - { - if( KVI_OPTION_BOOL(KviOption_boolScaleAvatars) && - ( - !KVI_OPTION_BOOL(KviOption_boolDoNotStretchAvatars) || - (av->pixmap()->width() > KVI_OPTION_UINT(KviOption_uintAvatarScaleWidth)) || - (av->pixmap()->height() > KVI_OPTION_UINT(KviOption_uintAvatarScaleHeight)) - ) - ) - { - QPixmap * pix = av->scaledPixmap(KVI_OPTION_UINT(KviOption_uintAvatarScaleWidth), KVI_OPTION_UINT(KviOption_uintAvatarScaleHeight)); - - m_iHeight += pix->height(); - } - else - { - m_iHeight += av->pixmap()->height(); - } - } - } - m_iHeight += 3; -} - -/////////////////////////////////////////////// - - - -KviUserListView::KviUserListView(QWidget * parent,KviWindowToolPageButton* button,KviIrcUserDataBase * db,KviWindow * pWnd,int dictSize,const QString & label_text,const char * name) -: KviWindowToolWidget(parent,button) -{ - setAutoDelete(0); - m_pKviWindow = pWnd; - m_pEntryDict = new KviPointerHashTable<QString,KviUserListEntry>(dictSize,false); - m_pEntryDict->setAutoDelete(true); - - m_pUsersLabel = new QLabel(this,"userslabel"); - KviTalToolTip::add(m_pUsersLabel,label_text); - - m_pViewArea = new KviUserListViewArea(this); - m_pToolTip = new KviUserListToolTip(this,m_pViewArea); - m_pTopItem = 0; - m_pHeadItem = 0; - m_pTailItem = 0; - m_iOpCount = 0; - m_iHalfOpCount = 0; - m_iVoiceCount = 0; - m_iChanAdminCount = 0; - m_iChanOwnerCount = 0; - m_iUserOpCount = 0; - m_pIrcUserDataBase = db; - m_iTotalHeight = 0; - m_ibEntries = 0; - m_ieEntries = 0; - m_iIEntries = 0; - m_iSelectedCount = 0; -// setBackgroundMode(QWidget::NoBackground); - applyOptions(); - registerSelf(); -} - -KviUserListView::~KviUserListView() -{ - removeAllEntries(); - delete m_pEntryDict; - delete m_pToolTip; -} - -void KviUserListView::emitRightClick() -{ - int ev = -1; - switch(m_pKviWindow->type()) - { - case KVI_WINDOW_TYPE_CHANNEL: ev = KviEvent_OnChannelNickPopupRequest; break; - case KVI_WINDOW_TYPE_QUERY: ev = KviEvent_OnQueryNickPopupRequest; break; - case KVI_WINDOW_TYPE_CONSOLE: ev = KviEvent_OnNotifyListPopupRequest; break; - default: ev = KviEvent_OnNickLinkPopupRequest; break; // this should actually never happen - } - if(ev > -1) - { - if(KviKvsEventManager::instance()->hasAppHandlers(ev)) - { - QString nicks; - appendSelectedNicknames(nicks); - KviKvsVariantList vList; - vList.append(nicks); - KviKvsEventManager::instance()->trigger(ev,m_pKviWindow,&vList); - } else { - g_pApp->checkSuggestRestoreDefaultScript(); - } - } -} - -void KviUserListView::emitDoubleClick() -{ - int ev = -1; - switch(m_pKviWindow->type()) - { - case KVI_WINDOW_TYPE_CHANNEL: ev = KviEvent_OnChannelNickDefaultActionRequest; break; - case KVI_WINDOW_TYPE_QUERY: ev = KviEvent_OnQueryNickDefaultActionRequest; break; - case KVI_WINDOW_TYPE_CONSOLE: ev = KviEvent_OnNotifyListDefaultActionRequest; break; - default: ev = KviEvent_OnNickLinkDefaultActionRequest; break; // this should actually never happen - } - if(ev > -1) - { - if(KviKvsEventManager::instance()->hasAppHandlers(ev)) - { - QString nicks; - appendSelectedNicknames(nicks); - KviKvsVariantList vList; - vList.append(nicks); - KviKvsEventManager::instance()->trigger(ev,m_pKviWindow,&vList); - } else { - g_pApp->checkSuggestRestoreDefaultScript(); - } - } -} - -void KviUserListView::updateScrollBarRange() -{ - int max = m_iTotalHeight - (m_pViewArea->height() - (KVI_USERLIST_BORDER_WIDTH * 2)); - m_pViewArea->m_pScrollBar->setRange(0,max > 0 ? max : 0); -} - -void KviUserListView::applyOptions() -{ -/* if(!KVI_OPTION_BOOL(KviOption_boolDisableUserListLabel)){ - m_pUsersLabel->hide(); - m_pViewArea->setGeometry(0,0,width(),height()); - } - if(KVI_OPTION_BOOL(KviOption_boolDisableUserListLabel)){ - m_pUsersLabel->show(); - updateUsersLabel(); - }*/ - setFont(KVI_OPTION_FONT(KviOption_fontUserListView)); - QFontMetrics fm(KVI_OPTION_FONT(KviOption_fontUserListView)); - m_iFontHeight = fm.lineSpacing(); - KviUserListEntry * e = m_pHeadItem; - m_iTotalHeight = 0; - while(e) - { - e->recalcSize(); - m_iTotalHeight += e->m_iHeight; - e = e->m_pNext; - } - updateScrollBarRange(); - m_pUsersLabel->setFont(KVI_OPTION_FONT(KviOption_fontUserListView)); - setMinimumWidth(100); - resizeEvent(0); // this will call update() too - repaint(); -} -void KviUserListView::updateArea() -{ - bool bEnable = m_pViewArea->isUpdatesEnabled(); - if(!bEnable) m_pViewArea->setUpdatesEnabled(true); - triggerUpdate(); - if(!bEnable) m_pViewArea->setUpdatesEnabled(false); -} - -void KviUserListView::enableUpdates(bool bEnable) -{ - m_pViewArea->setUpdatesEnabled(bEnable); - if(bEnable)triggerUpdate(); -} - -void KviUserListView::setMaskEntries(char type, int num) -{ - switch (type) - { - case 'b': - m_ibEntries = num; - break; - case 'e': - m_ieEntries = num; - break; - case 'I': - m_iIEntries = num; - break; - } - updateUsersLabel(); -} - -void KviUserListView::completeNickBashLike(const QString &begin,KviPointerList<QString> *l,bool bAppendMask) -{ - KviUserListEntry * entry = m_pHeadItem; - - while(entry) - { - if(KviQString::equalCIN(begin,entry->m_szNick,begin.length())) - { - if(bAppendMask) - { - QString * s = new QString(); - KviQString::sprintf(*s,"%Q!%Q@%Q",&(entry->m_szNick),&(entry->m_pGlobalData->user()),&(entry->m_pGlobalData->host())); - l->append(s); - } else - l->append(new QString(entry->m_szNick)); - } - entry = entry->m_pNext; - } -} - -bool KviUserListView::completeNickStandard(const QString &begin,const QString &skipAfter,QString &buffer,bool bAppendMask) -{ - KviUserListEntry * entry = m_pHeadItem; - - if(!skipAfter.isEmpty()) - { - while(entry) - { - if(KviQString::equalCI(skipAfter,entry->m_szNick)) - { - entry = entry->m_pNext; - break; - } - entry = entry->m_pNext; - } - } - - // FIXME: completion should skip my own nick or place it as last entry in the chain (?) - - // if(KviConsole * c = m_pKviWindow->console()) - // { - // if(kvi_strEqualCI(entry->m_szNick.ptr(),c->currentNickName()) - // } - - // Ok...now the real completion - while(entry) - { - if(entry->m_szNick.length() >= begin.length()) - { - int result = KviQString::cmpCIN(begin,entry->m_szNick,begin.length()); - if(result == 0) - { - // This is ok. - buffer = entry->m_szNick; - if(bAppendMask) - { - buffer += entry->m_pGlobalData->user(); - buffer += entry->m_pGlobalData->host(); - } - return true; - } else if(result < 0) - { - // No match...begin is lower than the current entry - if(entry->m_iFlags == 0)return false; - else { - int flags = entry->m_iFlags; - // skip the current flag - while(entry) - { - if(entry->m_iFlags != flags)break; - entry = entry->m_pNext; - } - continue; - } - } - } - entry = entry->m_pNext; - } - - return false; -} - - -void KviUserListView::insertUserEntry(const QString &nick,KviUserListEntry * e) -{ - // Complex insertion task :) - - m_pEntryDict->insert(nick,e); - m_iTotalHeight += e->m_iHeight; - - bool bGotTopItem = false; - - int flag = 0; - if(e->m_iFlags != 0) - { - if(e->m_iFlags & KVI_USERFLAG_USEROP) - { - flag = KVI_USERFLAG_USEROP; - m_iUserOpCount++; - } - if(e->m_iFlags & KVI_USERFLAG_VOICE) - { - flag = KVI_USERFLAG_VOICE; - m_iVoiceCount++; - } - if(e->m_iFlags & KVI_USERFLAG_HALFOP) - { - flag = KVI_USERFLAG_HALFOP; - m_iHalfOpCount++; - } - if(e->m_iFlags & KVI_USERFLAG_OP) - { - flag = KVI_USERFLAG_OP; - m_iOpCount++; - } - if(e->m_iFlags & KVI_USERFLAG_CHANADMIN) - { - flag = KVI_USERFLAG_CHANADMIN; - m_iChanAdminCount++; - } - if(e->m_iFlags & KVI_USERFLAG_CHANOWNER) - { - flag = KVI_USERFLAG_CHANOWNER; - m_iChanOwnerCount++; - } - } - - - if(m_pHeadItem) - { - KviUserListEntry * entry = m_pHeadItem; - - if(!(e->m_iFlags & KVI_USERFLAG_CHANOWNER)) - { - // the new user is not a channel owner... - // skip the channel owners - while(entry && (entry->m_iFlags & KVI_USERFLAG_CHANOWNER)) - { - if(entry == m_pTopItem)bGotTopItem = true; - entry = entry->m_pNext; - } - - if(!(e->m_iFlags & KVI_USERFLAG_CHANADMIN)) - { - // the new user is not a channel admin... - // skip chan admins - while(entry && (entry->m_iFlags & KVI_USERFLAG_CHANADMIN)) - { - if(entry == m_pTopItem)bGotTopItem = true; - entry = entry->m_pNext; - } - - // is operator ? - if(!(e->m_iFlags & KVI_USERFLAG_OP)) - { - // the new user is not an op... - // skip ops - while(entry && (entry->m_iFlags & KVI_USERFLAG_OP)) - { - if(entry == m_pTopItem)bGotTopItem = true; - entry = entry->m_pNext; - } - - // is half oped ? - if(!(e->m_iFlags & KVI_USERFLAG_HALFOP)) - { - // nope , skip halfops - while(entry && (entry->m_iFlags & KVI_USERFLAG_HALFOP)) - { - if(entry == m_pTopItem)bGotTopItem = true; - entry = entry->m_pNext; - } - - // is voiced ? - if(!(e->m_iFlags & KVI_USERFLAG_VOICE)) - { - // nope , not voiced so skip voiced users - while(entry && (entry->m_iFlags & KVI_USERFLAG_VOICE)) - { - if(entry == m_pTopItem)bGotTopItem = true; - entry = entry->m_pNext; - } - - // is userop'd? - if(!(e->m_iFlags & KVI_USERFLAG_USEROP)) - { - // nope , skip userops - while(entry && (entry->m_iFlags & KVI_USERFLAG_USEROP)) - { - if(entry == m_pTopItem)bGotTopItem = true; - entry = entry->m_pNext; - } - } // else is userop, ops, halfops, and voiced are skipped - } // else it is voiced , ops and halfops are skipped - } // else it is halfop , ops are skipped - } // else it is op , chan admins are skipped - } // else it is chan admin , chan owners are skipped - } // else it is chan owner, so nothing to skip: the chan owners are first in the list - - // now strcmp within the current user-flag group... - while(entry && (KviQString::cmpCI(entry->m_szNick,e->m_szNick) < 0) && - ((entry->m_iFlags & flag) || (flag == 0))) - { - if(entry == m_pTopItem)bGotTopItem = true; - entry = entry->m_pNext; - } - if(entry) - { - // inserting - e->m_pNext = entry; - e->m_pPrev = entry->m_pPrev; - if(e->m_pPrev == 0)m_pHeadItem = e; - else e->m_pPrev->m_pNext = e; - entry->m_pPrev = e; - // need to adjust the item offsets now... - // ok... if we're inserting something after - // the top item, we move everything down - // otherwise we only update the scrollbar values - if(!bGotTopItem) - { - // Inserting BEFORE the top item - if((e == m_pHeadItem) && (m_pTopItem == e->m_pNext) && (m_pViewArea->m_iTopItemOffset == 0)) - { - // special case...the top item is the head one - // and it has zero offset...change the top item too - m_pTopItem = e; - triggerUpdate(); - } else { - // invisible insertion - m_pViewArea->m_bIgnoreScrollBar = true; - m_pViewArea->m_iLastScrollBarVal += e->m_iHeight; - updateScrollBarRange(); - m_pViewArea->m_pScrollBar->setValue(m_pViewArea->m_iLastScrollBarVal); - m_pViewArea->m_bIgnoreScrollBar = false; - updateUsersLabel(); - } - } else { - triggerUpdate(); - } - } else { - // appending to the end (may be visible) - m_pTailItem->m_pNext = e; - e->m_pNext = 0; - e->m_pPrev = m_pTailItem; - m_pTailItem = e; - triggerUpdate(); - } - } else { - // There were no items (is rather visible) - m_pHeadItem = e; - m_pTailItem = e; - m_pTopItem = e; - e->m_pNext = 0; - e->m_pPrev = 0; - triggerUpdate(); - } - if(e->m_bSelected) - { - m_iSelectedCount++; - if(m_iSelectedCount == 1)g_pFrame->childWindowSelectionStateChange(m_pKviWindow,true); - } -} - -KviUserListEntry * KviUserListView::join(const QString &nick,const QString &user, - const QString &host,int iFlags) -{ - // Ok..an user joins the channel - KviUserListEntry * it = m_pEntryDict->find(nick); - if(it == 0) - { - // add an entry to the global dict - KviIrcUserEntry * pGlobalData = m_pIrcUserDataBase->insertUser(nick,user,host); - // calculate the flags and update the counters - it = new KviUserListEntry(this,nick,pGlobalData,iFlags,(user == QString::null)); - insertUserEntry(nick,it); - } else { -// if(!host.isEmpty()) - it can be UHNAMES with host or NAMEX(X) w/o it -// { - // Ok...the user was already on... - // Probably this is a NAMES(X) reply , and the user IS_ME - // (already joined after the JOIN message) - if(iFlags != it->m_iFlags) - { -//// FIXME: #warning "Maybe say to the channel that we're oped : and the op is guessed from the names reply" - if((iFlags & KVI_USERFLAG_CHANOWNER) != (it->m_iFlags & KVI_USERFLAG_CHANOWNER))setChanOwner(nick,iFlags & KVI_USERFLAG_CHANOWNER); - if((iFlags & KVI_USERFLAG_CHANADMIN) != (it->m_iFlags & KVI_USERFLAG_CHANADMIN))setChanAdmin(nick,iFlags & KVI_USERFLAG_CHANADMIN); - if((iFlags & KVI_USERFLAG_OP) != (it->m_iFlags & KVI_USERFLAG_OP))op(nick,iFlags & KVI_USERFLAG_OP); - if((iFlags & KVI_USERFLAG_HALFOP) != (it->m_iFlags & KVI_USERFLAG_HALFOP))halfop(nick,iFlags & KVI_USERFLAG_HALFOP); - if((iFlags & KVI_USERFLAG_VOICE) != (it->m_iFlags & KVI_USERFLAG_VOICE))voice(nick,iFlags & KVI_USERFLAG_VOICE); - if((iFlags & KVI_USERFLAG_USEROP) != (it->m_iFlags & KVI_USERFLAG_USEROP))userop(nick,iFlags & KVI_USERFLAG_USEROP); - } -// } - } - return it; -} - -void KviUserListView::triggerUpdate() -{ - // This stuff is useful on joins only - if(m_pViewArea->isUpdatesEnabled()) - { - //m_pViewArea->m_pScrollBar->setRange(0,m_iTotalHeight); - updateScrollBarRange(); - m_pViewArea->update(); - updateUsersLabel(); - } -} - -bool KviUserListView::avatarChanged(const QString &nick) -{ - KviUserListEntry * it = m_pEntryDict->find(nick); - if(it) - { - int oldH = it->m_iHeight; - m_iTotalHeight -= it->m_iHeight; - it->recalcSize(); - m_iTotalHeight += it->m_iHeight; - // if this was "over" the top item , we must adjust the scrollbar value - // otherwise scroll everything down - KviUserListEntry * e = m_pHeadItem; - bool bGotTopItem = false; - while(e != it) - { - if(e == m_pTopItem) - { - bGotTopItem = true; - e = it; - } else e = e->m_pNext; - } - if(!bGotTopItem && (m_pTopItem != it)) - { - // we're "over" the top item , so over the - // upper side of the view...adjust the scroll bar value - int hDiff = it->m_iHeight - oldH; - m_pViewArea->m_iLastScrollBarVal += hDiff; - m_pViewArea->m_bIgnoreScrollBar = true; -// m_pViewArea->m_pScrollBar->setRange(0,m_iTotalHeight); - updateScrollBarRange(); - m_pViewArea->m_pScrollBar->setValue(m_pViewArea->m_iLastScrollBarVal); - m_pViewArea->m_bIgnoreScrollBar = false; - } else { - // the item may be visible! - // the scroll bar should take care of the case - // in that the current value runs out of the allowed - // range.... it should set the value to a good one - // and emit the signal - updateScrollBarRange(); -// m_pViewArea->m_pScrollBar->setRange(0,m_iTotalHeight); - m_pViewArea->update(); - } - return true; - } - return false; -} - - -bool KviUserListView::userActionVerifyMask(const QString &nick,const QString &user,const QString &host,int actionTemperature,QString &oldUser,QString &oldHost) -{ - // This is called when an user "acts" in some visible way - // on the channel, so we can keep track of his channeel - // idle time. - // This particular function version of userAction - // will return false if there was a user or hostname - // change (unless they were not known at all) - // This will also update the username and hostname - // if needed. - KviUserListEntry * it = m_pEntryDict->find(QString(nick)); - if(it) - { - it->m_lastActionTime = kvi_unixTime(); - bool bChanged = false; - if(!(host.isEmpty() || (KviQString::equalCS(host,"*")))) - { - if(!KviQString::equalCI(it->m_pGlobalData->host(),host)) - { - if(!(it->m_pGlobalData->host().isEmpty() || KviQString::equalCS(it->m_pGlobalData->host(),"*"))) - { - oldHost = it->m_pGlobalData->host(); - bChanged = true; - } - it->m_pGlobalData->setHost(host); - } - } - if(!(user.isEmpty() || (KviQString::equalCS(user,"*")))) - { - if(!KviQString::equalCI(it->m_pGlobalData->user(),user)) - { - if(!(it->m_pGlobalData->user().isEmpty() || KviQString::equalCS(it->m_pGlobalData->user(),"*"))) - { - oldUser = it->m_pGlobalData->user(); - bChanged = true; - } - it->m_pGlobalData->setUser(user); - } - } - it->m_iTemperature += actionTemperature; - // Don't allow it to grow too much - if(it->m_iTemperature > 300)it->m_iTemperature = 300; - else if(it->m_iTemperature < -300)it->m_iTemperature = -300; - if(itemVisible(it))triggerUpdate(); - return !bChanged; - } - return true; // no such nick so no change -} - - -void KviUserListView::userAction(const QString &nick,const QString &user,const QString &host,int actionTemperature) -{ - // This is called when an user "acts" in some visible way - // on the channel, so we can keep track of his channeel - // idle time. This will also update the username and hostname - // if needed. - KviUserListEntry * it = m_pEntryDict->find(QString(nick)); - if(it) - { - it->m_lastActionTime = kvi_unixTime(); - if(!(host.isEmpty() || (KviQString::equalCS(host,"*")))) - it->m_pGlobalData->setHost(host); - if(!(user.isEmpty() || (KviQString::equalCS(user,"*")))) - it->m_pGlobalData->setUser(user); - it->m_iTemperature += actionTemperature; - // Don't allow it to grow too much - if(it->m_iTemperature > 300)it->m_iTemperature = 300; - else if(it->m_iTemperature < -300)it->m_iTemperature = -300; - if(itemVisible(it))triggerUpdate(); - } -} - - -void KviUserListView::userAction(KviIrcMask *user,int actionTemperature) -{ - // This is called when an user "acts" in some visible way - // on the channel, so we can keep track of his channeel - // idle time. This will also update the username and hostname - // if needed. - KviUserListEntry * it = m_pEntryDict->find(QString(user->nick())); - if(it) - { - it->m_lastActionTime = kvi_unixTime(); - if(user->hasUser())it->m_pGlobalData->setUser(user->user()); - if(user->hasHost())it->m_pGlobalData->setHost(user->host()); - it->m_iTemperature += actionTemperature; - // Don't allow it to grow too much - if(it->m_iTemperature > 300)it->m_iTemperature = 300; - else if(it->m_iTemperature < -300)it->m_iTemperature = -300; - if(itemVisible(it))triggerUpdate(); - } -} - -void KviUserListView::userAction(const QString &nick,int actionTemperature) -{ - // This is called when an user "acts" in some visible way - // on the channel, so we can keep track of his channeel - // idle time. This will also update the username and hostname - // if needed. - KviUserListEntry * it = m_pEntryDict->find(nick); - if(it) - { - it->m_lastActionTime = kvi_unixTime(); - it->m_iTemperature += actionTemperature; - if(it->m_iTemperature > 300)it->m_iTemperature = 300; - else if(it->m_iTemperature < -300)it->m_iTemperature = -300; - if(itemVisible(it))triggerUpdate(); - } -} - -kvi_time_t KviUserListView::getUserJoinTime(const QString &szNick) -{ - KviUserListEntry * e = m_pEntryDict->find(szNick); - if(!e)return (kvi_time_t)0; - return e->m_joinTime; -} - -kvi_time_t KviUserListView::getUserLastActionTime(const QString &szNick) -{ - KviUserListEntry * e = m_pEntryDict->find(szNick); - if(!e)return (kvi_time_t)0; - return e->m_lastActionTime; -} - - -int KviUserListView::getUserModeLevel(const QString &szNick) -{ - KviUserListEntry * e = m_pEntryDict->find(szNick); - if(!e)return 0; - if(e->m_iFlags & KVI_USERFLAG_MODEMASK) - { - if(e->m_iFlags & KVI_USERFLAG_CHANOWNER)return 60; - if(e->m_iFlags & KVI_USERFLAG_CHANADMIN)return 50; - if(e->m_iFlags & KVI_USERFLAG_OP)return 40; - if(e->m_iFlags & KVI_USERFLAG_HALFOP)return 30; - if(e->m_iFlags & KVI_USERFLAG_VOICE)return 20; - if(e->m_iFlags & KVI_USERFLAG_USEROP)return 10; - } - return 0; -} - -char KviUserListView::getUserFlag(KviUserListEntry * e) -{ - if(!e)return 0; - return (char)m_pKviWindow->connection()->serverInfo()->modePrefixChar(e->m_iFlags).unicode(); -} - -void KviUserListView::prependUserFlag(const QString &nick,QString &buffer) -{ - char uFlag = getUserFlag(nick); - if(uFlag)buffer.prepend(uFlag); -} - -int KviUserListView::flags(const QString &nick) -{ - KviUserListEntry * it = m_pEntryDict->find(nick); - return it ? it->m_iFlags : 0; -} - -#define SET_FLAG_FUNC(__funcname,__flag) \ - bool KviUserListView::__funcname(const QString &nick,bool bYes) \ - { \ - KviUserListEntry * it = m_pEntryDict->find(nick); \ - if(!it)return false; \ - m_pEntryDict->setAutoDelete(false); \ - partInternal(nick,false); \ - m_pEntryDict->setAutoDelete(true); \ - if(bYes) \ - { \ - if(!(it->m_iFlags & __flag))it->m_iFlags |= __flag; \ - } else { \ - if(it->m_iFlags & __flag)it->m_iFlags &= ~__flag; \ - } \ - updateScrollBarRange(); \ - insertUserEntry(nick,it); \ - m_pViewArea->update(); \ - return true; \ - } - -SET_FLAG_FUNC(setChanOwner,KVI_USERFLAG_CHANOWNER) -SET_FLAG_FUNC(setChanAdmin,KVI_USERFLAG_CHANADMIN) -SET_FLAG_FUNC(op,KVI_USERFLAG_OP) -SET_FLAG_FUNC(halfop,KVI_USERFLAG_HALFOP) -SET_FLAG_FUNC(userop,KVI_USERFLAG_USEROP) -SET_FLAG_FUNC(voice,KVI_USERFLAG_VOICE) - -#define GET_FLAG_FUNC(__funcname,__flag) \ - bool KviUserListView::__funcname(const QString &nick,bool bAtLeast) \ - { \ - KviUserListEntry * it = m_pEntryDict->find(nick); \ - return it ? (bAtLeast ? (it->m_iFlags >= __flag) : (it->m_iFlags & __flag)) : false; \ - } - -GET_FLAG_FUNC(isChanOwner,KVI_USERFLAG_CHANOWNER) -GET_FLAG_FUNC(isChanAdmin,KVI_USERFLAG_CHANADMIN) -GET_FLAG_FUNC(isOp,KVI_USERFLAG_OP) -GET_FLAG_FUNC(isVoice,KVI_USERFLAG_VOICE) -GET_FLAG_FUNC(isHalfOp,KVI_USERFLAG_HALFOP) -GET_FLAG_FUNC(isUserOp,KVI_USERFLAG_USEROP) - - -QString * KviUserListView::firstSelectedNickname() -{ - m_pIterator = m_pHeadItem; - while(m_pIterator) - { - if(m_pIterator->m_bSelected) - { - QString * s = &(m_pIterator->m_szNick); - m_pIterator = m_pIterator->m_pNext; - return s; - } - m_pIterator = m_pIterator->m_pNext; - } - return 0; -} - -QString * KviUserListView::nextSelectedNickname() -{ - while(m_pIterator) - { - if(m_pIterator->m_bSelected) - { - QString * s = &(m_pIterator->m_szNick); - m_pIterator = m_pIterator->m_pNext; - return s; - } - m_pIterator = m_pIterator->m_pNext; - } - return 0; -} - -void KviUserListView::appendSelectedNicknames(QString &buffer) -{ - KviUserListEntry * aux = m_pHeadItem; - bool bFirst = true; - while(aux) - { - if(aux->m_bSelected) - { - if(!bFirst)buffer.append(','); - else bFirst = false; - buffer.append(aux->m_szNick); - } - aux = aux->m_pNext; - } -} - -void KviUserListView::select(const QString& nick){ - KviPointerHashTableIterator<QString,KviUserListEntry> it(*m_pEntryDict); - while(it.current()) - { - ((KviUserListEntry *)it.current())->m_bSelected = false; - ++it; - } - - KviUserListEntry * entry = m_pEntryDict->find(nick); - if(entry) - { - entry->m_bSelected = true; - m_iSelectedCount = 1; - } else { - m_iSelectedCount = 0; - } - g_pFrame->childWindowSelectionStateChange(m_pKviWindow,true); - m_pViewArea->update(); -} - -bool KviUserListView::partInternal(const QString &nick,bool bRemove) -{ - KviUserListEntry * it = m_pEntryDict->find(nick); - if(it) - { - // so, first of all..check if this item is over, or below the top item - KviUserListEntry * e = m_pHeadItem; - bool bGotTopItem = false; - while(e != it) - { - if(e == m_pTopItem) - { - bGotTopItem = true; - e = it; - } else e = e->m_pNext; - } - if(bRemove)m_pIrcUserDataBase->removeUser(nick,it->m_pGlobalData); - - // now just remove it - if(it->m_iFlags & KVI_USERFLAG_OP)m_iOpCount--; - if(it->m_iFlags & KVI_USERFLAG_VOICE)m_iVoiceCount--; - if(it->m_iFlags & KVI_USERFLAG_HALFOP)m_iHalfOpCount--; - if(it->m_iFlags & KVI_USERFLAG_CHANADMIN)m_iChanAdminCount--; - if(it->m_iFlags & KVI_USERFLAG_CHANOWNER)m_iChanOwnerCount--; - if(it->m_iFlags & KVI_USERFLAG_USEROP)m_iUserOpCount--; - if(it->m_bSelected) - { - m_iSelectedCount--; - if(m_iSelectedCount == 0)g_pFrame->childWindowSelectionStateChange(m_pKviWindow,false); - } - if(it->m_pPrev)it->m_pPrev->m_pNext = it->m_pNext; - if(it->m_pNext)it->m_pNext->m_pPrev = it->m_pPrev; - if(m_pTopItem == it) - { - bGotTopItem = true; //!!! the previous while() does not handle it! - m_pTopItem = it->m_pNext; - if(m_pTopItem == 0)m_pTopItem = it->m_pPrev; - } - if(it == m_pHeadItem)m_pHeadItem = it->m_pNext; - if(it == m_pTailItem)m_pTailItem = it->m_pPrev; - m_iTotalHeight -= it->m_iHeight; - - int iHeight = it->m_iHeight; - - m_pEntryDict->remove(nick); - - if(bGotTopItem) - { - // removing after (or exactly) the top item, may be visible - if(bRemove)triggerUpdate(); - } else { - // removing over (before) the top item...not visible - m_pViewArea->m_bIgnoreScrollBar = true; - m_pViewArea->m_iLastScrollBarVal -= iHeight; - m_pViewArea->m_pScrollBar->setValue(m_pViewArea->m_iLastScrollBarVal); -// m_pViewArea->m_pScrollBar->setRange(0,m_iTotalHeight); - updateScrollBarRange(); - m_pViewArea->m_bIgnoreScrollBar = false; - if(bRemove)updateUsersLabel(); - } - - return true; - } - return false; -} - -bool KviUserListView::nickChange(const QString &oldNick,const QString &newNick) -{ - KviUserListEntry * it = m_pEntryDict->find(oldNick); - if(it) - { - QString user = it->m_pGlobalData->user(); - QString host = it->m_pGlobalData->host(); - int iFlags = it->m_iFlags; - kvi_time_t joint = it->m_joinTime; - bool bSelect = it->m_bSelected; - KviAvatar * av = it->m_pGlobalData->forgetAvatar(); - KviIrcUserEntry::Gender gender = it->m_pGlobalData->gender(); - bool bBot = it->m_pGlobalData->isBot(); - part(oldNick); - __range_invalid(m_pEntryDict->find(oldNick)); - it = join(newNick,user,host,iFlags); - it->m_pGlobalData->setGender(gender); - it->m_pGlobalData->setBot(bBot); - it->m_joinTime = joint; - it->m_lastActionTime = kvi_unixTime(); - it->m_bSelected = bSelect; - it->m_iTemperature += KVI_USERACTION_NICK; - if(av) - { - it->m_pGlobalData->setAvatar(av); - avatarChanged(newNick); - } - return true; - } - return false; -} - - -void KviUserListView::updateUsersLabel() -{ - if(!KVI_OPTION_BOOL(KviOption_boolDisableUserListLabel))//G&N 2005 - { - KviStr tmp; - tmp.sprintf("<nobr><b>[%u]</b>",m_pEntryDict->count()); - if(m_iChanOwnerCount)tmp.append(KviStr::Format," q:%d",m_iChanOwnerCount); - if(m_iChanAdminCount)tmp.append(KviStr::Format," a:%d",m_iChanAdminCount); - if(m_iOpCount)tmp.append(KviStr::Format," o:%d",m_iOpCount); - if(m_iHalfOpCount)tmp.append(KviStr::Format," h:%d",m_iHalfOpCount); - if(m_iVoiceCount)tmp.append(KviStr::Format," v:%d",m_iVoiceCount); - if(m_iUserOpCount)tmp.append(KviStr::Format," u:%d",m_iUserOpCount); - if(m_ibEntries)tmp.append(KviStr::Format," b:%d",m_ibEntries); - if(m_ieEntries)tmp.append(KviStr::Format," e:%d",m_ieEntries); - if(m_iIEntries)tmp.append(KviStr::Format," I:%d",m_iIEntries); - tmp.append("</nobr>"); - m_pUsersLabel->setText(tmp.ptr()); - } -} - -// FIXME: this could be done really better -void KviUserListView::partAllButOne(const QString &whoNot) -{ - QStringList ll; - KviPointerHashTableIterator<QString,KviUserListEntry> it(*m_pEntryDict); - while(it.current()) - { - if(!KviQString::equalCI(whoNot,it.currentKey())) - ll.append(it.currentKey()); - ++it; - } - for(QStringList::Iterator it2 = ll.begin();it2 != ll.end();it2++) - { - part(*it2); - } -} - -void KviUserListView::removeAllEntries() -{ - KviPointerHashTableIterator<QString,KviUserListEntry> it(*m_pEntryDict); - while(it.current()) - { - m_pIrcUserDataBase->removeUser(it.currentKey(), - ((KviUserListEntry *)it.current())->m_pGlobalData); - ++it; - } - m_pEntryDict->clear(); - m_pHeadItem = 0; - m_pTopItem = 0; - m_iVoiceCount = 0; - m_iHalfOpCount = 0; - m_iChanAdminCount = 0; - m_iChanOwnerCount = 0; - m_iOpCount = 0; - m_iUserOpCount = 0; - if(m_iSelectedCount != 0) - { - m_iSelectedCount = 0; - g_pFrame->childWindowSelectionStateChange(m_pKviWindow,false); - } - m_pViewArea->m_iTopItemOffset = 0; - m_pViewArea->m_iLastScrollBarVal = 0; - m_pViewArea->m_bIgnoreScrollBar = true; - m_pViewArea->m_pScrollBar->setValue(0); - m_iTotalHeight = 0; - updateScrollBarRange(); - m_pViewArea->m_bIgnoreScrollBar = false; // gfgf -} - -void KviUserListView::partAll() -{ - removeAllEntries(); - triggerUpdate(); -} - -void KviUserListView::resizeEvent(QResizeEvent *) -{ - int hght; - if(!KVI_OPTION_BOOL(KviOption_boolDisableUserListLabel))//G&N 2005 - { - hght = m_pUsersLabel->sizeHint().height(); - if(hght < 16)hght = 16; // at least - m_pUsersLabel->setGeometry(0,0,width(),hght); - } - else - { - hght =0; - } - - m_pViewArea->setGeometry(0,hght,width(),height() - hght); - - updateScrollBarRange(); -} - -bool KviUserListView::itemVisible(KviUserListEntry * e) -{ - KviUserListEntry * le = m_pTopItem; - int curTop = KVI_USERLIST_BORDER_WIDTH - m_pViewArea->m_iTopItemOffset; - int hght = height(); - while(le && (curTop < hght)) - { - if(le == e)return true; - curTop += le->m_iHeight; - le = le->m_pNext; - } - return false; -} - -KviUserListEntry * KviUserListView::itemAt(const QPoint &pnt,QRect * rct) -{ - if(!m_pTopItem)return 0; - if(pnt.y() < 0)return 0; - int curTop = KVI_USERLIST_BORDER_WIDTH - m_pViewArea->m_iTopItemOffset; - KviUserListEntry * e = m_pTopItem; - int curBottom = 0; - while(e && (curTop <= m_pViewArea->height())) - { - curBottom = curTop + e->m_iHeight; - if((pnt.y() >= curTop) && (pnt.y() < curBottom)) - { - if(rct) - { - rct->setX(0); - rct->setY(curTop); - rct->setWidth(m_pViewArea->width()); - rct->setHeight(e->m_iHeight); - } - return e; - } - curTop = curBottom; - e = e->m_pNext; - } - return 0; -} - - - -void KviUserListView::userStats(KviUserListViewUserStats * s) -{ - s->uTotal = m_pEntryDict->count(); - s->uHot = 0; - s->uHotOp = 0; - s->uActive = 0; - s->uActiveOp = 0; - s->uChanAdmin = 0; - s->uChanOwner = 0; - s->iAvgTemperature = 0; - s->uOp = 0; - s->uVoiced = 0; - s->uHalfOp = 0; - s->uUserOp = 0; - - KviUserListEntry * e = m_pHeadItem; - - kvi_time_t curTime = kvi_unixTime(); - - while(e) - { - if(e->m_lastActionTime) - { - unsigned int uTimeDiff = (((unsigned int)(curTime - e->m_lastActionTime)) >> 6); - if(uTimeDiff < 10) - { - s->uActive++; // the user was alive in the last ~16 mins - if(e->m_iFlags & (KVI_USERFLAG_OP | KVI_USERFLAG_CHANADMIN | KVI_USERFLAG_CHANOWNER)) - { - s->uActiveOp++; - if(e->m_iTemperature > 0) - { - s->uHot++; - s->uHotOp++; - } - } else { - if(e->m_iTemperature > 0)s->uHot++; - } - s->iAvgTemperature += e->m_iTemperature; - } - } - if(e->m_iFlags & KVI_USERFLAG_CHANOWNER)s->uChanOwner++; - else { - if(e->m_iFlags & KVI_USERFLAG_CHANADMIN)s->uChanAdmin++; - else { - if(e->m_iFlags & KVI_USERFLAG_OP)s->uOp++; - else { - if(e->m_iFlags & KVI_USERFLAG_HALFOP)s->uHalfOp++; - else { - if(e->m_iFlags & KVI_USERFLAG_VOICE)s->uVoiced++; - else { - if(e->m_iFlags & KVI_USERFLAG_USEROP)s->uUserOp++; - } - } - } - } - } - e = e->m_pNext; - } - - if(s->uActive > 0)s->iAvgTemperature /= ((int)s->uActive); -} - - -void KviUserListView::maybeTip(KviUserListToolTip * tip,const QPoint &pnt) -{ - if(!KVI_OPTION_BOOL(KviOption_boolShowUserListViewToolTips))return; - QRect itRect; - KviUserListEntry * it = (KviUserListEntry *)itemAt(pnt,&itRect); - if(it) - { - if(m_pKviWindow->console()) - { - QString buffer; - m_pKviWindow->console()->getUserTipText(it->m_szNick,it->m_pGlobalData,buffer); - - buffer += "<table width=\"100%\">"; - - if(it->m_joinTime != 0) - { - QDateTime dt; - dt.setTime_t(it->m_joinTime); - buffer += "<tr><td bgcolor=\"#F0F0F0\"><nobr>"; - buffer += __tr2qs("Joined on <b>%1</b>").arg(dt.toString()); - buffer += "</nobr></td></tr>"; - } - - if(it->m_lastActionTime != 0) - { - int secs = kvi_unixTime() - it->m_lastActionTime; - int mins = secs / 60; - secs = secs % 60; - int hors = mins / 60; - mins = mins % 60; - buffer += "<tr><td bgcolor=\"#F0F0F0\"><nobr>"; - buffer += __tr2qs("Quiet for <b>%1h %2m %3s</b>").arg(hors).arg(mins).arg(secs); - buffer += "</nobr></td></tr>"; - } - buffer += "</table>"; - - tip->doTip(itRect,buffer); - } - } -} - -/////////////////////////////////////////////////////////////// - -KviUserListViewArea::KviUserListViewArea(KviUserListView * par) -: QWidget(par) -{ - m_pListView = par; -#ifdef COMPILE_USE_QT4 - setAutoFillBackground(false); -#else - setBackgroundMode(QWidget::NoBackground); -#endif -#ifdef COMPILE_USE_QT4 - m_pScrollBar = new QScrollBar(Qt::Vertical,this,"scrollbar"); -#else - m_pScrollBar = new QScrollBar(QScrollBar::Vertical,this,"scrollbar"); -#endif - m_pScrollBar->setRange(0,0); - m_pScrollBar->setValue(0); - connect(m_pScrollBar,SIGNAL(valueChanged(int)),this,SLOT(scrollBarMoved(int))); - m_pScrollBar->setPageStep(height()); - m_pScrollBar->setLineStep(m_pListView->m_iFontHeight); - m_iLastScrollBarVal = 0; - m_iTopItemOffset = 0; - m_bIgnoreScrollBar = false; - m_pLastEntryUnderMouse = 0; -} - -KviUserListViewArea::~KviUserListViewArea() -{ -} - -void KviUserListViewArea::scrollBarMoved(int newVal) -{ - if(m_bIgnoreScrollBar)return; - int diff = newVal - m_iLastScrollBarVal; - if(m_pListView->m_pTopItem) - { - while(diff > 0) - { - int nextH = (m_pListView->m_pTopItem->m_iHeight - m_iTopItemOffset); - if(diff >= nextH) - { - // the diff is greater than the top item visible part - diff -= nextH; - if(m_pListView->m_pTopItem->m_pNext) - { - // There is a next item (offset to 0) - m_pListView->m_pTopItem = m_pListView->m_pTopItem->m_pNext; - m_iTopItemOffset = 0; - } else { - // No next item (rather a bug) (offset to the top item size) - m_iTopItemOffset = m_pListView->m_pTopItem->m_iHeight; - diff = 0; - } - } else { - // just offset the top item - m_iTopItemOffset += diff; - diff = 0; - } - } - while(diff < 0) - { - if((-diff) <= m_iTopItemOffset) - { - // just move the top item - m_iTopItemOffset += diff; - diff = 0; - } else { - diff += m_iTopItemOffset; - if(m_pListView->m_pTopItem->m_pPrev) - { - // There is a prev item (offset to 0) - m_pListView->m_pTopItem = m_pListView->m_pTopItem->m_pPrev; - m_iTopItemOffset = m_pListView->m_pTopItem->m_iHeight; - } else { - // No prev item (rather a bug) (offset to the top item size) - m_iTopItemOffset = 0; - diff = 0; - } - } - } - } - m_iLastScrollBarVal = newVal; - update(); - -} - -void KviUserListViewArea::paintEvent(QPaintEvent *ev) -{ - // update the scroll bar - - if(!isVisible())return; - - // if the mdiManager is in SDI mode - // and this window is attacched but is not the toplevel one - // then it is hidden completely behind the other windows - // and we can avoid to paint it :) - if(g_pFrame->mdiManager()->isInSDIMode() && - (m_pListView->window()->mdiParent() != g_pFrame->mdiManager()->topChild()) && - (m_pListView->window()->mdiParent())) - { - return; // totally hidden behind other windows - } - - int wdth = width() - m_pScrollBar->width(); - - QRect r = ev->rect(); - if(r.right() > wdth)r.setRight(wdth); - - //debug("PAINT EVENT %d,%d,%d,%d",r.left(),r.top(),r.width(),r.height()); - - KviDoubleBuffer db(width(),height()); - QPixmap * pMemBuffer = db.pixmap(); - - QPainter p(pMemBuffer); - SET_ANTI_ALIASING(p); - p.setFont(KVI_OPTION_FONT(KviOption_fontUserListView)); - -#ifdef COMPILE_USE_QT4 - QFontMetrics fm(p.fontMetrics()); -#endif - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - if(g_pShadedChildGlobalDesktopBackground) - { - QPoint pnt = mapToGlobal(QPoint(r.left(),r.top())); - p.drawTiledPixmap(r.left(),r.top(),r.width(),r.height(),*g_pShadedChildGlobalDesktopBackground,pnt.x(),pnt.y()); - } else { -#endif - QPixmap *pix = KVI_OPTION_PIXMAP(KviOption_pixmapUserListViewBackground).pixmap(); - p.fillRect(r.left(),r.top(),r.width(),r.height(),KVI_OPTION_COLOR(KviOption_colorUserListViewBackground)); - if(pix) - KviPixmapUtils::drawPixmapWithPainter(&p,pix,KVI_OPTION_UINT(KviOption_uintUserListPixmapAlign),r,width(),height()); -#ifdef COMPILE_PSEUDO_TRANSPARENCY - } -#endif - - KviUserListEntry * e = m_pListView->m_pTopItem; - - int theY = KVI_USERLIST_BORDER_WIDTH - m_iTopItemOffset; - - kvi_time_t curTime = kvi_unixTime(); - - bool bShowIcons = KVI_OPTION_BOOL(KviOption_boolShowUserChannelIcons); - bool bShowState = KVI_OPTION_BOOL(KviOption_boolShowUserChannelState); - bool bShowGender = KVI_OPTION_BOOL(KviOption_boolDrawGenderIcons); - - while(e && theY <= r.bottom()) - { - int bottom = theY + e->m_iHeight; - // theY is our top line - // theX is our left corner - // bottom is our bottom line - // wdth is the width of the whole widget - - if(bottom >= r.top()) - { - QColor * pClrFore = 0; - bool bColorAllocated=0; // FIXME: bool is true or false - if(e->m_bSelected) - { - p.fillRect(0,theY,wdth,e->m_iHeight,KVI_OPTION_COLOR(KviOption_colorUserListViewSelectionBackground)); - pClrFore = &(KVI_OPTION_COLOR(KviOption_colorUserListViewSelectionForeground)); - } else if(KVI_OPTION_BOOL(KviOption_boolUseDifferentColorForOwnNick) && m_pListView->m_pKviWindow->connection()) - { - if(e->m_szNick==m_pListView->m_pKviWindow->connection()->currentNickName()) - pClrFore = &(KVI_OPTION_COLOR(KviOption_colorUserListViewOwnForeground)); - } - - if(!pClrFore){ - // FIXME: - // - // this is slow... VERY slow when one has a lot of registered users. - // (this is NOT a simple lookup in the user db... it is a mask match) - // if we REALLY need to use custom colors for regged users then - // they should be updated ONCE and stored (cached) in the KviUserListEntry structure - // - if(m_pListView->m_pKviWindow->connection()->userDataBase()->haveCustomColor(e->m_szNick)) - { - pClrFore = m_pListView->m_pKviWindow->connection()->userDataBase()->customColor(e->m_szNick); - } - if(!pClrFore) - { - if(e->m_iFlags == 0) - { - pClrFore = &(KVI_OPTION_COLOR(KviOption_colorUserListViewNormalForeground)); - } else { - pClrFore = &(KVI_OPTION_COLOR((e->m_iFlags & KVI_USERFLAG_CHANOWNER) ? \ - KviOption_colorUserListViewChanOwnerForeground : ((e->m_iFlags & KVI_USERFLAG_CHANADMIN) ? \ - KviOption_colorUserListViewChanAdminForeground : ((e->m_iFlags & KVI_USERFLAG_OP) ? \ - KviOption_colorUserListViewOpForeground : ((e->m_iFlags & KVI_USERFLAG_HALFOP) ? \ - KviOption_colorUserListViewHalfOpForeground : ((e->m_iFlags & KVI_USERFLAG_VOICE) ? \ - KviOption_colorUserListViewVoiceForeground : KviOption_colorUserListViewUserOpForeground)))))); - } - } - } - - int theX = KVI_USERLIST_BORDER_WIDTH + 1; - - int iAvatarAndTextX = theX; - - if(bShowGender)iAvatarAndTextX += 11; - if(bShowIcons)iAvatarAndTextX += 18; - if(bShowState)iAvatarAndTextX += 11; - - if(KVI_OPTION_BOOL(KviOption_boolUserListViewDrawGrid)) - { - // the grid - switch(KVI_OPTION_UINT(KviOption_uintUserListViewGridType)) - { - case KVI_USERLISTVIEW_GRIDTYPE_PLAINGRID: - case KVI_USERLISTVIEW_GRIDTYPE_DOTGRID: - p.setPen(QPen(KVI_OPTION_COLOR(KviOption_colorUserListViewGrid),0, -#ifdef COMPILE_USE_QT4 - (KVI_OPTION_UINT(KviOption_uintUserListViewGridType) == KVI_USERLISTVIEW_GRIDTYPE_DOTGRID) ? Qt::DotLine : Qt::SolidLine)); -#else - (KVI_OPTION_UINT(KviOption_uintUserListViewGridType) == KVI_USERLISTVIEW_GRIDTYPE_DOTGRID) ? QPen::DotLine : QPen::SolidLine)); -#endif - p.drawLine(0,bottom - 1,wdth,bottom - 1); - if(bShowState || bShowIcons) - p.drawLine(iAvatarAndTextX,bottom - 1,iAvatarAndTextX,theY); - break; - default: // KVI_USERLISTVIEW_GRIDTYPE_3DGRID and KVI_USERLISTVIEW_GRIDTYPE_3DBUTTONS - if(!e->m_bSelected) - { - p.setPen(QPen(KVI_OPTION_COLOR(KviOption_colorUserListViewGrid),0 /*,QPen::DotLine*/)); - if((bShowState || bShowIcons) && (KVI_OPTION_UINT(KviOption_uintUserListViewGridType) == KVI_USERLISTVIEW_GRIDTYPE_3DGRID)) - p.drawLine(iAvatarAndTextX,bottom - 1,iAvatarAndTextX,theY); - p.setPen(colorGroup().shadow()); - p.drawLine(0,bottom - 1,wdth,bottom - 1); - p.setPen(colorGroup().light()); - p.drawLine(0,theY,wdth,theY); - theY--; - } - theY++; - break; - } - iAvatarAndTextX += 3; - } else { - iAvatarAndTextX += 1; - } - - if(e->globalData()->isAway()) - { - QRgb rgb2 = pClrFore->rgb(); - QRgb rgb1 = KVI_OPTION_COLOR(KviOption_colorUserListViewAwayForeground).rgb(); - p.setPen(QColor(((qRed(rgb1)*2) + qRed(rgb2)) / 3,((qGreen(rgb1)*2) + qGreen(rgb2)) / 3,((qBlue(rgb1)*2) + qBlue(rgb2)) / 3)); - } else { - p.setPen(*pClrFore); - } - theY+=2; - - if(!KVI_OPTION_BOOL(KviOption_boolDisableAvatars))//G&N 2005 - { - KviAvatar * av = e->m_pGlobalData->avatar(); - if(av && KVI_OPTION_UINT(KviOption_uintAvatarScaleWidth) && KVI_OPTION_UINT(KviOption_uintAvatarScaleHeight)) - { - QPixmap * pix; - if( KVI_OPTION_BOOL(KviOption_boolScaleAvatars) && - ( - !KVI_OPTION_BOOL(KviOption_boolDoNotStretchAvatars) || - (av->pixmap()->width() > KVI_OPTION_UINT(KviOption_uintAvatarScaleWidth)) || - (av->pixmap()->height() > KVI_OPTION_UINT(KviOption_uintAvatarScaleHeight)) - ) - ) - pix=av->scaledPixmap(KVI_OPTION_UINT(KviOption_uintAvatarScaleWidth),KVI_OPTION_UINT(KviOption_uintAvatarScaleHeight)); - else - pix=av->pixmap(); - p.drawPixmap(iAvatarAndTextX,theY,*pix); - theY += pix->height() + 1; - } - } - - if(bShowGender) - { - if(e->globalData()->gender()!=KviIrcUserEntry::Unknown) - { - QPixmap * ico = g_pIconManager->getBigIcon((e->globalData()->gender()==KviIrcUserEntry::Male) ? "kvi_icon_male.png" : "kvi_icon_female.png"); - p.drawPixmap(theX,theY+(m_pListView->m_iFontHeight-11)/2,*ico); - } - if(e->globalData()->isBot()) - { - QPixmap * ico = g_pIconManager->getBigIcon("kvi_icon_bot.png"); - p.drawPixmap(theX,theY+(m_pListView->m_iFontHeight-11)/2,*ico); - } - theX +=11; - } - - if(bShowState) - { - if(e->m_lastActionTime) - { - // the g_pUserChanStatePixmap is 36 x 80 pixels - // divided into 6 rows of 5 pixmaps - // row 0 is hot , row 5 is cold - // left is most active , right is least active - // e->m_iTemperature is a signed short , negative values are cold - // e->m_lastActionTime is the time of the last action (eventually 0 , if not known) - // 6 bit right shift is an aprox division for 64 : really aprox minutes - unsigned int uTimeDiff = (((unsigned int)(curTime - e->m_lastActionTime)) >> 6); - if(uTimeDiff < 16) - { - //p.drawRect(theX,theY + 2,10,e->m_iHeight - 4); - static int xOffTable[16] = - { - 0 , 8 , 16 , 16 , - 24 , 24 , 24 , 24 , - 32 , 32 , 32 , 32 , - 32 , 32 , 32 , 32 - }; - // the temperature now - // temp > 100 is hot (offset y = 0) - // temp < -100 is cold (offset y = 80) - // temp > 30 is half-hot (offset y = 16) - // temp < -30 is half-cold (offset y = 64) - // temp > 0 is a-bit-hot (offset y = 32) - // temp < 0 is a-bit-cold (offset y = 48) - - if(e->m_iTemperature > KVI_MID_TEMPERATURE) - { - if(e->m_iTemperature > KVI_HALF_HOT_TEMPERATURE) - { - if(e->m_iTemperature > KVI_HOT_TEMPERATURE) - { - // hot - p.drawPixmap(theX,theY,*g_pUserChanStatePixmap,xOffTable[uTimeDiff],0,8,16); - } else { - // half-hot - p.drawPixmap(theX,theY,*g_pUserChanStatePixmap,xOffTable[uTimeDiff],16,8,16); - } - } else { - // bit-hot - p.drawPixmap(theX,theY,*g_pUserChanStatePixmap,xOffTable[uTimeDiff],32,8,16); - } - } else { - if(e->m_iTemperature < KVI_HALF_COLD_TEMPERATURE) - { - if(e->m_iTemperature < KVI_COLD_TEMPERATURE) - { - // cold - p.drawPixmap(theX,theY,*g_pUserChanStatePixmap,xOffTable[uTimeDiff],80,8,16); - } else { - // half-cold - p.drawPixmap(theX,theY,*g_pUserChanStatePixmap,xOffTable[uTimeDiff],64,8,16); - } - } else { - // bit-cold - p.drawPixmap(theX,theY,*g_pUserChanStatePixmap,xOffTable[uTimeDiff],48,8,16); - } - } - } - } - theX += 11; - } - - if(bShowIcons) - { - //p.drawRect(theX,theY + 2,18,e->m_iHeight - 4); - if(e->m_iFlags != 0) - { - QPixmap * ico = g_pIconManager->getSmallIcon( \ - e->globalData()->isAway() ? \ - ( \ - (e->m_iFlags & KVI_USERFLAG_CHANOWNER) ? \ - KVI_SMALLICON_CHANOWNERAWAY : ((e->m_iFlags & KVI_USERFLAG_CHANADMIN) ? \ - KVI_SMALLICON_CHANADMINAWAY : ((e->m_iFlags & KVI_USERFLAG_OP) ? \ - KVI_SMALLICON_OPAWAY : ((e->m_iFlags & KVI_USERFLAG_HALFOP) ? \ - KVI_SMALLICON_HALFOPAWAY : ((e->m_iFlags & KVI_USERFLAG_VOICE) ? \ - KVI_SMALLICON_VOICEAWAY : KVI_SMALLICON_USEROPAWAY)))) - ) \ - : \ - ( \ - (e->m_iFlags & KVI_USERFLAG_CHANOWNER) ? \ - KVI_SMALLICON_CHANOWNER : ((e->m_iFlags & KVI_USERFLAG_CHANADMIN) ? \ - KVI_SMALLICON_CHANADMIN : ((e->m_iFlags & KVI_USERFLAG_OP) ? \ - KVI_SMALLICON_OP : ((e->m_iFlags & KVI_USERFLAG_HALFOP) ? \ - KVI_SMALLICON_HALFOP : ((e->m_iFlags & KVI_USERFLAG_VOICE) ? \ - KVI_SMALLICON_VOICE : KVI_SMALLICON_USEROP)))) \ - ) \ - ); -#ifdef COMPILE_USE_QT4 - p.drawPixmap(theX,theY+(fm.lineSpacing()-16/*size of small icon*/)/2,*ico); -#else - p.drawPixmap(theX,theY+(m_pListView->m_iFontHeight-16/*size of small icon*/)/2,*ico); -#endif - } - theX +=18; -#ifdef COMPILE_USE_QT4 - p.drawText(iAvatarAndTextX,theY,wdth - theX,fm.lineSpacing(),Qt::AlignLeft|Qt::AlignVCenter,e->m_szNick); -#else - p.drawText(iAvatarAndTextX,theY,wdth - theX,m_pListView->m_iFontHeight,Qt::AlignLeft|Qt::AlignVCenter,e->m_szNick); -#endif - } else { - - char flag = m_pListView->getUserFlag(e); - if(flag) - { - QString ttt = QChar(flag); - ttt += e->m_szNick; -#ifdef COMPILE_USE_QT4 - p.drawText(iAvatarAndTextX,theY,wdth - theX,fm.lineSpacing(),Qt::AlignLeft|Qt::AlignVCenter,ttt); -#else - p.drawText(iAvatarAndTextX,theY,wdth - theX,m_pListView->m_iFontHeight,Qt::AlignLeft|Qt::AlignVCenter,ttt); -#endif - } else { -#ifdef COMPILE_USE_QT4 - p.drawText(iAvatarAndTextX,theY,wdth - theX,fm.lineSpacing(),Qt::AlignLeft|Qt::AlignVCenter,e->m_szNick); -#else - p.drawText(iAvatarAndTextX,theY,wdth - theX,m_pListView->m_iFontHeight,Qt::AlignLeft|Qt::AlignVCenter,e->m_szNick); -#endif - } - } - if(bColorAllocated) delete pClrFore; - } - - theY = bottom; - e = e->m_pNext; - } - - //we really do not need any self-draw borders. - //if we will need it, we will draw a better one with system style - - //p.setPen(colorGroup().dark()); - //p.drawLine(0,0,wdth,0); - //p.drawLine(0,0,0,height()); - //p.setPen(colorGroup().light()); - //p.drawLine(1,height()-1,wdth,height()-1); - //p.drawLine(wdth - 1,1,wdth - 1,height()); - -#ifdef COMPILE_USE_QT4 - QPainter qt4SuxBecauseOfThisAdditionalPainter(this); - qt4SuxBecauseOfThisAdditionalPainter.drawPixmap(r.left(),r.top(),r.width(),r.height(),*pMemBuffer,r.left(),r.top(),r.width(),r.height()); -#else - bitBlt(this,r.left(),r.top(),pMemBuffer,r.left(),r.top(),r.width(),r.height(),Qt::CopyROP,false); -#endif -} - -void KviUserListViewArea::resizeEvent(QResizeEvent *) -{ - int iScr = m_pScrollBar->sizeHint().width(); - m_pScrollBar->setGeometry(width() - iScr,0,iScr,height()); - m_pScrollBar->setPageStep(height()); - m_pScrollBar->setLineStep(m_pListView->m_iFontHeight - 1); -} - -void KviUserListViewArea::mousePressEvent(QMouseEvent *e) -{ - setFocus(); - if(e->button() & Qt::LeftButton) - { - KviUserListEntry * entry = m_pListView->itemAt(e->pos()); - if(entry) - { - if(e->state() & Qt::ShiftButton) - { - // Multiselect mode - if(!entry->m_bSelected)m_pListView->m_iSelectedCount++; - entry->m_bSelected = true; - if(m_pListView->m_iSelectedCount == 1)g_pFrame->childWindowSelectionStateChange(m_pListView->m_pKviWindow,true); - update(); - } else if(e->state() & Qt::ControlButton) - { - // Invert mode - if(!entry->m_bSelected)m_pListView->m_iSelectedCount++; - else m_pListView->m_iSelectedCount--; - entry->m_bSelected = ! entry->m_bSelected; - if(m_pListView->m_iSelectedCount == 0)g_pFrame->childWindowSelectionStateChange(m_pListView->m_pKviWindow,false); - else if(m_pListView->m_iSelectedCount == 1)g_pFrame->childWindowSelectionStateChange(m_pListView->m_pKviWindow,true); - update(); - } else { - // Single select mode - bool bThereWasSelection = false; - if(m_pListView->m_iSelectedCount > 0) - { - KviUserListEntry * aux = m_pListView->m_pHeadItem; - while(aux) - { - aux->m_bSelected = false; - aux = aux->m_pNext; - } - bThereWasSelection = true; - } - entry->m_bSelected = true; - m_pListView->m_iSelectedCount = 1; - if(!bThereWasSelection)g_pFrame->childWindowSelectionStateChange(m_pListView->m_pKviWindow,true); - update(); - } - } - m_pLastEntryUnderMouse = entry; - } else if(e->button() & Qt::RightButton) - { - KviUserListEntry * entry = m_pListView->itemAt(e->pos()); - if(entry) - { - if(!entry->m_bSelected){ - entry->m_bSelected = true; - m_pListView->m_iSelectedCount=1; - KviPointerHashTableIterator<QString,KviUserListEntry> it(*(m_pListView->m_pEntryDict)); - while(it.current()) - { - if(it.current()!=entry) - ((KviUserListEntry *)it.current())->m_bSelected = false; - ++it; - } - } - if(m_pListView->m_iSelectedCount == 1) - g_pFrame->childWindowSelectionStateChange(m_pListView->m_pKviWindow,true); - update(); - } - m_pListView->emitRightClick(); - } -} -void KviUserListViewArea::keyPressEvent( QKeyEvent * e ) -{ - if(e->key()==Qt::Key_Escape) - { - if(m_pListView->m_pKviWindow->input()) - ((QWidget*)(m_pListView->m_pKviWindow->input()))->setFocus(); - } else { - QString szKey=e->text(); - if(!szKey.isEmpty()) - { - KviUserListEntry * nick=0; - KviUserListEntry * aux = m_pListView->m_pHeadItem; - while(aux) - { - //debug("%s %s %i %s %i",__FILE__,__FUNCTION__,__LINE__,aux->nick().utf8().data(),aux->nick().find(szKey,0,0)); - if(aux->nick().find(szKey,0,0)==0) - { - nick=aux; - break; - } - aux = aux->m_pNext; - } - if(nick) - { - bool bThereWasSelection = false; - if(m_pListView->m_iSelectedCount > 0) - { - aux = m_pListView->m_pHeadItem; - while(aux) - { - aux->m_bSelected = false; - aux = aux->m_pNext; - } - bThereWasSelection = true; - } - nick->m_bSelected = true; - m_pListView->m_iSelectedCount = 1; - if(!bThereWasSelection)g_pFrame->childWindowSelectionStateChange(m_pListView->m_pKviWindow,true); - update(); - } - } - } -} - -void KviUserListViewArea::mouseDoubleClickEvent(QMouseEvent *e) -{ - m_pListView->emitDoubleClick(); -} - -void KviUserListViewArea::mouseMoveEvent(QMouseEvent *e) -{ - if(e->state() & Qt::LeftButton) - { - KviUserListEntry * entry = m_pListView->itemAt(e->pos()); - if(entry && (entry != m_pLastEntryUnderMouse)) - { - if(e->state() & Qt::ControlButton) - { - if(entry->m_bSelected)m_pListView->m_iSelectedCount--; - else m_pListView->m_iSelectedCount++; - entry->m_bSelected = ! entry->m_bSelected; - if(m_pListView->m_iSelectedCount == 0)g_pFrame->childWindowSelectionStateChange(m_pListView->m_pKviWindow,false); - else if(m_pListView->m_iSelectedCount == 1)g_pFrame->childWindowSelectionStateChange(m_pListView->m_pKviWindow,true); - } else { - if(!entry->m_bSelected)m_pListView->m_iSelectedCount++; - entry->m_bSelected = true; - if(m_pListView->m_iSelectedCount == 1)g_pFrame->childWindowSelectionStateChange(m_pListView->m_pKviWindow,true); - } - update(); - m_pLastEntryUnderMouse = entry; - } else { - // out of the widget ? - if(entry == m_pLastEntryUnderMouse)return; - if(e->pos().y() < KVI_USERLIST_BORDER_WIDTH) - { - KviUserListEntry * top = m_pListView->m_pTopItem; - if(top) - { - m_pScrollBar->setValue(m_pScrollBar->value() - top->m_iHeight); - if(m_pListView->m_pTopItem != top) - { - if(e->state() & Qt::ControlButton) - { - if(m_pListView->m_pTopItem->m_bSelected)m_pListView->m_iSelectedCount--; - else m_pListView->m_iSelectedCount++; - m_pListView->m_pTopItem->m_bSelected = ! m_pListView->m_pTopItem->m_bSelected; - if(m_pListView->m_iSelectedCount == 0)g_pFrame->childWindowSelectionStateChange(m_pListView->m_pKviWindow,false); - else if(m_pListView->m_iSelectedCount == 1)g_pFrame->childWindowSelectionStateChange(m_pListView->m_pKviWindow,true); - } else { - if(!m_pListView->m_pTopItem->m_bSelected)m_pListView->m_iSelectedCount++; - m_pListView->m_pTopItem->m_bSelected = true; - if(m_pListView->m_iSelectedCount == 1)g_pFrame->childWindowSelectionStateChange(m_pListView->m_pKviWindow,true); - } - update(); - } - } - m_pLastEntryUnderMouse = top; - } else if(e->pos().y() > (height() - KVI_USERLIST_BORDER_WIDTH)) - { - KviUserListEntry * bottom = m_pListView->m_pTopItem; - if(bottom) - { - int theY = KVI_USERLIST_BORDER_WIDTH - m_iTopItemOffset; - while(bottom && (theY < height())) - { - theY+= bottom->m_iHeight; - bottom = bottom->m_pNext; - } - if(!bottom)bottom = m_pListView->m_pTailItem; - if(bottom) - { - m_pScrollBar->setValue(m_pScrollBar->value() + bottom->m_iHeight); - if(bottom != m_pLastEntryUnderMouse) - { - if(e->state() & Qt::ControlButton) - { - if(bottom->m_bSelected)m_pListView->m_iSelectedCount--; - else m_pListView->m_iSelectedCount++; - bottom->m_bSelected = ! bottom->m_bSelected; - if(m_pListView->m_iSelectedCount == 0)g_pFrame->childWindowSelectionStateChange(m_pListView->m_pKviWindow,false); - else if(m_pListView->m_iSelectedCount == 1)g_pFrame->childWindowSelectionStateChange(m_pListView->m_pKviWindow,true); - } else { - if(!bottom->m_bSelected)m_pListView->m_iSelectedCount++; - bottom->m_bSelected = true; - if(m_pListView->m_iSelectedCount == 1)g_pFrame->childWindowSelectionStateChange(m_pListView->m_pKviWindow,true); - } - update(); - } - } - } - m_pLastEntryUnderMouse = bottom; - } else m_pLastEntryUnderMouse = 0; - } - } -} - -void KviUserListViewArea::mouseReleaseEvent(QMouseEvent *) -{ - m_pLastEntryUnderMouse = 0; -} - -void KviUserListViewArea::wheelEvent(QWheelEvent *e) -{ -#ifdef COMPILE_USE_QT4 - static bool bHere = false; // Qt4(<= 4.2.2) has a nasty bug that makes the re-sent wheelEvent to cause infinite recursion - if(bHere)return; - bHere = true; -#endif - g_pApp->sendEvent(m_pScrollBar,e); -#ifdef COMPILE_USE_QT4 - bHere = false; -#endif -} - -#include "kvi_userlistview.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_userlistview.h b/3.4.0/src/kvirc/ui/kvi_userlistview.h deleted file mode 100644 index 33943fa45d..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_userlistview.h +++ /dev/null @@ -1,259 +0,0 @@ -#ifndef _KVI_USERLISTVIEW_H_ -#define _KVI_USERLISTVIEW_H_ - -//============================================================================= -// -// File : kvi_userlistview.h -// Creation date : Tue Aug 1 2000 21:03:41 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_settings.h" - -#include "kvi_string.h" -#include "kvi_ircuserdb.h" -#include "kvi_ircmask.h" -#include "kvi_time.h" - -#include <time.h> -#include "kvi_tal_tooltip.h" -#include <qwidget.h> -#include "kvi_pointerlist.h" -#include "kvi_pointerhashtable.h" -#include "kvi_toolwindows_container.h" - -class QLabel; -class QScrollBar; - -class KviUserListView; -class KviUserListViewArea; -class KviConsole; -class KviWindow; - -#define KVI_USERLISTVIEW_GRIDTYPE_3DGRID 0 -#define KVI_USERLISTVIEW_GRIDTYPE_3DBUTTONS 1 -#define KVI_USERLISTVIEW_GRIDTYPE_PLAINGRID 2 -#define KVI_USERLISTVIEW_GRIDTYPE_DOTGRID 3 - -#define KVI_USERLISTVIEW_GRIDTYPE_MAXIMUM 3 -#define KVI_USERLISTVIEW_GRIDTYPE_DEFAULT 0 - -class KVIRC_API KviUserListToolTip : public KviTalToolTip -{ -public: - KviUserListToolTip(KviUserListView *v,KviUserListViewArea * a); - virtual ~KviUserListToolTip(); -private: - KviUserListView * m_pListView; -public: - virtual void maybeTip(const QPoint &pnt); - void doTip(const QRect &rct,const QString &str){ tip(rct,str); }; -}; - - - -class KVIRC_API KviUserListEntry -{ - friend class KviUserListView; - friend class KviUserListViewArea; -public: - KviUserListEntry(KviUserListView * parent,const QString &nick,KviIrcUserEntry * e,short int iFlags,bool bJoinTimeUnknown = true); - ~KviUserListEntry(); -protected: - KviUserListView * m_pListView; - QString m_szNick; - KviIrcUserEntry * m_pGlobalData; - short int m_iFlags; - short int m_iTemperature; // user temperature : 0 = neutral - kvi_time_t m_lastActionTime; - kvi_time_t m_joinTime; - - int m_iHeight; - bool m_bSelected; - KviUserListEntry * m_pNext; - KviUserListEntry * m_pPrev; -public: - short int flags() const { return m_iFlags; }; - KviIrcUserEntry * globalData(){ return m_pGlobalData; }; - const QString &nick() const { return m_szNick; }; - KviUserListEntry * next(){ return m_pNext; }; - bool color(QColor& color); -protected: - void recalcSize(); -}; - - -typedef struct _KviUserListViewUserStats -{ - unsigned int uTotal; // total users on the channel - unsigned int uActive; // active users in the last 10 mins - unsigned int uActiveOp; // active operators in the last 10 minutes - unsigned int uHot; // hot active users - unsigned int uHotOp; // hot operators - unsigned int uOp; // total operators - unsigned int uHalfOp; // total halfops - unsigned int uVoiced; // total voiced users - unsigned int uChanAdmin; // total channel administrators - unsigned int uChanOwner; // total channel owners - unsigned int uUserOp; // total userops (uops) - int iAvgTemperature; // average user temperature -} KviUserListViewUserStats; - - -class KVIRC_API KviUserListView : public KviWindowToolWidget -{ - friend class KviUserListEntry; - friend class KviUserListViewArea; - friend class KviUserListToolTip; - friend class KviConsole; - friend class KviChannel; - friend class KviQuery; - Q_OBJECT -public: - KviUserListView(QWidget * parent,KviWindowToolPageButton* button,KviIrcUserDataBase * db,KviWindow * pWnd,int dictSize = 5,const QString &label_text = QString::null,const char * name = 0); - ~KviUserListView(); -protected: - KviPointerHashTable<QString,KviUserListEntry> * m_pEntryDict; - KviUserListEntry * m_pTopItem; - KviUserListEntry * m_pHeadItem; - KviUserListEntry * m_pTailItem; - KviUserListEntry * m_pIterator; - QLabel * m_pUsersLabel; - KviUserListViewArea * m_pViewArea; - KviIrcUserDataBase * m_pIrcUserDataBase; - int m_iSelectedCount; - int m_iOpCount; - int m_iVoiceCount; - int m_iHalfOpCount; - int m_iChanAdminCount; - int m_iChanOwnerCount; - int m_iUserOpCount; - int m_iTotalHeight; - int m_iFontHeight; - KviUserListToolTip * m_pToolTip; - int m_ibEntries; - int m_ieEntries; - int m_iIEntries; - KviWindow * m_pKviWindow; -protected: - void maybeTip(KviUserListToolTip * tip,const QPoint &pnt); - void triggerUpdate(); - void updateUsersLabel(); - void insertUserEntry(const QString &nick,KviUserListEntry * e); - void removeAllEntries(); - virtual void resizeEvent(QResizeEvent *); - bool partInternal(const QString &nick,bool bRemove = true); - void setUserDataBase(KviIrcUserDataBase * db){ m_pIrcUserDataBase = db; }; - void updateScrollBarRange(); -public: - void updateArea(); - void select(const QString&); - void applyOptions(); - KviPointerHashTable<QString,KviUserListEntry> * entryDict(){ return m_pEntryDict; }; - KviUserListEntry * firstItem(){ return m_pHeadItem; }; - KviUserListEntry * itemAt(const QPoint &pnt,QRect * rct = 0); - bool itemVisible(KviUserListEntry * e); - KviWindow * window(){ return m_pKviWindow; }; - - unsigned int count(){ return m_pEntryDict->count(); }; - int selectedCount(){ return m_iSelectedCount; }; - int opCount(){ return m_iOpCount; }; - int voiceCount(){ return m_iVoiceCount; }; - int chanOwnerCount(){ return m_iChanOwnerCount; }; - int chanAdminCount(){ return m_iChanAdminCount; }; - int halfOpCount(){ return m_iHalfOpCount; }; - int userOpCount(){ return m_iUserOpCount; }; - - KviUserListEntry * findEntry(const QString &nick){ return nick.isEmpty() ? 0 : m_pEntryDict->find(nick); }; - void appendSelectedNicknames(QString &buffer); - QString * firstSelectedNickname(); - QString * nextSelectedNickname(); - void partAll(); - void partAllButOne(const QString &whoNot); - void userStats(KviUserListViewUserStats * s); - int getUserModeLevel(const QString &nick); - kvi_time_t getUserJoinTime(const QString &nick); - kvi_time_t getUserLastActionTime(const QString &nick); - char getUserFlag(KviUserListEntry * e); - char getUserFlag(const QString &nick){ return getUserFlag(m_pEntryDict->find(nick)); }; - bool part(const QString &nick){ return partInternal(nick,true); }; - bool op(const QString &nick,bool bOp); - void prependUserFlag(const QString &nick,QString &buffer); - int flags(const QString &nick); - bool isOp(const QString &nick,bool bAtLeast = false); - bool isVoice(const QString &nick,bool bAtLeast = false); - bool isHalfOp(const QString &nick,bool bAtLeast = false); - bool isChanAdmin(const QString &nick,bool bAtLeast = false); - bool isChanOwner(const QString &nick,bool bAtLeast = false); - bool isUserOp(const QString &nick,bool bAtLeast = false); - bool voice(const QString &nick,bool bVoice); - bool setChanAdmin(const QString &nick,bool bChanAdmin); - bool setChanOwner(const QString &nick,bool bChanOwner); - bool halfop(const QString &nick,bool bHalfOp); - bool userop(const QString &nick,bool bUserOp); - void userAction(KviIrcMask *user,int actionTemperature); - bool userActionVerifyMask(const QString &nick,const QString &user,const QString &host,int actionTemperature,QString &oldUser,QString &oldHost); - void userAction(const QString &nick,const QString &user,const QString &host,int actionTemperature); - void userAction(const QString &nick,int actionTemperature); - bool nickChange(const QString &oldNick,const QString &newNick); - //KviUserListEntry * join(const char *nick,const char * user,const char * host,bool bOp,bool bVoice,bool bHalfOp); - KviUserListEntry * join(const QString &nick,const QString &user = QString::null,const QString &host = QString::null,int iFlags = 0); - bool avatarChanged(const QString &nick); - void enableUpdates(bool bEnable); - void setMaskEntries(char type, int num); - void emitRightClick(); - void emitDoubleClick(); - bool completeNickStandard(const QString &begin,const QString &skipAfter,QString &buffer,bool bAppendMask); - void completeNickBashLike(const QString &begin,KviPointerList<QString> * l,bool bAppendMask); -}; - -class KVIRC_API KviUserListViewArea : public QWidget -{ - friend class KviUserListView; - - Q_OBJECT - Q_PROPERTY(int TransparencyCapable READ dummyRead) -public: - KviUserListViewArea(KviUserListView * par); - ~KviUserListViewArea(); -public: - int dummyRead() const { return 0; }; -protected: - KviUserListView * m_pListView; - KviUserListEntry * m_pLastEntryUnderMouse; - QScrollBar * m_pScrollBar; - int m_iLastScrollBarVal; - int m_iTopItemOffset; - bool m_bIgnoreScrollBar; -protected: - virtual void paintEvent(QPaintEvent *); - virtual void resizeEvent(QResizeEvent *); - virtual void mousePressEvent(QMouseEvent *e); - virtual void mouseMoveEvent(QMouseEvent *e); - virtual void mouseReleaseEvent(QMouseEvent *); - virtual void mouseDoubleClickEvent(QMouseEvent *e); - virtual void wheelEvent(QWheelEvent *e); - virtual void keyPressEvent( QKeyEvent * e ); -protected slots: - void scrollBarMoved(int newVal); -}; - - -#endif //!_KVI_USERLISTVIEW_H_ diff --git a/3.4.0/src/kvirc/ui/kvi_window.cpp b/3.4.0/src/kvirc/ui/kvi_window.cpp deleted file mode 100644 index 0f4178cc14..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_window.cpp +++ /dev/null @@ -1,1518 +0,0 @@ -//============================================================================= -// -// File : kvi_window.cpp -// Creation date : Tue Jul 6 1999 14:52:11 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 __KVIRC__ -#define KVI_WINDOW_MIN_WIDTH 100 -#define KVI_WINDOW_MIN_HEIGHT 100 - -#define _KVI_WINDOW_CPP_ - -#define _KVI_DEBUG_CHECK_RANGE_ - -#include "kvi_debug.h" -#include "kvi_app.h" -#include "kvi_window.h" -#include "kvi_frame.h" -#include "kvi_taskbar.h" -#include "kvi_iconmanager.h" -#include "kvi_mdichild.h" -#include "kvi_locale.h" -#include "kvi_ircview.h" -#include "kvi_out.h" -#include "kvi_malloc.h" -#include "kvi_input.h" -#include "kvi_fileutils.h" -#include "kvi_options.h" -#include "kvi_config.h" -#include "kvi_irccontext.h" -#include "kvi_console.h" -#include "kvi_ircconnectionserverinfo.h" -#include "kvi_mirccntrl.h" -#include "kvi_toolwindows_container.h" -#include "kvi_styled_controls.h" -#include "kvi_kvs_script.h" - -#include <qpixmap.h> -#include "kvi_tal_popupmenu.h" -#include <qcursor.h> -#include <qtimer.h> -#include <qsplitter.h> -#include <qmetaobject.h> -#include <qdatetime.h> -#include <qtextcodec.h> -#include <qevent.h> - -// it looks they can't decide :D -#ifdef COMPILE_USE_QT4 - #include <QPushButton> - #include <qdesktopwidget.h> -#else - #include <qobjectlist.h> -#endif - - -#include <qvariant.h> -#include <qtoolbutton.h> -#include "kvi_tal_tooltip.h" -#include <qmessagebox.h> - -#ifdef COMPILE_CRYPT_SUPPORT - #include "kvi_crypt.h" - #include "kvi_cryptcontroller.h" -#endif - -#ifdef COMPILE_KDE_SUPPORT - #include <kwin.h> - #include <kdeversion.h> -#endif - -#ifdef COMPILE_ON_WINDOWS - #include <windows.h> -#endif - -KVIRC_API KviWindow * g_pActiveWindow = 0; - -static KviTalPopupMenu * g_pMdiWindowSystemMainPopup = 0; -static KviTalPopupMenu * g_pMdiWindowSystemTextEncodingPopup = 0; -static KviTalPopupMenu * g_pMdiWindowSystemTextEncodingPopupStandard = 0; -static KviTalPopupMenu * g_pMdiWindowSystemTextEncodingPopupSmart = 0; -static KviTalPopupMenu * g_pMdiWindowSystemTextEncodingPopupSmartUtf8 = 0; - -unsigned long int g_uUniqueWindowId = 1; - -// FIXME: #warning "Mouse wheel support" -KviWindow::KviWindow(int type,KviFrame * lpFrm,const QString &name,KviConsole * lpConsole) - : QWidget(0) -{ - m_uId = g_uUniqueWindowId; - g_uUniqueWindowId++; - - - // FIXME: REMOVE THIS - setName(name); - // END FIXME - m_szName = name; - - g_pApp->registerWindow(this); - - m_iType = type; - m_pFocusHandler = 0; - - m_pFrm = lpFrm; // FIXME: Should disappear! - m_pIrcView = 0; - m_pInput = 0; - m_pSplitter = 0; - m_pButtonBox = 0; - m_pConsole = lpConsole; - m_pContext = lpConsole ? lpConsole->context() : 0; - m_pLastFocusedChild = 0; - m_pTextCodec = 0; // will be set by loadProperties - m_pTextEncodingButton = 0; - m_pHideToolsButton = 0; -// m_pEditorsContainer = 0; - -#ifdef COMPILE_CRYPT_SUPPORT - - m_pCryptControllerButton = 0; - m_pCryptController = 0; - m_pCryptSessionInfo = 0; -#endif - - m_pAccel = 0; - - m_pTaskBarItem = 0; - - setMinimumSize(KVI_WINDOW_MIN_WIDTH,KVI_WINDOW_MIN_HEIGHT); -#ifdef COMPILE_USE_QT4 - //setAutoFillBackground(false); - setFocusPolicy(Qt::StrongFocus); -#else - setBackgroundMode(NoBackground); - setFocusPolicy(StrongFocus); -#endif - - connect(g_pApp,SIGNAL(reloadImages()),this,SLOT(reloadImages())); -} - -KviWindow::~KviWindow() -{ - //g_pFrame->childWindowDestroyed(this); - destroyTaskBarItem(); - g_pApp->unregisterWindow(this); - if(g_pApp->windowCount() == 0) - { - // this is the last window! - if(g_pMdiWindowSystemMainPopup) - delete g_pMdiWindowSystemMainPopup; - if(g_pMdiWindowSystemTextEncodingPopup) - delete g_pMdiWindowSystemTextEncodingPopup; - if(g_pMdiWindowSystemTextEncodingPopupStandard) - delete g_pMdiWindowSystemTextEncodingPopupStandard; - if(g_pMdiWindowSystemTextEncodingPopupSmart) - delete g_pMdiWindowSystemTextEncodingPopupSmart; - if(g_pMdiWindowSystemTextEncodingPopupSmartUtf8) - delete g_pMdiWindowSystemTextEncodingPopupSmartUtf8; - } -#ifdef COMPILE_CRYPT_SUPPORT - if(m_pCryptSessionInfo) - KviCryptController::destroyCryptSessionInfo(&m_pCryptSessionInfo); -#endif -} - -void KviWindow::setWindowName(const QString &szName) -{ - m_szName = szName; - emit windowNameChanged(); -} - -void KviWindow::toggleButtonContainer() -{ - QFrame *pContainer=buttonContainer(); - if(pContainer) - { - pContainer->setHidden(!pContainer->isHidden()); - } -} - -void KviWindow::setName(const char * name) -{ - m_szName = name; - QWidget::setName(name); -} - -KviIrcConnection * KviWindow::connection() -{ - return m_pContext ? m_pContext->connection() : 0; -} - -void KviWindow::reloadImages() -{ - updateIcon(); -} - -bool KviWindow::hasAttention() -{ - if(((QApplication *)g_pApp)->activeWindow() == 0)return false; // no application window has the focus atm - - if(mdiParent()) - { - if(frame()->isActiveWindow())return true; - // This frame is not the active window but the - // active window still belongs to KVIrc. - // When the active window is derived from QDialog - // then it is probably a KVIrc's option dialog - // or something similar. - // In this case we assume that the user has the - // KVIrc window just below and can see it. - - // Handle the special case of the dialogs then - QWidget * w = ((QApplication *)g_pApp)->activeWindow(); - if(w->inherits("QDialog")) - { - // but make sure that the frame is visible at all! - if(!frame()->isVisible())return false; - return true; - } - // any other class is so unfrequent that we ignore it - } else { - // when the window is undocked, instead - // it is likely to be covered by KVIrc or other windows... - if(isActiveWindow())return true; - } - return false; -} - -void KviWindow::demandAttention() -{ - if(mdiParent()) - { - if(frame()->isActiveWindow())return; -#ifdef COMPILE_ON_WINDOWS - FLASHWINFO fwi; - fwi.cbSize = sizeof(fwi); - fwi.hwnd = (HWND)(frame()->winId()); - fwi.dwFlags = FLASHW_TRAY | FLASHW_TIMERNOFG; - fwi.uCount = 20; - fwi.dwTimeout = 500; - FlashWindowEx(&fwi); -#else - #ifdef COMPILE_KDE_SUPPORT - #if (KDE_VERSION_MAJOR >= 3) && (KDE_VERSION_MINOR >= 2) - KWin::demandAttention(frame()->winId(),true); - #endif - #endif -#endif - } else { - if(isActiveWindow())return; -#ifdef COMPILE_ON_WINDOWS - FLASHWINFO fwi; - fwi.cbSize = sizeof(fwi); - fwi.hwnd = (HWND)winId(); - fwi.dwFlags = FLASHW_TRAY | FLASHW_TIMERNOFG; - fwi.uCount = 20; - fwi.dwTimeout = 500; - FlashWindowEx(&fwi); -#else - #ifdef COMPILE_KDE_SUPPORT - #if (KDE_VERSION_MAJOR >= 3) && (KDE_VERSION_MINOR >= 2) - KWin::demandAttention(winId(),true); - #endif - #endif -#endif - } -} - -bool KviWindow::focusNextPrevChild(bool next) -{ - QWidget * w = focusWidget(); - if(w) - { -#ifdef COMPILE_USE_QT4 - if(w->focusPolicy() == Qt::StrongFocus)return false; -#else - if(w->focusPolicy() == QWidget::StrongFocus)return false; -#endif - //QVariant v = w->property("KviProperty_FocusOwner"); - //if(v.isValid())return false; // Do NOT change the focus widget! - - if(w->parent()) - { -#ifdef COMPILE_USE_QT4 - if(w->parent()->metaObject()->indexOfProperty("KviProperty_ChildFocusOwner") == -1) -#else - if(w->parent()->metaObject()->findProperty("KviProperty_ChildFocusOwner") == -1) -#endif - return false; // Do NOT change the focus widget! - } - } - - return QWidget::focusNextPrevChild(next); -} - -void KviWindow::forceTextCodec(QTextCodec * c) -{ - if(!c)return; - m_pTextCodec = c; - QTextCodec * dc = defaultTextCodec(); - if(dc != c) - m_szTextEncoding = c->name(); - else - m_szTextEncoding = ""; // this is the default anyway -} - -bool KviWindow::setTextEncoding(const QString &szTextEncoding) -{ - if(!szTextEncoding.isEmpty()) - { - m_pTextCodec = KviLocale::codecForName(szTextEncoding.latin1()); - if(m_pTextCodec) - { - m_szTextEncoding = szTextEncoding; - return true; - } - // this is an error because we specified an encoding - // and we couldn't find a codec for this - } // else it is empty : this means : guess from locale - // either empty or not found... - m_pTextCodec = 0; - m_szTextEncoding = ""; // empty: we're using the default - return false; -} - -QTextCodec * KviWindow::defaultTextCodec() -{ - // if we have a connection try to inherit from there... - if(connection()) - { - QTextCodec * c = connection()->textCodec(); - if(c)return c; - } - return KviApp::defaultTextCodec(); -} - -KviQCString KviWindow::encodeText(const QString &szText) -{ - if(!m_pTextCodec)return defaultTextCodec()->fromUnicode(szText); - return m_pTextCodec->fromUnicode(szText); -} - -QString KviWindow::decodeText(const char * szText) -{ - if(!m_pTextCodec)return defaultTextCodec()->toUnicode(szText); - return m_pTextCodec->toUnicode(szText); -} - -bool KviWindow::activityMeter(unsigned int *,unsigned int *) -{ - return false; -} - - -const char * KviWindow::m_typeTable[KVI_WINDOW_NUM_TYPES + 1]= -{ - "console", - "channel", - "query", - "help", - "terminal", - "editor", - "dccchat", - "dccsend", - "socketspy", - "links", - "tool", - "gnutella", - "dirbrowser", - "dcccanvas", - "dccvoice", - "list", - "offer", - "logview", - "deadchannel", - "deadquery", - "scripteditor", - "scriptobject", - "userwindow", - "debug", - // <------ NEW TYPES GO HERE! - "unknown" -}; - -const char * KviWindow::typeString() -{ - if(m_iType < KVI_WINDOW_NUM_TYPES) - { - return m_typeTable[m_iType]; - } - return m_typeTable[KVI_WINDOW_NUM_TYPES]; -} - -void KviWindow::setType(int iType) -{ - m_iType = iType; -} - - -void KviWindow::createTaskBarItem() -{ - if(m_pTaskBarItem)return; - m_pTaskBarItem = g_pFrame->m_pTaskBar->addItem(this); -} - -void KviWindow::destroyTaskBarItem() -{ - if(!m_pTaskBarItem)return; - g_pFrame->m_pTaskBar->removeItem(m_pTaskBarItem); - // m_pTaskBarItem = 0; // actually the taskBarItem destructor sets it -} - -BUTTON_CLASS * KviWindow::createToolButton(QWidget * par,const char * nam,int pixon,int pixoff,const QString & tooltip,bool bOn) -{ -#ifdef COMPILE_USE_QT4 - BUTTON_CLASS * b = new BUTTON_CLASS(par); - b->setObjectName(nam); - b->setFlat(true); - b->setIcon(QIcon(*(g_pIconManager->getSmallIcon(pixon)))); -#else - BUTTON_CLASS * b = new BUTTON_CLASS(par,nam); - b->setToggleButton(true); - b->setUsesBigPixmap(false); - QIconSet is1; - is1.setPixmap(*(g_pIconManager->getSmallIcon(pixon)),QIconSet::Small,QIconSet::Normal,QIconSet::On); - is1.setPixmap(*(g_pIconManager->getSmallIcon(pixoff)),QIconSet::Small,QIconSet::Normal,QIconSet::Off); - b->setIconSet(is1); -#endif - - - KviTalToolTip::add - (b,tooltip); - b->setOn(bOn); - return b; -} - -// This is always defined... -void KviWindow::createCryptControllerButton(QWidget * par) -{ -#ifdef COMPILE_CRYPT_SUPPORT - m_pCryptControllerButton = new KviWindowToolPageButton(KVI_SMALLICON_UNLOCKEDOFF,KVI_SMALLICON_UNLOCKED,__tr2qs("Crypting"),buttonContainer(),false,"crypt_controller_button"); - connect(m_pCryptControllerButton,SIGNAL(clicked()),this,SLOT(toggleCryptController())); -#endif // COMPILE_CRYPT_SUPPORT -} - -void KviWindow::createTextEncodingButton(QWidget * par) -{ - if(m_pTextEncodingButton)delete m_pTextEncodingButton; - m_pTextEncodingButton = createToolButton(par,"text_encoding_button",KVI_SMALLICON_TEXTENCODING,KVI_SMALLICON_TEXTENCODING,__tr2qs("Private Text Encoding"),false); - connect(m_pTextEncodingButton,SIGNAL(clicked()),this,SLOT(textEncodingButtonClicked())); -} - -void KviWindow::textEncodingButtonClicked() -{ - createSystemTextEncodingPopup(); - g_pMdiWindowSystemTextEncodingPopup->popup(m_pTextEncodingButton->mapToGlobal(QPoint(0,m_pTextEncodingButton->height()))); - m_pTextEncodingButton->setOn(false); -} - -const QString & KviWindow::lastLineOfText() -{ - if(m_pIrcView) - return m_pIrcView->lastLineOfText(); - return KviQString::empty; -} - -const QString & KviWindow::lastMessageText() -{ - if(m_pIrcView) - return m_pIrcView->lastMessageText(); - return KviQString::empty; -} - -// The following three have to be here even if the crypt support is disabled...moc does not support conditional compilations -void KviWindow::toggleCryptController() -{ -#ifdef COMPILE_CRYPT_SUPPORT - if(!m_pCryptControllerButton->isOn()) - { - if(m_pCryptController) - { - delete m_pCryptController; - m_pCryptController = 0; - if(!m_pCryptControllerButton) - return; - if(m_pCryptControllerButton->isOn()) - m_pCryptControllerButton->setOn(false); - } - } else { - if(m_pSplitter && m_pInput) - { - m_pCryptController = new KviCryptController(m_pSplitter,m_pCryptControllerButton,"crypt_controller",this,m_pCryptSessionInfo); - connect(m_pCryptController,SIGNAL(done()),this,SLOT(cryptControllerFinished())); - //setFocusHandlerNoClass(m_pInput,m_pCryptController,"QLineEdit"); //link it! - m_pCryptController->show(); - if(!m_pCryptControllerButton) - return; - if(!(m_pCryptControllerButton->isOn())) - m_pCryptControllerButton->setOn(true); - } - } -#endif // COMPILE_CRYPT_SUPPORT -} - -#ifdef COMPILE_CRYPT_SUPPORT -void KviWindow::setCryptSessionInfo(KviCryptSessionInfo * inf) -{ - if(m_pCryptSessionInfo) - KviCryptController::destroyCryptSessionInfo(&m_pCryptSessionInfo); - m_pCryptSessionInfo = inf; - if(m_pCryptSessionInfo) - { - connect(m_pCryptSessionInfo->pEngine,SIGNAL(destroyed()),this,SLOT(cryptSessionInfoDestroyed())); - } - if(m_pCryptControllerButton) - { -#if QT_VERSION >= 300 - QIconSet is; - is.setPixmap(*(g_pIconManager->getSmallIcon(m_pCryptSessionInfo ? KVI_SMALLICON_LOCKEDOFF : KVI_SMALLICON_UNLOCKEDOFF)),QIconSet::Small,QIconSet::Normal,QIconSet::Off); - is.setPixmap(*(g_pIconManager->getSmallIcon(m_pCryptSessionInfo ? KVI_SMALLICON_LOCKED : KVI_SMALLICON_UNLOCKED)),QIconSet::Small,QIconSet::Normal,QIconSet::On); - m_pCryptControllerButton->setIconSet(is); -#else - - m_pCryptControllerButton->setOnIconSet( - *(g_pIconManager->getSmallIcon(m_pCryptSessionInfo ? KVI_SMALLICON_LOCKEDOFF : KVI_SMALLICON_UNLOCKEDOFF))); - m_pCryptControllerButton->setOffIconSet( - *(g_pIconManager->getSmallIcon(m_pCryptSessionInfo ? KVI_SMALLICON_LOCKED : KVI_SMALLICON_UNLOCKED))); -#endif - - if(m_pCryptControllerButton->isOn()) - m_pCryptControllerButton->setOn(false); - } -} -#endif // COMPILE_CRYPT_SUPPORT - -void KviWindow::cryptControllerFinished() -{ -#ifdef COMPILE_CRYPT_SUPPORT - KviCryptSessionInfo * inf = m_pCryptController->getNewSessionInfo(); - setCryptSessionInfo(inf); - delete m_pCryptController; - m_pCryptController = 0; -#endif -} - -void KviWindow::cryptSessionInfoDestroyed() -{ -#ifdef COMPILE_CRYPT_SUPPORT - output(KVI_OUT_SYSTEMERROR,__tr2qs("Ops...I've accidentally lost the crypting engine...")); - m_pCryptSessionInfo->pEngine = 0; - delete m_pCryptSessionInfo; - m_pCryptSessionInfo = 0; -#endif -} - - - -void KviWindow::setProgress(int progress) -{ - m_pTaskBarItem->setProgress(progress); -} - -void KviWindow::listWindowTypes() -{ - outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("List of window types available in this release of KVIrc:")); - for(int i=0;i< KVI_WINDOW_NUM_TYPES;i++) - outputNoFmt(KVI_OUT_SYSTEMMESSAGE,m_typeTable[i]); -} - -void KviWindow::getConfigGroupName(QString &buf) -{ - buf = typeString(); -} - - -void KviWindow::getDefaultLogFileName(QString &buffer) -{ - // FIXME: #warning "Make it configurable ?" - QString date; - QDate dt(QDate::currentDate()); - date=dt.toString("yyyy.MM.dd"); - QString base; - getBaseLogFileName(base); - kvi_encodeFileName(base); - base.replace("%%2e","%2e"); - base=base.lower(); - QString tmp; - if(KVI_OPTION_BOOL(KviOption_boolGzipLogs)) - KviQString::sprintf(tmp,"%s_%s_%s.log.gz",typeString(),base.utf8().data(),date.utf8().data()); - else - KviQString::sprintf(tmp,"%s_%s_%s.log",typeString(),base.utf8().data(),date.utf8().data()); - g_pApp->getLocalKvircDirectory(buffer,KviApp::Log,tmp); -} - -/*void KviWindow::getBaseLogFileName(KviStr &buffer) -{ - buffer = m_szName; -}*/ - -void KviWindow::getBaseLogFileName(QString &buffer) -{ - buffer = m_szName; -} - - -void KviWindow::saveProperties(KviConfig *cfg) -{ - // store only the non-default text encoding. - QString szCodec = m_szTextEncoding; - QTextCodec * c = defaultTextCodec(); - if(c && m_pTextCodec) - { -#ifdef COMPILE_USE_QT4 - if(KviQString::equalCI(szCodec,c->name().data()))szCodec = KviQString::empty; // store "default" -#else - if(KviQString::equalCI(szCodec,c->name()))szCodec = KviQString::empty; // store "default" -#endif - } - QString szKey = "TextEncoding_"; - szKey += m_szName; - cfg->writeEntry(szKey,szCodec); - if(m_pInput) { - cfg->writeEntry("inputToolButtonsHidden",m_pInput->isButtonsHidden()); - cfg->writeEntry("commandLineIsUserFriendly",m_pInput->isUserFriendly()); - } - - // - - /*if(m_pIrcView && m_iType==KVI_WINDOW_TYPE_CHANNEL) - if(m_pIrcView->isLogging()) - cfg->writeEntry("LoggingEnabled",m_pIrcView->isLogging());*/ -} - -void KviWindow::loadProperties(KviConfig *cfg) -{ - QString szKey = "TextEncoding_"; - szKey += m_szName; - setTextEncoding(cfg->readQStringEntry(szKey,KviQString::empty).utf8().data()); - if(m_pInput) { - m_pInput->setButtonsHidden(cfg->readBoolEntry("inputToolButtonsHidden",KVI_OPTION_BOOL(KviOption_boolHideInputToolButtons))); - m_pInput->setUserFriendly(cfg->readBoolEntry("commandLineIsUserFriendly",KVI_OPTION_BOOL(KviOption_boolCommandlineInUserFriendlyModeByDefault))); - } -/* if(m_pIrcView && m_iType==KVI_WINDOW_TYPE_CHANNEL) - { - bool bEnableLogs=cfg->readBoolEntry("LoggingEnabled",0); - if(!m_pIrcView->isLogging() && bEnableLogs) - { - QString szTmp; - getBaseLogFileName(szTmp); - m_pIrcView->startLogging(); - } - }*/ -} - -QPixmap * KviWindow::myIconPtr() -{ - return g_pIconManager->getSmallIcon(KVI_SMALLICON_DEFAULTICON); -} - -void KviWindow::getTaskBarTipText(QString &buffer) -{ - buffer = m_szPlainTextCaption; -} - -void KviWindow::setFixedCaption(const QString &szCaption) -{ - m_szPlainTextCaption = szCaption; -} - -void KviWindow::fillCaptionBuffers() -{ - QString szCaption = m_szPlainTextCaption; - if(szCaption.isEmpty()) - szCaption = m_szName; - - fillSingleColorCaptionBuffers(szCaption); -} - -void KviWindow::fillSingleColorCaptionBuffers(const QString &szName) -{ - static QString p1("<nobr><font color=\""); - static QString p2("\"><b>"); - static QString p3("</b></font></nobr>"); - - m_szPlainTextCaption = szName; - - m_szHtmlActiveCaption = p1; - m_szHtmlActiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name(); - m_szHtmlActiveCaption += p2; - m_szHtmlActiveCaption += szName; - m_szHtmlActiveCaption += p3; - - m_szHtmlInactiveCaption = p1; - m_szHtmlInactiveCaption += KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name(); - m_szHtmlInactiveCaption += p2; - m_szHtmlInactiveCaption += szName; - m_szHtmlInactiveCaption += p3; -} - -void KviWindow::updateCaption() -{ - fillCaptionBuffers(); - if(mdiParent()) - mdiParent()->setCaption(plainTextCaption(),htmlActiveCaption(),htmlInactiveCaption()); - else - setCaption(plainTextCaption()); - if(m_pTaskBarItem)m_pTaskBarItem->captionChanged(); - if(mdiParent() && isMaximized() && (g_pActiveWindow == this)) - g_pFrame->updateCaption(); -} - -void KviWindow::createSystemTextEncodingPopup() -{ - if(!g_pMdiWindowSystemTextEncodingPopup) - g_pMdiWindowSystemTextEncodingPopup = new KviTalPopupMenu(); - else - { - g_pMdiWindowSystemTextEncodingPopup->clear(); - } - - if(!g_pMdiWindowSystemTextEncodingPopupStandard) - g_pMdiWindowSystemTextEncodingPopupStandard = new KviTalPopupMenu(); - else - { - g_pMdiWindowSystemTextEncodingPopupStandard->clear(); - disconnect(g_pMdiWindowSystemTextEncodingPopupStandard,SIGNAL(activated(int)),0,0); - } - - if(!g_pMdiWindowSystemTextEncodingPopupSmart) - g_pMdiWindowSystemTextEncodingPopupSmart = new KviTalPopupMenu(); - else - { - g_pMdiWindowSystemTextEncodingPopupSmart->clear(); - disconnect(g_pMdiWindowSystemTextEncodingPopupSmart,SIGNAL(activated(int)),0,0); - } - - if(!g_pMdiWindowSystemTextEncodingPopupSmartUtf8) - g_pMdiWindowSystemTextEncodingPopupSmartUtf8 = new KviTalPopupMenu(); - else - { - g_pMdiWindowSystemTextEncodingPopupSmartUtf8->clear(); - disconnect(g_pMdiWindowSystemTextEncodingPopupSmartUtf8,SIGNAL(activated(int)),0,0); - } - - QTextCodec * c = defaultTextCodec(); - QString tmp = __tr2qs("Use Default Encoding"); - if(c) - { - tmp += " ("; - tmp += c->name(); - tmp += ")"; - } - - int id = g_pMdiWindowSystemTextEncodingPopup->insertItem(tmp,this,SLOT(systemTextEncodingPopupDefault())); - if(m_szTextEncoding.isEmpty())g_pMdiWindowSystemTextEncodingPopup->setItemChecked(id,true); - g_pMdiWindowSystemTextEncodingPopup->insertSeparator(); - - g_pMdiWindowSystemTextEncodingPopup->insertItem(__tr2qs("Standard"),g_pMdiWindowSystemTextEncodingPopupStandard); - g_pMdiWindowSystemTextEncodingPopup->insertItem(__tr2qs("Smart (Send Local)"),g_pMdiWindowSystemTextEncodingPopupSmart); - g_pMdiWindowSystemTextEncodingPopup->insertItem(__tr2qs("Smart (Send UTF-8)"),g_pMdiWindowSystemTextEncodingPopupSmartUtf8); - - int i = 0; - KviLocale::EncodingDescription * d = KviLocale::encodingDescription(i); - while(d->szName) - { - KviQString::sprintf(tmp,"%s (%s)",d->szName,d->szDescription); - KviTalPopupMenu * ppp = d->bSmart ? (d->bSendUtf8 ? g_pMdiWindowSystemTextEncodingPopupSmartUtf8 : g_pMdiWindowSystemTextEncodingPopupSmart) : g_pMdiWindowSystemTextEncodingPopupStandard; - id = ppp->insertItem(tmp); - if(KviQString::equalCI(m_szTextEncoding,d->szName)) - ppp->setItemChecked(id,true); - i = i + 1; - d = KviLocale::encodingDescription(i); - } - - connect(g_pMdiWindowSystemTextEncodingPopupSmart,SIGNAL(activated(int)),this,SLOT(systemTextEncodingPopupSmartActivated(int))); - connect(g_pMdiWindowSystemTextEncodingPopupSmartUtf8,SIGNAL(activated(int)),this,SLOT(systemTextEncodingPopupSmartUtf8Activated(int))); - connect(g_pMdiWindowSystemTextEncodingPopupStandard,SIGNAL(activated(int)),this,SLOT(systemTextEncodingPopupStandardActivated(int))); -} - - -void KviWindow::systemPopupRequest(const QPoint &pnt) -{ - if(!g_pMdiWindowSystemMainPopup) - g_pMdiWindowSystemMainPopup = new KviTalPopupMenu(); - else - { - g_pMdiWindowSystemMainPopup->clear(); - g_pMdiWindowSystemMainPopup->disconnect(); - } - - if(mdiParent()) - g_pMdiWindowSystemMainPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_UNDOCK)), - __tr2qs("&Undock"),this,SLOT(undock())); - else - g_pMdiWindowSystemMainPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DOCK)), - __tr2qs("&Dock"),this,SLOT(dock())); - - g_pMdiWindowSystemMainPopup->insertSeparator(); - - int id = g_pMdiWindowSystemMainPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MINIMIZE)), - __tr2qs("Mi&nimize"),this,SLOT(minimize())); - g_pMdiWindowSystemMainPopup->setItemEnabled(id,!isMinimized()); - id = g_pMdiWindowSystemMainPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MAXIMIZE)), - __tr2qs("Ma&ximize"),this,SLOT(maximize())); - g_pMdiWindowSystemMainPopup->setItemEnabled(id,!isMaximized()); - id = g_pMdiWindowSystemMainPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_RESTORE)), - __tr2qs("&Restore"),this,SLOT(restore())); - g_pMdiWindowSystemMainPopup->setItemEnabled(id,isMinimized()||isMaximized()); - - g_pMdiWindowSystemMainPopup->insertSeparator(); - - g_pMdiWindowSystemMainPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CLOSE)), - __tr2qs("Close"),this,SLOT(close())); - - g_pMdiWindowSystemMainPopup->insertSeparator(); - - if(m_pTextEncodingButton) - { - createSystemTextEncodingPopup(); - g_pMdiWindowSystemMainPopup->insertItem(__tr2qs("Text &Encoding"),g_pMdiWindowSystemTextEncodingPopup); - } // else we don't support setting private encoding anyway - - - g_pMdiWindowSystemMainPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_XY)), - __tr2qs("Sa&ve Window Properties"),this,SLOT(savePropertiesAsDefault())); - - fillContextPopup(g_pMdiWindowSystemMainPopup); - - g_pMdiWindowSystemMainPopup->popup(pnt); -} - -void KviWindow::systemTextEncodingPopupDefault() -{ - // default - setTextEncoding(""); -} - -void KviWindow::systemTextEncodingPopupSmartActivated(int id) -{ - if(!g_pMdiWindowSystemTextEncodingPopupSmart) - return; - QString tmp = g_pMdiWindowSystemTextEncodingPopupSmart->text(id); - KviQString::cutFromFirst(tmp," ("); - setTextEncoding(tmp); -} - -void KviWindow::systemTextEncodingPopupSmartUtf8Activated(int id) -{ - if(!g_pMdiWindowSystemTextEncodingPopupSmartUtf8) - return; - QString tmp = g_pMdiWindowSystemTextEncodingPopupSmartUtf8->text(id); - KviQString::cutFromFirst(tmp," ("); - setTextEncoding(tmp); -} - -void KviWindow::systemTextEncodingPopupStandardActivated(int id) -{ - if(!g_pMdiWindowSystemTextEncodingPopupStandard) - return; - QString tmp = g_pMdiWindowSystemTextEncodingPopupStandard->text(id); - KviQString::cutFromFirst(tmp," ("); - setTextEncoding(tmp); -} - -void KviWindow::savePropertiesAsDefault() -{ - QString group; - getConfigGroupName(group); - - if(!kvi_strEqualCI(group,typeString())) - { - // save also the settings for THIS specialized window - g_pFrame->saveWindowProperties(this,group); - } - - g_pFrame->saveWindowProperties(this,typeString()); -} - -void KviWindow::contextPopup() -{ - systemPopupRequest(QCursor::pos()); -} - -void KviWindow::fillContextPopup(KviTalPopupMenu *) -{ - // nothing here -} - -void KviWindow::undock() -{ - g_pFrame->undockWindow(this); -} - -void KviWindow::dock() -{ - g_pFrame->dockWindow(this); -} - -void KviWindow::delayedAutoRaise() -{ - QTimer::singleShot(0,this,SLOT(autoRaise())); -} - -void KviWindow::autoRaise() -{ - if(!mdiParent()) - { - raise(); - setActiveWindow(); - } - if(m_pFocusHandler) - m_pFocusHandler->setFocus(); - else - setFocus(); -} - -void KviWindow::delayedClose() -{ - QTimer::singleShot(0,this,SLOT(close())); -} - -void KviWindow::closeEvent(QCloseEvent *e) -{ - e->ignore(); - g_pFrame->childWindowCloseRequest(this); -} - -void KviWindow::updateIcon() -{ - if(parent()) - { - ((KviMdiChild *)parent())->setIcon(*myIconPtr()); - } else { - setIcon(*myIconPtr()); - } -} - -void KviWindow::youAreDocked() -{ - if(m_pAccel) - { - delete m_pAccel; - m_pAccel = 0; - } - ((KviMdiChild *)parent())->setIcon(*myIconPtr()); - updateCaption(); - connect(((KviMdiChild *)parent()),SIGNAL(systemPopupRequest(const QPoint &)),this,SLOT(systemPopupRequest(const QPoint &))); -} - -void KviWindow::youAreUndocked() -{ - m_pAccel = g_pFrame->installAccelerators(this); - setIcon(*myIconPtr()); - updateCaption(); -} - -#ifdef FocusIn -// Hack for X.h -#undef FocusIn -#endif - -void KviWindow::activateSelf() -{ - if(mdiParent()) - mdiParent()->activate(false); - - g_pFrame->childWindowActivated(this); - // this is now done by KviFrame in childWindowActivated - //g_pFrame->m_pTaskBar->setActiveItem(m_pTaskBarItem); -} - -void KviWindow::setFocus() -{ - // don't trigger the whole Qt focus mechanism.. - // just trigger directly our focusInEvent - // so we'll redirect the focus to the m_pFocusHandler - focusInEvent(0); -} - -void KviWindow::focusInEvent(QFocusEvent *) -{ - if(m_pLastFocusedChild) - { - if(m_pLastFocusedChild->hasFocus() && m_pLastFocusedChild->isVisible()) - { - // the last focused child still has focus (ehm ???) - if(g_pActiveWindow != this)activateSelf(); - return; - } - } - - if(!m_pFocusHandler) - { - // must find one NOW - // we probably have no KviInput since it would have been grabbed anyway - - if(m_pIrcView)m_pFocusHandler = m_pIrcView; - else { -#ifdef COMPILE_USE_QT4 - QList<QObject *> list = children(); - for(QList<QObject *>::Iterator it = list.begin();it != list.end();++it) - { - QObject * c = *it; - if(c->isWidgetType()) - { - m_pFocusHandler = (QWidget *)c; - break; - } - } -#else - QObjectList *list = (QObjectList *)(children()); - if(list) - { - for(QObject * c = list->first();c;c = list->next()) - { - if(c->isWidgetType()) - { - m_pFocusHandler = (QWidget *)c; - break; - } - } - } -#endif - } - if(m_pFocusHandler)m_pFocusHandler->setFocus(); - else { - // else too bad :/ - debug("No widget able to handle focus for window %s",name()); - return; - } - } else { - m_pFocusHandler->setFocus(); - } - - // Setting the focus to the focus handler usually - // triggers our filter for the children's focusInEvent. - // This should call activateSelf() and thus - // we should be already the active window at this point. - // If we're not, then run activateSelf() to fix this. - if(g_pActiveWindow != this)activateSelf(); - //else debug("ACTIVE WINDOW IS ALREADY THIS"); - updateCaption(); -} - -bool KviWindow::eventFilter(QObject *o,QEvent *e) -{ - switch(e->type()) - { - case QEvent::FocusIn: - m_pLastFocusedChild = (QWidget *)o; - if(g_pActiveWindow != this)activateSelf(); - break; - case QEvent::Enter: - // this is a handler moved here from KviMdiChild::eventFilter - if(QApplication::overrideCursor()) - QApplication::restoreOverrideCursor(); - break; - case QEvent::MouseButtonPress: -#ifdef COMPILE_USE_QT4 - if( (((QWidget *)o)->focusPolicy() == Qt::NoFocus) || - (((QWidget *)o)->focusPolicy() == Qt::TabFocus)) -#else - if( (((QWidget *)o)->focusPolicy() == QWidget::NoFocus) || - (((QWidget *)o)->focusPolicy() == QWidget::TabFocus)) -#endif - { - // this will not focus our window - // set the focus to the focus handler - if(m_pLastFocusedChild) - { - if(m_pLastFocusedChild->hasFocus() && m_pLastFocusedChild->isVisible()) - return false; - } - - if(m_pFocusHandler) - { - m_pFocusHandler->setFocus(); - } else { - setFocus(); // we grab the focus (someone must do it , damn :D) - } - } - break; - case QEvent::ChildInserted: - if(((QChildEvent *)e)->child()->isWidgetType()) - childInserted((QWidget *)((QChildEvent *)e)->child()); - break; - case QEvent::ChildRemoved: - if(((QChildEvent *)e)->child()->isWidgetType()) - childRemoved((QWidget *)((QChildEvent *)e)->child()); - break; - default: /* make gcc happy */ break; - } - return false; -} - - -void KviWindow::childInserted(QWidget * o) -{ - o->removeEventFilter(this); // ensure that we don't filter twice - o->installEventFilter(this); // we filter its events - connect(o,SIGNAL(destroyed()),this,SLOT(childDestroyed())); - - if(o->inherits("KviInput")) - m_pFocusHandler = o; - else - { -#ifdef COMPILE_USE_QT4 - if(!m_pFocusHandler && (o->focusPolicy() == Qt::StrongFocus)) -#else - if(!m_pFocusHandler && (o->focusPolicy() == QWidget::StrongFocus)) -#endif - { - m_pFocusHandler = o; - } - } - -#ifdef COMPILE_USE_QT4 - QList<QObject *> list = o->children(); - for(QList<QObject *>::Iterator it = list.begin();it != list.end();++it) - { - QObject * c = *it; - if(c->isWidgetType()) - { - childInserted((QWidget *)c); - } - } -#else - QObjectList *list = (QObjectList *)(o->children()); - if(list) - { - for(QObject * c = list->first();c;c = list->next()) - { - if(c->isWidgetType()) - childInserted((QWidget *)c); - } - } -#endif -} - -void KviWindow::childDestroyed() -{ - QWidget * s = (QWidget *)sender(); - childRemoved(s); -} - -void KviWindow::childRemoved(QWidget * o) -{ - //debug("CHILD REMOVED %d",o); - o->removeEventFilter(this); - if(o == m_pFocusHandler) - m_pFocusHandler = 0; - if(o == m_pLastFocusedChild) - m_pLastFocusedChild = 0; - -#ifdef COMPILE_USE_QT4 - QList<QObject *> list = o->children(); - for(QList<QObject *>::Iterator it = list.begin();it != list.end();++it) - { - QObject * c = *it; - if(c->isWidgetType()) - { - childRemoved((QWidget *)c); - } - } -#else - QObjectList *list = (QObjectList *)(o->children()); - if(list) - { - for(QObject * c = list->first();c;c = list->next()) - { - if(c->isWidgetType()) - childRemoved((QWidget *)c); - } - } //else debug("The removed object has no children"); -#endif -} - -void KviWindow::childEvent(QChildEvent *e) -{ - if(e->child()->isWidgetType()) - { - if(e->removed()) - childRemoved((QWidget *)(e->child())); - else - childInserted((QWidget *)(e->child())); - } - QWidget::childEvent(e); -} - -void KviWindow::wheelEvent(QWheelEvent *e) -{ - /* NOTHING HERE FOR NOW (FIXME) */ -} - - -void KviWindow::childrenTreeChanged(QWidget * widgetAdded) -{ - // if(widgetAdded && m_pFocusHandler)setFocusHandler(m_pFocusHandler,widgetAdded); - // FIXME: This might be useless - QResizeEvent * e = new QResizeEvent(size(),size()); - resizeEvent(e); - delete e; -} - - -void KviWindow::updateBackgrounds(QObject * obj) -{ - if(!obj) - obj = this; -#ifdef COMPILE_USE_QT4 - QList<QObject *> list = obj->children(); - if (list.count()) - { - - for(QList<QObject *>::Iterator it = list.begin();it != list.end();++it) - { - QObject * child = *it; - if(child->metaObject()->indexOfProperty("TransparencyCapable") != -1){ - // if (child->isWidgetType()) - ((QWidget *)child)->update(); - } - updateBackgrounds(child); - } - } -#else - QObjectList * list = (QObjectList *)(obj->children()); - if(list) - { - for(unsigned int i=0;i<list->count();i++) - { - QObject * child = list->at(i); -#if QT_VERSION >= 300 - // FIXME: check if this code can work with qt < 3.0.0 too - if(child->metaObject()->findProperty("TransparencyCapable",true) != -1) - ((QWidget *)child)->update(); -#else - - QVariant v = list->at(i)->property("TransparencyCapable"); - if(v.isValid()) - ((QWidget *)child)->update(); -#endif - - updateBackgrounds(child); - } - } -#endif -} - -void KviWindow::moveEvent(QMoveEvent *e) -{ -#ifdef COMPILE_PSEUDO_TRANSPARENCY - updateBackgrounds(); -#endif - - QWidget::moveEvent(e); -} - -void KviWindow::minimize() -{ - if(mdiParent()) - { - if(!isMinimized()) - mdiParent()->minimize(); - } - else - showMinimized(); -} - -void KviWindow::maximize() -{ - if(mdiParent()) - { - if(!isMaximized()) - mdiParent()->maximize(); - } - else - showMaximized(); - autoRaise(); -} - -bool KviWindow::isMinimized() -{ - if(mdiParent()) - return (mdiParent()->state() == KviMdiChild::Minimized); - else - return QWidget::isMinimized(); -} - -bool KviWindow::isMaximized() -{ - if(mdiParent()) - return (mdiParent()->state() == KviMdiChild::Maximized); - // Heh...how to check it ? - // Empirical check - int wdth = (g_pApp->desktop()->width() * 75) / 100; - int hght = (g_pApp->desktop()->height() * 75) / 100; - - return ((x() <= 1)&&(y() <= 1)&&(width() >= wdth)&&(height() >= hght)); -} - -void KviWindow::restore() -{ - if(mdiParent()) - { - if(isMinimized()||isMaximized()) - mdiParent()->restore(); - } - else - showNormal(); - autoRaise(); -} - -QRect KviWindow::externalGeometry() -{ -#ifndef Q_OS_MACX - return mdiParent() ? mdiParent()->restoredGeometry() : frameGeometry(); -#else - return mdiParent() ? mdiParent()->restoredGeometry() : geometry(); -#endif -} - -void KviWindow::applyOptions() -{ - updateCaption(); - if(m_pIrcView)m_pIrcView->applyOptions(); - if(m_pInput)m_pInput->applyOptions(); - - // trick: relayout - resize(width() - 1,height() - 1); - resize(width() + 1,height() + 1); -} - -KviWindow * KviWindow::outputProxy() -{ - return 0; -} - -void KviWindow::lostUserFocus() -{ - if(!m_pIrcView)return; - if(m_pIrcView->hasLineMark())m_pIrcView->clearLineMark(true); -} - - -void KviWindow::internalOutput(KviIrcView * pView,int msg_type,const kvi_wchar_t * pText,int iFlags) -{ - // all roads lead to Rome :) - - if(pView) - { - if((this != g_pActiveWindow) || (!isActiveWindow())) - { - if(!pView->hasLineMark()) - { - iFlags |= KviIrcView::SetLineMark; - } - } - pView->appendText(msg_type,pText,iFlags); - } else { - // Redirect to the output proxy - KviWindow *wnd = outputProxy(); - if(wnd)wnd->outputNoFmt(msg_type,pText,iFlags); - } - - if(!m_pTaskBarItem) { - return; - } - - // if this option is checked we dont highlight other than channel msg - if(KVI_OPTION_BOOL(KviOption_boolHighlightOnlyNormalMsg)) - { - if((msg_type != KVI_OUT_CHANPRIVMSG) && (msg_type != KVI_OUT_CHANPRIVMSGCRYPTED)) - { - if(!( - ( - KVI_OPTION_BOOL(KviOption_boolHighlightOnlyNormalMsgQueryToo) && - ( - (msg_type == KVI_OUT_QUERYPRIVMSG) || (msg_type == KVI_OUT_QUERYTRACE) || - (msg_type == KVI_OUT_QUERYPRIVMSGCRYPTED) || (msg_type == KVI_OUT_QUERYNOTICE) || (msg_type == KVI_OUT_QUERYNOTICECRYPTED) - ) - ) - || - ( - KVI_OPTION_BOOL(KviOption_boolHighlightOnlyNormalMsgHighlightInChanToo) && (msg_type == KVI_OUT_HIGHLIGHT) - ) - ) - ) - return; - } - } - - if(KVI_OPTION_BOOL(KviOption_boolHighlightOnlyAtCostumHighlightLevel) && - (KVI_OPTION_MSGTYPE(msg_type).level() < ((int)(KVI_OPTION_UINT(KviOption_uintMinHighlightLevel))))) - { - return; - } - - m_pTaskBarItem->highlight(KVI_OPTION_MSGTYPE(msg_type).level()); -} - -void KviWindow::output(int msg_type,const char *format,...) -{ - QString szFmt(format); - kvi_va_list l; - kvi_va_start(l,format); - QString szBuf; - KviQString::vsprintf(szBuf,szFmt,l); - kvi_va_end(l); - preprocessMessage(szBuf); - const QChar * pC = KviQString::nullTerminatedArray(szBuf); - if(!pC)return; - internalOutput(m_pIrcView,msg_type,(kvi_wchar_t *)pC); -} - -void KviWindow::output(int msg_type,const QString &szFmt,...) -{ - kvi_va_list l; - kvi_va_start_by_reference(l,szFmt); - QString szBuf; - KviQString::vsprintf(szBuf,szFmt,l); - kvi_va_end(l); - preprocessMessage(szBuf); - const QChar * pC = KviQString::nullTerminatedArray(szBuf); - if(!pC)return; - internalOutput(m_pIrcView,msg_type,(kvi_wchar_t *)pC); -} - -void KviWindow::output(int msg_type,const kvi_wchar_t *format,...) -{ - QString szFmt=QString::fromUtf8(KviStr(format).ptr()); - kvi_va_list l; - kvi_va_start(l,format); - QString szBuf; - KviQString::vsprintf(szBuf,szFmt,l); - kvi_va_end(l); - preprocessMessage(szBuf); - const QChar * pC = KviQString::nullTerminatedArray(szBuf); - if(!pC)return; - internalOutput(m_pIrcView,msg_type,(kvi_wchar_t *)pC); -} - -void KviWindow::outputNoFmt(int msg_type,const char * text,int iFlags) -{ - QString szText(text); - preprocessMessage(szText); - const QChar * pC = KviQString::nullTerminatedArray(szText); - if(!pC)return; - internalOutput(m_pIrcView,msg_type,(kvi_wchar_t *)pC,iFlags); -} - -void KviWindow::outputNoFmt(int msg_type,const QString &szText,int iFlags) -{ - QString szBuf(szText); - preprocessMessage(szBuf); - const QChar * pC = KviQString::nullTerminatedArray(szBuf); - if(!pC)return; - internalOutput(m_pIrcView,msg_type,(kvi_wchar_t *)pC,iFlags); -} - -void KviWindow::unhighlight() -{ - if(!m_pTaskBarItem)return; - m_pTaskBarItem->unhighlight(); -} - -/* This messes up a bit: for example it breaks the WHOIS output where - escapes are already present (checking for them here would be an overkill). - This should be eventually done ONLY for remote user message texts - in the server parser. - - Fixed -*/ - -void KviWindow::preprocessMessage(QString & szMessage) -{ - // slow -#ifdef COMPILE_USE_QT4 - QStringList strings = szMessage.split(" "); -#else - QStringList strings = QStringList::split(" ",szMessage, TRUE); -#endif - for ( QStringList::Iterator it = strings.begin(); it != strings.end(); ++it ) { - QString tmp(*it); - if(tmp.contains('\r')) continue; - tmp = KviMircCntrl::stripControlBytes(tmp); - tmp.stripWhiteSpace(); - if(m_pConsole) - if(m_pConsole->connection()) - if(m_pConsole->connection()->serverInfo()->supportedChannelTypes().contains(tmp[0])) - if((*it)==tmp) - *it=QString("\r!c\r%1\r").arg(*it); - else - { - *it=QString("\r!c%1\r%2\r").arg(tmp).arg(*it); - } - } - szMessage=strings.join(" "); -} - - -#include "kvi_window.moc" diff --git a/3.4.0/src/kvirc/ui/kvi_window.h b/3.4.0/src/kvirc/ui/kvi_window.h deleted file mode 100644 index 969148c294..0000000000 --- a/3.4.0/src/kvirc/ui/kvi_window.h +++ /dev/null @@ -1,393 +0,0 @@ -#ifndef _KVI_WINDOW_H_ -#define _KVI_WINDOW_H_ -//============================================================================= -// -// File : kvi_window.h -// Creation date : Tue Jul 6 1999 14:52:20 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2004 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_string.h" -#include "kvi_qstring.h" -#include "kvi_qcstring.h" -#include "kvi_settings.h" - -#ifdef COMPILE_ON_WINDOWS - // The brain-damaged MSVC compiler can't instantiate QList templates without a destructor definition - #include "kvi_mdichild.h" -#else - class KviMdiChild; -#endif - -#include <qframe.h> - -class KviFrame; -class KviTaskBarItem; -class KviConfig; -class KviIrcView; -class KviInput; -class KviConsole; -class KviIrcContext; -class KviIrcConnection; -class KviWindowToolPageButton; - -class KviTalPopupMenu; -class QPixmap; -class QSplitter; -class KviTalHBox; -class QToolButton; -class QTextCodec; -class KviTalWidgetStack; - -#include "kvi_tal_hbox.h" -#include "kvi_tal_widgetstack.h" -#include "kvi_accel.h" - -#ifdef COMPILE_CRYPT_SUPPORT - class KviCryptController; - class KviCryptSessionInfo; -#endif - -#include <qwidget.h> - -// -// Window types -// -// There are KVI_WINDOW_NUM_TYPES predefined -// window types: these are used by the KVIrc core and distributed modules -// If you add a new def, increase KVI_WINDOW_NUM_TYPES -// - -#define KVI_WINDOW_TYPE_CONSOLE 0 -#define KVI_WINDOW_TYPE_CHANNEL 1 -#define KVI_WINDOW_TYPE_QUERY 2 -#define KVI_WINDOW_TYPE_HELP 3 -#define KVI_WINDOW_TYPE_TERM 4 -#define KVI_WINDOW_TYPE_EDITOR 5 -#define KVI_WINDOW_TYPE_DCCCHAT 6 -#define KVI_WINDOW_TYPE_DCCSEND 7 -#define KVI_WINDOW_TYPE_SOCKETSPY 8 -#define KVI_WINDOW_TYPE_LINKS 9 -#define KVI_WINDOW_TYPE_TOOL 10 -#define KVI_WINDOW_TYPE_GNUTELLA 11 -#define KVI_WINDOW_TYPE_DIRBROWSER 12 -#define KVI_WINDOW_TYPE_DCCCANVAS 13 -#define KVI_WINDOW_TYPE_DCCVOICE 14 -#define KVI_WINDOW_TYPE_LIST 15 -#define KVI_WINDOW_TYPE_OFFER 16 -#define KVI_WINDOW_TYPE_LOGVIEW 17 -#define KVI_WINDOW_TYPE_DEADCHANNEL 18 -#define KVI_WINDOW_TYPE_DEADQUERY 19 -#define KVI_WINDOW_TYPE_SCRIPTEDITOR 20 -#define KVI_WINDOW_TYPE_SCRIPTOBJECT 21 -#define KVI_WINDOW_TYPE_USERWINDOW 22 -#define KVI_WINDOW_TYPE_DEBUG 23 - - -#define KVI_WINDOW_NUM_TYPES 24 - - -#define KVI_WINDOW_TYPE_USER 10000 - - - - -#define KVI_ACTIVITY_NONE 0 -#define KVI_ACTIVITY_VERYLOW 1 -#define KVI_ACTIVITY_LOW 2 -#define KVI_ACTIVITY_MEDIUM 3 -#define KVI_ACTIVITY_HIGH 4 -#define KVI_ACTIVITY_VERYHIGH 5 - -#define KVI_ACTIVITY_ICE 0 -#define KVI_ACTIVITY_VERYCOLD 1 -#define KVI_ACTIVITY_COLD 2 -#define KVI_ACTIVITY_UNDEFINED 3 -#define KVI_ACTIVITY_HOT 4 -#define KVI_ACTIVITY_VERYHOT 5 -#define KVI_ACTIVITY_FIRE 6 - -#ifdef COMPILE_USE_QT4 - class QPushButton; - #define BUTTON_CLASS QPushButton -#else - #define BUTTON_CLASS QToolButton -#endif - - -class KVIRC_API KviWindow : public QWidget -{ - friend class KviInput; - friend class KviFrame; - friend class KviTaskBarItem; - friend class KviTaskBarButton; - friend class KviTreeTaskBarItem; - friend class KviTreeTaskBar; - Q_PROPERTY(int KviProperty_ChildFocusOwner READ type) - Q_OBJECT -public: - KviWindow(int type,KviFrame * lpFrm,const QString &name,KviConsole * pConsole = 0); - virtual ~KviWindow(); -protected: // almost private: don't touch :D - QString m_szName; // the current window name (usually also the target) - KviFrame * m_pFrm; - KviConsole * m_pConsole; - KviIrcContext * m_pContext; - - int m_iType; - - KviTaskBarItem * m_pTaskBarItem; - QWidget * m_pFocusHandler; - QString m_szPlainTextCaption; - QString m_szHtmlActiveCaption; - QString m_szHtmlInactiveCaption; - KviIrcView * m_pIrcView; - KviInput * m_pInput; - QSplitter * m_pSplitter; - KviTalHBox * m_pButtonBox; - unsigned long int m_uId; - QString m_szTextEncoding; -#ifdef COMPILE_CRYPT_SUPPORT - KviWindowToolPageButton * m_pCryptControllerButton; - KviCryptController * m_pCryptController; - KviCryptSessionInfo * m_pCryptSessionInfo; -#endif - BUTTON_CLASS * m_pTextEncodingButton; - QToolButton * m_pHideToolsButton; - QWidget * m_pLastFocusedChild; - KviAccel * m_pAccel; - static const char * m_typeTable[KVI_WINDOW_NUM_TYPES + 1]; - // text encoding and decoding - //unsigned int m_uTextEncoding; - QTextCodec * m_pTextCodec; -// KviToolWindowsContainer * m_pEditorsContainer; -public: - // The global ID of this window: unique in the application - QString id(){ return QString("%1").arg(m_uId); }; - unsigned long int numericId(){ return m_uId; }; -public: - // THIS is the function that should be used - const QString & windowName(){ return m_szName; }; - void setWindowName(const QString &szName); - // force QT to set our UNICODE name too... FIXME: this should be removed later... - virtual void setName(const char * szName); - - // Window type management - int type() const { return m_iType; }; - // This returns a descriptive name of the window type - // if the window is an user window, the typeString returned - // by THIS implementation is "unknown" - virtual const char * typeString(); - - QTextCodec * textCodec(){ return m_pTextCodec ? m_pTextCodec : defaultTextCodec(); }; - void forceTextCodec(QTextCodec * c); - - // The frame that this window belongs to - // It is always non-null and never changes - KviFrame * frame() const { return m_pFrm; }; - // The KviIrcView of this window: may be NULL if the window has no KviIrcView (and thus supports no direct output) - KviIrcView * view() const { return m_pIrcView; }; - // The mdiParent widget: may be nulll if the window is undocked - KviMdiChild * mdiParent(){ return (KviMdiChild *)parent(); }; - // The console that this window belongs to: may be null for windows that aren't bound to irc contexts - KviConsole * console(){ return m_pConsole; }; - // same as above - KviIrcContext * context(){ return m_pContext; }; - // the current IRC connection (if any) - KviIrcConnection * connection(); - // The splitter of this window: it *shouldn't* be null... but ... well.. who knows ? :D ...better check it - QSplitter * splitter(){ return m_pSplitter; }; - // The window has ALWAYS a taskbar item - KviTaskBarItem * taskBarItem(){ return m_pTaskBarItem; }; - // The window *might* have a button container - virtual QFrame * buttonContainer(){ return (QFrame*)m_pButtonBox; }; - virtual void toggleButtonContainer(); - // The window *might* have an output proxy: if it has no view() for example - virtual KviWindow * outputProxy(); - // The window input widget - KviInput * input(){ return m_pInput; }; - - // The target of this window: empty when it makes no sense :D - virtual const QString & target(){ return KviQString::empty; }; - // The local nickname bound to this window: might be empty when a local nickname makes no sense - virtual const QString & localNick(){ return KviQString::empty; }; - -#ifdef COMPILE_CRYPT_SUPPORT - KviCryptSessionInfo * cryptSessionInfo(){ return m_pCryptSessionInfo; }; - void setCryptSessionInfo(KviCryptSessionInfo * i); -#endif - - virtual bool activityMeter(unsigned int * puActivityValue,unsigned int * puActivityTemperature); - - void unhighlight(); - - virtual void getTaskBarTipText(QString &buffer); - - // This is meaningful only if view() is non NULL - const QString & lastLineOfText(); - const QString & lastMessageText(); - - const QString &textEncoding(){ return m_szTextEncoding; }; - // returns true if the encoding could be succesfully set - bool setTextEncoding(const QString &szTextEncoding); - // this must return a default text codec suitable for this window - virtual QTextCodec * defaultTextCodec(); - // encode the text from szSource by using m_uTextEncoding - KviQCString encodeText(const QString &szText); - QString decodeText(const char * szText); - - void contextPopup(); - // Raises the window (after a light delay to prevent focus pingpongs) - void delayedAutoRaise(); - // Window state: might work :D - bool isMinimized(); - bool isMaximized(); - // Retrieves the default log file name: this is pre-build - void getDefaultLogFileName(QString &buffer); - // Well...the external geometry :) - QRect externalGeometry(); - - void delayedClose(); // close that jumps out of the current event loop - - // Interesting overridables: - virtual void fillContextPopup(KviTalPopupMenu * p); - virtual void getConfigGroupName(QString &buf); -// virtual void getBaseLogFileName(KviStr &buffer); - virtual void getBaseLogFileName(QString &buffer); - virtual void updateCaption(); - virtual void applyOptions(); - virtual void updateIcon(); - virtual void ownMessage(const QString &text){}; - virtual void ownAction(const QString &text){}; - virtual const QString & plainTextCaption(){ return m_szPlainTextCaption; }; - virtual const QString & htmlActiveCaption(){ return m_szHtmlActiveCaption; }; - virtual const QString & htmlInactiveCaption(){ return m_szHtmlInactiveCaption; }; - virtual void setFocus(); - - void internalOutput(KviIrcView * pView,int msg_type,const kvi_wchar_t * text,int iFlags=0); - // You *might* want to override these too.. but better don't touch them :D - virtual void output(int msg_type,const char * format,...); - virtual void outputNoFmt(int msg_type,const char * text,int iFlags=0); - virtual void output(int msg_type,const kvi_wchar_t * format,...); - virtual void outputNoFmt(int msg_type,const kvi_wchar_t * text,int iFlags=0){ internalOutput(m_pIrcView,msg_type,text,iFlags); }; - virtual void output(int msg_type,const QString &szFmt,...); - virtual void outputNoFmt(int msg_type,const QString &szText,int iFlags=0); // <-- these are KviIrcView::AppendTextFlags - // Just helpers.. FIXME: might be redesigned in some other way - void updateBackgrounds(QObject * obj = 0); - - void demandAttention(); - bool hasAttention(); - - // This should die, probably - void listWindowTypes(); - -public slots: - void dock(); - void undock(); - void autoRaise(); - void maximize(); - void minimize(); - void restore(); - void reloadImages(); -protected slots: - void savePropertiesAsDefault(); - void toggleCryptController(); // This has to be here even if the crypt support is enabled...moc does not support conditionals - void cryptControllerFinished(); // same as above - void cryptSessionInfoDestroyed(); // same as above - void textEncodingButtonClicked(); - void systemPopupRequest(const QPoint &pnt); - void systemTextEncodingPopupSmartActivated(int id); - void systemTextEncodingPopupSmartUtf8Activated(int id); - void systemTextEncodingPopupStandardActivated(int id); - void systemTextEncodingPopupDefault(); - void childDestroyed(); -signals: - void windowNameChanged(); -protected: - // Loading and saving of properties - // Protected: only KviFrame can call these - virtual void saveProperties(KviConfig *cfg); - virtual void loadProperties(KviConfig *cfg); - // Creation and destruction events: overridden in windows that have script events bound to creation and destruction - virtual void triggerCreationEvents(){}; - virtual void triggerDestructionEvents(){}; - // Internal: do not touch :D (KviFrame) - virtual void createTaskBarItem(); - virtual void destroyTaskBarItem(); - // called by KviFrame - // either lost the active window status or the frame is no longer active (but we're still the active kvirc's subwindow) - virtual void lostUserFocus(); - // Sets the progress for the taskbar item: if "progress" makes sense in your window , well , use this - void setProgress(int progress); - // call this in the constructor if your caption is fixed: - // it will set m_szPlainTextCaption to szCaption and it will - // automatically use it without the need of overriding fillCaptionBuffers - void setFixedCaption(const QString &szCaption); - // this by default calls fillSingleColorCaptionBuffer(plainTextCaption()); - virtual void fillCaptionBuffers(); - // protected helper - void fillSingleColorCaptionBuffers(const QString &szName); - // Virtual events that signal dock state change - virtual void youAreDocked(); - virtual void youAreUndocked(); - // Reimplement to show a special icon in the taskbar items and captions - virtual QPixmap * myIconPtr(); - // Sets the type of this window: be careful with this - void setType(int iType); - - bool eventFilter(QObject *o,QEvent *e); - - // Virtuals overridden to manage the internal layouts... - virtual void moveEvent(QMoveEvent *e); - virtual void closeEvent(QCloseEvent *e); - virtual void wheelEvent(QWheelEvent *e); - virtual void childEvent(QChildEvent *e); - virtual void focusInEvent(QFocusEvent *e); - - void childInserted(QWidget * o); - void childRemoved(QWidget * o); - - void activateSelf(); - - // Internal helpers - void createCryptControllerButton(QWidget * par); - void createTextEncodingButton(QWidget * par); - void createSystemTextEncodingPopup(); - - BUTTON_CLASS * createToolButton(QWidget * par,const char * nam,int pixon,int pixoff,const QString & tooltip,bool bOn); - // This is called by KviInput: actually it links the widgetAdded - virtual void childrenTreeChanged(QWidget * widgetAdded); - - virtual bool focusNextPrevChild(bool bNext); - - virtual void preprocessMessage(QString & szMessage); -}; - -#ifndef _KVI_WINDOW_CPP_ - // The active window: - // This is almost always non null - // The exception is the startup (when there are no windows at all) - // and the last phase of the destructor. - // You usually shouldn't care of checking this pointer for NULL unless - // you're running very early at startup or very late at shutdown - extern KVIRC_API KviWindow * g_pActiveWindow; -#endif - -#endif //_KVI_WINDOW_H_ diff --git a/3.4.0/src/modules/.svnignore b/3.4.0/src/modules/.svnignore deleted file mode 100644 index 05942bc9ef..0000000000 --- a/3.4.0/src/modules/.svnignore +++ /dev/null @@ -1,9 +0,0 @@ -Makefile.in -Makefile -.deps -*.o -*.lo -*.la -*.moc -.libs -moc_editor.cpp diff --git a/3.4.0/src/modules/Makefile.am b/3.4.0/src/modules/Makefile.am deleted file mode 100644 index 267a89ef8e..0000000000 --- a/3.4.0/src/modules/Makefile.am +++ /dev/null @@ -1,61 +0,0 @@ -SUBDIRS = about \ - action \ - actioneditor \ - addon \ - aliaseditor \ - avatar \ - chan \ - channelsjoin \ - clock \ - codetester \ - config \ - context \ - dcc \ - dialog \ - editor \ - eventeditor \ - file \ - filetransferwindow \ - dockwidget \ - help \ - http \ - ident \ - iograph \ - lamerizer \ - links \ - list \ - log \ - logview \ - mask \ - math \ - mediaplayer \ - mircimport \ - my \ - notifier \ - objects \ - options \ - perl \ - perlcore \ - popupeditor \ - raweditor \ - regchan \ - reguser \ - rijndael \ - setup \ - sharedfile \ - sharedfileswindow \ - snd \ - socketspy \ - spaste \ - str \ - system \ - term \ - texticons \ - theme \ - tip \ - tmphighlight \ - toolbar \ - toolbareditor \ - torrent \ - url \ - window diff --git a/3.4.0/src/modules/about/.svnignore b/3.4.0/src/modules/about/.svnignore deleted file mode 100644 index 3ebe7fb0c8..0000000000 --- a/3.4.0/src/modules/about/.svnignore +++ /dev/null @@ -1,10 +0,0 @@ -Makefile.in -Makefile -.deps -*.o -*.lo -*.la -*.moc -.libs -.mospics -.pics \ No newline at end of file diff --git a/3.4.0/src/modules/about/ENTRIES b/3.4.0/src/modules/about/ENTRIES deleted file mode 100644 index 0e53b3dafa..0000000000 --- a/3.4.0/src/modules/about/ENTRIES +++ /dev/null @@ -1,259 +0,0 @@ -NAME: Szymon Stefanek -NICK: Pragma -MAIL: pragma at kvirc dot net -ROLE: The "Creator" of KVIrc -ROLE: Mental work, hand work, -ROLE: eyes consuming and coffee drinking -TEXT: I'll check... lemme check... -TEXT: I'll fix it tomorrow... -TEXT: KVIrc: the client that can't make coffee - -NAME: Jan Wagner -NICK: Istari -NICK: spion -ROLE: Webmaster, bughunter, snapshot mantainer -ROLE: support gay^Wguy :o) and the man that gives -ROLE: you KVIrc through IPv6. - -NAME: Luk De Ketelaere -NICK: Balboy -MAIL: balboy at kvirc dot net -ROLE: Documentation, bug searching, public relations -TEXT: No idea of what you're talking about... or why you need it :) - -NAME: Andrea Parrella -NICK: YaP -MAIL: yap at kvirc dot net -ROLE: Bug hunting, plugin development, bug fixes, -ROLE: windows porting and snapshots -TEXT: why you haven't implemented a class like DoEverythingByYourself ? :) -TEXT: <Pragma> a wonderful recursive function :) -TEXT: <YaP> Damn...I knew it eheheheheh - -NAME: Christian Strommen -NICK: Number1 -MAIL: number1 at realityx dot net -ROLE: Makes sure that nobody is lazy, bug-hunter, a LOT of suggestions and maker of RealityX IRC -TEXT: Skydiving is almost as exciting as KVIrc scripting! -TEXT: Pragma: could you add these functions: $rubmyback() and $makecoffe() ? - -NAME: Olle Hällnäs -NICK: Crocodile -MAIL: olle at xmms dot org -ROLE: The "open hand" for the KVIrc project. -ROLE: Provider of the CVS service, www & ftp mirroring, bandwidth, -ROLE: great ideas and fun while coding. - -NAME: Juanjo Alvarez -NICK: Kane -MAIL: juanjux at yahoo dot es -ROLE: Away system, colored nicks, general programming, spanish translantation -TEXT: Pragma: think of KVIrc as a tool for scripters... we have to left them something to do :) - -NAME: Krzysztof Godlewski -NICK: Kristoff -MAIL: kristoff at proczta dot wprost dot pl -ROLE: Official polish beer provider -ROLE: and plugin developer -TEXT: echo "STOP IT" > /dev/neighbour -TEXT: cd ./neighbour && make clean -TEXT: Pragma...erm...bugs ? WHICH bugs ? ;)) - -NAME: Christopher R. Gabriel -NICK: CGabriel -MAIL: cgabriel at linux dot it -ROLE: The 'light' inside the GNU clouds -ROLE: Generic (??!) official project supporter :) -TEXT: Pragma: seems that kvirc with all its plugins is becoming a desktop environment -TEXT: echo espresso > /dev/coffee -TEXT: Pragma: you reached the user limit. WTF! - -NAME: Andrew Frolov -NICK: Drosha@Undernet -ROLE: Beta testing -ROLE: Ideator of www.kvirc.org -TEXT: This free project is better that shareware -TEXT: mIrc for windows even in alpha stage - -NAME: Ted Podgurski -NICK: alch3m1st -MAIL: tedp at toocool dot com -ROLE: Test scripter, bug hunting -ROLE: ideator & creator of the first www.kvirc.net -TEXT: whassup ? - -NAME: RAD Kade 1 -NICK: RADKade1 -ROLE: Debugging an improvements -TEXT: I'm just *really* good at doing things -TEXT: when I have no idea of what I'm actually doing - -NAME: Fritz Elfert -NICK: KNFritz@OpenProjects -ROLE: Improvements of KVIrc code and of my linux knowledge -ROLE: I like to think him as a 'spiritual guide'... :D - -NAME: Charles Samuels -NICK: Njaard -MAIL: charles at altair dot dhs dot org -ROLE: The KDE man! Making sure that KVirc has a reason to have a K in the beginning -TEXT: Could I please make KVirc a pure KDE application today?? Pleeease... - -NAME: BuTi -NICK: BuTi@OpenProjects -MAIL: buti at geocities dot com -ROLE: Some "tiny" pieces of code - -NAME: Nick Betcher -NICK: Error403 -MAIL: nbetcher at real-time dot com -TEXT: <Error403> Number1: I imagined you looking crazy :) -TEXT: "<NumeroUno> I was drunk - -NAME: Orn E. Hansen -NICK: oehansen -MAIL: oe.hansen at gamma dot telenordia dot se -ROLE: The official C++ manual and plugin developer -TEXT: prepare yourselves.. -TEXT: #include <iostream.h> -TEXT: class testing {... -TEXT: <oehansen> I must admit, I'm getting confused :-) -TEXT: <Pragma> Me too , at this point :) - -NAME: Giovanni Ferri -NICK: marl -MAIL: giovanni at fonderiadigitale dot it -ROLE: Bug hunter, ideas source :) -TEXT: buy a pigeon traveller and pass dcc transfers to him - -NAME: Anodine -NICK: [Anodine] -ROLE: Various funky improvements -TEXT: I can program anything I set my mind to! - -NAME: Paul Boehm -NICK: infected -ROLE: Beta testing, language structure improvements -TEXT: ...it's enough for 100 IPs per meter -TEXT: on earth, so every lightswitch can have -TEXT: its own IP...then you telnet to your lightswitch -TEXT: and turn it off! - -NAME: munehiro -NICK: munehiro -ROLE: Italian translations, code improvements and many useful suggestions - -NAME: Eva Schaller -NICK: Penny -ROLE: Italian translation, bug hunting, moral support :)))) -TEXT: KVirc ? Ah! Il dinosauro... - -NAME: Christoph Thielecke -NICK: Crissi -ROLE: German translation, bug hunting, new ideas -ROLE: Some scripting, Code improvements + new code ;) -TEXT: Pragma: Short question... - -NAME: Triskelios -NICK: Triskelios -MAIL: trisk-kvirc at quasarnet dot org -ROLE: Breaking everything, and correcting grammar when there isn't anything left to break -ROLE: Also, listening to Aeri's requests and getting about half of them done... -TEXT: Hey, it's not my responsibility to find a funny quote of myself ^_~ - -NAME: Dušan Hokův -NICK: Hunterz -MAIL: dusan at mirc dot cz -ROLE: Czech translation - -NAME: Thilo Shulz -NICK: Thilo -ROLE: Bugtracking and constant user support on #kvirc - -NAME: Iacopo Palazzi -NICK: Iakko@IrcNet -MAIL: iakko at omnikron dot net -ROLE: Various code patches, ideas and bug hunting - -NAME: Thomas Kalla -NICK: |Tom|@IrcNet -ROLE: MacOSX porting - -NAME: Valeriy Girchenko -ROLE: Russian translation - -NAME: José Melo -NICK: Ze_M -ROLE: Portuguese translation, default script patches and Mandriva (MDE) packager. - -NAME: Adilson Gonçalves Soares Junior -NICK: CaBiDe -MAIL: cabide at brfree dot com dot br -ROLE: Portuguese Brasilian translation - -NAME: Alessandro Carbone -NICK: Noldor -MAIL: noldor at barmes dot org -ROLE: Betatesting, bugfixing, exotic scripting, -ROLE: code improvements, documentation....To be continued :-) -TEXT: <Grifisx>...damned brackets  ...there are always too many... -TEXT: <Noldor>....or too few.. - -NAME: Tonino Imbesi -NICK: Grifisx -MAIL: grifisx at barmes dot org -ROLE: Betatesting, bugfixing, exotic scripting, -ROLE: code improvements, documentation....To be continued :-) -TEXT: <Grifisx> The difference between me and you is just that -TEXT: <Grifisx> You see things and you say "Why?" But I dream things -TEXT: <Grifisx> that never were and I say..."Why not?" - -NAME: Alexey Uzhva -NICK: Alexey -MAIL: wizard at opendoor dot ru -ROLE: Bugfixing, code improvements, localization improvements -ROLE: To be continued :-) - -NAME: Ahinu -NICK: Ahinu -MAIL: ahinu at wanadoo dot fr -ROLE: French translation, code fixes, betatesting and heavy bughunting - -NAME: Cle' -NICK: Etherea -MAIL: badgirl at virg0 dot org -ROLE: Artist :) -TEXT: Time makes no sense ;) - -NAME: Andidas -NICK: Andidas -ROLE: Splash screen Artist :) -MAIL: http://www.andidas.com - -NAME: TheXception -NICK: TheXception -MAIL: kvirc@thexception.net -ROLE: bugfixes, german tutorials -TEXT: everything is possible, it only needs its time. - -NAME: Elvio Basello -NICK: HelLViS69 -MAIL: hellvis69 at netsons dot org -ROLE: Site (re)creator, Italian translation, scripting, -ROLE: bughunting, Slackware packages, new ideas... -TEXT: <HelLViS69> Blessed gdb, in the name of ritchie, -TEXT: kermingham and rms - -NAME: Massimiliano Leone -NICK: k0sm|k0 -MAIL: k0smik0 at logorroici dot org -ROLE: Debian packages, moral support -TEXT: One must make one's self superior to humanity, in power, -TEXT: in loftiness of soul, in contempt. - Friedrich Nietzsche - -NAME: Lorenzo Marcon -NICK: LoSko -MAIL: http://losko.altervista.org/nglfserv/ -ROLE: Bug hunting and fixing, doc fixes, scripting (NGL File Server) -TEXT: I don't know what I want, but I know how to get it. - diff --git a/3.4.0/src/modules/about/Makefile.am b/3.4.0/src/modules/about/Makefile.am deleted file mode 100644 index 4192c11959..0000000000 --- a/3.4.0/src/modules/about/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -############################################################################### -# KVirc IRC client Makefile - 10.03.2000 Szymon Stefanek <stefanek@tin.it> -############################################################################### - -AM_CPPFLAGS = -I$(SS_TOPSRCDIR)/src/kvilib/include/ -I$(SS_TOPSRCDIR)/src/kvirc/include/ \ -$(SS_INCDIRS) $(SS_CPPFLAGS) -DGLOBAL_KVIRC_DIR=\"$(globalkvircdir)\" - -pluglib_LTLIBRARIES = libkviabout.la - -libkviabout_la_LDFLAGS = -module -avoid-version $(SS_LDFLAGS) $(SS_LIBDIRS) - -libkviabout_la_SOURCES = libkviabout.cpp aboutdialog.cpp - -libkviabout_la_LIBADD = $(SS_LIBLINK) ../../kvilib/build/libkvilib.la - -noinst_HEADERS= aboutdialog.h - -EXTRA_DIST = mkabouttext.pl abouttext.inc ENTRIES - -abouttext: - perl mkabouttext.pl - -%.moc: %.h - $(SS_QT_MOC) $< -o $@ - -#libkviabout.cpp: libkviabout.moc -aboutdialog.cpp: aboutdialog.moc diff --git a/3.4.0/src/modules/about/about.vcproj b/3.4.0/src/modules/about/about.vcproj deleted file mode 100755 index ec845118f7..0000000000 --- a/3.4.0/src/modules/about/about.vcproj +++ /dev/null @@ -1,172 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="7.10" - Name="about" - ProjectGUID="{1DEEEFDC-8DF0-4E33-B869-84737C15E64C}" - Keyword="Win32Proj"> - <Platforms> - <Platform - Name="Win32"/> - </Platforms> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin\modules" - IntermediateDirectory="Debug" - ConfigurationType="2" - CharacterSet="2"> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui"" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;ABOUT_EXPORTS" - MinimalRebuild="TRUE" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" - DebugInformationFormat="4"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt-mtnc321.lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib kvirc.lib msvcrt.lib" - OutputFile="$(OutDir)/kvi$(ProjectName).dll" - LinkIncremental="2" - AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin"" - IgnoreAllDefaultLibraries="TRUE" - GenerateDebugInformation="TRUE" - ProgramDatabaseFile="$(OutDir)/about.pdb" - SubSystem="2" - ImportLibrary="$(OutDir)/about.lib" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin\modules" - IntermediateDirectory="Release" - ConfigurationType="2" - CharacterSet="2"> - <Tool - Name="VCCLCompilerTool" - GlobalOptimizations="TRUE" - InlineFunctionExpansion="2" - FavorSizeOrSpeed="1" - OmitFramePointers="TRUE" - AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui"" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;ABOUT_EXPORTS" - RuntimeLibrary="0" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" - DebugInformationFormat="3"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt-mtnc321.lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib kvirc.lib msvcrt.lib" - OutputFile="$(OutDir)/kvi$(ProjectName).dll" - LinkIncremental="1" - AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin"" - IgnoreAllDefaultLibraries="TRUE" - GenerateDebugInformation="TRUE" - SubSystem="2" - OptimizeReferences="2" - EnableCOMDATFolding="2" - OptimizeForWindows98="1" - ImportLibrary="$(OutDir)/about.lib" - TargetMachine="1"/> - <Tool - Name="VCMIDLTool"/> - <Tool - Name="VCPostBuildEventTool"/> - <Tool - Name="VCPreBuildEventTool"/> - <Tool - Name="VCPreLinkEventTool"/> - <Tool - Name="VCResourceCompilerTool"/> - <Tool - Name="VCWebServiceProxyGeneratorTool"/> - <Tool - Name="VCXMLDataGeneratorTool"/> - <Tool - Name="VCWebDeploymentTool"/> - <Tool - Name="VCManagedWrapperGeneratorTool"/> - <Tool - Name="VCAuxiliaryManagedWrapperGeneratorTool"/> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> - <File - RelativePath=".\aboutdialog.cpp"> - </File> - <File - RelativePath=".\libkviabout.cpp"> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> - <File - RelativePath=".\aboutdialog.h"> - <FileConfiguration - Name="Debug|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32"> - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o $(InputDir)\$(InputName).moc $(InputDir)\$(InputFileName) -" - Outputs="$(InputDir)\$(InputName).moc"/> - </FileConfiguration> - </File> - <File - RelativePath=".\libkviabout.h"> - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" - UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3.4.0/src/modules/about/about_QT4_vc05.vcproj b/3.4.0/src/modules/about/about_QT4_vc05.vcproj deleted file mode 100644 index a1d326f9bd..0000000000 --- a/3.4.0/src/modules/about/about_QT4_vc05.vcproj +++ /dev/null @@ -1,262 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8,00" - Name="about" - ProjectGUID="{1DEEEFDC-8DF0-4E33-B869-84737C15E64C}" - RootNamespace="about" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin\modules\" - IntermediateDirectory="Debug" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui";"$(QTDIR)\include\Qt3Support";"$(QTDIR)\include\QtCore\";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtNetwork";"$(QTDIR)\include\QtXml";" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;ABOUT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="false" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt3support4.lib qtcore4.lib qtgui4.lib qtmain.lib kvilib.lib kvirc.lib" - OutputFile="$(OutDir)/kvi$(ProjectName).dll" - LinkIncremental="2" - AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)"" - GenerateManifest="true" - GenerateDebugInformation="true" - ProgramDatabaseFile="$(OutDir)/about.pdb" - SubSystem="2" - TurnOffAssemblyGeneration="true" - ImportLibrary="$(OutDir)/about.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest" - EmbedManifest="true" - VerboseOutput="true" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin\modules" - IntermediateDirectory="Release" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="1" - InlineFunctionExpansion="2" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - EnableFiberSafeOptimizations="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui";"$(QTDIR)\include\Qt3Support";"$(QTDIR)\include\QtCore\";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtNetwork";"$(QTDIR)\include\QtXml";" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;ABOUT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;" - StringPooling="true" - MinimalRebuild="true" - ExceptionHandling="1" - RuntimeLibrary="2" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="false" - DebugInformationFormat="0" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="kvilib.lib kvirc.lib qt3support4.lib qtgui4.lib qtcore4.lib" - OutputFile="$(OutDir)/kvi$(ProjectName).dll" - LinkIncremental="1" - AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)"" - GenerateManifest="true" - IgnoreAllDefaultLibraries="false" - GenerateDebugInformation="true" - SubSystem="2" - OptimizeReferences="2" - EnableCOMDATFolding="2" - OptimizeForWindows98="1" - LinkTimeCodeGeneration="1" - TurnOffAssemblyGeneration="true" - ImportLibrary="$(OutDir)/about.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest" - EmbedManifest="false" - VerboseOutput="true" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\aboutdialog.cpp" - > - </File> - <File - RelativePath=".\libkviabout.cpp" - > - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath=".\aboutdialog.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName) " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\libkviabout.h" - > - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" - UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3.4.0/src/modules/about/about_vc05.vcproj b/3.4.0/src/modules/about/about_vc05.vcproj deleted file mode 100644 index 5cff41cc26..0000000000 --- a/3.4.0/src/modules/about/about_vc05.vcproj +++ /dev/null @@ -1,255 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8,00" - Name="about" - ProjectGUID="{1DEEEFDC-8DF0-4E33-B869-84737C15E64C}" - RootNamespace="about" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin\modules\" - IntermediateDirectory="Debug" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui"" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;ABOUT_EXPORTS;_CRT_SECURE_NO_DEPRECATE" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt-$(QTTAG).lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib kvirc.lib msvcrt.lib perl58.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib" - OutputFile="$(OutDir)/kvi$(ProjectName).dll" - LinkIncremental="2" - AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)"" - GenerateManifest="true" - IgnoreAllDefaultLibraries="true" - GenerateDebugInformation="true" - ProgramDatabaseFile="$(OutDir)/about.pdb" - SubSystem="2" - TurnOffAssemblyGeneration="true" - ImportLibrary="$(OutDir)/about.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest" - EmbedManifest="true" - VerboseOutput="true" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="$(SolutionDir)\win32build\bin\modules" - IntermediateDirectory="Release" - ConfigurationType="2" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" - CharacterSet="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="1" - AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui"" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;ABOUT_EXPORTS;_CRT_SECURE_NO_DEPRECATE" - StringPooling="true" - MinimalRebuild="false" - ExceptionHandling="1" - RuntimeLibrary="0" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="qt-$(QTTAG).lib qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib kvirc.lib msvcrt.lib perl58.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib" - OutputFile="$(OutDir)/kvi$(ProjectName).dll" - LinkIncremental="1" - AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)"" - GenerateManifest="true" - IgnoreAllDefaultLibraries="true" - GenerateDebugInformation="true" - SubSystem="2" - OptimizeReferences="2" - EnableCOMDATFolding="2" - OptimizeForWindows98="1" - TurnOffAssemblyGeneration="true" - ImportLibrary="$(OutDir)/about.lib" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest" - EmbedManifest="false" - VerboseOutput="true" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Source Files" - Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\aboutdialog.cpp" - > - </File> - <File - RelativePath=".\libkviabout.cpp" - > - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath=".\aboutdialog.h" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)" " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName) " - Outputs="$(InputDir)\$(InputName).moc" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\libkviabout.h" - > - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" - UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" - > - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3.4.0/src/modules/about/aboutdialog.cpp b/3.4.0/src/modules/about/aboutdialog.cpp deleted file mode 100644 index 1688e09e21..0000000000 --- a/3.4.0/src/modules/about/aboutdialog.cpp +++ /dev/null @@ -1,166 +0,0 @@ -//============================================================================= -// -// File : aboutdialog.cpp -// Creation date : Sun Jun 23 17:59:12 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "aboutdialog.h" - -#include "kvi_defaults.h" - -#include "kvi_locale.h" -#include "kvi_app.h" -#include "kvi_fileutils.h" -#include "kvi_sourcesdate.h" - -#include <qwidget.h> -#include <qlayout.h> -#include <kvi_tal_textedit.h> -#include <qlabel.h> -#include <qpixmap.h> -#include <qevent.h> - -extern KviAboutDialog * g_pAboutDialog; -/* -"<font color=\"#FFFF00\"><b>KVIrc public releases :</b></font><br>\n" \ -"<br>\n" \ -"<font color=\"#FF0000\">0.9.0</font><br>\n" \ -"<font size=\"2\" color=\"#808080\">Release date: 25.01.1999</font><br>\n" \ -"<br>\n" \ -"<font color=\"#FF0000\">1.0.0 'Millennium'</font><br>\n" \ -"<font size=\"2\">\"The net in your hands\"</font><br>\n" \ -"<font size=\"2\" color=\"#808080\">Release date: 21.12.1999</font><br>\n" \ -"<br>\n" \ -"<font color=\"#FF0000\">2.0.0 'Phoenix'</font><br>\n" \ -"<font size=\"2\">\"The client that can't make coffee\"</font><br>\n" \ -"<font size=\"2\" color=\"#808080\">Release date: 30.05.2000</font><br>\n" \ -"<br>\n" \ -"<font color=\"#FF0000\">2.1.0 'Dark Star'</font><br>\n" \ -"<font size=\"2\">\"The client that can't make coffee\"</font><br>\n" \ -"<font size=\"2\" color=\"#808080\">Release date: 30.01.2001</font><br>\n" \ -"<br>\n" \ -"<font color=\"#FF0000\">2.1.1 'Monolith'</font><br>\n" \ -"<font size=\"2\">\"A breath of fresh net\"</font><br>\n" \ -"<font size=\"2\" color=\"#808080\">Release date: 01.05.2001</font><br>\n" \ -"<br> 3.0.0-xmas build: 24-12-2001\n" \ -"3.0.0-beta1: 24-06-2002\n " -"<font color=\"#FF0000\">3.0.0 'Avatar'</font><br>\n" \ -"<font size=\"2\">\"No slogan yet\"</font><br>\n" \ -"<font size=\"2\" color=\"#808080\">Release date: Still unknown</font><br>\n" \ -*/ - -#include "abouttext.inc" - -KviAboutDialog::KviAboutDialog() -: KviTalTabDialog(0) -{ - setCaption(__tr2qs_ctx("About KVIrc...","about")); - setOkButton(__tr2qs_ctx("Close","about")); - - KviStr buffer; - g_pApp->findImage(buffer,"kvi_splash.png"); - - QPixmap pix(buffer.ptr()); - - QWidget * w = new QWidget(this); - QGridLayout * g = new QGridLayout(w,2,1,4,8); - - QLabel * l = new QLabel(w); - l->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); - l->setBackgroundColor(Qt::black); - l->setAlignment(Qt::AlignCenter); - l->setPixmap(pix); - - g->addWidget(l,0,0); - - QString aboutString= "KVIrc <b>" KVI_VERSION " '" KVI_RELEASE_NAME "'</b><br>"; - aboutString += __tr2qs_ctx("Forged by the <b>KVIrc Development Team</b>","about"); - aboutString += "<br>"; - aboutString += __tr2qs_ctx("Sources date","about"); - aboutString += ": "; - aboutString += KVI_SOURCES_DATE; - - l = new QLabel(aboutString,w); - l->setAlignment(Qt::AlignCenter); - g->addWidget(l,1,0); - - addTab(w,__tr2qs_ctx("About","about")); - - - - w = new QWidget(this); - g = new QGridLayout(w,1,1,4,8); - - KviTalTextEdit * v = new KviTalTextEdit(w); - v->setReadOnly(true); - g->addWidget(v,0,0); - - v->setText(g_szAboutText); - - addTab(w,__tr2qs_ctx("Honor && Glory","about")); - - - - w = new QWidget(this); - g = new QGridLayout(w,1,1,4,8); - - v = new KviTalTextEdit(w); - v->setReadOnly(true); - v->setWordWrap(KviTalTextEdit::NoWrap); - g->addWidget(v,0,0); - - QString szLicense; - - QString szLicensePath; - g_pApp->getGlobalKvircDirectory(szLicensePath,KviApp::License,"COPYING"); - - if(!KviFileUtils::loadFile(szLicensePath,szLicense)) - { - szLicense = __tr2qs_ctx("Oops... Can't find the license file...\n" \ - "It MUST be included in the distribution...\n" \ - "Please report to <pragma at kvirc dot net>","about"); - } - - v->setText(szLicense); - - addTab(w,__tr2qs_ctx("License","about")); - - - connect(this,SIGNAL(applyButtonPressed()),this,SLOT(closeButtonPressed())); -} - -KviAboutDialog::~KviAboutDialog() -{ - g_pAboutDialog = 0; -} - -void KviAboutDialog::closeEvent(QCloseEvent *e) -{ - e->ignore(); - delete this; -} - -void KviAboutDialog::closeButtonPressed() -{ - delete this; -} - -#include "aboutdialog.moc" diff --git a/3.4.0/src/modules/about/aboutdialog.h b/3.4.0/src/modules/about/aboutdialog.h deleted file mode 100644 index 95ef968a49..0000000000 --- a/3.4.0/src/modules/about/aboutdialog.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _ABOUTDIALOG_H_ -#define _ABOUTDIALOG_H_ -// -// File : aboutdialog.h -// Creation date : Sun Jun 23 17:59:13 2002 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 <kvi_tal_tabdialog.h> - -class KviAboutDialog : public KviTalTabDialog -{ - Q_OBJECT -public: - KviAboutDialog(); - ~KviAboutDialog(); -protected: - virtual void closeEvent(QCloseEvent *e); -protected slots: - void closeButtonPressed(); -}; - -#endif //_ABOUTDIALOG_H_ diff --git a/3.4.0/src/modules/about/abouttext.inc b/3.4.0/src/modules/about/abouttext.inc deleted file mode 100644 index c35fc173e4..0000000000 --- a/3.4.0/src/modules/about/abouttext.inc +++ /dev/null @@ -1,768 +0,0 @@ -static char * g_szAboutText = "" \ -"<html>" \ -"<head>" \ -"<title>Honor and glory" \ -"" \ -"
" \ -"

" \ -"This is a partial list of the people that have " \ -"contributed in some way to the KVIrc project.

" \ -"Honor and glory to:
" \ -"



" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Szymon Stefanek" \ -"
(" \ -"Pragma" \ -")
" \ -"[" \ -"pragma at kvirc dot net" \ -"]" \ -"
" \ -"The \"Creator\" of KVIrc" \ -"
" \ -"Mental work, hand work," \ -"
" \ -"eyes consuming and coffee drinking" \ -"
" \ -"\"I'll check... lemme check...\"" \ -"
" \ -"\"I'll fix it tomorrow...\"" \ -"
" \ -"\"KVIrc: the client that can't make coffee\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Jan Wagner" \ -"
(" \ -"Istari" \ -", " \ -"spion" \ -")
" \ -"Webmaster, bughunter, snapshot mantainer" \ -"
" \ -"support gay^Wguy :o) and the man that gives" \ -"
" \ -"you KVIrc through IPv6." \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Luk De Ketelaere" \ -"
(" \ -"Balboy" \ -")
" \ -"[" \ -"balboy at kvirc dot net" \ -"]" \ -"
" \ -"Documentation, bug searching, public relations" \ -"
" \ -"\"No idea of what you're talking about... or why you need it :)\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Andrea Parrella" \ -"
(" \ -"YaP" \ -")
" \ -"[" \ -"yap at kvirc dot net" \ -"]" \ -"
" \ -"Bug hunting, plugin development, bug fixes," \ -"
" \ -"windows porting and snapshots" \ -"
" \ -"\"why you haven't implemented a class like DoEverythingByYourself ? :)\"" \ -"
" \ -"\"<Pragma> a wonderful recursive function :)\"" \ -"
" \ -"\"<YaP> Damn...I knew it eheheheheh\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Christian Strommen" \ -"
(" \ -"Number1" \ -")
" \ -"[" \ -"number1 at realityx dot net" \ -"]" \ -"
" \ -"Makes sure that nobody is lazy, bug-hunter, a LOT of suggestions and maker of RealityX IRC" \ -"
" \ -"\"Skydiving is almost as exciting as KVIrc scripting!\"" \ -"
" \ -"\"Pragma: could you add these functions: $rubmyback() and $makecoffe() ?\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Olle Hällnäs" \ -"
(" \ -"Crocodile" \ -")
" \ -"[" \ -"olle at xmms dot org" \ -"]" \ -"
" \ -"The \"open hand\" for the KVIrc project." \ -"
" \ -"Provider of the CVS service, www & ftp mirroring, bandwidth," \ -"
" \ -"great ideas and fun while coding." \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Juanjo Alvarez" \ -"
(" \ -"Kane" \ -")
" \ -"[" \ -"juanjux at yahoo dot es" \ -"]" \ -"
" \ -"Away system, colored nicks, general programming, spanish translantation" \ -"
" \ -"\"Pragma: think of KVIrc as a tool for scripters... we have to left them something to do :)\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Krzysztof Godlewski" \ -"
(" \ -"Kristoff" \ -")
" \ -"[" \ -"kristoff at proczta dot wprost dot pl" \ -"]" \ -"
" \ -"Official polish beer provider" \ -"
" \ -"and plugin developer" \ -"
" \ -"\"echo \"STOP IT\" > /dev/neighbour\"" \ -"
" \ -"\"cd ./neighbour && make clean\"" \ -"
" \ -"\"Pragma...erm...bugs ? WHICH bugs ? ;))\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Christopher R. Gabriel" \ -"
(" \ -"CGabriel" \ -")
" \ -"[" \ -"cgabriel at linux dot it" \ -"]" \ -"
" \ -"The 'light' inside the GNU clouds" \ -"
" \ -"Generic (??!) official project supporter :)" \ -"
" \ -"\"Pragma: seems that kvirc with all its plugins is becoming a desktop environment\"" \ -"
" \ -"\"echo espresso > /dev/coffee\"" \ -"
" \ -"\"Pragma: you reached the user limit. WTF!\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Andrew Frolov" \ -"
(" \ -"Drosha@Undernet" \ -")
" \ -"Beta testing" \ -"
" \ -"Ideator of www.kvirc.org" \ -"
" \ -"\"This free project is better that shareware\"" \ -"
" \ -"\"mIrc for windows even in alpha stage\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Ted Podgurski" \ -"
(" \ -"alch3m1st" \ -")
" \ -"[" \ -"tedp at toocool dot com" \ -"]" \ -"
" \ -"Test scripter, bug hunting" \ -"
" \ -"ideator & creator of the first www.kvirc.net" \ -"
" \ -"\"whassup ?\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"RAD Kade 1" \ -"
(" \ -"RADKade1" \ -")
" \ -"Debugging an improvements" \ -"
" \ -"\"I'm just *really* good at doing things\"" \ -"
" \ -"\"when I have no idea of what I'm actually doing\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Fritz Elfert" \ -"
(" \ -"KNFritz@OpenProjects" \ -")
" \ -"Improvements of KVIrc code and of my linux knowledge" \ -"
" \ -"I like to think him as a 'spiritual guide'... :D" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Charles Samuels" \ -"
(" \ -"Njaard" \ -")
" \ -"[" \ -"charles at altair dot dhs dot org" \ -"]" \ -"
" \ -"The KDE man! Making sure that KVirc has a reason to have a K in the beginning" \ -"
" \ -"\"Could I please make KVirc a pure KDE application today?? Pleeease...\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"BuTi" \ -"
(" \ -"BuTi@OpenProjects" \ -")
" \ -"[" \ -"buti at geocities dot com" \ -"]" \ -"
" \ -"Some \"tiny\" pieces of code" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Nick Betcher" \ -"
(" \ -"Error403" \ -")
" \ -"[" \ -"nbetcher at real-time dot com" \ -"]" \ -"
" \ -"\"<Error403> Number1: I imagined you looking crazy :)\"" \ -"
" \ -"\"\"<NumeroUno> I was drunk\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Orn E. Hansen" \ -"
(" \ -"oehansen" \ -")
" \ -"[" \ -"oe.hansen at gamma dot telenordia dot se" \ -"]" \ -"
" \ -"The official C++ manual and plugin developer" \ -"
" \ -"\"prepare yourselves..\"" \ -"
" \ -"\"#include <iostream.h>\"" \ -"
" \ -"\"class testing {...\"" \ -"
" \ -"\"<oehansen> I must admit, I'm getting confused :-)\"" \ -"
" \ -"\"<Pragma> Me too , at this point :)\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Giovanni Ferri" \ -"
(" \ -"marl" \ -")
" \ -"[" \ -"giovanni at fonderiadigitale dot it" \ -"]" \ -"
" \ -"Bug hunter, ideas source :)" \ -"
" \ -"\"buy a pigeon traveller and pass dcc transfers to him\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Anodine" \ -"
(" \ -"[Anodine]" \ -")
" \ -"Various funky improvements" \ -"
" \ -"\"I can program anything I set my mind to!\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Paul Boehm" \ -"
(" \ -"infected" \ -")
" \ -"Beta testing, language structure improvements" \ -"
" \ -"\"...it's enough for 100 IPs per meter\"" \ -"
" \ -"\"on earth, so every lightswitch can have\"" \ -"
" \ -"\"its own IP...then you telnet to your lightswitch\"" \ -"
" \ -"\"and turn it off!\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"munehiro" \ -"
(" \ -"munehiro" \ -")
" \ -"Italian translations, code improvements and many useful suggestions" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Eva Schaller" \ -"
(" \ -"Penny" \ -")
" \ -"Italian translation, bug hunting, moral support :))))" \ -"
" \ -"\"KVirc ? Ah! Il dinosauro...\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Christoph Thielecke" \ -"
(" \ -"Crissi" \ -")
" \ -"German translation, bug hunting, new ideas" \ -"
" \ -"Some scripting, Code improvements + new code ;)" \ -"
" \ -"\"Pragma: Short question...\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Triskelios" \ -"
(" \ -"Triskelios" \ -")
" \ -"[" \ -"trisk-kvirc at quasarnet dot org" \ -"]" \ -"
" \ -"Breaking everything, and correcting grammar when there isn't anything left to break" \ -"
" \ -"Also, listening to Aeri's requests and getting about half of them done..." \ -"
" \ -"\"Hey, it's not my responsibility to find a funny quote of myself ^_~\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Dušan Hokův" \ -"
(" \ -"Hunterz" \ -")
" \ -"[" \ -"dusan at mirc dot cz" \ -"]" \ -"
" \ -"Czech translation" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Thilo Shulz" \ -"
(" \ -"Thilo" \ -")
" \ -"Bugtracking and constant user support on #kvirc" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Iacopo Palazzi" \ -"
(" \ -"Iakko@IrcNet" \ -")
" \ -"[" \ -"iakko at omnikron dot net" \ -"]" \ -"
" \ -"Various code patches, ideas and bug hunting" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Thomas Kalla" \ -"
(" \ -"|Tom|@IrcNet" \ -")
" \ -"MacOSX porting" \ -"


" \ -"" \ -"" \ -"" \ -"
" \ -"Valeriy Girchenko" \ -"
" \ -"Russian translation" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"José Melo" \ -"
(" \ -"Ze_M" \ -")
" \ -"Portuguese translation, default script patches and Mandriva (MDE) packager." \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Adilson Gonçalves Soares Junior" \ -"
(" \ -"CaBiDe" \ -")
" \ -"[" \ -"cabide at brfree dot com dot br" \ -"]" \ -"
" \ -"Portuguese Brasilian translation" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Alessandro Carbone" \ -"
(" \ -"Noldor" \ -")
" \ -"[" \ -"noldor at barmes dot org" \ -"]" \ -"
" \ -"Betatesting, bugfixing, exotic scripting," \ -"
" \ -"code improvements, documentation....To be continued :-)" \ -"
" \ -"\"<Grifisx>...damned brackets  ...there are always too many...\"" \ -"
" \ -"\"<Noldor>....or too few..\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Tonino Imbesi" \ -"
(" \ -"Grifisx" \ -")
" \ -"[" \ -"grifisx at barmes dot org" \ -"]" \ -"
" \ -"Betatesting, bugfixing, exotic scripting," \ -"
" \ -"code improvements, documentation....To be continued :-)" \ -"
" \ -"\"<Grifisx> The difference between me and you is just that\"" \ -"
" \ -"\"<Grifisx> You see things and you say \"Why?\" But I dream things \"" \ -"
" \ -"\"<Grifisx> that never were and I say...\"Why not?\"\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Alexey Uzhva" \ -"
(" \ -"Alexey" \ -")
" \ -"[" \ -"wizard at opendoor dot ru" \ -"]" \ -"
" \ -"Bugfixing, code improvements, localization improvements" \ -"
" \ -"To be continued :-)" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Ahinu" \ -"
(" \ -"Ahinu" \ -")
" \ -"[" \ -"ahinu at wanadoo dot fr " \ -"]" \ -"
" \ -"French translation, code fixes, betatesting and heavy bughunting" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Cle'" \ -"
(" \ -"Etherea" \ -")
" \ -"[" \ -"badgirl at virg0 dot org" \ -"]" \ -"
" \ -"Artist :)" \ -"
" \ -"\"Time makes no sense ;)\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Andidas" \ -"
(" \ -"Andidas" \ -")
" \ -"[" \ -"http://www.andidas.com" \ -"]" \ -"
" \ -"Splash screen Artist :)" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"TheXception" \ -"
(" \ -"TheXception" \ -")
" \ -"[" \ -"kvirc@thexception.net" \ -"]" \ -"
" \ -"bugfixes, german tutorials" \ -"
" \ -"\"everything is possible, it only needs its time.\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Elvio Basello" \ -"
(" \ -"HelLViS69" \ -")
" \ -"[" \ -"hellvis69 at netsons dot org" \ -"]" \ -"
" \ -"Site (re)creator, Italian translation, scripting," \ -"
" \ -"bughunting, Slackware packages, new ideas..." \ -"
" \ -"\"<HelLViS69> Blessed gdb, in the name of ritchie,\"" \ -"
" \ -"\"kermingham and rms\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Massimiliano Leone" \ -"
(" \ -"k0sm|k0" \ -")
" \ -"[" \ -"k0smik0 at logorroici dot org" \ -"]" \ -"
" \ -"Debian packages, moral support" \ -"
" \ -"\"One must make one's self superior to humanity, in power,\"" \ -"
" \ -"\"in loftiness of soul, in contempt. - Friedrich Nietzsche\"" \ -"


" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"" \ -"
" \ -"Lorenzo Marcon" \ -"
(" \ -"LoSko" \ -")
" \ -"[" \ -"http://losko.altervista.org/nglfserv/" \ -"]" \ -"
" \ -"Bug hunting and fixing, doc fixes, scripting (NGL File Server)" \ -"
" \ -"\"I don't know what I want, but I know how to get it.\"" \ -"


" \ -"
" \ -"This list is far from being complete.
" \ -"A lot of more or less \"anonymous\" people have wasted their time, " \ -"eyes, bandwidth and brain resources on this project.
" \ -"If you're one of those, then well, this dialog is also for you :)
" \ -"
" \ -"" \ -""; diff --git a/3.4.0/src/modules/about/kviabout.dsp b/3.4.0/src/modules/about/kviabout.dsp deleted file mode 100644 index 8e755c3027..0000000000 --- a/3.4.0/src/modules/about/kviabout.dsp +++ /dev/null @@ -1,164 +0,0 @@ -# Microsoft Developer Studio Project File - Name="kviabout" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=kviabout - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "kviabout.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "kviabout.mak" CFG="kviabout - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "kviabout - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "kviabout - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "kviabout - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "kviabout_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "_$(QTDIR)\include" /I "$(QTDIR)\include" /I "..\..\kvilib\tal" /I "..\..\kvilib\system" /I "..\..\kvilib\irc" /I "..\..\kvilib\file" /I "..\..\kvilib\ext" /I "..\..\kvilib\net" /I "..\..\kvilib\core\wstring" /I "..\..\kvilib\core" /I "..\..\kvilib\config" /I "..\..\kvirc\kvs" /I "..\..\kvirc\module" /I "..\..\kvirc\uparser\scripttoolbar" /I "..\..\kvirc\uparser" /I "..\..\kvirc\sparser" /I "..\..\kvirc\kernel" /I "..\..\kvirc\ui" /I "C:\ssl" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "kviabout_EXPORTS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x410 /d "NDEBUG" -# ADD RSC /l 0x410 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 $(QTDIR)\lib\qt-mtnc321.lib $(QTDIR)\lib\qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib kvirc.lib msvcrt.lib /nologo /dll /machine:I386 /nodefaultlib:"LIBCMT.lib" /out:"..\..\..\win32build\bin\modules\kviabout.dll" /libpath:"C:\OpenSSL\lib\VC" /libpath:"..\..\kvilib\Release" /libpath:"..\..\kvirc\Release" - -!ELSEIF "$(CFG)" == "kviabout - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "kviabout_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "_$(QTDIR)\include" /I "$(QTDIR)\include" /I "..\..\kvilib\tal" /I "..\..\kvilib\system" /I "..\..\kvilib\irc" /I "..\..\kvilib\file" /I "..\..\kvilib\ext" /I "..\..\kvilib\net" /I "..\..\kvilib\core\wstring" /I "..\..\kvilib\core" /I "..\..\kvilib\config" /I "..\..\kvirc\kvs" /I "..\..\kvirc\module" /I "..\..\kvirc\uparser\scripttoolbar" /I "..\..\kvirc\uparser" /I "..\..\kvirc\sparser" /I "..\..\kvirc\kernel" /I "..\..\kvirc\ui" /I "C:\ssl" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "kviabout_EXPORTS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x410 /d "_DEBUG" -# ADD RSC /l 0x410 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 $(QTDIR)\lib\qt-mtnc321.lib $(QTDIR)\lib\qtmain.lib libeay32.lib SSLeay32.lib ws2_32.lib kvilib.lib kvirc.lib msvcrt.lib /nologo /dll /incremental:no /machine:I386 /nodefaultlib:"LIBCMT.lib" /out:"..\..\..\win32build\KviDebug\modules\kviabout.dll" /libpath:"C:\OpenSSL\lib\VC" /libpath:"..\..\kvilib\Debug" /libpath:"..\..\kvirc\Debug" -# SUBTRACT LINK32 /debug - -!ENDIF - -# Begin Target - -# Name "kviabout - Win32 Release" -# Name "kviabout - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\aboutdialog.cpp -# End Source File -# Begin Source File - -SOURCE=.\libkviabout.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\aboutdialog.h - -!IF "$(CFG)" == "kviabout - Win32 Release" - -# Begin Custom Build -InputDir=. -InputPath=.\aboutdialog.h -InputName=aboutdialog - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ELSEIF "$(CFG)" == "kviabout - Win32 Debug" - -# Begin Custom Build -InputDir=. -InputPath=.\aboutdialog.h -InputName=aboutdialog - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\libkviabout.h - -!IF "$(CFG)" == "kviabout - Win32 Release" - -!ELSEIF "$(CFG)" == "kviabout - Win32 Debug" - -# Begin Custom Build -InputDir=. -InputPath=.\libkviabout.h -InputName=libkviabout - -"$(InputDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\$(InputName).moc - -# End Custom Build - -!ENDIF - -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/3.4.0/src/modules/about/kviabout.dsw b/3.4.0/src/modules/about/kviabout.dsw deleted file mode 100644 index d18c0fa88f..0000000000 --- a/3.4.0/src/modules/about/kviabout.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "kviabout"=.\kviabout.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/3.4.0/src/modules/about/libkviabout.cpp b/3.4.0/src/modules/about/libkviabout.cpp deleted file mode 100644 index 7a076edf5d..0000000000 --- a/3.4.0/src/modules/about/libkviabout.cpp +++ /dev/null @@ -1,100 +0,0 @@ -//============================================================================= -// -// File : kvi_about.cpp -// Creation date : Tue Jul 6 1999 03:54:25 by Szymon Stefanek -// Last major modification : Tue Dec 05 2000 06:00:00 by Christian Strmmen -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Till Bush (buti at geocities dot com) -// Copyright (C) 1999-2005 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 "kvi_module.h" -#include "kvi_locale.h" - - -#include "aboutdialog.h" - -KviAboutDialog * g_pAboutDialog = 0; - -/* - @doc: about.kvirc - @type: - command - @title: - about.kvirc - @short: - Shows the "about kvirc" dialog - @syntax: - about.kvirc - @description: - Shows the KVIrc "about dialog". - This command is exported by the "about" module. -*/ - - -static bool about_kvs_command_kvirc(KviKvsModuleCommandCall *) -{ - if(!g_pAboutDialog) - { - g_pAboutDialog = new KviAboutDialog(); - g_pAboutDialog->show(); - } else { - g_pAboutDialog->raise(); - } - return true; -} - - -// ======================================= -// init routine -// ======================================= - -static bool about_module_init(KviModule * m) -{ - KVSM_REGISTER_SIMPLE_COMMAND(m,"kvirc",about_kvs_command_kvirc) - return true; -} - -static bool about_module_cleanup(KviModule *m) -{ - if(g_pAboutDialog)delete g_pAboutDialog; - g_pAboutDialog = 0; - return true; -} - -static bool about_module_can_unload(KviModule * m) -{ - return (!g_pAboutDialog); -} - -// ======================================= -// plugin definition structure -// ======================================= - -KVIRC_MODULE( - "KVIrc about dialog", - "2.0.0", - "Till Bush \n" \ - "Szymon Stefanek " , - "Exports the /about.kvirc command\n", - about_module_init , - about_module_can_unload, - 0, - about_module_cleanup -) diff --git a/3.4.0/src/modules/about/libkviabout.h b/3.4.0/src/modules/about/libkviabout.h deleted file mode 100644 index 3de3764f99..0000000000 --- a/3.4.0/src/modules/about/libkviabout.h +++ /dev/null @@ -1,84 +0,0 @@ -#ifndef _KVI_ABOUT_H_ -#define _KVI_ABOUT_H_ -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 1999-2000 Till Bush (buti@geocities.com) -// Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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 - -class KviDlgAbout; - -class KviAboutLabel : public QLabel -{ - Q_OBJECT -public: - KviAboutLabel(KviDlgAbout * par); - ~KviAboutLabel(); -public: - KviDlgAbout * m_pAboutDialog; - QPixmap * m_pMemPixmap; -public: - virtual void drawContents(QPainter *p); - virtual void resizeEvent(QResizeEvent *e); -}; - - - -class KviDlgAbout : public QDialog -{ - Q_OBJECT -public: - KviDlgAbout(); - ~KviDlgAbout(); -//signals: // this is never used in the source (Kristoff) -// void closed(); -private slots: - void close(); - virtual void closeEvent(QCloseEvent *); -// virtual void paintEvent(QPaintEvent *); - void scrollText(); -public: - int m_posy; - char * m_text; - KviAboutLabel * m_pfield; - QPixmap * m_ppix_text; - QPixmap * m_pBackground; -}; - -class KviDlgBuildInfo : public QDialog -{ - Q_OBJECT -public: - KviDlgBuildInfo(); - ~KviDlgBuildInfo(); -private slots: - void close(); -private: - virtual void closeEvent(QCloseEvent *); - - QLabel * m_pPicLabel; - QLabel * m_pTextLabel; - QPushButton * m_pButton; -}; -*/ -#endif //_KVI_ABOUT_H_ diff --git a/3.4.0/src/modules/about/mkabouttext.pl b/3.4.0/src/modules/about/mkabouttext.pl deleted file mode 100644 index 0b58a42cfe..0000000000 --- a/3.4.0/src/modules/about/mkabouttext.pl +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/perl - -open(TEMPLATE,"ENTRIES") or die "Can't open the ENTRIES file"; - -$cnt = -1; - -while(