diff options
| author | 2017-08-25 12:07:04 +0200 | |
|---|---|---|
| committer | 2017-08-25 12:07:04 +0200 | |
| commit | bff6c4d1d3b34e5c4c3fb83f9439b4427f75a363 (patch) | |
| tree | d8ebbabf69b237556205b9d3f62ae50a1ce51652 | |
| parent | Fix the text of all links in the documentation being lowercase. (diff) | |
| download | KVIrc-bff6c4d1d3b34e5c4c3fb83f9439b4427f75a363.tar.gz KVIrc-bff6c4d1d3b34e5c4c3fb83f9439b4427f75a363.tar.bz2 KVIrc-bff6c4d1d3b34e5c4c3fb83f9439b4427f75a363.zip | |
Remove lots of redundant line feeds around block elements in the docs.
38 files changed, 251 insertions, 367 deletions
diff --git a/admin/gendoc.pl b/admin/gendoc.pl index dd608df8d..8a47db812 100755 --- a/admin/gendoc.pl +++ b/admin/gendoc.pl @@ -1430,7 +1430,7 @@ if(open(DOCINDEX,">$g_directory/index$g_fileextension")) print_twocolumnbody("<a href=\"doc_kvs_aliasesandfunctions$g_fileextension\">Aliases and Functions</a>","How to write aliases/functions"); print_twocolumnbody("<a href=\"doc_kvs_datatypes$g_fileextension\">Variables</a>","Which types of variables are available and how to handle them"); print_twocolumnbody("<a href=\"doc_operators$g_fileextension\">Operators</a>","Describes simple operations with variables"); - print_twocolumnbody("<a href=\"doc_events$g_fileextension\">Events</a>","How to handle network events in KVS ?"); + print_twocolumnbody("<a href=\"doc_events$g_fileextension\">Events</a>","How to handle network events in KVS"); print_twocolumnbody("<a href=\"doc_objects$g_fileextension\">Objects</a>","Object oriented scripting"); print_twocolumnbody("<a href=\"doc_kvs_addons$g_fileextension\">Addons</a>","How to write nice addons for KVIrc"); print_twocolumnbody("<a href=\"doc_kvs_codingtips$g_fileextension\">Coding Tips</a>","Some tips that may help you"); @@ -1444,7 +1444,7 @@ if(open(DOCINDEX,">$g_directory/index$g_fileextension")) print_twocolumnsubtitle("Other Documents"); print_twocolumnbody("<a href=\"doc_keyboard$g_fileextension\">Keyboard shortcuts</a>","Map of the global keyboard shortcuts"); print_twocolumnbody("<a href=\"doc_module_index_all$g_fileextension\">Modules</a>","Documentation related to specific modules"); - print_twocolumnbody("<a href=\"doc_widget_index_all$g_fileextension\">Features</a>"," "); + # print_twocolumnbody("<a href=\"doc_widget_index_all$g_fileextension\">Features</a>","Documentation on features of KVIrc"); print_twocolumnbody("<a href=\"doc_generic_index_all$g_fileextension\">Miscellaneous</a>","Misc documentation that didn't find any other place"); print_twocolumnbody("<a href=\"doc_keyterms_index_all$g_fileextension\">Keyterms</a>","The (long) listing of all the keyterms"); print_tableend(); diff --git a/data/doctemplates/ircintro.template b/data/doctemplates/ircintro.template index 98b6a7051..571b76a55 100644 --- a/data/doctemplates/ircintro.template +++ b/data/doctemplates/ircintro.template @@ -7,12 +7,11 @@ @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] + [big]What is IRC?[/big] Internet Relay Chat (IRC) is one of the most popular and most interactive services on the Internet. When you've been wondering [i]where the others are?[/i], 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] + [big]How does it work?[/big] IRC consists of various separate networks (or [i]nets[/i]) 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. @@ -22,8 +21,7 @@ Some networks allow the registration of nicknames: once you have registered a nickname no one 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] + [big]Channels[/big] 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 @@ -39,22 +37,19 @@ 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] + [big]Just a bit of IRC Etiquette...[/big] 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 (that's called lurking). - [br] - [big]Finding more info[/big][br] + [big]Finding more info[/big] The web is full of information about IRC: it's just a matter of typing [i]IRC[/i] 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] + [big]Well...[/big] Have fun :) */ diff --git a/src/kvilib/config/kvi_shortcuts.h b/src/kvilib/config/kvi_shortcuts.h index 1838a7f75..d82e1f6d0 100644 --- a/src/kvilib/config/kvi_shortcuts.h +++ b/src/kvilib/config/kvi_shortcuts.h @@ -253,8 +253,7 @@ [li]shortcuts can be adapted to the OS: Help is F1 under Windows and Linux, ⌘? on macOS[/li] [/ul] A full list of available combinations is available at the [anchorlink:http://doc.qt.nokia.com/latest/qkeysequence.html#standard-shortcuts] Qt documentation[/anchorlink] - [br] - [big]All the standard keys alphabetically ordered[/big][br] + [big]All the standard keys alphabetically ordered[/big] [b]F1:[/b] Help Index (Window)[br] [b]Ctrl+A:[/b] Select all[br] [b]Ctrl+B:[/b] Insert Bold control character[br] @@ -302,9 +301,9 @@ [b]Ctrl+Shift+S:[/b] Open Script tester[br] [b]Ctrl+Shift+T:[/b] Open [i]Theme Options[/i] dialog[br] [b]Ctrl+Shift+X:[/b] Open [i]Execute Script[/i] dialog[br] - [b]Ctrl+Shift+Z:[/b] Redo last action[br] + [b]Ctrl+Shift+Z:[/b] Redo last action - [big]Window handling related keys:[/big][br] + [big]Window handling related keys:[/big] [b]Alt+UpArrow:[/b] Previous window[br] [b]Alt+DownArrow:[/b] Next window[br] [b]Alt+Shift+UpArrow:[/b] Previous window in the same IRC context[br] @@ -318,9 +317,9 @@ [b]Shift+PageUp:[/b] Scroll the output window up one line[br] [b]Shift+PageDown:[/b] Scroll the output window down one line[br] [b]Ctrl+L:[/b] Scroll to the last read line[br] - [b]Ctrl+W:[/b] Close current window[br] + [b]Ctrl+W:[/b] Close current window - [big]Text editing related hotkeys:[/big][br] + [big]Text editing related hotkeys:[/big] [b]Shift+LeftArrow:[/b] Select the previous character[br] [b]Shift+RightArrow:[/b] Select the next character[br] [b]Ctrl+LeftArrow:[/b] Move to the beginning of the previous word[br] @@ -351,7 +350,7 @@ [b]Alt+Enter:[/b] Show/hide the multi-line editor[br] [b]Ctrl+Enter:[/b] Send message as plain text, ignoring / commands[br] [b]Shift+Enter:[/b] Send message as a kvs command[br] - [b]Alt+<numeric_sequence>:[/b] Insert the character by ASCII/Unicode code[br] + [b]Alt+<numeric_sequence>:[/b] Insert the character by ASCII/Unicode code [example] [b]Alt+32:[/b] Inserts ASCII/Unicode character 32: ' ' (a space) [b]Alt+00032:[/b] Same as above :) @@ -360,7 +359,7 @@ [b]Alt+23566:[/b] Inserts Unicode character 23566 (an ideogram) [/example] - [big]Completion hotkeys[/big][br] + [big]Completion hotkeys[/big] [b]Tab in the first word of input:[/b] Complete nicknames in the current channel or query[br] [b]Shift+Tab after the first word of input:[/b] Complete nicknames with full mask in the current channel or query[br] [b]Tab after a leading /:[/b] Complete commands[br] diff --git a/src/kvilib/ext/KviCryptEngine.cpp b/src/kvilib/ext/KviCryptEngine.cpp index 19eea0eee..45a019a30 100644 --- a/src/kvilib/ext/KviCryptEngine.cpp +++ b/src/kvilib/ext/KviCryptEngine.cpp @@ -41,14 +41,14 @@ @short: Crypt/text transformation engines and how to use them @body: - [big]Introduction[/big][br] + [big]Introduction[/big] 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 first came up with the [i]crypt engines[/i], that allowed secure conversations in channels, queries and DCC chats; then found out that the realized structure was perfect to be [i]generalized[/i] - into [i]text transformation[/i] support.[br][br] - [big]The concept[/big][br] + into [i]text transformation[/i] support. + [big]The concept[/big] In few words, the [i]text transformation[/i] 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. @@ -68,8 +68,8 @@ in a way that it is still readable but has a different look. This engine would not require a back transformation (so no [i]decrypt stage[/i]). A [i]symmetric[/i] idea could be an engine that strips the color codes from the incoming text: this - engine would not require an encrypting stage.[br][br] - [big]The name of this stuff[/big][br] + engine would not require an encrypting stage. + [big]The name of this stuff[/big] Initially all this was named [i]cryptography support[/i]. Then [i]cryptography[/i] was no longer enough to describe the framework, so [i]text transformation[/i] is a more generic term. @@ -78,14 +78,14 @@ KviCryptEngine in the sources. So actually the terms [i]crypt[/i] and text transformation refer to the same thing. You will often find the term [i]encrypt[/i] standing for [i]outgoing text - transformation[/i] and [i]decrypt[/i] standing for [i]incoming text transformation[/i].[br][br] - [big]Yes, but why cryptography (on IRC)?[/big][br] + transformation[/i] and [i]decrypt[/i] standing for [i]incoming text transformation[/i]. + [big]Yes, but why cryptography (on IRC)?[/big] Because it MAY be useful. More than once people have asked me to add some encryption support to the DCC chats. Yes, I know that there are other [i]secure communication[/i] tools, but actually I can't find one that is able to implement a [i]secure real time conversation[/i]. And what about a MULTIPLE real - time secure conversation? This can be done on an IRC channel now.[br][br] - [big]The working things[/big][br] + time secure conversation? This can be done on an IRC channel now. + [big]The working things[/big] KVIrc can use a text transformation engine on IRC channels, in queries and in 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 @@ -107,8 +107,8 @@ The key is user specified, so you have to find a secure way to negotiate it with your communication endpoints. If you can meet these people in real life, this is the best way to exchange the keys, otherwise you can use mail & PGP. - Yes, this is a shortcoming of the crypt protocol: it is missing a public key handshake.[br][br] - [big]The first test[/big][br] + Yes, this is a shortcoming of the crypt protocol: it is missing a public key handshake. + [big]The first test[/big] A cool way to test an encryption engine is to use a [i]self query[/i]: 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 @@ -118,8 +118,8 @@ Then you can try to activate encryption only and leaving decryption disabled: you will see how the text would appear to a possible [i]man in the middle[/i]. You can also try to use different keys for encrypting and decrypting, - and play with the Ctrl+P escape.[br][br] - [big]The protocol[/big][br] + and play with the Ctrl+P escape. + [big]The protocol[/big] Well, there is no protocol actually, only the existing implementations, that can be accessed by anyone that wants to reproduce them. There are only some points relating to the encryption engines that need to be cleared:[br][br] @@ -141,8 +141,8 @@ The escape character is not needed if the engine performs non-encrypting tasks: a charset mapper will produce text that is meant to be read by anyone on the channel, a text colorizer will act in a similar way too. - So the escape character is used for the encryption engines only.[br][br] - [big]An idea for future implementations[/big][br] + So the escape character is used for the encryption engines only. + [big]An idea for future implementations[/big] A [i]public key[/i] handshake protocol could be implemented. */ diff --git a/src/kvilib/ext/KviRegisteredUserDataBase.cpp b/src/kvilib/ext/KviRegisteredUserDataBase.cpp index 8469bd2c9..cabe06fde 100644 --- a/src/kvilib/ext/KviRegisteredUserDataBase.cpp +++ b/src/kvilib/ext/KviRegisteredUserDataBase.cpp @@ -44,20 +44,19 @@ registered users, registration mask, registered user properties, user properties, notify property, avatar property @body: - [big]Introduction[/big][br] + [big]Introduction[/big] 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] + This works more or less like the IRC ban list, K-Line list, or invite list. + [big]User entry[/big] A registered user database entry is identified by a [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 [i]internal identifier[/i] 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] + are used to recognize the user on IRC. + [big]Registration masks[/big] The masks have the common IRC mask format: [b]<nick>!<user>@<host>[/b][br] The masks may contain [b]*[/b] and [b]?[/b] wildcards that match any portion of text.[br] [b]*!*@*[/b][br] @@ -78,7 +77,7 @@ [b]<nick>!*<username>@*.<host>.<top>[/b][br] or[br] [b]<nick>!*<username>@<number>.<number>.<number>.*[/b][br] - In this way you can be 95% sure that the mask will really match the correct user.[br] + In this way you can be 95% sure that the mask will really match the correct user. [big]Example of registration and lookups[/big] Assume that you want to register a friend of yours: Derek Riggs.[br] Derek often uses [i]Eddie[/i] as his nickname @@ -100,8 +99,7 @@ If you have two masks registered: [b]Pragma!*xor@*.myisp.it[/b] and [b]*!*@*.myisp.it[/b], KVIrc will match [b]Pragma!~xor@233-dyn.myisp.it[/b] with the first one even if the second one also matches; the first one however, is a best match. - [br][br] - [big]Properties[/big][br] + [big]Properties[/big] 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] @@ -112,9 +110,8 @@ 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 [i]default[/i] [doc:avatar]avatar image file[/doc] for the specified user.[br] - The [i]ignore[/i] property should be set to [i]1[/i] (or [i]true[/i]) for users that have to be ignored (:D).[br] - [br] - [big]The interface to the database[/big][br] + The [i]ignore[/i] property should be set to [i]1[/i] (or [i]true[/i]) for users that have to be ignored (:D). + [big]The interface to the database[/big] The [module:reguser]reguser module[/module] is the interface to the [i]registered users database[/i].[br] It provides a set of commands for adding and removing masks and manipulating properties.[br] */ diff --git a/src/kvilib/ext/KviSharedFilesManager.cpp b/src/kvilib/ext/KviSharedFilesManager.cpp index f9270eefd..a9e3eca56 100644 --- a/src/kvilib/ext/KviSharedFilesManager.cpp +++ b/src/kvilib/ext/KviSharedFilesManager.cpp @@ -50,7 +50,7 @@ The [i]file offers[/i] 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 [i]visible name[/i] for it. Remote users will be able to request you the file and download it automatically by - issuing a simple DCC GET request.[br] + issuing a simple DCC GET request. [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. @@ -64,7 +64,7 @@ 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 [i]size[/i] parameter in the DCC GET request.[br] + use an additional [i]size[/i] parameter in the DCC GET request. [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] diff --git a/src/kvilib/irc/KviIrcMask.cpp b/src/kvilib/irc/KviIrcMask.cpp index 74d776c6c..ddc79c720 100644 --- a/src/kvilib/irc/KviIrcMask.cpp +++ b/src/kvilib/irc/KviIrcMask.cpp @@ -39,7 +39,7 @@ @keyterms: irc masks, nickname, username, hostname, wildcard @body: - [big]Simple masks[/big][br] + [big]Simple masks[/big] An IRC mask is a string in a special format that identifies a user on IRC.[br] The standard basic format is:[br] [b]<nick>!<username>@<host>[/b][br] @@ -76,9 +76,8 @@ 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] + The irc-masks are [b]case insensitive[/b]. + [big]Wildcard masks[/big] In some contexts the irc-masks can contain [b]*[/b] and [b]?[/b] wildcards.[br] The wild masks are used to [i]match[/i] a user within a set of them.[br] [b]*[/b] matches any sequence (eventually empty) of characters and [b]?[/b] matches a single character.[br] diff --git a/src/kvirc/kernel/KviNotifyList.cpp b/src/kvirc/kernel/KviNotifyList.cpp index a46fff6c2..266e6f413 100644 --- a/src/kvirc/kernel/KviNotifyList.cpp +++ b/src/kvirc/kernel/KviNotifyList.cpp @@ -68,20 +68,20 @@ entry.[br] The property is called [i]notify[/i], and you have to set it to the nickname that you want to look for.[br] - So for example, assume to register a friend of yours like Szymon:[br] + So for example, assume to register a friend of yours like Szymon: [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 [i]notify[/i] property to the nickname that you want him to be [i]looked for[/i]:[br] + hist [i]notify[/i] property to the nickname that you want him to be [i]looked for[/i]: [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] [i]Pragma [someuser@somehost.it] is on IRC[/i].[br] - If Szymon uses often [i][Pragma][/i] as his secondary nickname, you can do the following:[br] + If Szymon uses often [i][Pragma][/i] as his secondary nickname, you can do the following: [example] [cmd:reguser.addmask]reguser.addmask[/cmd] Szymon [Pragma]*@*.it [cmd:reguser.setproperty]reguser.setproperty[/cmd] Szymon notify [i]Pragma [Pragma][/i] diff --git a/src/kvirc/kvs/KviKvsCoreFunctions_af.cpp b/src/kvirc/kvs/KviKvsCoreFunctions_af.cpp index 3955adc74..c83148cc1 100644 --- a/src/kvirc/kvs/KviKvsCoreFunctions_af.cpp +++ b/src/kvirc/kvs/KviKvsCoreFunctions_af.cpp @@ -458,7 +458,7 @@ namespace KviKvsCoreFunctions @description: Returns the requested information about local certificate.[br] Some queries can accept an optional parameter <param1>.[br] - Available query strings are:[br] + Available query strings are: [ul] [li]signatureType[/li] [li]signatureContents[/li] @@ -847,7 +847,7 @@ namespace KviKvsCoreFunctions 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] + that will be transformed according to the following rules: [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] @@ -1216,7 +1216,7 @@ namespace KviKvsCoreFunctions [example] [cmd]if[/cmd]($features("SSL"))[cmd]echo[/cmd] "Yes! SSL is available"; [/example] - If used in [i]non-array[/i] context it returns just a comma separated list of entries:[br] + If used in [i]non-array[/i] context it returns just a comma separated list of entries: [example] [cmd]echo[/cmd] $features [/example] diff --git a/src/kvirc/kvs/KviKvsCoreFunctions_gl.cpp b/src/kvirc/kvs/KviKvsCoreFunctions_gl.cpp index 0b8a17861..4713f6209 100644 --- a/src/kvirc/kvs/KviKvsCoreFunctions_gl.cpp +++ b/src/kvirc/kvs/KviKvsCoreFunctions_gl.cpp @@ -428,7 +428,7 @@ namespace KviKvsCoreFunctions 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] + The following code will list all the available icon names: [example] %i = 0 [cmd]do[/cmd] { @@ -500,7 +500,7 @@ namespace KviKvsCoreFunctions <integer> $integer(<data:variant>) @description: Forces <data> to be an integer data type with the following - semantics:[br] + semantics: [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] @@ -1065,7 +1065,7 @@ namespace KviKvsCoreFunctions Gets the text you pass as the first parameter and formats it so that KVIrc will display it as a link. You can specify the type of the link as the second parameter. Valid values for the - second parameter are:[br] + second parameter are: [ul] [li]nick link to a nickname[/li] [li]channel link to a channel name[/li] diff --git a/src/kvirc/kvs/KviKvsCoreFunctions_mr.cpp b/src/kvirc/kvs/KviKvsCoreFunctions_mr.cpp index dd7be1d7e..4f83c5679 100644 --- a/src/kvirc/kvs/KviKvsCoreFunctions_mr.cpp +++ b/src/kvirc/kvs/KviKvsCoreFunctions_mr.cpp @@ -568,7 +568,7 @@ namespace KviKvsCoreFunctions <real> $real(<data:variant>) @description: Forces <data> to be a [i]real[/i] data type with the following - semantics:[br] + semantics: [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] diff --git a/src/kvirc/kvs/KviKvsCoreFunctions_sz.cpp b/src/kvirc/kvs/KviKvsCoreFunctions_sz.cpp index 1a3193041..d16bc3c01 100644 --- a/src/kvirc/kvs/KviKvsCoreFunctions_sz.cpp +++ b/src/kvirc/kvs/KviKvsCoreFunctions_sz.cpp @@ -503,7 +503,6 @@ namespace KviKvsCoreFunctions software is called localization. KVIrc offers some commands and functions for this purpose and this document explains briefly how to use them. - [br] [big]The big picture[/big] [br] All of the strings in your script are written in a [i]primary language[/i]. @@ -519,7 +518,6 @@ namespace KviKvsCoreFunctions The binary form translations are then loaded in the KVIrc executable at runtime and a function is used to look up the translations. - [br][br] [big]How to translate scripts[/big] [br] Your strings should be surrounded by the [fnc]$tr[/fnc]() function in the following way: @@ -528,17 +526,17 @@ namespace KviKvsCoreFunctions [/example] [br] Then you should run the xgettext command on your script files. - This is done by a shell commandline similar to the following:[br] + This is done by a shell commandline similar to the following: [example] xgettext -o myscript.pot -ktr mykvsfile1.kvs mykvsfile2.kvs ... [/example] [br] - Copy the translation file obtained in the following way:[br] + Copy the translation file obtained in the following way: [example] cp myscript.pot myscript_XX.po - [/example][br] + [/example] Where the XX is your country/language code. For example, for Italian - it would be:[br] + it would be: [example] cp myscript.pot myscript_it.po [/example] @@ -550,19 +548,19 @@ namespace KviKvsCoreFunctions msgid "your default language text" msgstr "il tuo testo in linguaggio predefinito" [br] - Compile your translation to binary form with the following command:[br] + Compile your translation to binary form with the following command: [example] msgfmt -o myscript_it.mo myscript_it.po - [/example][br] + [/example] Copy the generated *.mo file to the [i]locale[/i] subdirectory in the KVIrc's local directory (usually $HOME/.kvirc/locale/). [br] - Set the system language to the XX above with the following command:[br] + Set the system language to the XX above with the following command: [example] export LANG="XX" - [/example][br] - For Italian it would be:[br] - [example]export LANG="it"[/example][br] + [/example] + For Italian it would be: + [example]export LANG="it"[/example] [br] Start KVIrc and type in the commandline: [example] @@ -579,7 +577,6 @@ namespace KviKvsCoreFunctions 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). - [br][br] [big]Caveats[/big] [br] You should [b]never[/b] use variables or identifiers inside the $tr() function. @@ -1016,7 +1013,7 @@ namespace KviKvsCoreFunctions <string> $version(<type:string>) @description: Returns information about the version of the currently running KVIrc.[br] - Type can be one of:[br] + Type can be one of: [ul] [li]a: return the application name[/li] [li]b: return the build date in human readable form[/li] diff --git a/src/kvirc/kvs/KviKvsCoreSimpleCommands_mr.cpp b/src/kvirc/kvs/KviKvsCoreSimpleCommands_mr.cpp index 39696ffa0..bc170ff6c 100644 --- a/src/kvirc/kvs/KviKvsCoreSimpleCommands_mr.cpp +++ b/src/kvirc/kvs/KviKvsCoreSimpleCommands_mr.cpp @@ -1313,8 +1313,8 @@ namespace KviKvsCoreSimpleCommands rebind %winid[br] echo "Again in this window :)" [/example] - [note][br] - [big]Deprecated switches:[/big][br] + [note] + [big]Deprecated switches:[/big] From version 3.0.0, the standard -r switch support to commands was removed. [/note] */ diff --git a/src/kvirc/kvs/KviKvsCoreSimpleCommands_sz.cpp b/src/kvirc/kvs/KviKvsCoreSimpleCommands_sz.cpp index beb9e6c0b..c49e341d0 100644 --- a/src/kvirc/kvs/KviKvsCoreSimpleCommands_sz.cpp +++ b/src/kvirc/kvs/KviKvsCoreSimpleCommands_sz.cpp @@ -69,10 +69,10 @@ namespace KviKvsCoreSimpleCommands The switch -x will make say evaluate and execute arbitrary commands, too: if <text> begins with a slash then it will be treated as a command to be evaluated and executed (after parsing the identifiers etc.).[br] - If this happens, the executed command will not be send to the active channel.[br] + If this happens, the executed command will not be send to the active channel. [example] /say -x /[cmd]echo[/cmd] foo - [/example][br] + [/example] will just print "foo".[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) diff --git a/src/kvirc/kvs/event/KviKvsEventManager.cpp b/src/kvirc/kvs/event/KviKvsEventManager.cpp index 93a365dd5..15ca56f3c 100644 --- a/src/kvirc/kvs/event/KviKvsEventManager.cpp +++ b/src/kvirc/kvs/event/KviKvsEventManager.cpp @@ -52,7 +52,7 @@ For example, the [event:onirc]OnIRC[/event] is triggered when the login operations have been terminated and you can consider yourself [i]completely[/i] on IRC. For example, you might want to [i]auto-join[/i] some channels. Nothing easier! The following snippet of code - adds a handler to the OnIRC event that joins three channels:[br] + adds a handler to the OnIRC event that joins three channels: [example] [cmd]event[/cmd](OnIRC,autojoin) { @@ -64,7 +64,7 @@ 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 (you could use the notify list for that).[br] - You can add the [cmd]whois[/cmd] request to the handler above or just create a new one:[br] + You can add the [cmd]whois[/cmd] request to the handler above or just create a new one: [example] [cmd]event[/cmd](OnIRC,lookforfred) { @@ -73,7 +73,7 @@ } [/example] (An even nicer idea would be to use the [cmd]awhois[/cmd] command, but that's left to the reader as an exercise.[br] - To remove an event handler you still use the [cmd]event[/cmd] command, but with an empty code block:[br] + To remove an event handler you still use the [cmd]event[/cmd] command, but with an empty code block: [example] [cmd]event[/cmd](OnIRC,lookforfred){}[br] [/example] diff --git a/src/kvirc/kvs/object/KviKvsObject.cpp b/src/kvirc/kvs/object/KviKvsObject.cpp index ca8b137ce..2dcd7e47d 100644 --- a/src/kvirc/kvs/object/KviKvsObject.cpp +++ b/src/kvirc/kvs/object/KviKvsObject.cpp @@ -60,8 +60,8 @@ The KVIrc scripting language is not object oriented in nature. Anyway, objects are a highlevel abstraction that allow to write complex code in a [i]clean[/i] way. - So I've added at least some pseudo-object support.[br][br] - [big]Basic concepts[/big][br] + So I've added at least some pseudo-object support. + [big]Basic concepts[/big] Objects are arranged in tree structures. Each object that you create is either toplevel object or a child of another object. A toplevel object is a parentless one. @@ -83,13 +83,12 @@ The ID is assigned by KVIrc and can be held in any variable. You can think the object ID as a [i]handle for the object[/i] 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 (this can be 0 for toplevel objects).[br] - - The object name (eventually empty)[br] + - The object name (eventually empty) [example] %myobject = [fnc]$new[/fnc]([class]object[/class],0,theName) [/example] @@ -97,14 +96,14 @@ the STRING [b]0[/b] 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] + you can check if the creation has failed in the following way: [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] + You can also test the object ID's for equality: [example] [cmd]if[/cmd](%myobject == %anotherobject)[cmd] echo[/cmd] "This is the same object!"; @@ -113,20 +112,19 @@ 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 [i]destroy[/i] and delete is currently aliased to that name too).[br] + this command was named [i]destroy[/i] and delete is currently aliased to that name too). [example] [cmd]delete[/cmd] %myobject [/example] If the destroyed object has child 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] + You can set an object's field by using the object scope operator "->": [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] + To retrieve the field data use the object scope operator in the same way: [example] [cmd]echo[/cmd] %myobject->%fieldVariable [/example] @@ -139,14 +137,14 @@ 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] + Any [doc:operators]operator[/doc] can be used with the object field variables: [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 [i]on the fly[/i] by using objects and fields:[br] + You can simulate C structures [i]on the fly[/i] by using objects and fields: [example] # Create a user description on the fly %myobj = [fnc]$new[/fnc]([class]object[/class],0,userDescription) @@ -161,7 +159,7 @@ # Destroy the object [cmd]delete[/cmd] %myobj [/example] - The field variables can be also dictionaries:[br] + The field variables can be also dictionaries: [example] %theobj->%field[key] = something [/example] @@ -171,7 +169,7 @@ which can be used in any function and will be only valid in the very current scope. This does and does not apply to KVI++.[br] Local variables can be used as normal and the scope of those variables will (naturally) be limited to the scope of - the function they are defined in.[br] + the function they are defined in. [example] [cmd]class[/cmd](test,[class]object[/class]) { @@ -190,7 +188,7 @@ %myObject->$test() [comment]# Behold! This will only print "var: "![/comment] %myObject->$anotherfunc() - [/example][br] + [/example] Instance variables, however, which are managed in the object's [i]field[/i] can be accessed at any time by anyone. [b]Warning:[/b] every script or object is potentially able to change the values of your field variables! They may also add or unset (empty) previously not used or used fields.[br] @@ -215,11 +213,10 @@ 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 [i]object[/i] class (again... read on) objects export the [classfnc:object]$name[/classfnc]() - and [classfnc:object]$className[/classfnc]() functions.[br] + and [classfnc:object]$className[/classfnc]() functions. [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]() @@ -228,7 +225,7 @@ [/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 child identifiers.[br] + It returns a comma separated list of child identifiers. [example] %tmp = [fnc]$new[/fnc]([class]object[/class],0,myobject) %tmpchild = [fnc]$new[/fnc]([class]object[/class],%tmp,child1) @@ -250,7 +247,7 @@ (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] + A more complex example [example] %tmp = [fnc]$new[/fnc]([class]object[/class],0,myobject) [cmd]foreach[/cmd](%i,1,2,3) @@ -273,7 +270,7 @@ } [comment]# Destroy the object and it's child items[/comment] [cmd]delete[/cmd] %tmp - [/example][br] + [/example] In the example above four objects have been created. A [i]parent[/i] object named [i]myobject[/i], and three child objects. The destructor has been reimplemented for each child object, @@ -284,11 +281,10 @@ - destroy all the child items (and consequently trigger all the [i]individual[/i] destructors).[br][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] + If a function does not return a meaningful value, or you just want to ignore it, you can call it in the following way: [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. @@ -318,7 +314,6 @@ [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][br] [example] class HostAddress { @@ -352,13 +347,12 @@ [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][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] + level of inheritance is 1: deriving from class [class]object[/class]. [example] [cmd]class[/cmd](helloworld,[class]object[/class]) { @@ -367,7 +361,7 @@ [cmd]echo[/cmd] Hello world! } } - [/example][br] + [/example] The above class is named [i]helloworld[/i]. It inherits the [class]object[/class] class. This means that it acquires all the [class]object[/class] functions: [classfnc:object]$name[/classfnc](), [classfnc:object]$class[/classfnc](), [classfnc:object]$children[/classfnc]()... @@ -379,7 +373,7 @@ [/example] You should see [i]Hello world[/i] 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 [i]hello[/i] in two different languages:[br] + derive another class from helloworld and make it say [i]hello[/i] in two different languages: [example] [cmd]class[/cmd](localizedhelloworld,helloworld) { @@ -410,7 +404,7 @@ } } [/example] - Now you can call:[br] + Now you can call: [example] %m = [fnc]$new[/fnc](localizedhelloworld) %m->$setLanguage(italian) @@ -432,7 +426,7 @@ contains the ID of an instance of class [i]localizedhelloworld[/i], the new implementation of that function will be called (executed). The inherited sayhello was able to say [i]hello world[/i] 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] + call the [b]base class implementation[/b]. [example] [fnc]$this[/fnc]->$helloworld:sayhello() [comment]# equivalent to $$->$helloworld:sayhello(),[/comment] @@ -451,12 +445,12 @@ 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] + Do a [cmd]clearobjects[/cmd] to cleanup the old class definitions and read on. [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] - The constructor can and should list and initialize all the necessary object fields.[br] + The constructor can and should list and initialize all the necessary object fields. [example] [cmd]class[/cmd](myObject,[class]object[/class]) { @@ -468,7 +462,7 @@ %myObject = [fnc]$new[/fnc](myObject,[class]object[/class]) [cmd]echo[/cmd] %myObject->%test - [/example][br] + [/example] Will thus print "This is a sample object field."[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 @@ -487,7 +481,7 @@ the base class state, and propagate its return value (eventually modified if the base class constructor is successful but your derived class initialization fails).[br] This very basic example will illustrate how to do this (please read the paragraph about inheriting classes - above first):[br] + above first): [example] [cmd]class[/cmd](baseObject,[class]object[/class]) { @@ -505,12 +499,12 @@ [fnc]$this[/fnc]->$baseObject::constructor() } } - [/example][br][br] + [/example] 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] - [big]Signals and slots[/big][br] + automatically. + [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 @@ -523,7 +517,7 @@ 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. - [big]So why signals and slots?[/big][br] + [big]So why signals and slots?[/big] Because signals are much more powerful in many situations. The signals have no equivalent in C/C++... but they have been implemented in many high-level C/C++ libraries and development kits (including the system-wide signal/handler mechanism implemented @@ -611,7 +605,7 @@ 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 [i]password[/i] echo mode only by using this function call:[br] + the [i]password[/i] echo mode only by using this function call: [example] %X=$new(lineedit, 0, a_name)[br] %X->$show()[br] diff --git a/src/kvirc/kvs/parser/KviKvsParser.cpp b/src/kvirc/kvs/parser/KviKvsParser.cpp index e6de7d7c6..15d242273 100644 --- a/src/kvirc/kvs/parser/KviKvsParser.cpp +++ b/src/kvirc/kvs/parser/KviKvsParser.cpp @@ -326,7 +326,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer the [i]PrincoScript[/i] or [i]dynamirc[/i] (tough this last one should be categorized as [i]malware[/i] 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.[br] - More about addons in this [doc:addons]document[/doc] + [doc:kvs_addons]Learn more about KVS addons[/doc]. [big]Hello world![/big] This documentation contains a lot of script examples. They will appear like the following block of code: @@ -479,7 +479,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer 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] + Another example: [example] [cmd]echo[/cmd] "The new KVIrc   \ IS OUT!" @@ -521,11 +521,11 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [/example] [big]Command blocks[/big] Commands can be 'grouped' in blocks by using the classic C++ braces. - Here is a single line example:[br] + Here is a single line example: [example] { [cmd]echo[/cmd] First command; [cmd]echo[/cmd] Second command; } [cmd]echo[/cmd] Third command [/example] - Multi line example:[br] + Multi line example: [example] { [cmd]echo[/cmd] First command @@ -539,7 +539,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [/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] + will be useful later (see [cmd]if[/cmd],[cmd]while[/cmd]...). [note] Unlike in C or C++, the braces do [b]not[/b] automatically define a variable scope (with few exceptions to this rule ... just to complicate the things a bit more). @@ -584,7 +584,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer 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. - [br] [big]And now?[/big] [br] You're now ready to really start experimenting with KVS. You can take @@ -867,7 +866,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer @short: KVIrc window structure and the window naming conventions @body: - [big]Introduction[/big][br] + [big]Introduction[/big] Starting from the release 3.0.0, KVIrc window structure has grown in complexity. Older releases allowed one connection per [i]frame window[/i] and thus had a dedicated command parser @@ -877,8 +876,8 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer It was sufficient to have an [i]unique[/i] 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] + In this version, the unique window names are impossible to be granted. + [big]Scenario[/big] The command parser is now [i]global[/i] 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 @@ -948,7 +947,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [/li] [/ul] [br] - A naming convention has become necessary to resolve ambiguities.[br] + A naming convention has become necessary to resolve ambiguities. [big]Basic assumptions[/big] Every KVIrc window has four main properties:[br] -[b]an unique numeric identifier[/b][br] @@ -967,9 +966,8 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer 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 [i]channel[/i], for query windows is [i]query[/i], - for console windows it is [i]console[/i], etc.[br] - [br] - [big]IRC Contexts[/big][br] + for console windows it is [i]console[/i], etc. + [big]IRC Contexts[/big] The KVIrc frame windows are numbered starting from 0 and named [i]frame_<number>[/i]. Each frame can contain an unlimited number of consoles.[br] Each console is bound to an [b]IRC context[/b]. (The part [i]is bound to[/i] could @@ -1001,9 +999,9 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer 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] + KVIrc will try to keep that windows with unique logical names. + [big]How to identify a window[/big] + So what we have until now is: [ul] [li]Each window has its own unique [b]window ID[/b]: we will refer windows always using this identifier.[/li] @@ -1214,13 +1212,13 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer KVIrc has a builtin addon management system that allows the users to create, 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.[br] - [big]Addon installation[/big][br] + the KVIrc help and to be translated in several languages. + [big]Addon installation[/big] The addons are usually shipped in compressed archives (.kva). KVIrc will look for the installer file called [i]install.kvs[/i] and executes it when the user will ask for your addon to be installed. The install.kvs contains the code for the [b]registration[/b] of your addon and will [cmd]include[/cmd] all the other - necessary source files.[br] + necessary source files. [big]The minimal addon[/big] [br] The smallest addon that you can write is the one that does nothing. @@ -1271,7 +1269,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer ... } [/example] - [br] [big]A typical addon layout[/big] [br] As stated above, the addons are usually shipped in a compressed archive. @@ -1386,11 +1383,9 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer etc...). Please note that English is the default language and KVIrc will fallback to the [i]en[/i] subdirectory when no other language is found around... - [br] [big]Some examples[/big] The code below is just an example of how to write a useful initialization of your own addon. The name of the classes refer to the ones described above. - [br] [example] [comment]# Register the classes[/comment] alias(MyAddon::classes::register) @@ -1453,7 +1448,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer ... } [/example] - [br] [big]The help and configuration callbacks[/big] [br] Each addon can have a help and a configuration callback. These are set @@ -1472,7 +1466,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer mainly for more complex 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. - [br] [big]The real addon work[/big] [br] The real addon work is done by the scripts contained in the src directory. @@ -1485,7 +1478,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer 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 :) - [br] [big]Where to start[/big] [br] It is a good idea to start in the KVIrc scripts GitHub repository https://github.com/kvirc/kvirc-scripts. There are surely @@ -1581,7 +1573,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer 'entity' indicates a [b]literal entity[/b]: 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] + rules (productions), to improve readability. [table] [tr] [td]<command buffer>[/td] @@ -1737,7 +1729,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer A variable identifier is composed by a '%' (percent) sign followed by a sequence of letters, digits or underscores. Examples of valid variable names are: - [br] [example] %i %variable @@ -1750,14 +1741,12 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [br] 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). - [br] [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] - [br] [title]Local and global variables[/title] [br] Variables can be local or global. @@ -1766,15 +1755,13 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer until they are explicitly unset or until KVIrc quits. [br] Local variables start with a [b]lowercase letter[/b] while the global ones with an [b]uppercase letter[/b]. - [br] [example] %var = 10; [comment]# this is a local variable[/comment] %Var = 10; [comment]# this is a global variable[/comment] [/example] [br] You can also force a variable that start with a lowercase letter to be global - by pre-declaring it with the [cmd]global[/cmd] keyword.[br] - [br] + by pre-declaring it with the [cmd]global[/cmd] keyword. [example] [comment]# copy this script to a file and run /[cmd]parse[/cmd] <filename>[/comment] global %a @@ -1786,29 +1773,24 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [br] If you have executed the example above from a file (by the means of [cmd]parse[/cmd]) then now you can type - [br] [example] [cmd]echo[/cmd] %a [/example] [br] in the commandline to see the contents of the variable %a. If you also try - [br] [example] [cmd]echo[/cmd] %b [/example] [br] you will see nothing printed since %b was local to the parsed script. - [br] [title]Data types[/title] [br] KVS has three main categories of data types: scalars, arrays and associative arrays (also known as dictionaries or hashes). - [br] [subtitle]Scalars[/subtitle] [br] The scalars are simple variables containing a single value (a string or an integer). - [br] [example] [comment]# %a is a scalar variable[/comment] %a = "This is a string" @@ -1816,18 +1798,15 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer %a = 24.5 [cmd]echo[/cmd] %a [/example] - [br] [subtitle]Arrays[/subtitle] [br] 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. - [br] [example] %arrayName[index] [/example] [br] An easy way to create an array is to use the [fnc]$array[/fnc] function. - [br] [example] %a = $array("element1","element2","element3"); [comment]# Create an array with 3 items[/comment] [cmd]for[/cmd](%i=0;%i<3;%i++) @@ -1839,14 +1818,12 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer 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: - [br] [example] %a[9] = "This is an array element"; [/example] [br] 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. - [br] [example] %a[9] = "This is an array element"; echo $length(%a) @@ -1855,12 +1832,10 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer Be aware that by making such an assignment you implicitly consume some memory for all the preceding 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: - [br] [example] %a[1000000] = "An array element faaaaaar away..."; echo $length(%a) [/example] - [br] [note] [big]Food for thought:[/big] KVIrc allocates a pointer for each item in the array. The pointer is @@ -1877,7 +1852,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer can also use the [cmd]foreach[/cmd] command to iterate the items of an array. Be aware that [cmd]foreach[/cmd] will [b]not[/b] iterate over unset items in the array unless you use the -a switch. - [br] [example] %Array[0]=Pippo %Array[1]=Pluto @@ -1887,7 +1861,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [/example] [br] Note that the items 3 and 4 are simply skipped. - [br] [subtitle]Hashes[/subtitle] [br] The hashes are collections of items indexed by strings: the word [i]hash[/i] @@ -1895,7 +1868,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [i]associative arrays[/i], [i]dictionaries[/i] or [i]key-value pair sets[i]. The hash items are selected by placing the key in curly brackets just after the hash name. - [br] [example] %hashName{key} [/example] @@ -1913,19 +1885,16 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer 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: - [br] [example] %a{"MyKey"} = "MyValue" [/example] [br] You may have already noticed that the [fnc]$keys[/fnc]() function returns the array of the hash keys: it is useful to iterate over the hash items. - [br] [title]Mutability of variables[/title] [br] KVS is not strictly typed: any variable can assume different type identities at different times, even in the same script. - [br] [example] [comment]# %a is a scalar[/comment] %a = "This is a string" @@ -1942,7 +1911,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer 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. - [br] [example] [comment]# here we eat 256 locations of memory at once :)[/comment] %a[16][16] = 10 @@ -1953,7 +1921,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer 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. - [br] [example] %a = $array("element1","element2","element3"); echo %a; [comment]# echo expects its arguments to be scalar[/comment] @@ -1968,7 +1935,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [br] KVS handles also the other possible implicit casts: scalar->hash,hash->scalar,array->hash,hash->array. Experiment with it. - [br] [title]More about scalars[/title] [br] Internally KVS is implicitly typed: the [i]scalar[/i] data type is in fact @@ -1993,7 +1959,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer otherwise, a real becomes an integer by truncating it's fractional part... [br] You can find out the type of a specified variable by using the [fnc]$typeof[/fnc]() function. - [br] [example] %a = 1 echo $typeof(%a) @@ -2006,7 +1971,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [/example] [br] There is also another subtle type of scalar called [i]nothing[/i]. It stands for an empty (unset) variable. - [br] [example] %a = $nothing echo $typeof(%a) @@ -2020,7 +1984,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [br] 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. - [br] [title]Explicit casts[/title] [br] You can make explicit conversions between some data types by using the casting functions. @@ -2036,7 +1999,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer 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. - [br] [title]More about variables life-cycle[/title] [br] As stated above variables start their existence when you assign something to them. @@ -2047,7 +2009,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [br] 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. - [br] [example] %a = [fnc]$array[/fnc]("data","for","a","really","huge","array","of","items") %b = 10 @@ -2058,7 +2019,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer 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. - [br] [example] %a = "test"; [comment]# %a starts his existence[/comment] %b = "test2"; @@ -2068,7 +2028,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer [br] Note that because of mutability of variables (explained above) you can use the empty string assignment also to free arrays and hashes. - [br] [title]Extended scope variables[/title] [br] Beside local and global variables there is a third family of them. @@ -2084,21 +2043,18 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer 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. - [br] [title]Variable evaluation[/title] [br] 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 - [br] [example] %number = 1st; echo this is my %number variable test [/example] [br] will first assign [i]1st[/i] to the variable [i]%number[/i] and then execute "echo this is my 1st variable test". The following example will [b]not[/b] work as expected. - [br] [example] %number = 1; echo this is my %numberst variable test [/example] @@ -2107,11 +2063,9 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer name extracted will be [i]%numberst[/i] 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: - [br] [example] %number = 1; echo this is my %number\st variable test [/example] - [br] [title]Putting it all together[/title] [br] Variables can be either local, global or have an extended scope. Their start to exist diff --git a/src/kvirc/kvs/parser/KviKvsParser_expression.cpp b/src/kvirc/kvs/parser/KviKvsParser_expression.cpp index 804fdade6..e983a8832 100644 --- a/src/kvirc/kvs/parser/KviKvsParser_expression.cpp +++ b/src/kvirc/kvs/parser/KviKvsParser_expression.cpp @@ -49,7 +49,7 @@ 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 [b]+[/b], [b]-[/b], [b]*[/b], [b]/[/b], [b]|[/b], [b]&[/b], [b]^[/b], [b]||[/b], [b]&&[/b], [b]^^[/b], [b]>>[/b], [b]<<[/b], [b]<[/b], [b]>,[/b] [b]<=,[/b] [b]>=,[/b] [b]==,[/b] [b]!=[/b] and [b]<>[/b] (synonym for !=).[br] - The following table describes their meaning.[br] + The following table describes their meaning. [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] diff --git a/src/kvirc/kvs/parser/KviKvsParser_lside.cpp b/src/kvirc/kvs/parser/KviKvsParser_lside.cpp index 091041bb6..fbff809b3 100644 --- a/src/kvirc/kvs/parser/KviKvsParser_lside.cpp +++ b/src/kvirc/kvs/parser/KviKvsParser_lside.cpp @@ -52,8 +52,7 @@ Some operators, like arithmetic ones, are typically used inside the special function [b]$(<expression>)[/b], called the [i][doc:expressioneval]Expression evaluation identifier[/doc][/i]; This special function returns the result of the evaluation of the <expression>. - In previous versions of KVIrc this function was called $calc().[br] - [br] + In previous versions of KVIrc this function was called $calc(). [table] [tr][td]Operator[/td][td]document[/td][/tr] [tr][td]=[/td][td][doc:assignment]assignment operator[/doc][/td][/tr] diff --git a/src/kvirc/kvs/parser/KviKvsParser_specialCommands.cpp b/src/kvirc/kvs/parser/KviKvsParser_specialCommands.cpp index 911ba8d2b..71f8bf98e 100644 --- a/src/kvirc/kvs/parser/KviKvsParser_specialCommands.cpp +++ b/src/kvirc/kvs/parser/KviKvsParser_specialCommands.cpp @@ -2030,7 +2030,7 @@ KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandDefpopup() 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 [b]not[/b] allowed.[br] - To remove a popup menu use this command with an empty body:[br] + To remove a popup menu use this command with an empty body: [example] defpopup(test){} [/example] diff --git a/src/kvirc/module/KviModule.cpp b/src/kvirc/module/KviModule.cpp index 83cd579ee..de2e7e46e 100644 --- a/src/kvirc/module/KviModule.cpp +++ b/src/kvirc/module/KviModule.cpp @@ -74,29 +74,28 @@ extern KVIRC_API KviModuleExtensionManager * g_pModuleExtensionManager; Module loading is now [i]transparent[/i] to the user. There are no [i]load[/i] and [i]unload[/i] commands: the modules are automatically loaded when the [i]core[/i] requests them and unloaded after some (configurable) time - of inactivity.[br] - [br] - [big]Module naming convention[/big][br] + of inactivity. + [big]Module naming convention[/big] Every KVIrc module must have an [i]unique[/i] name: the name is a single token, made only of [b]lowercase[/b] letters, digits and underscores. The real object file (library) is named [i]libkvi<name>.so[/i]. 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] + and remapped always to the lowercase version). + [big]What a module can do[/big] Basically, a module exports parts of the scripting language features. For example, the module [i]about[/i] exports the [i]about.kvirc[/i] 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] + To activate the dialog you only need to execute the command: [example] about.kvirc [/example] That's all. KVIrc will load the necessary module, run the [i]/about.kvirc[/i] command, - wait until the module is not used anymore and then unload it.[br][br] - [big]Transparent loading and unloading[/big][br] + wait until the module is not used anymore and then unload it. + [big]Transparent loading and unloading[/big] 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>. @@ -110,7 +109,6 @@ extern KVIRC_API KviModuleExtensionManager * g_pModuleExtensionManager; 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>. - [br] [big]Forced loading and unloading[/big] All the modules export a [i]load[/i] and a [i]unload[/i] command. [example] diff --git a/src/kvirc/sparser/KviIrcServerParser_ctcp.cpp b/src/kvirc/sparser/KviIrcServerParser_ctcp.cpp index 3a1c19f51..180182752 100644 --- a/src/kvirc/sparser/KviIrcServerParser_ctcp.cpp +++ b/src/kvirc/sparser/KviIrcServerParser_ctcp.cpp @@ -82,12 +82,12 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog; 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] + Here is my personal point of view on the CTCP protocol. [big]What is CTCP?[/big] 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] + IRC protocol. [big]Basic concepts[/big] A CTCP message is sent as the <text> part of the PRIVMSG and NOTICE IRC commands.[br] @@ -115,7 +115,7 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog; 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] + should be allowed and theoretically the trailing <0x01> delimiter can be optional. [big]How to extract the CTCP message[/big] The IRC messages do not allow the following characters to be sent:[br] <NUL> (ASCII character 0), <CR> (Carriage return), <LF> (Line feed).[br] @@ -130,8 +130,7 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog; 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] - [br] + and thus from now on we will deal only with the <ctcp message> part. [big]Parsing a CTCP message: The quoting dilemma[/big] Since there are characters that cannot appear in a <ctcp message>, theoretically we should have to use a quoting mechanism. @@ -164,8 +163,7 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog; I've chosen the octal representation 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] - [br] + character (escape sequence '\\'). [big]Let's mess a little more[/big] A CTCP message is made of [b]space separated parameters[/b].[br] The natural way of separating parameters is to use the space character. @@ -185,7 +183,6 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog; let's include the [b]"[/b] quotes in our standard: literal (unescaped) [b]"[/b] quotes define a single token string. To include a literal [b]"[/b] character, escape it. Additionally, the last parameter of a <ctcp message> may be made of multiple tokens. - [br] [big]A CTCP parameter extracting example[/big] A trivial example of a C [i]CTCP parameter extracting routine[/i] follows.[br] An IRC message is made of up to 510 usable characters. @@ -278,7 +275,7 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog; } return msg_ptr; } - [/example][br] + [/example] [big]CTCP parameter semantics[/big] The first <ctcp parameter> of a <ctcp message> is the <ctcp tag>: it defines the semantic of the rest of the message.[br] @@ -287,8 +284,7 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog; case sensitive, I'd prefer to follow the IRC message semantic (just to have less "special cases") and treat the whole message 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] - [br] + and thus <ctcp messages> follows. [big]PING[/big] [b]Syntax: <0x01>PING <data><0x01>[/b][br] The PING request is used to check the round trip time from one client to another. @@ -297,7 +293,6 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog; integer but not necessarily; 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. - [br] [big]VERSION[/big] [b]Syntax: <0x01>VERSION<0x01>[/b][br] The VERSION request asks for information about another user's IRC client program. @@ -308,14 +303,12 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog; 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. - [br] [big]USERINFO[/big] [b]Syntax: <0x01>USERINFO<0x01>[/b][br] The USERINFO request asks for information about another user. The reply should be sent through a NOTICE with the following syntax:[br] <0x01>USERINFO <user_info_data><0x01>[br] The <user_info_data> should be a human readable [i]user defined[/i] string; - [br] [big]CLIENTINFO[/big] [b]Syntax: <0x01>CLIENTINFO<0x01>[/b][br] The CLIENTINFO request asks for information about another user's IRC client program. @@ -325,7 +318,6 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog; <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. - [br] [big]FINGER[/big] [b]Syntax: <0x01>FINGER<0x01>[/b][br] The FINGER request asks for information about another IRC user. @@ -333,30 +325,25 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog; <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; - [br] [big]SOURCE[/big] [b]Syntax: <0x01>SOURCE<0x01>[/b][br] The SOURCE request asks for the client homepage or ftp site information. The reply should be sent through 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. - [br] [big]TIME[/big] [b]Syntax: <0x01>TIME<0x01>[/b][br] The TIME request asks for the user local time. The reply should be sent through 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. - [br] [big]ACTION[/big] [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] - [br] + It should be sent through a NOTICE message and never generate a reply. [big]AVATAR (equivalent to ICON or FACE)[/big] [b]Syntax: <0x01>AVATAR<0x01>[/b][br] - The AVATAR tag is used to query a user's avatar.[br] - [br] + The AVATAR tag is used to query a user's avatar. [big]MULTIMEDIA (equivalent to MM or SOUND)[/big] [b]Syntax: <0x01>MULTIMEDIA <filename><0x01>[/b][br] The MULTIMEDIA tag is used to play a multimedia file on the receiver's side.[br] @@ -370,8 +357,7 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog; 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] - [br] + non-standard private message syntax. This convention should be dropped. [big]DCC[/big] [b]Syntax: <0x01>DCC <type> <type dependent parameters><0x01>[/b][br] The DCC tag is used to initiate a Direct Client Connection. diff --git a/src/kvirc/ui/KviInput.cpp b/src/kvirc/ui/KviInput.cpp index f08d46fda..1175ee73c 100644 --- a/src/kvirc/ui/KviInput.cpp +++ b/src/kvirc/ui/KviInput.cpp @@ -465,7 +465,6 @@ void KviInput::toggleMultiLine() The idea is simple: anything that starts with a slash [b]/[/b] 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.). - [br] [big]The two operating modes[/big] [br] The commandline input has two operating modes: the [i]user friendly mode[/i] and diff --git a/src/kvirc/ui/KviIrcView_events.cpp b/src/kvirc/ui/KviIrcView_events.cpp index 3f83191f0..456341124 100644 --- a/src/kvirc/ui/KviIrcView_events.cpp +++ b/src/kvirc/ui/KviIrcView_events.cpp @@ -62,47 +62,47 @@ 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 [i]echoed[/i] internally.[br] - The simplest way to explain it is to use an example:[br] + The simplest way to explain it is to use an example: [example] echo This is a $cr![!dbl]echo You have clicked it! $cr\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 [i]clickable link[/i], you will see the text highlighted.[br] Once you double-click one of that words, the command [i][cmd]echo[/cmd] You have clicked it![/i] will be executed.[br] - The format looks complex?... it is not...just read on.[br] + The format looks complex?... it is not...just read on. [example] <cr>!<link_type><cr><visible text><cr>[br] <cr>!<escape_command><cr><visible text><cr> [/example] [big]Escape format[/big] - The whole escape sequence format is the following:[br][br] + The whole escape sequence format is the following: [example] [b]<cr>!<escape_command><cr><visible text><cr>[/b][br] [/example] [note] [b]<cr>[/b] is the carriage return character. You can obtain it by using the [fnc]$cr[/fnc] function.[br] [b]<visible text>[/b] is the text that will appear as [i]link[/i] when you move the mouse over it.[br] - [b]<escape_command>[/b] is the description of the actions to be taken when the user interacts with the link.[br] + [b]<escape_command>[/b] is the description of the actions to be taken when the user interacts with the link. [/note] [note] The [b]<escape_command>[/b] has the two following syntactic forms:[br] [b]<escape_command> ::= <user_defined_commands>[/b][br] [b]<escape_command> ::= <builtin_link_description>[/b] [/note] - [big]User defined links[/big][br] + [big]User defined links[/big] 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] + The commands are specified in the <escape_command> part by using the following syntax: [note] <escape_command> ::= <user_defined_commands>[br][br] <user_defined_commands> ::= <command_rule> [<user_defined_commands>][br][br] <command_rule> ::= <action_tag><command>[br][br] <action_tag> ::= "[!" <action> "]"[br][br] <action> ::= "rbt" | "mbt" | "dbl" | "txt"[br][br] - <command> ::= any KVIrc command (see notes below)[br] + <command> ::= any KVIrc command (see notes below) [/note] [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] + in this document. @seealso: [fnc]$fmtlink[/fnc] [fnc]$cr[/fnc] diff --git a/src/modules/addon/libkviaddon.cpp b/src/modules/addon/libkviaddon.cpp index f32fef1d7..178194283 100644 --- a/src/modules/addon/libkviaddon.cpp +++ b/src/modules/addon/libkviaddon.cpp @@ -599,7 +599,7 @@ static bool addon_kvs_cmd_register(KviKvsModuleCallbackCommandCall * c) Installs the [files] for the addon identified by the specified <id>. These files will be automatically removed when the addon is uninstalled.[br][br] <target> is the target path inside the local KVIrc directory. The following - standard paths should be used:[br] + standard paths should be used: [ul] [li]"pics" for image files.[/li] [li]"locale" for translation *.mo files.[/li] diff --git a/src/modules/context/libkvicontext.cpp b/src/modules/context/libkvicontext.cpp index 186fce01c..163e4e86b 100644 --- a/src/modules/context/libkvicontext.cpp +++ b/src/modules/context/libkvicontext.cpp @@ -612,7 +612,7 @@ static bool context_kvs_fnc_queueSize(KviKvsModuleFunctionCall * c) has no associated IRC context) then this function prints a warning and returns an empty string.[br] If the IRC context is not using SSL then this function returns an empty string.[br] Some queries can accept an optional parameter <param1>.[br] - Available query strings are:[br] + Available query strings are: [ul] [li]signatureType[/li] [li]signatureContents[/li] diff --git a/src/modules/dcc/libkvidcc.cpp b/src/modules/dcc/libkvidcc.cpp index f130b9048..510c5b122 100644 --- a/src/modules/dcc/libkvidcc.cpp +++ b/src/modules/dcc/libkvidcc.cpp @@ -1370,7 +1370,7 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c) @keyterms: DCC without IRC @body: - [big]What is DCC?[/big][br] + [big]What is DCC?[/big] 'DCC' stands for Direct Client Connection, it is used to exchange data directly between two IRC clients (with no IRC server in the middle).[br] DCC itself is not a well-defined protocol, but rather a set of @@ -1381,9 +1381,8 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c) The [b]DCC negotiation[/b] part is used to request the [b]DCC transfer[/b] and define its necessary parameters,[br] while the [b]DCC transfer[/b] part is the real data transfer between clients.[br] The [b]DCC negotiation[/b] requires a third entity that routes the negotiation data between clients, - this is usually an IRC server.[br] - [br] - [big]DCC Negotiation[/big][br] + this is usually an IRC server. + [big]DCC Negotiation[/big] This part of the protocol is the most tricky and difficult one, and is different for almost every DCC sub-protocol.[br] The [i]constant[/i] scenario of the negotiation is more or less the following:[br] There are two IRC clients connected to the same IRC network and they want to exchange some data in @@ -1436,12 +1435,10 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c) You can also manually connect to a specified port and IP address without having been notified of a DCC request.[br][br][br] Is everything clear?...I don't think so... my English is really bad... - [br] - [big]DCC Transfer[/big][br] + [big]DCC Transfer[/big] The DCC transfer part is different for every DCC sub-protocol, but - it always happens over a direct client to client TCP connection.[br] - [br] - [big]DCC Sub-protocols[/big][br] + it always happens over a direct client to client TCP connection. + [big]DCC Sub-protocols[/big] There are two main standardized DCC sub-protocols that are widely implemented in IRC clients: [b]DCC chat[/b] and [b]DCC SEND[/b].[br] DCC chat is quite simple and the protocol is more or less completely defined.[br] @@ -1451,9 +1448,8 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c) by VIrc, the Send-Ahead enhancement implemented in many clients, the RESUME facility...)[br] Many clients introduced new DCC sub-protocols with non-standard implementations, leading again to client incompatibility.[br] - Some of the notable sub-protocols are DCC Voice, DCC Draw, DCC Whiteboard...[br] - [br] - [big]DCC Chat[/big][br] + Some of the notable sub-protocols are DCC Voice, DCC Draw, DCC Whiteboard... + [big]DCC Chat[/big] This is the simplest and most standardized DCC sub-protocol. Almost every IRC client implements it.[br] It is used to exchange lines of text between the two clients.[br] The negotiation is quite simple, we assume that [b]client A[/b] wants to establish a DCC chat connection to [b]client B[/b]. @@ -1479,9 +1475,8 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c) [b]DCC SCHAT chat <ipaddress> <port>[/b][br] where [i]SCHAT[/i] stands for Secure CHAT.[br] The external protocol is exactly the same but is built on top of a Secure Sockets Layer implementation (specifically OpenSSL). The connection will be encrypted with a private key algorithm after - a public key handshake.[br] - [br] - [big]DCC SEND[/big][br] + a public key handshake. + [big]DCC SEND[/big] DCC SEND is another standard sub-protocol. Most clients implement this as well, many have tried to enhance it.[br] The basic DCC SEND protocol allows transferring a file from the requesting client to the receiving client.[br] @@ -1529,9 +1524,8 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c) [b]DCC SSEND <filename> <ipaddress> <port> <filesize>[/b][br] where [i]SSEND[/i] stands for Secure SEND.[br] The [i]Turbo[/i] extension can be combined with the SSL extension too. In this case the second parameter - of the negotiation string must be [i]TSSEND[/i] or [i]STSEND[/i].[br] - [br] - [big]DCC RECV[/big][br] + of the negotiation string must be [i]TSSEND[/i] or [i]STSEND[/i]. + [big]DCC RECV[/big] DCC RECV is the counterpart of DCC SEND. This is a KVIrc extension and is not standard yet.[br] The purpose of this sub-protocol will not be immediately clear, but read on for an explanation.[br] It is used to request a file from another client; we assume that [b]client A[/b] knows that [b]client B[/b] has @@ -1555,9 +1549,8 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c) DCC RECV requires the initiating (passive) client to know that the file to be transferred is available on the B's side and probably also know the file size. This sub-protocol does not specify how this information is obtained, but it will become clear soon that it can be obtained either manually (User B can simply tell the info to User A), - or automatically (as in the DCC RSEND sub-protocol (keep reading)).[br] - [br] - [big]DCC RSend[/big][br] + or automatically (as in the DCC RSEND sub-protocol (keep reading)). + [big]DCC RSend[/big] DCC RSend stands for Reverse Send. This is a KVIrc extension to the SEND protocol to allow firewalled clients to send files.[br] In fact, this is a [i]half[/i] sub-protocol, since it defines only a part of the DCC negotiation; the transfer is defined by another sub-protocol (and specifically bu DCC RECV).[br] @@ -1573,9 +1566,8 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c) [b]DCC TRSEND <filename> <filesize>[/b][br] The [i]SSL[/i] extension is also activated by prepending an [b]S[/b] to the RSEND string. It can be again combined with the [i]Turbo[/i] extension. The negotiation parameter becomes then [i]SRSEND[/i], [i]TSRSEND[/i] or [i]STRSEND[/i].[br] - Easy, no? :)[br] - [br] - [big]DCC Get[/big][br] + Easy, no? :) + [big]DCC Get[/big] This is again a [i]half[/i] sub-protocol in fact since it defines only a part of the negotiation for file transfers.[br] It is also NON standard, since actually no client except KVIrc implements it (AFAIK).[br] DCC Get is used to request a file from a remote client. Assume that [b]client A[/b] wants to request a file from [b]client B[/b] @@ -1592,24 +1584,22 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c) is found in the sub-protocol that the remote client will choose.[br] The association of <filename> with a real file on the B's machine is not explicitly defined by the sub-protocol; KVIrc uses an internal [i]file-offer[/i] table with a list of files that are available for download.[br] - The [i]Turbo[/i] and [i]SSL[/i] extensions are activated as usual, [i]TGET[/i], [i]SGET[/i], [i]TSGET[/i] and [i]STGET[/i] are supported.[br] - [br] - [big]DCC File Transfer[/big][br] + The [i]Turbo[/i] and [i]SSL[/i] extensions are activated as usual, [i]TGET[/i], [i]SGET[/i], [i]TSGET[/i] and [i]STGET[/i] are supported. + [big]DCC File Transfer[/big] DCC SEND: Send a file, sender is passive, receiver is active (not good for firewalled senders)[br] DCC RECV: Receive a file, sender is active, receiver is passive (not good for firewalled receivers)[br] DCC RSEND: Send a file, sender is active, receiver is passive (not good for firewalled receivers)[br] DCC GGET: Receive a file, sender is passive if not firewalled, receiver active if sender not firewalled (will fail only if both are firewalled)[br] The [i]Turbo[/i] extension disables the stream of acknowledges and is activated by prepending the 'T' character to the DCC sub-protocol name[br] - The [i]SSL[/i] extension causes a Secure Socket Layer to be used and is activated by prepending the 'S' character to the DCC sub-protocol name[br] - [br] - [big]DCC Voice[/big][br] + The [i]SSL[/i] extension causes a Secure Socket Layer to be used and is activated by prepending the 'S' character to the DCC sub-protocol name + [big]DCC Voice[/big] DCC Voice is a KVIrc extension (there is a Windows client called VIrc that implements such a protocol, but it is incompatible with KVIrc).[br] DCC Voice allows audio level communication between two clients, the audio stream is compressed with a specified codec.[br] KVIrc currently supports the ADPCM (core support) and the GSM codec (if the libgsm is available on the target system).[br] [b]TODO: Finish the DCC Voice doc :)[/b] - [big]More tricks[/big][br] + [big]More tricks[/big] KVIrc supports another [i]hack[/i] to the DCC negotiation, it recognizes [i]XDCC[/i] as a DCC negotiation CTCP parameter.[br] This can be used to circumvent limitations of some IRC clients (read mIRC) that will not allow @@ -2770,7 +2760,7 @@ static bool dcc_kvs_fnc_sessionList(KviKvsModuleFunctionCall * c) has no associated DCC session) then this function prints a warning and returns an empty string.[br] If the DCC session is not using SSL then this function returns an empty string.[br] Some queries can accept an optional parameter <param1>.[br] - Available query strings are:[br] + Available query strings are: [ul] [li]signatureType[/li] [li]signatureContents[/li] @@ -2903,14 +2893,13 @@ static bool dcc_kvs_fnc_getSSLCertInfo(KviKvsModuleFunctionCall * c) @title: The DCC module @body: - [big]Overview[/big][br] + [big]Overview[/big] The DCC module handles the Direct Client Connection protocol layer and all it's sub-protocols.[br] The sub-protocols include the standard CHAT the standard SEND and its variants plus several - KVIrc extensions like RECV, RSEND, GET and VOICE.[br] - [br] - [big]Initiating a DCC negotiation[/big][br] + KVIrc extensions like RECV, RSEND, GET and VOICE. + [big]Initiating a DCC negotiation[/big] The following commands initiate a specific DCC session with a remote client:[br] [cmd]dcc.chat[/cmd][br] @@ -2918,9 +2907,8 @@ static bool dcc_kvs_fnc_getSSLCertInfo(KviKvsModuleFunctionCall * c) [cmd]dcc.rsend[/cmd][br] [cmd]dcc.recv[/cmd][br] [cmd]dcc.get[/cmd][br] - [cmd]dcc.voice[/cmd][br] - [br] - [big]Handling the DCC events[/big][br] + [cmd]dcc.voice[/cmd] + [big]Handling the DCC events[/big] Each DCC session has an associated unique identifier (<dcc_id>).[br] You can interact with the session by using several commands and functions exported by this module and by passing the above session diff --git a/src/modules/dialog/libkvidialog.cpp b/src/modules/dialog/libkvidialog.cpp index 10fd12f3d..49dc95a42 100644 --- a/src/modules/dialog/libkvidialog.cpp +++ b/src/modules/dialog/libkvidialog.cpp @@ -875,7 +875,7 @@ static bool dialog_kvs_fnc_yesno(KviKvsModuleFunctionCall * c) is open the whole world can change: you can return from the dialog call and discover that the server connection no longer exists and the application is about to quit.[br] This may happen even with non-blocking dialogs,but in non-blocking mode you have - a way to handle this event. Consider the following snippet of code:[br] + a way to handle this event. Consider the following snippet of code: [example] echo My name is $? [/example] diff --git a/src/modules/objects/KvsObject_lineEdit.cpp b/src/modules/objects/KvsObject_lineEdit.cpp index db302cc8c..8af1498ce 100644 --- a/src/modules/objects/KvsObject_lineEdit.cpp +++ b/src/modules/objects/KvsObject_lineEdit.cpp @@ -133,14 +133,14 @@ static const int mode_cod[] = { Sets the lineedit to read-only mode. !fn: $setInputMask(<mask:string>) Sets the validation input mask to inputMask.[br] - [b]Example:[/b][br] + [b]Example:[/b] [example] %ledit_example->$setInputMask( "+99 99 99 99 99;_" );[br] %ledit_example->$setInputMask( "000.000.000.000;_" );[br] %ledit_example->IP Number Mask.[br] %ledit_example->setInputMask( ">AAAAA-AAAAA-AAAAA-AAAAA-AAAAA;#" ); [/example] - The mask format understands these mask characters:[br] + The mask format understands these mask characters: [example] [b][comment]Character Meaning[/comment][/b][br] A - ASCII alphabetic character required. A-Z, a-z.[br] diff --git a/src/modules/objects/KvsObject_multiLineEdit.cpp b/src/modules/objects/KvsObject_multiLineEdit.cpp index 955091b6d..19ddb0f84 100644 --- a/src/modules/objects/KvsObject_multiLineEdit.cpp +++ b/src/modules/objects/KvsObject_multiLineEdit.cpp @@ -70,7 +70,7 @@ Returns [b]1[/b] (true) if the cursor is placed at the end of the text; otherwise returns [b]0[/b] (false). !fn: $setWordWrap(<wrap_mode:string>) Sets the word wrap mode to mode.[br] - Valid Values are:[br] + Valid Values are: [example] - NoWrap - Do not wrap the text.[br] - WidgetWidth - Wrap the text at the current width of the widget.[br] diff --git a/src/modules/objects/KvsObject_wrapper.cpp b/src/modules/objects/KvsObject_wrapper.cpp index 147ca7d4e..1131aa4c2 100644 --- a/src/modules/objects/KvsObject_wrapper.cpp +++ b/src/modules/objects/KvsObject_wrapper.cpp @@ -80,7 +80,7 @@ As you can see the objects are identified by their names (for example "mdi_manager") and by their class names (for example KviChannelWindow).[br] To wrap a specific widget you must provide a path in the tree composed of search specifiers.[br] - Each search specifier can have one of the following forms:[br] + Each search specifier can have one of the following forms: [example] (1) <class> (2) <class>::<name> @@ -91,17 +91,17 @@ The first three forms may be preceded by the prefix [b]*[/b] which will tell KVS to perform a recursive search from this point. Let's see some examples.[br] The form (1) matches the first widget with the specified class name.[br] - For instance:[br] + For instance: [example] %Frame = $new(wrapper,0,test,KviMainWindow) [/example] This will wrap the first top level object with class KviMainWindow. Now you can use - any [class]widget[/class] or [class]object[/class] methods on it.[br] + any [class]widget[/class] or [class]object[/class] methods on it. [example] %Frame = $new(wrapper,0,test,KviMainWindow) %Frame->$setGeometry(20,20,400,400); [/example] - If you want to wrap the KVIrc status bar you can use a composite path:[br] + If you want to wrap the KVIrc status bar you can use a composite path: [example] %StatusBar = $new(wrapper,0,test,KviMainWindow,KviStatusBar) %StatusBar->$setProperty(autoFillBackground,1) @@ -109,7 +109,7 @@ [/example] The form (2) matches both the class and the widget name. In this way you can differentiate between children that have the same class.[br] - For instance:[br] + For instance: [example] %VerticalScrollBar = $new(wrapper,0,test,KviMainWindow,QSplitter,KviWindowStack,QWidget::qt_scrollarea_vcontainer,QScrollBar) %VerticalScrollBar->$setProperty(invertedAppearance,1); @@ -124,24 +124,24 @@ [/example] If you don't want to specify the full path to the widget you can try to use a recursive search which may skip some levels. Keep in mind that the recursive search is breadth-first and will return the first widget that matches.[br] - In our sample tree the following would match the first widget with class KviChannelWindow.[br] + In our sample tree the following would match the first widget with class KviChannelWindow. [example] %Chan = $new(wrapper,0,test,*KviChannelWindow) %Chan->$setBackgroundColor(80,0,0); [/example] - The following would match the first widget with name #kvirc[br] + The following would match the first widget with name #kvirc [example] %Chan = $new(wrapper,0,test,*::#kvirc) %Chan->$setBackgroundColor(80,0,0); [/example] The recursive search can start at any level, so if starting from the root does not work properly you might try - specifying a part of the path and then searching recursively.[br] + specifying a part of the path and then searching recursively. [example] %Chan = $new(wrapper,0,test,KviMainWindow,*::#kvirc) %Chan->$setBackgroundColor(80,0,0); [/example] The form (4) allows you to jump directly to a specific KVIrc channel/query/console window, - without the need of looking it up in the tree.[br] + without the need of looking it up in the tree. [example] %Win = $new(wrapper,0,test,!Window::$window) %Win->$setBackgroundColor(80,0,0); diff --git a/src/modules/options/OptionsWidget_ctcpFloodProtection.cpp b/src/modules/options/OptionsWidget_ctcpFloodProtection.cpp index 8f625c57a..07a12c43e 100644 --- a/src/modules/options/OptionsWidget_ctcpFloodProtection.cpp +++ b/src/modules/options/OptionsWidget_ctcpFloodProtection.cpp @@ -33,7 +33,7 @@ /* @doc: ctcpfloodprotectionoptions @type: - widget + generic @title: CTCP flood protection options @short: diff --git a/src/modules/perl/libkviperl.cpp b/src/modules/perl/libkviperl.cpp index 2284e7214..d84e1c848 100644 --- a/src/modules/perl/libkviperl.cpp +++ b/src/modules/perl/libkviperl.cpp @@ -71,13 +71,12 @@ static KviModule * g_pPerlCoreModule = nullptr; @short: How to use Perl from KVS and KVS from Perl. @body: - [big]Introduction[/big][br] + [big]Introduction[/big] Starting from version 3.0.2 you can include Perl code snippets in KVS code and you can use KVS commands from within Perl. This feature is present only if a working Perl installation - has been found at build time.[br] - [br] - [big]Using Perl from KVS[/big][br] + has been found at build time. + [big]Using Perl from KVS[/big] Using Perl from KVIrc is really easy - just enclose your Perl code snippet inside [cmd]perl.begin[/cmd] and [cmd]perl.end[/cmd]. [example] @@ -85,7 +84,7 @@ static KviModule * g_pPerlCoreModule = nullptr; <perl code goes here> [cmd]perl.end[/cmd] [/example] - For example:[br] + For example: [example] [cmd]perl.begin[/cmd] open(MYFILE,'>>myfile.txt') or die "Can't open myfile.txt!"; @@ -98,9 +97,8 @@ static KviModule * g_pPerlCoreModule = nullptr; and [cmd]perl.end[/cmd]. This means that you can write Perl code in the commandline, in the aliases, the event handlers, popups...anywhere.[br] If you have already encountered KVIrc's [cmd]eval[/cmd] command - then you probably also know how to execute a Perl code snippet from a file :)[br] - [br] - [big]Using KVS from Perl[/big][br] + then you probably also know how to execute a Perl code snippet from a file :) + [big]Using KVS from Perl[/big] KVIrc exports several commands to the Perl namespace that allow you to invoke KVIrc's functions from inside the Perl code snippet.[br] The nicest example is KVIrc::echo(): @@ -115,9 +113,8 @@ static KviModule * g_pPerlCoreModule = nullptr; <text> is obviously the text to be printed. <colorset> is the equivalent of the [cmd]echo[/cmd] -i option and <windowid> is the equivalent of the -w option. Both <colorset> and <windowid> - can be omitted (in this case KVIrc will use a default colorset and the current window).[br] - [br] - [big]Perl execution contexts[/big][br] + can be omitted (in this case KVIrc will use a default colorset and the current window). + [big]Perl execution contexts[/big] The Perl code snippets are executed by a Perl interpreter - each interpreter has its own context and thus its own variables, own function namespace etc.[br] @@ -128,7 +125,7 @@ static KviModule * g_pPerlCoreModule = nullptr; allow you to preserve your context across [cmd]perl.begin[/cmd] invocations.[br] [br] You can invoke a specific Perl context by passing it as parameter to the [cmd]perl.begin[/cmd] - command:[br] + command: [example] [cmd]perl.begin("mycontext")[/cmd] $myvariable = "mycontext"; @@ -136,7 +133,7 @@ static KviModule * g_pPerlCoreModule = nullptr; [cmd]perl.end[/cmd] [/example] The nice thing is that at a later time you can invoke this context again - and discover that $mycontext has preserved its value:[br] + and discover that $mycontext has preserved its value: [example] [cmd]perl.begin("mycontext")[/cmd] KVIrc::echo("myvariable is still equal to ".$myvariable); @@ -167,23 +164,21 @@ static KviModule * g_pPerlCoreModule = nullptr; once in a while to recreate the interpreter.[br] If you just execute occasional Perl code snippets and don't need to keep persistent variables, then just use the nameless temporary context provided - by [cmd]perl.begin[/cmd]("").[br] - [br] - [big]Passing parameters to the Perl script[/big][br] + by [cmd]perl.begin[/cmd](""). + [big]Passing parameters to the Perl script[/big] The easiest way to pass parameters to the perl code snippet is to put them as [cmd]perl.begin[/cmd] arguments. In fact the complete syntax of [cmd]perl.begin[/cmd] is:[br] [b]perl.begin(<perl context>,<arg0>,<arg1>,...)[/b][br] Where the <arg0>,<arg1>...<argN> parameters - are passed to the Perl context as elements of the $_[] array.[br] + are passed to the Perl context as elements of the $_[] array. [example] [cmd]perl.begin[/cmd]("","Hello world!","Now I CAN",1,2,3) for($i=0;$i<5;$i++) KVIrc::echo($_[i],40); [cmd]perl.end[/cmd] [/example] - [br] - [big]Accessing the KVIrc scripting context from Perl[/big][br] + [big]Accessing the KVIrc scripting context from Perl[/big] KVIrc exposes the following functions that manipulate variables of the KVIrc's current KVS execution context:[br] [b]KVIrc::getLocal(<x>)[/b][br] @@ -195,7 +190,7 @@ static KviModule * g_pPerlCoreModule = nullptr; [b]KVIrc::setGlobal(<Y>,<value>)[/b][br] Sets KVIrc's global variable %Y to <value>[br] The local variables referenced belong to the current KVS execution context - while the global variables are visible everywhere.[br] + while the global variables are visible everywhere. [example] %pippo = test %Pluto = 12345 @@ -210,13 +205,12 @@ static KviModule * g_pPerlCoreModule = nullptr; [cmd]echo[/cmd] "\%pippo is" %pippo [cmd]echo[/cmd] "\%Pluto is" %Pluto [/example] - [br] - [big]Executing arbitrary KVIrc commands from Perl[/big][br] + [big]Executing arbitrary KVIrc commands from Perl[/big] You can execute arbitrary KVS commands from Perl by means of:[br] [b]KVIrc::eval(<code>)[/b][br] This function behaves exactly like the ${ <code> } KVS construct - it executes <code> in a child context and returns its evaluation result.[br] - The following two code snippets have equivalent visible effects:[br] + The following two code snippets have equivalent visible effects: [example] [cmd]echo[/cmd] ${ return "Yeah!"; } [/example] @@ -228,7 +222,7 @@ static KviModule * g_pPerlCoreModule = nullptr; You can [i]eval[/i] compound command sequences and variable ones.[br] Remember that the Perl code snippet is evaluated in a child KVS context and thus the local variables are NOT visible! - The following code snippets may easily fool you:[br] + The following code snippets may easily fool you: [example] %x = 10 [cmd]perl.begin[/cmd] @@ -236,7 +230,7 @@ static KviModule * g_pPerlCoreModule = nullptr; [cmd]perl.end[/cmd] [/example] This will print [i]The value is[/i] since %x is not accessible from the eval's context. - If you have tried to write something like this then you probably need to rewrite it as:[br] + If you have tried to write something like this then you probably need to rewrite it as: [example] %x = 10 [cmd]perl.begin[/cmd] @@ -257,7 +251,7 @@ static KviModule * g_pPerlCoreModule = nullptr; KVIrc::echo(KVIrc::eval('return $window.caption')); [cmd]perl.end[/cmd] [/example] - [big]A shortcut for KVIrc::eval("/say...")[/big][br] + [big]A shortcut for KVIrc::eval("/say...")[/big] Since KVIrc::eval("/say...") is a common calling pattern, say has been added to the KVIrc Perl namespace. You can now call [example] @@ -270,8 +264,7 @@ static KviModule * g_pPerlCoreModule = nullptr; The complete syntax for KVIrc::say() is:[br] [b]KVIrc::say(<text>[,<windowid>])[/b][br] and the semantics are obvious (see also /[cmd]say[/cmd]). - [br] - [big]Perl script return values[/big][br] + [big]Perl script return values[/big] The [cmd]perl.begin[/cmd] command propagates the Perl code return value to the KVIrc context (just like a [cmd]setreturn[/cmd]() would do) - this makes it easier to create an alias that executes a Perl script and @@ -284,8 +277,7 @@ static KviModule * g_pPerlCoreModule = nullptr; [li]Then, from the KVIrc script after [cmd]perl.end[/cmd], retrieve the %var variable, check its value and call [cmd]setreturn[/cmd]() on it.[/li] [/ul] - [br] - [big]Executing Perl scripts from files[/big][br] + [big]Executing Perl scripts from files[/big] [example] [cmd]alias[/cmd](perlexec) { @@ -298,13 +290,12 @@ static KviModule * g_pPerlCoreModule = nullptr; [comment]# or even[/comment] [cmd]echo[/cmd] $perlexec("/home/pragma/computeprimelargerthan.pl","10000") [/example] - [br] - [big]Other tricks[/big][br] + [big]Other tricks[/big] An interesting feature of persistent Perl contexts is that you can prepare a context for later fast execution.[br] The idea is to declare all Perl functions in a single Perl code snippet then call single functions when fast execution is needed.[br] - For example you might parse the following snippet at KVIrc's startup:[br] + For example you might parse the following snippet at KVIrc's startup: [example] [cmd]perl.begin[/cmd]("persistent") sub handler_for_event_1 @@ -323,8 +314,7 @@ static KviModule * g_pPerlCoreModule = nullptr; handler_for_event_1($_[0],$_[1]) [cmd]perl.end[/cmd] [/example] - [br] - [big]Curiosity[/big][br] + [big]Curiosity[/big] The Perl support in KVIrc is implemented as a master-slave module pair. The perl.* module is the master while perlcore is the slave. When Perl support isn't compiled in, the perl.* commands diff --git a/src/modules/python/libkvipython.cpp b/src/modules/python/libkvipython.cpp index 0af0eec34..6bdd56a80 100644 --- a/src/modules/python/libkvipython.cpp +++ b/src/modules/python/libkvipython.cpp @@ -68,7 +68,7 @@ static KviModule * g_pPythonCoreModule = nullptr; @short: How to use Python from KVS and KVS from Python. @body: - [big]Introduction[/big][br] + [big]Introduction[/big] Starting from version 4.0.0 you can include Python code snippets in KVS code and you can use KVS commands from within Python. This feature is present only if a working Python installation @@ -76,8 +76,7 @@ static KviModule * g_pPythonCoreModule = nullptr; The Python support is very similar to the Perl support present since 3.x, so if you have used Perl from KVIrc before you'll find the API is almost the same.. otherwise read on :) - [br] - [big]Using Python from KVS[/big][br] + [big]Using Python from KVS[/big] Using Python from KVIrc is really easy - just enclose your Python code snippet inside [cmd]python.begin[/cmd] and [cmd]python.end[/cmd]. [example] @@ -85,7 +84,7 @@ static KviModule * g_pPythonCoreModule = nullptr; <python code goes here> [cmd]python.end[/cmd] [/example] - For example:[br] + For example: [example] [cmd]python.begin[/cmd] f = open('myfile.txt', 'w') @@ -98,9 +97,8 @@ static KviModule * g_pPythonCoreModule = nullptr; and [cmd]python.end[/cmd]. This means that you can write Python code in the commandline, in the aliases, the event handlers, popups... anywhere.[br] If you have already encountered KVIrc's [cmd]eval[/cmd] command - then you probably also know how to execute a Python code snippet from a file :)[br] - [br] - [big]Using KVS from python[/big][br] + then you probably also know how to execute a Python code snippet from a file :) + [big]Using KVS from python[/big] KVIrc exports several commands to the Python namespace that allow you to invoke KVIrc's functions from inside the Python code snippet.[br] The nicest example is kvirc.echo(): @@ -115,9 +113,8 @@ static KviModule * g_pPythonCoreModule = nullptr; <text> is obviously the text to be printed. <colorset> is the equivalent of the [cmd]echo[/cmd] -i option and <windowid> is the equivalent of the -w option. Both <colorset> and <windowid> - can be omitted (in this case KVIrc will use a default colorset and the current window).[br] - [br] - [big]Python execution contexts[/big][br] + can be omitted (in this case KVIrc will use a default colorset and the current window). + [big]Python execution contexts[/big] The Python code snippets are executed by a Python interpreter - each interpreter has its own context and thus its own variables, own function namespace etc.[br] @@ -128,7 +125,7 @@ static KviModule * g_pPythonCoreModule = nullptr; allow you to preserve your context across [cmd]python.begin[/cmd] invocations.[br] [br] You can invoke a specific Python context by passing it as parameter to the [cmd]python.begin[/cmd] - command:[br] + command: [example] [cmd]python.begin("mycontext")[/cmd] myvariable = "mycontext" @@ -136,7 +133,7 @@ static KviModule * g_pPythonCoreModule = nullptr; [cmd]python.end[/cmd] [/example] The nice thing is that at a later time you can invoke this context again - and discover that mycontext has preserved its value:[br] + and discover that mycontext has preserved its value: [example] [cmd]python.begin("mycontext")[/cmd] kvirc.echo("myvariable is still equal to " + myvariable) @@ -167,23 +164,21 @@ static KviModule * g_pPythonCoreModule = nullptr; once in a while to recreate the interpreter.[br] If you just execute occasional Python code snippets and don't need to keep persistent variables, then just use the nameless temporary context provided - by [cmd]python.begin[/cmd]("").[br] - [br] - [big]Passing parameters to the Python script[/big][br] + by [cmd]python.begin[/cmd](""). + [big]Passing parameters to the Python script[/big] The easiest way to pass parameters to the Python code snippet is to put them as [cmd]python.begin[/cmd] arguments. In fact the complete syntax of [cmd]python.begin[/cmd] is:[br] [b]python.begin(<python context>,<arg0>,<arg1>,...)[/b][br] Where the <arg0>,<arg1>...<argN> parameters - are passed to the Python context as elements of the aArgs array.[br] + are passed to the Python context as elements of the aArgs array. [example] [cmd]python.begin[/cmd]("","Hello world!","Now I CAN",1,2,3) for l in range(0,5): kvirc.echo(aArgs[l]) [cmd]python.end[/cmd] [/example] - [br] - [big]Accessing the KVIrc scripting context from python[/big][br] + [big]Accessing the KVIrc scripting context from python[/big] KVIrc exposes the following functions that manipulate variables of KVIrc's current KVS execution context:[br] [b]kvirc.getLocal(<x>)[/b][br] @@ -195,7 +190,7 @@ static KviModule * g_pPythonCoreModule = nullptr; [b]kvirc.setGlobal(<Y>,<value>)[/b][br] Sets KVIrc's global variable %Y to <value>[br] The local variables referenced belong to the current KVS execution context - while the global variables are visible everywhere.[br] + while the global variables are visible everywhere. [example] %pippo = test %Pluto = 12345 @@ -210,13 +205,12 @@ static KviModule * g_pPythonCoreModule = nullptr; [cmd]echo[/cmd] "\%pippo is" %pippo [cmd]echo[/cmd] "\%Pluto is" %Pluto [/example] - [br] - [big]Executing arbitrary KVIrc commands from python[/big][br] + [big]Executing arbitrary KVIrc commands from python[/big] You can execute arbitrary KVS commands from Python by means of:[br] [b]kvirc.eval(<code>)[/b][br] This function behaves exactly like the ${ <code> } KVS construct - it executes <code> in a child context and returns its evaluation result.[br] - The following two code snippets have equivalent visible effects:[br] + The following two code snippets have equivalent visible effects: [example] [cmd]echo[/cmd] ${ return "Yeah!"; } [/example] @@ -228,7 +222,7 @@ static KviModule * g_pPythonCoreModule = nullptr; You can "eval" compound command sequences and variable ones.[br] Remember that the Python code snippet is evaluated in a child KVS context and thus the local variables are NOT visible! - The following code snippets may easily fool you:[br] + The following code snippets may easily fool you: [example] %x = 10 [cmd]python.begin[/cmd] @@ -236,7 +230,7 @@ static KviModule * g_pPythonCoreModule = nullptr; [cmd]python.end[/cmd] [/example] This will print "The value is " since %x is not accessible from the eval's context. - If you have tried to write something like this then you probably need to rewrite it as:[br] + If you have tried to write something like this then you probably need to rewrite it as: [example] %x = 10 [cmd]python.begin[/cmd] @@ -244,8 +238,7 @@ static KviModule * g_pPythonCoreModule = nullptr; kvirc.eval("echo \"The value is ".$x."\"") [cmd]python.end[/cmd] [/example] - [br] - [big]A shortcut for kvirc.eval("/say...")[/big][br] + [big]A shortcut for kvirc.eval("/say...")[/big] Since kvirc.eval("/say...") is a common calling pattern, say has been added to the KVIrc Python namespace. You can now call [example] @@ -258,8 +251,7 @@ static KviModule * g_pPythonCoreModule = nullptr; The complete syntax for kvirc.say() is:[br] [b]kvirc.say(<text>[,<windowid>])[/b][br] and the semantics are obvious (see also /[cmd]say[/cmd]). - [br] - [big]Python script return values[/big][br] + [big]Python script return values[/big] The [cmd]python.begin[/cmd] command propagates the Python code return value to the KVIrc context (just like a [cmd]setreturn[/cmd]() would do) - this makes it easier to create an alias that executes a Python script and @@ -272,8 +264,7 @@ static KviModule * g_pPythonCoreModule = nullptr; [li]Then, from the KVIrc script after [cmd]python.end[/cmd], retrieve the %var variable, check its value and call [cmd]setreturn[/cmd]() on it.[/li] [/ul] - [br] - [big]Executing Python scripts from files[/big][br] + [big]Executing Python scripts from files[/big] [example] [cmd]alias[/cmd](pythonexec) { @@ -286,8 +277,7 @@ static KviModule * g_pPythonCoreModule = nullptr; [comment]# or even[/comment] [cmd]echo[/cmd] $pythonexec("/home/pragma/computeprimelargerthan.pl","10000") [/example] - [br] - [big]Curiosity[/big][br] + [big]Curiosity[/big] The Python support in KVIrc is implemented as a master-slave module pair. The python.* module is the master while pythoncore is the slave. When Python support isn't compiled in, the python.* commands diff --git a/src/modules/reguser/libkvireguser.cpp b/src/modules/reguser/libkvireguser.cpp index 3d51faab9..ebb9d6abb 100644 --- a/src/modules/reguser/libkvireguser.cpp +++ b/src/modules/reguser/libkvireguser.cpp @@ -1087,11 +1087,11 @@ static bool reguser_kvs_fnc_property(KviKvsModuleFunctionCall * c) bound to the first entry matched by by <user_mask>.[br] If the property is not set, an empty string is returned.[br] If no entry matches <user_mask> this function returns an empty string - and does not print any error.[br] + and does not print any error. [example] %property = $reguser.matchProperty(<user_mask>,<property_name>) [/example] - Is actually a shortcut for:[br] + Is actually a shortcut for: [example] %tmp = [fnc]$reguser.match[/fnc](<user_mask>) if("%tmp" != "")%property = $reguser.property(%tmp,<property_name>) diff --git a/src/modules/str/libkvistr.cpp b/src/modules/str/libkvistr.cpp index a0a4e961c..c695be123 100644 --- a/src/modules/str/libkvistr.cpp +++ b/src/modules/str/libkvistr.cpp @@ -1697,7 +1697,7 @@ static bool str_kvs_fnc_grep(KviKvsModuleFunctionCall * c) %Test[] = $str.split("Y*H","hihiYeaHhohohoyeahYepYEAHhi",sw) echo %Test[] [/example] - If used outside of an array context, a comma-separated list of substrings is returned:[br] + If used outside of an array context, a comma-separated list of substrings is returned: [example] [cmd]echo[/cmd] $str.split("[ ]*","Condense spaces and change all it in commas",r) [/example] @@ -1879,8 +1879,7 @@ static bool str_kvs_fnc_split(KviKvsModuleFunctionCall * c) and by using the following corresponding variadic parameters. Since the percent sign is used as variable prefix in KVIrc, this function uses the question mark [b]?[/b] instead.[br] - The <format> string can contain the following escape sequences:[br] - [br] + The <format> string can contain the following escape sequences: [table] [tr][td][b]?s[/b][/td][td]The next parameter is evaluated as a string and substituted in place of ?s[/td][/tr] [tr][td][b]?d[/b][/td][td]The next parameter is evaluated as a signed integer and substituted in place of ?d[/td][/tr] diff --git a/src/modules/system/Plugin.cpp b/src/modules/system/Plugin.cpp index f63d3dfa9..33bb6c253 100644 --- a/src/modules/system/Plugin.cpp +++ b/src/modules/system/Plugin.cpp @@ -51,7 +51,7 @@ [br][br] [b]Exported functions by easyplugin (C/C++-Examples):[/b][br] [b]_free function[/b] [i] (needed)[/i][br][br] - This function is important! Since KVIrc can not free directly the memory of the dll, the plugins need the _free function so that the memory can be freed by the plugin to prevent memory-leaks.[br] + This function is important! Since KVIrc can not free directly the memory of the dll, the plugins need the _free function so that the memory can be freed by the plugin to prevent memory-leaks. [example] int _free(void * p) { @@ -70,7 +70,7 @@ [/example] [b]_unload function[/b] [i]((optional)[/i][br][br] This function will be called before the plugins is unloaded. In this function you can clean up memory or other things. - After this call there is no guarantee that the plugin will be kept in memory.[br] + After this call there is no guarantee that the plugin will be kept in memory. [example] int _unload() { @@ -80,7 +80,7 @@ [br][b]_canunload function[/b] [i](optional)[/i][br] The _canunload-function will be called by KVIrc to check if it may unload the plugin. If return value is true KVIrc will unload the plugin, false means he will try unloading it at the next check.[br] - Important: KVIrc will ignore this if unload of plugins will be forced! So you have to be sure that the _unload function of your plugins cleans up![br] + Important: KVIrc will ignore this if unload of plugins will be forced! So you have to be sure that the _unload function of your plugins cleans up! [example] int _canunload() { @@ -90,7 +90,7 @@ [br][b]user function[/b][br] This is the general structure of a user function call.[br] The important thing here is the handling of return values. To return a value to KVIrc you have to allocate memory and write the pointer to it into pBuffer.[br] - Have a look at the example for more details.[br] + Have a look at the example for more details. [example] int about(int argc, char * argv[], char ** pBuffer) { diff --git a/src/modules/url/libkviurl.cpp b/src/modules/url/libkviurl.cpp index 4a3640639..279c414cd 100644 --- a/src/modules/url/libkviurl.cpp +++ b/src/modules/url/libkviurl.cpp @@ -675,7 +675,7 @@ UrlDlgList * findFrame() @description: This command opens a configuration window where it is possible to setup plugin's parameters.[br] - You can also open this window by using popup menu in the URL list window[br] + You can also open this window by using popup menu in the URL list window [big]Configure dialog options:[/big] There is also a ban list widget, which allows to have a list of words that plugin must not catch.[br][br] [i]e.g. if the word "ftp" is inserted in the ban list and if in a window there is an output like "ftp.kvirc.net", |
