aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar un1versal2016-03-02 12:15:44 +0000
committerGravatar un1versal2016-03-14 04:57:12 +0000
commitf138911b65dfce85c551f9e2e4bbeb595d6c6755 (patch)
tree701d5eec803c30160be47f8762b5838e57bc44dd /src
parentcleanup: add or remove empty lines between documentation blocks & code (diff)
downloadKVIrc-f138911b65dfce85c551f9e2e4bbeb595d6c6755.tar.gz
KVIrc-f138911b65dfce85c551f9e2e4bbeb595d6c6755.tar.bz2
KVIrc-f138911b65dfce85c551f9e2e4bbeb595d6c6755.zip
documentation: formatting/indentation + minor syntax fixes
+ Dont use double quotes to emphasise words in normal circumstances. + improve indenting + consistency (good for readability when editing source) + also replace single quotes
Diffstat (limited to 'src')
-rw-r--r--src/kvilib/ext/KviCryptEngine.cpp46
-rw-r--r--src/kvilib/ext/KviRegisteredUserDataBase.cpp52
-rw-r--r--src/kvilib/ext/KviSharedFilesManager.cpp12
-rw-r--r--src/kvilib/irc/KviAvatar.cpp6
-rw-r--r--src/kvilib/irc/KviIrcMask.cpp31
-rw-r--r--src/kvirc/kernel/KviNotifyList.cpp34
-rw-r--r--src/kvirc/kvs/KviKvsCoreCallbackCommands.cpp56
-rw-r--r--src/kvirc/kvs/KviKvsCoreFunctions_af.cpp223
-rw-r--r--src/kvirc/kvs/KviKvsCoreFunctions_gl.cpp114
-rw-r--r--src/kvirc/kvs/KviKvsCoreFunctions_mr.cpp50
-rw-r--r--src/kvirc/kvs/KviKvsCoreFunctions_sz.cpp133
-rw-r--r--src/kvirc/kvs/KviKvsCoreSimpleCommands_af.cpp24
-rw-r--r--src/kvirc/kvs/KviKvsCoreSimpleCommands_gl.cpp36
-rw-r--r--src/kvirc/kvs/KviKvsCoreSimpleCommands_mr.cpp90
-rw-r--r--src/kvirc/kvs/KviKvsCoreSimpleCommands_sz.cpp18
-rw-r--r--src/kvirc/kvs/event/KviKvsEventManager.cpp6
-rw-r--r--src/kvirc/kvs/event/KviKvsEventTable.cpp52
-rw-r--r--src/kvirc/kvs/object/KviKvsObject.cpp1122
-rw-r--r--src/kvirc/kvs/parser/KviKvsParser.cpp1032
-rw-r--r--src/kvirc/kvs/parser/KviKvsParser_expression.cpp132
-rw-r--r--src/kvirc/kvs/parser/KviKvsParser_lside.cpp160
-rw-r--r--src/kvirc/kvs/parser/KviKvsParser_specialCommands.cpp188
-rw-r--r--src/kvirc/module/KviModule.cpp15
-rw-r--r--src/kvirc/sparser/KviAntiSpam.cpp8
-rw-r--r--src/kvirc/sparser/KviIrcServerParser_ctcp.cpp113
-rw-r--r--src/kvirc/ui/KviInput.cpp41
-rw-r--r--src/kvirc/ui/KviIrcView_events.cpp4
-rw-r--r--src/modules/about/libkviabout.cpp8
-rw-r--r--src/modules/action/libkviaction.cpp60
-rw-r--r--src/modules/addon/libkviaddon.cpp87
-rw-r--r--src/modules/avatar/libkviavatar.cpp4
-rw-r--r--src/modules/chan/libkvichan.cpp68
-rw-r--r--src/modules/channelsjoin/libkvichannelsjoin.cpp2
-rw-r--r--src/modules/config/libkviconfig.cpp38
-rw-r--r--src/modules/context/libkvicontext.cpp2
-rw-r--r--src/modules/dcc/libkvidcc.cpp267
-rw-r--r--src/modules/dialog/libkvidialog.cpp8
-rw-r--r--src/modules/file/libkvifile.cpp114
-rw-r--r--src/modules/lamerizer/libkvilamerizer.cpp4
-rw-r--r--src/modules/language/libkvilanguage.cpp22
-rw-r--r--src/modules/links/libkvilinks.cpp6
-rw-r--r--src/modules/log/libkvilog.cpp2
-rw-r--r--src/modules/mask/libkvimask.cpp8
-rw-r--r--src/modules/mediaplayer/libkvimediaplayer.cpp61
-rw-r--r--src/modules/my/libkvimy.cpp8
-rw-r--r--src/modules/notifier/libkvinotifier.cpp20
-rw-r--r--src/modules/objects/KvsObject_buttonGroup.cpp2
-rw-r--r--src/modules/objects/KvsObject_checkBox.cpp2
-rw-r--r--src/modules/objects/KvsObject_colorDialog.cpp2
-rw-r--r--src/modules/objects/KvsObject_dateTimeEdit.cpp39
-rw-r--r--src/modules/objects/KvsObject_dockWindow.cpp6
-rw-r--r--src/modules/objects/KvsObject_file.cpp21
-rw-r--r--src/modules/objects/KvsObject_groupBox.cpp23
-rw-r--r--src/modules/objects/KvsObject_http.cpp2
-rw-r--r--src/modules/objects/KvsObject_label.cpp39
-rw-r--r--src/modules/objects/KvsObject_layout.cpp12
-rw-r--r--src/modules/objects/KvsObject_lineEdit.cpp51
-rw-r--r--src/modules/objects/KvsObject_listWidget.cpp37
-rw-r--r--src/modules/objects/KvsObject_multiLineEdit.cpp54
-rw-r--r--src/modules/objects/KvsObject_painter.cpp413
-rw-r--r--src/modules/objects/KvsObject_pixmap.cpp16
-rw-r--r--src/modules/objects/KvsObject_popupMenu.cpp138
-rw-r--r--src/modules/objects/KvsObject_process.cpp130
-rw-r--r--src/modules/objects/KvsObject_radioButton.cpp10
-rw-r--r--src/modules/objects/KvsObject_slider.cpp18
-rw-r--r--src/modules/objects/KvsObject_socket.cpp178
-rw-r--r--src/modules/objects/KvsObject_sql.cpp135
-rw-r--r--src/modules/objects/KvsObject_tabWidget.cpp22
-rw-r--r--src/modules/objects/KvsObject_tableWidget.cpp22
-rw-r--r--src/modules/objects/KvsObject_toolBar.cpp8
-rw-r--r--src/modules/objects/KvsObject_trayIcon.cpp22
-rw-r--r--src/modules/objects/KvsObject_treeWidget.cpp14
-rw-r--r--src/modules/objects/KvsObject_treeWidgeteItem.cpp21
-rw-r--r--src/modules/objects/KvsObject_vBox.cpp16
-rw-r--r--src/modules/objects/KvsObject_webView.cpp15
-rw-r--r--src/modules/objects/KvsObject_widget.cpp176
-rw-r--r--src/modules/objects/KvsObject_window.cpp7
-rw-r--r--src/modules/objects/KvsObject_workspace.cpp180
-rw-r--r--src/modules/objects/KvsObject_wrapper.cpp169
-rw-r--r--src/modules/objects/libkviobjects.cpp52
-rw-r--r--src/modules/perl/libkviperl.cpp9
-rw-r--r--src/modules/proxydb/libkviproxydb.cpp80
-rw-r--r--src/modules/python/libkvipython.cpp2
-rw-r--r--src/modules/regchan/libkviregchan.cpp6
-rw-r--r--src/modules/serverdb/libkviserverdb.cpp6
-rw-r--r--src/modules/str/libkvistr.cpp64
-rw-r--r--src/modules/tmphighlight/libkvitmphighlight.cpp6
-rw-r--r--src/modules/toolbar/libkvitoolbar.cpp4
-rw-r--r--src/modules/trayicon/libkvitrayicon.cpp2
-rw-r--r--src/modules/window/libkviwindow.cpp10
90 files changed, 3230 insertions, 3598 deletions
diff --git a/src/kvilib/ext/KviCryptEngine.cpp b/src/kvilib/ext/KviCryptEngine.cpp
index b98390d12..8f14b1c55 100644
--- a/src/kvilib/ext/KviCryptEngine.cpp
+++ b/src/kvilib/ext/KviCryptEngine.cpp
@@ -45,54 +45,54 @@
[big]Introduction[/big][br]
Well, there is a concrete background noise about security around the net.
And I've thought that adding a little cryptography support to KVIrc wasn't
- a bad idea. So I first came up with the "crypt engines", that
+ 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 "generalized"
- into "text transformation" support.[br]
+ then found out that the realized structure was perfect to be [i]generalized[/i]
+ into [i]text transformation[/i] support.[br]
[big]The concept[/big][br]
- In few words, the "text transformation" engine is a layer between the user and the
+ 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.
The trick works also in the reverse way: some data comes from the remote target,
the engine re-transforms the text in some other way and displays it to the local user.[br]
- The "incoming" transformation is usually the inverse of the "outgoing" one, but it
- is not mandatory. It will become clear in few sentences that some engines will do no "incoming"
+ The [i]incoming[/i] transformation is usually the inverse of the [i]outgoing[/i] one, but it
+ is not mandatory. It will become clear in few sentences that some engines will do no [i]incoming[/i]
transformation at all. The original use of the transformation engines was to encrypt the
outgoing data and to decrypt the incoming data; anyway, the engines can perform
other funky tasks. One of them is remapping the local charset to a standardized one
when sending text to a channel (or some other target) and doing the inverse map on
- the way back. A totally "fantastic" usage of this concept could be an "on-the-fly translator";
+ the way back. A totally [i]fantastic[/i] usage of this concept could be an [i]on-the-fly translator[/i];
it could translate for example Italian to English while sending to a channel
and English to Italian on the way back... the implementation of a such engine is left
to the reader as exercise :) Another (maybe less interesting) usage is to
colorize the outgoing text, or transform it
in a way that it is still readable but has a different look. This engine
- would not require a back transformation (so no "decrypt stage"). A "symmetric"
+ 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]
[big]The name of this stuff[/big][br]
- Initially all this was named "cryptography support".
- Then "cryptography" was no longer enough to describe
- the framework, so "text transformation" is a more generic term.
+ 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.
Anyway, both terms were used in the documentation and the source.
- Just as example, the "text transformation engine" is called
- KviCryptEngine in the sources. So actually the terms "crypt"
+ Just as example, the [i]text transformation engine[/i] is called
+ 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]
[big]Yes, but why cryptography (on IRC)?[/big][br]
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
- "secure communication" tools, but actually I can't find one that is able to
- implement a "secure real time conversation". And what about a MULTIPLE real
+ [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]
[big]The working things[/big][br]
KVIrc can use a text transformation engine on IRC channels, in the queries
and the DCC chats. At the time I am writing, only the [module:rijndael]Rijndael[/module] crypt engine
is available: this is a private key encryption algorithm that assures
- a "pretty good" security level. More engines will be surely available
+ a [i]pretty good[/i] security level. More engines will be surely available
at the time of the 3.0.0 release of KVIrc. The engines
- can be activated by the dedicated dialog that can be accessed from the "button bar"
+ can be activated by the dedicated dialog that can be accessed from the [i]button bar[/i]
of the window. Once an engine has been enabled all the text that you type
in the input line (that is not a command obviously) is encrypted
and sent to the remote endpoint. If you want to send a non-encrypted message
@@ -110,14 +110,14 @@
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]
[big]The first test[/big][br]
- A cool way to test an encryption engine is to use a "self query": connect to
+ 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
and enable both encryption and decryption; specify the same key for
bot directions and then type some text in the input line: you will see
- the message twice: one is "your local text" and the other is the server routed one.
+ the message twice: one is [i]your local text[/i] and the other is the server routed one.
Then you can try to activate encryption only and leaving decryption disabled:
- you will see how the text would appear to a possible "man in the middle".
+ you 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]
[big]The protocol[/big][br]
@@ -125,10 +125,10 @@
can be accessed by anyone that want to reproduce them. There are only some
points relating to the encryption engines that need to be cleared:[br]
The encrypted text must be suitable to be sent through an IRC connection;
- this means that some characters can not appear in the encrypted text (e.g. CR,LF,NULL....).
+ this means that some characters can not appear in the encrypted text (e.g. CR, LF, NULL).
KVIrc solves it in a simple way: the encrypted binary data is encoded,
either as a hexadecimal numeric string or in base64.[br]
- An escape character has been defined to identify messages that are "encrypted" from the
+ An escape character has been defined to identify messages that are [i]encrypted[/i] from the
ones that are not: this character has ASCII code 30 (decimal).[br]
The encoding is used in private messages only and has the following format:[br]
PRIVMSG <target> :<escape_char_ascii_30><encrypted message>[br]
@@ -144,7 +144,7 @@
act in a similar way too. So the escape character is used for the encryption
engines only.
[big]An idea for the future implementations[/big][br]
- A "public key" handshake protocol could be implemented.
+ A [i]public key[/i] handshake protocol could be implemented.
*/
KviCryptEngine::KviCryptEngine()
diff --git a/src/kvilib/ext/KviRegisteredUserDataBase.cpp b/src/kvilib/ext/KviRegisteredUserDataBase.cpp
index 18d8cb151..289694073 100644
--- a/src/kvilib/ext/KviRegisteredUserDataBase.cpp
+++ b/src/kvilib/ext/KviRegisteredUserDataBase.cpp
@@ -48,23 +48,23 @@
It is used to recognize users on IRC and associate properties to them.[br]
This works more or less like the IRC ban list, K-Line list, or invite list.[br]
[big]User entry[/big][br]
- A registered user database entry is identified by an [b]unique[/b] name.[br]
+ 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 "internal identifier" for the user entry:
+ 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]
The masks have the common IRC mask format: [b]<nick>!<user>@<host>[/b][br]
- The masks may contain '*' and '?' wildcards that match any portion of text.[br]
+ The masks may contain [b]*[/b] and [b]?[/b] wildcards that match any portion of text.[br]
[b]*!*@*[/b][br]
[b]Pragma!*@*[/b][br]
[b]*!~daemon@*[/b][br]
[b]Pragma!*daemon@*.it[/b][br]
[b]Pragma!?daemon@some*.it[/b][br]
[b]Pragma!~daemon@some.host.it[/b][br]
- Are examples of valid registration masks.[br]
+ Are examples of valid registration masks.[br][br]
The masks with wildcards can actually match more than a single user.[br]
For example the mask *!root@*.host.com will match all the users
having root as username and coming from the host.com domain.[br]
@@ -73,47 +73,47 @@
If you don't use wildcards in nicknames you are sure that
in a single IRC connection, a mask will always refer to a single user.[br]
You will commonly use the following format:[br]
- <nick>!*<username>@*.<host>.<top>[br]
+ [b]<nick>!*<username>@*.<host>.<top>[/b][br]
or[br]
- <nick>!*<username>@<number>.<number>.<number>.*[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]
- [br]
[big]Example of registration and lookups[/big]
Assume that you want to register a friend of yours: Derek Riggs.[br]
- Derek often uses "Eddie" as his nickname
- "stranger" as username and has a dial-up connection that makes his IP address appear as
+ Derek often uses [i]Eddie[/i] as his nickname
+ [i]stranger[/i] as username and has a dial-up connection that makes his IP address appear as
<variable-number>.somewhere.in.time.org.[br]
- You will add an entry with name "Derek Riggs" and a registration mask like the following:
- Eddie!stranger@*.somewhere.in.time.org.[br]
- If the IRC servers keep adding strange characters ([doc:irc_masks]prefixes[/doc]) at the beginning of his username you may use
- Eddie!*stranger@*.somewhere.in.time.org.[br]
- If Eddie also often connects from the wasted.years.org domain and gets 'eddie' as username there, you might add a second registration mask as follows:
- Eddie!*eddie@*.wasted.years.org.[br]
+ You will add an entry with name [i]Derek Riggs[/i] and a registration mask like the following:[br]
+ [b]Eddie!stranger@*.somewhere.in.time.org.[/b][br]
+ If the IRC servers keep adding strange characters ([doc:irc_masks]prefixes[/doc]) at the beginning of his username you may use;[br]
+ [b]Eddie!*stranger@*.somewhere.in.time.org.[/b][br]
+ If Eddie also often connects from the wasted.years.org domain and gets [i]eddie[/i] as username there,
+ you might add a second registration mask as follows:[br]
+ [b]Eddie!*eddie@*.wasted.years.org.[/b][br]
An alternative could be use only one mask with *.org as domain and allow any username (Eddie!*@*.org) but this
could become dangerous since it could match the users that you don't want to.[br]
On the other hand, if you dislike the users with the nickname Eddie that come from .org
- and you're implementing an auto-kick system, the correct mask to register is "Eddie!*@*.org".[br]
- [br]
+ and you're implementing an auto-kick system, the correct mask to register is [i]Eddie!*@*.org[/i].
+ [br][br]
KVIrc tries to be smart, and always find the most correct match for an user:
- If you have two masks registered: Pragma!*xor@*.myisp.it and *!*@*.myisp.it,
- KVIrc will match Pragma!~xor@233-dyn.myisp.it with the first one even if the second
- one matches too; the first one is a best match.[br]
- [br]
+ 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]
A registered user has an (eventually empty) set of properties
defined by name/value pairs. (In versions prior to 3.0.0 flags were used instead,
but revealed to be insufficient).[br]
KVIrc recognizes some of these properties and associates semantic actions to it; other properties
are left for scripting extension. Property names are case insensitive.[br]
- One of the recognized properties is the "[doc:notify_list]notify[/doc]" property.
+ One of the recognized properties is the [i][doc:notify_list]notify[/doc][/i] property.[br][br]
When an user is found to have this property set to a special value
KVIrc will attempt to track the user presence on IRC.
Another one is the [doc:avatar]avatar[/doc] property. Its value should be the
- name of the "default" [doc:avatar]avatar image file[/doc] for the specified user.[br]
- The "ignore" property should be set to "1" (or "true") for users that have to be ignored (:D).[br]
+ 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 [module:reguser]reguser module[/module] is the interface to the "registered users database".[br]
+ 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]
*/
@@ -238,7 +238,7 @@ KviRegisteredUser * KviRegisteredUserDataBase::addMask(KviRegisteredUser * u,Kvi
l->setAutoDelete(true);
if(!u->addMask(mask))
{
- qDebug(" Oops! Received an incoherent regusers action, recovered?");
+ qDebug("Oops! Received an incoherent regusers action, recovered?");
delete l;
l = 0;
} else {
diff --git a/src/kvilib/ext/KviSharedFilesManager.cpp b/src/kvilib/ext/KviSharedFilesManager.cpp
index c816ef26a..cd910f2d7 100644
--- a/src/kvilib/ext/KviSharedFilesManager.cpp
+++ b/src/kvilib/ext/KviSharedFilesManager.cpp
@@ -45,9 +45,9 @@
@keyterms:
file sharing
@body:
- [big]What is this ?[/big]
- The "file offers" are a simple way to share your files with other IRC users.[br]
- Basically, you setup an offer by selecting a local file, choosing a "visible name" for it.
+ [big]What is this?[/big]
+ 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]
[big]Details[/big]
@@ -55,15 +55,15 @@
The offer is given a visible name that the remote users will effectively request.
To share the file /usr/arch/mp3/SonataArctica_SingInSilence_Live.mp3 you will add a file offer
with /usr/arch/mp3/SonataArctica_SingInSilence_Live.mp3 as real file path, something like
- "SonataArctica_SingInSilence.mp3". A remote user will then request you a DCC GET SonataArctica_SingInSilence.mp3
+ [i]SonataArctica_SingInSilence.mp3[/i]. A remote user will then request you a DCC GET SonataArctica_SingInSilence.mp3
and KVIrc will automatically send the file.[br]
- Each file offer has an "user mask" that the requesting remote users must match to
+ Each file offer has an [i]user mask[/i] that the requesting remote users must match to
obtain the file: *!*@* matches any user, Pragma!*@* matches any user with nickname pragma,
*!*@*.omnikron.net matches any user coming from the omnikron.net domain.[br]
Each offer can have an expire time: the offer will be automatically removed after
a defined number of seconds. An expire time of '0' seconds means that the offer should never expire.[br]
If you have two file offers with the same name and different file, the remote user can
- use an additional "size" parameter in the DCC GET request.[br]
+ use an additional [i]size[/i] parameter in the DCC GET request.[br]
[big]Security issues[/big]
This is a nice but unsecure method of sharing files.[br]
The user mask is a good protection but you have to use it properly![br]
diff --git a/src/kvilib/irc/KviAvatar.cpp b/src/kvilib/irc/KviAvatar.cpp
index a99775711..c37ddd1dc 100644
--- a/src/kvilib/irc/KviAvatar.cpp
+++ b/src/kvilib/irc/KviAvatar.cpp
@@ -49,8 +49,8 @@
the protocol is intended to be client based.
[big]The terms[/big]
The user that wants to offer a digital representation of himself
- will be called "source user". The ones that will receive the notification
- will be called "target users".
+ will be called [i]source user[/i]. The ones that will receive the notification
+ will be called [i]target users[/i].
Every IRC user can be either a source user or target user.
[big]The idea[/big]
Every IRC user has a client-side property called AVATAR. Let's say that there
@@ -86,7 +86,7 @@
[br]
There should be a convention on the image sizes: not a protocol limit.
For example, the convention could be that all the images should be smaller than
- 129x129 pixels. The preferred image format is "png" (Portable Network Graphics)
+ 129x129 pixels. The preferred image format is [i]png[/i] (Portable Network Graphics)
since it allows good compression rates without compromising the image quality.
Other formats may be accepted as well (Theoretically this protocol could be
extended to allow movies or 3D images).
diff --git a/src/kvilib/irc/KviIrcMask.cpp b/src/kvilib/irc/KviIrcMask.cpp
index cdddcb4cd..abf95b40a 100644
--- a/src/kvilib/irc/KviIrcMask.cpp
+++ b/src/kvilib/irc/KviIrcMask.cpp
@@ -26,6 +26,7 @@
#include "KviIrcMask.h"
#include <QRegExp>
+
/*
@doc: irc_masks
@title:
@@ -52,13 +53,15 @@
The <username> often has a special prefix character added by the IRC server:[br]
this is rather server specific protocol, but the prefixes are somewhat standardized and
the common meanings of them are:[br]
- noprefix: I line with Ident[br]
- ^: I line with OTHER type Ident[br]
- ~: I line, no Ident[br]
- +: i line with Ident[br]
- =: i line with OTHER type Ident[br]
- -: i line, no Ident[br]
- So finally you can find <username> strings like "~pragma" or "^pragma", where "pragma"
+ [pre]
+ noprefix: I line with Ident[br]
+ ^: I line with OTHER type Ident[br]
+ ~: I line, no Ident[br]
+ +: i line with Ident[br]
+ =: i line with OTHER type Ident[br]
+ -: i line, no Ident[br]
+ [/pre]
+ So finally you can find <username> strings like [i]~pragma[/i] or [i]^pragma[/i], where [i]pragma[/i]
is the system username of the irc-user and ~ and ^ are prefixes.[br]
The <host> part is the hostname of the remote user.[br]
In most cases it is the human-readable format of the host name, but sometimes
@@ -75,19 +78,19 @@
The irc-masks are [b]case insensitive[/b].[br]
[br]
[big]Wildcard masks[/big][br]
- In some contexts the irc-masks can contain '*' and '?' wildcards.[br]
- The wild masks are used to "match" an user within a set of them.[br]
- '*' matches any sequence (eventually empty) of characters and '?' matches a single character.[br]
+ In some contexts the irc-masks can contain [b]*[/b] and [b]?[/b] wildcards.[br]
+ The wild masks are used to [i]match[/i] an user within a set of them.[br]
+ [b]*[/b] matches any sequence (eventually empty) of characters and [b]?[/b] matches a single character.[br]
Wildcards are allowed only in the <nick>, <user> and <host> part: so the
- "wildest" mask possible is:[br]
+ [i]wildest[/i] mask possible is:[br]
[b]*!*@*[/b][br]
- that designates "any nickname, any username on any host".[br]
+ that designates [i]any nickname, any username on any host[/i].[br]
Here are some examples of wild masks:[br]
- Pragma!*pragma@212.101.102.*: matches any user with nickname "Pragma", username that ends with "pragma" and
+ Pragma!*pragma@212.101.102.*: matches any user with nickname [i]Pragma[/i], username that ends with [i]pragma[/i] and
coming from any machine on the 212.101.102 network.[br]
*!solo@*.starwars.org: matches any nick with username solo (no prefix!) coming from any machine in
the starwars.org domain.[br]
- Pragma!*@*: matches any user with nickname "Pragma".[br]
+ Pragma!*@*: matches any user with nickname [i]Pragma[/i].[br]
*/
static unsigned char ucMaskTable[27][3] = {
diff --git a/src/kvirc/kernel/KviNotifyList.cpp b/src/kvirc/kernel/KviNotifyList.cpp
index af621867f..2252fde83 100644
--- a/src/kvirc/kernel/KviNotifyList.cpp
+++ b/src/kvirc/kernel/KviNotifyList.cpp
@@ -65,7 +65,7 @@
periodically if your friends are online.[br]
This is basically achieved by setting a property in the [doc:registered_users]registered users database[/doc]
entry.[br]
- The property is called "notify", and you have to set it to the nickname
+ 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]
[example]
@@ -73,44 +73,44 @@
[cmd:reguser.addmask]reguser.addmask[/cmd] Szymon Pragma!*@*.it
[/example]
And then want it in the notify list; nothing easier, just set
- hist "notify" property to the nickname that you want him to be "looked for":[br]
+ hist [i]notify[/i] property to the nickname that you want him to be [i]looked for[/i]:[br]
[example]
[cmd:reguser.setproperty]reguser.setproperty[/cmd] Szymon notify Pragma
[/example]
In this way, once in a while, KVIrc will send to the server an ISON message
with the nickname Pragma. If Szymon is online, you will be notified with a message:[br]
- "Pragma [someuser@somehost.it] is on IRC".[br]
- If Szymon uses often "[Pragma]" as his secondary nickname, you can do the following:[br]
+ [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]
[example]
[cmd:reguser.addmask]reguser.addmask[/cmd] Szymon [Pragma]*@*.it
- [cmd:reguser.setproperty]reguser.setproperty[/cmd] Szymon notify "Pragma [Pragma]"
+ [cmd:reguser.setproperty]reguser.setproperty[/cmd] Szymon notify [i]Pragma [Pragma][/i]
[/example]
KVIrc will then look for both nicknames getting online.[br]
KVIrc supports three notify lists management methods:[br]
- The "stupid ISON method", the "intelligent ISON method" and the "WATCH method".[br]
- The "stupid ISON method" will assume that Szymon is online if any user with nickname
+ The [i]stupid ISON method[/i], the [i]intelligent ISON method[/i] and the [i]WATCH method[/i].[br]
+ The [i]stupid ISON method[/i] will assume that Szymon is online if any user with nickname
Pragma (or [Pragma] in the second example) gets online; this means that also Pragma!someuser@somehost.com will be
- assumed to be "Szymon" and will be shown in the notify list.[br]
+ assumed to be [i]Szymon[/i] and will be shown in the notify list.[br]
This might be a false assumption (since somehost.com does not even match *.it),
- but it is the best result that the "stupid ISON method" can achieve.[br]
- The "intelligent ISON method" will also check the Pragma's username and hostname
+ but it is the best result that the [i]stupid ISON method[/i] can achieve.[br]
+ The [i]intelligent ISON method[/i] will also check the Pragma's username and hostname
and match it in the registered masks; so in the example above, you will be notified if
- any user that matches Pragma!*@*.it gets online; (but you will NOT be notified if
+ any user that matches Pragma!*@*.it gets online; (but you will [b]not[/b] be notified if
(for example) Pragma!someuser@somehost.com gets online).[br]
- So what's the point in including a stupid method? :) Well...the intelligent
- method "eats" some of your IRC bandwidth; it has to send USERHOST messages
+ So what's the point in including a stupid method? :) Well... the intelligent
+ method [i]eats[/i] some of your IRC bandwidth; it has to send USERHOST messages
for every group of 5 users in the notify list. If you have a lot of users
in the notify list, it might become slow and eventually cause a
client to server flood.[br]
- So finally, the intelligent method is the default. If you have "flood" problems,
- or if you think that the notify list is quite slow, try the "stupid" method:
+ So finally, the intelligent method is the default. If you have [i]flood[/i] problems,
+ or if you think that the notify list is quite slow, try the [i]stupid[/i] method:
it is not that bad after all.[br]
- The third notify list management method is the "WATCH method".[br]
+ The third notify list management method is the [i]WATCH method[/i].[br]
It uses a totally different (and better) approach to the notify lists management,
and can be used only on the networks that support the WATCH notify method (DALnet, WebNet, etc.).[br]
KVIrc will attempt to guess if the server you're currently using supports the WATCH command
and eventually use this last method.[br]
- The WATCH method uses the "notify" property to get the nicknames that have to be
+ The WATCH method uses the [i]notify[/i] property to get the nicknames that have to be
sent to the server in the /WATCH commands.
*/
diff --git a/src/kvirc/kvs/KviKvsCoreCallbackCommands.cpp b/src/kvirc/kvs/KviKvsCoreCallbackCommands.cpp
index 4a7cabab9..52088da88 100644
--- a/src/kvirc/kvs/KviKvsCoreCallbackCommands.cpp
+++ b/src/kvirc/kvs/KviKvsCoreCallbackCommands.cpp
@@ -70,7 +70,7 @@ namespace KviKvsCoreCallbackCommands
results by calling the callback routine.
The -i switch causes the command to execute
in IPv6 mode (and lookup ONLY IPv6 hosts!).[br]
- The -a switch causes the command to run in "unspecified" mode
+ The -a switch causes the command to run in [i]unspecified[/i] mode
and return any available address: IPv4 or Ipv6.[br]
This command also performs reverse lookups (if you pass an IP address as <hostname>).[br]
The callback command gets passed five parameters:[br]
@@ -90,8 +90,8 @@ namespace KviKvsCoreCallbackCommands
!sw: -i
Causes the command to execute in IPv6 mode (and lookup ONLY IPv6 hosts!).
!sw: -a
- The -a switch causes the command to run in "unspecified" mode
- and return any available address: IPv4 or Ipv6.
+ The -a switch causes the command to run in [i]unspecified[/i] mode
+ and return any available address: IPv4 or IPv6.
@examples:
[example]
ahost("localhost")
@@ -180,20 +180,20 @@ namespace KviKvsCoreCallbackCommands
The implementation code can be either a single KVS instruction
or an instruction block (instruction list enclosed in braces).[br]
If the alias already exists, it is replaced with the new implementation.[br]
- If the <implementation> is empty (e.g. "{}" or just a ";")
+ If the <implementation> is empty (e.g. [i]{}[/i] or just a [i];[/i])
the alias <alias_name> is removed.
- If the "remove" form is used but the specified <alias_name> does not exist
+ If the [i]remove[/i] form is used but the specified <alias_name> does not exist
in the alias store then a warning is printed unless
the -q (--quiet) switch is used.
- If <alias_name> contains a "<name>::" prefix, then the alias
+ If <alias_name> contains a [i]<name>::[/i] prefix, then the alias
is created in the namespace specified by <name>.
If the namespace does not exist, it is created.
- Any alias without the "<name>::" prefix is created in the root
+ Any alias without the [i]<name>::[/i] prefix is created in the root
namespace. Namespaces are useful to avoid collisions in alias names
between scripts. Only really common aliases should be created
in the root namespace - all of the internal functionality of your
scripts should be hidden in your own namespace.
- The special syntax "<namespace>::" can be used to remove all
+ The special syntax [i]<namespace>::[/i] can be used to remove all
the aliases belonging to the specified namespace. When creating
aliases this syntax is not allowed.
@examples:
@@ -327,7 +327,7 @@ namespace KviKvsCoreCallbackCommands
@description:
AWHOIS stands for Asynchronous WHOIS. It is used to obtain data for a specified
irc user (designated by <nickname>). This command sends a WHOIS query to the
- server and silently awaits the sequence of replies. When the "End of WHOIS" message
+ server and silently awaits the sequence of replies. When the [i]End of WHOIS[/i] message
is received from server the <callback command> is executed passing the WHOIS
information as positional parameters.[br]
The <magic> string is an optional string to be evaluated at AWHOIS execution time.
@@ -349,7 +349,7 @@ namespace KviKvsCoreCallbackCommands
If the -i switch is specified, the WHOIS message is sent to the server
that the <nickname> user is connected to; in this way you will probably
get the idle time of the user too.[br]
- If the server replies with a "No such nick/channel error message" the
+ If the server replies with a [i]No such nick/channel error message[/i] the
<callback command> will be still triggered, but will have all the parameters
empty with the exception of $0.[br]
If the connection gets interrupted before all the information have been received,
@@ -418,7 +418,7 @@ namespace KviKvsCoreCallbackCommands
The optional button text is specified by <label_text>.[br]
The <callback_code> will be executed as reaction to a button press.[br]
[br]
- The "window" type button can be added only to the windows that have a button container: this
+ The [i]window[/i] type button can be added only to the windows that have a button container: this
actually includes at least console, channels and queries.[br]
The button is added to the current window; if you want to add it to a different
window, use the [doc:command_rebinding]standard -r command rebinding[/doc] switch.[br]
@@ -529,7 +529,7 @@ namespace KviKvsCoreCallbackCommands
If the <implementation> is empty
the handler <handler_name> is removed from the handler
list instead of being added.[br]
- The <event_name> may be one of the kvirc-builtin event names
+ The <event_name> may be one of the KVIrc builtin event names
or a numeric code (from 0 to 999) of a RAW server message.[br]
If the -q switch is specified then the command runs in quiet mode.
@seealso:
@@ -637,17 +637,17 @@ namespace KviKvsCoreCallbackCommands
If the -t switch is used then the termination event will be
triggered just after the process has been killed.
!sw: -p=<timeout> | --trigger-ping=<timeout>
- Trigger <callback command> with "ping" events every <timeout> milliseconds.
+ Trigger <callback command> with [i]ping[/i] events every <timeout> milliseconds.
!sw: -w | --bind-to-window
Kill the process if the current window is closed. In this case the
termination event is [b]not[/b] triggered (since the parent window has been lost).
If this switch is not used then the process is rebound to
the active console window and continues running.
!sw: -s=<interpreter command> | --shell=<interpreter command>
- Use <interpreter command> instead of the default interpreter "sh -c".
+ Use <interpreter command> instead of the default interpreter [i]sh -c[/i].
The <interpreter command> should be able to launch the interpeter
and should contain the necessary arguments in order to allow
- KVirc to pass the "commandline" by appending it as the last parameter.
+ KVirc to pass the [i]commandline[/i] by appending it as the last parameter.
!sw: -d | --direct
Use no command interpreter at all: run the command directly.
Takes precedence over -s.
@@ -667,8 +667,8 @@ namespace KviKvsCoreCallbackCommands
$1 = <event parameter>[br]
$2 = <magic data>[br]
The first parameter specifies the event cause and contains one of the
- following strings: "stdout","stderr","terminated","started" and "ping".
- [b]By default (if no switches are used) only "stdout" type events are triggered[/b].
+ following strings: [i]stdout[/i], [i]stderr[/i], [i]terminated[/i], [i]started[/i] and [i]ping[/i].
+ [b]By default (if no switches are used) only [i]stdout[/i] type events are triggered[/b].
The second parameter depends on the event cause and contains data sensible
to each event type. The third parameter is the eventual <magic data>
passed to the exec command call.[br]
@@ -685,13 +685,13 @@ namespace KviKvsCoreCallbackCommands
[b]Startup event[/b][br]
If the -x switch is used then the startup event is triggered
just after the process has been successfully launched.
- The $0 parameter passed to the callback contains the string "started".
+ The $0 parameter passed to the callback contains the string [i]started[/i].
Parameter $1 contains the pid of the slave process.[br]
[br]
[b]Stdout data event[/b][br]
The stdout data event is triggered when the process prints some output
on its stdout stream. This event is triggered by default and to disable
- it you must use the -n switch. $0 contains the string "stdout".
+ it you must use the -n switch. $0 contains the string [i]stdout[/i].
If the -b switch is not used then $1 contains a single line of process
output with the trailing carriage return and/or line feed stripped.
If -b is used then $1 contains the whole process output
@@ -701,13 +701,13 @@ namespace KviKvsCoreCallbackCommands
The stderr data event is similar to the stdout one but there are three differences.
The first one is that the stderr event is [b]not[/b] triggered by default: you must
use the -e switch to enable it. The second difference is that $0
- contains "stderr" instead of "stdout". The last difference is that $1 contains data
+ contains [i]stderr[/i] instead of [i]stdout[/i]. The last difference is that $1 contains data
coming from the slave process stderr stream.[br]
[br]
[b]Termination event[/b][br]
The termination event is triggered after the slave process has terminated its
execution. You must use the -t switch to enable it since it is
- disabled by default. $0 contains the string "terminated". $1 contains the process exit
+ disabled by default. $0 contains the string [i]terminated[/i]. $1 contains the process exit
status value. (Note that if the process has crashed or has been terminated
by an external signal then this value will be 0).[br]
[br]
@@ -729,7 +729,7 @@ namespace KviKvsCoreCallbackCommands
With the -b switch the events stdout and stderr are triggered once even if the process
emits no output.
The -s=<interpreter> switch may be used to specify the path of the command interpreter
- that is "sh -c" by default on UNIX machines and "cmd.exe /c" on Windows.
+ that is [i]sh -c[/i] by default on UNIX machines and [i]cmd.exe /c[/i] on Windows.
The interpreter executable is searched on the system PATH.
If the process can't be started then a warning message is printed in the current window
unless the -q (quiet) flag is used.[br]
@@ -1009,7 +1009,7 @@ namespace KviKvsCoreCallbackCommands
<implementation> must be a valid command sequence.[br]
Side note:[br]
This command can not successfully implement
- the "constructor" function since it must be called
+ the [i]constructor[/i] function since it must be called
after this one has already been executed.[br]
To implement a constructor you MUST write your own class definition.[br]
@seealso:
@@ -1066,10 +1066,10 @@ namespace KviKvsCoreCallbackCommands
The timer periodically calls the specified <callback_command> code passing the
eventual <callback_param> strings as positional parameters.[br]
If a timer with the same name already exists, it is replaced by this one.[br]
- [b]The <callback_command> is evaluated at timer "shot" time and [b]not[/b] while
+ [b]The <callback_command> is evaluated at timer [i]shot[/i] time and [b]not[/b] while
this command is being parsed. This means that the identifiers that you put
inside <callback_command> will [b]not[/b] have the current values.[/b]
- The values will be assigned at timer "shot" time.[br]
+ The values will be assigned at timer [i]shot[/i] time.[br]
This is a common scripters error and problem: if it is not clear, look at the examples below.[br]
The timer is bound to the window in that this command is executed in.[br]
If the window gets destroyed, the timer is stopped; unless the -p switch is used.[br]
@@ -1078,15 +1078,15 @@ namespace KviKvsCoreCallbackCommands
original window is destroyed.[br]
The -s switch causes this timer to trigger only once: it will be automatically destroyed after that.[br]
The time has an associated set of [doc:data_structures]extended scope variables[/doc]:
- the variables that begin with "%:" have their life extended to the whole "life" of the timer.[br]
+ the variables that begin with [i]%:[/i] have their life extended to the whole [i]life[/i] of the timer.[br]
Using a very low delay is a common method to perform some background processing: you
basically split a huge job in small slices and execute them when the timer is triggered
until you run out of slices. A delay of 0 will cause the timer to be called whenever
- KVIrc has some "idle time" to spend.
+ KVIrc has some [i]idle time[/i] to spend.
On the other hand, remember that timers are precious resources: many timers running
with a very low delay will cause KVIrc to slow down.[br]
Since all the KVIrc timers share the same namespace it is a good idea to use
- descriptive timer names: a timer named "a" is likely to be used by two or more scripts
+ descriptive timer names: a timer named [i]a[/i] is likely to be used by two or more scripts
at once causing one (or both) of them to fail.[br]
A timer can be stopped at any time by using the [cmd]killtimer[/cmd] command.
@seealso:
diff --git a/src/kvirc/kvs/KviKvsCoreFunctions_af.cpp b/src/kvirc/kvs/KviKvsCoreFunctions_af.cpp
index 476aa13e9..94bdc3fad 100644
--- a/src/kvirc/kvs/KviKvsCoreFunctions_af.cpp
+++ b/src/kvirc/kvs/KviKvsCoreFunctions_af.cpp
@@ -72,13 +72,13 @@ namespace KviKvsCoreFunctions
window ID is returned (0).[br]
If no <irc context id> is specified, then
the application active window is returned (the window
- that currently has the input focus). Note that in this
+ that currently has the input focus).[br][br]Note that in this
case the returned window may also belong to another IRC
context or be not bound to any IRC context at all.
In some extreme cases you may even get a window that
has no output widget and thus has its output redirected.
- Using the "global" active window should be used only
- for communicating something REALLY urgent (and maybe
+ Using the [i]global[/i] active window should be used only
+ for communicating something [b]really[/b] urgent (and maybe
unrelated to a specific IRC connection) to the user.
@seealso:
[fnc]$window[/fnc]
@@ -345,8 +345,6 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
/*
@doc: b
@type:
@@ -372,8 +370,6 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
/*
@doc: base64toAscii
@type:
@@ -407,8 +403,6 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
/*
@doc: boolean
@type:
@@ -463,8 +457,6 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
/*
@doc: certificate
@type:
@@ -480,29 +472,29 @@ namespace KviKvsCoreFunctions
Some queries can accept an optional parameter <param1>.[br]
Available query strings are:[br]
[ul]
- [li]signatureType[/li]
- [li]signatureContents[/li]
- [li]subjectCountry[/li]
- [li]subjectStateOrProvince[/li]
- [li]subjectLocality[/li]
- [li]subjectOrganization[/li]
- [li]subjectOrganizationalUnit[/li]
- [li]subjectCommonName[/li]
- [li]issuerCountry[/li]
- [li]issuerStateOrProvince[/li]
- [li]issuerLocality[/li]
- [li]issuerOrganization[/li]
- [li]issuerOrganizationalUnit[/li]
- [li]issuerCommonName[/li]
- [li]publicKeyBits[/li]
- [li]publicKeyType[/li]
- [li]serialNumber[/li]
- [li]pemBase64[/li]
- [li]version[/li]
- [li]fingerprintIsValid[/li]
- [li]fingerprintDigestId[/li]
- [li]fingerprintDigestStr[/li]
- [li]fingerprintContents * accepts parameter interpreted as "digest name"[/li]
+ [li]signatureType[/li]
+ [li]signatureContents[/li]
+ [li]subjectCountry[/li]
+ [li]subjectStateOrProvince[/li]
+ [li]subjectLocality[/li]
+ [li]subjectOrganization[/li]
+ [li]subjectOrganizationalUnit[/li]
+ [li]subjectCommonName[/li]
+ [li]issuerCountry[/li]
+ [li]issuerStateOrProvince[/li]
+ [li]issuerLocality[/li]
+ [li]issuerOrganization[/li]
+ [li]issuerOrganizationalUnit[/li]
+ [li]issuerCommonName[/li]
+ [li]publicKeyBits[/li]
+ [li]publicKeyType[/li]
+ [li]serialNumber[/li]
+ [li]pemBase64[/li]
+ [li]version[/li]
+ [li]fingerprintIsValid[/li]
+ [li]fingerprintDigestId[/li]
+ [li]fingerprintDigestStr[/li]
+ [li]fingerprintContents * accepts parameter interpreted as [i]digest name[/i][/li]
[/ul]
@seealso:
[fnc]$str.evpSign[/fnc]
@@ -588,11 +580,11 @@ namespace KviKvsCoreFunctions
<channel name> and bound to the connection specified by
<irc context id>[br]
If no window matches the specified name or connection, an invalid
- window ID is returned (0).[br]
+ window ID is returned [b]0[/b].[br]
If no <irc context id> is specified, this function looks for
the channel in the current connection context (if any).[br]
If no <channel name> is specified, this function returns the current
- channel window ID, if executed in a channel, else 0.[br]
+ channel window ID, if executed in a channel, and [b]0[/b] otherwise.[br]
@seealso:
[fnc]$window[/fnc],
[fnc]$query[/fnc],
@@ -638,8 +630,6 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
/*
@doc: char
@type:
@@ -674,8 +664,6 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
/*
@doc: classdefined
@type:
@@ -687,7 +675,7 @@ namespace KviKvsCoreFunctions
@syntax:
$classdefined(<class_name>)
@description:
- Returns 1 if the class <class_name> is defined, else 0.
+ Returns [b]1[/b] if the class <class_name> is defined, and [b]0[/b] otherwise.
*/
KVSCF(classDefined)
@@ -702,8 +690,6 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
/*
@doc: console
@type:
@@ -748,8 +734,6 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
/*
@doc: context
@type:
@@ -765,17 +749,17 @@ namespace KviKvsCoreFunctions
the specified <server> and local user's <nickname>.[br] This function can
find only connected IRC contexts.
If no context matches the server and nickname, and invalid
- [b]IRC context ID[/b] is returned (0).[br]
+ [b]IRC context ID[/b] is returned [b]0[/b].[br]
If <server> is an empty string, the first context that matches
the specified nickname is returned. If <nickname> is an empty string,
the first context that uses the specified server is returned.
If both parameters are missing this function returns the
- id of the current IRC context, or '0' if the
+ id of the current IRC context, or [b]0[/b] if the
window that this call is executed in is not bound to any IRC context.
Please note that in this last case you may find an [b]IRC context[/b]
- that is 'not connected'.
+ that is [i]not connected[/i].
This can only happen if the current window is a console that is
- in the "idle" state, with no connection established yet.[br]
+ in the [i]idle[/i] state, with no connection established yet.[br]
It is a good idea to take a look at the
[doc:window_naming_conventions]window naming conventions[/doc].
@seealso:
@@ -802,8 +786,6 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
/*
@doc: countStatusBarItems
@type:
@@ -834,8 +816,6 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
/*
@doc: cr
@type:
@@ -861,8 +841,8 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
+ // The formatting of the table contents has to remain this way (i.e. long lines),
+ // else it adds long spaces between words in same sentence which looks awful on screen + harder to read.
/*
@doc: date
@type:
@@ -875,58 +855,43 @@ namespace KviKvsCoreFunctions
<string> $date(<format:string>[,<unixtime:integer>])
@description:
Returns the string representation of <unixtime> or
- of the current time if <unixtime> is not given,
- based on <format>.[br]
+ of the current time if <unixtime> is not given, based on <format>.[br]
The <format string> should contain a set of characters
that will be transformed according to the following rules:[br]
- [br]
[table]
- [tr][td][b]a[/b][/td][td]The abbreviated weekday name according to the current locale.[/td][/tr]
- [tr][td][b]A[/b][/td][td]The full weekday name according to the current locale.[/td][/tr]
- [tr][td][b]b[/b][/td][td]The abbreviated month name according to the current locale.[/td][/tr]
- [tr][td][b]B[/b][/td][td]The full month name according to the current locale.[/td][/tr]
- [tr][td][b]c[/b][/td][td]The preferred date and time representation for the current locale.[/td][/tr]
- [tr][td][b]C[/b][/td][td]The century number (year/100) as a 2-digit integer. (SU)[/td][/tr]
- [tr][td][b]d[/b][/td][td]The day of the month as a decimal number (range 01 to 31).[/td][/tr]
- [tr][td][b]D[/b][/td][td]Equivalent to m/d/y.[/td][/tr]
- [tr][td][b]e[/b][/td][td]Like d, the day of the month as a decimal number, but a leading
- zero is replaced by a space. (SU)[/td][/tr]
- [tr][td][b]F[/b][/td][td]Equivalent to Y-m-d (the ISO 8601 date format). (C99)[/td][/tr]
- [tr][td][b]h[/b][/td][td]Equivalent to b.[/td][/tr]
- [tr][td][b]H[/b][/td][td]The hour as a decimal number using a 24-hour clock (range 00 to 23).[/td][/tr]
- [tr][td][b]I[/b][/td][td]The hour as a decimal number using a 12-hour clock (range 01 to 12).[/td][/tr]
- [tr][td][b]j[/b][/td][td]The day of the year as a decimal number (range 001 to 366).[/td][/tr]
- [tr][td][b]k[/b][/td][td]The hour (24-hour clock) as a decimal number (range 0 to 23); sin-
- gle digits are preceded by a blank. (See also H.)[/td][/tr]
- [tr][td][b]l[/b][/td][td]The hour (12-hour clock) as a decimal number (range 1 to 12); sin-
- gle digits are preceded by a blank. (See also I.)[/td][/tr]
- [tr][td][b]m[/b][/td][td]The month as a decimal number (range 01 to 12).[/td][/tr]
- [tr][td][b]M[/b][/td][td]The minute as a decimal number (range 00 to 59).[/td][/tr]
- [tr][td][b]n[/b][/td][td]A newline character. (SU)[/td][/tr]
- [tr][td][b]p[/b][/td][td]Either `AM' or `PM' according to the given time value, or the cor-
- responding strings for the current locale. Noon is treated as `pm' and midnight as `am'.[/td][/tr]
- [tr][td][b]r[/b][/td][td]The time in a.m. or p.m. notation. In the POSIX locale this is
- equivalent to `I:M:S p'.[/td][/tr]
- [tr][td][b]s[/b][/td][td]The number of seconds since the Epoch, i.e., since 1970-01-01
- 00:00:00 UTC.[/td][/tr]
- [tr][td][b]S[/b][/td][td]The second as a decimal number (range 00 to 60). (The range is up
- to 60 to allow for occasional leap seconds.)[/td][/tr]
- [tr][td][b]t[/b][/td][td]A tab character.[/td][/tr]
- [tr][td][b]T[/b][/td][td]The time in 24-hour notation (H:M:S). (SU)[/td][/tr]
- [tr][td][b]u[/b][/td][td]The day of the week as a decimal, range 1 to 7, Monday being 1.
- See also w.[/td][/tr]
- [tr][td][b]V[/b][/td][td]The ISO 8601:1988 week number of the current year as a decimal num-
- ber, range 01 to 53, where week 1 is the first week that has at
- least 4 days in the current year, and with Monday as the first day
- of the week. See also U and W.[/td][/tr]
- [tr][td][b]w[/b][/td][td]The day of the week as a decimal, range 0 to 6, Sunday being 0.[/td][/tr]
- [tr][td][b]W[/b][/td][td]The week number of the current year as a decimal number, range 00
- to 53, starting with the first Monday as the first day of week 01.[/td][/tr]
- [tr][td][b]y[/b][/td][td]The year as a decimal number without a century (range 00 to 99).[/td][/tr]
- [tr][td][b]Y[/b][/td][td]The year as a decimal number including the century.[/td][/tr]
- [tr][td][b]z[/b][/td][td]The time-zone as hour offset from GMT. Required to emit
- RFC822-conformant dates (using "a, d b Y H:M:S z").[/td][/tr]
- [tr][td][b]Z[/b][/td][td]The time zone or name or abbreviation (not implemented yet).[/td][/tr]
+ [tr][td][b]a[/b][/td][td]The abbreviated weekday name according to the current locale.[/td][/tr]
+ [tr][td][b]A[/b][/td][td]The full weekday name according to the current locale.[/td][/tr]
+ [tr][td][b]b[/b][/td][td]The abbreviated month name according to the current locale.[/td][/tr]
+ [tr][td][b]B[/b][/td][td]The full month name according to the current locale.[/td][/tr]
+ [tr][td][b]c[/b][/td][td]The preferred date and time representation for the current locale.[/td][/tr]
+ [tr][td][b]C[/b][/td][td]The century number (year/100) as a 2-digit integer. (SU)[/td][/tr]
+ [tr][td][b]d[/b][/td][td]The day of the month as a decimal number (range 01 to 31).[/td][/tr]
+ [tr][td][b]D[/b][/td][td]Equivalent to m/d/y.[/td][/tr]
+ [tr][td][b]e[/b][/td][td]Like d, the day of the month as a decimal number, but a leading zero is replaced by a space. (SU)[/td][/tr]
+ [tr][td][b]F[/b][/td][td]Equivalent to Y-m-d (the ISO 8601 date format). (C99)[/td][/tr]
+ [tr][td][b]h[/b][/td][td]Equivalent to b.[/td][/tr]
+ [tr][td][b]H[/b][/td][td]The hour as a decimal number using a 24-hour clock (range 00 to 23).[/td][/tr]
+ [tr][td][b]I[/b][/td][td]The hour as a decimal number using a 12-hour clock (range 01 to 12).[/td][/tr]
+ [tr][td][b]j[/b][/td][td]The day of the year as a decimal number (range 001 to 366).[/td][/tr]
+ [tr][td][b]k[/b][/td][td]The hour (24-hour clock) as a decimal number (range 0 to 23); single digits are preceded by a blank. See also [b]H[/b].[/td][/tr]
+ [tr][td][b]l[/b][/td][td]The hour (12-hour clock) as a decimal number (range 1 to 12); single digits are preceded by a blank. See also [b]I[/b].[/td][/tr]
+ [tr][td][b]m[/b][/td][td]The month as a decimal number (range 01 to 12).[/td][/tr]
+ [tr][td][b]M[/b][/td][td]The minute as a decimal number (range 00 to 59).[/td][/tr]
+ [tr][td][b]n[/b][/td][td]A newline character. (SU)[/td][/tr]
+ [tr][td][b]p[/b][/td][td]Either [b]AM[/b] or [b]PM[/b] according to the given time value, or the corresponding strings for the current locale. Noon is treated as [b]pm[/b] and midnight as [b]am[/b].[/td][/tr]
+ [tr][td][b]r[/b][/td][td]The time in a.m. or p.m. notation. In the POSIX locale this is equivalent to [b]I:M:S p[/b].[/td][/tr]
+ [tr][td][b]s[/b][/td][td]The number of seconds since the Epoch, i.e., since 1970-01-01 00:00:00 UTC.[/td][/tr]
+ [tr][td][b]S[/b][/td][td]The second as a decimal number (range 00 to 60). (The range is up to 60 to allow for occasional leap seconds.)[/td][/tr]
+ [tr][td][b]t[/b][/td][td]A tab character.[/td][/tr]
+ [tr][td][b]T[/b][/td][td]The time in 24-hour notation (H:M:S). (SU)[/td][/tr]
+ [tr][td][b]u[/b][/td][td]The day of the week as a decimal, range 1 to 7, Monday being 1. See also [b]w[/b].[/td][/tr]
+ [tr][td][b]V[/b][/td][td]The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week. See also [b]U[/b] and [/b]W.[/td][/tr]
+ [tr][td][b]w[/b][/td][td]The day of the week as a decimal, range 0 to 6, Sunday being 0.[/td][/tr]
+ [tr][td][b]W[/b][/td][td]The week number of the current year as a decimal number, range 00 to 53, starting with the first Monday as the first day of week 01.[/td][/tr]
+ [tr][td][b]y[/b][/td][td]The year as a decimal number without a century (range 00 to 99).[/td][/tr]
+ [tr][td][b]Y[/b][/td][td]The year as a decimal number including the century.[/td][/tr]
+ [tr][td][b]z[/b][/td][td]The time-zone as hour offset from GMT. Required to emit RFC822-compliant dates (using [i]a, d b Y H:M:S z[/i]).[/td][/tr]
+ [tr][td][b]Z[/b][/td][td]The time zone or name or abbreviation (not implemented yet).[/td][/tr]
[/table]
@examples:
[example]
@@ -934,8 +899,8 @@ namespace KviKvsCoreFunctions
[/example]
@seealso:
[fnc]$unixtime[/fnc], [fnc]$hptimestamp[/fnc]
- @author:
- Kai Wasserbäch <debian@carbon-project.org>
+ @author:
+ Kai Wasserbäch <debian@carbon-project.org>
*/
KVSCF(date)
@@ -951,7 +916,7 @@ namespace KviKvsCoreFunctions
// derived from KDateTime (not a copy, but the structure is similar,
// which isn't surprising), but limited/extended to the required set of
// functionality.
- // The reason for this is platform independency.
+ // The reason for this is platform independent.
QDateTime qDt;
QString szFmtTime;
int iLength, iVal, iTemp, iLocalTzH, iLocalTzM, iUtcH, iUtcM, iTzOffset;
@@ -1154,8 +1119,6 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
/*
@doc: escape
@type:
@@ -1167,8 +1130,8 @@ namespace KviKvsCoreFunctions
@syntax:
<string> $escape(<text:string>)
@description:
- In KVS some characters in a string have special meanings: % marks the start of a variable name, $ the start of a function name, etc..[br]
- Sometimes you could need to escape them using a \ character to avoid KVIrc from interpreting the special meaning of these characters:
+ In KVS some characters in a string have special meanings: [b]%[/b] marks the start of a variable name, [b]$[/b] the start of a function name, etc..[br]
+ Sometimes you could need to escape them using a [b]\[/b] character to avoid KVIrc from interpreting the special meaning of these characters:
this function will to the dirty job for you, returning a correctly kvs-escaped version of the string passed as a parameter.[br]
@seealso:
[cmd]eval[/cmd]
@@ -1188,8 +1151,6 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
/*
@doc: false
@type:
@@ -1202,11 +1163,11 @@ namespace KviKvsCoreFunctions
<boolean> $false
@description:
Evaluates to the false boolean constant. False
- is equivalent to the integer 0 too. This function/constant
+ is equivalent to the integer [b]0[/b] too. This function/constant
is useful to keep your code readable: when you
have a variable that can assume boolean values it's
nicer to use [fnc]$true[/fnc] and $false instead of
- the integer constants 1 and 0. The reader will
+ the integer constants [b]1[/b] and [b]0[/b]. The reader will
understand immediately that the variable simply can't
assume any other value.
@examples:
@@ -1228,8 +1189,6 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
/*
@doc: features
@type:
@@ -1249,14 +1208,14 @@ namespace KviKvsCoreFunctions
The form with the [test_feature] parameter returns true if and only if [test_feature] is available.[br]
@examples:
[example]
- %myfeats[] = $features
- [cmd]echo[/cmd] %myfeats[]
- %i = %myfeats[]#
- [cmd]while[/cmd](%i > 0)
- {
- [cmd]echo[/cmd] "Supporting feature %myfeats[%i]"
- %i--;
- }
+ %myfeats[] = $features
+ [cmd]echo[/cmd] %myfeats[]
+ %i = %myfeats[]#
+ [cmd]while[/cmd](%i > 0)
+ {
+ [cmd]echo[/cmd] "Supporting feature %myfeats[%i]"
+ %i--;
+ }
[/example]
Nearly the same loop, just really shorter:
[example]
@@ -1265,11 +1224,11 @@ namespace KviKvsCoreFunctions
[/example]
You can test for a specific feature in the following way:
[example]
- [cmd]if[/cmd]($features("SSL"))[cmd]echo[/cmd] "Yes! SSL is available";
+ [cmd]if[/cmd]($features("SSL"))[cmd]echo[/cmd] "Yes! SSL is available";
[/example]
- If used in "non-array" context it returns just a comma separated list of entries:[br]
+ If used in [i]non-array[/i] context it returns just a comma separated list of entries:[br]
[example]
- [cmd]echo[/cmd] $features
+ [cmd]echo[/cmd] $features
[/example]
@seealso:
[fnc]$version[/fnc]
@@ -1374,8 +1333,6 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
/*
@doc: firstconnectedconsole
@type:
@@ -1402,8 +1359,6 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
/*
@doc: flatten
@type:
@@ -1416,7 +1371,7 @@ namespace KviKvsCoreFunctions
<array> $flatten(<data1:variant>[,<data2:variant>[,...]])
@description:
Returns an array of items built from the passed arguments
- with the following rules:[br]
+ with the following rules:
[ul]
[li]If an argument is a scalar value then the argument itself is appended to the result.[/li]
[li]If an argument is an array then each contained item is appended to the result.[/li]
@@ -1476,8 +1431,6 @@ namespace KviKvsCoreFunctions
return true;
}
- /////////////////////////////////////////////////////////////////////////////////////////////
-
/*
@doc: fmtlink
@type:
diff --git a/src/kvirc/kvs/KviKvsCoreFunctions_gl.cpp b/src/kvirc/kvs/KviKvsCoreFunctions_gl.cpp
index 1fd7c24cc..f46cd15fa 100644
--- a/src/kvirc/kvs/KviKvsCoreFunctions_gl.cpp
+++ b/src/kvirc/kvs/KviKvsCoreFunctions_gl.cpp
@@ -48,38 +48,38 @@ namespace KviKvsCoreFunctions
/////////////////////////////////////////////////////////////////////////////////////////
-/*
- @doc: gender
- @type:
+ /*
+ @doc: gender
+ @type:
function
- @title:
- $gender
- @short:
- Returns the gender of the specified user
- @syntax:
- <string> $gender(<nickname:string>)
- @description:
- Returns the gender, or 'unknown' if not setted from remote user, of the specified IRC user IF it is known.[br]
- The gender is known if [fnc]$isWellKnown[/fnc] returns 1.[br]
- The gender is generally known if the user is on a channel with you
- or has an open query with you.[br]
- Detailed explanation:[br]
- KVIrc has an internal database of users that are currently
- visible by *this client*: this includes users on open channels
- and queries.[br] The other IRC users are [b]not[/b] in the database:
- this means that KVIrc knows [b]nothing[/b] about them and can't return
- any information immediately. In this case this function will return
- an EMPTY string.[br]
- If a user is in the database, at least his nickname is known.[br]
- The username and hostname are known only if the server provides that information
- spontaneously or after a KVIrc request.[br]
- KVIrc requests user information for all the users in open queries
- and channels. This information takes some time to be retrieved,
- in this interval of time KVIrc knows only the user's nickname.
- This function will return the string "*" in this case.[br]
- @seealso:
- [fnc]$isWellKnown[/fnc], [fnc]$hostname[/fnc], [fnc]$realname[/fnc], [cmd]$username[/cmd]
-*/
+ @title:
+ $gender
+ @short:
+ Returns the gender of the specified user
+ @syntax:
+ <string> $gender(<nickname:string>)
+ @description:
+ Returns the gender, or 'unknown' if not setted from remote user, of the specified IRC user IF it is known.[br]
+ The gender is known if [fnc]$isWellKnown[/fnc] returns 1.[br]
+ The gender is generally known if the user is on a channel with you
+ or has an open query with you.[br]
+ Detailed explanation:[br]
+ KVIrc has an internal database of users that are currently
+ visible by *this client*: this includes users on open channels
+ and queries.[br] The other IRC users are [b]not[/b] in the database:
+ this means that KVIrc knows [b]nothing[/b] about them and can't return
+ any information immediately. In this case this function will return
+ an EMPTY string.[br]
+ If a user is in the database, at least his nickname is known.[br]
+ The username and hostname are known only if the server provides that information
+ spontaneously or after a KVIrc request.[br]
+ KVIrc requests user information for all the users in open queries
+ and channels. This information takes some time to be retrieved,
+ in this interval of time KVIrc knows only the user's nickname.
+ This function will return the string [b]*[/b] in this case.[br]
+ @seealso:
+ [fnc]$isWellKnown[/fnc], [fnc]$hostname[/fnc], [fnc]$realname[/fnc], [cmd]$username[/cmd]
+ */
KVSCF(gender)
{
@@ -110,7 +110,7 @@ KVSCF(gender)
return true;
}
- /*
+/*
@doc: globals
@type:
function
@@ -123,7 +123,9 @@ KVSCF(gender)
@description:
Returns an hashtable of all global variables set.
@examples:
- echo $globals()
+ [example]
+ echo $globals()
+ [example]
@seealso:
[cmd]global[/cmd]
[fnc]$hash[/fnc]
@@ -251,7 +253,7 @@ KVSCF(gender)
KVIrc requests user information for all the users in open queries
and channels. This information takes some time to be retrieved,
in this interval of time KVIrc knows only the user's nickname.
- This function will return the string "*" in this case.[br]
+ This function will return the string [b]*[/b] in this case.[br]
@seealso:
[fnc]$isWellKnown[/fnc], [fnc]$username[/fnc], [cmd]awhois[/cmd]
*/
@@ -281,17 +283,17 @@ KVSCF(gender)
}
/*
- @doc: lag
- @type:
+ @doc: lag
+ @type:
function
- @title:
+ @title:
$lag
- @short:
- Returns the lag on the current server
- @syntax:
- <integer> $lag
- @description:
- This function returns the lag in the current server, in milliseconds.[br]
+ @short:
+ Returns the lag on the current server
+ @syntax:
+ <integer> $lag
+ @description:
+ This function returns the lag in the current server, in milliseconds.[br]
*/
KVSCF(lag)
@@ -324,7 +326,7 @@ KVSCF(gender)
Returns a high precision timestamp as a floating point value.
The timestamp represents the number of seconds elapsed since
a certain moment in the past. The number of seconds
- contains a "high precision" fractional part. The "certain moment" definition
+ contains a [i]high precision[/i] fractional part. The [i]certain moment[/i] definition
depends on the platform KVIrc is executed. This means that
this timestamp is totally useless to represent a time value
but is useful to compute time intervals with sub-second precision.
@@ -528,11 +530,11 @@ KVSCF(gender)
@title:
$isbot
@short:
- Returns 1 if the user is a bot. Otherwise return 0.
+ Returns [b]1[/b] if the user is a bot. Otherwise return 0.
@syntax:
<string> $isbot(<nickname:string>)
@description:
- Returns 1 if the user is a bot. Otherwise return 0.[br]
+ Returns [b]1[/b] if the user is a bot. Otherwise return 0.[br]
This info is known if [fnc]$isWellKnown[/fnc] returns 1.[br]
This info is generally known if the user is on a channel with you
or has an open query with you.[br]
@@ -549,7 +551,7 @@ KVSCF(gender)
KVIrc requests user information for all the users in open queries
and channels. This information takes some time to be retrieved,
in this interval of time KVIrc knows only the user's nickname.
- This function will return the string "*" in this case.[br]
+ This function will return the string [b]*[/b] in this case.[br]
@seealso:
[fnc]$isWellKnown[/fnc], [fnc]$hostname[/fnc], [fnc]$realname[/fnc], [cmd]$username[/cmd]
*/
@@ -666,7 +668,7 @@ KVSCF(gender)
@syntax:
<boolean> $isEventEnabled(<event_name:string>,<handler_name:string>)
@description:
- Returns 1 if the event handler is enabled.
+ Returns [b]1[/b] if the event handler is enabled.
*/
KVSCF(isEventEnabled)
@@ -719,7 +721,7 @@ KVSCF(gender)
@short:
Finds whether a variable contains a representation of a number
@description:
- Returns 1 if the <data> is an integer or a real number, 0 otherwise.
+ Returns [b]1[/b] if the <data> is an integer or a real number, and [b]0[/b] otherwise.
*/
KVSCF(isNumeric)
@@ -746,11 +748,11 @@ KVSCF(gender)
<boolean> $isSet(<data:variant>)
@description:
Returns 1 if <data> is actually set to some non-empty value
- and 0 otherwise. If <data> is a variable, then this function
+ and [b]0[/b] otherwise. If <data> is a variable, then this function
simply checks if the variable is set. If <data> is a constant
then this function checks if the constant is non empty.
- Since KVIrc treats empty strings as "unset" values then
- this function could be also called "isNonEmpty" and it is
+ Since KVIrc treats empty strings as [i]unset[/i] values then
+ this function could be also called [i]isNonEmpty[/i] and it is
the perfect opposite of [fnc]$isEmpty[/fnc]
@seealso:
[fnc]$isEmpty[/fnc], [cmd]unset[/cmd]
@@ -778,7 +780,7 @@ KVSCF(gender)
@syntax:
<boolean> $istimer(<name:string>)
@description:
- Returns 1 if the timer named <name> is actually running, 0 otherwise.
+ Returns [b]1[/b] if the timer named <name> is actually running, and [b]0[/b] otherwise.
@seealso:
[cmd]timer[/cmd], [cmd]killtimer[/cmd]
*/
@@ -933,9 +935,9 @@ KVSCF(gender)
@description:
Returns the short name of currently used language.[br]
Type <type> should be one of: [br]
- "full" - returns full locale name, such as ru_RU.UTF-8 (default).[br]
- "lang" - return language name, such as "ru_RU".[br]
- "short" - returns only language group such as "ru".[br]
+ [i]full[/i] - returns full locale name, such as ru_RU.UTF-8 (default).[br]
+ [i]lang[/i] - return language name, such as ru_RU.[br]
+ [i]short[/i] - returns only language group such as ru.[br]
*/
KVSCF(lang)
diff --git a/src/kvirc/kvs/KviKvsCoreFunctions_mr.cpp b/src/kvirc/kvs/KviKvsCoreFunctions_mr.cpp
index 1a1b945bb..4ad236f2a 100644
--- a/src/kvirc/kvs/KviKvsCoreFunctions_mr.cpp
+++ b/src/kvirc/kvs/KviKvsCoreFunctions_mr.cpp
@@ -62,33 +62,33 @@ namespace KviKvsCoreFunctions
If the <nickname> is not given it is assumed to be the current nickname.[br]
If <mask_type> is not given or is invalid, it is assumed to be 0.[br]
Available mask types:[br]
- 0 : nick!user@machine.host.top (nick!user@XXX.XXX.XXX.XXX) (default)[br]
- 1 : nick!user@*.abc.host.top (nick!user@XXX.XXX.XXX.*)[br]
+ 0 : nick!user@machine.host.top [b](nick!user@XXX.XXX.XXX.XXX) (default)[/b][br]
+ 1 : nick!user@*.abc.host.top [b](nick!user@XXX.XXX.XXX.*)[/b][br]
2 : nick!user@*[br]
- 3 : nick!*@machine.host.top (nick!user@XXX.XXX.XXX.XXX)[br]
- 4 : nick!*@*.abc.host.top (nick!user@XXX.XXX.XXX.*)[br]
+ 3 : nick!*@machine.host.top [b](nick!user@XXX.XXX.XXX.XXX)[/b][br]
+ 4 : nick!*@*.abc.host.top [b](nick!user@XXX.XXX.XXX.*)[/b][br]
5 : nick!*@*[br]
- 6 : *!user@machine.host.top (*!user@XXX.XXX.XXX.XX)[br]
- 7 : *!user@*.abc.host.top (*!user@XXX.XXX.XXX.*)[br]
+ 6 : *!user@machine.host.top [b](*!user@XXX.XXX.XXX.XX)[/b][br]
+ 7 : *!user@*.abc.host.top [b](*!user@XXX.XXX.XXX.*)[/b][br]
8 : *!user@*[br]
- 9 : *!*@machine.host.top (*!*@XXX.XXX.XXX.XXX)[br]
- 10: *!*@*.abc.host.top (*!*@XXX.XXX.XXX.*)[br]
- 11: nick!*user@machine.host.top (nick!*user@XXX.XXX.XXX.XXX)[br]
- 12: nick!*user@*.abc.host.top (nick!*user@XXX.XXX.XXX.*)[br]
+ 9 : *!*@machine.host.top [b](*!*@XXX.XXX.XXX.XXX)[/b][br]
+ 10: *!*@*.abc.host.top [b](*!*@XXX.XXX.XXX.*)[/b][br]
+ 11: nick!*user@machine.host.top [b](nick!*user@XXX.XXX.XXX.XXX)[/b][br]
+ 12: nick!*user@*.abc.host.top [b](nick!*user@XXX.XXX.XXX.*)[/b][br]
13: nick!*user@*[br]
- 14: *!*user@machine.host.top (*!*user@XXX.XXX.XXX.XXX)[br]
- 15: *!*user@*.abc.host.top (*!*user@XXX.XXX.XXX.*)[br]
+ 14: *!*user@machine.host.top [b](*!*user@XXX.XXX.XXX.XXX)[/b][br]
+ 15: *!*user@*.abc.host.top [b](*!*user@XXX.XXX.XXX.*)[/b][br]
16: *!*user@*[br]
- 17: nick!~user@*.host.top (nick!~user@XXX.XXX.*)[br]
- 18: nick!*@*.host.top (nick!*@XXX.XXX.*)[br]
- 19: *!~user@*.host.top (*!~user@XXX.XXX.*)[br]
- 20: nick!*user@*.host.top (nick!*user@XXX.XXX.*)[br]
- 21: *!*user@*.host.top (*!user@*XXX.XXX.*)[br]
- 22: nick!~user@*.host.top (nick!~user@XXX.XXX.*)[br]
- 23: nick!*@*.host.top (nick!*@XXX.XXX.*)[br]
- 24: *!~user@*.host.top (*!~user@XXX.XXX.*)[br]
- 25: nick!*user@*.host.top (nick!*user@XXX.XXX.*)[br]
- 26: *!*user@*.host.top (*!user@*XXX.XXX.*)[br]
+ 17: nick!~user@*.host.top [b](nick!~user@XXX.XXX.*)[/b][br]
+ 18: nick!*@*.host.top [b](nick!*@XXX.XXX.*)[/b][br]
+ 19: *!~user@*.host.top [b](*!~user@XXX.XXX.*)[/b][br]
+ 20: nick!*user@*.host.top [b](nick!*user@XXX.XXX.*)[/b][br]
+ 21: *!*user@*.host.top [b](*!user@*XXX.XXX.*)[/b][br]
+ 22: nick!~user@*.host.top [b](nick!~user@XXX.XXX.*)[/b][br]
+ 23: nick!*@*.host.top [b](nick!*@XXX.XXX.*)[/b][br]
+ 24: *!~user@*.host.top [b](*!~user@XXX.XXX.*)[/b][br]
+ 25: nick!*user@*.host.top [b](nick!*user@XXX.XXX.*)[/b][br]
+ 26: *!*user@*.host.top [b](*!user@*XXX.XXX.*)[/b][br]
If some data is missing, these types may change:[br]
For example, if the hostname is missing, the mask type 3 or 4 may be reduced to type 5.[br]
If the user with <nickname> is not found in the current IRC context user database,
@@ -463,7 +463,7 @@ namespace KviKvsCoreFunctions
If no <irc context id> is specified, this function looks for
the query in the current connection context (if any).[br]
If no <target> is specified, this function returns the current
- query window ID, if executed in a query, else 0.[br]
+ query window ID, if executed in a query, and [b]0[/b] otherwise.[br]
@examples:
[example]
[/example]
@@ -595,7 +595,7 @@ namespace KviKvsCoreFunctions
@syntax:
<real> $real(<data:variant>)
@description:
- Forces <data> to be a "real" data type with the following
+ Forces <data> to be a [i]real[/i] data type with the following
semantics:[br]
[ul]
[li]If <data> is a real, <data> itself is returned.[/li]
@@ -659,7 +659,7 @@ namespace KviKvsCoreFunctions
KVIrc requests user information for all the users in open queries
and channels. This information takes some time to be retrieved,
in this interval of time KVIrc knows only the user's nickname.
- This function will return the string "*" in this case.[br]
+ This function will return the string [b]*[/b] in this case.[br]
@seealso:
[fnc]$isWellKnown[/fnc], [fnc]$hostname[/fnc], [fnc]$username[/fnc], [cmd]awhois[/cmd]
*/
diff --git a/src/kvirc/kvs/KviKvsCoreFunctions_sz.cpp b/src/kvirc/kvs/KviKvsCoreFunctions_sz.cpp
index 25c1f0efe..525af23e5 100644
--- a/src/kvirc/kvs/KviKvsCoreFunctions_sz.cpp
+++ b/src/kvirc/kvs/KviKvsCoreFunctions_sz.cpp
@@ -70,19 +70,19 @@ namespace KviKvsCoreFunctions
{
/*
- @doc: scriptContextName
- @type:
- function
- @title:
- $scriptContextName
- @short:
- Returns the actual script context's name..
- @syntax:
- <string> $scriptContextName()
- @description:
- Returns the actual script context's name. Useful only for custom debug.
- @seealso:
- [cmd]debug[/cmd]
+ @doc: scriptContextName
+ @type:
+ function
+ @title:
+ $scriptContextName
+ @short:
+ Returns the actual script context's name..
+ @syntax:
+ <string> $scriptContextName()
+ @description:
+ Returns the actual script context's name. Useful only for custom debug.
+ @seealso:
+ [cmd]debug[/cmd]
*/
KVSCF(scriptContextName)
@@ -281,7 +281,7 @@ namespace KviKvsCoreFunctions
[li]If <data> is a string then <data> itself is returned.[/li]
[li]If <data> is an integer then its decimal representation is returned.[/li]
[li]If <data> is a real then its decimal floating-point representation is returned.[/li]
- [li]If <data> is a boolean then the string "1" is returned for a true value and the string "0" for a false value.[/li]
+ [li]If <data> is a boolean then the string [b]1[/b] is returned for a true value and the string [b]0[/b] for a false value.[/li]
[li]If <data> is nothing (unset) then an empty string is returned[/li]
[li]If <data> is an array then a string with all the items converted to strings and separated by commas is returned[/li]
[li]If <data> is a hash then a string with all the values converted to strings and separated by commas is returned[/li]
@@ -327,7 +327,7 @@ namespace KviKvsCoreFunctions
If the switch was not present at all then this function
returns an empty string (that evaluates to false in an expression).
A warning is printed if this function is used non-alias code.
- @seealso:
+ @seealso:
[fnc]$insideAlias[/fnc]
@examples:
[example]
@@ -457,8 +457,8 @@ namespace KviKvsCoreFunctions
@syntax:
$this
@description:
- Returns the ID of the current object or ('0') if there is
- none. This function has a "quick" version with syntax:
+ Returns the ID of the current object or (0) if there is
+ none. This function has a [i]quick[/i] version with syntax:
[b]$$[/b][br]
*/
@@ -473,7 +473,7 @@ namespace KviKvsCoreFunctions
@syntax:
$$
@description:
- Returns the ID of the current object or ('0') if there is
+ Returns the ID of the current object or (0) if there is
none. This function is equivalent to [fnc]$this[/fnc]
*/
@@ -496,126 +496,109 @@ namespace KviKvsCoreFunctions
@short:
Explains how to add translation capabilities to your scripts
@body:
- [p]
[big]Introduction[/big]
- [/p]
- [p]
Adding the translated versions of the strings adds a great
value to your scripts. The process of translating a part of
software is called localization. KVIrc offers some commands
and functions for this purpose and this document explains
briefly how to use them.
- [/p]
-
- [p]
+ [br]
[big]The big picture[/big]
- [/p]
- [p]
- All of the strings in your script are written in a "primary language".
- The most common "primary language" is English, but theoretically
+ [br]
+ All of the strings in your script are written in a [i]primary language[/i].
+ The most common [i]primary language[/i] is English, but theoretically
it can be any language of your choice.
- [/p]
- [p]
+ [br]
By the means of the gettext package programs you extract
the strings from your script and produce a translation file.
- [/p]
- [p]
+ [br]
The translation file is then effectively translated in another
language and later compiled in a binary form.
- [/p]
- [p]
+ [br]
The binary form translations are then loaded in the KVIrc
executable at runtime and a function is used to look up the
translations.
- [/p]
-
- [p]
+ [br][br]
[big]How to translate scripts[/big]
- [/p]
- [p]
+ [br]
Your strings should be surrounded by the [fnc]$tr[/fnc]() function in the following way:
[example]
[fnc]$tr[/fnc]("your default language text")
[/example]
- [/p]
- [p]
+ [br]
Then you should run the xgettext command on your script files.
This is done by a shell commandline similar to the following:[br]
- [pre]xgettext -o myscript.pot -ktr mykvsfile1.kvs mykvsfile2.kvs ...[/pre]
- [/p]
- [p]
+ [example]
+ xgettext -o myscript.pot -ktr mykvsfile1.kvs mykvsfile2.kvs ...
+ [/example]
+ [br]
Copy the translation file obtained in the following way:[br]
- [pre]cp myscript.pot myscript_XX.pot[/pre]
+ [example]
+ cp myscript.pot myscript_XX.pot
+ [/example][br]
Where the XX is your country/language code. For example, for Italian
it would be:[br]
- [pre]cp myscript.pot myscript_it.po[/pre]
- [/p]
- [p]
+ [example]
+ cp myscript.pot myscript_it.po
+ [/example]
+ [br]
Translate mytranslation_it.po. The format of the po file is straightforward.
There are msgid lines with the original English text and immediately
following msgstr lines that must be filled with the corresponding translation.
For example in Italian you would translate:[br]
msgid "your default language text"
msgstr "il tuo testo in linguaggio predefinito"
- [/p]
- [p]
+ [br]
Compile your translation to binary form with the following command:[br]
- [pre]msgfmt -o myscript_it.mo myscript_it.po[/pre]
- [/p]
- [p]
- Copy the generated *.mo file to the "locale" subdirectory
+ [example]
+ msgfmt -o myscript_it.mo myscript_it.po
+ [/example][br]
+ Copy the generated *.mo file to the [i]locale[/i] subdirectory
in the KVIrc's local directory (usually $HOME/.kvirc/locale/).
- [/p]
- [p]
+ [br]
Set the system language to the XX above with the following command:[br]
- [pre]export LANG="XX"[/pre][br]
+ [example]
+ export LANG="XX"
+ [/example][br]
For Italian it would be:[br]
- [pre]export LANG="it"[/pre][br]
- [/p]
- [p]
+ [example]export LANG="it"[/example][br]
+ [br]
Start KVIrc and type in the commandline:
[example]
- [cmd]echo[/cmd] [fnc]$tr[/fnc]("your default language text","myscript")
+ [cmd]echo[/cmd] [fnc]$tr[/fnc]("your default language text","myscript")
[/example]
If you did everything well, you should see the translated
text echoed in the window :)[br]
- [/p]
- [p]
+ [br]
Obviously if you don't set LANG="XX", the same command will
output the original string unchanged.
- [/p]
- [p]
+ [br]
You can manage translations in several languages by producing
several *.mo files all with the proper language/country code appended.
The right *.mo file will be magically loaded by KVIrc that
will look up the user's LANG variable. (If you don't want
to use LANG, you can use KVIRC_LANG instead, it will still work).
- [/p]
-
+ [br][br]
[big]Caveats[/big]
- [/p]
- [p]
- You should NEVER use variables or identifiers inside the $tr() function.
+ [br]
+ You should [b]never[/b] use variables or identifiers inside the $tr() function.
This because the translation files are generated offline,
when the string is not evaluated yet (i.e variables ad identifiers
are not substituted by their actual return values).
The translation process, instead, happens at runtime, when
the variables and identifiers have been substituted by their
actual values. This would lead to a mismatch between the
- string you look up in the translation catalogue and the
+ string you look up in the translation catalog and the
effectively translated one. If you need to include variables
in your strings you should compose the string with smaller pieces
[example]
[cmd]echo[/cmd] [fnc]$tr[/fnc]("On this channel") %number [fnc]$tr[/fnc]("users are operators")
[/example]
- [/p]
- [p]
The translation process can be realized only if your
scripts are written in external files. This makes sense since
if you're translating the script then you will probably want to
distribute it and the only way to distribute it is on files.
But well.. this is a caveat.
- [/p]
*/
/*
@@ -971,7 +954,7 @@ namespace KviKvsCoreFunctions
or has an open query with you.[br]
Detailed explanation:[br]
KVIrc has an internal database of users that are currently
- visible by *this client*: this includes users on open channels
+ visible by [i][b]this client[/b][/i]: this includes users on open channels
and queries.[br] The other IRC users are [b]not[/b] in the database:
this means that KVIrc knows NOTHING about them and can't return
any information immediately. In this case this function will return
diff --git a/src/kvirc/kvs/KviKvsCoreSimpleCommands_af.cpp b/src/kvirc/kvs/KviKvsCoreSimpleCommands_af.cpp
index 33588f294..3218864e3 100644
--- a/src/kvirc/kvs/KviKvsCoreSimpleCommands_af.cpp
+++ b/src/kvirc/kvs/KviKvsCoreSimpleCommands_af.cpp
@@ -105,11 +105,11 @@ namespace KviKvsCoreSimpleCommands
This command is [doc:connection_dependent_commands]connection dependent[/doc].[br]
If no away reason is specified, the behaviour of this command depends from the value
of the option boolUseAwayMessage: if enabled, user will be set away using the default
- away message (or "Away from keyboard" if no default away message is set);
+ away message (or [i]Away from keyboard[/i] if no default away message is set);
otherwise, the user will return from a previous away state.
@examples:
[example]
- away I'm asleep. Don't wake me up.
+ away I'm asleep. Don't wake me up.
[/example]
*/
@@ -414,14 +414,14 @@ namespace KviKvsCoreSimpleCommands
Changes an existing user defined button.[br]
<type_unused> is ignored and present only for backward compatibility.[br]
<name> is the name of the button.[br]
- <operation> may be one of the constant strings "enable", "disable", "image",
- "text".[br]
- Operations "enable" and "disable" do not require the fourth [parameter] and have
- the obvious meaning.[br] Operation "image" requires the [parameter] to be
+ <operation> may be one of the constant strings [i]enable[/i], [i]disable[/i], [i]image[/i],
+ [i]text"[/i].[br]
+ Operations [i]enable[/i] and [i]disable[/i] do not require the fourth [parameter] and have
+ the obvious meaning.[br] Operation [i]image[/i] requires the [parameter] to be
a valid [doc:image_id]image_id[/doc] and sets the button image.[br]
- Operation "text" requires the [parameter] (and in fact all the following ones)
+ Operation [i]text[/i] requires the [parameter] (and in fact all the following ones)
to be a string containing the button text label.[br]
- The <operation> constants may be abbreviated, even to the single letters 'e','d','i' and 't'.[br]
+ The <operation> constants may be abbreviated, even to the single letters [b]e[/b], [b]d[/b], [b]i[/b] and [b]t[/b].[br]
The -q switch causes the command to be quiet about errors and warnings.[br]
@seealso:
[cmd]button[/cmd]
@@ -650,7 +650,7 @@ namespace KviKvsCoreSimpleCommands
For more info take a look at the [doc:ctcp_handling]CTCP protocol implementation notes[/doc].[br]
The CTCP message will be a request (sent through a PRIVMSG) unless the -n switch
specified: in that case it will be a reply (sent through a NOTICE).[br]
- If <ctcp_data> is the single string "ping" then a trailing time string argument
+ If <ctcp_data> is the single string [i]ping[/i] then a trailing time string argument
is added in order to determine the round trip time when the ping reply comes back.
To override this behaviour simply specify your own time string parameter.[br]
This command is [doc:connection_dependent_commands]connection dependent[/doc].[br]
@@ -1099,7 +1099,7 @@ namespace KviKvsCoreSimpleCommands
icon scheme (icon and colors), otherwise it uses
the default one (0).[br]
If the -d switch is used then the output is sent to a special
- window called "Debug" (the window is created if not existing yet).
+ window called [i]Debug[/i] (the window is created if not existing yet).
This is useful for script debugging purposes (you get the output
in Debug regardless of the window that the executed command is attached to).
The KVIrc view widgets support clickable links that can be realized by using special [doc:escape_sequences]escape sequences[/doc].[br]
@@ -1380,8 +1380,8 @@ namespace KviKvsCoreSimpleCommands
sanitize it by using [fnc]$escape[/fnc]() in order to avoid command injection.[/b]
Note that nicknames, usernames, hostnames, channel names and any kind of text that
isn't generated under your control may contain malicious code. For instance, if you
- try to eval the string built by concatenating "echo" and the result of [fnc]$channel.name[/fnc]
- inside a channel named "#test;quit" (yes, that's a valid channel name) you'll obtain
+ try to eval the string built by concatenating [i]echo[/i] and the result of [fnc]$channel.name[/fnc]
+ inside a channel named [i]#test;quit[/i] (yes, that's a valid channel name) you'll obtain
a disconnection as a side effect. To avoid this you need to use [fnc]$escape[/fnc]() around
[fnc]$chan.name[/fnc].
@examples:
diff --git a/src/kvirc/kvs/KviKvsCoreSimpleCommands_gl.cpp b/src/kvirc/kvs/KviKvsCoreSimpleCommands_gl.cpp
index b42547777..8b7902aa1 100644
--- a/src/kvirc/kvs/KviKvsCoreSimpleCommands_gl.cpp
+++ b/src/kvirc/kvs/KviKvsCoreSimpleCommands_gl.cpp
@@ -117,10 +117,10 @@ namespace KviKvsCoreSimpleCommands
If no document has been found using absolute and relative paths,
the first document matching [document] in the help search database
is shown. Otherwise, an error page is displayed.[br/]
- The help browser has limited html browsing capabilities: you can
- use it to view simple html files on your filesystem.[br]
+ The help browser has limited HTML browsing capabilities: you can
+ use it to view simple HTML files on your filesystem.[br]
This command is an alias for the [cmd]help.open[/cmd] command exported
- by the "help" module.
+ by the [i]help[/i] module.
@switches:
!sw: -m | --mdi
The created browser is a MDI window,
@@ -132,11 +132,11 @@ namespace KviKvsCoreSimpleCommands
[cmd]help.open[/cmd]
@examples:
[example]
- help /home/pragma/myfile.html //absolute path
- help cmd_snd.play.html //relative path
- help "Binding operator" //keyword search, remember quoting
- help OnNickServAuth //keyword search for an event
- help \$my.user //keyword search, $ needs to be escaped
+ help /home/pragma/myfile.html //absolute path
+ help cmd_snd.play.html //relative path
+ help "Binding operator" //keyword search, remember quoting
+ help OnNickServAuth //keyword search for an event
+ help \$my.user //keyword search, $ needs to be escaped
[/example]
*/
@@ -184,18 +184,18 @@ namespace KviKvsCoreSimpleCommands
the results in the current window.[br]
The -i switch causes the command to execute
in IPv6 mode (and lookup ONLY IPv6 hosts!).[br]
- The -a switch causes the command to run in "unspecified" mode
+ The -a switch causes the command to run in [i]unspecified[/i] mode
and return any available address: IPv4 or IPv6.[br]
This command also performs reverse lookups (if you pass an IP address as <hostname>).[br]
@examples:
[example]
- host localhost
- host irc.flashnet.it
- host -i irc.flashnet.it
- host -i A0E0:FFFF:::1010:1111:E0E0:A0A0
- host -a 127.0.0.1
- host 255.41.31.23
- host -a irc.stealth.net
+ host localhost
+ host irc.flashnet.it
+ host -i irc.flashnet.it
+ host -i A0E0:FFFF:::1010:1111:E0E0:A0A0
+ host -a 127.0.0.1
+ host 255.41.31.23
+ host -a irc.stealth.net
[/example]
@seealso:
[cmd]ahost[/cmd]
@@ -233,7 +233,7 @@ namespace KviKvsCoreSimpleCommands
@short:
A builtin alias for parse
@description:
- This is a builtin alias for [cmd]parse[/cmd] that gives scripts a "more C-ish" look :)
+ This is a builtin alias for [cmd]parse[/cmd] that gives scripts a [i]more C-ish[/i] look :)
@seealso:
[cmd]parse[/cmd]
*/
@@ -607,7 +607,7 @@ namespace KviKvsCoreSimpleCommands
@title:
list
@syntax:
- list [ <channel> *( "," <channel> ) [ <target> ] ]
+ list [ <channel> *( ',' <channel> ) [ <target> ] ]
@short:
Lists channels
@description:
diff --git a/src/kvirc/kvs/KviKvsCoreSimpleCommands_mr.cpp b/src/kvirc/kvs/KviKvsCoreSimpleCommands_mr.cpp
index ba968938b..b6714b240 100644
--- a/src/kvirc/kvs/KviKvsCoreSimpleCommands_mr.cpp
+++ b/src/kvirc/kvs/KviKvsCoreSimpleCommands_mr.cpp
@@ -232,7 +232,7 @@ namespace KviKvsCoreSimpleCommands
This command is [doc:connection_dependent_commands]connection dependent[/doc].[br]
@examples:
[example]
- nick Pragma
+ nick Pragma
[/example]
*/
@@ -279,9 +279,9 @@ namespace KviKvsCoreSimpleCommands
This command is [doc:connection_dependent_commands]connection dependent[/doc].[br]
@examples:
[example]
- notice Pragma Hello!
- notice Pragma,Crocodile Hello to you both!
- notice #kvirc Hello from outside!
+ notice Pragma Hello!
+ notice Pragma,Crocodile Hello to you both!
+ notice #kvirc Hello from outside!
[/example]
*/
@@ -333,7 +333,7 @@ namespace KviKvsCoreSimpleCommands
This command is [doc:connection_dependent_commands]connection dependent[/doc].
@examples:
[example]
- op Pragma,Crocodile
+ op Pragma,Crocodile
[/example]
@seealso:
[cmd]chanowner[/cmd], [cmd]dechanowner[/cmd], [cmd]chanadmin[/cmd], [cmd]dechanadmin[/cmd], [cmd]deop[/cmd], [cmd]halfop[/cmd], [cmd]dehalfop[/cmd], [cmd]voice[/cmd], [cmd]devoice[/cmd], [cmd]userop[/cmd], [cmd]deuserop[/cmd]
@@ -361,7 +361,7 @@ namespace KviKvsCoreSimpleCommands
The handlers for the supported URL types are specified in the options dialog.[br]
Each handler is a KVIrc commandline that the URL will be passed to as the first parameter ($0).[br]
The supported URL types are:[br]
- [b]HTTP[/b]: http://&lt;url&gt; or sth that begins with "www." [br]
+ [b]HTTP[/b]: http://&lt;url&gt; or sth that begins with [b][i]www.[/b][/i][br]
[b]HTTPS[/b]: https://&lt;url&gt;[br]
[b]FILE[/b]: file://&lt;url&gt;[br]
[b]IRC[/b]: irc[s][6]://<server>[:<port>][/<channel>[?<pass>]] (Handled internally)[br]
@@ -519,13 +519,13 @@ namespace KviKvsCoreSimpleCommands
must be appropriate for the type of option that you're going to set.[br]
With no parameters this command lists all the available option names
sorted by option type.[br] The possible option types are:[br]
- [b]Boolean[/b]: <optValue> must be "1" or "0"[br]
+ [b]Boolean[/b]: <optValue> must be [b]1[/b] or [b]0[/b][br]
[b]String[/b]: <optValue> can be any string[br]
[b]StringList[/b]: <optValue> must be a comma separated list of strings (eventually empty)[br]
[b]Color[/b]: <optValue> must have the format #RRGGBB where R G and B are hex digits[br]
[b]Font[/b]: <optValue> is a comma separated list of font properties:
<family>,<pointsize>,<style>,<charset>,<weight>,<flags>. <family> is the font face name
- ("arial", "helvetica" etc..), <pointsize> is more or less the indicator of the size of the font
+ ([i]arial[/i], [i]helvetica[/i] etc.), <pointsize> is more or less the indicator of the size of the font
(try sth like 12,14), <style> is an integer that indicates the font style (fixed for example),
<charset> is an integer that indicates the charset of the font (maybe one day I'll document it better),
<weight> indicates the (em) weight of the font (50,100,150...matches Bold,DemiBold etc..),
@@ -629,8 +629,8 @@ namespace KviKvsCoreSimpleCommands
If <filename> is an existing directory name a file dialog
will pop up, allowing you to choose a file to parse.
The file dialog will start in the directory specified by <filename>.
- If you don't know the name of an existing directory, just pass "."
- or "/". The command just prints a warning if the file cannot be loaded for
+ If you don't know the name of an existing directory, just pass '.'
+ or '/'. The command just prints a warning if the file cannot be loaded for
some reason. If you want the command to stop with an error in
this case then use the -e switch.[br]
This command has a builtin alias called [cmd]include[/cmd].
@@ -641,7 +641,7 @@ namespace KviKvsCoreSimpleCommands
The reason for such a constraint is simple: KVIrc has no means
of knowing the encoding that one or other scripter uses to
edit his files. Unlike other languages (like HTML, for example)
- there is no "external" metadata that will allow for
+ there is no [i]external[/i] metadata that will allow for
encoding detection before the data is actually decoded.
UTF-8 is the right way (tm). Use it.
@examples:
@@ -768,8 +768,8 @@ namespace KviKvsCoreSimpleCommands
This command is equivalent to [cmd]leave[/cmd]
@examples:
[example]
- part #kvirc Byez!
- part #linux-it,#xmms,#kde Time to sleep
+ part #kvirc Byez!
+ part #linux-it,#xmms,#kde Time to sleep
[/example]
*/
@@ -962,9 +962,9 @@ namespace KviKvsCoreSimpleCommands
This command is equivalent to [cmd]msg[/cmd]
@examples:
[example]
- privmsg Pragma Hello!
- privmsg Pragma,Crocodile Hello to you both!
- privmsg #kvirc Hello from outside!
+ privmsg Pragma Hello!
+ privmsg Pragma,Crocodile Hello to you both!
+ privmsg #kvirc Hello from outside!
[/example]
*/
@@ -1033,10 +1033,10 @@ namespace KviKvsCoreSimpleCommands
If -i is not present but -m is used then the windows are always created as minimized.
@examples:
[example]
- [comment]# Open a single query to Pragma[/comment]
- query Pragma
- [comment]# Open a query to Pragma and to Crocodile, say "Hello!" in both windows[/comment]
- query Pragma,Crocodile Hello !
+ [comment]# Open a single query to Pragma[/comment]
+ query Pragma
+ [comment]# Open a query to Pragma and to Crocodile, say "Hello!" in both windows[/comment]
+ query Pragma,Crocodile Hello !
[/example]
*/
@@ -1121,11 +1121,11 @@ namespace KviKvsCoreSimpleCommands
Forcing the connection may cause your quit message to not be
displayed to the other IRC users: most likely it will be replaced
by a 'Connection reset by peer' or a 'EOF from client'.[br]
- If the -u switch is specified then an "unexpected disconnection" will be simulated
+ If the -u switch is specified then an [i]unexpected disconnection[/i] will be simulated
and all the related options will be applied (e.g. automatic reconnection,
- channels and queries kept open etc..). The QUIT message will be still sent unless
- the -f switch is used. You can control all the "unexpected
- disconnection" options in the options dialog.
+ channels and queries kept open etc.). The QUIT message will be still sent unless
+ the -f switch is used. You can control all the [i]unexpected disconnection[/i]
+ options in the options dialog.
If the -q switch is specified, this command terminates KVIrc immediately.[br]
@examples:
[example]
@@ -1222,10 +1222,10 @@ namespace KviKvsCoreSimpleCommands
This command is equivalent to [cmd]quote[/cmd].
@examples:
[example]
- [comment]# Send a private message "by hand"[/comment]
- raw PRIVMSG Pragma :hello!
- [comment]# Send a private message through another connection[/comment]
- raw -r=[fnc]$console[/fnc]([fnc]$ic[/fnc](irc.otherserver.com,othernick)) PRIVMSG Pragma :heya on this side!
+ [comment]# Send a private message "by hand"[/comment]
+ raw PRIVMSG Pragma :hello!
+ [comment]# Send a private message through another connection[/comment]
+ raw -r=[fnc]$console[/fnc]([fnc]$ic[/fnc](irc.otherserver.com,othernick)) PRIVMSG Pragma :heya on this side!
[/example]
*/
@@ -1272,16 +1272,18 @@ namespace KviKvsCoreSimpleCommands
-q causes the command to run quietly.[br]
[b]Handle with care.[/b]
@examples:
- [comment]# Try this example in a channel or query window[/comment][br]
- [comment]# Remember the current window ID[/comment][br]
- %winid = $window[br]
- [comment]# Rebind to the console of the current IRC context[/comment][br]
- rebind $console[br]
- echo "Hello from the console :)"[br]
- echo "Hello again.. still in the console"[br]
- [comment]# Rebind back[/comment][br]
- rebind %winid[br]
- echo "Again in this window :)"
+ [example]
+ [comment]# Try this example in a channel or query window[/comment][br]
+ [comment]# Remember the current window ID[/comment][br]
+ %winid = $window[br]
+ [comment]# Rebind to the console of the current IRC context[/comment][br]
+ rebind $console[br]
+ echo "Hello from the console :)"[br]
+ echo "Hello again.. still in the console"[br]
+ [comment]# Rebind back[/comment][br]
+ rebind %winid[br]
+ echo "Again in this window :)"
+ [/example]
*/
KVSCSC(rebind)
@@ -1320,7 +1322,9 @@ namespace KviKvsCoreSimpleCommands
Starting from version 3.0.0 of KVIrc you can also return
arrays and hashes just like any other variable types.
@examples:
- return $array(item1,item2,3213,itemX);
+ [example]
+ return $array(item1,item2,3213,itemX);
+ [/example]
@seealso:
[cmd]setreturn[/cmd], [cmd]break[/cmd], [cmd]halt[/cmd]
*/
@@ -1367,10 +1371,10 @@ namespace KviKvsCoreSimpleCommands
the shell by yourself (probably by passing the real command as the -c argument).
@examples:
[example]
- run xterm
- run xmessage -center *
- [comment]# note the difference in * processing[/comment]
- run /bin/bash -c "xmessage -center *"
+ run xterm
+ run xmessage -center *
+ [comment]# note the difference in * processing[/comment]
+ run /bin/bash -c "xmessage -center *"
[/example]
*/
diff --git a/src/kvirc/kvs/KviKvsCoreSimpleCommands_sz.cpp b/src/kvirc/kvs/KviKvsCoreSimpleCommands_sz.cpp
index 724687086..0afc850db 100644
--- a/src/kvirc/kvs/KviKvsCoreSimpleCommands_sz.cpp
+++ b/src/kvirc/kvs/KviKvsCoreSimpleCommands_sz.cpp
@@ -181,7 +181,7 @@ namespace KviKvsCoreSimpleCommands
The <server> is added to the server list (if not already
there) and set as current.[br]
[br]
- If <server> is in the form "id:<some_string>" then <some_string>
+ If <server> is in the form [i]id:<some_string>[/i] then <some_string>
is interpreted as the server's internal ID (specified in the options dialog).
This is useful when you need to force KVIrc to choose between multiple
server entries with the same hostname and port stored in the database.[br]
@@ -191,15 +191,15 @@ namespace KviKvsCoreSimpleCommands
and the connection attempt will stop.
[br]
If <server> doesn't seem to be a valid IP address or hostname (i.e. it contains no dots)
- and it doesn't look to be in the form "id:<some_string>" then
+ and it doesn't look to be in the form [i]id:<some_string>[/i] then
it is assumed to be a network name and if such a network is found
in the server list then the best server for that network is contacted.
(KVIrc tries to guess the round-robin (random) servers first).[br]
- This behaviour can be forced by adding the "net:" prefix to the <server>
+ This behavior can be forced by adding the [i]net:[/i] prefix to the <server>
(so it will work even if the network name contains a dot).[br]
[br]
The connection is attempted in the current IRC context. If there is already
- a connection in progress then it is "brutally" terminated.[br]
+ a connection in progress then it is [i]brutally[/i] terminated.[br]
@examples:
[example]
server irc.tin.it
@@ -362,7 +362,7 @@ namespace KviKvsCoreSimpleCommands
menu bar text for the new popup.[br]
If a popup menu with the same <visible_text> or the same <menu_name> already exists in
the current frame, it is removed first.[br]
- <visible_text> can optionally contain the "&" character to identify
+ <visible_text> can optionally contain the '&' character to identify
the popup menu accelerator.[br]
[menu_name], if given, must be a valid name of a popup menu created earlier
with [cmd]defpopup[/cmd] (or the popup editor).[br]
@@ -576,7 +576,7 @@ namespace KviKvsCoreSimpleCommands
@short:
Initializes the random number generator
@description:
- Initializes the random number generator "seeding" it with
+ Initializes the random number generator [i]seeding[/i] it with
<seed> which must be an integer. If no <seed> is passed it defaults to 1.
Sequences of random numbers can be repeated by using the
same <seed> value.
@@ -1108,12 +1108,12 @@ namespace KviKvsCoreSimpleCommands
Requests user information
@description:
Requests information about an IRC user specified by <nickname>.[br]
- Whowas requests "history" records. See [doc:rfc2812]RFC2812[/doc] for more info.[br]
+ Whowas requests [i]history[/i] records. See [doc:rfc2812]RFC2812[/doc] for more info.[br]
This command is [doc:connection_dependent_commands]connection dependent[/doc].
@examples:
[example]
- [comment]# Query past info about Pragma[/comment]
- whowas Pragma
+ [comment]# Query past info about Pragma[/comment]
+ whowas Pragma
[/example]
@seealso:
[cmd]whois[/cmd]
diff --git a/src/kvirc/kvs/event/KviKvsEventManager.cpp b/src/kvirc/kvs/event/KviKvsEventManager.cpp
index 9a5bff56a..3b0221e35 100644
--- a/src/kvirc/kvs/event/KviKvsEventManager.cpp
+++ b/src/kvirc/kvs/event/KviKvsEventManager.cpp
@@ -50,8 +50,8 @@
Event handlers can be created or destroyed by using the scriptcenter (graphic interface)
or even from the commandline (or script) by using the [cmd]event[/cmd] command.[br]
For example, the [event:onirc]OnIRC[/event] is triggered when the login operations have
- been terminated and you can consider yourself "completely" on IRC. For example, you might
- want to "auto-join" some channels. Nothing easier! The following snippet of code
+ 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]
[example]
[cmd]event[/cmd](OnIRC,autojoin)
@@ -80,7 +80,7 @@
[br]
Certain events will pass you some data in the positional parameters.[br]
For example, when you are being banned from a channel, KVIrc triggers the [event:onmeban]OnMeBan[/event]
- event: you might be interested in WHO has banned you. KVIrc will pass the "ban source" information
+ event: you might be interested in WHO has banned you. KVIrc will pass the [i]ban source[/i] information
in the positional parameters $0,$1 and $2.[br]
(Please note that the parameters started from $1 in KVIrc versions older than 3.0.0!).[br]
You may take a look at the list of available [doc:event_index_all]events[/doc].[br]
diff --git a/src/kvirc/kvs/event/KviKvsEventTable.cpp b/src/kvirc/kvs/event/KviKvsEventTable.cpp
index f7dc73a67..559a35bf1 100644
--- a/src/kvirc/kvs/event/KviKvsEventTable.cpp
+++ b/src/kvirc/kvs/event/KviKvsEventTable.cpp
@@ -189,7 +189,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
This event is triggered every time that an URL is going to appear
in a KVIrc window output widget. You cannot stop it or modify it.
This event is good for implementing an URL catcher.[br]
- WARNING: If you attempt to "echo $0" inside this event, you will cause an infinite loop.
+ WARNING: If you attempt to [i]echo $0[/i] inside this event, you will cause an infinite loop.
*/
EVENT("OnURL", \
"$0 = URL"),
@@ -234,7 +234,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
human readable string.[br]
The keys that actually work with KVIrc are:[br]
F2 to F12, F1 to F12 with SHIFT key pressed, 0 to 9 with CTRL key pressed.[br]
- This means that you can set up 33 "quick" aliases...that's really more than
+ This means that you can set up 33 [i]quick[/i] aliases... that's really more than
an user can remember.[br]
Note: this event won't be called for keys already bound to actions.
If you need more keys, mail me, I'll see what I can do :)[br]
@@ -263,7 +263,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
@description:
A channel or query message is going to be highlighted.[br]
The message may be either a PRIVMSG, a NOTICE or a CTCP ACTION.[br]
- The highlight may be either caused by a "highlight word" or by your own nickname
+ The highlight may be either caused by a [i]highlight word[/i] or by your own nickname
(if that option was specified).[br]
$5 contains the original color/icon set of the message that depends on
the type of the message itself.[br]
@@ -322,7 +322,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
is detected to be ON-Line.[br]
The event is triggered in the console window or the active window of the IRC context depending
on the user options.[br]
- (Note: If you call [cmd]halt[/cmd] in this event, you will stop the "Nick is on IRC" output,
+ (Note: If you call [cmd]halt[/cmd] in this event, you will stop the [i]Nick is on IRC[/i] output,
but this is rather a bad idea since KVIrc gives a lot of additional information to the
user with some notify-methods).[br]
This is a good place to play a sound or attract the user attention in some other way.[br]
@@ -348,7 +348,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
has just left IRC.[br]
The event is triggered in the console window or the active window of the IRC context depending
on the user options.[br]
- (Note: If you call [cmd]halt[/cmd] in this event, you will stop the "Nick has left IRC" output,
+ (Note: If you call [cmd]halt[/cmd] in this event, you will stop the [i]Nick has left IRC[/i] output,
but this is rather a bad idea since KVIrc gives a lot of additional information to the
user with some notify-methods).[br]
This is a good place to play a sound or attract the user attention in some other way.[br]
@@ -605,12 +605,12 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
and you have not logged in: it is not a good idea
attempting to send data to the server (READ: [b]This is NOT
a good place for joining channels[/b]).
- Your nickname is still "undefined" too.
+ Your nickname is still [i]undefined[/i] too.
If you're looking for the appropriate moment for sending
data to the server look at the [event:onirc]OnIRC[/event] event.
This event is a good place for initializing connection related
variables. By calling [cmd]halt[/cmd] in this event you will stop the
- "Connection established" output.
+ [i]Connection established[/i] output.
@seealso:
[event:onircconnectionterminated]OnIRCConnectionTerminated[/event]
*/
@@ -634,7 +634,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
can't send data to the server. You can still read
the connection parameters like the server name or
network name. By calling [cmd]halt[/cmd] in this
- event you will stop the "Connection terminated..." output.
+ event you will stop the [i]Connection terminated...[/i] output.
@seealso:
[event:onircconnectionestablished]OnIRCConnectionEstablished[/event]
*/
@@ -655,11 +655,11 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
@description:
This event is triggered immediately after the login
operations have been terminated. From now on you are
- "completely on IRC": your nickname has been defined
+ [i]completely on IRC[/i]: your nickname has been defined
and the server is ready to accept commands from you.
- This is a good place to join the "preferred channels".
+ This is a good place to join the [i]preferred channels[/i].
By calling [cmd]halt[/cmd] in this event you will
- stop the "Login operations complete..." output.
+ stop the [i]Login operations complete...[/i] output.
@seealso:
[event:onircconnectionestablished]OnIRCConnectionEstablished[/event]
[event:onircconnectionterminated]OnIRCConnectionTerminated[/event]
@@ -684,8 +684,8 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
The two parameters passed are the two servers that lost the link and were
signaled in that particular quit message.[br]
The actual netsplit detector in the KVIrc core uses the following rule
- (extracted from the eggdrop bot code): "determine if signoff string matches "%.% %.%",
- and only one space".[br]
+ (extracted from the eggdrop bot code): [i]determine if signoff string matches "%.% %.%",
+ and only one space[/i].[br]
[b]Note that this may be not accurate and KVIrc CAN be fooled by specially
formatted quit messages that aren't really netsplits.[/b][br]
KVIrc tries to avoid duplicate netsplit warnings thus this event will NOT
@@ -713,7 +713,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
console
@description:
Triggered when the user requests a disconnection from
- a server by pressing the "disconnect" button, by closing
+ a server by pressing the [i]disconnect[/i] button, by closing
the console or closing KVIrc. It is your last chance
to send some meaningful data to the server before the QUIT message
is sent. You can't prevent the user from disconnecting - [cmd]halt[/cmd] does nothing here.[br]
@@ -771,7 +771,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
An unhandled/unrecognized literal server message has been received.[br]
The KVIrc core code hasn't been able to recognize it nor handle it in any way.[br]
If you call [cmd]halt[/cmd] you will stop the standard or warning message output.[br]
- For server numerics there is no "unhandled" event, you should use the RAW numeric events to handle them.[br]
+ For server numerics there is no [i]unhandled[/i] event, you should use the RAW numeric events to handle them.[br]
@seealso:
*/
EVENT("OnUnhandledLiteral", \
@@ -908,7 +908,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
This event is triggered when an user has right clicked on a hostname link in the text view.
The double click link action is builtin and it causes KVIrc to perform a DNS query on the hostname.
This is a good place to show a popup menu with some operations that can be done on the hostname like
- "telnet", "traceroute", some special kind of DNS lookup (maybe an xterm with nslookup or sth).
+ [i]telnet[/i], [i]traceroute[/i], some special kind of DNS lookup (maybe an xterm with nslookup or sth).
*/
EVENT("OnHostLinkPopupRequest", \
"$0 = actual name\n" \
@@ -1025,7 +1025,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
Actual name is equal to the command name if command name is not null.
Visible name is the link text (as it shown by user)
Command name is set if the visible name differs with the actual link target (e.g. probably contains mIRC colors). It is equal to the actual target name.
- This event is triggered when an user has right clicked on an "unknown" nickname link in
+ This event is triggered when an user has right clicked on an [i]unknown[/i] nickname link in
the text view.[br]
This is a good place to show a [cmd]popup[/cmd] menu with some operations
that can be performed with the nickname like querying, sending a file by DCC or opening a dcc.chat.
@@ -1181,7 +1181,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
This includes the channel users list, the ban list,
the channel mode, the topic and eventually
the invite and ban exception lists.[br]
- Calling halt in this even stops the "channel synchronized" output.
+ Calling halt in this even stops the [i]channel synchronized[/i] output.
(the output will be halted anyway if [fnc]$option[/fnc](boolShowChannelSyncTime) evaluates to false)
@seealso:
[event:ondccchatpopuprequest]OnDCCChatPopupRequest[/event],
@@ -1213,7 +1213,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
$0!$1@$2 is the source of the message, $3 is the message text
and $4 are the eventual mode prefixes added to the target channel (i.e:
if the message is only for channel operators then you will get the string @ in $4).
- $5 will be 1 if the message was encrypted and 0 otherwise.
+ $5 will be [b]1[/b] if the message was encrypted and [b]0[/b] otherwise.
@seealso:
[event:onquerymessage]OnQueryMessage[/event]
[event:ondccchatmessage]OnDCCChatMessage[/event]
@@ -1247,7 +1247,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
For channel op or channel voice notices it will contain also the leading '@' or '+' flag.
Please note that this convention is different from the one used in [event:onchannelprivmsg]OnChannelMessage[/event]:
the incompatibility is here for historical reasons: it is not a big deal so we're not fighting it :)
- $3 will be 1 if the message was encrypted and 0 otherwise.
+ $3 will be [b]1[/b] if the message was encrypted and [b]0[/b] otherwise.
@seealso:
[event:onservernotice]OnServerNotice[/event]
*/
@@ -1284,7 +1284,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
Note also that you may not receive this event if the anti-spam option is in use and
KVIrc has detected that this might be a spam message. This is usually not an issue
but if you care about it then write to pragma at kvirc dot net asking to add a OnSpam event.
- $4 will be 1 if the message is encrypted and 0 otherwise.
+ $4 will be [b]1[/b] if the message is encrypted and [b]0[/b] otherwise.
@seealso:
[event:onquerywindowrequest]OnQueryWindowRequest[/event]
[event:onquerywindowcreated]OnQueryWindowCreated[/event]
@@ -1318,7 +1318,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
@description:
Triggered when a private notice is received.[br]
If you call [cmd]halt[/cmd] in this event, the message output will be stopped and if the message was going to cause a query window creation, the window will [b]not[/b] be created.
- $4 will be 1 if the message is encrypted and 0 otherwise.
+ $4 will be [b]1[/b] if the message is encrypted and [b]0[/b] otherwise.
@seealso:
[event:onchannelmessage]OnChannelMessage[/event]
[event:onchannelnotice]OnChannelNotice[/event]
@@ -1454,7 +1454,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
Console
@description:
Triggered when the local user enters the AWAY state.
- Calling 'halt' in this event disables the server "You have been marked as being away" message.[br]
+ Calling 'halt' in this event disables the server [i]You have been marked as being away[/i] message.[br]
@seealso:
[event:onmeback]OnMeBack[/event]
*/
@@ -1478,7 +1478,7 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
Triggered when the local user leaves the AWAY state.[br]
The $0 parameter contains the [b]UNIX time[/b] of the away status start.[br]
You can obtain the current [b]UNIX time[/b] from the function [fnc]$unixtime[/fnc].[br]
- Calling 'halt' in this event disables the server "You are no longer marked as being away" message.[br]
+ Calling 'halt' in this event disables the server [i]You are no longer marked as being away[/i] message.[br]
@seealso:
[event:onmeaway]OnMeAway[/event]
*/
@@ -1790,8 +1790,8 @@ KviKvsEvent KviKvsEventManager::m_appEventTable[KVI_KVS_NUM_APP_EVENTS]=
@description:
Triggered when the local user has changed his user mode.[br]
The first parameter is the changed mode flag with a leading '+' or '-' sign:
- if the mode was removed it will be something like "-x", otherwise something like "+x".[br]
- Calling 'halt' in this event will stop the "mode" message output.[br]
+ if the mode was removed it will be something like [i]-x[/i], otherwise something like [i]+x[/i].[br]
+ Calling 'halt' in this event will stop the [i]mode[/i] message output.[br]
*/
EVENT("OnUserModeChange", \
"$0 = mode flags"),
diff --git a/src/kvirc/kvs/object/KviKvsObject.cpp b/src/kvirc/kvs/object/KviKvsObject.cpp
index a74925b4e..9920fc513 100644
--- a/src/kvirc/kvs/object/KviKvsObject.cpp
+++ b/src/kvirc/kvs/object/KviKvsObject.cpp
@@ -47,496 +47,476 @@
#include <time.h>
-/*
- @doc: objects
- @title:
- Object scripting
- @short:
- Object scripting overview
- @keyterms:
- objects, object scripting, complex data structures
- @body:
- [big]Introduction[/big]
-
- The KVIrc scripting language is not object oriented in nature.
- Anyway, objects are a highlevel abstraction that allow
- to write complex code in a "clean" way.
- So I've added at least some pseudo-object support.[br][br]
-
- [big]Basic concepts[/big]
-
- Objects are arranged in tree structures.
- Each object that you create is either toplevel object or a child
- of another object. A toplevel object is a parentless one.
- Obviously all objects can have child objects.[br][br]
-
- When an object is destroyed, all its child objects are also destroyed.
- The toplevel objects are automatically destroyed when KVIrc quits.
- The objects are global to the entire application (this is different
- from previous KVIrc releases where the objects were local
- to the current frame window and arranged in a single tree
- with a builtin root object).[br][br]
-
- Each object is an instance of a class that defines its features.
- Each object has also a name, that is not necessary unique and is assigned to
- by the programmer; the name is just a mnemonic expedient, and
- you may also not need it.[br][br]
-
- Each object is identified by an [b]OPAQUE UNIQUE ID[/b].
- The ID is assigned by KVIrc and can be held in any variable.
- You can think the object ID as a "handle for the object" or the object's pointer.
- Any action performed on the object will require its ID.[br][br]
-
- [big]Creation and destruction[/big]
-
- To create an object you must use the [fnc]$new[/fnc]()
- function. [fnc]$new[/fnc]() requires three parameters:[br]
- - The object class (more about object classes later in this document)[br]
- - The ID of the parent object (this can be 0 for toplevel objects).[br]
- - The object name (eventually empty)[br]
- [example]
- %myobject = [fnc]$new[/fnc]([class]object[/class],0,theName)
- [/example]
- [fnc]$new[/fnc]() returns the ID of the newly created object, or
- the STRING "0" if the object creation fails
- (it is a string because the object ID's are generally strings, and 0 is an "invalid object ID").
- In well written scripts it is not common that the object creation fails, anyway
- you can check if the creation has failed in the following way:[br]
- [example]
- [cmd]if[/cmd](%myobject)[cmd]echo[/cmd] "Object created!"
- else [cmd]echo[/cmd] "Object creation failed!"
- [/example]
- You can also test the object ID's for equality:[br]
- [example]
- [cmd]if[/cmd](%myobject == %anotherobject)[cmd]echo[/cmd] "This is the same object!";
- [/example]
- The parent object ID is optional, if not specified it is assumed to be 0.
- The object name is optional, but it may help you later in finding the object.[br][br]
-
- To destroy an object use the [cmd]delete[/cmd] command. (In previous versions
- this command was named "destroy" and delete is currently aliased to that name too).[br]
- [example]
- [cmd]delete[/cmd] %myobject
- [/example]
- If the destroyed object has child objects, these are destroyed too.[br][br]
-
- [big]Fields: objects as pseudo-structures[/big]
+ /*
+ @doc: objects
+ @title:
+ Object scripting
+ @short:
+ Object scripting overview
+ @keyterms:
+ objects, object scripting, complex data structures
+ @body:
+ [big]Introduction[/big]
+ The KVIrc scripting language is not object oriented in nature.
+ Anyway, objects are a highlevel abstraction that allow
+ to write complex code in a [i]clean[/i] way.
+ So I've added at least some pseudo-object support.[br][br]
+ [big]Basic concepts[/big][br]
+ 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.
+ Obviously all objects can have child objects.
+ [br][br]
+ When an object is destroyed, all its child objects are also destroyed.
+ The toplevel objects are automatically destroyed when KVIrc quits.
+ The objects are global to the entire application (this is different
+ from previous KVIrc releases where the objects were local
+ to the current frame window and arranged in a single tree
+ with a builtin root object).
+ [br][br]
+ Each object is an instance of a class that defines its features.
+ Each object has also a name, that is not necessary unique and is assigned to
+ by the programmer; the name is just a mnemonic expedient, and
+ you may also not need it.
+ [br][br]
+ Each object is identified by an [b]OPAQUE UNIQUE ID[/b].
+ The ID is assigned by KVIrc and can be held in any variable.
+ You can think the object ID as a [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]
+ [example]
+ %myobject = [fnc]$new[/fnc]([class]object[/class],0,theName)
+ [/example]
+ [fnc]$new[/fnc]() returns the ID of the newly created object, or
+ the STRING [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]
+ [example]
+ [cmd]if[/cmd](%myobject)[cmd]echo[/cmd] "Object created!"
+ else [cmd]echo[/cmd] "Object creation failed!"
+ [/example]
+ You can also test the object ID's for equality:[br]
+ [example]
+ [cmd]if[/cmd](%myobject == %anotherobject)[cmd]echo[/cmd] "This is the same object!";
+ [/example]
+ The parent object ID is optional, if not specified it is assumed to be 0.
+ The object name is optional, but it may help you later in finding the object.
+ [br][br]
+ To destroy an object use the [cmd]delete[/cmd] command. (In previous versions
+ this command was named [i]destroy[/i] and delete is currently aliased to that name too).[br]
+ [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 "-&gt;":[br]
+ [example]
+ %myobject-&gt;%fieldVariable = dataString
+ [/example]
+ To unset a field set it with empty data string (just like with a normal variable).
+ To retrieve the field data use the object scope operator in the same way:[br]
+ [example]
+ [cmd]echo[/cmd] %myobject-&gt;%fieldVariable
+ [/example]
+ The '-&gt;' operator has been stolen from the C language.
+ In the KVIrc scripting language it switches from the global namespace
+ to the object's one.[br]
+ So in the above example %fieldVariable is owned by the object.[br]
+ The first character of the variable name has no special meaning in the
+ object namespace (in the global namespace the variables starting
+ with an uppercase letter are global to the application, the other ones are local
+ to the command sequence). The variable names are completely case insensitive.
+ [br][br]
+ Any [doc:operators]operator[/doc] can be used with the object field variables:[br]
+ [example]
+ %myobject-&gt;%fieldVariable = 0
+ %myobject-&gt;%fieldVarialbe ++
+ [cmd]if[/cmd]0(%myobject-&gt;%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]
+ [example]
+ # Create an user description on the fly
+ %myobj = [fnc]$new[/fnc]([class]object[/class],0,userDescription)
+ # Set the fields
+ %myobj-&gt;%nickname = Pragma
+ %myobj-&gt;%username = daemon
+ %myobj-&gt;%hostname = pippo.pragma.org
+ %myobj-&gt;%info = Pragma goes always sleep too late
+ %myobj-&gt;%info [doc:operators]&lt;&lt;[/doc] and wakes up too late too!
+ # Call an (user defined) alias that stores the data to a file
+ storetofile %myobj
+ # Destroy the object
+ [cmd]delete[/cmd] %myobj
+ [/example]
+ The field variables can be also dictionaries:[br]
+ [example]
+ %theobj-&gt;%field[key] = something
+ [/example]
+ Unlike in C, there is no need to declare object fields.[br]
+ If you have ever used other high level object-oriented languages, you may be used to declaring different types of
+ variables: instance variables, which per definition define an object's state (at least partly) and local variables,
+ 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]
+ [example]
+ [cmd]class[/cmd](test,[class]object[/class])
+ {
+ test()
+ {
+ %test = "will this persist?"
+ }
- All the objects can contain variable fields.
- You can set an object's field by using the object scope operator "-&gt;":[br]
- [example]
- %myobject-&gt;%fieldVariable = dataString
- [/example]
- To unset a field set it with empty data string (just like with a normal variable).
- To retrieve the field data use the object scope operator in the same way:[br]
- [example]
- [cmd]echo[/cmd] %myobject-&gt;%fieldVariable
- [/example]
- The '-&gt;' operator has been stolen from the C language.
- In the KVIrc scripting language it switches from the global namespace
- to the object's one.[br]
- So in the above example %fieldVariable is owned by the object.[br]
- The first character of the variable name has no special meaning in the
- object namespace (in the global namespace the variables starting
- with an uppercase letter are global to the application, the other ones are local
- to the command sequence). The variable names are completely case insensitive.[br][br]
+ anotherfunc() {
+ [cmd]echo[/cmd] "var: %test"
+ }
+ }
- Any [doc:operators]operator[/doc] can be used with the object field variables:[br]
- [example]
- %myobject-&gt;%fieldVariable = 0
- %myobject-&gt;%fieldVarialbe ++
- [cmd]if[/cmd]0(%myobject-&gt;%fieldVariable != 1)[cmd]echo[/cmd] KVIrc is drunk, maybe a reboot will help?
- [/example]
- You can simulate C structures "on the fly" by using objects and fields:[br]
- [example]
- # Create an user description on the fly
- %myobj = [fnc]$new[/fnc]([class]object[/class],0,userDescription)
- # Set the fields
- %myobj-&gt;%nickname = Pragma
- %myobj-&gt;%username = daemon
- %myobj-&gt;%hostname = pippo.pragma.org
- %myobj-&gt;%info = Pragma goes always sleep too late
- %myobj-&gt;%info [doc:operators]&lt;&lt;[/doc] and wakes up too late too!
- # Call an (user defined) alias that stores the data to a file
- storetofile %myobj
- # Destroy the object
- [cmd]delete[/cmd] %myobj
- [/example]
- The field variables can be also dictionaries:[br]
- [example]
- %theobj-&gt;%field[key] = something
- [/example]
- Unlike in C, there is no need to declare object fields.[br]
- If you have ever used other high level object-oriented languages, you may be used to declaring different types of
- variables: instance variables, which per definition define an object's state (at least partly) and local variables,
- 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]
- [example]
- [cmd]class[/cmd](test,[class]object[/class])
- {
- test()
+ %myObject = [fnc]$new[/fnc](test,0)
+ %myObject-&gt;$test()
+ [comment]# Behold! This will only print "var: "![/comment]
+ %myObject-&gt;$anotherfunc()
+ [/example][br]
+ 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]
+ As earlier said, there is no need to declare object fields, as KVIrc will keep track of them. Even more precisely
+ said, you [b]can not[/b] declare them in the class file itself (some later example will tell you otherwise,
+ just keep in mind to ignore the pseudo code, as it does not reflect how KVI++ is really working in respect of
+ fields.)[br]
+ However, there is one way to declare and define object fields: using the constructor (please see below, if you
+ are interesting in learning about this function), it is possible to [i]declare[/i] (really only for the human being
+ reading the code) and more important initialize object fields. For more information, see the Constructor section
+ below.[br]
+ Any object can have any field variable; an [i]unset[/i] field is equivalent to an [i]empty[/i] field.[br]
+ Note:[br]
+ The KVIrc scripting language is not typed.
+ Any object class (be patient... I'll explain classes in a while) identifier can be stored in any KVIrc variable:
+ it is not possible to find out the object features by [i]examining[/i] its identifier.
+ This may make the usage of objects a bit [i]unclear[/i];
+ However, with some experience you will be able to use the objects in a very powerful way.
+ The type-safety can be also simulated by a careful usage of object names;
+ in the above example, the %myobj object was created with the [i]userDescription[/i] name.
+ The storetofile alias could check the passed object's name and refuse to work
+ if that does not match "userDescription".
+ [br][br]
+ A more complex use of fields will be described later in this document.
+ [br][br]
+ [big]Member functions[/big]
+ Just like in C++, the objects have member functions.
+ For example, the [i]object[/i] class (again... read on) objects export the [classfnc:object]$name[/classfnc]()
+ and [classfnc:object]$className[/classfnc]() functions.[br]
+ [example]
+ %tmp = [fnc]$new[/fnc]([class]object[/class],0,myobject)
+ [cmd]echo[/cmd] The object's name is %tmp-&gt;[classfnc:object]$name[/classfnc](), the class name is %tmp-&gt;[classfnc:object]$className[/classfnc]()
+ # Destroy the object
+ [cmd]delete[/cmd] %tmp
+ [/example]
+ Another cool function exported by the [class:object]object[/class] class is the
+ [classfnc:object]$children[/classfnc]() function.
+ It returns a comma separated list of child identifiers.[br]
+ [example]
+ %tmp = [fnc]$new[/fnc]([class]object[/class],0,myobject)
+ %tmpchild = [fnc]$new[/fnc]([class]object[/class],%tmp,child1)
+ %tmpchild = [fnc]$new[/fnc]([class]object[/class],%tmp,child2)
+ %tmpchild = [fnc]$new[/fnc]([class]object[/class],%tmp,child3)
+ [cmd]echo[/cmd] The object's child list is: %tmp-&gt;[classfnc:object]$children[/classfnc]()
+ # Destroy the object and the child
+ [cmd]delete[/cmd] %tmp
+ [/example]
+ There are two special functions for each objects: the [i]constructor[/i] and the [i]destructor[/i].
+ You will find more information on constructors and destructors later in this document,
+ for now it's enough that you know that these functions are called automatically by KVirc:
+ the constructor is called when the object is created and the destructor is called when the
+ object is being destroyed with [cmd]delete[/cmd].[br][br]
+ [br]
+ The object functions can be reimplemented on-the-fly
+ by using the [cmd]privateimpl[/cmd] command: you can simply modify the behaviour of the function
+ by writing your own function body.
+ (This is an uncommon feature: unlike many other languages, you can reimplement object
+ functions at run-time, when the object has been already created.)
+ [br][br]
+ A more complex example[br]
+ [example]
+ %tmp = [fnc]$new[/fnc]([class]object[/class],0,myobject)
+ [cmd]foreach[/cmd](%i,1,2,3)
{
- %test = "will this persist?"
+ %tmpchild = [fnc]$new[/fnc]([class]object[/class],%tmp,child%i)
+ [cmd]privateimpl[/cmd](%tmpchild,destructor){ [cmd]echo[/cmd] Object [fnc]$this[/fnc] ([fnc]$this[/fnc]-&gt;[classfnc:object]$name[/classfnc]()) destroyed; }
}
-
- anotherfunc() {
- [cmd]echo[/cmd] "var: %test"
+ [cmd]privateimpl[/cmd](%tmp,destructor)
+ {
+ %count = 0;
+ [cmd]foreach[/cmd](%t,[fnc]$this[/fnc]-&gt;[classfnc:object]$children[/classfnc]())
+ {
+ [cmd]echo[/cmd] Children : %t-&gt;[classfnc:object]$name[/classfnc]() with class %t-&gt;[classfnc:object]$class[/classfnc]()
+ %count++
+ }
+ [cmd]echo[/cmd] Just before destroying my %count child items.
}
- }
-
- %myObject = [fnc]$new[/fnc](test,0)
- %myObject-&gt;$test()
- [comment]# Behold! This will only print "var: "![/comment]
- %myObject-&gt;$anotherfunc()
- [/example][br]
- Intance variables, however, which are managed in the object's "field" 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]
- As earlier said, there is no need to declare object fields, as KVIrc will keep track of them. Even more precisely
- said, you [b]can not[/b] declare them in the class file itself (some later example will tell you otherwise,
- just keep in mind to ignore the pseudo code, as it does not reflect how KVI++ is really working in respect of
- fields.)[br]
- However, there is one way to declare and define object fields: using the constructor (please see below, if you
- are interesting in learning about this function), it is possible to "declare" (really only for the human being
- reading the code) and more important initialize object fields. For more information, see the Constructor section
- below.[br]
- Any object can have any field variable; an "unset" field is equivalent to an "empty" field.[br]
- Note:[br]
- The KVIrc scripting language is not typed.
- Any object class (be patient... I'll explain classes in a while) identifier can be stored in any KVIrc variable:
- it is not possible to find out the object features by "examining" its identifier.
- This may make the usage of objects a bit "unclear";
- However, with some experience you will be able to use the objects in a very powerful way.
- The type-safety can be also simulated by a careful usage of object names;
- in the above example, the %myobj object was created with the "userDescription" name.
- The storetofile alias could check the passed object's name and refuse to work
- if that does not match "userDescription".[br][br]
-
- A more complex use of fields will be described later in this document.[br][br]
-
- [big]Member functions[/big]
-
- Just like in C++, the objects have member functions.
- For example, the "object" class (again... read on) objects export the [classfnc:object]$name[/classfnc]()
- and [classfnc:object]$className[/classfnc]() functions.[br]
- [example]
- %tmp = [fnc]$new[/fnc]([class]object[/class],0,myobject)
- [cmd]echo[/cmd] The object's name is %tmp-&gt;[classfnc:object]$name[/classfnc](), the class name is %tmp-&gt;[classfnc:object]$className[/classfnc]()
- # Destroy the object
- [cmd]delete[/cmd] %tmp
- [/example]
- Another cool function exported by the [class:object]object[/class] class is the
- [classfnc:object]$children[/classfnc]() function.
- It returns a comma separated list of child identifiers.[br]
- [example]
- %tmp = [fnc]$new[/fnc]([class]object[/class],0,myobject)
- %tmpchild = [fnc]$new[/fnc]([class]object[/class],%tmp,child1)
- %tmpchild = [fnc]$new[/fnc]([class]object[/class],%tmp,child2)
- %tmpchild = [fnc]$new[/fnc]([class]object[/class],%tmp,child3)
- [cmd]echo[/cmd] The object's child list is: %tmp-&gt;[classfnc:object]$children[/classfnc]()
- # Destroy the object and the child
- [cmd]delete[/cmd] %tmp
- [/example]
- There are two special functions for each objects: the "constructor" and the "destructor".
- You will find more information on constructors and destructors later in this document,
- for now it's enough that you know that these functions are called automatically by KVirc:
- the constructor is called when the object is created and the destructor is called when the
- object is being destroyed with [cmd]delete[/cmd].[br][br]
-
- The object functions can be reimplemented on-the-fly
- by using the [cmd]privateimpl[/cmd] command: you can simply modify the behaviour of the function
- by writing your own function body.
- (This is an uncommon feature: unlike many other languages, you can reimplement object
- functions at run-time, when the object has been already created.)[br][br]
-
- A more complex example[br]
- [example]
- %tmp = [fnc]$new[/fnc]([class]object[/class],0,myobject)
- [cmd]foreach[/cmd](%i,1,2,3)
- {
- %tmpchild = [fnc]$new[/fnc]([class]object[/class],%tmp,child%i)
- [cmd]privateimpl[/cmd](%tmpchild,destructor){ [cmd]echo[/cmd] Object [fnc]$this[/fnc] ([fnc]$this[/fnc]-&gt;[classfnc:object]$name[/classfnc]()) destroyed; }
- }
- [cmd]privateimpl[/cmd](%tmp,destructor)
- {
- %count = 0;
- [cmd]foreach[/cmd](%t,[fnc]$this[/fnc]-&gt;[classfnc:object]$children[/classfnc]())
+ [comment]# Destroy the object and it's child items[/comment]
+ [cmd]delete[/cmd] %tmp
+ [/example][br]
+ 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,
+ to make it [i]say[/i] its name (Please note the usage of [fnc]$this[/fnc]).
+ In the parent destructor the child objects have been counted and listed.[br]
+ Then the parent object is destroyed causing to:[br]
+ - trigger the parent destructor.[br]
+ - 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]
+ [example]
+ %anyobject-&gt;$functionname()
+ [/example]
+ [br]
+ [big]Classes[/big]
+ As said before, all objects are instances of a specific class.
+ This concept is common to almost all object oriented languages.
+ A class is a collection of methods that define an object's behaviour.
+ It's not easy to explain it, so I'll try with an example:[br]
+ [b]Please note, that this is pseudo code. KVI++ does by no mean employs
+ a [i]field[/i] directive as shown below![/b]
+ [example]
+ class HostAddress
{
- [cmd]echo[/cmd] Children : %t-&gt;[classfnc:object]$name[/classfnc]() with class %t-&gt;[classfnc:object]$class[/classfnc]()
- %count++
+ field hostname
+ function ipnumber()
+ function isLocalhost()
}
- [cmd]echo[/cmd] Just before destroying my %count child items.
- }
- [comment]//Destroy the object and it's child items[/comment]
- [cmd]delete[/cmd] %tmp
- [/example]
-
- In the example above four objects have been created.
- A "parent" object named "myobject", and three child objects.
- The destructor has been reimplemented for each child object,
- to make it "say" its name (Please note the usage of [fnc]$this[/fnc]).
- In the parent destructor the child objects have been counted and listed.[br]
- Then the parent object is destroyed causing to:[br]
- - trigger the parent destructor.[br]
- - destroy all the child items (and consequently trigger all the [i]individual[/i] destructors).[br][br]
-
- Not all the object functions must return a value:
- If a function does not return a meaningful value, or you just want to ignore it, you can call it in the following way:[br]
- [example]
- %anyobject-&gt;$functionname()
- [/example]
- [br]
-
- [big]Classes[/big]
- As said before, all objects are instances of a specific class.
- This concept is common to almost all object oriented languages.
- A class is a collection of methods that define an object's behaviour.
- Hehe... it is not easy to explain it, so I'll try with an example:[br]
- [b]Please note, that this is pseudo code. KVI++ does by no means employs
- a "field" directive as shown below![/b]
- [example]
- class HostAddress
- {
- field hostname
- function ipnumber()
- function isLocalhost()
- }
- [/example]
- The above class is a representation of a host address.
- You create an [b]instance of this class[/b] and set the hostname field, for example,
- to www.kernel.org.
- The object is now able to give you information about the hostname in a transparent way:
- You can call the ipnumber() function, and the object will return you the
- digits and dots representation of www.kernel.org.
- The isLocalhost() function will return true if the hostname refers to the local machine
- The object internal job is hidden from the user, but probably it will be a huge job.
- To obtain the IP number from the hostname, the object will probably have to perform a DNS call (usually a complex task).
- To check if the hostname references the local machine, the object will have to obtain the local hostname
- from the system (in some "unspecified" way) and then compare it with the given "hostname" field.[br][br]
-
- The internal job of the object is defined by the "implementation of the class".
- Obviously, the programmer that creates the class has to write that implementation.[br]
-
- [example]
- class HostAddress
- {
- field hostname
- function ipnumber()
- {
- find the nearest DNS server
- make the DNS call
- wait for the response
- decode the response
- }
- function isLocalhost()
- {
- query the kernel for the local hostname
- compare the obtained hostname with the hostname field
- }
- }
- [/example]
- In the above example I have "implemented" the two functions in pseudo code.[br][br]
-
- Let's go back to the real world.[br][br]
-
- KVirc contains a [doc:classes]set of built-in ready-to-use classes[/doc].
- The basic class is [class]object[/class]: all the other classes are derived from this (more about
- object inheritance later in this doc).[br][br]
-
- Another available class is [class]socket[/class] that is an interface to the real system sockets.
- An instance of the [class]socket[/class] class can connect and communicate with other hosts on the net.[br][br]
-
- The [b]class definitions are GLOBAL to the entire application[/b]: all server windows share them.[br][br]
-
- So now we can say that in KVIrc
- [b]a CLASS is a collection of features that define the behaviour of an object.
- The user interface to the class are the member functions and the events.[/b][br][br]
-
- [big]Inheritance[/big]
-
- Someone asked for derived classes?[br]
- Here we go:[br]
- The [cmd]class[/cmd] command allows you to define new object classes.
- In KVI++, A new class must be always derived from some other class: the lowest possible
- level of inheritance is 1: deriving from class [class]object[/class].[br]
- [example]
- [cmd]class[/cmd](helloworld,[class]object[/class])
- {
- sayhello()
+ [/example]
+ The above class is a representation of a host address.
+ You create an [b]instance of this class[/b] and set the hostname field, for example,
+ to www.kernel.org.
+ The object is now able to give you information about the hostname in a transparent way:
+ You can call the ipnumber() function, and the object will return you the
+ digits and dots representation of www.kernel.org.
+ The isLocalhost() function will return true if the hostname refers to the local machine
+ The object internal job is hidden from the user, but probably it will be a huge job.
+ To obtain the IP number from the hostname, the object will probably have to perform a DNS call (usually a complex task).
+ To check if the hostname references the local machine, the object will have to obtain the local hostname
+ from the system (in some [i]unspecified[/i] way) and then compare it with the given [i]hostname[/i] field.
+ [br][br]
+ The internal job of the object is defined by the "implementation of the class".
+ Obviously, the programmer that creates the class has to write that implementation.
+ [br][br]
+ [example]
+ class HostAddress
{
- [cmd]echo[/cmd] Hello world!
+ field hostname
+ function ipnumber()
+ {
+ find the nearest DNS server
+ make the DNS call
+ wait for the response
+ decode the response
+ }
+ function isLocalhost()
+ {
+ query the kernel for the local hostname
+ compare the obtained hostname with the hostname field
+ }
}
- }
- [/example]
-
- The above class is named "helloworld". 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]()...
- Additionally, it has the $sayhello() function, that "echoes Hello world" to the console.
- Now you can create an instance of this class:
- [example]
- %instance = [fnc]$new[/fnc](helloworld)
- %instance-&gt;$sayhello()
- [/example]
- You should see "Hello world" printed in the console.
- Easy job... let's make the things a bit more complex now:
- derive another class from helloworld and make it say "hello" in two different languages:[br]
- [example]
- [cmd]class[/cmd](localizedhelloworld,helloworld)
- {
- [comment]# define the setlanguage function[/comment]
- [comment]# note that <$0 = language> is just a programmer reminder[/comment]
- setlanguage(<$0 = language>)
- {
- [cmd]if[/cmd](($0 == english) || ($0 == italian))
+ [/example]
+ In the above example I have [i]implemented[/i] the two functions in pseudo code.
+ [br][br]
+ Let's go back to the real world.
+ [br][br]
+ KVirc contains a [doc:classes]set of built-in ready-to-use classes[/doc].
+ The basic class is [class]object[/class]: all the other classes are derived from this (more about
+ object inheritance later in this doc).
+ [br][br]
+ Another available class is [class]socket[/class] that is an interface to the real system sockets.
+ An instance of the [class]socket[/class] class can connect and communicate with other hosts on the net.
+ [br][br]
+ The [b]class definitions are GLOBAL to the entire application[/b]: all server windows share them.
+ [br][br]
+ So now we can say that in KVIrc [b]a CLASS is a collection of features that define the behaviour of an object.
+ The user interface to the class are the member functions and the events.[/b]
+ [br][br]
+ [big]Inheritance[/big][br]
+ Someone asked for derived classes?[br]
+ Here we go:[br]
+ The [cmd]class[/cmd] command allows you to define new object classes.
+ In KVI++, A new class must be always derived from some other class: the lowest possible
+ level of inheritance is 1: deriving from class [class]object[/class].[br]
+ [example]
+ [cmd]class[/cmd](helloworld,[class]object[/class])
{
- [fnc:$this]$$[/fnc]-&gt;%lang = $0
- [cmd]return[/cmd] 1
- } else {
- [cmd]echo[/cmd] I don't know that language ($0)
- [cmd]echo[/cmd] defaulting to English
- [fnc:$this]$$[/fnc]-&gt;%lang = english
- [cmd]return[/cmd] 0
+ sayhello()
+ {
+ [cmd]echo[/cmd] Hello world!
+ }
}
- }
-
- sayhello()
+ [/example][br]
+ 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]()...
+ Additionally, it has the $sayhello() function, that [i]echoes Hello world[/i] to the console.
+ Now you can create an instance of this class:
+ [example]
+ %instance = [fnc]$new[/fnc](helloworld)
+ %instance-&gt;$sayhello()
+ [/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]
+ [example]
+ [cmd]class[/cmd](localizedhelloworld,helloworld)
{
- [cmd]if[/cmd]([fnc:$this]$$[/fnc]-&gt;%lang == italian)[cmd]echo[/cmd] Ciao mondo!
- else [fnc:$this]$$[/fnc]-&gt;$helloworld:sayhello()
- }
- }
- [/example]
- Now you can call:[br]
- [example]
- %m = [fnc]$new[/fnc](localizedhelloworld)
- %m-&gt;$setLanguage(italian)
- %m-&gt;$sayhello()
- %m-&gt;$setLanguage(english)
- %m-&gt;$sayhello()
- %m-&gt;$setLanguage(turkish)
- %m-&gt;$sayhello()
- [cmd]delete[/cmd] %myobj
- [/example]
- The class defined above is inherited from the previously defined helloworld class:
- so it inherits the "object" class functions and events and the sayhello function from "helloworld".
- In addition a setlanguage function is defined that stores in a variable the language name passed
- as a parameter (after checking its validity). ($0 evaluates to the first parameter passed)
- If the language is unknown the setlanguage function will return 0 (false).
- Now we want to be able to say "hello world" in Italian and English.
- So we [b]override[/b] the inherited sayhello function.
- "To override" means "to reimplement": if you call %object-&gt;$sayhello() and %object
- contains the ID of an instance of class "localizedhelloworld", the new implementation of that function will be called (executed).
- The inherited sayhello was able to say "hello world" only in English, so we can still use it in the new implementation
- without rewriting its contents. So if the language set is not Italian we assume that it is English and
- call the [b]base class implementation[/b].[br]
- [example]
- [fnc]$this[/fnc]-&gt;$helloworld:sayhello()
- [comment]# equivalent to $$-&gt;$helloworld:sayhello(),[/comment]
- [comment]# to $this-&gt;$helloworld::sayhello(),[/comment]
- [comment]# and to $$-&gt;$helloworld::sayhello()[/comment]
- [/example]
- otherwise the language is Italian and we say "hello" in Italian :).
- So, to call a base class implementation of a function we prepend the base class name before the function name in the call.
- The base class name could be also [class]object[/class] in this case, but the [class]object[/class] class has no "sayhello" function defined
- so it would result in an error.[br][br]
- In the above example, all the values of [fnc]$this[/fnc]-&gt;%language
- that are not equal to Italian are assumed to be English.
- This is not always true, for example, just after the object creation the %language variable field
- is effectively empty. The above class works correctly in this case, but we might want to have always
- a coherent state of the field variables, so we need another concept: the class [b]constructor[/b]
- that will be discussed in the next paragraph.[br][br]
-
- Note: multiple inheritance (inheritance from more than one base class) is not implemented, KVIrc is not a compiler. :)[br][br]
-
- Objects are much more powerful...[br][br]
-
- Do a [cmd]clearobjects[/cmd] to cleanup the old class definitions and read on.[br][br]
-
- [big]Constructors and destructors[/big]
-
- The class constructor is a [b]function[/b] that is called automatically just after the object
- has been created internally by KVIrc and just before the [fnc]$new[/fnc]
- function returns. It should be used to setup the internal object state.[br]
- The constructor can and should list and initialize all the necessary object fields.[br]
- [example]
- [cmd]class[/cmd](myObject,[class]object[/class])
- {
- constructor()
+ [comment]# define the setlanguage function[/comment]
+ [comment]# note that <$0 = language> is just a programmer reminder[/comment]
+ setlanguage(<$0 = language>)
{
- [fnc]$this[/fnc]-&gt;%test = "This is a sample object field."
+ [cmd]if[/cmd](($0 == english) || ($0 == italian))
+ {
+ [fnc:$this]$$[/fnc]-&gt;%lang = $0
+ [cmd]return[/cmd] 1
+ } else {
+ [cmd]echo[/cmd] I don't know that language ($0)
+ [cmd]echo[/cmd] defaulting to English
+ [fnc:$this]$$[/fnc]-&gt;%lang = english
+ [cmd]return[/cmd] 0
+ }
}
- }
-
- %myObject = [fnc]$new[/fnc](myObject,[class]object[/class])
- [cmd]echo[/cmd] %myObject-&gt;%test
- [/example][br]
- 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
- is immediately destroyed and [fnc]$new[/fnc]() returns 0 to the caller.
- Any other return value is treated as success, so the object is effectively
- created and [fnc]$new[/fnc]() returns its ID to the caller.[br]
- This said, KVI++ will automatically return a value of 1 and you should [b]never[/b]
- return a value other than 0 if something bad happened (like a mandatory parameter was not given in the $new()
- call or the like.) KVIrc will also issue a warning message and remind you of this when a non-zero value is
- returned.[br]
- All the builtin classes have a constructor defined that will almost never fail (only if we run out of memory),
- so you can avoid to check the [fnc]$new[/fnc]() return value
- when creating the instances of the built-in classes.[br][br]
- In derived classes you can override the constructor to setup your object's state.[br]
- You should [b]always call the base class constructor[/b] in your overridden one, to setup
- the base class state, and propagate its return value (eventually modified if the base class
- constructor is 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]
- [example]
- [cmd]class[/cmd](baseObject,[class]object[/class])
- {
- constructor()
+ sayhello()
{
- [cmd]echo[/cmd] "baseObject or derived object created."
+ [cmd]if[/cmd]([fnc:$this]$$[/fnc]-&gt;%lang == italian)[cmd]echo[/cmd] Ciao mondo!
+ else [fnc:$this]$$[/fnc]-&gt;$helloworld:sayhello()
}
}
-
- [cmd]class[/cmd](derivedObject,baseObject)
- {
- constructor()
+ [/example]
+ Now you can call:[br]
+ [example]
+ %m = [fnc]$new[/fnc](localizedhelloworld)
+ %m-&gt;$setLanguage(italian)
+ %m-&gt;$sayhello()
+ %m-&gt;$setLanguage(english)
+ %m-&gt;$sayhello()
+ %m-&gt;$setLanguage(turkish)
+ %m-&gt;$sayhello()
+ [cmd]delete[/cmd] %myobj
+ [/example]
+ The class defined above is inherited from the previously defined helloworld class:
+ so it inherits the [i]object[/i] class functions and events and the sayhello function from [i]helloworld[/i].
+ In addition a setlanguage function is defined that stores in a variable the language name passed
+ as a parameter (after checking its validity). ($0 evaluates to the first parameter passed)
+ If the language is unknown the setlanguage function will return 0 (false).
+ Now we want to be able to say [i]hello world[/i] in Italian and English.
+ So we [b]override[/b] the inherited sayhello function.
+ [i]To override[/i] means [i]to reimplement[/i]: if you call %object-&gt;$sayhello() and %object
+ 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]
+ [example]
+ [fnc]$this[/fnc]-&gt;$helloworld:sayhello()
+ [comment]# equivalent to $$-&gt;$helloworld:sayhello(),[/comment]
+ [comment]# to $this-&gt;$helloworld::sayhello(),[/comment]
+ [comment]# and to $$-&gt;$helloworld::sayhello()[/comment]
+ [/example]
+ otherwise the language is Italian and we say [i]hello[/i] in Italian :).
+ So, to call a base class implementation of a function we prepend the base class name before the function name in the call.
+ The base class name could be also [class]object[/class] in this case, but the [class]object[/class] class has no [i]sayhello[/i] function defined
+ so it would result in an error.[br][br]
+ In the above example, all the values of [fnc]$this[/fnc]-&gt;%language
+ that are not equal to Italian are assumed to be English.
+ This is not always true, for example, just after the object creation the %language variable field
+ is effectively empty. The above class works correctly in this case, but we might want to have always
+ a coherent state of the field variables, so we need another concept: the class [b]constructor[/b]
+ that will be discussed in the next paragraph.[br][br]
+ Note: multiple inheritance (inheritance from more than one base class) is not implemented, KVIrc is not a compiler. :)[br][br]
+ Objects are much more powerful...[br][br]
+ Do a [cmd]clearobjects[/cmd] to cleanup the old class definitions and read on.[br][br]
+ [big]Constructors and destructors[/big]
+ The class constructor is a [b]function[/b] that is called automatically just after the object
+ has been created internally by KVIrc and just before the [fnc]$new[/fnc]
+ function returns. It should be used to setup the internal object state.[br]
+ The constructor can and should list and initialize all the necessary object fields.[br]
+ [example]
+ [cmd]class[/cmd](myObject,[class]object[/class])
{
- [cmd]echo[/cmd] "derivedObject object created."
- [fnc]$this[/fnc]->$baseObject::constructor()
+ constructor()
+ {
+ [fnc]$this[/fnc]-&gt;%test = "This is a sample object field."
+ }
}
- }
- [/example][br][br]
- In practice, the builtin class constructors do nothing other than setting the return
- value to 1 so you can even avoid to call them, but in any other case you must do it.[br][br]
- This is different from C (for example), where the constructors are called (more or less)
- automatically.[br][br]
-
- [big]Signals and slots[/big]
+ %myObject = [fnc]$new[/fnc](myObject,[class]object[/class])
+ [cmd]echo[/cmd] %myObject-&gt;%test
+ [/example][br]
+ 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
+ is immediately destroyed and [fnc]$new[/fnc]() returns 0 to the caller.
+ Any other return value is treated as success, so the object is effectively
+ created and [fnc]$new[/fnc]() returns its ID to the caller.[br]
+ This said, KVI++ will automatically return a value of 1 and you should [b]never[/b]
+ return a value other than 0 if something bad happened (like a mandatory parameter was not given in the $new()
+ call or the like.) KVIrc will also issue a warning message and remind you of this when a non-zero value is
+ returned.[br]
+ All the builtin classes have a constructor defined that will almost never fail (only if we run out of memory),
+ so you can avoid to check the [fnc]$new[/fnc]() return value
+ when creating the instances of the built-in classes.[br][br]
+ In derived classes you can override the constructor to setup your object's state.[br]
+ You should [b]always call the base class constructor[/b] in your overridden one, to setup
+ the base class state, and propagate its return value (eventually modified if the base class
+ constructor is 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]
+ [example]
+ [cmd]class[/cmd](baseObject,[class]object[/class])
+ {
+ constructor()
+ {
+ [cmd]echo[/cmd] "baseObject or derived object created."
+ }
+ }
- The signals and slots are a powerful mean of inter-object communication.
- A signal is emitted by an object to notify a change in its state.
- For example, the [class:button]button class[/class] emits the
- [classsignal:button]clicked[/classsignal] signal when the user clicks the button.[br][br]
- A signal is emitted by an object and can be received and handled by any other existing object
- (including the object that emits the signal).[br]
- The handler function for a signal is called "slot".[br]
- It is just a convention: in fact, a slot is a normal object function (and any object function can be a slot).
- More than one slot can be connected to a single signal, and more signals can be connected to a single slot.[br]
- In this way, many objects can be notified of a change in a single object, as well as a single object
- can easily handle state-changes for many objects.[br]
- The signal/slot behaviour could be easily implemented by a careful usage of object functions.
- [b]So why signals and slots?[/b][br]
- Because signals are much more powerful in many situations.
- The signals have no equivalent in C/C++... but they have been implemented in many highlevel
- C/C++ libraries and development kits (including the system-wide signal/handler mechanism implemented
- by all the modern kernels and used in inter-process communication).[br]
-*/
+ [cmd]class[/cmd](derivedObject,baseObject)
+ {
+ constructor()
+ {
+ [cmd]echo[/cmd] "derivedObject object created."
+ [fnc]$this[/fnc]->$baseObject::constructor()
+ }
+ }
+ [/example][br][br]
+ In practice, the builtin class constructors do nothing other than setting the return
+ value to 1 so you can even avoid to call them, but in any other case you must do it.[br][br]
+ This is different from C (for example), where the constructors are called (more or less)
+ automatically.[br]
+ [big]Signals and slots[/big][br]
+ The signals and slots are a powerful mean of inter-object communication.
+ A signal is emitted by an object to notify a change in its state.
+ For example, the [class:button]button class[/class] emits the
+ [classsignal:button]clicked[/classsignal] signal when the user clicks the button.[br][br]
+ A signal is emitted by an object and can be received and handled by any other existing object
+ (including the object that emits the signal).[br]
+ The handler function for a signal is called "slot".[br]
+ It is just a convention: in fact, a slot is a normal object function (and any object function can be a slot).
+ More than one slot can be connected to a single signal, and more signals can be connected to a single slot.[br]
+ In this way, many objects can be notified of a change in a single object, as well as a single object
+ can easily handle state-changes for many objects.[br]
+ The signal/slot behaviour could be easily implemented by a careful usage of object functions.
+ [big]So why signals and slots?[/big][br]
+ Because signals are much more powerful in many situations.
+ The signals have no equivalent in C/C++... but they have been implemented in many high-level
+ C/C++ libraries and development kits (including the system-wide signal/handler mechanism implemented
+ by all the modern kernels and used in inter-process communication).[br]
+ */
@@ -544,109 +524,109 @@
///////////////////////////////////////////////////////////////////////////////////////
/*
- @doc: object
- @keyterms:
- object class, object, class
- @title:
- object class
- @type:
- class
- @short:
- Base class for all the KVIrc objects
- @inherits:
- none
- @description:
- This is the base class for all builtin KVirc object classes.
- It exports functions to retrieve an object's name, to iterate
- through child objects and to lookup a child object by name or class.
- Additionally, this class provides builtin timer functionality.
- The [classfnc]$constructor[/classfnc] and [classfnc]$destructor[/classfnc]
- functions are empty implementations that all the other classes inherit.
- @functions:
- !fn: $constructor()
- Constructor for this object class.
- The default implementation does nothing.
- !fn: $destructor()
- Destructor for this object class.
- The default implementation emits the signal "[classsignal]destroyed[/classsignal]".
- !fn: $name()
- Returns the name of this object.
- !fn: $parent()
- Returns the parent object of this object or 0 if this object has no parent.
- !fn: $timerEvent(<timerId>)
- Handler for the timer events.
- The default implementation does nothing.
- See also [classfnc]$startTimer[/classfnc]()
- and [classfnc]$killTimer[/classfnc]().
- !fn: $startTimer(<timeout>)
- Starts a builtin timer for this object and returns its timer ID
- as a string or '-1' if <timeout> was invalid.
- The [classfnc]$timerEvent[/classfnc]() handler function
- will be called every <timeout> milliseconds until the timer is stopped by $killTimer().
- !fn: $killTimer(<timer id>)
- Stops the timer specified by <timer id>.
- !fn: $className()
- Returns the class name of this object instance
- !fn: $findChild(<class>,<name>)
- Returns the first child that matches <class> and <name>.
- If <class> is an empty string, any class matches,
- if <name> is an empty string, any name matches.
- This function traverses the entire child tree but is [b]not[/b] recursive.
- !fn: $childCount()
- Returns the number of child objects
- !fn: $emit(<signal_name>[,parameters])
- Emits the signal <signal_name> passing the optional [parameters].
- See the [doc:objects]objects documentation[/doc] for an overview of signals and slots.
- !fn: $children()
- Returns an array of child object identifiers.
- !fn: $signalSender()
- Returns the current signal sender when in a slot connected to a signal.
- In other contexts this function returns an empty string.
- You can safely use it to test if the current function has been
- triggered directly or from a signal emission.
- !fn: $signalName()
- Returns the name of the last signal that has triggered one of this object's slots.
- When called in a slot handler, the triggering signal name is returned.
- !fn: $property(<Qt property name>[,bNowarning:boolean])
- This is for really advanced scripting.[br]
- All KVIrc widgets are based on the Qt library ones.[br]
- The Qt library allows to set and read special properties.[br]
- You will have to take a look at the Qt documentation for each widget type
- to see the available property names.[br]
- The supported property types are: Rect, Size, Point, Color, String, CString,
- Int, UInt, Bool and enumeration types.[br]
- For example, the widget's x coordinate can be retrieved by using the [classfnc]$x[/classfnc]()
- function or by calling $property(x).[br]
- There are many properties that are available only through the [classfnc]$property[/classfnc]() call:[br]
- For example, you can find out if the widget accepts drops by calling [classfnc]$property[/classfnc](acceptDrops).[br]
- This function will be mainly useful in the [class]wrapper[/class] class.
- !fn: $setProperty(<Qt property>,<property value>)
- Sets a qt property for this widget.[br]
- This is for advanced scripting, and can control really many features of the Qt widgets.[br]
- For example, the [class]multilineedit[/class] widgets can be set to
- the "password" echo mode only by using this function call:[br]
- [example]
- %X=$new(lineedit, 0, a_name)[br]
- %X-&gt;$show()[br]
- %X-&gt;$setProperty(echoMode,Password)[br]
- [/example]
- The available properties to be set are listed by [classfnc]$listProperties[/classfnc]()[br]
- and must appear in the list as writeable.[br]
- This function will be mainly useful in the [class]wrapper[/class] class.
- !fn: $listProperties([bArray])
- Lists the properties of this object.[br]
- If <bArray> is $true then the function returns the properties
- as an array of descriptive strings, otherwise the properties are dumped to the
- active window. If <bArray> is not passed then it is assumed to be $false.
- This function will be mainly useful in the [class]wrapper[/class] class.
- @signals:
- !sg: destroyed()
- Emitted by the default implementation of [classfnc]$destructor[/classfnc].
- If you reimplement [classfnc]$destructor[/classfnc] in one of the derived
- classes (or as a private implementation), and still want this signal
- to be emitted you must emit it by yourself, or (better) call the base class
- destructor.
-*/
+ @doc: object
+ @keyterms:
+ object class, object, class
+ @title:
+ object class
+ @type:
+ class
+ @short:
+ Base class for all the KVIrc objects
+ @inherits:
+ none
+ @description:
+ This is the base class for all builtin KVirc object classes.
+ It exports functions to retrieve an object's name, to iterate
+ through child objects and to lookup a child object by name or class.
+ Additionally, this class provides builtin timer functionality.
+ The [classfnc]$constructor[/classfnc] and [classfnc]$destructor[/classfnc]
+ functions are empty implementations that all the other classes inherit.
+ @functions:
+ !fn: $constructor()
+ Constructor for this object class.
+ The default implementation does nothing.
+ !fn: $destructor()
+ Destructor for this object class.
+ The default implementation emits the signal [i][classsignal]destroyed[/classsignal][/i].
+ !fn: $name()
+ Returns the name of this object.
+ !fn: $parent()
+ Returns the parent object of this object or 0 if this object has no parent.
+ !fn: $timerEvent(<timerId>)
+ Handler for the timer events.
+ The default implementation does nothing.
+ See also [classfnc]$startTimer[/classfnc]()
+ and [classfnc]$killTimer[/classfnc]().
+ !fn: $startTimer(<timeout>)
+ Starts a builtin timer for this object and returns its timer ID
+ as a string or '-1' if <timeout> was invalid.
+ The [classfnc]$timerEvent[/classfnc]() handler function
+ will be called every <timeout> milliseconds until the timer is stopped by $killTimer().
+ !fn: $killTimer(<timer id>)
+ Stops the timer specified by <timer id>.
+ !fn: $className()
+ Returns the class name of this object instance
+ !fn: $findChild(<class>,<name>)
+ Returns the first child that matches <class> and <name>.
+ If <class> is an empty string, any class matches,
+ if <name> is an empty string, any name matches.
+ This function traverses the entire child tree but is [b]not[/b] recursive.
+ !fn: $childCount()
+ Returns the number of child objects
+ !fn: $emit(<signal_name>[,parameters])
+ Emits the signal <signal_name> passing the optional [parameters].
+ See the [doc:objects]objects documentation[/doc] for an overview of signals and slots.
+ !fn: $children()
+ Returns an array of child object identifiers.
+ !fn: $signalSender()
+ Returns the current signal sender when in a slot connected to a signal.
+ In other contexts this function returns an empty string.
+ You can safely use it to test if the current function has been
+ triggered directly or from a signal emission.
+ !fn: $signalName()
+ Returns the name of the last signal that has triggered one of this object's slots.
+ When called in a slot handler, the triggering signal name is returned.
+ !fn: $property(<Qt property name>[,bNowarning:boolean])
+ This is for really advanced scripting.[br]
+ All KVIrc widgets are based on the Qt library ones.[br]
+ The Qt library allows to set and read special properties.[br]
+ You will have to take a look at the Qt documentation for each widget type
+ to see the available property names.[br]
+ The supported property types are: Rect, Size, Point, Color, String, CString,
+ Int, UInt, Bool and enumeration types.[br]
+ For example, the widget's x coordinate can be retrieved by using the [classfnc]$x[/classfnc]()
+ function or by calling $property(x).[br]
+ There are many properties that are available only through the [classfnc]$property[/classfnc]() call:[br]
+ For example, you can find out if the widget accepts drops by calling [classfnc]$property[/classfnc](acceptDrops).[br]
+ This function will be mainly useful in the [class]wrapper[/class] class.
+ !fn: $setProperty(<Qt property>,<property value>)
+ Sets a qt property for this widget.[br]
+ This is for advanced scripting, and can control really many features of the Qt widgets.[br]
+ For example, the [class]multilineedit[/class] widgets can be set to
+ the [i]password[/i] echo mode only by using this function call:[br]
+ [example]
+ %X=$new(lineedit, 0, a_name)[br]
+ %X-&gt;$show()[br]
+ %X-&gt;$setProperty(echoMode,Password)[br]
+ [/example]
+ The available properties to be set are listed by [classfnc]$listProperties[/classfnc]()[br]
+ and must appear in the list as writeable.[br]
+ This function will be mainly useful in the [class]wrapper[/class] class.
+ !fn: $listProperties([bArray])
+ Lists the properties of this object.[br]
+ If <bArray> is $true then the function returns the properties
+ as an array of descriptive strings, otherwise the properties are dumped to the
+ active window. If <bArray> is not passed then it is assumed to be $false.
+ This function will be mainly useful in the [class]wrapper[/class] class.
+ @signals:
+ !sg: destroyed()
+ Emitted by the default implementation of [classfnc]$destructor[/classfnc].
+ If you reimplement [classfnc]$destructor[/classfnc] in one of the derived
+ classes (or as a private implementation), and still want this signal
+ to be emitted you must emit it by yourself, or (better) call the base class
+ destructor.
+ */
// we use a char * pointer just to store a number
// we don't use void * just because incrementing a void pointer doesn't look that good
diff --git a/src/kvirc/kvs/parser/KviKvsParser.cpp b/src/kvirc/kvs/parser/KviKvsParser.cpp
index b8a25217d..bcba08c21 100644
--- a/src/kvirc/kvs/parser/KviKvsParser.cpp
+++ b/src/kvirc/kvs/parser/KviKvsParser.cpp
@@ -259,15 +259,14 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
@title:
KVIrc scripting language introduction
@short:
- KVIrc scripting language introduction
+ KVS scripting language introduction
@body:
[p]
- [b]KVS[/b] is the [b]KV[/b]irc [b]S[/b]cripting language.
- It was inspired by C++,sh,perl,php and mIrc scripting language implementations.
- It is a compromise between flexibility and speed, a 'workaround' for many intrinsic
+ [b]KVS[/b] is the [b]KV[/b]Irc [b]S[/b]cripting language.
+ It was inspired by C++, sh, Perl, PHP and mIRC scripting language implementations.
+ It is a compromise between flexibility and speed, a [i]workaround[/i] for many intrinsic
problems of an IRC-oriented scripting language.
- [/p]
- [p]
+ [br]
KVS is semi-interpreted: the execution is done in two main stages.
The first stage is the compilation where a syntactic tree is built.
The second stage is the real execution and is performed by visiting the tree
@@ -275,8 +274,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
the next executions can jump directly into the second stage.
This two-stage approach has been introduced in version 3.0.0, the previous
versions of the language used a single-stage on-the-fly interpreter.
- [/p]
- [p]
+ [br]
KVS allows you to:[br]
[ul]
[li]Implement automated reactions to the events generated by an IRC network[/li]
@@ -284,22 +282,17 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
[li]Add interface elements like popups, toolbars, buttons...[/li]
[li]Add advanced interface elements like complete dialogs or even widgets integrated in KVIrc[/li]
[/ul]
- [/p]
- [p]
+ [br]
KVS contains all the common constructs of structured programming.
- You will find almost all the C control commands, sh/perl-like variables, arrays and and functions.
+ You will find almost all the C control commands, sh/Perl-like variables, arrays and and functions.
There are also some object-oriented characteristics: you will find C++ like
objects with constructors, destructors and class inheritance.
- There are also more exotic concepts like the signal-slots interobject-communication.
+ There are also more exotic concepts like the signal-slots inter-object communication.
Obviously you will also find most of the RFC1459 IRC commands and
- other tools to [i]play[/i] with an IRC connection.
- [/p]
- [p]
- I'll try to explain the language by using examples
- instead of strict syntactic rules. (Actually I have even
- tried to write the rules...take a look [doc:syntactic_rules]here[/doc][br][br]
- And please...forgive me for my [i]fantastic[/i] English :)
- [/p]
+ other tools to [i]play[/i] with an IRC connection.[br]
+ I'll try to explain the language by using examples instead of strict syntactic rules.[br]
+ I have even tried to write the rules... take a look [doc:syntactic_rules]here[/doc][br][br]
+ And please... forgive me for my [i]fantastic[/i] English :)
Szymon Stefanek
*/
@@ -315,7 +308,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
KVS basic concepts
@body:
[big]Scripts[/big]
- [p]
+ [br]
You use KVS to implement [b]scripts[/b].
A script is basically a finite list of KVS instructions.
When you type a command in the KVIrc input window you in fact
@@ -323,23 +316,18 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
longer scripts in KVIrc memory and execute them at later time.
Scripts can be also read from external files by the means of the
[cmd]parse[/cmd] command.
- [/p]
- [p]
+ [br]
There is an issue with the word [i]script[/i] that is worth clearing here.
It is common usage to call [i]script[/i] a thing that is something more
that a finite list of (some scripting language) instructions.
In fact a set of scripts, documentation files, graphics or other multimedia
- files and sometimes executable binaries is still called a [i]script[/i]...just like
+ files and sometimes executable binaries is still called a [i]script[/i]... just like
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.
- [/p]
- [p]
- More about addons in this [doc:addons]document[/doc]
- [/p]
-
+ for both usages of the word in this documentation and around the web.[br]
+ More about addons in this [doc:addons]document[/doc][br]
[big]Hello world![/big]
- [p]
+ [br]
This documentation contains a lot of script examples.
They will appear like the following block of code:
[example]
@@ -361,11 +349,9 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
Another alternative for testing scripts is the code tester window.
You can access it by selecting [i]New code tester[/i] from the Scripting menu
at the top of the KVIrc window. You will soon have the opportunity to
- experiment with all the methods. Read on.
- [/p]
-
+ experiment with all the methods. Read on.[br]
[big]Basic syntax[/big]
- [p]
+ [br]
A script contains a list of instructions separated by newlines or ';' characters.
Placing an instruction per line does not require a terminating character,
placing more instructions in a single line require them to be separated by ';'.
@@ -391,22 +377,21 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
don't see the enclosing quotes around the printed text: more about this
in the following sections.[br]
[note]
- Cryptic note (you may skip it for now):[br]
- Yes, the command terminator is a problem for those that want to use ';)' at the end
- of IRC commands like [cmd]msg[/cmd]. It is almost unavoidable (read: the cost for
- avoiding it is too high). Note that using '|' or any other character as command terminator
- will [b]not[/b] solve the problem: if the terminator is too difficult to type it will annoy the
- scripters (and me), if it is too easy then there will be always someone that wants to use it
- at the end (or in the middle) of a command with the original meaning.
- The solution is to escape the ';' character:
+ Cryptic note (you may skip it for now):[br]
+ Yes, the command terminator is a problem for those that want to use ';)' at the end
+ of IRC commands like [cmd]msg[/cmd]. It is almost unavoidable (read: the cost for
+ avoiding it is too high). Note that using '|' or any other character as command terminator
+ will [b]not[/b] solve the problem: if the terminator is too difficult to type it will annoy the
+ scripters (and me), if it is too easy then there will be always someone that wants to use it
+ at the end (or in the middle) of a command with the original meaning.
+ The solution is to escape the [b];[/b] character:
[example]
[cmd]echo[/cmd] You can do it now \;)
[/example]
[/note]
- [/p]
-
+ [br]
[big]Parameter processing[/big]
- [p]
+ [br]
Most of the commands accept (and sometimes require) a list of parameters.
For example, the [cmd]join[/cmd] command (that is used to join an IRC channel)
accepts two parameters: the first one is the channel to join and the second is
@@ -423,9 +408,9 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
optional: if you specify it, then it will be interpreted as the channel password,
if you don't then no password will be used.
[note]
- The syntax is written in a simplified BNF. I say simplified because it is not
- totally strict around the KVIrc documentation. I just prefer the syntax to be
- clear and easy to read instead of being formally perfect.
+ The syntax is written in a simplified BNF. I say simplified because it is not
+ totally strict around the KVIrc documentation. I just prefer the syntax to be
+ clear and easy to read instead of being formally perfect.
[/note]
You can finally join a channel by writing:
[example]
@@ -437,21 +422,18 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
[/example]
In the example above the optional parameter [password] is omitted.
[note]
- In fact it is not really omitted: KVIrc interprets it as an empty string that later
- means [i]do not send the password to the server[/i].
- Empty strings are equivalent to omitted ones.
- [/note]
- [/p]
-
+ In fact it is not really omitted: KVIrc interprets it as an empty string that later
+ means [i]do not send the password to the server[/i].
+ Empty strings are equivalent to omitted ones.
+ [/note][br]
[big]Parameters, spaces and quotes[/big]
- [p]
+ [br]
From the examples above is obvious that KVS command parameters are separated by spaces.
What is not totally obvious is that multiple spaces are allowed but KVIrc
will automatically reduce them to exactly one (just like HTML parsers or the shell
interpreters do). This is an useful behaviour in an IRC client since spaces usually
carry no information and in text oriented protocols make the parsing really harder (:D).
- [/p]
- [p]
+ [br]
The spaces are simplified in normal processing but there are ways to force KVIrc
to interpret the spaces just as they are.
The first method are the quotation marks: all the spaces enclosed in quotation marks
@@ -471,10 +453,9 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
it is really easier to use than to explain.
There is obviously a method to preserve the quotes too and it is also another
method to preserve the spaces but that leads us to the next paragraph.
- [/p]
-
+ [br]
[big]Escape character[/big]
- [p]
+ [br]
You may have already noticed that KVS treats some characters in a special way.
For example the double-quote characters can be used to enclose strings
and are stripped by the parser.
@@ -507,9 +488,9 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
Another example:[br]
[example]
[cmd]echo[/cmd] "The new KVIrc &nbsp; &nbsp; &nbsp \
- &nbsp; &nbsp; IS OUT!"
- [cmd]echo[/cmd] Check it out at http://www.kvi\
- &nbsp; &nbsp; rc.net!
+ &nbsp; &nbsp; IS OUT!"
+ [cmd]echo[/cmd] Check it out at http://www.kvi \
+ &nbsp; &nbsp; rc.net!
[/example]
This will be printed as:[br][br]
[i]
@@ -521,10 +502,9 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
Later we will discover other common usages of the backslash escape, such
as preventing KVIrc from interpreting a literal percent character as a variable
or separating variable names from the text.
- [/p]
-
+ [br]
[big]Command switches[/big]
- [p]
+ [br]
Many commands accept switch parameters.
[b]A switch modifies the behaviour of a command.[/b]
Any switch can optionally accept a parameter, that must
@@ -547,10 +527,9 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
[example]
[cmd]echo[/cmd] "--- This text has three minus signs on the left"
[/example]
- [/p]
-
+ [br]
[big]Command blocks[/big]
- [p]
+ [br]
Commands can be 'grouped' in blocks by using the classic C++ braces.
Here is a single line example:[br]
[example]
@@ -565,19 +544,18 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
[cmd]echo[/cmd] Third command
[/example]
[note]
- Reminder : copy the example above to a text file
- and then use /[cmd]parse[/cmd] &lt;filename&gt;
+ Reminder: copy the example above to a text file
+ and then use /[cmd]parse[/cmd] &lt;filename&gt;
[/note]
In this case the command block has no special meaning
other than making the code more readable, but command blocks
will be useful later (see [cmd]if[/cmd],[cmd]while[/cmd]...).[br]
[note]
- Unlike in C or C++, the braces do [b]not[/b] automatically define a variable scope
- (with few exceptions to this rule ... just to complicate the things a bit more).
- You will recall this last assertion later, when reading about [doc:data_structures]data structures[/doc].
+ 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).
+ You will recall this last assertion later, when reading about [doc:data_structures]data structures[/doc].
[/note]
- [/p]
-
+ [br]
[big]Comments[/big]
[p]
KVIrc supports comments in command sequences.[br]
@@ -590,46 +568,44 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
You can't escape newline characters in this case.
(or better: escape characters have no meaning in comments...
maybe one day I'll implement it).[br]
- Starting from version 3.0.0, KVIrc supports also C++ single line and C multiline comments.[br]
- A C++ comment starts with two slashes '//' and terminates with a newline.
- A multiline C comment starts with '/ *' and ends at the first '* /' encountered.
+ Starting from version 3.0.0, KVIrc supports also C++ single line and C multi-line comments.[br]
+ A C++ comment starts with two slashes [b]//[/b] and terminates with a newline.
+ A multi-line C comment starts with [b]/ *[/b] and ends at the first [b]* /[/b] encountered.
Since KVIrc has no pre-processor, the C/C++ comments usually can't be placed in the middle of a command:
they must start where a command would start and end before the begin of another command.[br]
- [/p]
-
+ [br]
[big]Indentation[/big]
- [p]
+ [br]
You [b]should[/b] use spaces or [b]tabs[/b] to [b]indent[/b] your code. Note that the [b]should[/b]
word is written in bold characters: I mean that you really should indent your code.
Indenting helps both you (the script writer) and the reader (any other user that will
read your script). A good indenting practice is the first step to become a great programmer :)
[note]
- Please note that the command parameters should be separated by
- space characters (ASCII 32). Tabs are not granted to work as parameter separators.[br]
+ Please note that the command parameters should be separated by
+ space characters (ASCII 32). Tabs are not granted to work as parameter separators.[br]
[/note]
[example]
- {
- &lt;tab&gt;[cmd]echo[/cmd] Indented command
- &lt;tab&gt;{
- &lt;tab&gt;&lt;tab&gt;# Comment
- &lt;tab&gt;&lt;tab&gt;[cmd]echo[/cmd] Really Really long indented \
- &lt;tab&gt;&lt;tab&gt;&lt;tab&gt;command
- &lt;tab&gt;}
- }
+ {
+ &lt;tab&gt;[cmd]echo[/cmd] Indented command
+ &lt;tab&gt;{
+ &lt;tab&gt;&lt;tab&gt;# Comment
+ &lt;tab&gt;&lt;tab&gt;[cmd]echo[/cmd] Really Really long indented \
+ &lt;tab&gt;&lt;tab&gt;&lt;tab&gt;command
+ &lt;tab&gt;}
+ }
[/example]
Tabs behave better than spaces as indentation characters since other users can
adjust the tab size to match their taste. I personally prefer 4 character tabs
while most text/code editors usually come with 8 characters as default.
- [/p]
-
+ [br]
[big]And now?[/big]
- [p]
+ [br]
You're now ready to really start experimenting with KVS. You can take
a look at the [doc:commands]command index[/doc] and start trying to use them
while keeping in mind the rules described in this document.
The next suggested lecture is the documentation about [doc:kvs_aliasesandfunctions]the aliases and the functions[/doc].
Have fun :)
- [/p]
+ [br]
*/
/*
@@ -644,16 +620,15 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
KVS Functions and aliases
@body:
[big]Introduction[/big]
- [p]
+ [br]
Since you're here, you should already have read about the [doc:kvs_basicconcepts]KVS basic concepts[/doc]
and have visited the [doc:commands]command index[/doc]. If you feel ready to take the next step
then read on.
- [/p]
-
+ [br]
[big]Functions[/big][br]
- [p]
+ [br]
KVS has many internal [doc]functions[/doc] that can be used as command parameters.[br]
- [b]All the function names start with a literal '$' character.[/b][br]
+ [b]All the function names start with a literal [b]$[/b] character.[/b][br]
[example]
[cmd]echo[/cmd] This window caption is [fnc]$window.caption[/fnc]
[/example]
@@ -670,14 +645,12 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
[i](Surprise: in this case the -w switch is useless,
since echo prints text to the current window by default...
but it will work correctly. :)[/i]
- [/p]
- [p]
+ [br]
Normal function names can be made of [i]anycase[/i] letters, digits and underscores,
with the restriction that the first character is not a digit.[br]
- Some kind of functions can contain a dot '.' character inside the name
+ Some kind of functions can contain a dot ([b].[/b]) character inside the name
and these are assumed to be module references (see [doc:modules]the modules documentation[/doc]).[br]
- [/p]
- [p]
+ [br]
By now we have seen only simple functions, but there's more...[br]
The functions can accept parameters; the general syntax for a function call is:[br]
[b]$<function name>['('<parameter_list>')'][/b][br]
@@ -691,7 +664,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
a string: in this case it can be also interpreted as a number.[br]
When passing an empty list you can avoid the parenthesis.
(And you have found the [i]simple[/i] functions shown above).
- So the followind two calls are equal:[br]
+ So the following two calls are equal:[br]
[example]
[cmd]echo[/cmd] [fnc]$window.caption[/fnc]
[cmd]echo[/cmd] [fnc]$window.caption()[/fnc]
@@ -715,9 +688,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
[/example]
This is useful for algebraic and boolean expressions, like the ones
accepted by the special function $() (see next paragraphs).[br]
- [/p]
-
-
+ [br]
[big]Aliases[/big][br]
An alias is a user defined command. It can be used to rename the builtin KVIrc commands or functions,
to automate complex tasks or as a means for structured programming.
@@ -732,7 +703,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
[example]
[cmd]alias[/cmd](j){ [cmd]join[/cmd] $0-; };
[/example]
-
This will create the alias [b]j[/b]. From this moment you can use /j as if it was a normal command.
[example]
j #kvirc
@@ -752,15 +722,13 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
$N-M returns the parameters from (N-1)-th to the (M-1)-th (a parameter range) and $N- returns
all the parameters from (N-1)-th to the last one. In the example above $0- stands for
all the parameters starting from the first one.
- [/p]
- [p]
+ [br]
To remove an alias, use the alias command again with an empty body:
[example]
[cmd]alias[/cmd](j){}
[/example]
This will remove the alias [b]j[/b] defined above.
- [/p]
- [p]
+ [br]
A common task in channel management is the kick & ban action.
You first ban a user from the channel and then eventually kick him
(obviously assuming that he is actually on the channel).
@@ -777,8 +745,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
This will first execute [i]ban spammer[/i] and then [i]kick spammer with; You're not welcome here[/i].
Our kb is a really simple example... it doesn't check for the validity of the parameters -
the server will warn us if the parameters passed to kb were empty.
- [/p]
- [p]
+ [br]
The alias can be modified at any time by reusing the alias command.
Let's make our [b]kb[/b] a bit more intelligent and add a check for the parameters.
TIP: It is a good idea to write the following examples in a text file and then use /parse <filename> to execute it.
@@ -804,8 +771,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
Finally the [i]kick <nickname> <reason>[/i] will be executed.
Get used to looking at the single command documentation pages, they will give
you the hints necessary to fully understand the above piece of code.
- [/p]
- [p]
+ [br]
Aliases can be used as a means for structured programming.
In large scripts you will [b]surely[/b] have [i]common tasks[/i] to perform (like having
specially-colored output or calculating a value from a set of other values)...
@@ -814,8 +780,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
The alias as a procedure (subroutine or sub-task) has been shown in the [b]kb[/b] example above -
it might be commonly called from more complex scripts or other aliases in the case that a
kick & ban action is needed.
- [/p]
- [p]
+ [br]
Aliases can be used also as functions.
Assume that you often need to calculate the sum of three numbers - a function-alias is the way.
[example]
@@ -823,7 +788,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
[/example]
This will add the alias [i]sum3[/i] and make it available both as a command and a function.
The [i]return[/i] command sets the return value of a sequence of commands
- (an alias is a sequence of commands...remember?) and terminates the execution (by returning
+ (an alias is a sequence of commands... remember?) and terminates the execution (by returning
the control to the caller).
So return $($0 + $1 + $2); will set the return value of the alias to the value
computed by $($0 + $1 + $2), which is the sum of the first three parameters passed.
@@ -848,14 +813,11 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
is propagated (and in fact [i]used[/i]).
There are some [i]nice[/i] exceptions to this rule...but you don't need to care about it, for now.
If return is not called inside an alias body, the return value will be set to [fnc]$null[/fnc].
- [/p]
- [p]
+ [br]
Aliases can accept switches just like any other command. The [fnc]$sw[/fnc] is there
- exactly for that purpose. Check it out.
- [/p]
-
+ exactly for that purpose. Check it out.[br]
[big]Special functions[/big]
- [p]
+ [br]
We have already seen the positional parameter functions.
The functions of type [b]$N[-[M]][/b] (where N and M are positive
numbers starting from 0 and N < M) evaluate to the sequence of
@@ -873,7 +835,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
The function [b]$#[/b] evaluates to the number of positional parameters available.
The [b]positional parameter[/b] functions do not accept parameters.[br]
The special function [b]$(<expression>)[/b], called the
- "[doc:expressioneval]Expression evaluation identifier[/doc]", returns the result
+ [i][doc:expressioneval]Expression evaluation identifier[/doc][/i], returns the result
of the evaluation of the <expression>. In previous versions of KVIrc this
function was called $calc().[br]
[example]
@@ -914,201 +876,201 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
*/
/*
- @doc: window_naming_conventions
- @type:
- language
- @title:
- Window naming conventions
- @keyterms:
- IRC context,window ID,frame window,connection ID
- @short:
- KVIrc window structure and the window naming conventions
- @body:
- [big]Introduction[/big][br]
- Starting from the release 3.0.0, KVIrc window structure has
- grown in complexity. Older releases allowed one connection
- per [i]frame window[/i] and thus had a dedicated command parser
- for each connection. Finding a window in that scenario
- was quite easy: it was enough to designate it by [i]name[/i]
- (that was exactly the text displayed in the window caption).
- 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]
- 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
- using two separate connections.
+ @doc: window_naming_conventions
+ @type:
+ language
+ @title:
+ Window naming conventions
+ @keyterms:
+ IRC context, window ID, frame window, connection ID
+ @short:
+ KVIrc window structure and the window naming conventions
+ @body:
+ [big]Introduction[/big][br]
+ Starting from the release 3.0.0, KVIrc window structure has
+ grown in complexity. Older releases allowed one connection
+ per [i]frame window[/i] and thus had a dedicated command parser
+ for each connection. Finding a window in that scenario
+ was quite easy: it was enough to designate it by [i]name[/i]
+ (that was exactly the text displayed in the window caption).
+ 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]
+ 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
+ using two separate connections.
+ [ul]
+ [li]
+ Application (Unique command parser)
[ul]
[li]
- Application (Unique command parser)
+ Frame X
[ul]
[li]
- Frame X
+ Console M (IRC context)
[ul]
- [li]
- Console M (IRC context)
- [ul]
- [li]Channel windows[/li]
- [li]Query windows[/li]
- [li]Other connection related windows[/li]
- [/ul]
- [/li]
- [li]
- Console N (IRC context)
- [ul]
- [li]Channel windows[/li]
- [li]Query windows[/li]
- [li]Other connection related windows[/li]
- [/ul]
- [/li]
- [li]
- Other windows
- [/li]
- [li]
- ...
- [/li]
+ [li]Channel windows[/li]
+ [li]Query windows[/li]
+ [li]Other connection related windows[/li]
[/ul]
[/li]
[li]
- Frame Y
+ Console N (IRC context)
[ul]
- [li]
- Console O (IRC context)
- [ul]
- [li]Channel windows[/li]
- [li]Query windows[/li]
- [li]Other connection related windows[/li]
- [/ul]
- [/li]
- [li]
- Console P (IRC context)
- [ul]
- [li]Channel windows[/li]
- [li]Query windows[/li]
- [li]Other connection related windows[/li]
- [/ul]
- [/li]
- [li]
- Other windows
- [/li]
- [li]
- ...
- [/li]
+ [li]Channel windows[/li]
+ [li]Query windows[/li]
+ [li]Other connection related windows[/li]
[/ul]
[/li]
[li]
+ Other windows
+ [/li]
+ [li]
...
[/li]
[/ul]
[/li]
+ [li]
+ Frame Y
+ [ul]
+ [li]
+ Console O (IRC context)
+ [ul]
+ [li]Channel windows[/li]
+ [li]Query windows[/li]
+ [li]Other connection related windows[/li]
+ [/ul]
+ [/li]
+ [li]
+ Console P (IRC context)
+ [ul]
+ [li]Channel windows[/li]
+ [li]Query windows[/li]
+ [li]Other connection related windows[/li]
+ [/ul]
+ [/li]
+ [li]
+ Other windows
+ [/li]
+ [li]
+ ...
+ [/li]
+ [/ul]
+ [/li]
+ [li]
+ ...
+ [/li]
[/ul]
- [br]
- A naming convention has become necessary to resolve ambiguities.[br]
- [big]Basic assumptions[/big]
- Every KVIrc window has four main properties:[br]
- -[b]an unique numeric identifier[/b][br]
- -[b]the logical name[/b][br]
- -[b]the type identifier[/b][br]
- -[b]the caption text[/b][br]
- The [b]numeric identifier[/b] is unique to the whole application,
- and is the one returned by the [fnc]$window[/fnc] function.[br]
- The identifier is assigned by KVIrc when the window is created
- and is not changed until the window is destroyed.
- This identifier will be referred as [b]window ID[/b].[br]
- The [b]logical name[/b] is a property of some kind of windows.
- It usually corresponds to the first part of the window caption.
- For example, for channel windows it is the channel name, for
- queries it is the list of the targets. For some other windows
- the logical name corresponds to the caption text. This will be discussed later.[br]
- The [b]type identifier[/b] describes the properties of a certain window.
- For channel windows the type identifier is [i]channel[/i], for query windows is [i]query[/i],
- for console windows it is [i]console[/i], etc.[br]
-
- [big]IRC Contexts[/big][br]
- The KVIrc frame windows are numbered starting from 0 and named
- "frame_<number>". Each frame can contain an unlimited number of consoles.[br]
- Each console is bound to an [b]IRC context[/b]. (The part [i]is bound to[/i] could
- be substituted by [i]defines[/i] or [i]is contained in[/i]).[br]
- [i]An [b]IRC context[/b] is a set of resources that can deal with a single
- IRC connection.[/i][br]
- The association between an [b]IRC context[/b]
- and a console is bijective: each [b]IRC context[/b] is associated
- to a single console window.[br]
- An [b]IRC context[/b] can be in connected or not-connected state.
- When in connected state, it contains a set of windows beside the console:
- mainly channels and query windows.
- The channels and query windows can exist [b]only[/b] if the associated
- [b]IRC context[/b] exists.[br]
- Channels and queries have unique names inside a connection so
- there is no way to confuse it. (Theoretically there can
- be more than one query window with the same name, but in fact
- all the windows refer to the same target so they are instances
- of the same resource).
- All this creates a sort of namespace: the channels and queries can be identified
- as [i]bound[/i] to a specific [b]IRC context[/b].[br]
- An [b]IRC context[/b] can [i]contain[/i] other windows, such as the [i]sockets[/i]
- window or the [i]list[/i] window. KVIrc takes care of making them
- unique inside the [b]IRC context[/b] namespace.[br]
- Each [b]IRC context[/b] has its own unique [b]IRC context ID[/b] (see [fnc]$context[/fnc]).[br]
- Since to a single [b]IRC context[/b] may correspond only a single IRC connection,
- when in connected state, the [b]IRC context[/b] may be referred also as [b]connection[/b]
- or [b]connection context[/b], and the associated [b]IRC context Id[/b] can be
- referred as [b]connection ID[/b] or [b]connection context ID[/b].[br]
- There are classes of windows that are not bound to any [b]IRC context[/b]:
- this includes user created windows, DCC windows, browsers etc.[br]
- KVIrc will try to keep that windows with unique logical names.[br]
- [big]How to identify a window[/big][br]
- So what we have until now is:[br]
- [ul]
- [li]Each window has its own unique [b]window ID[/b]: we
- will refer windows always using this identifier.[/li]
- [li]Each window has a set of properties including:
- window type, logical name.[/li]
- [li]Subsets of windows are bound to a single [b]IRC context[/b][/li]
- [/ul]
- The simplest (but also the less significant) method of looking for
- a window is to finding it by caption.[br]
- The [fnc]$window[/fnc] function finds the first KVIrc window matching
- the [i]caption text[/i] and returns its [b]window ID[/b].[br]
- This method will likely fail when there are more windows with the same
- caption text; for this reason several specific functions
- have been added to allow finding the correct window.[br]
- The [fnc]$console[/fnc] finds a console window bound to a specified
- [b]IRC context[/b].[br]
- The [fnc]$channel[/fnc] finds a channel window matching the specified
- name and bound to a specified [b]IRC context[/b].[br]
- The [fnc]$query[/fnc] finds a query window that has a specified target
- and is bound to a specified [b]IRC context[/b].[br]
- */
+ [/li]
+ [/ul]
+ [br]
+ A naming convention has become necessary to resolve ambiguities.[br]
+ [big]Basic assumptions[/big]
+ Every KVIrc window has four main properties:[br]
+ -[b]an unique numeric identifier[/b][br]
+ -[b]the logical name[/b][br]
+ -[b]the type identifier[/b][br]
+ -[b]the caption text[/b][br]
+ The [b]numeric identifier[/b] is unique to the whole application,
+ and is the one returned by the [fnc]$window[/fnc] function.[br]
+ The identifier is assigned by KVIrc when the window is created
+ and is not changed until the window is destroyed.
+ This identifier will be referred as [b]window ID[/b].[br]
+ The [b]logical name[/b] is a property of some kind of windows.
+ It usually corresponds to the first part of the window caption.
+ For example, for channel windows it is the channel name, for
+ queries it is the list of the targets. For some other windows
+ the logical name corresponds to the caption text. This will be discussed later.[br]
+ The [b]type identifier[/b] describes the properties of a certain window.
+ For channel windows the type identifier is [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]
+ 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
+ be substituted by [i]defines[/i] or [i]is contained in[/i]).[br]
+ [i]An [b]IRC context[/b] is a set of resources that can deal with a single
+ IRC connection.[/i][br]
+ The association between an [b]IRC context[/b]
+ and a console is bijective: each [b]IRC context[/b] is associated
+ to a single console window.[br]
+ An [b]IRC context[/b] can be in connected or not-connected state.
+ When in connected state, it contains a set of windows beside the console:
+ mainly channels and query windows.
+ The channels and query windows can exist [b]only[/b] if the associated
+ [b]IRC context[/b] exists.[br]
+ Channels and queries have unique names inside a connection so
+ there is no way to confuse it. (Theoretically there can
+ be more than one query window with the same name, but in fact
+ all the windows refer to the same target so they are instances
+ of the same resource).
+ All this creates a sort of namespace: the channels and queries can be identified
+ as [i]bound[/i] to a specific [b]IRC context[/b].[br]
+ An [b]IRC context[/b] can [i]contain[/i] other windows, such as the [i]sockets[/i]
+ window or the [i]list[/i] window. KVIrc takes care of making them
+ unique inside the [b]IRC context[/b] namespace.[br]
+ Each [b]IRC context[/b] has its own unique [b]IRC context ID[/b] (see [fnc]$context[/fnc]).[br]
+ Since to a single [b]IRC context[/b] may correspond only a single IRC connection,
+ when in connected state, the [b]IRC context[/b] may be referred also as [b]connection[/b]
+ or [b]connection context[/b], and the associated [b]IRC context Id[/b] can be
+ referred as [b]connection ID[/b] or [b]connection context ID[/b].[br]
+ There are classes of windows that are not bound to any [b]IRC context[/b]:
+ this includes user created windows, DCC windows, browsers etc.[br]
+ KVIrc will try to keep that windows with unique logical names.[br]
+ [big]How to identify a window[/big][br]
+ So what we have until now is:[br]
+ [ul]
+ [li]Each window has its own unique [b]window ID[/b]: we
+ will refer windows always using this identifier.[/li]
+ [li]Each window has a set of properties including:
+ window type, logical name.[/li]
+ [li]Subsets of windows are bound to a single [b]IRC context[/b][/li]
+ [/ul]
+ The simplest (but also the less significant) method of looking for
+ a window is to finding it by caption.[br]
+ The [fnc]$window[/fnc] function finds the first KVIrc window matching
+ the [i]caption text[/i] and returns its [b]window ID[/b].[br]
+ This method will likely fail when there are more windows with the same
+ caption text; for this reason several specific functions
+ have been added to allow finding the correct window.[br]
+ The [fnc]$console[/fnc] finds a console window bound to a specified
+ [b]IRC context[/b].[br]
+ The [fnc]$channel[/fnc] finds a channel window matching the specified
+ name and bound to a specified [b]IRC context[/b].[br]
+ The [fnc]$query[/fnc] finds a query window that has a specified target
+ and is bound to a specified [b]IRC context[/b].[br]
+*/
- /*
- @doc: connection_dependent_commands
- @type:
- language
- @title:
- Connection dependent commands
- @keyterms:
- IRC context, connection dependent commands
- @body:
- Many KVIrc commands are connection dependent:
- you need an IRC connection to successfully execute them;
- usually because some data needs to be sent to the server.
- This includes commands like [cmd]whois[/cmd],[cmd]raw[/cmd],[cmd]query[/cmd],
- [cmd]msg[/cmd],[cmd]notice[/cmd],[cmd]op[/cmd],[cmd]ctcp[/cmd]...[br]
- These commands must be executed in a window that is bound to a
- [b]connected [doc:window_naming_conventions]IRC context[/doc][/b].
- You will obviously get an error message if you try to use them in a window
- that has no associated IRC connection.[br]
- For instance: [cmd]whois[/cmd] will work only if you execute it
- in a console, channel or query window.[br]
- If you want to use these commands in a window that is not associated to
- any IRC context you may use the [doc:command_rebinding]standard -r switch[/doc].
- You can use the same switch to execute a command in an [b]IRC context[/b] that is
- not the current one.
- */
+/*
+ @doc: connection_dependent_commands
+ @type:
+ language
+ @title:
+ Connection dependent commands
+ @keyterms:
+ IRC context, connection dependent commands
+ @body:
+ Many KVIrc commands are connection dependent:
+ you need an IRC connection to successfully execute them;
+ usually because some data needs to be sent to the server.
+ This includes commands like [cmd]whois[/cmd],[cmd]raw[/cmd],[cmd]query[/cmd],
+ [cmd]msg[/cmd],[cmd]notice[/cmd],[cmd]op[/cmd],[cmd]ctcp[/cmd]...[br]
+ These commands must be executed in a window that is bound to a
+ [b]connected [doc:window_naming_conventions]IRC context[/doc][/b].
+ You will obviously get an error message if you try to use them in a window
+ that has no associated IRC connection.[br]
+ For instance: [cmd]whois[/cmd] will work only if you execute it
+ in a console, channel or query window.[br]
+ If you want to use these commands in a window that is not associated to
+ any IRC context you may use the [doc:command_rebinding]standard -r switch[/doc].
+ You can use the same switch to execute a command in an [b]IRC context[/b] that is
+ not the current one.
+*/
/*
@@ -1135,7 +1097,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
[example]
[cmd]alias[/cmd](j){ [cmd]join[/cmd] $0-; };
[/example]
-
+ [br]
This will create the alias [b]j[/b]. From this moment you can use /j as it was a normal command.
[example]
j #kvirc
@@ -1155,15 +1117,13 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
$N-M returns the parameters from (N-1)-th to the (M-1)-th (a parameter range) and $N- returns
all the parameters from (N-1)-th to the last one. In the example above $0- stands for
all the parameters starting from the first one.
- [/p]
- [p]
+ [br]
To remove an alias use again the alias command with an empty body:
[example]
[cmd]alias[/cmd](j){}
[/example]
This will remove the alias [b]j[/b] defined above.
- [/p]
- [p]
+ [br]
A common task in channel management is the kick & ban action.
You first ban an user from the channel and then eventually kick him
(obviously assuming that he is actually on the channel).
@@ -1180,8 +1140,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
This will first execute [i]ban spammer[/i] and then [i]kick spammer with; You're not welcome here[/i].
Our kb is a really simple example... it doesn't check for the validity of the parameters:
the server will warn us if the parameters passed to kb were empty.
- [/p]
- [p]
+ [br]
The alias can be modified at any time by re-using the alias command.
Let's make our [b]kb[/b] a bit more intelligent and add a check for the parameters.
TIP: It is a good idea to write the following examples in a text file and then use /parse <filename> to execute it.
@@ -1207,8 +1166,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
Finally the [i]kick <nickname> <reason>[/i] will be executed.
Get used to looking at the single command documentation pages, they will give
you the hints necessary to fully understand the above piece of code.
- [/p]
- [p]
+ [br]
Aliases can be used as a mean for structured programming.
In large scripts you will [b]surely[/b] have [i]common tasks[/i] to perform (like having specially
colored output or calculating a value from a set of other values)...
@@ -1217,8 +1175,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
The alias as a procedure (subroutine or sub-task) has been shown in the [b]kb[/b] example above:
it might be commonly called from more complex scripts or other aliases in case that a
kick & ban action is needed.
- [/p]
- [p]
+ [br]
The aliases can be used also as functions.
Assume that you need really often to calculate the sum of three numbers: a function-alias is the way.
[example]
@@ -1251,11 +1208,10 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
is propagated (and in fact [i]used[/i]).
(There are some [i]nice[/i] exceptions to this rule... but you don't need to care about it, for now).
If return is not called inside an alias body, the return value will be just a null value.
- [/p]
- [p]
+ [br]
Aliases can accept switches just like any other command. The [fnc]$sw[/fnc] is there
exactly for that purpose. Check it out.
- [/p]
+ [br]
*/
@@ -1271,32 +1227,24 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
Writing KVIrc addons
@body:
[big]Introduction[/big]
- [p]
+ [br]
An addon is basically a set of KVS scripts, multimedia, documentation
and accessory files that implement a KVIrc feature.
It might be a simple automatic-away subsystem, a GUI newsticker or a complex
- file sharing
- service (commonly called [i]fserve[/i]). Addons are sometimes called [i]scripts[/i].
- In fact a KVIrc addon is usually made of more than one KVS script.
- [/p]
- [p]
+ file sharing service (commonly called [i]fserve[/i]). Addons are sometimes called [i]scripts[/i].
+ In fact a KVIrc addon is usually made of more than one KVS script.[br][br]
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.
- [/p]
-
- [big]Addon installation[/big]
- [p]
+ the KVIrc help and to be translated in several languages.[br]
+ [big]Addon installation[/big][br]
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.
- [/p]
-
+ necessary source files.[br]
[big]The minimal addon[/big]
- [p]
+ [br]
The smallest addon that you can write is the one that does nothing.
[example]
[cmd]addon.register[/cmd]("MyAddon", \
@@ -1310,17 +1258,16 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
}
[/example]
The code above does nothing but registers the [i]MyAddon[/i] addon.
- [/p]
- [p]
+ [br]
The first parameter is the internal addon ID which can be used to identify
your addon inside KVIrc. The ID must be unique: two addons that share the same
name cannot be installed. The second parameter is the addon version. It should
be expressed in the classic format [major].[minor].[pathlevel] or something
really similar (in fact KVIrc just expects the version to be a string composed
- of numbers separated by dots). The version is compared when an addon is
- installed and KVIrc complains if the user tries to downgrade an addon (that is
- to install a less recent version over a more recent one). The third parameter
- is the visible name of your addon: it will be displayed to the user in the
+ of numbers separated by dots).[br][br]
+ The version is compared when an addon is installed and KVIrc complains if the user
+ tries to downgrade an addon (that is to install a less recent version over a more recent one).[br]
+ The third parameter is the visible name of your addon: it will be displayed to the user in the
addon management dialog. It can contain the [fnc]$tr[/fnc] function so you
can have it translated to several languages. The fourth parameter
is a short description of the feature that the addon implements; it can
@@ -1328,8 +1275,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
version required to run the addon. The sixth parameter is the icon to show in
the manager: it has to be 32x32 pixel big. There are also some switches that
can be used to fiddle a little bit more :)
- [/p]
- [p]
+ [br]
The callback instruction that follows the registration command is the
uninstallation code. KVIrc will invoke it when the user will ask for your
addon to be uninstalled. Don't assume that your addon will be never
@@ -1347,17 +1293,15 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
...
}
[/example]
- [/p]
-
+ [br]
[big]A typical addon layout[/big]
- [p]
+ [br]
As stated above, the addons are usually shipped in a compressed archive.
Once uncompressed, the installer will check the directory tree containing the
addon code and all the related files.
In order to have uniformity the installer complains if the structure is not
respected.
- [/p]
- [p]
+ [br]
[pre]
[b]name-version[/b]
+- init.kvs
@@ -1391,24 +1335,19 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
+- hints.html
\- ...
[/pre]
- [/p]
- [p]
The entries in [b]bold[/b] are directories while the other are files.
Please note that you need all of these directories or the routine that
automagically creates the installer will fail.
- [/p]
- [p]
+ [br]
The toplevel directory should be named with your addon name and version.
Use no spaces in the directory entries (this will make the things simpler for
people that want to use your addon).
- [/p]
- [p]
+ [br]
Hint: Remember that your addon is going to be installed on different platforms
(at least Linux, OS X and Windows based).
The poor windows' notepad has serious problems with reading text
files that contain only linefeeds as line separators. Keep it in mind...
- [/p]
- [p]
+ [br]
The [b]initialization script[/b] has to be named init.kvs and must contain all the
routines to register your addon.
[example]
@@ -1450,35 +1389,30 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
[comment]# A script containing some logging functions[/comment]
MyAddon_functions_logging.kvs
[/example]
- [/p]
- [p]
- The [b]locale[/b] directory should contain the *.mo files for your tranlations.
+ [br]
+ The [b]locale[/b] directory should contain the *.mo files for your translations.
The localization process of a script is explained in [doc:localization]this document[/doc].
Your *.mo filenames should be prefixed by your addon name.
- [/p]
- [p]
+ [br]
The [b]configuration directory[/b] [i]config[/i] should contains only the files
which store the configuration of your addon and must end with the .kvc
extension.
- [/p]
- [p]
+ [br]
The [b]pics[/b] and [b]sound[/b] (if relevant) directories should contain
your multimedia files. I's a good idea to have your pics file in PNG format
and sound files in WAV format.
- [/p]
- [p]
+ [br]
The [b]help[/b] directory should contain subdirectories for each language
your help files are written in. The languages dirs should be named
with the language code also used for the translation files (like [i]en[/i], [i]it[/i]
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...
- [/p]
-
+ [br]
[big]Some examples[/big]
- [p]The code below is just an example of how to write a useful initalizazion of
+ 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)
@@ -1541,14 +1475,12 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
...
}
[/example]
- [/p]
-
+ [br]
[big]The help and configuration callbacks[/big]
- [p]
+ [br]
Each addon can have a help and a configuration callback. These are set
respectively by [cmd]addon.sethelpcallback[/cmd] and [cmd]addon.setconfigurecallback[/cmd].
- [/p]
- [p]
+ [br]
The help callback will be invoked by KVIrc when the user will ask help for your addon (mainly
from the addon management dialog, but not necessarily). It should call [cmd]help.open[/cmd]
with the name of your documentation index html file (it should be relative
@@ -1556,17 +1488,15 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
lookup the right language). If you provide no help callback, the buttons
for requesting help will be simply disabled. (A good an relatively complex addon
*should* have at least a minimal help file explaining the features).
- [/p]
- [p]
+ [br]
The configuration callback will be invoked when the user will try to configure
your addon from the addon management dialog. This callback is useful
mainly for 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.
- [/p]
-
+ [br]
[big]The real addon work[/big]
- [p]
+ [br]
The real addon work is done by the scripts contained in the src directory.
They will likely add aliases (maybe in a nice namespace named against your addon),
register event handlers, create actions, timers, toolbars and object classes.
@@ -1577,17 +1507,14 @@ 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 :)
- [/p]
-
+ [br]
[big]Where to start[/big]
- [p]
- It is a good idea to start on the KVIrc web site. There are surely
- several addons to look at. Pick one that seems simple and analyze its
- layout and code (wow... the free software!). It will be easier to do than it was to explain it :D
- [/p]
- [p]
+ [br]
+ It is a good idea to start in the KVIrc scripts GitHub repository https://github.com/kvirc/kvirc-scripts. There are surely
+ several addons to look at. Pick one that seems simple and analyze its layout and code
+ (wow... amazing free software!). It will be easier to do than it was to explain it :D[br]
Have fun! :)
- [/p]
+ [br]
*/
@@ -1633,7 +1560,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
but this is a matter of taste; personally I feel really well with that.[br]
Just as example, here go my fundamental convention rules for C++:[br]
[br]
- - The type of the variable is encoded at the beginning of the variable name:[br]
+ - The type of the variable is encoded at the beginning of the variable name:[br]
[br]
- b prefix for the boolean variables[br]
- i prefix for signed integers[br]
@@ -1642,10 +1569,10 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
- sz prefix for strings (this is rather for string classes)[br]
- ...[br]
[br]
- - Pointers have a [b]p[/b] prefix prepended[br]
- - Global variables start with a [b]g_[/b] prefix[br]
- - Member variables start with a [b]m_[/b] prefix[br]
- - Exception comes for local variables with obvious semantics[br]
+ - Pointers have a [b]p[/b] prefix prepended[br]
+ - Global variables start with a [b]g_[/b] prefix[br]
+ - Member variables start with a [b]m_[/b] prefix[br]
+ - Exception comes for local variables with obvious semantics[br]
[br]
- i,j,k,l for local loop counters[br]
- [i]aux[/i] and [i]tmp[/i] for local obvious short-term temporary variables[br]
@@ -1668,7 +1595,6 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
@short:
Syntactic rules of the KVIrc scripting language
@body:
-
In the following table you can find a good part of the
KVIrc scripting language syntactic rules.[br]
[br]
@@ -1690,7 +1616,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
[/tr]
[tr]
[td]<whitespace>[/td]
- [td]{<space>|<tab>|<newline>}['\'<newline>][<whitespace>][/td]
+ [td]{<space>|<tab>|<newline>}['\'<newline>][<whitespace>][/td]
[/tr]
[tr]
[td]<space>[/td]
@@ -1810,7 +1736,7 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
[/tr]
[tr]
[td]<command dependent part>[/td]
- [td][b]Production in each command help page[/b][/td]
+ [td]Production in each command help page[/td]
[/tr]
[/table]
To be continued...
@@ -1845,13 +1771,11 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
All about the KVS variable and datatype management
@body:
[title]Basic syntax[/title]
-
- [p]
+ [br]
A variable identifier is composed by a '%' (percent) sign followed
by a sequence of letters, digits or underscores.
Examples of valid variable names are:
- [/p]
-
+ [br]
[example]
%i
%variable
@@ -1861,42 +1785,34 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
%2ndName
%_hidden
[/example]
-
- [p]
+ [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).
- [/p]
-
+ [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]
-
- [p]
+ [br]
Variables can be local or global.
Local variables preserve their contents only inside the [b]scope[/b] of a single script.
Global variables are shared between all the scripts and preserve their contents
until they are explicitly unset or until KVIrc quits.
- [/p]
-
- [p]
+ [br]
Local variables start with a [b]lowercase letter[/b] while the global ones with an [b]uppercase letter[/b].
- [/p]
-
+ [br]
[example]
%var = 10; [comment]# this is a local variable[/comment]
%Var = 10; [comment]# this is a global variable[/comment]
[/example]
-
- [p]
+ [br]
You can also force a variable that start with a lowercase letter to be global
- by predeclaring it with the [cmd]global[/cmd] keyword.[br]
- [/p]
-
+ by pre-declaring it with the [cmd]global[/cmd] keyword.[br]
+ [br]
[example]
[comment]# copy this script to a file and run /[cmd]parse[/cmd] <filename>[/comment]
global %a
@@ -1905,42 +1821,32 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
[comment]# %a is a global variable now : all the other scripts can see its value[/comment]
[comment]# %b is a local variable and no other scripts can see its value[/comment]
[/example]
-
- [p]
+ [br]
If you have executed the example above from a file (by the means of [cmd]parse[/cmd])
then now you can type
- [/p]
-
+ [br]
[example]
[cmd]echo[/cmd] %a
[/example]
-
- [p]
+ [br]
in the commandline to see the contents of the variable %a.
If you also try
- [/p]
-
+ [br]
[example]
[cmd]echo[/cmd] %b
[/example]
-
- [p]
+ [br]
you will see nothing printed since %b was local to the parsed script.
- [/p]
-
+ [br]
[title]Data types[/title]
-
- [p]
+ [br]
KVS has three main categories of data types: scalars, arrays and associative
arrays (also known as dictionaries or hashes).
- [/p]
-
+ [br]
[subtitle]Scalars[/subtitle]
-
- [p]
+ [br]
The scalars are simple variables containing a single value (a string or an integer).
- [/p]
-
+ [br]
[example]
[comment]# %a is a scalar variable[/comment]
%a = "This is a string"
@@ -1948,22 +1854,18 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
%a = 24.5
[cmd]echo[/cmd] %a
[/example]
-
+ [br]
[subtitle]Arrays[/subtitle]
-
- [p]
+ [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.
- [/p]
-
+ [br]
[example]
%arrayName[index]
[/example]
-
- [p]
+ [br]
An easy way to create an array is to use the [fnc]$array[/fnc] function.
- [/p]
-
+ [br]
[example]
%a = $array("element1","element2","element3"); [comment]# Create an array with 3 items[/comment]
[cmd]for[/cmd](%i=0;%i<3;%i++)
@@ -1971,62 +1873,51 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
echo %a[%i]; [comment]# Accessing the %i'th element of the array[/comment]
}
[/example]
-
- [p]
+ [br]
Note that in the example above %a refers to the whole array while %a[%i] refers
to one of its elements, in particular the one with index %i.
You also create an array by explicitly assigning to one of its elements:
- [/p]
-
+ [br]
[example]
%a[9] = "This is an array element";
[/example]
-
- [p]
+ [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.
- [/p]
-
+ [br]
[example]
%a[9] = "This is an array element";
echo $length(%a)
[/example]
-
- [p]
+ [br]
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:
- [/p]
-
+ [br]
[example]
%a[1000000] = "An array element faaaaaar away...";
echo $length(%a)
[/example]
-
+ [br]
[note]
- [p]
- Food for thoughts:
- [/p]
- [p]
- KVIrc allocates a pointer for each item in the array. The pointer is
- empty when the item is unset and points to an additional block
- of memory when the item is set. The size of a pointer is platform
- dependent: on the platforms supported by KVIrc it's either 32 or 64 bit.
- The size of the additional block depends both on the platform
- and on the contents of the item... it's average value may
- be around 16 bytes. The array size is determined by the last SET element index.
- All this this means that in the worst case (64 bit assumption) an array in
- that the highest indexed item set is N eats up at least N*8+16 bytes of memory.
- [/p]
+ [br]
+ [big]Food for thoughts:[/big]
+ KVIrc allocates a pointer for each item in the array. The pointer is
+ empty when the item is unset and points to an additional block
+ of memory when the item is set. The size of a pointer is platform
+ dependent: on the platforms supported by KVIrc it's either 32 or 64-bit.
+ The size of the additional block depends both on the platform
+ and on the contents of the item... it's average value may
+ be around 16 bytes. The array size is determined by the last SET element index.
+ All this this means that in the worst case (64 bit assumption) an array in
+ that the highest indexed item set is N eats up at least N*8+16 bytes of memory.
[/note]
-
- [p]
+ [br]
Besides the traditional indexed looping method you
can also use the [cmd]foreach[/cmd] command to iterate the items of an array.
Be aware that [cmd]foreach[/cmd] will [b]not[/b] iterate over unset items in the
array unless you use the -a switch.
- [/p]
-
+ [br]
[example]
%Array[0]=Pippo
%Array[1]=Pluto
@@ -2034,26 +1925,21 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
%Array[5]=Prova
[cmd]foreach[/cmd](%item,%Array)[cmd]echo[/cmd] Got Item: %item
[/example]
-
- [p]
+ [br]
Note that the items 3 and 4 are simply skipped.
- [/p]
-
+ [br]
[subtitle]Hashes[/subtitle]
-
- [p]
+ [br]
The hashes are collections of items indexed by strings: the word [i]hash[/i]
is in fact a shortcut for [i]hashtable[/i]. In literature hashes are also called
[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.
- [/p]
-
+ [br]
[example]
%hashName{key}
[/example]
-
- [p]
+ [br]
An easy way to create a hash is to use the [fnc]$hash[/fnc] function.
[/p]
[example]
@@ -2063,29 +1949,23 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
echo "KEY:" %key "VALUE:" %a{%key};
}
[/example]
-
- [p]
+ [br]
Note that in the example above %a refers to the whole hash while %a{%i} refers
to one of its elements, in particular the one with the key %key.
You also create a hash by explicitly assigning to one of its elements:
- [/p]
-
+ [br]
[example]
%a{"MyKey"} = "MyValue"
[/example]
-
- [p]
+ [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.
- [/p]
-
+ [br]
[title]Mutability of variables[/title]
-
- [p]
+ [br]
KVS is not strictly typed: any variable can assume different type identities at different times,
even in the same script.
- [/p]
-
+ [br]
[example]
[comment]# %a is a scalar[/comment]
%a = "This is a string"
@@ -2094,95 +1974,66 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
[comment]# %a becomes a hash with two values[/comment]
%a = $hash("key1","value1","key2","value2");
[/example]
-
- [p]
+ [br]
In literature this kind of variable is called [b]variant[/b] and this is the
term that you will find all around the documentation when an explicit
data type is not requested.
- [/p]
-
- [p]
+ [br]
Note that array and hash items are variants too. This means that you can have arrays
of arrays, hashes of arrays of hashes and any other multidimensional combination you like.
However remember that hash keys are strings and not variants so you can't use an array as hash key.
- [/p]
-
+ [br]
[example]
[comment]# here we eat 256 locations of memory at once :)[/comment]
%a[16][16] = 10
[comment]# a hash of hashes: here we eat just two memory locations[/comment]
%a{"16"}{"16"} = 10
[/example]
-
-
- [p]
+ [br]
In most cases the KVS engine manages automatically the conversion between data types.
For example, when you put an array in a place where a scalar is requested, KVIrc
automatically transforms it to a scalar string by joining all the items with a comma.
- [/p]
-
+ [br]
[example]
%a = $array("element1","element2","element3");
echo %a; [comment]# echo expects its arguments to be scalar[/comment]
[/example]
-
- [p]
+ [br]
Conversely, when you put a scalar in place of an array, KVIrc automatically
transforms it to an array with a single item. In this way a function like
[fnc]$sort[/fnc] works also with a scalar.
- [/p]
-
- [p]
+ [br]
In literature the conversions between data types are called [b]casts[/b]. When
the conversion is automatic the cast is said to be [b]implicit[/b].
- [/p]
-
- [p]
+ [br]
KVS handles also the other possible implicit casts: scalar->hash,hash->scalar,array->hash,hash->array.
Experiment with it.
- [/p]
-
+ [br]
[title]More about scalars[/title]
-
- [p]
+ [br]
Internally KVS is implicitly typed: the [i]scalar[/i] data type is in fact
a set of types that KVIrc manages silently. The types are: integer, string, real, boolean and hobject.
- [/p]
-
- [p]
+ [br]
Integers are non-floating point numbers. Their allowable range depends on the underlying
platform integer size: usually 32 or 64 bit.
- [/p]
-
- [p]
+ [br]
Reals are floating point numbers. Their allowable range and precision depends on the underlying
platform.
- [/p]
-
- [p]
+ [br]
Booleans are either true or false values. For boolean constants, use [fnc]$true[/fnc] or [fnc]$false[/fnc].
Don't use [i]true[/i] or [i]false[/i], because the engine sees them as non-empty strings, which always evaluate as true.
- [/p]
-
- [p]
- Hobject stands for Handle to Object and it is a sort of a C++ pointer.
+ [br]
+ hobject stands for Handle to Object and it is a sort of a C++ pointer.
Detailed description of objects is in [doc:objects]this document[/doc].
- [/p]
-
- [p]
+ [br]
Basically anything else fails in the [i]string[/i] category.
- [/p]
-
- [p]
+ [br]
In most cases KVS manages all the conversions between data types automatically.
For example an integer becomes a true boolean when it's non zero and a false boolean
otherwise, a real becomes an integer by truncating it's fractional part...
- [/p]
-
- [p]
+ [br]
You can find out the type of a specified variable by using the [fnc]$typeof[/fnc]() function.
- [/p]
-
+ [br]
[example]
%a = 1
echo $typeof(%a)
@@ -2193,33 +2044,25 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
%a = "test"
echo $typeof(%a)
[/example]
-
- [p]
+ [br]
There is also another subtle type of scalar called [i]nothing[/i]. It stands for an empty (unset) variable.
- [/p]
-
+ [br]
[example]
%a = $nothing
echo $typeof(%a)
[/example]
-
- [p]
+ [br]
Nothing is something in between a data type and a special value for all the other data types:
it represents absence of information.
This may look a bit confusing but realize that all the unreferenced KVS variable are in fact of type [i]nothing[/i]:
they just don't exist. This means that you can use [fnc]$nothing[/fnc]() to effectively
unset a variable.
- [p]
-
- [p]
+ [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.
- [/p]
-
-
+ [br]
[title]Explicit casts[/title]
-
- [p]
+ [br]
You can make explicit conversions between some data types by using the casting functions.
[fnc]$integer[/fnc]() will attempt to convert the variant parameter to an integer, [fnc]$real[/fnc]()
will cast to a floating point value, [fnc]$boolean[/fnc]() will convert to a
@@ -2228,58 +2071,46 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
a dictionary. By assigning the special [fnc]$nothing[/fnc]() value you will
convert to the nothing data type (or simply unset the variable).
The only explicit conversion that is not possible is to hobject.
- [/p]
-
- [p]
+ [br]
As stated several times in this document, KVS tries to manage the casts automatically
so you usually don't need to care about it. The explicit casts are provided for
the very few cases where an automatic conversion would lead to an unexpected value (for your script)
and for writer's clarity.
- [/p]
-
+ [br]
[title]More about variables life-cycle[/title]
-
- [p]
+ [br]
As stated above variables start their existence when you assign something to them.
After a variable has been created it persists until it goes out of his scope (remember
about local and global variables?) or you explicitly destroy it. You will usually
not care about it and just leave the KVS engine to do his cleaning job but it's still worth
knowing that you actually can force KVIrc to free the memory used by a variable.
- [/p]
-
- [p]
+ [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.
- [/p]
-
+ [br]
[example]
%a = [fnc]$array[/fnc]("data","for","a","really","huge","array","of","items")
%b = 10
%c = "just a string that eats memory"
[cmd]unset[/cmd] %a,%b,%c
[/example]
-
- [p]
+ [br]
The KVS engine treats unset variables just like empty strings. The opposite is also valid: empty
strings behave like empty (unset) variables. This means that you can assign an empty string
to a variable to unset it.
- [/p]
-
+ [br]
[example]
%a = "test"; [comment]# %a starts his existence[/comment]
%b = "test2";
%a = ""; [comment]# %a is in fact unset[/comment]
%b = ; [comment]# syntactically this is just the same as above[/comment]
[/example]
-
- [p]
+ [br]
Note that because of mutability of variables (explained above) you can use the empty string
assignment also to free arrays and hashes.
- [/p]
-
+ [br]
[title]Extended scope variables[/title]
-
- [p]
+ [br]
Beside local and global variables there is a third family of them.
Variables that have a ':' character just after the leading '%' are [b]extended scope[/b] variables.
[i]%:index[/i], [i]%:Hello[/i], [i]%:something.else[/i] are all valid special scope variable names.
@@ -2287,62 +2118,53 @@ KviKvsTreeNodeInstruction * KviKvsParser::parseAsParameter(const QChar * pBuffer
"Extended scope" means that these variables are somewhere in the middle between
global and local variables. They normally act as local, but in some cases their [b]lifetime[/b] and [b]visibility[/b]
may be extended.
- [/p]
-
- [p]
+ [br]
For example, in the popups, all the special scope variables
are visible during all the "lifetime" of a popup (so from the prologue code call to
the moment when the user selects an item and the corresponding code is executed).
This allows you to pre-calculate some data or conditions in the popup prologue
and use this data in the popup item conditions and item handlers.
- [/p]
-
+ [br]
[title]Variable evaluation[/title]
-
- [p]
+ [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
- [/p]
+ [br]
[example]
%number = 1st; echo this is my %number variable test
[/example]
- [p]
+ [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.
- [/p]
+ [br]
[example]
%number = 1; echo this is my %numberst variable test
[/example]
- [p]
+ [br]
KVS will assign [b]1[/b] to %number in this case but the next variable
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:
- [/p]
+ [br]
[example]
%number = 1; echo this is my %number\st variable test
[/example]
-
+ [br]
[title]Putting it all together[/title]
-
- [p]
+ [br]
Variables can be either local, global or have an extended scope. Their start to exist
when you first assign something to them and they disappear when they go out of their
scope or you explicitly destroy them.
- [/p]
-
- [p]
+ [br]
KVS has 8 builtin data types: string, integer, real, boolean, hobject, nothing, array and hash.
The first 6 are scalar data types while the last two are not.
- [/p]
-
- [p]
+ [br]
When possible, KVS manages all the conversions between data types silently.
In the few cases in that an implicit conversion is not possible you have to manage the conversion
manually otherwise KVS will complain.
- [/p]
+ [br]
*/
diff --git a/src/kvirc/kvs/parser/KviKvsParser_expression.cpp b/src/kvirc/kvs/parser/KviKvsParser_expression.cpp
index 86f138c3e..8230eee72 100644
--- a/src/kvirc/kvs/parser/KviKvsParser_expression.cpp
+++ b/src/kvirc/kvs/parser/KviKvsParser_expression.cpp
@@ -32,72 +32,72 @@
//#warning "FIXME: expression eval doc!"
- /*
- @doc: expressioneval
- @type:
- language
- @title:
- Expression evaluation identifier
- @syntax:
- $(<expression>)
- @keyterms:
- expressions
- @short:
- Expression evaluation identifier
- @description:
- Evaluates <expression> and returns its result.[br]
- If <expression> is a single string, array or hash, it is returned unmodified.[br]
- In any other case the expression evaluation returns a numeric value, either real or integer.[br]
- The expressions are really close to the C ones and have some minor extensions.[br]
- The supported operators are +,-,*,/,|,&,^,||,&&,^^,>>,<<,<,>,<=,>=,==,!= and <> (synonim for !=).[br]
- The following table describes their meaning.[br]
- [table]
- [tr][td][b]Operator[/b][/td][td][b]Description[/b][/td][/tr]
- [tr][td]a + b[/td][td]Arithmetic sum: valid only for numeric operands[/td][/tr]
- [tr][td]a - b[/td][td]Arithmetic subtraction: valid only for numeric operands[/td][/tr]
- [tr][td]a / b[/td][td]Arithmetic division: valid only for numeric operands[/td][/tr]
- [tr][td]a * b[/td][td]Arithmetic multiplication: valid only for numeric operands[/td][/tr]
- [tr][td]a % b[/td][td]Arithmetic modulus: valid only for numeric operands[/td][/tr]
- [tr][td]a || b[/td][td]Logical or: valid only for boolean operands[/td][/tr]
- [tr][td]a && b[/td][td]Logical and: valid only for boolean operands[/td][/tr]
- [tr][td]a ^^ b[/td][td]Logical xor: valid only for boolean operands[/td][/tr]
- [tr][td]a >> b[/td][td]Bitwise shift right: valid only for integer operands[/td][/tr]
- [tr][td]a << b[/td][td]Bitwise shift left: valid only for integer operands[/td][/tr]
- [tr][td]a | b[/td][td]Bitwise or: valid only for integer operands[/td][/tr]
- [tr][td]a & b[/td][td]Bitwise and: valid only for integer operands[/td][/tr]
- [tr][td]a ^ b[/td][td]Bitwise xor: valid only for integer operands[/td][/tr]
- [tr][td]a > b[/td][td]Greater than: valid for numeric or string operands. Case sensitive[/td][/tr]
- [tr][td]a < b[/td][td]Lower than: valid for numeric or string operands. Case sensitive[/td][/tr]
- [tr][td]a >= b[/td][td]Greater or equal to: valid for numeric or string operands. Case sensitive[/td][/tr]
- [tr][td]a <= b[/td][td]Lower or equal to: valid for numeric or string operands. Case sensitive[/td][/tr]
- [tr][td]a != b[/td][td]Not equal to: valid for numeric or string operands. Case sensitive[/td][/tr]
- [tr][td]a == b[/td][td]Equal to: valid for numeric or string operands. Case sensitive[/td][/tr]
- [/table]
- The expressions can contain integer, real or string constants and variable operands.[br]
- The integer constants can be also specified as hexadecimal numbers by prefixing them by '0x'.[br]
- The string constants should be enclosed in quotes.[br]
- @examples:
- [example]
- echo $(10 + 5 * 100)
- echo $(10 / 3)
- echo $(10 / 3.0)
- echo $(10.0 + 5 * 100)
- echo $(145 & 2)
- echo $("hello" > "ciao")
- echo $(10 == "10")
- %a = 100
- %b = 50.3
- %c = "test"
- echo $(%a + %b)
- echo $("%a%b" + 1)
- echo $(%a + %b > %c)
- echo $(-(10 + 20) * 3)
- echo $(1 ^ 2)
- echo $(1 ^ 1)
- echo $(0xffff == 65535)
- ...
- [/example]
- */
+/*
+ @doc: expressioneval
+ @type:
+ language
+ @title:
+ Expression evaluation identifier
+ @syntax:
+ $(<expression>)
+ @keyterms:
+ expressions
+ @short:
+ Expression evaluation identifier
+ @description:
+ Evaluates <expression> and returns its result.[br]
+ If <expression> is a single string, array or hash, it is returned unmodified.[br]
+ In any other case the expression evaluation returns a numeric value, either real or integer.[br]
+ The expressions are really close to the C ones and have some minor extensions.[br]
+ The supported operators are [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]
+ [table]
+ [tr][td][b]Operator[/b][/td][td][b]Description[/b][/td][/tr]
+ [tr][td]a + b[/td][td]Arithmetic sum: valid only for numeric operands[/td][/tr]
+ [tr][td]a - b[/td][td]Arithmetic subtraction: valid only for numeric operands[/td][/tr]
+ [tr][td]a / b[/td][td]Arithmetic division: valid only for numeric operands[/td][/tr]
+ [tr][td]a * b[/td][td]Arithmetic multiplication: valid only for numeric operands[/td][/tr]
+ [tr][td]a % b[/td][td]Arithmetic modulus: valid only for numeric operands[/td][/tr]
+ [tr][td]a || b[/td][td]Logical or: valid only for boolean operands[/td][/tr]
+ [tr][td]a && b[/td][td]Logical and: valid only for boolean operands[/td][/tr]
+ [tr][td]a ^^ b[/td][td]Logical xor: valid only for boolean operands[/td][/tr]
+ [tr][td]a >> b[/td][td]Bitwise shift right: valid only for integer operands[/td][/tr]
+ [tr][td]a << b[/td][td]Bitwise shift left: valid only for integer operands[/td][/tr]
+ [tr][td]a | b[/td][td]Bitwise or: valid only for integer operands[/td][/tr]
+ [tr][td]a & b[/td][td]Bitwise and: valid only for integer operands[/td][/tr]
+ [tr][td]a ^ b[/td][td]Bitwise xor: valid only for integer operands[/td][/tr]
+ [tr][td]a > b[/td][td]Greater than: valid for numeric or string operands. Case sensitive[/td][/tr]
+ [tr][td]a < b[/td][td]Lower than: valid for numeric or string operands. Case sensitive[/td][/tr]
+ [tr][td]a >= b[/td][td]Greater or equal to: valid for numeric or string operands. Case sensitive[/td][/tr]
+ [tr][td]a <= b[/td][td]Lower or equal to: valid for numeric or string operands. Case sensitive[/td][/tr]
+ [tr][td]a != b[/td][td]Not equal to: valid for numeric or string operands. Case sensitive[/td][/tr]
+ [tr][td]a == b[/td][td]Equal to: valid for numeric or string operands. Case sensitive[/td][/tr]
+ [/table]
+ The expressions can contain integer, real or string constants and variable operands.[br]
+ The integer constants can be also specified as hexadecimal numbers by prefixing them by '0x'.[br]
+ The string constants should be enclosed in quotes.[br]
+ @examples:
+ [example]
+ echo $(10 + 5 * 100)
+ echo $(10 / 3)
+ echo $(10 / 3.0)
+ echo $(10.0 + 5 * 100)
+ echo $(145 & 2)
+ echo $("hello" > "ciao")
+ echo $(10 == "10")
+ %a = 100
+ %b = 50.3
+ %c = "test"
+ echo $(%a + %b)
+ echo $("%a%b" + 1)
+ echo $(%a + %b > %c)
+ echo $(-(10 + 20) * 3)
+ echo $(1 ^ 2)
+ echo $(1 ^ 1)
+ echo $(0xffff == 65535)
+ ...
+ [/example]
+*/
diff --git a/src/kvirc/kvs/parser/KviKvsParser_lside.cpp b/src/kvirc/kvs/parser/KviKvsParser_lside.cpp
index 65790d17e..89c2f22c2 100644
--- a/src/kvirc/kvs/parser/KviKvsParser_lside.cpp
+++ b/src/kvirc/kvs/parser/KviKvsParser_lside.cpp
@@ -51,7 +51,7 @@
Some operators have no [right_operand] and these are called [b]unary operators[/b]:
they operate directly on <left_operand>.[br]
Some operators, like arithmetic ones, are typically used inside the special function
- [b]$(<expression>)[/b], called the "[doc:expressioneval]Expression evaluation identifier[/doc]";
+ [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]
@@ -158,7 +158,7 @@ end_of_the_param:
@short:
Assignment operation
@body:
- The assignment is the "plainest" of the operators: it works just like in any other programming language.[br]
+ The assignment is the [i]plainest[/i] of the operators: it works just like in any other programming language.[br]
The syntax is:[br]
[br]
[b]<target> = <source>[/b]
@@ -169,45 +169,45 @@ end_of_the_param:
If <source> evaluates to an empty value then the <target> variable is unset.
@examples:
[example]
- [comment]# Assigning a constant to the variable %Tmp[/comment]
- %Tmp = 1
- [cmd]echo[/cmd] %Tmp
- [comment]# Assigning a string constant to the variable %Tmp[/comment]
- %Tmp = some string
- [cmd]echo[/cmd] %Tmp
- [comment]# Assigning a string constant to the variable %Tmp[/comment]
- %Tmp = "some string with whitespace &nbsp; &nbsp; &nbsp; &nbsp; preserved"
- [cmd]echo[/cmd] %Tmp
- [comment]# Assigning a variable to another variable copies its contents[/comment]
- %Someothervariable = "Contents"
- %Tmp = %Someothervariable
- [cmd]echo[/cmd] %Tmp
- [comment]# Assigning a variable string to the variable %z[/comment]
- %color = blue
- %z = my eyes are %color
- [cmd]echo[/cmd] %z
- [comment]# Assigning a variable string (with a function call inside) to the variable %x[/comment]
- %x = the system os is [fnc]$system.osname[/fnc]
- [cmd]echo[/cmd] %x
- [comment]# Assigning an empty string to the local variable %y unsets %y[/comment]
- %x =
- [cmd]echo[/cmd] %y
- [comment]# This is equivalent to the above[/comment]
- %y = ""
- [comment]# This is equivalent too, if $function evaluates to an empty string[/comment]
- %y = $function()
- [comment]# Assigning a variable string to a hash entry[/comment]
- %Dict{key} = [fnc]$system.osname[/fnc]\ian
- [comment]# Unsetting an array entry[/comment]
- %mydict[23] = ""
- [comment]# Assigning a hash to another: %mydict[] becomes a copy of %anotherdict[][/comment]
- %anotherdict{"The key"} = "Some dummy value"
- %mydict = %anotherdict
- [cmd]echo[/cmd]%mydict{"The key"}
- [comment]# This will convert %mydict to be a scalar variable (deleting all the %mydict contents!)[/comment]
- %mydict = "some default value"
- [comment]# Unsetting a whole hash[/comment]
- %anotherdict =
+ [comment]# Assigning a constant to the variable %Tmp[/comment]
+ %Tmp = 1
+ [cmd]echo[/cmd] %Tmp
+ [comment]# Assigning a string constant to the variable %Tmp[/comment]
+ %Tmp = some string
+ [cmd]echo[/cmd] %Tmp
+ [comment]# Assigning a string constant to the variable %Tmp[/comment]
+ %Tmp = "some string with whitespace &nbsp; &nbsp; &nbsp; &nbsp; preserved"
+ [cmd]echo[/cmd] %Tmp
+ [comment]# Assigning a variable to another variable copies its contents[/comment]
+ %Someothervariable = "Contents"
+ %Tmp = %Someothervariable
+ [cmd]echo[/cmd] %Tmp
+ [comment]# Assigning a variable string to the variable %z[/comment]
+ %color = blue
+ %z = my eyes are %color
+ [cmd]echo[/cmd] %z
+ [comment]# Assigning a variable string (with a function call inside) to the variable %x[/comment]
+ %x = the system os is [fnc]$system.osname[/fnc]
+ [cmd]echo[/cmd] %x
+ [comment]# Assigning an empty string to the local variable %y unsets %y[/comment]
+ %x =
+ [cmd]echo[/cmd] %y
+ [comment]# This is equivalent to the above[/comment]
+ %y = ""
+ [comment]# This is equivalent too, if $function evaluates to an empty string[/comment]
+ %y = $function()
+ [comment]# Assigning a variable string to a hash entry[/comment]
+ %Dict{key} = [fnc]$system.osname[/fnc]\ian
+ [comment]# Unsetting an array entry[/comment]
+ %mydict[23] = ""
+ [comment]# Assigning a hash to another: %mydict[] becomes a copy of %anotherdict[][/comment]
+ %anotherdict{"The key"} = "Some dummy value"
+ %mydict = %anotherdict
+ [cmd]echo[/cmd]%mydict{"The key"}
+ [comment]# This will convert %mydict to be a scalar variable (deleting all the %mydict contents!)[/comment]
+ %mydict = "some default value"
+ [comment]# Unsetting a whole hash[/comment]
+ %anotherdict =
[/example]
*/
@@ -229,31 +229,31 @@ end_of_the_param:
[b]<target>++[/b][br]
[b]<target>--[/b][br]
[br]
- ++ increments <target> by one, -- decrements <target> by one.[br]
- These are equivalent to += 1 and -= 1.[br]
+ [b]++[/b] increments <target> by one, [b]--[/b] decrements <target> by one.[br]
+ These are equivalent to [b]+= 1[/b] and [b]-= 1[/b].[br]
<target> must be an existing variable and contain an integer value.[br]
If <target> contains a real value then the real is truncated to the nearest
integer and then incremented or decremented.[br]
@examples:
[example]
- %a=10
- [cmd]echo[/cmd] "Incrementing"
- [cmd]while[/cmd](%a < 20)
- {
- [cmd]echo[/cmd] %a
- [b]%a++[/b]
- }
- [cmd]echo[/cmd] "Decrementing"
- [cmd]while[/cmd](%a > 10)
- {
- [cmd]echo[/cmd] %a
- [b]%a--[/b]
- }
- [cmd]echo[/cmd] "Testing for loop"
- [cmd]for[/cmd](%a=0;%a < 10;[b]%a++[/b])
- {
- [cmd]echo[/cmd] %a
- }
+ %a=10
+ [cmd]echo[/cmd] "Incrementing"
+ [cmd]while[/cmd](%a < 20)
+ {
+ [cmd]echo[/cmd] %a
+ [b]%a++[/b]
+ }
+ [cmd]echo[/cmd] "Decrementing"
+ [cmd]while[/cmd](%a > 10)
+ {
+ [cmd]echo[/cmd] %a
+ [b]%a--[/b]
+ }
+ [cmd]echo[/cmd] "Testing for loop"
+ [cmd]for[/cmd](%a=0;%a < 10;[b]%a++[/b])
+ {
+ [cmd]echo[/cmd] %a
+ }
[/example]
@seealso:
[doc:operators]Operators[/doc]
@@ -388,10 +388,10 @@ end_of_the_param:
[b]<target> << <right_operand>[/b][br]
[b]<target> <, <right_operand>[/b][br]
[br]
- Operator .= appends <right_operand> to <target>.
- Operator << appends a space followed by <right_operand> to <target> if <target> is non empty,
+ Operator [b].=[/b] appends <right_operand> to <target>.
+ Operator [b]<<[/b] appends a space followed by <right_operand> to <target> if <target> is non empty,
otherwise sets <target> to <right_operand>.
- Operator <, is similar to << but uses a comma to separate the two variable contents.
+ Operator [b]<,[/b] is similar to [b]<<[/b] but uses a comma to separate the two variable contents.
The last two operators are useful in creating space-separated or comma-separated lists.
@examples:
[example]
@@ -443,29 +443,29 @@ end_of_the_param:
Binding operator
@body:
This operator is a really ugly, poor and clueless attempt to reach at least 1% of the
- power of the perl =~ operator :D[br]
+ power of the Perl [b]=~[/b] operator :D[br]
It allows some complex string operations to be performed efficiently by operating directly
on the left operand (in fact this is a lot faster in KVIrc since at least one step of parsing is skipped).[br]
Its basic syntax is:[br]
[br][b]<left_operand> =~ <operation>[parameters][/b][br][br]
- Where <operation> may be one of 't','s' and parameters depend on it.[br]
+ Where <operation> may be one of [b]t[/b], [b]s[/b] and parameters depend on it.[br]
<left_operand> is the target of the <operation>.[br]
If <left_operand> is an array or dictionary, the <operation> is executed on each item they contain.[br]
- Operation 't' is the transliteration.[br]
+ Operation [b]t[/b] is the transliteration.[br]
The complete syntax with parameters is:[br]
- [br][b]<left_operand> =~ t/<search characters>/<replacement characters>/[/b][br][br]
+ [br][b]<left_operand> [b]=~[/b] t/<search characters>/<replacement characters>/[/b][br][br]
where <search characters> is a string of characters that are replaced with the corresponding
characters in <replacement characters>.[br]
- This operation can be also named 'y' or 'tr' (to preserve some compatibility with other languages).
+ This operation can be also named [b]y[/b] or [b]tr[/b] (to preserve some compatibility with other languages).
[example]
- %A=This is a test string
- echo %A
- %A=~ tr/abcdefghi/ABCDEFGHI/
- echo %A
+ %A=This is a test string
+ echo %A
+ %A=~ tr/abcdefghi/ABCDEFGHI/
+ echo %A
[/example]
- Operation 's' is the substitution.[br]
+ Operation [b]s[/b] is the substitution.[br]
The complete syntax with parameters is:[br]
- [br][b]<left_operand> =~ s/<search pattern>/<replacement pattern>/[flags][/b][br][br]
+ [br][b]<left_operand> [b]=~[/b] s/<search pattern>/<replacement pattern>/[flags][/b][br][br]
where <search pattern> is an extended regular expression to be matched in the <left_operand>
and <replacement string> is a special pattern that will replace any occurrence found.[br]
<search pattern> may contain parentheses to capture parts of the matched text.
@@ -475,11 +475,11 @@ end_of_the_param:
since the KVS parser will first unquote the string and then pass it to the regexp engine.
That's also why we use \\N and not \N.[br]
\\0 is a special escape that will be replaced by the entire match (is always valid!).[br]
- [flags] may be a combination of the letters 'g','i' and 'w'.[br]
- 'g' causes the search to be global and not stop after the first occurrence of <search pattern>.[br]
- 'i' causes the search to be case insensitive.[br]
- 'm' causes the search to be case minimal (non-greedy).[br]
- 'w' causes the search pattern to be interpreted as a simple wildcard regular expression.
+ [flags] may be a combination of the letters [b]g[/b], [b]i[/b] and [b]w[/b].[br]
+ [b]g[/b] causes the search to be global and not stop after the first occurrence of <search pattern>.[br]
+ [b]i[/b] causes the search to be case insensitive.[br]
+ [b]m[/b] causes the search to be case minimal (non-greedy).[br]
+ [b]w[/b] causes the search pattern to be interpreted as a simple wildcard regular expression.
@examples:
[example]
%A=This is a test string
diff --git a/src/kvirc/kvs/parser/KviKvsParser_specialCommands.cpp b/src/kvirc/kvs/parser/KviKvsParser_specialCommands.cpp
index 1968f28a6..5c7dfeb7d 100644
--- a/src/kvirc/kvs/parser/KviKvsParser_specialCommands.cpp
+++ b/src/kvirc/kvs/parser/KviKvsParser_specialCommands.cpp
@@ -279,7 +279,7 @@ KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandGlobal()
declaring global variables by starting them with an uppercase letter
and declaring local variables by starting them with a lowercase one.
@examples:
- global %a,%b,%c;
+ global %a, %b, %c;
*/
while(KVSP_curCharUnicode == '%')
{
@@ -637,7 +637,7 @@ KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandWhile()
It can contain the [cmd]break[/cmd] command: in that case the
execution of the <command> will be immediately interrupted and the control
transferred to the command following this while block.[br]
- It is valid for <command> to be an empty command terminated with a ';'.
+ It is valid for <command> to be an empty command terminated with a [b];[/b].
<condition> is an expression as the ones evaluated by [doc:expressioneval]$(*)[/doc]
with the following extensions:[br]
If <condition> is a string, its length is evaluated: in this way a non-empty string
@@ -732,17 +732,19 @@ KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandDo()
causes the <condition> to be true, an empty array causes it to be false.[br]
If <condition> is a hash, the number of its entries is evaluated: in this way a non-empty hash
causes the <condition> to be true, an empty hash causes it to be false.[br]
- @examples:
+ @examples:
[example]
- %i = 0;
- do %i++; while(%i < 100);
- echo "After first execution: %i";
- %i = 10
- do {
- echo "Executed!";
- %i++;
- } while(%i < 1)
- echo "After second execution: %i";
+ %i = 0;
+ do %i++; while(%i < 100);
+ echo "After first execution: %i";
+ %i = 10
+ do
+ {
+ echo "Executed!";
+ %i++;
+ }
+ while(%i < 1)
+ echo "After second execution: %i";
[/example]
@seealso:
[cmd]while[/cmd]
@@ -836,7 +838,7 @@ KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandIf()
@description:
Executes <command1> if the <condition> evaluates
to true (non zero result).
- If the "else part" is given, <command2> is executed
+ If the [i]else part[/i] is given, <command2> is executed
if the <condition> evaluates to false (result == '0').[br]
<condition> is an expression evaluated in the same way as [doc:expressioneval]$(*)[/doc]
with the following extensions:[br]
@@ -847,8 +849,10 @@ KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandIf()
If <condition> is a hash, the number of its entries is evaluated - a non-empty hash
is true, an empty hash is false.[br]
@examples:
- if(%a != 10)[cmd]echo[/cmd] \%a was != 10
- else [cmd]echo[/cmd] \%a was 10!
+ [example]
+ if(%a != 10)[cmd]echo[/cmd] \%a was != 10
+ else [cmd]echo[/cmd] \%a was 10!
+ [/example]
*/
if(KVSP_curCharUnicode != '(')
@@ -1038,7 +1042,9 @@ KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandFor()
If <condition> is a hash, the number of its entries is evaluated: in this way a non-empty hash
causes the <condition> to be true, an empty hash causes it to be false.[br]
@examples:
- for(%a = 0;%a < 100;%a++)echo %a
+ [example]
+ for(%a = 0;%a < 100;%a++)echo %a
+ [/example]
*/
if(KVSP_curCharUnicode != '(')
@@ -1194,13 +1200,13 @@ KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandForeach()
[example]
foreach(%i,1,2,3,4,5,6,7,8,9)[cmd]echo[/cmd] %i
foreach(%chan,[fnc]$window.list[/fnc](channel))[cmd]me[/cmd] -r=%chan This is a test!
- [comment]// This will work too, and will do the same job[/comment]
+ [comment]# This will work too, and will do the same job[/comment]
%windows[] = [fnc]$window.list[/fnc](channel)
foreach(%chan,%windows[])[cmd]me[/cmd] -r=%chan This is a test!
- [comment]// And this too[/comment]
+ [comment]# And this too[/comment]
%windows[] = [fnc]$window.list[/fnc](channel)
foreach(%key,[fnc]$keys[/fnc](%windows[]))[cmd]me[/cmd] -r=%windows[%key] This is a test!
- [comment]// Another interesting example[/comment]
+ [comment]# Another interesting example[/comment]
[cmd]alias[/cmd](test){ [cmd]return[/cmd] [fnc]$hash[/fnc](1,a,2,b,3,c,4,d); };
foreach(%x,[fnc]$keys[/fnc]($test)){ [cmd]echo[/cmd] %x, $test{%x}; }
[/example]
@@ -1315,7 +1321,7 @@ KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandSwitch()
The switch command is based on the standard C 'switch' keyword.
It conditionally executes groups of commands chosen from a larger set of command groups.[br]
First <expression> is evaluated (<expression> is any arithmetic or string expression).[br]
- Then the 'match', 'regexp', 'case' and 'default' labels are evaluated sequentially
+ Then the [b]match[/b], [b]regexp[/b], [b]case[/b] and [b]default[/b] labels are evaluated sequentially
in the order of appearance.[br]
[b]case(<value>)[:]<command>[/b][br]
The <value> is evaluated and is compared against the result of <expression>.
@@ -1327,7 +1333,7 @@ KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandSwitch()
If the -p (--passthrough) option is enabled, than the switch command will execute all the instructions blocks
until a [cmd]break[/cmd] statement is found.[br]
[b]match(<value>)[:]<command>[/b][br]
- The <value> is expected to be a wildcard expression (wildcard characters being '*' and '?')
+ The <value> is expected to be a wildcard expression (wildcard characters being [b]*[/b] and [b]?[/b])
that is matched in a case insensitive fashion against <expression>.[br]
If a match occurs, the related <command> is executed.
The [cmd]break[/cmd] statement is treated as in the case label.[br]
@@ -1341,76 +1347,76 @@ KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandSwitch()
@examples:
[comment]# Try to change the 1 below to 2 or 3 to see the results[/comment]
[example]
- %tmp = 1
- switch(%tmp)
- {
- case(1):
- echo \%tmp was 1!
- break;
- case(2)
- echo \%tmp was 2!
- break;
- default:
- echo \%tmp was not 1 nor 2: it was %tmp!
- break;
- }
+ %tmp = 1
+ switch(%tmp)
+ {
+ case(1):
+ echo \%tmp was 1!
+ break;
+ case(2)
+ echo \%tmp was 2!
+ break;
+ default:
+ echo \%tmp was not 1 nor 2: it was %tmp!
+ break;
+ }
[/example]
- [comment]# A more complex example: change the 1 in 2 or 3[/comment]
[example]
- %tmp = 1
- switch(%tmp)
- {
- case(1):
- echo \%tmp was 1!
+ [comment]# A more complex example: change the 1 in 2 or 3[/comment]
+ %tmp = 1
+ switch(%tmp)
+ {
+ case(1):
+ echo \%tmp was 1!
case(2)
- echo \%tmp was 2!
- break;
- default:
- echo \%tmp was either 1 or something different from 2 (%tmp)
- break;
- }
+ echo \%tmp was 2!
+ break;
+ default:
+ echo \%tmp was either 1 or something different from 2 (%tmp)
+ break;
+ }
[/example]
- [comment]# An example of the -p switch[/comment]
[example]
- %tmp = 1
- switch -p (%tmp)
- {
- case(1):
- echo \%tmp was 1!
- case(2)
- echo \%tmp was 1 or 2!
+ [comment]# An example of the -p switch[/comment]
+ %tmp = 1
+ switch -p (%tmp)
+ {
+ case(1):
+ echo \%tmp was 1!
+ case(2)
+ echo \%tmp was 1 or 2!
+ break;
+ default:
+ echo \%tmp was not 1 or 2 (%tmp)
break;
- default:
- echo \%tmp was not 1 or 2 (%tmp)
- break;
- }
+ }
[/example]
- [comment]# An example with strings[/comment]
[example]
- %tmp = "This is a test"
- %tmp2 = "This is not a test"
- switch(%tmp)
- {
- case(%tmp2)
- echo \%tmp == \%tmp2
- break;
- case(%tmp)
+ [comment]# An example with strings[/comment]
+ %tmp = "This is a test"
+ %tmp2 = "This is not a test"
+ switch(%tmp)
{
- [comment]//do not break here[/comment]
- echo "Yeah... It's stupid... \%tmp == \%tmp :D"
+ case(%tmp2)
+ echo \%tmp == \%tmp2
+ break;
+ case(%tmp)
+ {
+ [comment]# do not break here[/comment]
+ echo "Yeah... It's stupid... \%tmp == \%tmp :D"
+ }
+ match("*TEST"):
+ echo "Matched *TEST"
+ regexp("[a-zA-Z ]*test"):
+ echo "Matched [a-zA-Z ]*text"
+ regexp("[a-zA-Z ]*not[a-zA-Z ]*"):
+ echo "Matched [a-zA-Z ]*not[a-zA-Z ]*"
+ default:
+ echo This is executed anyway (unless some break was called)
+ break;
}
- match("*TEST"):
- echo "Matched *TEST"
- regexp("[a-zA-Z ]*test"):
- echo "Matched [a-zA-Z ]*text"
- regexp("[a-zA-Z ]*not[a-zA-Z ]*"):
- echo "Matched [a-zA-Z ]*not[a-zA-Z ]*"
- default:
- echo This is executed anyway (unless some break was called)
- break;
- }
[/example]
- */
+*/
if(KVSP_curCharUnicode != '(')
{
@@ -1936,26 +1942,26 @@ KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandDefpopup()
the previous contents of the popups are cleared before updating.[br]
The popup is generated 'on the fly' when the [cmd]popup[/cmd] command
is called.[br]
- The 'item' keyword adds a menu item with visible <text>,
+ The [i]item[/i] keyword adds a menu item with visible <text>,
the optional <icon> and <command> as code to be executed when the item
is clicked. <text> is a string that is evaluated at [cmd]popup[/cmd]
call time and may contain identifiers and variables. If <expression>
is given, it is evaluated at [cmd]popup[/cmd] call time and if the result
is 0, the item is not shown in the physical popup.[br]
- The 'popup' keyword adds a submenu with visible <text>, the optional
+ The [i]popup[/i] keyword adds a submenu with visible <text>, the optional
<icon> and a popup body that has identical syntax to the defpopup body.
- The <expression> has the same meaning as with the 'item' keyword.[br]
+ The <expression> has the same meaning as with the [i]item[/i] keyword.[br]
The 'extpopup' keyword adds a submenu with visible <text>, the optional
icon and a popup body that is defined by the popup menu <name>. This
basically allows to nest popup menus and define their parts separately.
- <icon> and <expression> have the same meaning as with the 'item' keyword.[br]
- The 'separator' keyword adds a straight line between items (separator).[br]
+ <icon> and <expression> have the same meaning as with the [i]item[/i] keyword.[br]
+ The [i]separator[/i] keyword adds a straight line between items (separator).[br]
The 'separatorid' keyword adds a straight line between items, but permits to
specify a separator id.[br]
- The 'label' keywork adds a descriptive label that acts like a separator.[br]
- The 'prologue' keyword adds a <prologue_command> to be executed
+ The [i]label[/i] keywork adds a descriptive label that acts like a separator.[br]
+ The [i]prologue[/i] keyword adds a <prologue_command> to be executed
just before the popup is filled at [cmd]popup[/cmd] command call.[br]
- The 'epilogue' keyword adds an <epilogue_command> to be executed
+ The [i]epilogue[/i] keyword adds an <epilogue_command> to be executed
just after the popup has been filled at [cmd]popup[/cmd] command call.[br]
There can be multiple prologue and epilogue commands: their execution order
is undefined.[br]
@@ -1970,12 +1976,12 @@ KviKvsTreeNodeCommand * KviKvsParser::parseSpecialCommandDefpopup()
[example]
defpopup(test){}
[/example]
- This will remove the popup 'test' and free its memory.
+ This will remove the popup [i]test[/i] and free its memory.
Popups have a special kind of local variables that have an extended lifetime,
- called "extended scope" - this is described in the [doc:data_structures]Data structures documentation[/doc].[br]
+ called [i]extended scope[/i] - this is described in the [doc:data_structures]Data structures documentation[/doc].[br]
The syntax for an "extended scope" variable is:[br]
[b]%:<variable name>[/b][br]
- This type of variable is maintained during the entire "visible lifetime" of the popup -
+ This type of variable is maintained during the entire [i]visible lifetime[/i] of the popup -
from the [cmd]popup[/cmd] command call to the moment in that the user selects an item and the
corresponding code is executed (essentially from a [cmd]popup[/cmd] call to the next one).[br]
This allows you to pre-calculate data and conditions in the prologue of the popup
diff --git a/src/kvirc/module/KviModule.cpp b/src/kvirc/module/KviModule.cpp
index 0c9095dfd..720aab569 100644
--- a/src/kvirc/module/KviModule.cpp
+++ b/src/kvirc/module/KviModule.cpp
@@ -77,7 +77,7 @@ extern KVIRC_API KviModuleExtensionManager * g_pModuleExtensionManager;
[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]
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.
@@ -94,11 +94,10 @@ extern KVIRC_API KviModuleExtensionManager * g_pModuleExtensionManager;
of the KVIrc executable and saving some memory.
To activate the dialog you only need to execute the command:[br]
[example]
- about.kvirc
+ 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]
-
+ wait until the module is not used anymore and then unload it.[br][br]
[big]Transparent loading and unloading[/big][br]
Any command that has the form <name>.<command> is assumed to be
a module reference. KVIrc tries to locate the module named <name>, load it (if
@@ -113,21 +112,21 @@ 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]
- about.load
+ about.load
[/example]
The example above will do nothing more than loading the [i]about[/i]
module into the core memory.
[example]
- about.unload
+ about.unload
[/example]
The example above will forcibly unload the module from the core memory;
even if it is still locked.[br]
Please note that this can be dangerous in some situations... so
- better check the KVIrc behavior twice before making public any script
+ better check the KVIrc behaviour twice before making public any script
that uses this command.
*/
diff --git a/src/kvirc/sparser/KviAntiSpam.cpp b/src/kvirc/sparser/KviAntiSpam.cpp
index 963987d4a..6622ce72e 100644
--- a/src/kvirc/sparser/KviAntiSpam.cpp
+++ b/src/kvirc/sparser/KviAntiSpam.cpp
@@ -86,7 +86,7 @@
KVIrc contains a small spam detector, and can help you in avoiding that annoying flood
of queries popping up when you join large channels full of lamers.[br]
The spam detector works in a rather simple way: when someone sends you a private message
- containing one or more "special words", and that user has no open query window,
+ containing one or more [i]special words[/i], and that user has no open query window,
so the message is treated as spam and is redirected to the console window or is ignored completely
(if you enable that option).[br]
The spam words to check for, can be set by the means of [cmd]option[/cmd] stringlistSpamWords.[br]
@@ -94,9 +94,9 @@
[cmd]option[/cmd] boolUseAntiSpamOnNotice to 1.[br]
@examples:
[example]
- [comment]# This will cause "new-query private messages" containing[/comment]
- [comment]# words "http:","#" (channel name),"ftp:".... to be redirected to the console[/comment]
- [cmd]option[/cmd] stringlistSpamWords http:,#,ftp:,sex,free,chat,join
+ [comment]# This will cause new-query private messages containing[/comment]
+ [comment]# words http:, #(channel name), or ftp: to be redirected to the console[/comment]
+ [cmd]option[/cmd] stringlistSpamWords http:, #, ftp:, sex, free, chat, join
[cmd]option[/cmd] boolUseAntiSpamOnPrivmsg 1
[comment]# This will cause these messages to be completely ignored[/comment]
[cmd]option[/cmd] boolSilentAntiSpam 1
diff --git a/src/kvirc/sparser/KviIrcServerParser_ctcp.cpp b/src/kvirc/sparser/KviIrcServerParser_ctcp.cpp
index c4b04fec7..b602298d7 100644
--- a/src/kvirc/sparser/KviIrcServerParser_ctcp.cpp
+++ b/src/kvirc/sparser/KviIrcServerParser_ctcp.cpp
@@ -72,18 +72,18 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog;
@short:
For developers: Client-To-Client Protocol handling in KVIrc
@body:
- [big]Introduction[/big][br]
+ [big]Introduction[/big]
Personally, I think that the CTCP specification is to
be symbolically printed & burned. It is really too complex
(you can go mad with the quoting specifications)
and NO IRC CLIENT supports it completely.
Here is my personal point of view on the CTCP protocol.[br]
- [big]What is CTCP?[/big][br]
+ [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]
- [big]Basic concepts[/big][br]
+ [big]Basic concepts[/big]
A CTCP message is sent as the <text> part of the PRIVMSG and
NOTICE IRC commands.[br]
To differentiate the CTCP message from a normal IRC message
@@ -111,7 +111,7 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog;
receiving a single IRC message (no flood for the sender).
From my personal point of view, only [b]one CTCP message per IRC message[/b]
should be allowed and theoretically the trailing <0x01> delimiter can be optional.[br]
- [big]How to extract the CTCP message[/big][br]
+ [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]
So finally we have four characters that [b]cannot appear literally into a
@@ -126,16 +126,16 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog;
or later, assuming that it is not a valid char in the <ctcp message>.[br]
In this document I will assume that you have stripped the trailing <0x01>
and thus from now on we will deal only with the <ctcp message> part.[br]
-
- [big]Parsing a CTCP message: The quoting dilemma[/big][br]
+ [br]
+ [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.
Well, in fact, no actual CTCP message uses the quoting: there
is no need to include a <NUL>, a <CR> or <LF> inside the actually
defined messages (The only one could be CTCP SED, but I have never
seen it in action... is there any client that implements it?).
- We could also leave the "quoting" to the "single message type semantic":
- a message that needs to include "any character" could have its own
+ We could also leave the [i]quoting[/i] to the [i]single message type semantic[/i]:
+ a message that needs to include [i]any character[/i] could have its own
encoding method (Base64 for example). With the "one CTCP per IRC message"
convention we could even allow <0x01> inside messages. Only the leading
(and eventually trailing) <0x01> would be the delimiter, the other ones
@@ -143,8 +143,8 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog;
<0x01> inside a message? <0x01> is not printable (as well as <CR>,<LF> and <NUL>),
so only encoded messages (and again we can stick to the single message semantic)
messages or the ones including special parameters. Some machines might
- allow <0x01> in filenames....well, a file with <0x01> in its name has something
- broken inside, or the creator is a sort of "hacker" (so he also
+ allow <0x01> in filenames... well, a file with <0x01> in its name has something
+ broken inside, or the creator is a sort of [i]hacker[/i] (so he also
knows how to rename a file...) :).[br]
Anyway, let's be pedantic, and define this quoting method.
Let's use the most intuitive method, adopted all around the world:[br]
@@ -160,29 +160,29 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog;
the authors seemed to like it. This point could be discussed in
some mailing list or sth. The '\C' sequence is useful to include the backslash
character (escape sequence '\\').[br]
-
- [big]Let's mess a little more[/big][br]
+ [br]
+ [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.
- We define a "token" as a sequence of valid CTCP characters not including literal space.
+ We define a [i]token[/i] as a sequence of valid CTCP characters not including literal space.
A <ctcp parameter> is usually a token, but not always;
filenames can contain spaces inside names (and it happens very often!).
So one of the parameters of CTCP DCC is not a space separated token.
How do we handle it? Again a standard is missing. Some clients simply change
the filename placing underscores instead of spaces, this is a reasonable solution if used with care.
- Other clients attempt to "isolate" the filename token by surrounding it with some kind
- of quotes, usually the '"' or ''' characters. This is also a good solution.
+ Other clients attempt to [i]isolate[/i] the filename token by surrounding it with some kind
+ of quotes, usually the [b]"[/b] or [b]'[/b] characters. This is also a good solution.
Another one that naturally comes into my mind is to use the previously defined
- quoting to define a "non-breaking space" character, because a space after a backslash
+ quoting to define a [i]non-breaking space[/i] character, because a space after a backslash
could lose its original semantic. Better yet, use the backslash followed by
the octal representation of the space character ('\040').
Anyway, to maintain compatibility with other popular IRC clients (such as mIRC),
- let's include the '"' quotes in our standard: literal (unescaped) '"' quotes
- define a single token string. To include a literal '"' character, escape it.
+ 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.
-
- [big]A CTCP parameter extracting example[/big][br]
- A trivial example of a C "CTCP parameter extracting routine" follows.[br]
+ [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.
When a CTCP is sent there is a PRIVMSG or NOTICE token that uses at least 6 characters,
at least two spaces and a target token (that can not be empty, so it is at least one character)
@@ -190,8 +190,8 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog;
for a complete <ctcp message> and thus for a <ctcp token>.
In fact, the <ctcp message> is always smaller than 500 characters; there are usually two
<0x01> chars, there is a message source part at the beginning of the IRC message
- that is 10-15 characters long, and there is a ':' character before the trailing parameter.
- Anyway, to really be on the "safe side", we use a 512 character buffer for each
+ that is 10-15 characters long, and there is a [b]:[/b] character before the trailing parameter.
+ Anyway, to really be on the [i]safe side[/i], we use a 512 character buffer for each
<ctcp token>. Finally, I'll assume that you have already ensured that
the <ctcp message> that we are extracting from is shorter than 511 characters in all,
and have provided a buffer big enough to avoid this code segfaulting.
@@ -274,8 +274,7 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog;
return msg_ptr;
}
[/example][br]
-
- [big]CTCP parameter semantics[/big][br]
+ [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]
Although it is a convention to specify the <ctcp tag> as uppercase letters,
@@ -284,8 +283,8 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog;
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]
-
- [big]PING[/big][br]
+ [br]
+ [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.
The receiving client should reply with exactly the same message but sent
@@ -293,26 +292,26 @@ 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.
-
- [big]VERSION[/big][br]
+ [br]
+ [big]VERSION[/big]
[b]Syntax: <0x01>VERSION<0x01>[/b][br]
The VERSION request asks for information about another user's IRC client program.
The reply should be sent through a NOTICE with the following syntax:[br]
<0x01>VERSION <client_version_data><0x01>[br]
The preferred form for <client_version_data> is
- "<client_name>:<client_version>:<client_enviroinement>", but historically
+ [i]<client_name>:<client_version>:<client_enviroinement>[/i], but historically
clients (and users) send a generic reply describing the client name, version
and eventually the used script name. This CTCP reply is intended to be human
readable, so any form is accepted.
-
- [big]USERINFO[/big][br]
+ [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 "user defined" string;
-
- [big]CLIENTINFO[/big][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.
While VERSION requests the client program name and version, CLIENTINFO requests
@@ -321,39 +320,39 @@ 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.
-
- [big]FINGER[/big][br]
+ [br]
+ [big]FINGER[/big]
[b]Syntax: <0x01>FINGER<0x01>[/b][br]
The FINGER request asks for information about another IRC user.
The reply should be sent through a NOTICE with the following syntax:[br]
<0x01>FINGER <user_info_data><0x01>[br]
The <user_info_data> should be a human readable string containing
the system username and possibly the system idle time;
-
- [big]SOURCE[/big][br]
+ [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.
-
- [big]TIME[/big][br]
+ [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.
-
- [big]ACTION[/big][br]
+ [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]
-
- [big]AVATAR (equivalent to ICON or FACE)[/big][br]
+ [br]
+ [big]AVATAR (equivalent to ICON or FACE)[/big]
[b]Syntax: <0x01>AVATAR<0x01>[/b][br]
The AVATAR tag is used to query an user's avatar.[br]
-
- [big]MULTIMEDIA (equivalent to MM or SOUND)[/big][br]
+ [br]
+ [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]
The receiving client should locate the file associated to <filename>,
@@ -367,23 +366,21 @@ extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog;
The client may decide to drop the entire message too. Older clients (including
older releases of KVIrc) used to request the missing filenames by a particular
non-standard private message syntax. This convention should be dropped.[br]
-
- [big]DCC[/big][br]
+ [br]
+ [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.
The known DCC types are:[br]
- CHAT[br]
- SEND[br]
- TSEND[br]
- GET[br]
- TGET[br]
- ACCEPT[br]
- RESUME[br]
+ CHAT[br]
+ SEND[br]
+ TSEND[br]
+ GET[br]
+ TGET[br]
+ ACCEPT[br]
+ RESUME[br]
*/
-
-
void KviIrcServerParser::encodeCtcpParameter(const char * param,KviCString &buffer,bool bSpaceBreaks)
{
//
diff --git a/src/kvirc/ui/KviInput.cpp b/src/kvirc/ui/KviInput.cpp
index aad267c7c..83b45f22f 100644
--- a/src/kvirc/ui/KviInput.cpp
+++ b/src/kvirc/ui/KviInput.cpp
@@ -441,40 +441,39 @@ void KviInput::toggleMultiLine()
Commandline input features
@body:
[big]Principles of operation[/big]
- [p]
- The idea is simple: anything that starts with a slash (/) character
+ [br]
+ 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..).
- [/p]
+ sent to the target of the window (channel, query, DCC chat etc.).
+ [br]
[big]The two operating modes[/big]
- [p]
- The commandline input has two operating modes: the "user friendly mode" and
- the "kvs mode". In the user friendly mode all the parameters of the commands
+ [br]
+ The commandline input has two operating modes: the [i]user friendly mode[/i] and
+ the [i]kvs mode[/i]. In the user friendly mode all the parameters of the commands
are interpreted exactly like you type them. There is no special interpretation
- of $,%,-,( and ; characters. This allows you to type "/me is happy ;)", for example.
+ of [b]$[/b], [b]%[/b], [b]-[/b], [b]([/b] and [b];[/b] characters. This allows you to type [i]/me is happy ;)[/i], for example.
In the kvs mode the full parameter interpretation is enabled and the commands
work just like in any other script editor. This means that anything that
- starts with a $ is a function call, anything that starts with a % is a variable,
- the dash characters after command names are interpreted as switches and ; is the
- command separator. This in turn does [b]not[/b] allow you to type "/me is happy ;)"
- because ; is the command separator and ) will be interpreted as the beginning
+ starts with a [b]$[/b] is a function call, anything that starts with a % is a variable,
+ the dash characters after command names are interpreted as switches and [b];[/b] is the
+ command separator. This in turn does [b]not[/b] allow you to type [i]/me is happy ;)[/i]
+ because [b];[/b] is the command separator and ) will be interpreted as the beginning
of the next command. In KVS mode you obviously have to escape the ; character
- by typing "/me is happy \;)". The user friendly mode is good for everyday chatting
+ by typing [i]/me is happy \;)[/i]. The user friendly mode is good for everyday chatting
and for novice users while the KVS mode is for experts that know that minimum about
scripting languages. Please note that in the user-friendly mode you're not allowed
to type multiple commands at once :).
- [/p]
- [p]
+ [br]
Also look at the [doc:keyboard]keyboard shortcuts[/doc] reference.[br]
If you drop a file on this widget, a <a href="parse.kvihelp">/PARSE &lt;filename&gt;</a> will be executed.[br]
You can enable word substitution in the preferences dialog.[br]
- For example, if you choose to substitute "afaik" with "As far as I know",[br]
- when you will type "afaik" somewhere in the command line, and then
- press Space or Return, that word will be replaced with "As far as I know".[br]
+ For example, if you choose to substitute [b]afaik[/b] with [b]A[/b]s [b]f[/b]ar [b]a[/b]s [b]I[/b] [b]k[/b]now",[br]
+ when you will type [b]afaik[/b] somewhere in the command line, and then
+ press Space or Return, that word will be replaced with [i]As far as I know[/i].[br]
Experiment with it :)[br]
The Tab key activates the completion of the current word.[br]
- If a word is prefixed with a '/', it is treated as a command to be completed,
- if it begins with '$', it is treated as a function or identifier to be completed,
+ If a word is prefixed with a [b]/[/b], it is treated as a command to be completed,
+ if it begins with [b]$[/b], it is treated as a function or identifier to be completed,
otherwise it is treated as a nickname or filename to be completed.
[example]
/ec&lt;Tab&gt; will produce /echo&lt;space&gt;
@@ -486,5 +485,5 @@ void KviInput::toggleMultiLine()
$sel&lt;Tab;&gt; will find multiple matches and produce $selected
[/example]
Experiment with that too :)
- [/p]
+ [br]
*/
diff --git a/src/kvirc/ui/KviIrcView_events.cpp b/src/kvirc/ui/KviIrcView_events.cpp
index 19b3abb83..8058c41e5 100644
--- a/src/kvirc/ui/KviIrcView_events.cpp
+++ b/src/kvirc/ui/KviIrcView_events.cpp
@@ -62,7 +62,7 @@
The KVIrc view widgets support clickable links.[br]
The links can be created using special escape sequences in the text
passed to the [cmd]echo[/cmd] command.[br]
- KVIrc uses some escape sequences in the text "echoed" internally.[br]
+ 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]
[example]
[cmd]echo[/cmd] This is a [fnc]$cr[/fnc]![!dbl][cmd]echo[/cmd] You have clicked it![fnc]$cr[/fnc]\clickable link$cr !
@@ -79,7 +79,7 @@
The whole escape sequence format is the following:[br]
[b]<cr>!<escape_command><cr><visible text><cr>[/b][br]
<cr> is the carriage return character. You can obtain it by using the [fnc]]$cr[/fnc] function.[br]
- <visible text> is the text that will appear as "link" when you move the mouse over it.[br]
+ <visible text> is the text that will appear as [i]link[/i] when you move the mouse over it.[br]
<escape_command> is the description of the actions to be taken when the user interacts with the link.[br]
<escape_command> has the two following syntactic forms:[br]
[b]<escape_command> ::= <user_defined_commands>[/b][br]
diff --git a/src/modules/about/libkviabout.cpp b/src/modules/about/libkviabout.cpp
index 196fe3e43..9b2d726b6 100644
--- a/src/modules/about/libkviabout.cpp
+++ b/src/modules/about/libkviabout.cpp
@@ -39,19 +39,19 @@ AboutDialog * g_pAboutDialog = 0;
@title:
about.kvirc
@short:
- Shows the "About KVIrc" dialog
+ Shows the About KVIrc dialog
@syntax:
about.kvirc
@description:
- This command is exported by the "about" module.
+ This command is exported by the [i]about[/i] module.
This command opens a dialog which contains various tabs ranging from important to interesting information.
- [b]About[/b] tab: shows the current KVIrc base version, release name and splash screen.[/br]
+ [b]About[/b] tab: shows the current KVIrc base version, release name and splash screen.[br]
[b]Executable Information[/b] tab: contains important system and program information you can [b]copy and paste[/b] into e.g. a bug report or support request.[br]
[b]Honor & Glory[/b] tab: contains a non exhaustive list of the people who have contributed to help make KVIrc the IRC client you know and use today.[br]
[b]Licence[/b] tab: contains a copy (if present in the KVIrc package) of the license type and details associated with the KVIrc package.
@examples:
[example]
- /about.kvirc
+ about.kvirc
[/example]
*/
diff --git a/src/modules/action/libkviaction.cpp b/src/modules/action/libkviaction.cpp
index 3cbdfe6ec..cd61c9cd6 100644
--- a/src/modules/action/libkviaction.cpp
+++ b/src/modules/action/libkviaction.cpp
@@ -90,7 +90,7 @@ static bool action_kvs_cmd_list(KviKvsModuleCommandCall * c)
does not print warnings if the action is not defined or disabled.
@examples:
[example]
- action.trigger connect
+ action.trigger connect
[/example]
*/
@@ -280,78 +280,72 @@ static bool action_kvs_cmd_destroy(KviKvsModuleCommandCall * c)
Specifies that the action needs an IRC context to be executed.
When the current window does not belong to an IRC context
the action is automatically disabled
-
+ [br]
!sw: -c | --bind-to-connection
Specifies that the action needs an IRC connection to be executed.
When the current window has no associated IRC connection
the action is automatically disabled.
This switch implies -i.
-
+ [br]
!sw: -l | --enable-at-login
Specifies that the action needs to be enabled at login time, that is
when a link to the server has been established but the login
operations haven't been carried out yet (and thus there is no real IRC connection).
This switch requires -c to work.
-
+ [br]
!sw: -w=<window_types> | --window-types=<window_type>
Causes the action to be enabled only when the active window
is one of the specified types. <window_types> may be any combination
- of the letters 'q' (query), 'c' (channel), 'x' (console), 'd' (dccchat).
+ of the letters [b]q[/b] (query), [b]c[/b] (channel), [b]x[/b] (console), [b]d[/b] (dccchat).
If this switch is omitted then the action is enabled in all the windows.[br]
-
+ [br]
!sw: -s | --selected-only
Specifies that the action will be activated only if the active window
has selected users in the userlist. This switch requires -w with a combination
- of flags 'q','c' and 'x' (it doesn't work for DCC chat).
-
+ of flags [b]q[/b], [b]c/b] and [b]x[/b] (it doesn't work for DCC chat).
+ [br]
!sw: -t=<category> | --category=<category>
Causes the action to belong to the specified category.
- <category> can be one of "IRC","scripting","settings","GUI","channel","tools" and "generic".
- If this switch is omitted the "generic" category is automatically assumed.
- The actions failing in the "tools" category will appear in the "Tools" KVIrc menu too.
-
+ <category> can be one of [i]IRC[/i], [i]scripting[/i], [i]settings[/i], [i]GUI[/i], [i]channel[/i], [i]tools[/i] and [i]generic[/i].
+ If this switch is omitted the [i]generic[/i] category is automatically assumed.
+ The actions failing in the [i]tools[/i] category will appear in the [i]Tools[/i] KVIrc menu too.
+ [br]
!sw: -k=<key sequence> | --key-sequence=<key sequence>
Specifies that the action will be activated also by the <key sequence>
which is a string formed from up to four keyboard codes separated by
- commas optionally combined with the modifiers "Alt","Ctrl","Shift" and "Meta".[br]
- Examples of such sequences are: "Ctrl+X", "Ctrl+Alt+F" or "Ctrl+X,Alt+Space".
+ commas optionally combined with the modifiers [i]Alt[/i], [i]Ctrl[/i], [i]Shift[/i] and [i]Meta[/i].[br]
+ Examples of such sequences are: [i]Ctrl+X", [i]Ctrl+Alt+F[/i] or [i]Ctrl+X,Alt+Space[/i].
@description:
- [p]
+ [br]
Defines a new script action.
- [/p]
- [p]
+ [br]
Each action has an unique <name> that must not collide with any core action
- (i.e. don't use the "KVIrc." prefix).
+ (i.e. don't use the [i]KVIrc.[/i] prefix).
At any time you can check [cmd]action.list[/cmd] to verify that no core action
is already using your <name>. If the <name> was already used for a script action
then this action is simply replaced by the new one.
- [/p]
- [p]
+ [br]
Each action has an associated <visible label> that is the name meant to be presented to the user,
possibly even translated. This label will appear on the toolbar buttons, in the tooltips and
in the popup menu items. The string will be evaluated just before the actions is displayed
so the eventual runtime translation will fetch from the correct language catalogue.
- [/p]
- [p]
+ [br]
<description> is the descriptive text that will be displayed in the action choice dialog
(and maybe in other places).
The string will be evaluated just before the actions is displayed
so the eventual runtime translation will fetch from the correct language catalogue.
- [/p]
- [p]
+ [br]]
<big_icon_id> is the [doc:image_id]image identifier[/doc] of the icon that will
appear on the toolbar buttons and in the action choice dialog.
- [/p]
- [p]
+ [br]
<small_icon_id> is optional and is the [doc:image_id]image identifier[/doc] of the icon
that will appear in the menu items. Since menu items can be also iconless then
this parameter is optional.
- [/p]
- [p]
+ [br]
<action body> is the callback code snippet that will be triggered when this action is activated
either by the means of [cmd]action.trigger[/cmd], a toolbar button or a menu item selection.
An empty <action body> causes this command to behave like [cmd]action.destroy[/cmd] <name>.
- [/p]
+ [br]
@seealso:
[cmd]action.destroy[/cmd], [cmd]action.trigger[/cmd]
@examples:
@@ -455,8 +449,8 @@ static bool action_kvs_cmd_create(KviKvsModuleCallbackCommandCall * c)
@syntax:
<boolean> $action.exists(<name:string>)
@description:
- Returns 1 if the action with the specified <name> is currently defined
- and 0 otherwise.
+ Returns [b]1[/b] if the action with the specified <name> is currently defined
+ and [b]0[/b] otherwise.
*/
static bool action_kvs_fnc_exists(KviKvsModuleFunctionCall * c)
@@ -480,8 +474,8 @@ static bool action_kvs_fnc_exists(KviKvsModuleFunctionCall * c)
@syntax:
<boolean> $action.isEnabled(<name:string>)
@description:
- Returns 1 if the action with the specified <name> is currently enabled
- and 0 otherwise. If the action does not exist the function returns 0.
+ Returns [b]1[/b] if the action with the specified <name> is currently enabled
+ and [b]0[/b] otherwise. If the action does not exist the function returns [b]0[/b].
*/
static bool action_kvs_fnc_isEnabled(KviKvsModuleFunctionCall * c)
diff --git a/src/modules/addon/libkviaddon.cpp b/src/modules/addon/libkviaddon.cpp
index a33aac16d..33e0c6935 100644
--- a/src/modules/addon/libkviaddon.cpp
+++ b/src/modules/addon/libkviaddon.cpp
@@ -56,8 +56,8 @@ QRect g_rectManagementDialogGeometry(0,0,0,0);
@syntax:
<boolean> $addon.exists(<id:string>[,<version:string>])
@description:
- Returns 1 if the addon with the specified <id> is currently installed
- and 0 otherwise. If <version> is specified then any addon with
+ Returns [b]1[/b] if the addon with the specified <id> is currently installed
+ and [b]0[/b] otherwise. If <version> is specified then any addon with
a version lower than <version> is ignored (so you can effectively
check if a greater or equal version is present).
*/
@@ -311,7 +311,7 @@ static bool addon_kvs_cmd_help(KviKvsModuleCommandCall * c)
}
@switches:
!sw: -q
- Makes the command run quietly
+ Makes the command run quietly
@description:
Sets the configure callback for the specified addon.
The configure callback will be called by the user either by the
@@ -357,7 +357,7 @@ static bool addon_kvs_cmd_setconfigurecallback(KviKvsModuleCallbackCommandCall *
}
@switches:
!sw: -q
- Makes the command run quietly
+ Makes the command run quietly
@description:
Sets the help callback for the specified addon.
The help callback will be called by the user either by the
@@ -404,42 +404,33 @@ static bool addon_kvs_cmd_sethelpcallback(KviKvsModuleCallbackCommandCall * c)
}
@switches:
!sw: -f | --force
- Registers the addon even if an addon with the same <id> and
- a higher version already exists. The usage of this flag
- is highly discouraged (i.e. use it only for debugging purposes
- on your own machine).
+ Registers the addon even if an addon with the same <id> and
+ a higher version already exists. The usage of this flag
+ is highly discouraged (i.e. use it only for debugging purposes
+ on your own machine).
!sw: -n | --no-uninstall
- Performs no uninstallation of existing versions of the addon:
- it simply replaces the registration entry with the new data.
- Again, do [b]not[/b] use this switch if not for debugging purposes
- and on your own machine.
+ Performs no uninstallation of existing versions of the addon:
+ it simply replaces the registration entry with the new data.
+ Again, do [b]not[/b] use this switch if not for debugging purposes
+ and on your own machine.
!sw: -q | --quiet
- Makes the command run quietly
+ Makes the command run quietly
@description:
- [p]
- Registers a script-based addon.
- [/p]
- [p]
- The registration process allows to "show" the addon in the script-addon manager
+ Registers a script-based addon.[br]
+ The registration process allows to [i]show[/i] the addon in the script-addon manager
dialog and provides a standard way for the user to manage and uninstall the addons.
- You simply register your addon BEFORE attempting to install it.
- [/p]
- [p]
+ You simply register your addon BEFORE attempting to install it.[br]
A script-based addon is a set of scripts, icons, translations and possibly
other data files that add functionality to the KVIrc program.
- The script-based addons are often simply called "scripts" and
- we will adhere to that naming in certain parts of the documentation too.
- [/p]
- [p]
+ The script-based addons are often simply called [i]scripts[/i] and
+ we will adhere to that naming in certain parts of the documentation too.[br]
Each script-based addon (a set of scripts) is identified by an UNIQUE
<id>. Two addons with the same <id> can't co-exist in the same
KVIrc installation (so be sure to choose a token characteristic enough
to avoid collisions with others). The <id> itself is used only for
identification purposes and the user will almost always see the <visible_name>
instead, which can contain the [fnc]$tr[/fnc] function that will handle
- the translation for it.
- [/p]
- [p]
+ the translation for it.[br]
Each addon has also a <version> which is a string in the form x.y.z
where x, y and z are numbers (yes.. that's the standard major-minor-patch level
version numbering scheme). A <version> of 2.4.23 is greater than 2.4.3
@@ -447,26 +438,18 @@ static bool addon_kvs_cmd_sethelpcallback(KviKvsModuleCallbackCommandCall * c)
When an addon with a greater or equal version is installed over
an addon with a lower version, the lower one gets uninstalled first.
Installing a lower version over a greater one is not possible, unless
- the lower version one is uninstalled first.
- [/p]
- [p]
+ the lower version one is uninstalled first.[br][br]
<description> is another, possibly translated, string that will
- be presented to the user in the addon management dialog.
- [/p]
- [p]
+ be presented to the user in the addon management dialog.[br][br]
<minkvircversion> is the minimum KVIrc version required for the
addon to run. If the version of the running KVIrc executable
is lower than the requested one then the command will abort with an error.
If you want to completely ignore the KVIrc versioning (don't do it),
- use "0.0.0" here. If you need fine tuning on cvs features you may add also
- the sources date tag at the end of the required version string (e.g 3.2.1.20060303).
- [/p]
- [p]
+ use [b][i]0.0.0[/i][/b] here. If you need fine tuning on cvs features you may add also
+ the sources date tag at the end of the required version string (e.g 3.2.1.20060303).[br][br]
<iconid> is the [doc:image_id]image identifier[/doc] of the icon
that will be displayed in the addon management dialog.
- If not specified, a default icon will be used.
- [/p]
- [p]
+ If not specified, a default icon will be used.[br][br]
The <uninstall_callback> is a snippet of code that should
wipe out the addon from the system. It is ALWAYS a good practice
to write a complete uninstallation procedure (think that YOU like
@@ -474,9 +457,7 @@ static bool addon_kvs_cmd_sethelpcallback(KviKvsModuleCallbackCommandCall * c)
The <uninstall_callback> will be called by KVIrc when the addon
uninstallation is requested, either explicitly by using the GUI or the
command [cmd]addon.uninstall[/cmd], or implicitly by installing
- a newer version of the addon (upgrading).
- [/p]
- [p]
+ a newer version of the addon (upgrading).[br]
If the user security rules don't allow your addon to be installed
or a higher version of a addon with the same name already exists
the command will fail with an error (aborting your whole installation addon).
@@ -484,28 +465,22 @@ static bool addon_kvs_cmd_sethelpcallback(KviKvsModuleCallbackCommandCall * c)
then you should use [fnc]$addon.exists()[/fnc] to check if a
addon with the same name and a greater version already exists.
You can't gracefully handle security error conditions: your installation
- will be always aborted with an error in this case.
- [/p]
- [p]
+ will be always aborted with an error in this case.[br]
The addon can also have a configuration callback settable with [cmd]addon.setconfigurecallback[/cmd]
and a help callback settable with [cmd]addon.sethelpcallback[/cmd]. The first
will usually display a configuration dialog, the second will display
- some sort of addon's documentation, usually in the help browser.
- [/p]
- [p]
+ some sort of addon's documentation, usually in the help browser.[br]
The registration process uninstalls any previous addon version
by executing its uninstall callback routine. This is another reason for that
you should call addon.register BEFORE you attempt to install your addon.
Failing to do that may cause your old uninstalled to wipe out your newly
installed files or code.
- [/p]
@seealso:
[cmd]addon.uninstall[/cmd], [fnc]$addon.exists[/fnc],
[cmd]addon.setconfigurecallback[/cmd], [cmd]addon.configure[/cmd],
[cmd]addon.sethelpcallback[/cmd], [cmd]addon.help[/cmd], [cmd]addon.installfiles[/cmd]
@examples:
[example]
-
[/example]
*/
@@ -602,9 +577,9 @@ static bool addon_kvs_cmd_register(KviKvsModuleCallbackCommandCall * c)
addon.installfiles <id:string> <target:string> [files]
@switches:
!sw: -q | --quiet
- Makes the command run quietly
+ Makes the command run quietly
!sw: -s | --skip-nonexistent
- Skip nonexistent entries in the [files] list
+ Skip nonexistent entries in the [files] list
@description:
Installs the [files] for the addon identified by the specified <id>.
The files will be automatically removed when the addon is uninstalled.
@@ -617,7 +592,7 @@ static bool addon_kvs_cmd_register(KviKvsModuleCallbackCommandCall * c)
[li]"config" for configuration files.[/li]
[li]"help/<language>" for help files.[/li]
[/ul]
- Other target paths are allowed and subdirectories are supported (e.g. "pics/myaddon").
+ Other target paths are allowed and subdirectories are supported (e.g. [i]pics/myaddon[/i]).
[files] is a list of filenames or directory names.
Each file will be copied to the specified target path in the local KVIrc directory.
Filenames can contain wildcard characters in the last component.
@@ -826,7 +801,7 @@ static bool addon_kvs_cmd_install(KviKvsModuleCommandCall * c)
@description:
Creates a *.kva package containing a KVIrc addon.[br]
<package_path> is the absolute path and file name of the package that should be saved.[br]
- <addon_name> is the visible name of the addon (something like "My Addon").[br]
+ <addon_name> is the visible name of the addon (something like [i][b]My Addon[/i][/b]).[br]
<addon_version> is the version of the addon in the form X.Y.Z.[br]
<description> is a textual description of the addon.
<author> is the name of the person that is creating the addon.
diff --git a/src/modules/avatar/libkviavatar.cpp b/src/modules/avatar/libkviavatar.cpp
index a9735ac00..627aa1d7a 100644
--- a/src/modules/avatar/libkviavatar.cpp
+++ b/src/modules/avatar/libkviavatar.cpp
@@ -347,12 +347,12 @@ static bool avatar_kvs_cmd_unset(KviKvsModuleCommandCall * c)
restricted to KVIrc clients only. In the future other clients may implement it.[br]
This command is [doc:connection_dependent_commands]connection dependent[/doc].[br]
@examples:
- [example]
+ [example]
[comment]# Notify your current avatar to Pragma[/comment]
avatar.notify Pragma
[comment]# Notify your avatar to the channel #kvirc and to Pragma[/comment]
avatar #kvirc,Pragma
- [/example]
+ [/example]
@seealso:
[cmd]avatar.set[/cmd], [cmd]avatar.unset[/cmd]
*/
diff --git a/src/modules/chan/libkvichan.cpp b/src/modules/chan/libkvichan.cpp
index 03cce9b16..3d7bf9f10 100644
--- a/src/modules/chan/libkvichan.cpp
+++ b/src/modules/chan/libkvichan.cpp
@@ -144,7 +144,7 @@ static bool chan_kvs_fnc_getUrl(KviKvsModuleFunctionCall * c)
<boolean> $chan.isDead
<boolean> $chan.isDead(<window_id:string>)
@description:
- Returns 1 if the channel specified by <window_id> is a dead channel and 0 otherwise.[br]
+ Returns [b]1[/b] if the channel specified by <window_id> is a dead channel and [b]0[/b] otherwise.[br]
The form without parameters works on the current window.[br]
*/
@@ -499,7 +499,7 @@ static bool chan_kvs_fnc_useropcount(KviKvsModuleFunctionCall * c)
@description:
The first form returns the number of entries in the ban list of the current channel (assuming that the current window
is a channel at all). If the current window is not a channel, a warning is printed
- and 0 is returned.[br]
+ and [b]0[/b] is returned.[br]
The second form returns the number entries in the ban list of the channel specified by <window_id>.[br]
The number of ban list entries is returned if it is known form at the call time: this means that
if the channel is not synchronized with the server (as just after the join, for example)
@@ -531,7 +531,7 @@ static bool chan_kvs_fnc_bancount(KviKvsModuleFunctionCall * c)
@description:
The first form returns the number of entries in the ban exception list of the current channel (assuming that the current window
is a channel at all). If the current window is not a channel, a warning is printed
- and 0 is returned.[br]
+ and [b]0[/b] is returned.[br]
The second form returns the number entries in the ban exception list of the channel specified by <window_id>.[br]
The number of ban exception list entries is returned if it is known form at the call time: this means that
if the channel is not synchronized with the server (as just after the join, for example)
@@ -563,7 +563,7 @@ static bool chan_kvs_fnc_banexceptioncount(KviKvsModuleFunctionCall * c)
@description:
The first form returns the number of entries in the invite list of the current channel (assuming that the current window
is a channel at all). If the current window is not a channel, a warning is printed
- and 0 is returned.[br]
+ and [b]0[/b] is returned.[br]
The second form returns the number entries in the invite list of the channel specified by <window_id>.[br]
The number of invite list entries is returned if it is known form at the call time: this means that
if the channel is not synchronized with the server (as just after the join, for example)
@@ -594,7 +594,7 @@ static bool chan_kvs_fnc_invitecount(KviKvsModuleFunctionCall * c)
@description:
The first form returns the number of entries in the ban list of the current channel (assuming that the current window
is a channel at all). If the current window is not a channel, a warning is printed
- and 0 is returned.[br]
+ and [b]0[/b] is returned.[br]
The second form returns the number entries in the ban list of the channel specified by <window_id>.[br]
The number of list entries is returned if it is known form at the call time: this means that
if the channel is not synchronized with the server (as just after the join, for example)
@@ -626,7 +626,7 @@ static bool chan_kvs_fnc_maskcount(KviKvsModuleFunctionCall * c)
@syntax:
<boolean> $chan.ison(<nickname:string>[,<window_id:string>])
@description:
- Returns 1 if <nickname> is on the channel identified by <window_id>, 0 otherwise.[br]
+ Returns [b]1[/b] if <nickname> is on the channel identified by <window_id>, and [b]0[/b] otherwise.[br]
If <window_id> is not specified the current window is used (assuming that it is a channel at all).[br]
If the window is not a channel, a warning is printed and an empty string is returned.[br]
*/
@@ -714,7 +714,7 @@ static bool __clbkname(KviKvsModuleFunctionCall * c) \
@syntax:
<boolean> $chan.isowner(<nickname:string>[,<window_id:string>])
@description:
- Returns 1 if <nickname> is at least an owner on the channel identified by <window_id>, 0 otherwise.[br]
+ Returns [b]1[/b] if <nickname> is at least an owner on the channel identified by <window_id>, and [b]0[/b] otherwise.[br]
If <window_id> is not specified the current window is used (assuming that it is a channel at all).[br]
If the window is not a channel, a warning is printed and an empty string is returned.[br]
Note that if the user is not on the channel at all, you will get 0 as return value.[br]
@@ -733,7 +733,7 @@ IS_KVS_FUNC(chan_kvs_fnc_isowner,isChanOwner)
@syntax:
<boolean> $chan.isadmin(<nickname:string>[,<window_id:string>])
@description:
- Returns 1 if <nickname> is at least an administrator on the channel identified by <window_id>, 0 otherwise.[br]
+ Returns [b]1[/b] if <nickname> is at least an administrator on the channel identified by <window_id>, and [b]0[/b] otherwise.[br]
If <window_id> is not specified the current window is used (assuming that it is a channel at all).[br]
If the window is not a channel, a warning is printed and an empty string is returned.[br]
Note that if the user is not on the channel at all, you will get 0 as return value.[br]
@@ -752,7 +752,7 @@ IS_KVS_FUNC(chan_kvs_fnc_isadmin,isChanAdmin)
@syntax:
<boolean> $chan.isop(<nickname:string>[,<window_id:string>])
@description:
- Returns 1 if <nickname> is at least an operator on the channel identified by <window_id>, 0 otherwise.[br]
+ Returns [b]1[/b] if <nickname> is at least an operator on the channel identified by <window_id>, and [b]0[/b] otherwise.[br]
If <window_id> is not specified the current window is used (assuming that it is a channel at all).[br]
If the window is not a channel, a warning is printed and an empty string is returned.[br]
Note that if the user is not on the channel at all, you will get 0 as return value.[br]
@@ -771,7 +771,7 @@ IS_KVS_FUNC(chan_kvs_fnc_isop,isOp)
@syntax:
<boolean> $chan.isvoice(<nickname:string>[,<window_id:string>])
@description:
- Returns 1 if <nickname> is at least voiced on the channel identified by <window_id>, 0 otherwise.[br]
+ Returns [b]1[/b] if <nickname> is at least voiced on the channel identified by <window_id>, and [b]0[/b] otherwise.[br]
If <window_id> is not specified the current window is used (assuming that it is a channel at all).[br]
If the window is not a channel, a warning is printed and an empty string is returned.[br]
Note that if the user is not on the channel at all, you will get 0 as return value.[br]
@@ -790,7 +790,7 @@ IS_KVS_FUNC(chan_kvs_fnc_isvoice,isVoice)
@syntax:
<boolean> $chan.ishalfop(<nickname:string>[,<window_id:string>])
@description:
- Returns 1 if <nickname> is at least a half-operator on the channel identified by <window_id>, 0 otherwise.[br]
+ Returns [b]1[/b] if <nickname> is at least a half-operator on the channel identified by <window_id>, and [b]0[/b] otherwise.[br]
If <window_id> is not specified the current window is used (assuming that it is a channel at all).[br]
If the window is not a channel, a warning is printed and an empty string is returned.[br]
Note that if the user is not on the channel at all, you will get 0 as return value.[br]
@@ -809,7 +809,7 @@ IS_KVS_FUNC(chan_kvs_fnc_ishalfop,isHalfOp)
@syntax:
<boolean> $chan.isuserop(<nickname:string>[,<window_id:string>])
@description:
- Returns 1 if <nickname> is at least an user-operator on the channel identified by <window_id>, 0 otherwise.[br]
+ Returns [b]1[/b] if <nickname> is at least an user-operator on the channel identified by <window_id>, and [b]0[/b] otherwise.[br]
If <window_id> is not specified the current window is used (assuming that it is a channel at all).[br]
If the window is not a channel, a warning is printed and an empty string is returned.[br]
Note that if the user is not on the channel at all, you will get 0 as return value.[br]
@@ -841,10 +841,10 @@ static bool __clbkname(KviKvsModuleFunctionCall * c) \
<boolean> $chan.isMeOwner
<boolean> $chan.isMeOwner(<window_id:string>)
@description:
- Returns 1 if the current user is at least an owner on the channel specified by <window_id>, 0 otherwise.[br]
+ Returns [b]1[/b] if the current user is at least an owner on the channel specified by <window_id>, and [b]0[/b] otherwise.[br]
If <window_id> is not passed, the current window is used (assuming it is a channel at all).[br]
If the window is not a channel, a warning is printed and an empty string is returned.[br]
- This function is a "shortcut" for [fnc]$chan.isowner[/fnc]([fnc]$me[/fnc]).[br]
+ This function is a [i]shortcut[/i] for [fnc]$chan.isowner[/fnc]([fnc]$me[/fnc]).[br]
*/
IS_ME_KVS_FUNC(chan_kvs_fnc_ismeowner,isMeChanOwner)
@@ -861,10 +861,10 @@ IS_ME_KVS_FUNC(chan_kvs_fnc_ismeowner,isMeChanOwner)
<boolean> $chan.isMeAdmin
<boolean> $chan.isMeAdmin(<window_id:string>)
@description:
- Returns 1 if the current user is at least an administrator on the channel specified by <window_id>, 0 otherwise.[br]
+ Returns [b]1[/b] if the current user is at least an administrator on the channel specified by <window_id>, and [b]0[/b] otherwise.[br]
If <window_id> is not passed, the current window is used (assuming it is a channel at all).[br]
If the window is not a channel, a warning is printed and an empty string is returned.[br]
- This function is a "shortcut" for [fnc]$chan.isadmin[/fnc]([fnc]$me[/fnc]).[br]
+ This function is a [i]shortcut[/i] for [fnc]$chan.isadmin[/fnc]([fnc]$me[/fnc]).[br]
*/
IS_ME_KVS_FUNC(chan_kvs_fnc_ismeadmin,isMeChanAdmin)
@@ -881,10 +881,10 @@ IS_ME_KVS_FUNC(chan_kvs_fnc_ismeadmin,isMeChanAdmin)
<boolean> $chan.isMeOp
<boolean> $chan.isMeOp(<window_id:string>)
@description:
- Returns 1 if the current user is at least op on the channel specified by <window_id>, 0 otherwise.[br]
+ Returns [b]1[/b] if the current user is at least op on the channel specified by <window_id>, and [b]0[/b] otherwise.[br]
If <window_id> is not passed, the current window is used (assuming it is a channel at all).[br]
If the window is not a channel, a warning is printed and an empty string is returned.[br]
- This function is a "shortcut" for [fnc]$chan.isop[/fnc]([fnc]$me[/fnc]).[br]
+ This function is a [i]shortcut[/i] for [fnc]$chan.isop[/fnc]([fnc]$me[/fnc]).[br]
*/
IS_ME_KVS_FUNC(chan_kvs_fnc_ismeop,isMeOp)
@@ -901,10 +901,10 @@ IS_ME_KVS_FUNC(chan_kvs_fnc_ismeop,isMeOp)
<boolean> $chan.isMeHalfOp
<boolean> $chan.isMeHalfOp(<window_id:string>)
@description:
- Returns 1 if the current user is at least an half operator on the channel specified by <window_id>, 0 otherwise.[br]
+ Returns [b]1[/b] if the current user is at least an half operator on the channel specified by <window_id>, and [b]0[/b] otherwise.[br]
If <window_id> is not passed, the current window is used (assuming it is a channel at all).[br]
If the window is not a channel, a warning is printed and an empty string is returned.[br]
- This function is a "shortcut" for [fnc]$chan.ishalfop[/fnc]([fnc]$me[/fnc]).[br]
+ This function is a [i]shortcut[/i] for [fnc]$chan.ishalfop[/fnc]([fnc]$me[/fnc]).[br]
*/
IS_ME_KVS_FUNC(chan_kvs_fnc_ismehalfop,isMeHalfOp)
@@ -921,10 +921,10 @@ IS_ME_KVS_FUNC(chan_kvs_fnc_ismehalfop,isMeHalfOp)
<boolean> $chan.isMeVoice
<boolean> $chan.isMeVoice(<window_id:string>)
@description:
- Returns 1 if the current user is at least voice on the channel specified by <window_id>, 0 otherwise.[br]
+ Returns [b]1[/b] if the current user is at least voice on the channel specified by <window_id>, and [b]0[/b] otherwise.[br]
If <window_id> is not passed, the current window is used (assuming it is a channel at all).[br]
If the window is not a channel, a warning is printed and an empty string is returned.[br]
- This function is a "shortcut" for [fnc]$chan.isvoice[/fnc]([fnc]$me[/fnc]).[br]
+ This function is a [i]shortcut[/i] for [fnc]$chan.isvoice[/fnc]([fnc]$me[/fnc]).[br]
*/
IS_ME_KVS_FUNC(chan_kvs_fnc_ismevoice,isMeVoice)
@@ -941,10 +941,10 @@ IS_ME_KVS_FUNC(chan_kvs_fnc_ismevoice,isMeVoice)
<boolean> $chan.isMeUserOp
<boolean> $chan.isMeUserOp(<window_id:String>)
@description:
- Returns 1 if the current user is at least an user operator on the channel specified by <window_id>, 0 otherwise.[br]
+ Returns [b]1[/b] if the current user is at least an user operator on the channel specified by <window_id>, and [b]0[/b] otherwise.[br]
If <window_id> is not passed, the current window is used (assuming it is a channel at all).[br]
If the window is not a channel, a warning is printed and an empty string is returned.[br]
- This function is a "shortcut" for [fnc]$chan.isuserop[/fnc]([fnc]$me[/fnc]).[br]
+ This function is a [i]shortcut[/i] for [fnc]$chan.isuserop[/fnc]([fnc]$me[/fnc]).[br]
*/
IS_ME_KVS_FUNC(chan_kvs_fnc_ismeuserop,isMeUserOp)
@@ -1033,7 +1033,7 @@ static bool chan_kvs_fnc_key(KviKvsModuleFunctionCall * c)
If no <window_id> is passed, the current channel limit is returned (assuming that
the current window is a channel at all).[br]
If the window is not a channel, a warning is printed and an empty string is returned.[br]
- If the channel has no limit set, "0" is returned.[br]
+ If the channel has no limit set, [b]0[/b] is returned.[br]
Alternatively, you could use $chan.modeParam(l) to get the current limit.
@seealso:
[fnc]$chan.mode[/fnc]
@@ -1112,11 +1112,11 @@ static bool chan_kvs_fnc_modeParam(KviKvsModuleFunctionCall * c)
if it matches the [mask].[br]
[flags] may contain a subset of the letters [b]aovhnmi[/b]:[br]
[b]ovhn[/b] are mode flags: the users are added to the array only if they are channel administrators [b]a[/b], operators [b]o[/b],
- voiced users [b]v[/b], half-operators [b]h[/b], user-operators [b]u[/b] or unflagged [b]n[/b] users. (Unflagged means not operators, not
+ voiced users [b]v[/b], half-operators [b]h[/b], user-operators [b]u[/b] or unflagged [b]n[b] users. (Unflagged means not operators, not
voiced and not half-operators). If none of the [b]ovhun[/b] flags are used, KVIrc behaves like all five were passed.[br]
The flag [b]m[/b] causes the entire user masks to be added to the
array entries, as known by KVIrc at the moment of this function call.[br]
- The flag [b]i[/b] causes KVIrc to invert the match and add only the users that do NOT match [mask].[br]
+ The flag [b]i[/b] causes KVIrc to invert the match and add only the users that do [b]not[/b] match [mask].[br]
Please note that on really large channels this function may be time consuming (especially if [mask] is used):
use with care.[br]
@example:
@@ -1142,7 +1142,7 @@ static bool chan_kvs_fnc_modeParam(KviKvsModuleFunctionCall * c)
[comment]# Find all the channel operators[/comment]
%test[] = $chan.users(,,o)
echo %test[]
- [comment]# Find all the voiced users that do NOT come from *.edu[/comment]
+ [comment]# Find all the voiced users that do not come from *.edu[/comment]
[comment]# See also their whole mask[/comment]
%test[] = $chan.users(,*!*@*.edu,vim)
echo %test[]
@@ -1627,14 +1627,14 @@ static bool chan_kvs_fnc_matchinvite(KviKvsModuleFunctionCall * c)
Warning: this function is network-specific, makes some (bad) assumptions about a non-standard channel mode and
will probably be dropped in a future version.[br]
Use [fnc]$chan.matchmask[/fnc] instead.[br]
- Some networks use +q channel mode to set "mute bans".[br]
+ Some networks use +q channel mode to set [i]mute bans[/i].[br]
When an user mask matches such a ban, he won't be able to send messages to the channel.[br]
- The "mute bans" masks will be inserted in the normal channel bans list, with a percent sign % prepended.[br]
- This function returns the "mute ban" mask that matches <complete_mask> on channel identified by [window_id].[br]
+ The [i]mute bans[/i] masks will be inserted in the normal channel bans list, with a percent sign % prepended.[br]
+ This function returns the [i]mute ban[/i] mask that matches <complete_mask> on channel identified by [window_id].[br]
If no ban mask matches <complete_mask> an empty string is returned.[br]
If [window_id] is empty, the current window is used.[br]
If the window designated by [window_id] is not a channel a warning is printed and an empty string is returned.[br]
- This function is useful to determine if a "mute ban" set on the channel matches an user.[br]
+ This function is useful to determine if a [i]mute ban[/i] set on the channel matches an user.[br]
*/
static bool chan_kvs_fnc_matchqban(KviKvsModuleFunctionCall * c)
@@ -1745,11 +1745,11 @@ static bool chan_kvs_fnc_matchmask(KviKvsModuleFunctionCall * c)
@description:
Returns an integer identifying the specified user's channel mode on the channel specified by <window_id>.[br]
If <window_id> is not passed, the current window is used.[br]
- If the specified window is not a channel, a warning is printed and '0' is returned.[br]
+ If the specified window is not a channel, a warning is printed and [b]0[/b] is returned.[br]
This number can be useful to implement comparison functions between
users in order to determine the actions they can issue between each other.[br]
For example it is granted that an op will have userModeLevel greater than
- a voiced user or that a simple "modeless" user will have
+ a voiced user or that a simple [i]modeless[/i] user will have
an userModeLevel lower than a halfop.[br]
IRC allows multiple modes to be applied to a single user on a channel,
in that case this function will return the level of the highest mode
diff --git a/src/modules/channelsjoin/libkvichannelsjoin.cpp b/src/modules/channelsjoin/libkvichannelsjoin.cpp
index 44ce08d55..7af136d9e 100644
--- a/src/modules/channelsjoin/libkvichannelsjoin.cpp
+++ b/src/modules/channelsjoin/libkvichannelsjoin.cpp
@@ -47,7 +47,7 @@ QRect g_rectChannelsJoinGeometry;
channelsjoin.open
@description:
Shows a dialog that allows the user to enter channels in a visual manner.[br]
- This command is exported by the "channelsjoin" module.
+ This command is exported by the [b][i]channelsjoin[/i][/b] module.
*/
diff --git a/src/modules/config/libkviconfig.cpp b/src/modules/config/libkviconfig.cpp
index dea42cce8..56628baec 100644
--- a/src/modules/config/libkviconfig.cpp
+++ b/src/modules/config/libkviconfig.cpp
@@ -50,11 +50,11 @@ static int g_iNextConfigId = 0;
<filename> may be an absolute path or a relative path: if a relative path is used,
KVIrc will complete it with a local KVIrc directory suitable for writing script config files.[br]
If the config file doesn't exist, it is opened as empty config file.[br]
- Flags can contain a combination of letters 'r' and 'w'.[br]
- If only 'r' is specified, the config file is opened in "read-only" mode: no changes will be written to disk.[br]
- If only 'w' is specified, the config file is opened in "write-only" mode: the contents of the file on disk
+ Flags can contain a combination of letters [b]r[/b] and [b]w[/b].[br]
+ If only [b]r[/b] is specified, the config file is opened in [i]read-only[/i] mode: no changes will be written to disk.[br]
+ If only [b]w[/b] is specified, the config file is opened in [i]write-only[/i] mode: the contents of the file on disk
are not read.[br]
- If <flags> are not specified then 'rw' is assumed.[br]
+ If <flags> are not specified then [b][i]rw[/i][/b] is assumed.[br]
The function returns an identifier for the open config file. This identifier
is a mandatory parameter in all the other config.* functions and commands.[br]
The config section is set to the default section name: you can change it by using
@@ -66,13 +66,13 @@ static int g_iNextConfigId = 0;
[fnc]$config.id[/fnc]() function.[br]
@examples:
[example]
- # It is a good idea to store the returned ID to a variable :)
- %cfg = $config.open(myscript.kvc)
- %num = [fnc]$config.read[/fnc](%cfg,Number,0)
- [cmd]echo[/cmd] Number of entries is %num
- %num++;
- [cmd]config.write[/cmd] %cfg Number %num
- [cmd]config.close[/cmd] %cfg
+ [comment]# It is a good idea to store the returned ID to a variable :)[/comment]
+ %cfg = $config.open(myscript.kvc)
+ %num = [fnc]$config.read[/fnc](%cfg,Number,0)
+ [cmd]echo[/cmd] Number of entries is %num
+ %num++;
+ [cmd]config.write[/cmd] %cfg Number %num
+ [cmd]config.close[/cmd] %cfg
[/example]
@seealso:
[module:config]Config module documentation[/module]
@@ -142,7 +142,7 @@ static bool config_kvs_fnc_open(KviKvsModuleFunctionCall * c)
@description:
Returns the ID of an open config file specified by <filename>.[br]
(This is the same ID that is returned by [fnc]$config.open[/fnc].[br]
- If no such file is open, 0 is returned (that is an invalid config identifier).[br]
+ If no such file is open, [b]0[/b] is returned (that is an invalid config identifier).[br]
@seealso:
[module:config]Config module documentation[/module]
*/
@@ -268,10 +268,10 @@ static bool config_kvs_fnc_section(KviKvsModuleFunctionCall * c)
@syntax:
$config.readonly(<id>)
@description:
- Returns 1 if the config file identified by <id> is opened in read-only mode,
- 0 otherwise.[br]
+ Returns [b]1[/b] if the config file identified by <id> is opened in read-only mode,
+ and [b]0[/b] otherwise.[br]
<id> must be a valid config identifier returned by [fnc]$config.open[/fnc]()
- If <id> does not identify an open config file, a warning is printed and 0 is returned.[br]
+ If <id> does not identify an open config file, a warning is printed and [b]0[/b] is returned.[br]
@seealso:
[module:config]Config module documentation[/module]
*/
@@ -342,8 +342,8 @@ static bool config_kvs_fnc_filename(KviKvsModuleFunctionCall * c)
@syntax:
$config.hassection(<id>,<section_name>)
@description:
- Returns 1 if the section <section_name> exists in the config file identifier by <id>,
- 0 otherwise.[br]
+ Returns [b]1[/b] if the section <section_name> exists in the config file identifier by <id>,
+ and [b]0[/b] otherwise.[br]
<id> must be a valid config identifier returned by [fnc]$config.open[/fnc]()
@seealso:
[module:config]Config module documentation[/module]
@@ -515,7 +515,7 @@ static bool config_kvs_fnc_filelist(KviKvsModuleFunctionCall * c)
If the config file was opened as read-write (default), the changes will be stored
to disk. If the config was opened as read-only, changes will not be written.[br]
If the <id> does not match any open config file, a warning is printed unless
- the -q switch is used.[br]
+ the -q (quiet) switch is used.[br]
@seealso:
[module:config]Config module documentation[/module]
*/
@@ -703,7 +703,7 @@ static bool config_kvs_cmd_clearsection(KviKvsModuleCommandCall * c)
If <key> already exists in the current section of the config, the corresponding value is replaced with <value>.[br]
If <value> is an empty string, the <key> is simply removed from the current section.[br]
If a section remains empty (with no keys) at file write time, that section will be removed.[br]
- The changes are NOT written to disk: you must call [cmd]config.flush[/cmd] or (better) [cmd]config.close[/cmd]
+ The changes are [b]not[/b] written to disk: you must call [cmd]config.flush[/cmd] or (better) [cmd]config.close[/cmd]
for the changes to be effectively written.[br]
@seealso:
[module:config]Config module documentation[/module]
diff --git a/src/modules/context/libkvicontext.cpp b/src/modules/context/libkvicontext.cpp
index bcf8a5813..b0da0cc6c 100644
--- a/src/modules/context/libkvicontext.cpp
+++ b/src/modules/context/libkvicontext.cpp
@@ -414,7 +414,7 @@ STANDARD_IRC_CONNECTION_TARGET_PARAMETER(
<string> $context.state(<irc_context_id:uint>)
@description:
Returns a string describing the state of the specified IRC context.
- The string will be either "idle","connecting","loggingin" or "connected".
+ The string will be either [i]idle[/i], [i]connecting[/i], [i]logging in[/i] or [i]connected[/i].
If no irc_context_id is specified then the current irc_context is used.
If the irc_context_id specification is not valid then this function
returns nothing.
diff --git a/src/modules/dcc/libkvidcc.cpp b/src/modules/dcc/libkvidcc.cpp
index 4115225c7..be15c526e 100644
--- a/src/modules/dcc/libkvidcc.cpp
+++ b/src/modules/dcc/libkvidcc.cpp
@@ -195,25 +195,22 @@ static bool dcc_kvs_parse_default_parameters(DccDescriptor * d,KviKvsModuleComma
if the [fnc]$option[/fnc](boolCreateMinimizedDccChat) returns false.[br]
In the same way, by passing -m=0 you will create a non minimized DCC SEND.
If no <boolean> value is specified, it defaults to 1.[br]
-
!sw: -n | --no-ctcp
Do [b]not[/b] send the CTCP request to the target user, you will have to do it manually,
or the remote user will have to connect manually (for example by using dcc.chat -c).[br]
-
!sw: -c | --connect
Attempt to CONNECT to the remote host specified as <interface> and <port>,
instead of listening (active connection instead of a passive one).
In this case the -i and -p switches are mandatory.[br]
- The 'c' switch takes precedence over 'n' (In fact both should
+ The [b]c[/b] switch takes precedence over [b]n[/b] (In fact both should
be mutually exclusive).[br]
- If the 'c' and 'n' switches are missing, this commands
+ If the [b]c[/b] and [b]n[/b] switches are missing, this commands
needs to be executed in a window that is bound to a connected
IRC context (you need a third entity to accomplish the negotiation).[br]
-
!sw: -i=<interface> | --ip=<interface>
Bind the local listening socket to the specified <interface> (which is an IP address, IPv4 or IPv6).
If this switch is [b]not[/b] specified, the socket is bound to the interface of
- the current IRC connection (if any) or to "127.0.0.1".[br]
+ the current IRC connection (if any) or to [i]127.0.0.1[/i].[br]
You can also specify a local interface name to get the address from (this works only for IPv4 interfaces
since IPv6 ones seems to be unsupported by the system ioctl() calls at the moment (for Linux at least)).[br]
Here go some examples:[br]
@@ -221,16 +218,13 @@ static bool dcc_kvs_parse_default_parameters(DccDescriptor * d,KviKvsModuleComma
-i=3ffe:1001::1: this will bind to the IPv6 interface with the specified address.[br]
-i=ppp0: this will bind to the IPv4 address of the interface ppp0 (if supported by the underlying system).[br]
The -i switch parameter may serve also as a target address when the -c switch is used.[br]
-
!sw: -p=<port> | --port=<port>
Bind the local listening socket to the specified <port>.
- If this switch is [b]not[/b] specified, the port will be a "random" one chosen by the kernel.[br]
-
+ If this switch is [b]not[/b] specified, the port will be a [i]random[/i] one chosen by the kernel.[br]
!sw: -a=<fake address> | --fake-address=<fake address>
Send the <fake address> as target for the remote client in the requesting CTCP message.
If this switch is not given, the CTCP will contain the real IP address of the listening
interface.[br]
-
!sw: -f=<fake port> | --fake-port=<fake port>
Send the <fake port> as target port for the remote client in the requesting CTCP message.
If this switch is not given, the CTCP will contain the real port of the listening socket.
@@ -238,16 +232,14 @@ static bool dcc_kvs_parse_default_parameters(DccDescriptor * d,KviKvsModuleComma
All these switches are meant to allow maximum flexibility of the
DCC negotiation, earlier KVIrc releases had serious problems
with firewalled and/or masqueraded machines. With the -a and -f switches
- you can work around it.[br]
- [br]
-
+ you can work around it.
+ [br][br]
!sw: -u | --unlimited
If the 'u' switch is given, the connection attempt will
never time out; this might be useful if you want to leave
a listening socket for a friend of yours while you are sleeping
and have the CTCP processing disabled. The 'u' switch works either
in active and passive mode.[br]
-
!sw: -s | --ssl
Use a Secure Socket Layer for the transfer; the whole communication will be encrypted
with a private key algorithm after a public key handshake.[br]
@@ -259,17 +251,16 @@ static bool dcc_kvs_parse_default_parameters(DccDescriptor * d,KviKvsModuleComma
When requesting a SSL based DCC SEND to someone you probably will need a
certificate. If you don't have one, create it (for example with CA.pl -newcert)
and set it in the options dialog.
-
!sw: -z | --zero-port
Use the 0 port method. This is a dirty hack that allows you to use the CHAT
protocol with mIrc receiving clients.
@description:
Attempts a DCC connection to <nickname>.[br]
- The simplest case "dcc.chat <nickname>" will work just as in all
+ The simplest case [i]dcc.chat <nickname>[/i] will work just as in all
the other IRC clients, but this command is really more powerful...[br]
Before attempting to understand the possibilities of this command,
be sure to know how [doc:dcc_connection]DCC negotiation and connections[/doc] work.
- If the 'i' switch is specified, the local listening socket
+ If the [b]i[/b] switch is specified, the local listening socket
will be bound to the specified <interface> (which is an IP address, IPv4 or IPv6),
otherwise it will be bound to the interface of the current IRC connection.[br]
You can also specify a local interface name to get the address from (this works only for IPv4 interfaces
@@ -279,14 +270,14 @@ static bool dcc_kvs_parse_default_parameters(DccDescriptor * d,KviKvsModuleComma
-i=3ffe:1001::1: This will bind to the IPv6 interface with the specified address.[br]
-i=ppp0: This will bind to the IPv4 address of the interface ppp0 (if supported by the underlying system).[br]
The -i switch parameter may serve also as a target address when the -c switch is used.[br]
- If the 'p' switch is specified, the local listening socket
+ If the [b]p[/b] switch is specified, the local listening socket
will be bound to the <port>, otherwise it will be bound to
a random port chosen by the kernel.[br]
- If the 'a' switch is specified, the requesting CTCP message
+ If the [b]a[/b] switch is specified, the requesting CTCP message
will contain <fake address> as target for the remote user,
otherwise the CTCP message will contain the real IP address
of the listening interface.
- If the 'f' switch is specified, the requesting CTCP message
+ If the [b]f[/b] switch is specified, the requesting CTCP message
will contain <fake port> as target for the remote user,
otherwise the CTCP message will contain the real port of the
listening socket.
@@ -294,22 +285,22 @@ static bool dcc_kvs_parse_default_parameters(DccDescriptor * d,KviKvsModuleComma
DCC negotiation, earlier KVIrc releases had serious problems
with firewalled and/or masqueraded machines. With the -a and -f switches
you can workaround it.
- If the 'n' switch is specified, KVIrc will [b]not[/b] send the CTCP request
+ If the [b]n[/b] switch is specified, KVIrc will [b]not[/b] send the CTCP request
to the target user; you will have to do it manually, or the remote user
will have to connect manually (for example by using dcc.chat -c).
- If the 'c' switch is specified, KVIrc will attempt to connect
+ If the [b]c[/b] switch is specified, KVIrc will attempt to connect
to the remote host specified as <interface> and <port>, instead
of listening (active connection instead of a passive one).
In this case the -i and -p switches are mandatory.[br]
- The 'c' switch takes precedence over 'n' (In fact both should
+ The [b]c[/b] switch takes precedence over [b]n[/b] (In fact both should
be mutually exclusive).[br]
- If the 'c' and 'n' switches are missing, this commands
+ If the [b]c[/b] and [b]n[/b] switches are missing, this commands
needs to be executed in a window that is bound to a connected
IRC context (you need a third entity to accomplish the negotiation).[br]
- If the 'u' switch is given, the connection attempt will
+ If the [b]u[/b] switch is given, the connection attempt will
never time out; this might be useful if you want to leave
a listening socket for a friend of yours while you are sleeping
- and have the CTCP processing disabled. The 'u' switch works either
+ and have the CTCP processing disabled. The [b]u[/b] switch works either
in active and passive mode.[br]
If the -m switch is passed, the default boolCreateMinimizedDccChat option
is overridden with the <boolean> parameter passed. So actually
@@ -471,7 +462,7 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c)
It causes the transfer direction to be inverted; your client will receive
the file from the remote host instead of sending it.[br]
<file size> is the expected file size in bytes. This parameter can be omitted,
- and in this case the DCC will "blindly" trust the remote end and assume
+ and in this case the DCC will [i]blindly[/i] trust the remote end and assume
that the file has been transferred correctly when the remote end closes the connection.[br]
If you don't pass the -n option, the remote end will receive an informational DCC RECV request,
specifying the IP address and the port to connect to.[br]
@@ -493,18 +484,15 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c)
If spion had specified the file size, Pragma could use -g=<file size> while setting up the connection,
to be able to see the progress indications.[br]
If Pragma used the the -n option, the DCC RECV indication wouldn't have been sent, in this case
- Pragma would need to communicate the IP address and the port "manually" to spion.[br]
-
+ Pragma would need to communicate the IP address and the port [i]manually[/i] to spion.[br]
!sw: -b | --blind
Assume that no acknowledges are sent.
Assume that the transfer was successful when the whole file has been sent,
then close the socket.[br]
- This is called a "blind" DCC SEND.[br]
-
+ This is called a [i]blind[/i] DCC SEND.[br]
!sw: -t | -tdcc
Emulate the TDCC protocol: Use the TDCC CTCP message (DCC TSEND) for requesting the connection
and assume that no acknowledges are sent. Wait for the remote end to close the connection.[br]
-
!sw: -m[=<boolean>] | --minimize[=<boolean>]
If the -m switch is passed, the default boolCreateMinimizedDccSend option
is overridden with the <boolean> parameter passed. So actually
@@ -512,11 +500,9 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c)
if the [fnc]$option[/fnc](boolCreateMinimizedDccSend) returns false.[br]
In the same way, by passing -m=0 you will create a non minimized DCC SEND.
If no <boolean> value is specified, it defaults to 1.[br]
-
!sw: -n | --no-ctcp
Do [b]not[/b] send the CTCP request to the target user, you will have to do it manually,
or the remote user will have to connect manually (for example by using dcc.recv -c).[br]
-
!sw: -c | --connect
Attempt to CONNECT to the remote host specified as <interface> and <port>,
instead of listening (active connection instead of a passive one).
@@ -526,11 +512,10 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c)
If the 'c' and 'n' switches are missing, this commands
needs to be executed in a window that is bound to a connected
IRC context (you need a third entity to accomplish the negotiation).[br]
-
!sw: -i=<interface> | --ip=<interface>
Bind the local listening socket to the specified <interface> (which is an IP address, IPv4 or IPv6).
If this switch is [b]not[/b] specified, the socket is bound to the interface of
- the current IRC connection (if any) or to "127.0.0.1".[br]
+ the current IRC connection (if any) or to [i]127.0.0.1[/i].[br]
You can also specify a local interface name to get the address from (this works only for IPv4 interfaces
since IPv6 ones seems to be unsupported by the system ioctl() calls at the moment (for Linux at least)).[br]
Here go some examples:[br]
@@ -538,16 +523,13 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c)
-i=3ffe:1001::1: this will bind to the IPv6 interface with the specified address.[br]
-i=ppp0: this will bind to the IPv4 address of the interface ppp0 (if supported by the underlying system).[br]
The -i switch parameter may serve also as a target address when the -c switch is used.[br]
-
!sw: -p=<port> | --port=<port>
Bind the local listening socket to the specified <port>.
- If this switch is [b]not[/b] specified, the port will be a "random" one chosen by the kernel.[br]
-
+ If this switch is [b]not[/b] specified, the port will be a [i]random[/i] one chosen by the kernel.[br]
!sw: -a=<fake address> | --fake-address=<fake address>
Send the <fake address> as target for the remote client in the requesting CTCP message.
If this switch is not given, the CTCP will contain the real IP address of the listening
interface.[br]
-
!sw: -f=<fake port> | --fake-port=<fake port>
Send the <fake port> as target port for the remote client in the requesting CTCP message.
If this switch is not given, the CTCP will contain the real port of the listening socket.
@@ -555,16 +537,13 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c)
All these switches are meant to allow maximum flexibility of the
DCC negotiation, earlier KVIrc releases had serious problems
with firewalled and/or masqueraded machines. With the -a and -f switches
- you can work around it.[br]
- [br]
-
+ you can work around it.[br][/br]
!sw: -u | --unlimited
If the 'u' switch is given, the connection attempt will
never time out; this might be useful if you want to leave
a listening socket for a friend of yours while you are sleeping
and have the CTCP processing disabled. The 'u' switch works either
in active and passive mode.[br]
-
!sw: -s | --ssl
Use a Secure Socket Layer for the transfer; the whole communication will be encrypted
with a private key algorithm after a public key handshake.[br]
@@ -576,19 +555,18 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c)
When requesting a SSL based DCC SEND to someone you probably will need a
certificate. If you don't have one, create it (for example with CA.pl -newcert)
and set it in the options dialog.
-
@description:
Attempts to send the file <filename> to <nickname>.[br]
If [filename] is specified it must be an absolute file path,
otherwise a file selection dialog is opened.[br]
- The simplest case "dcc.send <nickname> <filename>" will work just as in all
+ The simplest case [i]dcc.send <nickname> <filename>[/i] will work just as in all
the other IRC clients, but this command is really more powerful...[br]
Before attempting to understand the possibilities of this command,
be sure to know how a [doc:dcc_connection]DCC negotiation and connection[/doc] works.[br]
The file will be sent as a sequence of packets which must
be acknowledged one by one by the active client.[br]
- There is a special option (see $option()) called "fast send" (also known
- as "send ahead") that makes KVIrc avoid to wait for the acknowledge
+ There is a special option (see $option()) called [i]fast send[/i] (also known
+ as [i]send ahead[/i]) that makes KVIrc avoid to wait for the acknowledge
of the last packet before sending the next one.[br]
Anyway, the connection is declared as successful only
when the whole file (all the packets) has been acknowledged.[br]
@@ -702,12 +680,10 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c)
Assume that no acknowledges are sent.
Assume that the transfer was successful when the whole file has been sent,
then close the socket.[br]
- This is called a "blind" DCC SEND.[br]
-
+ This is called a [i]blind[/i] DCC SEND.[br]
!sw: -t | -tdcc
Emulate the TDCC protocol: Use the TDCC CTCP message (DCC TSEND) for requesting the connection
and assume that no acknowledges are sent. Wait for the remote end to close the connection.[br]
-
!sw: -m[=<boolean>] | --minimize[=<boolean>]
If the -m switch is passed, the default boolCreateMinimizedDccSend option
is overridden with the <boolean> parameter passed. So actually
@@ -715,15 +691,13 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c)
if the [fnc]$option[/fnc](boolCreateMinimizedDccSend) returns false.[br]
In the same way, by passing -m=0 you will create a non minimized DCC SEND.
If no <boolean> value is specified, it defaults to 1.[br]
-
!sw: -n | --no-ctcp
Do [b]not[/b] send the CTCP request to the target user, you will have to do it manually,
or the remote user will have to connect manually (for example by using dcc.recv -c).[br]
-
!sw: -i=<interface> | --ip=<interface>
Bind the local listening socket to the specified <interface> (which is an IP address, IPv4 or IPv6).
If this switch is [b]not[/b] specified, the socket is bound to the interface of
- the current IRC connection (if any) or to "127.0.0.1".[br]
+ the current IRC connection (if any) or to [i]127.0.0.1[/i].[br]
You can also specify a local interface name to get the address from (this works only for IPv4 interfaces
since IPv6 ones seems to be unsupported by the system ioctl() calls at the moment (for Linux at least)).[br]
Here go some examples:[br]
@@ -731,16 +705,13 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c)
-i=3ffe:1001::1: this will bind to the IPv6 interface with the specified address.[br]
-i=ppp0: this will bind to the IPv4 address of the interface ppp0 (if supported by the underlying system).[br]
The -i switch parameter may serve also as a target address when the -c switch is used.[br]
-
!sw: -p=<port> | --port=<port>
Bind the local listening socket to the specified <port>.
- If this switch is [b]not[/b] specified, the port will be a "random" one chosen by the kernel.[br]
-
+ If this switch is [b]not[/b] specified, the port will be a [i]random[/i] one chosen by the kernel.[br]
!sw: -a=<fake address> | --fake-address=<fake address>
Send the <fake address> as target for the remote client in the requesting CTCP message.
If this switch is not given, the CTCP will contain the real IP address of the listening
interface.[br]
-
!sw: -f=<fake port> | --fake-port=<fake port>
Send the <fake port> as target port for the remote client in the requesting CTCP message.
If this switch is not given, the CTCP will contain the real port of the listening socket.
@@ -748,16 +719,14 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c)
All these switches are meant to allow maximum flexibility of the
DCC negotiation, earlier KVIrc releases had serious problems
with firewalled and/or masqueraded machines. With the -a and -f switches
- you can work around it.[br]
- [br]
-
+ you can work around it.
+ [br][br]
!sw: -u | --unlimited
- If the 'u' switch is given, the connection attempt will
+ If the [b][/b] switch is given, the connection attempt will
never time out; this might be useful if you want to leave
a listening socket for a friend of yours while you are sleeping
and have the CTCP processing disabled. The 'u' switch works either
in active and passive mode.[br]
-
!sw: -s | --ssl
Use a Secure Socket Layer for the transfer; the whole communication will be encrypted
with a private key algorithm after a public key handshake.[br]
@@ -769,7 +738,6 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c)
When requesting a SSL based DCC SEND to someone you probably will need a
certificate. If you don't have one, create it (for example with CA.pl -newcert)
and set it in the options dialog.
-
!sw: -c | --connect
Accepted for compatibility: don't use it!
@description:
@@ -779,7 +747,7 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c)
is a CTCP RECV.[br]
This command is the counterpart of [cmd]dcc.send[/cmd] and its parameters are exactly the same, so please refer to that
help page for the full discussion. This help page contains only a brief resume of these parameters.[br]
- The [doc:dcc_connection]dcc documentation[/doc] explains the DCC RECV subprotocol in detail.[br]
+ The [doc:dcc_connection]dcc documentation[/doc] explains the DCC RECV sub-protocol in detail.[br]
@examples:
*/
@@ -840,7 +808,6 @@ static bool dcc_kvs_cmd_recv(KviKvsModuleCommandCall * c)
@switches:
!sw: -t | -tdcc
Emulate the TDCC protocol.
-
!sw: -s | --ssl
Use a Secure Socket Layer for the transfer; the whole communication will be encrypted
with a private key algorithm after a public key handshake.[br]
@@ -861,7 +828,7 @@ static bool dcc_kvs_cmd_recv(KviKvsModuleCommandCall * c)
The remote end may acknowledge the request by sending a DCC RECV request.
This command effects are similar to [cmd]dcc.send[/cmd], but will work also on machines
that can't accept incoming connections (firewalling or masquerading problems).[br]
- A 120 seconds file offer is added for the specified file and mask "<nickname>!*@*".
+ A 120 seconds file offer is added for the specified file and mask [i]<nickname>!*@*[/i].
@examples:
*/
@@ -922,7 +889,7 @@ static bool dcc_kvs_cmd_rsend(KviKvsModuleCommandCall * c)
a TSEND reply.[br]
If the -s switch is given, the message will be a DCC SGET, expecting
a SSEND reply.[br]
- -t and -s can be combined together to obtain a "turbo"+"SSL" extension transfer.[br]
+ -t and -s can be combined together to obtain a [i]Turbo[/i]+[i]SSL[/i] extension transfer.[br]
-s will work only if the KVIrc executable has been compiled with SSL support and
the remote client supports it.[br]
@examples:
@@ -1000,11 +967,9 @@ static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c)
!sw: -g=<codec> | --codec=<codec>
Use the codec specified as parameter.
Actually the supported codecs are [i]null[/i], [i]adpcm[/i] and [i]gsm[/i].
-
!sw: -h=<rate> | --sample-rate=<rate>
Use the sample rate specified by <rage>.
Valid sample rates are 8000, 11025, 22050 and 44100 Hz.
-
!sw: -m[=<boolean>] | --minimize[=<boolean>]
If the -m switch is passed, the default boolCreateMinimizedDccSend option
is overridden with the <boolean> parameter passed. So actually
@@ -1012,25 +977,22 @@ static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c)
if the [fnc]$option[/fnc](boolCreateMinimizedDccSend) returns false.[br]
In the same way, by passing -m=0 you will create a non minimized DCC SEND.
If no <boolean> value is specified, it defaults to 1.[br]
-
!sw: -n | --no-ctcp
Do [b]not[/b] send the CTCP request to the target user, you will have to do it manually,
or the remote user will have to connect manually (for example by using dcc.recv -c).[br]
-
!sw: -c | --connect
Attempt to CONNECT to the remote host specified as <interface> and <port>,
instead of listening (active connection instead of a passive one).
In this case the -i and -p switches are mandatory.[br]
- The 'c' switch takes precedence over 'n' (In fact both should
+ The [b]c[/b] switch takes precedence over [b]n[/b] (In fact both should
be mutually exclusive).[br]
- If the 'c' and 'n' switches are missing, this commands
+ If the [b]c[/b] and [b]n[/b] switches are missing, this commands
needs to be executed in a window that is bound to a connected
IRC context (you need a third entity to accomplish the negotiation).[br]
-
!sw: -i=<interface> | --ip=<interface>
Bind the local listening socket to the specified <interface> (which is an IP address, IPv4 or IPv6).
If this switch is [b]not[/b] specified, the socket is bound to the interface of
- the current IRC connection (if any) or to "127.0.0.1".[br]
+ the current IRC connection (if any) or to [i]127.0.0.1[/i].[br]
You can also specify a local interface name to get the address from (this works only for IPv4 interfaces
since IPv6 ones seems to be unsupported by the system ioctl() calls at the moment (for Linux at least)).[br]
Here go some examples:[br]
@@ -1038,16 +1000,13 @@ static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c)
-i=3ffe:1001::1: this will bind to the IPv6 interface with the specified address.[br]
-i=ppp0: this will bind to the IPv4 address of the interface ppp0 (if supported by the underlying system).[br]
The -i switch parameter may serve also as a target address when the -c switch is used.[br]
-
!sw: -p=<port> | --port=<port>
Bind the local listening socket to the specified <port>.
- If this switch is [b]not[/b] specified, the port will be a "random" one chosen by the kernel.[br]
-
+ If this switch is [b]not[/b] specified, the port will be a [i]random[/i] one chosen by the kernel.[br]
!sw: -a=<fake address> | --fake-address=<fake address>
Send the <fake address> as target for the remote client in the requesting CTCP message.
If this switch is not given, the CTCP will contain the real IP address of the listening
interface.[br]
-
!sw: -f=<fake port> | --fake-port=<fake port>
Send the <fake port> as target port for the remote client in the requesting CTCP message.
If this switch is not given, the CTCP will contain the real port of the listening socket.
@@ -1057,14 +1016,12 @@ static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c)
with firewalled and/or masqueraded machines. With the -a and -f switches
you can work around it.[br]
[br]
-
!sw: -u | --unlimited
If the 'u' switch is given, the connection attempt will
never time out; this might be useful if you want to leave
a listening socket for a friend of yours while you are sleeping
and have the CTCP processing disabled. The 'u' switch works either
in active and passive mode.[br]
-
@description:
Attempts a DCC Voice connection to <nickname>.[br]
The -g option is used to select the GSM codec, available codecs are [i]gsm[/i], [i]adpcm[/i] and [i]null[/i].[br]
@@ -1081,7 +1038,7 @@ static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c)
the lowest limit is 5 KHz and the upper limit is 44.1 KHz (but some soundcards support 96 KHz).
It is also possible that the soundcard can't support a continuous range of frequencies and
will select a discrete closest match instead.[br]
- The "commonly used" sample rates are 8000, 11025, 22050 and 44100 Hz.[br]
+ The [i]commonly used[/i] sample rates are 8000, 11025, 22050 and 44100 Hz.[br]
The remaining parameters are equivalent to the ones used in [cmd]dcc.send[/cmd], so please refer to that
help page for the full discussion. This help page contains only a brief resume of these parameters.[br]
@examples:
@@ -1386,18 +1343,18 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c)
'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
- subprotocols with (more or less) standardized rules.[br]
+ sub-protocols with (more or less) standardized rules.[br]
Sub-protocols are also (historically) called [b]DCC types[/b]; this term often
leads to confusion and it will become clear later.[br]
- Each subprotocol has two main parts: The [b]DCC negotiation[/b] and the [b]DCC transfer[/b].[br]
+ Each sub-protocol has two main parts: The [b]DCC negotiation[/b] and the [b]DCC transfer[/b].[br]
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 part of the protocol is the most tricky and difficult one, and is different for almost every DCC subprotocol.[br]
- The "constant" scenario of the negotiation is more or less the following:[br]
+ 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
a direct client connection.[br]
Each client knows the other by nickname only (and eventually by the host displayed by the IRC server,
@@ -1411,12 +1368,12 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c)
The negotiation exchanges these information between clients by using IRC as channel and CTCP messages
as encoding method.[br]
An example will make things clearer:[br]
- DCC chat is the simplest (and most widely implemented) DCC subprotocol:
+ DCC chat is the simplest (and most widely implemented) DCC sub-protocol:
it is used to exchange <cr><lf> separated text data between clients.[br]
Assume that you want to establish a DCC chat
connection to 'Sarah' that is currently connected to your IRC network (so
she/he is an IRC user just like you).
- All you have to do is type sth as "/dcc chat Sarah" in your IRC client.
+ All you have to do is type sth as [i]/dcc chat Sarah[/i] in your IRC client.
The client will setup a listening socket on a random port chosen
usually by the kernel of your OS. In this case YOU are the [b]passive client[/b], and Sarah is the active one.[br]
Once the socket is ready to accept connections,
@@ -1432,13 +1389,13 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c)
Some IRC clients allow modifications of this procedure:[br]
First of all, the port to listen on can be specified by the user
and not by the kernel; this is useful when the passive client
- is behind a firewall that "shades" some sets of ports.
+ is behind a firewall that [i]shades[/i] some sets of ports.
The IP address for the listening socket
can be specified by the user as well (especially when the machine has more than one network interface).[br]
A more challenging trick is to listen on a specified IP address and port
and notify different ones to the remote user (e.g. <ip_address> and <port>
parameters of the CTCP message are not the ones that the client is listening on).
- This is especially useful with "transparent proxy" firewalls that
+ This is especially useful with [i]transparent proxy[/i] firewalls that
often are not transparent enough to allow the DCC connections.
(If you have one of these firewalls you know what I'm talking about,
otherwise just read on). KVIrc allows to avoid the usage of a third entity
@@ -1450,23 +1407,23 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c)
Is everything clear?...I don't think so... my English is really bad...
[br]
[big]DCC Transfer[/big][br]
- The DCC transfer part is different for every DCC subprotocol, but
+ 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 Subprotocols[/big][br]
- There are two main standardized DCC subprotocols that are widely implemented in IRC clients:
+ [big]DCC Sub-protocols[/big][br]
+ 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]
DCC SEND is a *real mess*, the original definition was not very flexible
so many IRC clients tried to enhance both the negotiation and the transfer, leading
often to incompatible implementations. (I can remember the Turbo File Transfer implemented
by VIrc, the Send-Ahead enhancement implemented in many clients, the RESUME facility...)[br]
- Many clients introduced new DCC subprotocols with non-standard implementations,
+ Many clients introduced new DCC sub-protocols with non-standard implementations,
leading again to client incompatibility.[br]
- Some of the notable subprotocols are DCC Voice, DCC Draw, DCC Whiteboard...[br]
+ Some of the notable sub-protocols are DCC Voice, DCC Draw, DCC Whiteboard...[br]
[br]
[big]DCC Chat[/big][br]
- This is the simplest and most standardized DCC subprotocol. Almost every IRC client implements it.[br]
+ 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].
[b]client A[/b] sets up a listening socket and retrieves its address (IP address and port).[br]
@@ -1475,8 +1432,8 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c)
Where <ipaddress> is a string representing an positive integer that is the A socket's IP address
in network byte order, and where <port> is a string representing an positive integer that is the
A socket's port.[br]
- The original purpose of the second "chat" string in the CTCP request is quite obscure, it was probably
- introduced to have the <ipaddress> as second parameter, as in the DCC SEND subprotocol.[br]
+ The original purpose of the second [i]chat[/i] string in the CTCP request is quite obscure, it was probably
+ introduced to have the <ipaddress> as second parameter, as in the DCC SEND sub-protocol.[br]
[b]client B[/b] receives the CTCP, parses it, eventually asks the user for permission and connects
to the specified IP address and port.
The transfer protocol is quite simple, both clients can send text lines separated by <cr><lf> pairs.[br]
@@ -1489,12 +1446,12 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c)
standard string representation of the IP address... missing inet_aton() function on the target system?).[br]
KVIrc adds the Secure Sockets Layer to the DCC chat protocol. In this case the negotiation string becomes:[br]
[b]DCC SCHAT chat <ipaddress> <port>[/b][br]
- where "SCHAT" stands for Secure CHAT.[br] The external protocol is exactly the same but is built on top of a Secure Sockets Layer
+ 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]
- DCC SEND is another standard subprotocol. Most clients implement this as well, many have tried
+ 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]
The requesting client (the one that sends the file) is always passive and the receiving client is always active.[br]
@@ -1503,7 +1460,7 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c)
[b]client A[/b] sets up a listening socket and retrieves its IP address and port.[br]
[b]client A[/b] sends a CTCP request to [b]client B[/b] in the following form:[br]
[b]DCC SEND <filename> <ipaddress> <port> <filesize>[/b][br]
- <ipaddress> and <port> have the same semantics as in the DCC chat subprotocol.[br]
+ <ipaddress> and <port> have the same semantics as in the DCC chat sub-protocol.[br]
<filename> is the name (without path!) of the file to be sent, and <filesize> is (yeah), the file size.[br]
[b]client B[/b] receives the CTCP, parses it, eventually asks the user for confirmation and connects to the
specified IP address and port; the transfer then begins.[br]
@@ -1512,17 +1469,17 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c)
of the file received up to that moment.[br]
The transmission closes when the last acknowledge is received by [b]client A[/b].[br]
The acknowledges were meant to include some sort of coherency check in the transmission, but in fact
- no client can "recover" from an acknowledge error/desync, all of them just close the connection declaring the
+ no client can [i]recover[/i] from an acknowledge error/desync, all of them just close the connection declaring the
transfer as failed (the situation is even worse in fact, often acknowledge errors aren't even detected!).[br]
Since the packet-acknowledge round trip eats a lot of time, many clients included
- the "send-ahead" feature; the [b]client A[/b] does [b]not[/b] wait for the acknowledge of the first packet before sending the second one.[br]
+ the [i]send-ahead[/i] feature; the [b]client A[/b] does [b]not[/b] wait for the acknowledge of the first packet before sending the second one.[br]
The acknowledges are still sent, but just a reverse independent stream.[br] This makes the DCC SEND considerably faster.[br]
Since the acknowledge stream has non-zero bandwidth usage, no client can recover from an acknowledge error and
- having them as an independent stream is more or less like having no acknowledges, the "Turbo" ( :) ) extension has been added:
+ having them as an independent stream is more or less like having no acknowledges, the [i]Turbo[/i] ( :) ) extension has been added:
[b]client B[/b] will send no acknowledges and will just close the connection when he has received all the expected data.[br]
This makes the DCC SEND as fast as FTP transfers.[br]
- The "Turbo" extension is specified during the negotiation phase, bu using TSEND as DCC message type (instead of SEND).[br]
- The "Turbo" extension is not widely implemented.[br]
+ The [i]Turbo[/i] extension is specified during the negotiation phase, bu using TSEND as DCC message type (instead of SEND).[br]
+ The [i]Turbo[/i] extension is not widely implemented.[br]
Later implementations have added the support for resuming interrupted DCC SEND transfers:[br]
[b]client A[/b] sets up the socket and sends the CTCP request as before.[br]
If [b]client B[/b] discovers that the file has been partially received in a previous DCC SEND session it sends
@@ -1533,19 +1490,19 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c)
[b]client A[/b] receives the request, parses it and eventually replies with:[br]
[b]DCC ACCEPT <filename> <port> <resume position>[/b][br]
[b]client B[/b] receives the ACCEPT message, connects to [b]client A[/b] and the transfer initiates as before.[br]
- The "Send-ahead" and "Turbo" extensions can obviously be used also in this case (But 'T' is [b]not[/b] prepended to the RESUME and ACCEPT messages).[br]
- The IPv6 extension can be used also in this subprotocol, so <ipaddress> can be also an IPv6 address in hexadecimal notation.[br]
+ The [i]Send-ahead[/i] and [i]Turbo[/i] extensions can obviously be used also in this case (But [b]T[/b] is [b]not[/b] prepended to the RESUME and ACCEPT messages).[br]
+ The IPv6 extension can be used also in this sub-protocol, so <ipaddress> can be also an IPv6 address in hexadecimal notation.[br]
KVIrc introduces the SSL extension also to DCC SEND. The protocol remains the same again but it is built on top of
a Secure Sockets Layer implementation just like DCC chat.[br]
With SSL the negotiation string becomes:[br]
[b]DCC SSEND <filename> <ipaddress> <port> <filesize>[/b][br]
- where "SSEND" stands for Secure SEND.[br]
- The "turbo" extension can be combined with the SSL extension too. In this case the second parameter
- of the negotiation string must be "TSSEND" or "STSEND".[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]
DCC RECV is the counterpart of DCC SEND. This is a KVIrc extension and is not standard yet.[br]
- The purpose of this subprotocol will not be immediately clear, but read on for an explanation.[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
a specific file and is able/wants to send it.[br]
[b]client A[/b] sets up a listening socket, retrieves its address and port and then
@@ -1557,38 +1514,38 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c)
[b]client B[/b] receives the CTCP message, parses it, looks for the file to send (in some unspecified way)
and connects to the specified IP address and port. The transfer then begins just as in the DCC SEND, but in the inverse way:
[b]client B[/b] sends blocks of data to [b]client A[/b] and [b]client B[/b] sends back acknowledges.[br]
- This subprotocol is useful in transferring data from clients that are behind a firewall and are not able to accept
+ This sub-protocol is useful in transferring data from clients that are behind a firewall and are not able to accept
incoming connections (this is not possible with a normal DCC SEND). In this case the client that receives
the file is passive and the client that sends it is active (as opposite to DCC SEND).[br]
- The "Send ahead" extension can be used also in this case and the "Turbo" extension is activated by prepending a 'T' to the
- DCC message, "TRECV" instead of "RECV". The SSL extension is activated by prepending an 'S' to the
- DCC message, "SRECV", "STRECV" or "TSRECV".[br]
- This subprotocol has an implicit resume capability and thus has no need for RESUME and ACCEPT messages.[br]
+ The [i]Send ahead[/i] extension can be used also in this case and the [i]Turbo[/i] extension is activated by prepending a [b]T[/b] to the
+ DCC message, [i]TRECV[/i] instead of [i]RECV[/i]. The SSL extension is activated by prepending an [b]S[/b] to the
+ DCC message, [i]SRECV", [i]STRECV[/i] or [i]TSRECV[/i].[br]
+ This sub-protocol has an implicit resume capability and thus has no need for RESUME and ACCEPT messages.[br]
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 subprotocol does not specify how this information is obtained, but it
+ 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 subprotocol (keep reading)).[br]
+ or automatically (as in the DCC RSEND sub-protocol (keep reading)).[br]
[br]
[big]DCC RSend[/big][br]
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 "half" subprotocol, since it defines only a part of the DCC negotiation;
- the transfer is defined by another subprotocol (and specifically bu DCC RECV).[br]
+ 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]
The requesting client (the one that sends the file) is active and the receiving client is passive.[br]
Assume that [b]client A[/b] wants to send a file to [b]client B[/b] and that [b]client A[/b] cannot accept incoming connections.[br]
[b]client A[/b] sends a CTCP request to [b]client B[/b] in the following form:[br]
[b]DCC RSEND <filename> <filesize>[/b][br]
[b]client B[/b] receives the request, parses it, eventually asks the user for confirmation, sets up a listening socket, retrieves
- its IP address and port and switches to the DCC RECV subprotocol by effectively sending the following CTCP message:[br]
+ its IP address and port and switches to the DCC RECV sub-protocol by effectively sending the following CTCP message:[br]
[b]DCC RECV <filename> <ipaddress> <port> <resume position>[/b][br]
- The rest of the transfer is defined by the DCC RECV subprotocol.[br]
- The "Turbo" extension is again activated by prepending a 'T' to the RSEND string, so the initial CTCP will become:[br]
+ The rest of the transfer is defined by the DCC RECV sub-protocol.[br]
+ The [i]Turbo[/i] extension is again activated by prepending a [b]T[/b] to the RSEND string, so the initial CTCP will become:[br]
[b]DCC TRSEND <filename> <filesize>[/b][br]
- The "SSL" extension is also activated by prepending an 'S' to the RSEND string. It can be again combined
- with the "turbo" extension. The negotiation parameter becomes then "SRSEND","TSRSEND" or "STRSEND".[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]
- This is again a "half" subprotocol in fact since it defines only a part of the negotiation for file transfers.[br]
+ 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]
(and assume that [b]client A[/b] knows that B has that file and wants to send it).[br]
@@ -1596,23 +1553,23 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c)
[b]DCC GET <filename>[/b][br]
Where <filename> is a name of a file without path.[br]
[b]client B[/b] receives the message, parses it, looks for an association of the <filename> to a real filesystem file
- and starts one of the two DCC file transfer subprotocols, DCC SEND or DCC RSEND.[br]
+ and starts one of the two DCC file transfer sub-protocols, DCC SEND or DCC RSEND.[br]
[b]client B[/b] should prefer the DCC SEND method and choose DCC RSEND only if it is not able to accept incoming connections.[br]
- This subprotocol can be used by firewalled clients that can't accept connections but still want to request a file
+ This sub-protocol can be used by firewalled clients that can't accept connections but still want to request a file
from another client, this one can fail only if both clients are firewalled (in this case no DCC transfer is possible at all).[br]
- This subprotocol also does not need to "magically" know the file size, the size definition
- is found in the subprotocol 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 subprotocol;
- KVIrc uses an internal "file-offer" table with a list of files that are available for download.[br]
- The "turbo" and "SSL" extensions are activated as usual, "TGET", "SGET", "TSGET" and "STGET" are supported.[br]
+ This sub-protocol also does not need to [i]magically[/i] know the file size, the size definition
+ 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]
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 "turbo" extension disables the stream of acknowledges and is activated by prepending the 'T' character to the DCC subprotocol name[br]
- The "SSL" extension causes a Secure Socket Layer to be used and is activated by prepending the 'S' character to the DCC subprotocol name[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]
DCC Voice is a KVIrc extension (there is a Windows client called VIrc that implements such
@@ -1622,11 +1579,11 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c)
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]
- KVIrc supports another "hack" to the DCC negotiation, it recognizes "XDCC" as
+ 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
you to send a /DCC GET since it is an unrecognized DCC type.[br]
- "XDCC" has exactly the same meaning as "DCC" (at least in KVIrc).[br]
+ [i]XDCC[/i] has exactly the same meaning as [i]DCC[/i] (at least in KVIrc).[br]
*/
static DccDescriptor * dcc_kvs_find_dcc_descriptor(const kvs_uint_t &uId,KviKvsModuleRunTimeCall * c,bool bWarn = true)
@@ -1780,8 +1737,8 @@ static bool dcc_kvs_fnc_protocol(KviKvsModuleFunctionCall * c)
<string> $dcc.connectionType(<dcc_id:uint>)
@description:
Returns the connection type of the specified DCC session.[br]
- Returns the string "ACTIVE" for active DCC connections
- and the string "PASSIVE" for passive DCC connections.
+ Returns the string [i]ACTIVE[/i] for active DCC connections
+ and the string [i]PASSIVE[/i] for passive DCC connections.
If <dcc_id> is omitted then the DCC Session associated
with the current window is assumed.[br]
If <dcc_id> is not a valid DCC session identifier (or it is omitted
@@ -1816,8 +1773,8 @@ static bool dcc_kvs_fnc_connectionType(KviKvsModuleFunctionCall * c)
<boolean> $dcc.isFileTransfer
<boolean> $dcc.isFileTransfer(<dcc_id:uint>)
@description:
- Returns 1 if the specified DCC
- is a file transfer and 0 otherwise.[br]
+ Returns [b]1[/b] if the specified DCC
+ is a file transfer and [b]0[/b] otherwise.[br]
If <dcc_id> is omitted then the DCC Session associated
with the current window is assumed.[br]
If <dcc_id> is not a valid DCC session identifier (or it is omitted
@@ -1852,8 +1809,8 @@ static bool dcc_kvs_fnc_isFileTransfer(KviKvsModuleFunctionCall * c)
<boolean> $dcc.isFileUpload
<boolean> $dcc.isFileUpload(<dcc_id:uint>)
@description:
- Returns 1 if the specified DCC
- is an upload file transfer and 0 otherwise.[br]
+ Returns [b]1[/b] if the specified DCC
+ is an upload file transfer and [b]0[/b] otherwise.[br]
If <dcc_id> is omitted then the DCC Session associated
with the current window is assumed.[br]
If <dcc_id> is not a valid DCC session identifier (or it is omitted
@@ -1888,8 +1845,8 @@ static bool dcc_kvs_fnc_isFileUpload(KviKvsModuleFunctionCall * c)
<boolean> $dcc.isFileDownload
<boolean> $dcc.isFileDownload(<dcc_id:uint>)
@description:
- Returns 1 if the specified DCC
- is a download file transfer and 0 otherwise.[br]
+ Returns [b]1[/b] if the specified DCC
+ is a download file transfer and [b]0[/b] otherwise.[br]
If <dcc_id> is omitted then the DCC Session associated
with the current window is assumed.[br]
If <dcc_id> is not a valid DCC session identifier (or it is omitted
@@ -2458,8 +2415,8 @@ static bool dcc_kvs_fnc_ircContext(KviKvsModuleFunctionCall * c)
<string> $dcc.transferStatus(<dcc_id:uint>)
@description:
Returns the status in the specified DCC session.[br]
- The status is one of the strings "connecting", "transferring", "success" and "failure".
- "success" and "failure" are reported when the transfer is terminated.
+ The status is one of the strings [i]connecting", [i]transferring[/i], [i]success[/i] and [i]failure[/i].
+ [i]success[/i] and [i]failure[/i] are reported when the transfer is terminated.
If <dcc_id> is omitted then the DCC session associated
with the current window is assumed.[br]
If <dcc_id> is not a valid DCC session identifier (or it is omitted
@@ -2511,7 +2468,7 @@ static bool dcc_kvs_fnc_transferStatus(KviKvsModuleFunctionCall * c)
and the current window has no associated DCC session) then
this function prints a warning and returns an empty string.[br]
If the DCC session does not refer to a file transfer then
- this function returns 0.[br]
+ this function returns [b]0[/b].[br]
See the [module:dcc]dcc module[/module] documentation for more information.[br]
*/
@@ -2557,7 +2514,7 @@ static bool dcc_kvs_fnc_transferredBytes(KviKvsModuleFunctionCall * c)
and the current window has no associated DCC session) then
this function prints a warning and returns an empty string.[br]
If the DCC session does not refer to a file transfer then
- this function returns 0.[br]
+ this function returns [b]0[/b].[br]
See the [module:dcc]dcc module[/module] documentation for more information.[br]
*/
@@ -2599,7 +2556,7 @@ static bool dcc_kvs_fnc_averageSpeed(KviKvsModuleFunctionCall * c)
Returns the DCC session identifier associated with the DCC window specified
by <window_id>. If <window_id> is omitted then the DCC session identifier
associated with the current window is returned. If the specified window
- has no associated DCC session then a warning is printed and 0 is returned.[br]
+ has no associated DCC session then a warning is printed and [b]0[/b] is returned.[br]
*/
static bool dcc_kvs_fnc_session(KviKvsModuleFunctionCall * c)
@@ -2723,8 +2680,8 @@ static bool dcc_kvs_fnc_sessionList(KviKvsModuleFunctionCall * c)
$dcc.getSSLCertInfo(<query:string>[,<type:string='remote'>[,<dcc_id:integer>[,<param1:string>]]])
@description:
Returns the requested information about certificates used in an SSL enabled DCC session.[br]
- The second <type> parameter can be "local" or "remote", and refers to the certificate you want
- to query the information from; if omitted, it defaults to "remote".[br]
+ The second <type> parameter can be [i]local[/i] or [i]remote[/i], and refers to the certificate you want
+ to query the information from; if omitted, it defaults to [i]remote[/i].[br]
If <dcc_id> is omitted then the DCC Session associated with the current window is assumed.[br]
If <dcc_id> is not a valid DCC session identifier (or it is omitted and the current window
has no associated DCC session) then this function prints a warning and returns an empty string.[br]
@@ -2754,7 +2711,7 @@ static bool dcc_kvs_fnc_sessionList(KviKvsModuleFunctionCall * c)
[li]fingerprintIsValid[/li]
[li]fingerprintDigestId[/li]
[li]fingerprintDigestStr[/li]
- [li]fingerprintContents * accepts parameter interpreted as "digest name"[/li]
+ [li]fingerprintContents * accepts parameter interpreted as [i]digest name[/i][/li]
[/ul]
@examples:
[example]
diff --git a/src/modules/dialog/libkvidialog.cpp b/src/modules/dialog/libkvidialog.cpp
index e3cbb73e5..17a2ef09b 100644
--- a/src/modules/dialog/libkvidialog.cpp
+++ b/src/modules/dialog/libkvidialog.cpp
@@ -162,14 +162,14 @@ void KviKvsCallbackMessageBox::done(int code)
to be the escape button of the dialog.[br]
<magic1>, <magic2>... are the magic parameters - evaluated at dialog.message call time and passed
to the <callback_command> as positional parameters.[br]
- If the -b or -modal switch is specified the dialog will have blocking modal behavior -
+ If the -b or -modal switch is specified the dialog will have blocking modal behaviour -
it will appear above its parent widget and block its input until the dialog is closed.[br]
Once the dialog is displayed, the user will click one of the buttons. At this point the dialog
is hidden and the <callback_command> is executed, passing the number of the button clicked
- as $0 and the magic parameters as positional parameters $1, $2, $3....[br]
+ as $0 and the magic parameters as positional parameters $1, $2, $3.[br]
@examples:
[example]
- [comment]//Just a warning dialog[/comment]
+ [comment]# Just a warning dialog[/comment]
dialog.message("Warning","You're being <b>warned</b>",warning,"OK"){ echo The user clicked OK; }
[comment]# A question[/comment]
dialog.message("And now?","What do you want to do?",information,"Go home","Watch TV","Scream")
@@ -467,7 +467,7 @@ void KviKvsCallbackTextInput::showEvent(QShowEvent *e)
as $0, and the magic parameters as positional parameters $2, $3, $4....[br]
@examples:
[example]
- [comment]//We need a single line reason[/comment]
+ [comment]# We need a single line reason[/comment]
dialog.textinput -d="Working!" (Away,Please enter the away message,"OK","Cancel")
{
switch($0)
diff --git a/src/modules/file/libkvifile.cpp b/src/modules/file/libkvifile.cpp
index d07ac9d15..2ff9022f1 100644
--- a/src/modules/file/libkvifile.cpp
+++ b/src/modules/file/libkvifile.cpp
@@ -86,6 +86,7 @@
@seealso:
[cmd]file.rename[/cmd], [fnc]$file.exists[/fnc]
*/
+
static bool file_kvs_cmd_copy(KviKvsModuleCommandCall * c)
{
QString szSrc,szDst;
@@ -125,6 +126,7 @@ static bool file_kvs_cmd_copy(KviKvsModuleCommandCall * c)
@seealso:
[cmd]file.delimagepath[/cmd]
*/
+
static bool file_kvs_cmd_addimagepath(KviKvsModuleCommandCall * c)
{
QString szDst;
@@ -157,6 +159,7 @@ static bool file_kvs_cmd_addimagepath(KviKvsModuleCommandCall * c)
@seealso:
[cmd]file.addimagepath[/cmd]
*/
+
static bool file_kvs_cmd_delimagepath(KviKvsModuleCommandCall * c)
{
QString szDst;
@@ -192,7 +195,7 @@ static bool file_kvs_cmd_delimagepath(KviKvsModuleCommandCall * c)
Causes the file to be written in the local 8-bit character set instead of the default UTF-8.
@description:
Writes <data> (which is a string of characters) to the file <filename>.[br]
- It does NOT append a trailing LF character: if you want it you must explicitly specify it in the <data> parameter.[br]
+ It does [b]not[/b] append a trailing LF character: if you want it you must explicitly specify it in the <data> parameter.[br]
-a causes the command to append the <data> to the file instead of overwriting the entire file.[br]
The path is adjusted according to the system that KVIrc
is running on so you don't have to bother about portability: it [i]should[/i] be automatically
@@ -204,6 +207,7 @@ static bool file_kvs_cmd_delimagepath(KviKvsModuleCommandCall * c)
@seealso:
[cmd]file.rename[/cmd], [fnc]$file.exists[/fnc]
*/
+
static bool file_kvs_cmd_write(KviKvsModuleCommandCall * c)
{
QString szFileName,szData;
@@ -257,6 +261,7 @@ static bool file_kvs_cmd_write(KviKvsModuleCommandCall * c)
@seealso:
[cmd]file.rename[/cmd], [fnc]$file.exists[/fnc], [fnc]$file.write[/fnc]
*/
+
static bool file_kvs_cmd_writeBytes(KviKvsModuleCommandCall * c)
{
QString szFileName;
@@ -325,6 +330,7 @@ static bool file_kvs_cmd_writeBytes(KviKvsModuleCommandCall * c)
@seealso:
[cmd]file.copy[/cmd], [fnc]$file.exists[/fnc]
*/
+
static bool file_kvs_cmd_rename(KviKvsModuleCommandCall * c)
{
QString szOld,szNew;
@@ -369,6 +375,7 @@ static bool file_kvs_cmd_rename(KviKvsModuleCommandCall * c)
@seealso:
[fnc]$file.exists[/fnc]
*/
+
static bool file_kvs_cmd_mkdir(KviKvsModuleCommandCall * c)
{
QString szDir;
@@ -408,6 +415,7 @@ static bool file_kvs_cmd_mkdir(KviKvsModuleCommandCall * c)
@seealso:
[fnc]$file.exists[/fnc]
*/
+
static bool file_kvs_cmd_remove(KviKvsModuleCommandCall * c)
{
QString szName;
@@ -449,6 +457,7 @@ static bool file_kvs_cmd_remove(KviKvsModuleCommandCall * c)
[fnc]$file.exists[/fnc]
[cmd]file.remove[/cmd]
*/
+
static bool file_kvs_cmd_rmdir(KviKvsModuleCommandCall * c)
{
QString szName;
@@ -485,6 +494,7 @@ static bool file_kvs_cmd_rmdir(KviKvsModuleCommandCall * c)
echo $file.exists(/etc/passwd);
[/example]
*/
+
static bool file_kvs_fnc_exists(KviKvsModuleFunctionCall * c)
{
QString szName;
@@ -508,10 +518,11 @@ static bool file_kvs_fnc_exists(KviKvsModuleFunctionCall * c)
@syntax:
<string> $file.type(<filename:string>)
@description:
- Returns "f" if the <filename> points to a real file, "d" if <filename>
- is the name of a directory or "l" if it is a symbolic link.[br]
+ Returns [b]f[/b] if the <filename> points to a real file, [b]d[/b] if <filename>
+ is the name of a directory or [b]l[/b] if it is a symbolic link.[br]
The <filename> should be an UNIX style file path and is adjusted according to the system that KVIrc is running on.[br]
*/
+
static bool file_kvs_fnc_type(KviKvsModuleFunctionCall * c)
{
QString szName;
@@ -541,9 +552,10 @@ static bool file_kvs_fnc_type(KviKvsModuleFunctionCall * c)
<integer> $file.size(<filename:string>)
@description:
Returns the size of the file pointed by <filename>.[br]
- If the file does not exist, this function returns 0.[br]
+ If the file does not exist, this function returns [b]0[/b].[br]
The <filename> should be an UNIX style file path and is adjusted according to the system that KVIrc is running on.[br]
*/
+
static bool file_kvs_fnc_size(KviKvsModuleFunctionCall * c)
{
QString szName;
@@ -565,11 +577,12 @@ static bool file_kvs_fnc_size(KviKvsModuleFunctionCall * c)
@short:
Returns the size of each file in a specified directory.
@syntax:
- <array> $file.allSize(<dirname:string>)
+ <array> $file.allSize(<dirname:string>)
@description:
- Returns the size of each file in a specified directory as an array.[br]
- This function is not recursive: it won't return the size of files in subdirectories of <dirname>.
+ Returns the size of each file in a specified directory as an array.[br]
+ This function is not recursive: it won't return the size of files in subdirectories of <dirname>.
*/
+
static bool file_kvs_fnc_allSizes(KviKvsModuleFunctionCall * c)
{
QString szDir;
@@ -618,17 +631,18 @@ static bool file_kvs_fnc_allSizes(KviKvsModuleFunctionCall * c)
<string> $file.fixpath(<filename:string>)
@description:
Returns the <filename> adjusted to match the current operating
- system file path conventions.[br] This means that on UNIX, a path like "C:\folder\file.mp3"
- will be returned as "/folder/file.mp3" and vice-versa.[br]
+ system file path conventions.[br] This means that on UNIX, a path like [i]C:\folder\file.mp3[/i]
+ will be returned as [i]/folder/file.mp3[/i] and vice-versa.[br]
There is a minor problem with UNIX paths converted to the windows system: UNIX
- has no "drive" concept thus the UNIX paths do not contain a drive. KVIrc will
- always map the paths to the "default" C: drive.[br]
+ has no [i]drive[/i] concept thus the UNIX paths do not contain a drive. KVIrc will
+ always map the paths to the [i]default[/i] C: drive.[br]
This is a good reason to avoid using absolute hard-coded paths :).[br]
Please note that you [b]don't need[/b] to call this function on paths that you
pass to the other file.* functions: they are adjusted automatically.[br]
@seealso:
[fnc]$file.ps[/fnc]
*/
+
static bool file_kvs_fnc_fixpath(KviKvsModuleFunctionCall * c)
{
QString szName;
@@ -652,10 +666,11 @@ static bool file_kvs_fnc_fixpath(KviKvsModuleFunctionCall * c)
<string> $file.ps()
@description:
Returns the file path separator for the current operating system.[br]
- On windows, '\' is returned, on UNIX, '/'.[br]
+ On windows, [b]\[/b] is returned, on UNIX, [b]/[/b].[br]
@seealso:
[fnc]$file.fixpath[/fnc]
*/
+
static bool file_kvs_fnc_ps(KviKvsModuleFunctionCall * c)
{
c->returnValue()->setString(QString(QChar(KVI_PATH_SEPARATOR_CHAR)));
@@ -676,21 +691,23 @@ static bool file_kvs_fnc_ps(KviKvsModuleFunctionCall * c)
Returns the listing of the specified directory as an array.[br]
The <directory> should be a UNIX style file path and is adjusted according to the system that KVIrc is running on.[br]
<flags> may be a combination of the following characters:[br]
- d: list directories[br]
- f: list files[br]
- l: list symbolic links[br]
- r: list readable files[br]
- w: list writable files[br]
- x: list executable files[br]
- h: list hidden files[br]
- s: list system files[br]
- n: sort files by name[br]
- t: sort files by file time[br]
- b: sort files by file size[br]
- z: put the directories first, then the files[br]
- k: invert sort order[br]
- i: case insensitive sort[br]
- If <flags> is empty then a default of 'dfrwxhs' is set.[br]
+ [pre]
+ [b]d:[/b] list directories[br]
+ [b]f:[/b] list files[br]
+ [b]l:[/b] list symbolic links[br]
+ [b]r:[/b] list readable files[br]
+ [b]w:[/b] list writable files[br]
+ [b]x:[/b] list executable files[br]
+ [b]h:[/b] list hidden files[br]
+ [b]s:[/b] list system files[br]
+ [b]n:[/b] sort files by name[br]
+ [b]t:[/b] sort files by file time[br]
+ [b]b:[/b] sort files by file size[br]
+ [b]z:[/b] put the directories first, then the files[br]
+ [b]k:[/b] invert sort order[br]
+ [b]i:[/b] case insensitive sort[br]
+ [/pre]
+ If <flags> is empty then a default of [b]dfrwxhs[/b] is set.[br]
If none of the r,w,x flags are set then KVIrc sets all of them by default.[br]
If <namefilter> is passed then it is interpreted as a wildcard string
that must match the entries to be returned.[br]
@@ -704,6 +721,7 @@ static bool file_kvs_fnc_ps(KviKvsModuleFunctionCall * c)
[cmd]foreach[/cmd](%f,%dir[])echo %f
[/example]
*/
+
static bool file_kvs_fnc_ls(KviKvsModuleFunctionCall * c)
{
QString szDir,szFlags,szFilter;
@@ -792,8 +810,8 @@ static bool file_kvs_fnc_ls(KviKvsModuleFunctionCall * c)
allocating memory, before attempting to read anything)[br]
An empty string is returned if a serious error occurs.[br]
The <filename> is adjusted according to the system that KVIrc is running on.[br]
- Flags are actually limited to the single letter 'l'. By default the file
- is decoded from the UTF-8 characters set. If 'l' is present the the file
+ Flags are actually limited to the single letter [b]l[/b]. By default the file
+ is decoded from the UTF-8 characters set. If [b]l[/b] is present the the file
is decoded by using the local 8-bit character set instead.
@examples:
[example]
@@ -802,6 +820,7 @@ static bool file_kvs_fnc_ls(KviKvsModuleFunctionCall * c)
@seealso:
[fnc]$file.readBytes[/fnc]
*/
+
static bool file_kvs_fnc_read(KviKvsModuleFunctionCall * c)
{
QString szNameZ;
@@ -884,7 +903,7 @@ static bool file_kvs_fnc_read(KviKvsModuleFunctionCall * c)
WARNING: always check the file size before attempting to read a whole file...
reading a CDROM ISO image may sit down your system :) (and will probably crash while
allocating memory, before attempting to read anything)[br]
- An empty array (or just "nothing") is returned if a serious error occurs.[br]
+ An empty array (or just [i]nothing[/i]) is returned if a serious error occurs.[br]
The <filename> is adjusted according to the system that KVIrc is running on.[br]
@examples:
[example]
@@ -893,6 +912,7 @@ static bool file_kvs_fnc_read(KviKvsModuleFunctionCall * c)
@seealso:
[fnc]$file.read[/fnc], [cmd]file.writeBytes[/cmd]
*/
+
static bool file_kvs_fnc_readBytes(KviKvsModuleFunctionCall * c)
{
QString szNameZ;
@@ -971,14 +991,14 @@ static bool file_kvs_fnc_readBytes(KviKvsModuleFunctionCall * c)
<array> $file.readLines(<filename:string>[,<startline:integer>,[<count:integer>[,<flags:string>]]])
@description:
Reads lines from the specified file and returns them as an array of strings.
- The lines are assumed to be separated by linefeed characters (which are NOT returned).
+ The lines are assumed to be separated by linefeed characters (which are [b]not[/b] returned).
Eventual terminating carriage return and line feed characters at the end of the line are stripped.
If <startline> is specified, then all the lines with indexes lower that <startline> are
discarded. If <count> is specified then at most this number of lines are returned,
otherwise the entire file is returned.
The <filename> is adjusted according to the system that KVIrc is running on.[br]
- Flags are actually limited to the single letter 'l'. By default the file
- is decoded from the UTF-8 character set, however if 'l' is present then the file
+ Flags are actually limited to the single letter [b]l[/b]. By default the file
+ is decoded from the UTF-8 character set, however if [b]l[/b] is present then the file
is decoded by the local 8-bit character set instead.
WARNING: Always check the size of the file you're going to read - it is not
a good idea attempting to read a 700 MiB binary file with this function since
@@ -990,6 +1010,7 @@ static bool file_kvs_fnc_readBytes(KviKvsModuleFunctionCall * c)
@seealso:
[fnc]$file.read[/fnc], [cmd]file.writeLines[/cmd], [fnc]$lf[/fnc]
*/
+
static bool file_kvs_fnc_readLines(KviKvsModuleFunctionCall * c)
{
QString szName;
@@ -1081,7 +1102,7 @@ static bool file_kvs_fnc_readLines(KviKvsModuleFunctionCall * c)
The lines are separated by a carriage-return+line-feed character
combination, compatible with windows text mode files.
This is the only way to make the file readable in windows notepad, for example.
- Please note that this is broken design: do NOT use it :)
+ Please note that this is broken design: do [b]not[/b] use it :)
!sw: -n | --no-separator
Do not separate the lines at all (either the separators are already
inside the lines array or no line separation is desired at all).
@@ -1097,6 +1118,7 @@ static bool file_kvs_fnc_readLines(KviKvsModuleFunctionCall * c)
@seealso:
[fnc]$file.readLines[/fnc]
*/
+
static bool file_kvs_cmd_writeLines(KviKvsModuleCommandCall * c)
{
QString szFile,szFlags;
@@ -1176,6 +1198,7 @@ static bool file_kvs_cmd_writeLines(KviKvsModuleCommandCall * c)
echo panic.png would be translated to $file.localdir(pics/panic.png)
[/example]
*/
+
static bool file_kvs_fnc_localdir(KviKvsModuleFunctionCall * c)
{
QString szName;
@@ -1209,6 +1232,7 @@ static bool file_kvs_fnc_localdir(KviKvsModuleFunctionCall * c)
that KVIrc is actually running on (thus you do not need to care about path
separators in the <relative_path>, KVIrc will adjust them).[br]
*/
+
static bool file_kvs_fnc_homedir(KviKvsModuleFunctionCall * c)
{
QString szName;
@@ -1244,6 +1268,7 @@ static bool file_kvs_fnc_homedir(KviKvsModuleFunctionCall * c)
that KVIrc is actually running on (thus you not need to care about path
separators in the <relative_path>, KVIrc will adjust them).[br]
*/
+
static bool file_kvs_fnc_rootdir(KviKvsModuleFunctionCall * c)
{
QString szName;
@@ -1278,6 +1303,7 @@ static bool file_kvs_fnc_rootdir(KviKvsModuleFunctionCall * c)
that KVIrc is actually running on (thus you do not need to care about path
separators in the <relative_path>, KVIrc will adjust them).[br]
*/
+
static bool file_kvs_fnc_cwd(KviKvsModuleFunctionCall * c)
{
QString szName;
@@ -1321,6 +1347,7 @@ static bool file_kvs_fnc_cwd(KviKvsModuleFunctionCall * c)
echo panic.png would be translated to $file.globaldir(pics/panic.png)
[/example]
*/
+
static bool file_kvs_fnc_globaldir(KviKvsModuleFunctionCall * c)
{
QString szName;
@@ -1349,12 +1376,13 @@ static bool file_kvs_fnc_globaldir(KviKvsModuleFunctionCall * c)
@description:
Returns the path part of the <filepath> translated to match the current
platform filesystem conventions.[br]
- The path will NOT contain a trailing path separator.[br]
+ The path will [b]not[/b] contain a trailing path separator.[br]
For example, if <filepath> is /usr/arch/mp3/Carisma_SuonoDelSilenzio.mp3 then
this function will return /usr/arch/mp3 on UNIX and C:\usr\arch\mp3 on Windows.
@seealso:
[fnc]$file.extractFileName[/fnc]
*/
+
static bool file_kvs_fnc_extractpath(KviKvsModuleFunctionCall * c)
{
QString szName;
@@ -1383,6 +1411,7 @@ static bool file_kvs_fnc_extractpath(KviKvsModuleFunctionCall * c)
@seealso:
[fnc]$file.extractfilename[/fnc]
*/
+
static bool file_kvs_fnc_extractfilename(KviKvsModuleFunctionCall * c)
{
QString szName;
@@ -1406,9 +1435,10 @@ static bool file_kvs_fnc_extractfilename(KviKvsModuleFunctionCall * c)
@syntax:
<hash> $file.diskspace([dirpath:string])
@description:
- Returns as hash, with 'freespace' and 'totalspace' as key, the free diskspace in bytes.[br]
+ Returns as hash, with [b]freespace[/b] and [b]totalspace[/b] as key, the free diskspace in bytes.[br]
Without optional dirpath parameter will be returned the current device's disk space (i.e. the disk on which KVIrc has been started).[br]
*/
+
static bool file_kvs_fnc_diskSpace(KviKvsModuleFunctionCall * c)
{
QString szPath;
@@ -1457,6 +1487,7 @@ static bool file_kvs_fnc_diskSpace(KviKvsModuleFunctionCall * c)
Currently supported: md5 (default), md4, md2, sha1, mdc2, ripemd160 and dss1.
Requires OpenSSL support, but offers a minimal set of hashes in any case.
*/
+
static bool file_kvs_fnc_digest(KviKvsModuleFunctionCall * c)
{
QString szFile,szAlgo,szResult;
@@ -1553,17 +1584,18 @@ static bool file_kvs_fnc_digest(KviKvsModuleFunctionCall * c)
Returns the datetime of a file as the number of milliseconds that have passed since 1970-01-01T00:00:00.000, Coordinated Universal Time (UTC).[br]
The path should be given in UNIX-style and is adjusted according to the system that KVIrc is running on.[br]
The type have to be:[br]
- "a" to retrieve the last time the file was accessed;[br]
- "c" to retrieve the creation time of the file (on most UNIX systems, when the creation time or the last status change time - e.g. changing file permissions - are not available, it will fallback to "m";[br]
- "m" to retrieve the time of the last modification of the file. This is the default.
+ [b]a[/b] to retrieve the last time the file was accessed;[br]
+ [b]c[/b] to retrieve the creation time of the file (on most UNIX systems, when the creation time or the last status change time - e.g. changing file permissions - are not available, it will fallback to "m";[br]
+ [b]m[/b] to retrieve the time of the last modification of the file. This is the default.
@examples:
[example]
- # Windows
+ [comment]# Windows[/comment]
echo $file.time(c:/file.txt);
- # Linux, other UNIX's
+ [comment]# Linux, other UNIX's[/comment]
echo $file.time(/etc/passwd,a);
[/example]
*/
+
static bool file_kvs_fnc_time(KviKvsModuleFunctionCall * c)
{
QString szName, szType;
diff --git a/src/modules/lamerizer/libkvilamerizer.cpp b/src/modules/lamerizer/libkvilamerizer.cpp
index 96ed3cf44..d5f6ffe37 100644
--- a/src/modules/lamerizer/libkvilamerizer.cpp
+++ b/src/modules/lamerizer/libkvilamerizer.cpp
@@ -39,8 +39,8 @@
@title:
The lamerizer module
@body:
- This is an example of what you should NOT do with a text transformation
- engine. Do NOT use it! :D
+ This is an example of what you should [b]not[/b] do with a text transformation
+ engine. Do [b]not[/b] use it! :D
*/
diff --git a/src/modules/language/libkvilanguage.cpp b/src/modules/language/libkvilanguage.cpp
index 6f800d614..cd287ff03 100644
--- a/src/modules/language/libkvilanguage.cpp
+++ b/src/modules/language/libkvilanguage.cpp
@@ -37,7 +37,7 @@
@title:
$language.detect
@short:
- (Tries to) detect the language and encoding of a string
+ Tries to detect the language and encoding of a string
@syntax:
<hash> language.detect(<text: string>)
@description:
@@ -45,18 +45,18 @@
as [text]. The accuracy of the detection mainly depends on the length
of the supplied text. Good results can be achieved with some thousands
characters.[br]
- This command is exported by the "language" module.
+ This command is exported by the [i]language[/i] module.
@examples:
[example]
- %dati = $language.detect("I'm a lord and I speak perfect English.");
- if(%dati{"error"} != "")echo "Language detection failed: " %dati{"error"};
- %count = %dati{"matchcount"};
- for(%i=0;%i<%count;%i++)
- {
- echo "LANGUAGE " %i " : " %dati{"matches"}[%i]{"language"};
- echo "ENCODING " %i " : " %dati{"matches"}[%i]{"encoding"};
- echo "SCORE " %i " : "%dati{"matches"}[%i]{"score"};
- }
+ %dati = $language.detect("I'm a lord and I speak perfect English.");
+ if(%dati{"error"} != "")echo "Language detection failed: " %dati{"error"};
+ %count = %dati{"matchcount"};
+ for(%i=0;%i<%count;%i++)
+ {
+ echo "LANGUAGE " %i " : " %dati{"matches"}[%i]{"language"};
+ echo "ENCODING " %i " : " %dati{"matches"}[%i]{"encoding"};
+ echo "SCORE " %i " : "%dati{"matches"}[%i]{"score"};
+ }
echo "ACCURACY: " %dati{"accuracy"};
[/example]
*/
diff --git a/src/modules/links/libkvilinks.cpp b/src/modules/links/libkvilinks.cpp
index 8b2a586db..523f40470 100644
--- a/src/modules/links/libkvilinks.cpp
+++ b/src/modules/links/libkvilinks.cpp
@@ -47,14 +47,14 @@ KviPointerList<LinksWindow> * g_pLinksWindowList = 0;
@description:
Opens a links window attached to the current IRC context.[br]
The links window handles the RPL_LINKS server replies and shows
- them in a Tree-View form: this is useful in visualizing the
+ them in a [b]tree-view[/b] form: this is useful in visualizing the
current network connections.[br]
Please note that the total number of links received (and the
total count of servers displayed when all the links have been received)
may actually be less than the real number of IRC servers in the network.
Servers that contain a wildcard in their name often act as gateways (hubs)
- for a "local IRC network"; if you're requesting links from a server that is
- external to the gateway, the servers internal to the network "behind the gateway"
+ for a [i]local IRC network[/i]; if you're requesting links from a server that is
+ external to the gateway, the servers internal to the network [i]behind the gateway[/i]
will not be shown; in the extreme case you will see the gateway as leaf node (and it isn't).
To see the internal network server tree you might request links from the gateway server.[br]
*/
diff --git a/src/modules/log/libkvilog.cpp b/src/modules/log/libkvilog.cpp
index 6b8448e4b..15748b1bd 100644
--- a/src/modules/log/libkvilog.cpp
+++ b/src/modules/log/libkvilog.cpp
@@ -185,7 +185,7 @@ static bool log_kvs_cmd_stop(KviKvsModuleCommandCall * c)
If logging is not enabled in the specified window, this command does nothing.[br]
If this command is never used, the log file is flushed at regular file-size intervals,
depending on the underlying I/O subsystem. This is usually 4KiB.[br]
- The "block flushing" is used to achieve a fast I/O on files, but may cause
+ The [i]block flushing[/i] is used to achieve a fast I/O on files, but may cause
the last data block to be lost in case of a program crash.[br]
@seealso:
[fnc]$window[/fnc],
diff --git a/src/modules/mask/libkvimask.cpp b/src/modules/mask/libkvimask.cpp
index d5d856821..04e9d24b6 100644
--- a/src/modules/mask/libkvimask.cpp
+++ b/src/modules/mask/libkvimask.cpp
@@ -38,11 +38,11 @@
@syntax:
<boolean> $mask.match(<wildcard_mask:string>,<fixed_mask:string>)
@description:
- Returns 1 if the <wildcard_mask> matches <fixed_mask> and 0 otherwise.
- <wildcard_mask> can obviously contain wildcards ('*' and '?').
+ Returns [b]1[/b] if the <wildcard_mask> matches <fixed_mask> and [b]0[/b] otherwise.
+ <wildcard_mask> can obviously contain wildcards ([b]*[/b] and [b]?[/b]).
@example:
[example]
- [cmd]if[/cmd]($mask.match(*!*@*.linux.it,$0))
+ [cmd]if[/cmd]($mask.match(*!*@*.linux.it,$0))
[cmd]op[/cmd] [fnc]$mask.nick[/fnc]($0)
[/example]
*/
@@ -148,7 +148,7 @@ static bool mask_kvs_fnc_host(KviKvsModuleFunctionCall * c)
@syntax:
<boolean> $mask.hasNumericHost(<mask: string>)
@description:
- Returns 1 if the hostname part of the mask is numeric (e.g. unresolved IPv4 or IPv6 address).
+ Returns [b]1[/b] if the hostname part of the mask is numeric (e.g. unresolved IPv4 or IPv6 address).
*/
diff --git a/src/modules/mediaplayer/libkvimediaplayer.cpp b/src/modules/mediaplayer/libkvimediaplayer.cpp
index eff100c60..53ac614c1 100644
--- a/src/modules/mediaplayer/libkvimediaplayer.cpp
+++ b/src/modules/mediaplayer/libkvimediaplayer.cpp
@@ -545,10 +545,10 @@ MP_KVS_FUNCTION(playerList)
selected media player interface. MRL is a standard Media Resource Locator.
Examples of such locators are:
[example]
- file:///home/myfile.mp3
- http://streaming.server.top:123
- dvd:///dev/dvd
- dvb://channelname
+ file:///home/myfile.mp3
+ http://streaming.server.top:123
+ dvd:///dev/dvd
+ dvb://channelname
[/example]
Take a look at the [module:mediaplayer]mediaplayer module documentation[/module]
for more details about how it works.[br]
@@ -605,7 +605,6 @@ MP_KVS_COMMAND(amipExec)
return true;
}
-
/*
@doc: mediaplayer.jumpTo
@type:
@@ -732,7 +731,6 @@ MP_KVS_SIMPLE_INT_FUNCTION(getVol,getVol)
MP_KVS_SIMPLE_COMMAND(mute,mute)
-
/*
@doc: mediaplayer.mrl
@type:
@@ -748,13 +746,13 @@ MP_KVS_SIMPLE_COMMAND(mute,mute)
The MRL is a standard Media Resource Locator.
Examples of such locators are:
[example]
- file:///home/myfile.mp3
- http://streaming.server.top:123
- dvd:///dev/dvd
- dvb://channelname
+ file:///home/myfile.mp3
+ http://streaming.server.top:123
+ dvd:///dev/dvd
+ dvb://channelname
[/example]
This means that the returned string may [b]not[/b] refer to a local file:
- it refers to the local file only if the 'file://' prefix is found ([fnc]$mediaplayer.localFile()[/fnc]
+ it refers to the local file only if the [b]file://[/b] prefix is found ([fnc]$mediaplayer.localFile()[/fnc]
checks that for you).
The returned string is empty if the player isn't currently playing.[br]
Take a look at the [module:mediaplayer]mediaplayer module documentation[/module]
@@ -774,7 +772,7 @@ MP_KVS_SIMPLE_STRING_FUNCTION(mrl,mrl)
@title:
$mediaplayer.nowPlaying
@short:
- Returns a descripting of the currently played media
+ Returns a description of the currently played media
@syntax:
$mediaplayer.nowPlaying()
@description:
@@ -1044,7 +1042,6 @@ MP_KVS_SIMPLE_STRING_FUNCTION(mediaType,mediaType)
MP_KVS_SIMPLE_INT_FUNCTION(bitRate,bitRate)
-
/*
@doc: mediaplayer.sampleRate
@type:
@@ -1059,7 +1056,7 @@ MP_KVS_SIMPLE_INT_FUNCTION(bitRate,bitRate)
Returns the sample rate (in Hz) of the multimedia file being played by the
remote instance of the media player.This function is not granted
to work with all the player interfaces and all the media types so
- you may get -1 or 0 in return sometimes.[br]
+ you may get [b]-1[/b] or [b]0[/b] in return sometimes.[br]
Take a look at the [module:mediaplayer]mediaplayer module documentation[/module]
for more details about how it works.[br]
@seealso:
@@ -1074,7 +1071,6 @@ MP_KVS_SIMPLE_INT_FUNCTION(bitRate,bitRate)
MP_KVS_SIMPLE_INT_FUNCTION(sampleRate,sampleRate)
-
/*
@doc: mediaplayer.length
@type:
@@ -1156,7 +1152,6 @@ MP_KVS_SIMPLE_INT_FUNCTION(position,position)
MP_KVS_SIMPLE_INT_FUNCTION(channels,channels)
-
/*
@doc: mediaplayer.setPlayListPos
@type:
@@ -1239,7 +1234,6 @@ MP_KVS_SIMPLE_INT_FUNCTION(getPlayListPos,getPlayListPos)
MP_KVS_SIMPLE_INT_FUNCTION(getListLength,getListLength)
-
/*
@doc: mediaplayer.getRepeat
@type:
@@ -1247,11 +1241,11 @@ MP_KVS_SIMPLE_INT_FUNCTION(getListLength,getListLength)
@title:
$mediaplayer.getRepeat
@short:
- Return if "Repeat" is on.
+ Return if [i]Repeat[/i] is on.
@syntax:
$mediaplayer.getRepeat()
@description:
- Return the value of the Repeat flag for the current track (1 for ON, 0 for OFF).[br]
+ Return the value of the Repeat flag for the current track ([b]1[/b] for [b]ON[/b], [b]0[/b] for [b]OFF[/b]).[br]
Take a look at the [module:mediaplayer]mediaplayer module documentation[/module]
for more details about how it works.[br]
@seealso:
@@ -1262,7 +1256,6 @@ MP_KVS_SIMPLE_INT_FUNCTION(getListLength,getListLength)
MP_KVS_SIMPLE_INT_FUNCTION(getRepeat,getRepeat)
-
/*
@doc: mediaplayer.getShuffle
@type:
@@ -1270,11 +1263,11 @@ MP_KVS_SIMPLE_INT_FUNCTION(getRepeat,getRepeat)
@title:
$mediaplayer.getShuffle
@short:
- Return if "shuffle" is on.
+ Return if [i]shuffle[/i] is on.
@syntax:
$mediaplayer.getShuffle()
@description:
- Return the value of the Shuffle flag (1 for ON, 0 for OFF).[br]
+ Return the value of the Shuffle flag ([b]1[/b] for [b]ON[/b], [b]0[/b] for [b]OFF[/b]).[br]
Take a look at the [module:mediaplayer]mediaplayer module documentation[/module]
for more details about how it works.[br]
@seealso:
@@ -1297,7 +1290,7 @@ MP_KVS_SIMPLE_BOOL_FUNCTION(getShuffle,getShuffle)
$mediaplayer.getEqData(<item:integer>,<options:string>)
@description:
Return the value of the EQ <item>.[br]
- if 'q' is given as an option, it runs in quiet mode.[br]
+ if [b]q[/b] is given as an option, it runs in quiet mode.[br]
Take a look at the [module:mediaplayer]mediaplayer module documentation[/module]
for more details about how it works.[br]
@seealso:
@@ -1450,8 +1443,8 @@ MP_KVS_FUNCTION(amipEval)
@syntax:
$mediaplayer.status()
@description:
- Returns the status if the currently selected media player: "playing",
- "stopped", "paused" or "unknown".
+ Returns the status if the currently selected media player: [b][i]playing[/b][/i],
+ [b][i]stopped[/b][/i], [b][i]paused[/b][/i] or [b][i]unknown[/b][/i].
Take a look at the [module:mediaplayer]mediaplayer module documentation[/module]
for more details about how it works.[br]
@seealso:
@@ -1485,7 +1478,6 @@ MP_KVS_FUNCTION(status)
return true;
}
-
/*
@doc: mediaplayer
@type:
@@ -1505,22 +1497,22 @@ MP_KVS_FUNCTION(status)
(Amarok2, JuK under KDE). You choose the player interface by either setting
the option in the settings dialog, by manually setting [cmd]option[/cmd] stringPreferredMediaPlayer
or by running [cmd]mediaplayer.detect[/cmd] that will guess the media player interface for you.[br]
- If you're going to use the Winamp media player then you must install the "gen_kvirc.dll" plugin
- (included in the KVIrc distribution) as a "general" Winamp plugin.
+ If you're going to use the Winamp media player then you must install the [i]gen_kvirc.dll[/i] plugin
+ (included in the KVIrc distribution) as a [i]general[/i] Winamp plugin.
This is achieved by simply copying the file gen_kvirc.dll
- to the Winamp plugins directory and restarting Winamp.[br]
- [br]
+ to the Winamp plugins directory and restarting Winamp.
+ [br][br]
The commands and functions exported by this module serve mainly for two
purposes: control the playback and get information about the currently played media.
Playback control is achieved by the means of [cmd]mediaplayer.play[/cmd],
[cmd]mediaplayer.stop[/cmd], [cmd]mediaplayer.pause[/cmd], [cmd]mediaplayer.next[/cmd],
[cmd]mediaplayer.prev[/cmd] and [fnc]$mediaplayer.status()[/fnc]. The
information about the currently played media can be retrieved with
- [fnc]$mediaplayer.nowplaying()[/fnc] and [fnc]$mediaplayer.mrl()[/fnc].
+ [fnc]$mediaplayer.nowplaying()[/fnc] and [fnc]$mediaplayer.mrl()[/fnc].[br][br]
Several other informative function are available as well but they are not
granted to work with all the supported media players or media types (e.g.
with Winamp you can play video files that probably have no album, genre
- or sampleRate information...).[br]
+ or sampleRate information).[br][br]
If you intend to write portable code, you should check the return value
of the functions like [fnc]$mediaplayer.artist()[/fnc], [fnc]$mediaplayer.title()[/fnc]
or [fnc]$mediaplayer.channels()[/fnc] and be ready to discard it when it
@@ -1540,7 +1532,7 @@ MP_KVS_FUNCTION(status)
@syntax:
mediaplayer.setRepeat [-q] <repeat:bool>
@description:
- Set the repeat flag to "repeat" (1 for ON, 0 for OFF).[br]
+ Set the repeat flag to [i]repeat[/i] ([b]1[/b] for [b]ON[/b], [b]0[/b] for [b]OFF[/b]).[br]
Take a look at the [module:mediaplayer]mediaplayer module documentation[/module]
for more details about how it works.[br]
@seealso:
@@ -1571,7 +1563,6 @@ MP_KVS_COMMAND(setRepeat)
return true;
}
-
/*
@doc: mediaplayer.setShuffle
@type:
@@ -1583,7 +1574,7 @@ MP_KVS_COMMAND(setRepeat)
@syntax:
mediaplayer.setShuffle [-q] <shuffle:bool>
@description:
- Set the Shuffle flag to "shuffle" (1 for ON, 0 for OFF).[br]
+ Set the Shuffle flag to [i]shuffle[/i] ([b]1[/b] for [b]ON[/b], [b]0[/b] for [b]OFF[/b]).[br]
Take a look at the [module:mediaplayer]mediaplayer module documentation[/module]
for more details about how it works.[br]
@seealso:
diff --git a/src/modules/my/libkvimy.cpp b/src/modules/my/libkvimy.cpp
index 97f0c068f..eae752e08 100644
--- a/src/modules/my/libkvimy.cpp
+++ b/src/modules/my/libkvimy.cpp
@@ -273,11 +273,11 @@ static bool my_kvs_fnc_ip(KviKvsModuleFunctionCall * c)
@title:
$my.serverIsIPV6
@short:
- Returns 1 if the current server connection use IPv6.
+ Returns [b]1[/b] if the current server connection use IPv6.
@syntax:
<boolean> $my.serverIsIPV6([irc_context_id:uint])
@description:
- Returns 1 if the server connection use IPv6.[br]
+ Returns [b]1[/b] if the server connection use IPv6.[br]
If the IRC context is not connected then an empty string is returned.[br]
If <irc_context_id> is specified this function returns acts as it was called
in that irc_context.[br]
@@ -302,11 +302,11 @@ static bool my_kvs_fnc_serverIsIPV6(KviKvsModuleFunctionCall * c)
@title:
$my.serverIsSSL
@short:
- Returns 1 if the current server connection uses SSL
+ Returns [b]1[/b] if the current server connection uses SSL
@syntax:
<boolean> $my.serverIsSSL([irc_context_id:uint])
@description:
- Returns 1 if the server connection uses SSL.[br]
+ Returns [b]1[/b] if the server connection uses SSL.[br]
If the IRC context is not connected then an empty string is returned.[br]
If <irc_context_id> is specified this function returns acts as it was called
in that irc_context.[br]
diff --git a/src/modules/notifier/libkvinotifier.cpp b/src/modules/notifier/libkvinotifier.cpp
index b6c6584e7..49236b55a 100644
--- a/src/modules/notifier/libkvinotifier.cpp
+++ b/src/modules/notifier/libkvinotifier.cpp
@@ -68,7 +68,7 @@ kvi_time_t g_tNotifierDisabledUntil = 0;
any color and/or font specification since the notifier is
skinnable and you don't know which color will result in a visible text.
[b]Please note that the user can forcibly disable the notifier
- for a limited period of time (a sort of "don't bug me" option).[/b]
+ for a limited period of time (a sort of [i]don't bug me[/i] option).[/b]
@switches:
!sw: -n | --noanim
Do not animate
@@ -111,6 +111,7 @@ kvi_time_t g_tNotifierDisabledUntil = 0;
notifier.message -t=10 This message will be shown only for 10 seconds
[/example]
*/
+
static bool notifier_kvs_cmd_message(KviKvsModuleCommandCall * c)
{
QString szMessage;
@@ -177,10 +178,11 @@ static bool notifier_kvs_cmd_message(KviKvsModuleCommandCall * c)
@description:
Hide the notifier window
[b]Please note that the user can forcibly disable the notifier
- for a limited period of time (a sort of "don't bug me" option).[/b]
+ for a limited period of time (a sort of [i]don't bug me[/i] option).[/b]
@seealso:
[cmd]notifier.show[/cmd] [cmd]notifier.message[/cmd] [fnc]$notifier.isEnabled[/fnc]
*/
+
static bool notifier_kvs_cmd_hide(KviKvsModuleCommandCall * c)
{
if(g_pNotifierWindow)
@@ -207,10 +209,11 @@ static bool notifier_kvs_cmd_hide(KviKvsModuleCommandCall * c)
not animated.[br]
The notifier is shown [b]only[/b] if it contains some messages.
[b]Please note that the user can forcibly disable the notifier
- for a limited period of time (a sort of "don't bug me" option).[/b]
+ for a limited period of time (a sort of [i]don't bug me[/i] option).[/b]
@seealso:
[cmd]notifier.hide[/cmd] [cmd]notifier.message[/cmd] [fnc]$notifier.isEnabled[/fnc]
*/
+
static bool notifier_kvs_cmd_show(KviKvsModuleCommandCall * c)
{
if(!g_pNotifierWindow)
@@ -231,22 +234,23 @@ static bool notifier_kvs_cmd_show(KviKvsModuleCommandCall * c)
@title:
$notifier.isEnabled
@short:
- Returns 1 if the notifier window is enabled
+ Returns [b]1[/b] if the notifier window is enabled
@syntax:
<boolean> $notifier.isEnabled
@description:
- Returns 1 if the notifier window is enabled and 0 otherwise.
- The user can forcibly disable the notifier as a sort of "don't bug me"
+ Returns [b]1[/b] if the notifier window is enabled and [b]0[/b] otherwise.
+ The user can forcibly disable the notifier as a sort of [i]don't bug me[/i]
feature for a limited period of time. When the notifier
is disabled the messages sent to it will not be shown.[br]
The only method that you (the scripter) can use to forcibly
re-enable the notifier is to unload the module and
- reload it...but [b]don't do it[/b] :)[br]
+ reload it, but [b]don't do it[/b] :)[br]
There is also a global option that allows forcibly disabling
the notifier forever, this option could be overridden with [cmd]option[/cmd]
- instead.. but again [b]don't do it[/b] :)[br]
+ instead, but again [b]don't do it[/b] :)[br]
*/
+
static bool notifier_kvs_fnc_isEnabled(KviKvsModuleFunctionCall * c)
{
bool bCheck;
diff --git a/src/modules/objects/KvsObject_buttonGroup.cpp b/src/modules/objects/KvsObject_buttonGroup.cpp
index d2be856c0..a7ec6a034 100644
--- a/src/modules/objects/KvsObject_buttonGroup.cpp
+++ b/src/modules/objects/KvsObject_buttonGroup.cpp
@@ -51,7 +51,7 @@
!fn: <id:integer> $addButton(<checkbutton or radiobutton:object>)
Adds the given button to the button group and returns an unique identifier.
!fn: <object> $checkedButton()
- Returns the button group's checked button, or 0 if no buttons are checked.
+ Returns the button group's checked button, or [b]0[/b] if no buttons are checked.
*/
KVSO_BEGIN_REGISTERCLASS(KvsObject_buttonGroup,"buttongroup","object")
diff --git a/src/modules/objects/KvsObject_checkBox.cpp b/src/modules/objects/KvsObject_checkBox.cpp
index 3056ae91f..25c605b1f 100644
--- a/src/modules/objects/KvsObject_checkBox.cpp
+++ b/src/modules/objects/KvsObject_checkBox.cpp
@@ -49,7 +49,7 @@
(unchecked).
@functions:
!fn: <bool> $isChecked()
- Returns '1' if the check box is checked, '0' otherwise.[br]
+ Returns [b]1[/b] if the check box is checked, and [b]0[/b] otherwise.[br]
See also [classfnc]$setChecked[/classfnc]().
!fn: $setChecked([<bChecked:bool>])
Sets the check box 'checked state' to <bool>.
diff --git a/src/modules/objects/KvsObject_colorDialog.cpp b/src/modules/objects/KvsObject_colorDialog.cpp
index 2d37bbadc..97b4bb1ea 100644
--- a/src/modules/objects/KvsObject_colorDialog.cpp
+++ b/src/modules/objects/KvsObject_colorDialog.cpp
@@ -63,7 +63,7 @@ const int option_cod[] = {
(unchecked).
@functions:
!fn: <bool> $isChecked()
- Returns '1' if the check box is checked, '0' otherwise.[br]
+ Returns [b]1[/b] if the check box is checked, and [b]0[/b] otherwise.[br]
See also [classfnc]$setChecked[/classfnc]().
!fn: $setChecked([<bChecked:bool>])
Sets the check box 'checked state' to <bool>.
diff --git a/src/modules/objects/KvsObject_dateTimeEdit.cpp b/src/modules/objects/KvsObject_dateTimeEdit.cpp
index b75fba824..d81692d2e 100644
--- a/src/modules/objects/KvsObject_dateTimeEdit.cpp
+++ b/src/modules/objects/KvsObject_dateTimeEdit.cpp
@@ -49,34 +49,33 @@
@functions:
!fn: $setDate(<text:string>,<format:string>)
Sets the date of the widget using the format <format>. Possible values for format are:
- [br]d the day as number without a leading zero (1 to 31)
- [br]dd the day as number with a leading zero (01 to 31)
- [br]ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). Uses QDate::shortDayName().
- [br]dddd the long localized day name (e.g. 'Monday' to 'Qt::Sunday'). Uses QDate::longDayName().
- [br]M the month as number without a leading zero (1-12)
- [br]MM the month as number with a leading zero (01-12)
- [br]MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). Uses QDate::shortMonthName().
- [br]MMMM the long localized month name (e.g. 'January' to 'December'). Uses QDate::longMonthName().
- [br]yy the year as two digit number (00-99)
- [br]yyyy the year as four digit number
+ [br][b]d[/b]: the day as number without a leading zero (1 to 31)
+ [br][b]dd[/b]: the day as number with a leading zero (01 to 31)
+ [br][b]ddd[/b]: the abbreviated localized day name (e.g. [b]Mon[/b] to [b]Sun/b]). Uses QDate::shortDayName().
+ [br][b]dddd[/b]: the long localized day name (e.g. [b]Monday[/b] to [b]Sunday[/b]). Uses QDate::longDayName().
+ [br][b]M[/b]: the month as number without a leading zero (1-12)
+ [br][b]MM[/b]: the month as number with a leading zero (01-12)
+ [br][b]MMM[/b]: the abbreviated localized month name (e.g. [b]Jan[/b] to [b]Dec[/b]). Uses QDate::shortMonthName().
+ [br][b]MMMM[/b]: the long localized month name (e.g. [b]January[/b] to [b]December[/b]). Uses QDate::longMonthName().
+ [br][b]yy[/b]: the year as two digit number (00-99)
+ [br][b]yyyy[/b]: the year as four digit number
!fn: <string> $date(<format:string>)
Returns the widget date according to format.
!fn: $setTime(<text:string>,<format:string>)
Sets the date of the widget using the format <format>. Possible values for format are:
- [br]h the hour without a leading zero
- [br]hh the hour with a leading zero
- [br]m the minute without a leading zero
- [br]mm the minute with a leading zero
- [br]s the second without a leading zero
- [br]ss the second with a leading zero
- [br]z the milliseconds without leading zeroes
- [br]zzz the milliseconds with leading zeroes
- [br]AP(or ap) use AM/PM display. AP will be replaced by either "AM" or "PM".
+ [br][b]h[/b]: the hour without a leading zero
+ [br][b]hh[/b]: the hour with a leading zero
+ [br][b]m[/b]: the minute without a leading zero
+ [br][b]mm[/b]: the minute with a leading zero
+ [br][b]s[/b]: the second without a leading zero
+ [br][b]ss[/b]: the second with a leading zero
+ [br][b]z[/b]: the milliseconds without leading zeroes
+ [br][b]zzz[/b]: the milliseconds with leading zeroes
+ [br][b]AP / ap[/b]: use AM/PM display. AP will be replaced by either [i]AM[/i] or [i]PM[/i].
!fn: $time(<format:string>)
Returns the widget time according to format.
*/
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_dateTimeEdit,"datetimeedit","widget")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit,date)
diff --git a/src/modules/objects/KvsObject_dockWindow.cpp b/src/modules/objects/KvsObject_dockWindow.cpp
index dcc97379e..02b0545e8 100644
--- a/src/modules/objects/KvsObject_dockWindow.cpp
+++ b/src/modules/objects/KvsObject_dockWindow.cpp
@@ -51,14 +51,14 @@
The widget must be a child of this dock window (otherwise strange things may happen).
!fn: $setAllowedDockAreas(<docks:string>)
Sets the allowed main window dock areas for this dock window.[br]
- <docks> must be a combination of "l","r","t","b","f" and "m".[br]
- "l" stands for left dock area, "r" stands for right dock area, "t" stands for the top dock areas, "b" stands for the bottom dock area, "f" stands for "floating" and "m" for "minimized".[br]
+ <docks> must be a combination of [i]l[/i], [i]r[/i], [i]t[/i], [i]b[/i], [b]f[/b] and [b]m[/b].[br]
+ [b]l[/b] stands for left dock area, [b]r[/b] stands for right dock area, [b]t[/b] stands for the top dock areas, [b]b[/b] stands for the bottom dock area,
+ [b]f[/b] stands for [i]floating[/i] and [b]m[/b] for [i]minimized[/i].[br]
If a flag is present then the related block area is enabled,otherwise it is disabled.
!fn: $dock(<dockarea:string>)
Docks this dock window to the specified dockarea of the main KVIrc window which can be one of "l" (left dock area), "t" (top dock area), "r" (right dock area), "b" (bottom dock area), "f" (floating) and "m" (minimized).
*/
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_dockWindow,"dockwindow","widget")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dockWindow,addWidget)
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dockWindow,setAllowedDockAreas)
diff --git a/src/modules/objects/KvsObject_file.cpp b/src/modules/objects/KvsObject_file.cpp
index ba5c5d6ce..e0542287a 100644
--- a/src/modules/objects/KvsObject_file.cpp
+++ b/src/modules/objects/KvsObject_file.cpp
@@ -75,11 +75,11 @@ const QIODevice::OpenMode mod_cod[] = {
[class]object[/class]
@description:
This object class provides access to files - basic I/O
- operations, copying, removing etc...
+ operations, copying, removing etc.
@functions:
!fn: $setName(<file_name:string>)
Sets the file name to <file_name>. It does [b]not move[/b] the file,
- it just changes the file the object is "pointing to". You can
+ it just changes the file the object is [i]pointing to[/i]. You can
not change names of already open files.[br]
See also: [classfnc]$open[/classfnc](),
[classfnc]$name[/classfnc]().
@@ -87,15 +87,15 @@ const QIODevice::OpenMode mod_cod[] = {
Returns name set by [classfnc]$setName[/classfnc]().[br]
See also: [classfnc]$setName[/classfnc]().
!fn: $open(<mode1:string>, <mode2:string>)
- Attempts to open the file in specified mode or modes "sum".
+ Attempts to open the file in specified mode or modes [i]sum[/i].
Valid modes are:[br]
[pre]
- RAW - RAW, non-buffered access[br]
- ReadOnly - opens the file read-only[br]
- WriteOnly - opens the file write-only[br]
- ReadWrite - opens the file in read-write mode[br]
- Append - opens the file in append mode. The file index is set to the end of the file.[br]
- Truncate - truncates the file[br]
+ RAW - RAW, non-buffered access[br]
+ ReadOnly - opens the file read-only[br]
+ WriteOnly - opens the file write-only[br]
+ ReadWrite - opens the file in read-write mode[br]
+ Append - opens the file in append mode. The file index is set to the end of the file.[br]
+ Truncate - truncates the file[br]
[/pre]
If you call this function without any parameters, the file is
opened in read-only mode.[br]
@@ -116,7 +116,7 @@ const QIODevice::OpenMode mod_cod[] = {
!fn: <integer> $size()
Returns current file size.
!fn: <boolean> $atEnd()
- Returns '1' if you have reached end of the file, '0' otherwise.
+ Returns '1' if you have reached end of the file, [b]0[/b] otherwise.
[br]See also: [classfnc]$seek[/classfnc](),
[classfnc]$where[/classfnc]().
!fn: <integer> $where()
@@ -149,7 +149,6 @@ const QIODevice::OpenMode mod_cod[] = {
$writeBlock()
*/
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_file,"file","object")
KVSO_REGISTER_HANDLER(KvsObject_file,"setName",setName)
KVSO_REGISTER_HANDLER(KvsObject_file,"name",name)
diff --git a/src/modules/objects/KvsObject_groupBox.cpp b/src/modules/objects/KvsObject_groupBox.cpp
index 04e5f31ef..74d9236fe 100644
--- a/src/modules/objects/KvsObject_groupBox.cpp
+++ b/src/modules/objects/KvsObject_groupBox.cpp
@@ -48,7 +48,6 @@ const int align_cod[] = {
#define align_num (sizeof(align_tbl) / sizeof(align_tbl[0]))
-
/*
@doc: groupbox
@keyterms:
@@ -73,13 +72,13 @@ const int align_cod[] = {
!fn: <string> $title()
Returns the groupbox title text.
!fn: $setFlat(<bflag:boolean>)
- Sets whether the group box is painted flat. Valid Values are 1 or 0.
+ Sets whether the group box is painted flat. Valid Values are [b]1[/b] or [b]0[/b].
!fn: <boolean> $isFlat()
- Returns 1 (true) if the groupbox is painted flat; otherwise returns 0 (false).
+ Returns [b]1[/b] (true) if the groupbox is painted flat; otherwise returns [b]0[/b] (false).
!fn: <boolean> $isCheckable()
- Returns 1 (true) if the group box has a checkbox in its title; otherwise returns 0 (false).
+ Returns [b]1[/b] (true) if the group box has a checkbox in its title; otherwise returns [b]0[/b] (false).
!fn: $setCheckable(<bflag:boolean>)
- Sets whether the groupbox has a checkbox in its title: Valid values are 1 or 0.
+ Sets whether the groupbox has a checkbox in its title: Valid values are [b]1[/b] or [b]0[/b].
!fn: $setInsideMargin(<margin:uint>)
Sets the the width of the inside margin to m pixels.
!fn: <integer> $insideMargin()
@@ -98,35 +97,35 @@ const int align_cod[] = {
Sets the groupbox's orientation. Valid values are: Horizontal, Vertical.
@examples:
[example]
- [comment]//First we'll create the main widget. as a dialog[/comment]
+ [comment]# First we'll create the main widget. as a dialog[/comment]
%widget=$new(dialog)
%layout=$new(layout,%widget)
- [comment]//Then the groupbox[/comment]
+ [comment]# Then the groupbox[/comment]
%gb=$new(groupbox,%widget)
%gb->$setTitle(Login)
%gb->$setAlignment("Left")
- [comment]//Add the groupbox to the main layout[/comment]
+ [comment]# Add the groupbox to the main layout[/comment]
%layout->$addWidget(%gb,0,0)
- [comment]//Now we create the user field
+ [comment]# Now we create the user field
(labels + lineedit) in a horizontal box[/comment]
%hbox=$new(hbox,%gb)
%labeluser=$new(label,%hbox)
%labeluser->$settext(User: )
%inputuser=$new(lineedit,%hbox)
- [comment]//Now we create the password field
+ [comment]# Now we create the password field
(labels + lineedit) in a horizontal box[/comment]
%hbox=$new(hbox,%gb)
%labelpass=$new(label,%hbox)
%labelpass->$settext(Pass: )
%inputpass=$new(lineedit,%hbox)
%inputpass->$setechomode("password")
- [comment]//Now we create the OK/Cancel box buttons[/comment]
+ [comment]# Now we create the OK/Cancel box buttons[/comment]
%hbox=$new(hbox,%gb)
%btnok=$new(button,%hbox)
%btnok->$settext("OK")
%btncancel=$new(button,%hbox)
%btncancel->$settext("Cancel")
- [comment]//Let's show our nice form[/comment]
+ [comment]# Let's show our nice form[/comment]
%widget->$show()
[/example]
*/
diff --git a/src/modules/objects/KvsObject_http.cpp b/src/modules/objects/KvsObject_http.cpp
index 3d01509d2..57bb11d74 100644
--- a/src/modules/objects/KvsObject_http.cpp
+++ b/src/modules/objects/KvsObject_http.cpp
@@ -100,7 +100,7 @@
The function returns a unique identifier which is passed by [b]requestStartedEvent()[/b] and [b]requestFinishedEvent()[/b].
When the request is started the requestStarted() signal is emitted. When it is finished the requestFinished() signal is emitted.
!fn: <id:integer>$currentId()
- Returns the identifier of the HTTP request being executed or 0 if there is no request being executed.
+ Returns the identifier of the HTTP request being executed or [b]0[/b] if there is no request being executed.
!fn: <id:integer> $setProxy(<host:string>,<port:integer>,[<user:string>,<password:string>])
Enables HTTP proxy support, using the proxy server host on port port.
Optionals parameters user and password can be provided if the proxy server requires authentication.
diff --git a/src/modules/objects/KvsObject_label.cpp b/src/modules/objects/KvsObject_label.cpp
index 6278a029a..e096604b6 100644
--- a/src/modules/objects/KvsObject_label.cpp
+++ b/src/modules/objects/KvsObject_label.cpp
@@ -88,7 +88,6 @@ const int frame_cod[] = {
#define frame_num (sizeof(frame_tbl) / sizeof(frame_tbl[0]))
-
/*
@doc: label
@keyterms:
@@ -130,14 +129,14 @@ const int frame_cod[] = {
This function sets alignment flags, given as parameters, for
this label. Valid flags are:
[pre]
- Right - Text is aligned to right border[br]
- Left - Text is aligned to left border[br]
- Top - Text is aligned to the top border[br]
- Bottom - Text is aligned to the bottom border[br]
- HCenter - Text is horizontally centered[br]
- VCenter - Text is vertically centered[br]
- Center - Equals HCenter + VCenter[br]
- Justify - Text is spaced apart to cover available room[br]
+ Right - Text is aligned to right border[br]
+ Left - Text is aligned to left border[br]
+ Top - Text is aligned to the top border[br]
+ Bottom - Text is aligned to the bottom border[br]
+ HCenter - Text is horizontally centered[br]
+ VCenter - Text is vertically centered[br]
+ Center - Equals HCenter + VCenter[br]
+ Justify - Text is spaced apart to cover available room[br]
[/pre]
It is obvious that you can not set [i]Right[/i]
and [i]Left[/i] simultaneously - this will [b]not[/b]
@@ -156,22 +155,17 @@ const int frame_cod[] = {
The flags determine the shape or shadow of the
label's frame. Valid shape flags are:[br]
[pre]
- NoFrame - Draw no frame. You shouldn't specify a shadow when
- using this.[br]
- Box - Draws a rectangular box. Its borders can be
- [i]Raised[/i] or [i]Sunken[/i][br]
- Panel - Draws a rectangular panel which can be
- [i]Raised[/i] or [i]Sunken[/i][br]
- WinPanel - Similar to [i]Panel[/i], but is more in Win95 style[br]
- Hline - Draws a horizontal line that frames nothing (useful as separator)
+ NoFrame - Draw no frame. You shouldn't specify a shadow when using this.[br]
+ Box - Draws a rectangular box. Its borders can be [i]Raised[/i] or [i]Sunken[/i][br]
+ Panel - Draws a rectangular panel which can be [i]Raised[/i] or [i]Sunken[/i][br]
+ WinPanel - Similar to [i]Panel[/i], but is more in Win95 style[br]
+ Hline - Draws a horizontal line that frames nothing (useful as separator)
[/pre]
Valid shadow flags are:[br]
[pre]
- Plain - No 3D effect (draws using foreground color)[br]
- Raised - Makes the label look like it was raised above the
- parent widget[br]
- Sunken - Makes the label look like it was [i]pushed[/i] inside
- the parent widget[br]
+ Plain - No 3D effect (draws using foreground color)[br]
+ Raised - Makes the label look like it was raised above the parent widget[br]
+ Sunken - Makes the label look like it was [i]pushed[/i] inside the parent widget[br]
[/pre]
!fn: $setImage(<image_id>)
Sets the image to be displayed on this label.
@@ -181,7 +175,6 @@ const int frame_cod[] = {
*/
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_label,"label","widget")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label,setText)
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label,text)
diff --git a/src/modules/objects/KvsObject_layout.cpp b/src/modules/objects/KvsObject_layout.cpp
index 67ddfa4e3..4953bfba0 100644
--- a/src/modules/objects/KvsObject_layout.cpp
+++ b/src/modules/objects/KvsObject_layout.cpp
@@ -54,6 +54,7 @@ const int align_cod[] = {
Qt::AlignBottom,
};
#define align_num (sizeof(align_tbl) / sizeof(align_tbl[0]))
+
/*
@doc: layout
@keyterms:
@@ -100,13 +101,14 @@ const int align_cod[] = {
!fn: $setResizeMode(<resize_mode:string>)
Sets the resize mode of the parent widget in relation to this layout.
<mode> can be one of:[br]
- -Auto: this is the default[br]
- -Fixed: the parent widget of this layout is resized to the "sizeHint" value and it cannot be resized by the user.[br]
- -Minimum: the minimum size of the parent widget of this layout is set to minimumSize() and it cannot be smaller[br]
- -FreeResize: the parent widget of this layout is not constrained at all[br]
+ [pre]
+ -Auto: this is the default[br]
+ -Fixed: the parent widget of this layout is resized to the "sizeHint" value and it cannot be resized by the user.[br]
+ -Minimum: the minimum size of the parent widget of this layout is set to minimumSize() and it cannot be smaller[br]
+ -FreeResize: the parent widget of this layout is not constrained at all[br]
+ [/pre]
*/
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_layout,"layout","object")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout,addWidget)
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout,addMultiCellWidget)
diff --git a/src/modules/objects/KvsObject_lineEdit.cpp b/src/modules/objects/KvsObject_lineEdit.cpp
index 8a194cef7..f6ccd00c3 100644
--- a/src/modules/objects/KvsObject_lineEdit.cpp
+++ b/src/modules/objects/KvsObject_lineEdit.cpp
@@ -44,7 +44,6 @@ static const int mode_cod[] = {
#define mode_num (sizeof(mode_tbl) / sizeof(mode_tbl[0]))
-
/*
@doc: lineedit
@keyterms:
@@ -72,9 +71,11 @@ static const int mode_cod[] = {
See also [classfnc]$text[/classfnc]().
!fn: $setEchoMode(<echo_mode:string>)
Sets the line edit's echo mode. Possible value are:[br]
- -Normal: display chars as they entered[br]
- -Noecho: do not display anything[br]
- -Password: display asterisks instead of the characters actually entered[br]
+ [pre]
+ -Normal: display chars as they entered[br]
+ -Noecho: do not display anything[br]
+ -Password: display asterisks instead of the characters actually entered[br]
+ [/pre]
See also [classfnc]$echoMode[/classfnc]().
!fn: <string> $echoMode()
Return the line edit's echo mode.
@@ -134,29 +135,29 @@ static const int mode_cod[] = {
Sets the validation input mask to inputMask.[br]
[b]Example:[/b][br]
[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;#" );
+ %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]
[example]
- [b][comment]Character Meaning[/comment][/b][br]
- A - ASCII alphabetic character required. A-Z, a-z.[br]
- a - ASCII alphabetic character permitted but not required.[br]
- N - ASCII alphanumeric character required. A-Z, a-z, 0-9.[br]
- n - ASCII alphanumeric character permitted but not required.[br]
- X - Any character required.[br]
- x - Any character permitted but not required.[br]
- 9 - ASCII digit required. 0-9.[br]
- 0 - ASCII digit permitted but not required.[br]
- D - ASCII digit required. 1-9.[br]
- d - ASCII digit permitted but not required.[br]
- # - ASCII digit or plus/minus sign permitted but not required.[br]
- > - All following alphabetic characters are uppercased.[br]
- < - All following alphabetic characters are lowercased.[br]
- ! - Switch off case conversion.[br]
- \ - Use \ to escape the special characters listed above to use them as separators.
+ [b][comment]Character Meaning[/comment][/b][br]
+ A - ASCII alphabetic character required. A-Z, a-z.[br]
+ a - ASCII alphabetic character permitted but not required.[br]
+ N - ASCII alphanumeric character required. A-Z, a-z, 0-9.[br]
+ n - ASCII alphanumeric character permitted but not required.[br]
+ X - Any character required.[br]
+ x - Any character permitted but not required.[br]
+ 9 - ASCII digit required. 0-9.[br]
+ 0 - ASCII digit permitted but not required.[br]
+ D - ASCII digit required. 1-9.[br]
+ d - ASCII digit permitted but not required.[br]
+ # - ASCII digit or plus/minus sign permitted but not required.[br]
+ > - All following alphabetic characters are uppercased.[br]
+ < - All following alphabetic characters are lowercased.[br]
+ ! - Switch off case conversion.[br]
+ \ - Use \ to escape the special characters listed above to use them as separators.
[/example]
The mask consists of a string of mask characters and separators, optionally[br]
followed by a semi-colon and the character used for blanks: the blank characters[br]
@@ -188,8 +189,6 @@ static const int mode_cod[] = {
This signal is emitted by the default implementation of [classfnc]$textChangedEvent[/classfnc]().
*/
-
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_lineEdit,"lineedit","widget")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,text)
diff --git a/src/modules/objects/KvsObject_listWidget.cpp b/src/modules/objects/KvsObject_listWidget.cpp
index 7b846df13..59c860509 100644
--- a/src/modules/objects/KvsObject_listWidget.cpp
+++ b/src/modules/objects/KvsObject_listWidget.cpp
@@ -69,14 +69,14 @@ const char * const itemflags_tbl[] = {
@description:
The listbox class is a widget displaying a list of string items.[br]
The listbox can operate in four selection modes: single, multi, extended
- and none. In the "single" mode only one item can be selected at a time
- and that item is also the current one. In the "multi" mode multiple
+ and none. In the [i]single[/i] mode only one item can be selected at a time
+ and that item is also the current one. In the [i]multi[/i] mode multiple
items can be selected and unselected and the current item may or may not
- be one of the selected items. In the "extended" mode multiple items
+ be one of the selected items. In the [i]extended[/i] mode multiple items
can be selected but they must be selected in a single mouse action
or by keeping the shift button pressed while clicking on the item.
In this mode the current item is always one of the selected items.[br]
- In the "none" mode no items can be selected and the current item
+ In the [i]none[/i] mode no items can be selected and the current item
may be any item in the list.[br]
In most situations you will operate the listwidget in [i]single[/i] mode
(and this is the default mode set at widget creation).
@@ -84,23 +84,23 @@ const char * const itemflags_tbl[] = {
!fn: $setSelectionMode(<selection_mode:string>)
Sets the current selection mode specified by the parameter <mode>
that can be one of the following string:[br]
- "single" : only one item can be selected at a time[br]
- "multi" : multiple items can be selected at a time[br]
- "extended" : multiple items can be selected but only in a single mouse interaction[br]
- "none" : no items can be selected[br]
- The default mode is "single"
+ [b]single[/b]: only one item can be selected at a time[br]
+ [b]multi[/b]: multiple items can be selected at a time[br]
+ [b]extended[/b]: multiple items can be selected but only in a single mouse interaction[br]
+ [b]none[/b]: no items can be selected[br]
+ The default mode is [i]"single"
!fn: $setFlag(<idx:integer>,<flag1:string>, <flag2:string>, ...)
Sets the flags for the item at index idx to the given flags. These determine whether the item can be selected or modified. This is often used to disable an item.[br]
Supported flags are:
[example]
- [br]- noitemflag : no flag sets;
- [br]- selectable : item is selectable;
- [br]- editable : item is editable;
- [br]- dragEnabled : item can dragged;
- [br]- dropEnabled : item can used as drop target;
- [br]- userCheckable : item is checkable;
- [br]- enabled :item is enabled;
- [br]- tristate : item is checkable with three separate states.
+ - noitemflag : no flag sets;[br]
+ - selectable : item is selectable;[br]
+ - editable : item is editable;[br]
+ - dragEnabled : item can dragged;[br]
+ - dropEnabled : item can used as drop target;[br]
+ - userCheckable : item is checkable;[br]
+ - enabled :item is enabled;[br]
+ - tristate : item is checkable with three separate states.
[/example]
!fn: $setChecked(<checkstate:bool>)
Sets the eventual item check box 'checked state' to <bool>.
@@ -153,8 +153,7 @@ const char * const itemflags_tbl[] = {
This signal is emitted by the default implementation of [classfnc]$itemEnteredEvent[/classfnc]().[br]
!sg: <string> $selectionChanged()
This signal is emitted by the default implementation of [classfnc]$selectionChangedEvent[/classfnc]().[br]
- */
-
+*/
KVSO_BEGIN_REGISTERCLASS(KvsObject_listWidget,"listbox","widget")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,insertItem)
diff --git a/src/modules/objects/KvsObject_multiLineEdit.cpp b/src/modules/objects/KvsObject_multiLineEdit.cpp
index c6a77fff6..9bef80f03 100644
--- a/src/modules/objects/KvsObject_multiLineEdit.cpp
+++ b/src/modules/objects/KvsObject_multiLineEdit.cpp
@@ -64,22 +64,22 @@
Sets the editor to be read-only if bReadOnly is 1 or
removes the read-only status if bReadOnly is 0
!fn: <boolean> $atBeginning()
- Returns 1 (true) if the cursor is placed at the beginning of the text; otherwise returns 0 (false).
+ Returns [b]1[/b] (true) if the cursor is placed at the beginning of the text; otherwise returns [b]0[/b] (false).
!fn: <boolean> $atEnd()
- Returns 1 (true) if the cursor is placed at the end of the text; otherwise returns 0 (false).
+ 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]
[example]
- - NoWrap - Do not wrap the text.[br]
- - WidgetWidth - Wrap the text at the current width of the widget.[br]
- - FixedPixelWidth - Wrap the text at a fixed number of pixels from the widget's left side.[br]
- - FixedColumnWidth - Wrap the text at a fixed number of character columns from the widget's left side.
+ - NoWrap - Do not wrap the text.[br]
+ - WidgetWidth - Wrap the text at the current width of the widget.[br]
+ - FixedPixelWidth - Wrap the text at a fixed number of pixels from the widget's left side.[br]
+ - FixedColumnWidth - Wrap the text at a fixed number of character columns from the widget's left side.
[/example]
!fn: <string> $wordWrap()
Returns the word wrap mode. NoWrap, WidgetWidth, FixedPixelWidth, FixedColumnWidth.
!fn: <string> $text()
- Returns the multiline edit's text.
+ Returns the multiline edits text.
!fn: <integer> $length()
Returns the number of characters in the text This function ignores newlines.
!fn: $setMaxLines(<mac_lines:integer>)
@@ -99,17 +99,17 @@
!fn: $setFamily(<font_family:string>)
Sets the font family of the current format to fontFamily.
!fn: $setItalic(<bItalic:boolean>)
- If the bool value is 1 sets the current format to italic; otherwise, if it's 0 sets the current format to no-italic.
+ If the bool value is [b]1[/b] sets the current format to italic; otherwise, if it's [b]0[/b] sets the current format to no-italic.
!fn: $setBold(<bBold:boolean>)
- If the bool value is 1 sets the current format to bold; otherwise, if it's 0 sets the current format to no-bold.
+ If the bool value is [b]1[/b] sets the current format to bold; otherwise, if it's [b]0[/b] sets the current format to no-bold.
!fn: $setUnderline(<bUnderline:boolean>)
- If the bool value is 1 sets the current format to underline; otherwise, if it's 0 sets the current format to no-underline.
+ If the bool value is [b]1[/b] sets the current format to underline; otherwise, if it's [b]0[/b] sets the current format to no-underline.
!fn: <boolean> $italic()
- Returns 1 (true) if the current format is italic; otherwise returns 0 (false).
+ Returns [b]1[/b] (true) if the current format is italic; otherwise returns [b]0[/b] (false).
!fn: <boolean> $bold()
- Returns 1 (true) if the current format is bold; otherwise returns 0 (false).
+ Returns [b]1[/b] (true) if the current format is bold; otherwise returns [b]0[/b] (false).
!fn: <boolean> $underline()
- Returns 1 (true) if the current format is underline; otherwise returns 0 (false).
+ Returns [b]1[/b] (true) if the current format is underline; otherwise returns [b]0[/b] (false).
!fn: $zoomIn(<zoom_range:integer>)
Zooms in on the text by making the base font size range points larger.
!fn: $zoomOut(<zoom_range:integer>)
@@ -123,7 +123,7 @@
!fn: $setUndoRedoEnabled(<bUndoRedo:boolean>)
Sets whether undo/redo is enabled to the bool value.
!fn: <boolean> $isUndoRedoEnabled()
- Returns 1 (true) if undo/redo is enabled; otherwise returns 0 (false).
+ Returns [b]1[/b] (true) if undo/redo is enabled; otherwise returns [b]0[/b] (false).
!fn: <integer> $undoDepth()
Returns the depth of the undo history.
!fn: $setText(<txt:string>)
@@ -142,7 +142,7 @@
!fn: $setPointSize(<point_size:integer))
Sets the point size of the font.
!fn: $setLinkUnderline(<bLinkUnderline:boolean>)
- Sets to 1 if you want that hypertext links will be underlined; otherwise sets to 0.
+ Sets to [b]1[/b] if you want that hypertext links will be underlined; otherwise sets to [b]0[/b].
!fn: $setTextFormat(<textformat:string>)
Sets the text format. Correct values are RichText, PlainText.
!fn: <string> $textFormat()
@@ -150,27 +150,27 @@
!fn: $loadFile(<path:string>)
Load the file specified in the <path>, also HTML files.
!fn: <boolean> $isUndoAvailable ()
- Returns 1 (true) if undo is available; otherwise returns 0 (false).
+ Returns [b]1 (true)[/b] if undo is available; otherwise returns [b]0 (false)[/b].
!fn: <boolean> $isRedoAvailable ()
- Returns 1 (true) if redo is available; otherwise returns 0 (false).
+ Returns [b]1 (true)[/b] if redo is available; otherwise returns [b]0 (false)[/b].
!fn: <integer> $lines()
Returns the number of lines in the multilineedit.
!fn: <integer> $lineOfChar(<paragraph:integer>,<index:integer>)
Returns the line number of the line in paragraph par in which the character at position index appears.[br]
- If there is no such paragraph or no such character at the index position -1 is returned.
+ If there is no such paragraph or no such character at the index position [b]-1[/b] is returned.
!fn: $setModified(<bModified:boolean>)
- Sets whether the document has been modified by the user. Valid Values are 1 (true) or 0 (false)
+ Sets whether the document has been modified by the user. Valid Values are [b]1 (true)[/b] or [b]0 (false)[/b].
!fn: $setAlignment(<alignment:string>)
- Sets the alignment of the current paragraph to <alignment>.
- Valid values are:
+ Sets the alignment of the current paragraph to <alignment>.[br]
+ Valid values are:
[example]
- - Auto - Aligns according to the language.[br]
- - Left - Aligns with the left edge.[br]
- - Right - Aligns with the right edge.[br]
- - Center - Centers in both dimensions.
- - Justify - Justify the text.
+ - Auto - Aligns according to the language.[br]
+ - Left - Aligns with the left edge.[br]
+ - Right - Aligns with the right edge.[br]
+ - Center - Centers in both dimensions.
+ - Justify - Justify the text.
[/example]
- */
+*/
KVSO_BEGIN_REGISTERCLASS(KvsObject_textedit,"multilineedit","widget")
diff --git a/src/modules/objects/KvsObject_painter.cpp b/src/modules/objects/KvsObject_painter.cpp
index 183e5e276..2d64ea223 100644
--- a/src/modules/objects/KvsObject_painter.cpp
+++ b/src/modules/objects/KvsObject_painter.cpp
@@ -201,7 +201,6 @@ const char * const brushstyles_tbl[] = {
#define brushstyles_num (sizeof(brushstyles_tbl) / sizeof(brushstyles_tbl[0]))
-
/*
@doc: painter
@keyterms:
@@ -238,10 +237,10 @@ const char * const brushstyles_tbl[] = {
All parameters are in integer form.
The HSV system, like RGB, has three components:[br]
[pre]
- * H, for hue, is either 0-359 if the color is chromatic (not gray), or meaningless if it is gray.[br]
- It represents degrees on the color wheel familiar to most people. Red is 0 (degrees), green is 120 and blue is 240.[br]
- * S, for saturation, is 0-255, and the bigger it is, the stronger the color is. Grayish colors have saturation near 0; very strong colors have saturation near 255.[br]
- * V, for value, is 0-255 and represents lightness or brightness of the color. 0 is black; 255 is as far from black as possible.[br]
+ * H, for hue, is either 0-359 if the color is chromatic (not gray), or meaningless if it is gray.[br]
+ It represents degrees on the color wheel familiar to most people. Red is 0 (degrees), green is 120 and blue is 240.[br]
+ * S, for saturation, is 0-255, and the bigger it is, the stronger the color is. Grayish colors have saturation near 0; very strong colors have saturation near 255.[br]
+ * V, for value, is 0-255 and represents lightness or brightness of the color. 0 is black; 255 is as far from black as possible.[br]
[/pre]
Examples: [b]Red[/b] is H=0, S=255, V=255.[br]
Light red could have H about 0, S about 50-100, and S=255.
@@ -251,19 +250,19 @@ const char * const brushstyles_tbl[] = {
Sets the painter's brush to have the specified color.[br]
Example:
[example]
- class (wdg,widget)[br]
- {[br]
- paintevent()[br]
- {[br]
- %b=$new(painter)[br]
- %b->$setBackgroundMode(Opaque)[br]
- %b->$setBrush(0,250,250)[br]
- %b->$begin($$)[br]
- %b->$drawEllipse(50,50,100,50)[br]
- }[br]
- }[br]
- %aa=$new(wdg)[br]
- %aa->$show()
+ class (wdg,widget)
+ {
+ paintevent()
+ {
+ %b=$new(painter)
+ %b->$setBackgroundMode(Opaque)
+ %b->$setBrush(0,250,250)
+ %b->$begin($$)
+ %b->$drawEllipse(50,50,100,50)
+ }
+ }
+ %aa=$new(wdg)[br]
+ %aa->$show()
[/example]
!fn: $drawRect(<x:integer>,<y:integer>,<w:unsigned integer>,<h:unsigned integer>)
Draws a rectangle with upper left corner at (x, y) and with width w and height h.
@@ -287,30 +286,30 @@ const char * const brushstyles_tbl[] = {
Draws the given <text> within the rectangle specified by <x>,<y> <width> and <height>.[br]
The <flag> parameters may be:[br]
[pre]
- Left[br]
- Top[br]
- Right[br]
- Bottom[br]
- HCenter[br]
- VCenter[br]
- Center[br]
- TextSingleLine[br]
- TextExpandTabs[br]
- TextShowMnemonic[br]
- TextWordWrap[br]
- TextIncludeTrailingSpaces[br]
+ Left[br]
+ Top[br]
+ Right[br]
+ Bottom[br]
+ HCenter[br]
+ VCenter[br]
+ Center[br]
+ TextSingleLine[br]
+ TextExpandTabs[br]
+ TextShowMnemonic[br]
+ TextWordWrap[br]
+ TextIncludeTrailingSpaces
[/pre]
!fn: $drawPixmap(<x:integer>,<y:integer>,<pixmap:hobject>,<sx:integer>,<sy:integer>,<ex:integer>,<ey:integer>)
Draws a pixmap at x,y coordinates[br]
!fn: $setFont(<family:string>,<size:integer>[,<style:enum>,<style:enum>,..])[br]
Set the font's family, size and style, valid flag for style are:[br]
[pre]
- italic[br]
- bold [br]
- underline [br]
- overline [br]
- strikeout [br]
- fixedpitch [br]
+ italic[br]
+ bold [br]
+ underline [br]
+ overline [br]
+ strikeout [br]
+ fixedpitch [br]
[/pre]
!fn: $setFontSize(<size:unsigned integer>)[br]
Set the current painter font's size.[br]
@@ -336,8 +335,8 @@ const char * const brushstyles_tbl[] = {
Sets the background mode of the painter to <bgMode>:
Valid values are:[br]
[pre]
- - Transparent (that is the default value);[br]
- - Opaque.
+ - Transparent (that is the default value);[br]
+ - Opaque.
[/pre]
!fn: $setOpacity(<opacity_factor:real>)
Sets the painter opacity that affects all painter operations (drawpixmap, drawtext...). Valid values range are from 0 (total transparency) to 1 (total opacity)[br]
@@ -350,179 +349,175 @@ const char * const brushstyles_tbl[] = {
You must call the [classfnc]$begin[/classfnc] before using it.
!fn: $setSmoothPixmapTransform(<boolean>)
Enable/disable smooth bilinear pixmap transformation algorithm (such as bilinear).
- You must call the [classfnc]$begin[/classfnc] before using it.
+ You must call the [classfnc]$begin[/classfnc] before using it.[br]
Example:
[example]
- [br]
- class (hello,widget)[br]
- {[br]
- constructor()[br]
- {[br]
- $$->%sintbl[]= $array( 0, 38, 71, 92, 100, 92, 71, 38,0, -38, -71, -92, -100, -92, -71, -38);[br]
- $$->%index=0[br]
- $$->$starttimer( 30 );[br]
- $$->$resize(800,600 );[br]
- $$->%string=$0[br]
- $$->%waitfor=1;[br]
- $$->%nextanim=0[br]
- [br]
- #zoom and rotation anim[br]
- $$->%Zoomindex=11[br]
- $$->%degree=0[br]
- $$->%Noanim=0[br]
- $$->%scrollright=-450[br]
- [br]
- #anim effect init[br]
- $$->%xoffset=4[br]
- $$->%yoffset=3[br]
- $$->%xstart=270[br]
- $$->%ystart=200[br]
- $$->%b=0[br]
- $$->%yoffs=400[br]
- [br]
- #parallax parameter[br]
- $$->%Off=400[br]
- $$->%roll=1[br]
- }[br]
- timerevent()[br]
- {[br]
- $$->%b = $(($$->%b + 1) & 15);[br]
- if ($$->%nextanim == 1) $$->$repaint(1);[br]
- $$->$repaint(0);[br]
- }[br]
- drawAnim()[br]
- {[br]
- %P->$setFont(32,"times",bold);[br]
- %w=$(%P->$fontMetricsWidth($$->%string[$$->%index]) + 20);[br]
- %h=$(%P->$fontMetricsHeight * 2);[br]
- %pmx = $(($$->$width/2) -%w/2);[br]
- %pmy = $(($$->$height()/2) - %h/2);[br]
- %x = 10;[br]
- %y= $((%h/2) + $$->$fontDescent());[br]
- %i=0[br]
- while ( $str.mid("Grifisx/Noldor",%i,1) != "") [br]
- {[br]
- %i16 = $(($$->%b+%i) & 15);[br]
- %char=$str.mid("Grifisx/Noldor",%i,1)[br]
- %P->$setPen($((15-%i16)*16),$((15-%i16)*16),$((15-%i16)*16) );[br]
- %P->$drawText( $(%x+$$->%xstart),$($$->%ystart+%y-$$->%sintbl[%i16]*%h/800),%char,1,Auto);[br]
- %x += %P->$fontMetricsWidth(%char);[br]
- %i++;[br]
- }[br]
- }[br]
- matrixeffect()[br]
- {[br]
- if (($$->%Zoomindex == 99) && ($$->%degree==360)) return %P->$drawPixmap($(400-32),$(300-32),"kvirc.png",0,0,-1,-1)[br]
- %P->$scale(0.$$->%Zoomindex,0.$$->%Zoomindex)[br]
- if ($$->%Zoomindex != 99) $$->%Zoomindex++;[br]
- %P->$rotate($$->%degree)[br]
- %P->$translate(400,300)[br]
- %P->$drawPixmap(-32,-32,"kvirc.png",0,0,-1,-1)[br]
- %P->$setFont(28,"times",bold);[br]
- %P->$reset()[br]
- if ($$->%scrollright >= 550) return[br]
- %P->$scale(0.$$->%Zoomindex,0.$$->%Zoomindex)[br]
- %P->$translate(400,350)[br]
- %P->$drawText($$->%scrollright,10,"Another cool class brought to you by...",-1,Auto) [br]
- $$->%scrollright += 3;[br]
- %P->$reset()[br]
- }[br]
- nextanim()[br]
- {[br]
- %p=$new(painter)[br]
- %p->$setBackgroundMode(Opaque)[br]
- %p->$setBrush($rand(255),$rand(255),$rand(255))[br]
- %p->$begin($$)[br]
- %rand=$rand(5)[br]
- %p->$drawrect($rand(800),$rand(400),120,200)[br]
- %p->$drawArc($rand(800),$rand(400),120,200,20,$(16*20))[br]
- %p->$drawPie($rand(800),$rand(400),120,200,20,$(16*20))[br]
- %p->$drawChord($rand(800),$rand(400),120,200,20,$(16*20))[br]
- %p->$drawEllipse($rand(800),$rand(400),100,30)[br]
- %p->$end()[br]
- delete %p[br]
- }[br]
- paintEvent()[br]
- {[br]
- if ($$->%nextanim ==1) return $$->$nextanim()[br]
- # pixmap creation: every effect will be painted on it then copied on widget[br]
- %pixmap=$new(pixmap)[br]
- %pixmap->$resize($$->$width(),$$->$height())[br]
- [br]
- # painter creation [br]
- %P=$new(painter);[br]
- %P->$begin(%pixmap);[br]
- $$->$drawanim[br]
- $$->$matrixeffect[br]
- %i=0[br]
- while (%i != 100)[br]
- {[br]
- %i16 = $(($$->%b+%i) & 15);[br]
- %P->$setPen($((15-%i16)*16),$((15-%i16)*16),$((15-%i16)*16) );[br]
- %P->$drawpoint($rand(800),$rand(600))[br]
- %i++[br]
- }[br]
- [br]
- # sets the animations order to manage the parallax effect[br]
- %P->$end[br]
- objects.bitBlt $$ 0 0 %pixmap[br]
- delete %pixmap[br]
- delete %P[br]
- if (%Pauseflag == 1) return[br]
- [br]
- # manage the animations parameters[br]
- if (($$->%Off<=60) && ($$->%roll<182)) $$->%roll += 2;[br]
- if ($$->%roll>182) $$->%waitfor=0[br]
- if ($$->%Noanim != 1) $$->%degree += 16;[br]
- if ($$->%degree >= 360)[br]
- {[br]
- $$->%degree=0;[br]
- if ($$->%Zoomindex == 99) $$->%Noanim=1[br]
- } [br]
- if ($$->%Noanim != 1) return[br]
- [br]
- #sinusoid animation[br]
- if (($$->%xstart <1) && ($$->%xoffset == -4)) $$->%xoffset=4;[br]
- if (($$->%xstart >$($$->$width()-%P->$fontMetricsWidth("Grifisx/Noldor"))) && ($$->%xoffset == 4)) $$->%xoffset=-4;[br]
- if (($$->%ystart <1) && ($$->%yoffset == -3)) $$->%yoffset=3;[br]
- if (($$->%ystart >$($$->$height()-60)) && ($$->%yoffset == 3)) $$->%yoffset=-3;[br]
- $$->%xstart += $$->%xoffset;[br]
- $$->%ystart += $$->%yoffset;[br]
- }[br]
- }[br]
- [br]
- %Hello=$new(hello)[br]
- %Hello->$setWindowTitle("Painter effects" );[br]
- %Hello->$setFont(28,"times",bold);[br]
- %Btn=$new(button,%Hello)[br]
- %Btn->$setmaximumwidth(80)[br]
- %Btn->$setmaximumheight(30)[br]
- %Btn->$setFont(8,"times",bold);[br]
- %Btn->$settext(Next)[br]
- [br]
- privateimpl(%Btn,mousepressevent)[br]
- {[br]
- if ($$->$parent->%nextanim==0) [br]
- {[br]
- $$->$parent->%nextanim=1[br]
- $$->$settext(Prev)[br]
- } [br]
- else[br]
- {[br]
- $$->$parent->%nextanim=0[br]
- $$->$settext(Next)[br]
- }[br]
- }[br]
- [br]
- %lay=$new(layout,%Hello)[br]
- %lay->$addwidget(%Btn,4,0)[br]
- %Hello->$setBackgroundColor("000000");[br]
- %Hello->$setmaximumwidth(800)[br]
- %Hello->$setminimumwidth(780)[br]
- %Hello->$setmaximumheight(600)[br]
- %Hello->$setminimumheight(600)[br]
- %Hello->$move(10,10)[br]
- %Hello->$show();[br] [br]
+ class (hello,widget)
+ {
+ constructor()
+ {
+ $$->%sintbl[]= $array( 0, 38, 71, 92, 100, 92, 71, 38,0, -38, -71, -92, -100, -92, -71, -38);
+ $$->%index=0
+ $$->$starttimer( 30 );
+ $$->$resize(800,600 );
+ $$->%string=$0
+ $$->%waitfor=1;
+ $$->%nextanim=0
+ [comment]#zoom and rotation anim[/comment]
+ $$->%Zoomindex=11
+ $$->%degree=0
+ $$->%Noanim=0
+ $$->%scrollright=-450
+
+ [comment]#anim effect init[/comment]
+ $$->%xoffset=4
+ $$->%yoffset=3
+ $$->%xstart=270
+ $$->%ystart=200
+ $$->%b=0
+ $$->%yoffs=400
+
+ [comment]#parallax parameter[/comment]
+ $$->%Off=400
+ $$->%roll=1
+ }
+ timerevent()
+ {
+ $$->%b = $(($$->%b + 1) & 15);
+ if ($$->%nextanim == 1) $$->$repaint(1);
+ $$->$repaint(0);
+ }
+ drawAnim()
+ {
+ %P->$setFont(32,"times",bold);
+ %w=$(%P->$fontMetricsWidth($$->%string[$$->%index]) + 20);
+ %h=$(%P->$fontMetricsHeight * 2);
+ %pmx = $(($$->$width/2) -%w/2);
+ %pmy = $(($$->$height()/2) - %h/2);
+ %x = 10;
+ %y= $((%h/2) + $$->$fontDescent());
+ %i=0
+ while ( $str.mid("Grifisx/Noldor",%i,1) != "")
+ {
+ %i16 = $(($$->%b+%i) & 15);
+ %char=$str.mid("Grifisx/Noldor",%i,1)
+ %P->$setPen($((15-%i16)*16),$((15-%i16)*16),$((15-%i16)*16) );
+ %P->$drawText( $(%x+$$->%xstart),$($$->%ystart+%y-$$->%sintbl[%i16]*%h/800),%char,1,Auto);
+ %x += %P->$fontMetricsWidth(%char);
+ %i++;
+ }
+ }
+ matrixeffect()
+ {
+ if (($$->%Zoomindex == 99) && ($$->%degree==360)) return %P->$drawPixmap($(400-32),$(300-32),"kvirc.png",0,0,-1,-1)
+ %P->$scale(0.$$->%Zoomindex,0.$$->%Zoomindex)
+ if ($$->%Zoomindex != 99) $$->%Zoomindex++;
+ %P->$rotate($$->%degree)
+ %P->$translate(400,300)
+ %P->$drawPixmap(-32,-32,"kvirc.png",0,0,-1,-1)
+ %P->$setFont(28,"times",bold);
+ %P->$reset()
+ if ($$->%scrollright >= 550) return
+ %P->$scale(0.$$->%Zoomindex,0.$$->%Zoomindex)
+ %P->$translate(400,350)
+ %P->$drawText($$->%scrollright,10,"Another cool class brought to you by...",-1,Auto)
+ $$->%scrollright += 3;
+ %P->$reset()
+ }
+ nextanim()
+ {
+ %p=$new(painter)
+ %p->$setBackgroundMode(Opaque)
+ %p->$setBrush($rand(255),$rand(255),$rand(255))
+ %p->$begin($$)
+ %rand=$rand(5)
+ %p->$drawrect($rand(800),$rand(400),120,200)
+ %p->$drawArc($rand(800),$rand(400),120,200,20,$(16*20))
+ %p->$drawPie($rand(800),$rand(400),120,200,20,$(16*20))
+ %p->$drawChord($rand(800),$rand(400),120,200,20,$(16*20))
+ %p->$drawEllipse($rand(800),$rand(400),100,30)
+ %p->$end()
+ delete %p
+ }
+ paintEvent()
+ {
+ if ($$->%nextanim ==1) return $$->$nextanim()
+ [comment]# pixmap creation: every effect will be painted on it then copied on widget[/comment]
+ %pixmap=$new(pixmap)
+ %pixmap->$resize($$->$width(),$$->$height())
+
+ [comment]# painter creation[/comment]
+ %P=$new(painter);
+ %P->$begin(%pixmap);
+ $$->$drawanim
+ $$->$matrixeffect
+ %i=0
+ while (%i != 100)
+ {
+ %i16 = $(($$->%b+%i) & 15);
+ %P->$setPen($((15-%i16)*16),$((15-%i16)*16),$((15-%i16)*16) );
+ %P->$drawpoint($rand(800),$rand(600))
+ %i++
+ }
+
+ [comment]# sets the animations order to manage the parallax effect[/comment]
+ %P->$end
+ objects.bitBlt $$ 0 0 %pixmap
+ delete %pixmap
+ delete %P
+ if (%Pauseflag == 1) return
+ [comment]# manage the animations parameters[/comment]
+ if (($$->%Off<=60) && ($$->%roll<182)) $$->%roll += 2;
+ if ($$->%roll>182) $$->%waitfor=0
+ if ($$->%Noanim != 1) $$->%degree += 16;
+ if ($$->%degree >= 360)
+ {
+ $$->%degree=0;
+ if ($$->%Zoomindex == 99) $$->%Noanim=1
+ }
+ if ($$->%Noanim != 1) return
+ [comment]#sinusoid animation[/comment]
+ if (($$->%xstart <1) && ($$->%xoffset == -4)) $$->%xoffset=4;
+ if (($$->%xstart >$($$->$width()-%P->$fontMetricsWidth("Grifisx/Noldor"))) && ($$->%xoffset == 4)) $$->%xoffset=-4;
+ if (($$->%ystart <1) && ($$->%yoffset == -3)) $$->%yoffset=3;
+ if (($$->%ystart >$($$->$height()-60)) && ($$->%yoffset == 3)) $$->%yoffset=-3;
+ $$->%xstart += $$->%xoffset;
+ $$->%ystart += $$->%yoffset;
+ }
+ }
+
+ %Hello=$new(hello)
+ %Hello->$setWindowTitle("Painter effects" );
+ %Hello->$setFont(28,"times",bold);
+ %Btn=$new(button,%Hello)
+ %Btn->$setmaximumwidth(80)
+ %Btn->$setmaximumheight(30)
+ %Btn->$setFont(8,"times",bold);
+ %Btn->$settext(Next)
+
+ privateimpl(%Btn,mousepressevent)
+ {
+ if ($$->$parent->%nextanim==0)
+ {
+ $$->$parent->%nextanim=1
+ $$->$settext(Prev)
+ }
+ else
+ {
+ $$->$parent->%nextanim=0
+ $$->$settext(Next)
+ }
+ }
+
+ %lay=$new(layout,%Hello)
+ %lay->$addwidget(%Btn,4,0)
+ %Hello->$setBackgroundColor("000000");
+ %Hello->$setmaximumwidth(800)
+ %Hello->$setminimumwidth(780)
+ %Hello->$setmaximumheight(600)
+ %Hello->$setminimumheight(600)
+ %Hello->$move(10,10)
+ %Hello->$show();
[/example]
*/
diff --git a/src/modules/objects/KvsObject_pixmap.cpp b/src/modules/objects/KvsObject_pixmap.cpp
index e02cf9106..52eeda284 100644
--- a/src/modules/objects/KvsObject_pixmap.cpp
+++ b/src/modules/objects/KvsObject_pixmap.cpp
@@ -53,14 +53,16 @@
!fn: $fill(<colorname, RGB or HSV array value or [<red>, <green>, <blue>][<hue>, <saturation>, <value>], [opacity], [system color:RGB or HSV])
Fills the pixmap with color and opacity.[br]
!fn: $resize(<width:integer>,<height:integer>)
- Resizes the pixmap to w width and h height. Set wh or hg to 0, to have a null pixmap.
+ Resizes the pixmap to w width and h height. Set [b]wh[/b] or [b]hg to [b]0[/b], to have a null pixmap.
!fn: $scale(<width:integer>,<height:integer>,[<aspect_ratio:string>])
- Scales the pixmap or the animation by sx horizontally and sy vertically.
+ Scales the pixmap or the animation by [b]sx[/b] horizontally and [b]sy[/b] vertically.[br]
Aspect_ratio values:
- - IgnoreAspectRatio:the pixmap is scaled ignoring his aspect ratio.
- - KeepAspectRatio: pixmap is scaled to a rectangle as large as possible inside size, preserving the aspect ratio.
- - KeepAspectRatioByExpanding, the pixmap is scaled to a rectangle as small as possible outside size, preserving the aspect ratio.
- Default value is KeepAspectRatio.
+ [pre]
+ - IgnoreAspectRatio:the pixmap is scaled ignoring his aspect ratio.
+ - KeepAspectRatio: pixmap is scaled to a rectangle as large as possible inside size, preserving the aspect ratio.
+ - KeepAspectRatioByExpanding, the pixmap is scaled to a rectangle as small as possible outside size, preserving the aspect ratio.
+ [/pre]
+ [b]Default value is KeepAspectRatio.[/b][br][br]
!fn: $load(<file_name:string>)
Load a pixmap from the file <file_name>.
!fn: $save(<file_name:string>)
@@ -80,10 +82,8 @@
@signals:
!sg: $frameChanged()
This signal is emitted by the default implementation of [classfnc]$frameChangedEvent[/classfnc]().[br]
-
*/
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_pixmap,"pixmap","object")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,fill)
diff --git a/src/modules/objects/KvsObject_popupMenu.cpp b/src/modules/objects/KvsObject_popupMenu.cpp
index c368e9a02..8524c171c 100644
--- a/src/modules/objects/KvsObject_popupMenu.cpp
+++ b/src/modules/objects/KvsObject_popupMenu.cpp
@@ -85,83 +85,83 @@
[br]
@examples:
[example]
- [comment]//First we define a class inherited from popupmenu[/comment]
- class(menu,popupmenu)
- {
- constructor()
- {
- [comment]//We store the item's ID for checking in activatedEvent[/comment]
- @%tile_id=@$insertItem("Tile",118)
- @%cascade_id=@$insertItem("Cascade",115)
- @$insertSeparator(3)
- @%closeactw_id=@$insertItem("Close Active Window",08)
- @%closeallw_id=@$insertItem("Close All Window",58)
- }
- activatedEvent()
+ [comment]# First we define a class inherited from popupmenu[/comment]
+ class(menu,popupmenu)
{
- [comment]//Now we emit a signals to the relative to the user choice[/comment]
- %id=$0
- if (%id==@%tile_id) @$emit("tile")
- else if(%id==@%cascade_id) @$emit("cascade")
- else if (%id==@%closeactw_id) @$emit("closeactive")
- else @$emit("closeallwindows")
- [comment]//Deleting the popup[/comment]
- delete $$
+ constructor()
+ {
+ [comment]# We store the item's ID for checking in activatedEvent[/comment]
+ @%tile_id=@$insertItem("Tile",118)
+ @%cascade_id=@$insertItem("Cascade",115)
+ @$insertSeparator(3)
+ @%closeactw_id=@$insertItem("Close Active Window",08)
+ @%closeallw_id=@$insertItem("Close All Window",58)
+ }
+ activatedEvent()
+ {
+ [comment]# Now we emit a signals to the relative to the user choice[/comment]
+ %id=$0
+ if (%id==@%tile_id) @$emit("tile")
+ else if(%id==@%cascade_id) @$emit("cascade")
+ else if (%id==@%closeactw_id) @$emit("closeactive")
+ else @$emit("closeallwindows")
+ [comment]# Deleting the popup[/comment]
+ delete $$
+ }
}
- }
- class (ws,widget)[br]
- {
- [comment]In the constructor we create everything that belong to the single widget.[/comment]
- constructor()
+ class (ws,widget)[br]
{
- [comment]//Here we generate a loop to create our labels inside the widget.[/comment]
- %lay=$new(layout,$$)
- [comment]we use a vbox to managing labels in vertical orientation[/comment]
- %vb=$new(vbox,$$)
- [comment]Then add the vbox to the main layout[/comment]
- %lay->$addWidget(%vb,0,0)
- [comment]Let's create our colorful labels[/comment]
- for(%i=0;%i<15;%i++)
+ [comment]In the constructor we create everything that belong to the single widget.[/comment]
+ constructor()
{
- @%label=$new(label,%vb)
- @%label->$settext("Another class by N\&G")
- #We set our foreground's colors using the hex array in a random way.
- @%label->$setforegroundcolor($array($rand(255),$rand(255),$rand(255)))
+ [comment]# Here we generate a loop to create our labels inside the widget.[/comment]
+ %lay=$new(layout,$$)
+ [comment]we use a vbox to managing labels in vertical orientation[/comment]
+ %vb=$new(vbox,$$)
+ [comment]# Then add the vbox to the main layout[/comment]
+ %lay->$addWidget(%vb,0,0)
+ [comment]# Let's create our colorful labels[/comment]
+ for(%i=0;%i<15;%i++)
+ {
+ @%label=$new(label,%vb)
+ @%label->$settext("Another class by N\&G")
+ [comment]# We set our foreground's colors using the hex array in a random way.[/comment]
+ @%label->$setforegroundcolor($array($rand(255),$rand(255),$rand(255)))
+ }
+ }
+ customContextMenuRequestedEvent()
+ {
+ [comment]# We create the popupmenu relative to this widget at runtime.[/comment]
+ %p=$new(menu,$$)
+ objects.connect %p tile @$parent tile
+ objects.connect %p cascade @$parent cascade
+ objects.connect %p closeactive @$parent closeactivewindow
+ objects.connect %p closeallwindows @$parent closeallwindows
+ %p->$exec($$,$($0+10),$($1+10))
}
}
- customContextMenuRequestedEvent()
+ [comment]# We create the workspace widget[/comment]
+ %Workspace=$new(workspace)
+ [comment]# We use as space as we have[/comment]
+ %size[]=%Workspace->$screenResolution()
+ [comment]# Resize it[/comment]
+ %Workspace->$resize(%size[0],%size[1])
+ [comment]# Then create 20 subwidget[/comment]
+ for(%i=0;%i<20;%i++)
{
- [comment]//We create the popupmenu relative to this widget at runtime.[/comment]
- %p=$new(menu,$$)
- objects.connect %p tile @$parent tile
- objects.connect %p cascade @$parent cascade
- objects.connect %p closeactive @$parent closeactivewindow
- objects.connect %p closeallwindows @$parent closeallwindows
- %p->$exec($$,$($0+10),$($1+10))
+ %w=$new(ws,%Workspace)
+ [comment]# Let's add every widget to the workspace[/comment]
+ %Workspace->$addSubWindow(%w)
+ [comment]# Then "shake it" a little bit around :-)[/comment]
+ %w->$move($rand($(%size[0]-50)),$rand($(%size[1]-50)))
}
- }
- [comment]//We create the workspace widget[/comment]
- %Workspace=$new(workspace)
- [comment]//We use as space as we have[/comment]
- %size[]=%Workspace->$screenResolution()
- [comment]//Resize it[/comment]
- %Workspace->$resize(%size[0],%size[1])
- [comment]//Then create 20 subwidget[/comment]
- for(%i=0;%i<20;%i++)
- {
- %w=$new(ws,%Workspace)
- [comment]//Let's add every widget to the workspace[/comment]
- %Workspace->$addSubWindow(%w)
- [comment]//Then "shake it" a little bit around :-)[/comment]
- %w->$move($rand($(%size[0]-50)),$rand($(%size[1]-50)))
- }
- [comment]//Reimplement closeEvent to delete all this :-)[/comment]
- privateimpl(%Workspace,closeEvent)
- {
- delete $$
- }
- [comment]//Let's show![/comment]
- %Workspace->$show()
+ [comment]# Reimplement closeEvent to delete all this :-)[/comment]
+ privateimpl(%Workspace,closeEvent)
+ {
+ delete $$
+ }
+ [comment]# Let's show![/comment]
+ %Workspace->$show()
[/example]
*/
diff --git a/src/modules/objects/KvsObject_process.cpp b/src/modules/objects/KvsObject_process.cpp
index e7c4b1931..d58ec3f64 100644
--- a/src/modules/objects/KvsObject_process.cpp
+++ b/src/modules/objects/KvsObject_process.cpp
@@ -44,7 +44,7 @@
[class]object[/class]
@description:
The Process class is used to start external programs and to communicate with them.[br]
- !WARNING AT LAST YOU HAVE TO CLOSE THE PROCESS!
+ [b]WARNING! at last you have to close the process![/b]
@functions:
!fn: $addArgument(<process-name:string>)
With this command you give the process name (or more arguments) for communication.
@@ -53,9 +53,9 @@
Tries to run the process.[br]
[b]e.g.[/b]
[example]
- %process=$new(process);[br]
- %process->$addArg("cmd.exe");[br]
- %process->$start();[br]
+ %process=$new(process);[br]
+ %process->$addArg("cmd.exe");[br]
+ %process->$start();[br]
[/example]
!fn: <string> $readStdout()
Reads the data that the process has written to standard output.
@@ -63,70 +63,70 @@
Reads the data that the process has written to standard error.
[b]e.g.[/b]
[example]
- class (test,object)[br]
- {[br]
- slotReadStdout()[br]
- {[br]
- %stdo = %Process->$readStdout()[br]
- #%Aoutput->$append(%stdo);// coming soon in the new texteditor class[br]
- %Aoutput->$settext(%stdo);[br]
- }[br]
- slotReadStderr()[br]
- {[br]
- %stderr= %Process->$readStderr()[br]
- #%Aoutput->$append(%stderr);// coming soon in the new texteditor class[br]
- %Aoutput->$settext(%stderr);[br]
- }[br]
- }[br]
+ class (test,object)
+ {
+ slotReadStdout()
+ {
+ %stdo = %Process->$readStdout()
+ #%Aoutput->$append(%stdo);[comment]# coming soon in the new texteditor class[/comment]
+ %Aoutput->$settext(%stdo);
+ }
+ slotReadStderr()
+ {
+ %stderr= %Process->$readStderr()
+ #%Aoutput->$append(%stderr);[comment]# coming soon in the new texteditor class[/comment]
+ %Aoutput->$settext(%stderr);
+ }
+ }
- %tt=$new(test)[br]
- %A=$new(widget)[br]
- %A->$setGeometry(100,100,400,300)[br]
- %layoutA=$new(layout,%A)[br]
- %Ainput=$new(lineedit,%A)[br]
- #%Aoutput=$new(textedit,%A) [comment]//coming soon in the new texteditor class[/commnet][br]
- %Aoutput=$new(label,%A)[br]
- %bclosekill=$new(button,%A)[br]
- %bclosekill->$settext("&CloseKill ")[br]
- %bkill=$new(button,%A)[br]
- %bkill->$settext("&Kill ")[br]
- %bterminate=$new(button,%A)[br]
- %bterminate->$settext("&Ask to Terminate ")[br]
- %layoutA->$addwidget(%Ainput,0,0)[br]
- %layoutA->$addwidget(%Aoutput,1,0)[br]
- %layoutA->$addwidget(%bclosekill,3,0)[br]
- %layoutA->$addwidget(%bkill,4,0,)[br]
- %layoutA->$addwidget(%bterminate,5,0)[br]
+ %tt=$new(test)
+ %A=$new(widget)
+ %A->$setGeometry(100,100,400,300)
+ %layoutA=$new(layout,%A)
+ %Ainput=$new(lineedit,%A)
+ #%Aoutput=$new(textedit,%A)[comment]# coming soon in the new texteditor class[/commnet]
+ %Aoutput=$new(label,%A)
+ %bclosekill=$new(button,%A)
+ %bclosekill->$settext("&CloseKill ")
+ %bkill=$new(button,%A)
+ %bkill->$settext("&Kill ")
+ %bterminate=$new(button,%A)
+ %bterminate->$settext("&Ask to Terminate ")
+ %layoutA->$addwidget(%Ainput,0,0)
+ %layoutA->$addwidget(%Aoutput,1,0)
+ %layoutA->$addwidget(%bclosekill,3,0)
+ %layoutA->$addwidget(%bkill,4,0,)
+ %layoutA->$addwidget(%bterminate,5,0)
- %Process=$new(process)[br]
- %Process->$addArgument("cmd.exe")[br]
- %Process->$startProcess();[br]
+ %Process=$new(process)
+ %Process->$addArgument("cmd.exe")
+ %Process->$startProcess();
- connect %Process readyReadStdout %tt slotReadStdout[br]
- connect %Process readyReadStderr %tt slotReadStderr[br]
- privateimpl(%Ainput,returnPressedEvent)[br]
- {
- %command=%Ainput->$text() "\r\n"[br]
- %Process->$writeToStdin(%command);[br]
- %Ainput->$setText("");[br]
- }[br]
+ connect %Process readyReadStdout %tt slotReadStdout
+ connect %Process readyReadStderr %tt slotReadStderr
+ privateimpl(%Ainput,returnPressedEvent)
+ {
+ %command=%Ainput->$text() "\r\n"
+ %Process->$writeToStdin(%command);
+ %Ainput->$setText("");
+ }
- privateimpl(%bclosekill,mousepressevent)[br]
- {[br]
- %Process->$closekill();[br]
- delete %A;[br]
- }[br]
- privateimpl(%bkill,mousepressevent)[br]
- {[br]
- %Process->$kill();[br]
- delete %A;[br]
- }[br]
- privateimpl(%bterminate,mousepressevent)[br]
- {[br]
- %Process->$tryTerminate();[br]
- delete %A;[br]
- }[br]
- %A->$show();[br]
+ privateimpl(%bclosekill,mousepressevent)
+ {
+ %Process->$closekill();
+ delete %A;
+ }
+ privateimpl(%bkill,mousepressevent)
+ {
+ %Process->$kill();
+ delete %A;
+ }
+ privateimpl(%bterminate,mousepressevent)
+ {
+ %Process->$tryTerminate();
+ delete %A;
+ }
+ %A->$show();
[/example]
!fn: $writeToStdin(<command:string>)
With this command you send a command to the process:
@@ -136,7 +136,7 @@
(I think that this is the better way.)[br]
[b]e.g.[/b]
[pre]
- %Process->close_kill();
+ %Process->close_kill();
[/pre]
!fn: $kill()
Kill the process the hard way (Bad Idea).
diff --git a/src/modules/objects/KvsObject_radioButton.cpp b/src/modules/objects/KvsObject_radioButton.cpp
index e26f3c108..05d732224 100644
--- a/src/modules/objects/KvsObject_radioButton.cpp
+++ b/src/modules/objects/KvsObject_radioButton.cpp
@@ -30,6 +30,7 @@
#include "KviIconManager.h"
#include <QRadioButton>
+
/*
@doc: radiobutton
@keyterms:
@@ -52,18 +53,15 @@
!fn: $setChecked(<bChecked:boolean>)
Sets whether the radio button is checked to check.
!fn: $setPixmap(<image_id>)
- Sets the pixmap shown on the radiobutton..See the [doc:image_id]image identifier[/doc] documentation for the explanation
- of the <image_id> parameter.
+ Sets the pixmap shown on the radiobutton. See the [doc:image_id]image identifier[/doc]
+ documentation for the explanation of the <image_id> parameter.
!fn: <bool>$toggleEvent()
- Called by KVIrc when the radibutton state is toggled.
+ Called by KVIrc when the radiobutton state is toggled.
The default implementation emits the toggled(<bool>) signal.
!sg: $toggled()
This signal is emitted by the default implementation of [classfnc]$toggleEvent[/classfnc]().[br]
-
-
*/
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_radioButton,"radiobutton","widget")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_radioButton,setText)
diff --git a/src/modules/objects/KvsObject_slider.cpp b/src/modules/objects/KvsObject_slider.cpp
index 06651dfb0..3eac95140 100644
--- a/src/modules/objects/KvsObject_slider.cpp
+++ b/src/modules/objects/KvsObject_slider.cpp
@@ -31,7 +31,6 @@
#include <QSlider>
-
/*
@doc: slider
@keyterms:
@@ -67,12 +66,14 @@
!fn: $setTickmarks(<tick_marks:string>)
Sets the tickmark settings for this slider.[br]
Values are:[br]
- NoMarks - do not draw any tickmarks.[br]
- Both - draw tickmarks on both sides of the groove.[br]
- Above - draw tickmarks above the (horizontal) slider[br]
- Below - draw tickmarks below the (horizontal) slider[br]
- Left - draw tickmarks to the left of the (vertical) slider[br]
- Right - draw tickmarks to the right of the (vertical) slider
+ [pre]
+ NoMarks - do not draw any tickmarks.[br]
+ Both - draw tickmarks on both sides of the groove.[br]
+ Above - draw tickmarks above the (horizontal) slider[br]
+ Below - draw tickmarks below the (horizontal) slider[br]
+ Left - draw tickmarks to the left of the (vertical) slider[br]
+ Right - draw tickmarks to the right of the (vertical) slider
+ [/pre]
!fn: $setTickInterval(<value>)
Sets the interval between tickmarks.
!fn: <integer> $value()
@@ -95,11 +96,8 @@
!sg: $valueChanged()
This signal is emitted by the default implementation of [classfnc]valueChangedEvent[/classfnc]().[br]
If you reimplement that function you will have to emit the signal manually (if you still need it).
-
*/
-
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_slider,"slider","widget")
diff --git a/src/modules/objects/KvsObject_socket.cpp b/src/modules/objects/KvsObject_socket.cpp
index 7dfe40c00..1f64b4043 100644
--- a/src/modules/objects/KvsObject_socket.cpp
+++ b/src/modules/objects/KvsObject_socket.cpp
@@ -83,6 +83,7 @@ const char * const sockerrors_tbl[] = {
"ProxyProtocol",
"UnknownSocket"
};
+
/*
@doc: socket
@keyterms:
@@ -103,20 +104,20 @@ const char * const sockerrors_tbl[] = {
!fn: <integer or string> $status(<asString:boolean>)
Returns the status of the socket :[br]
[pre]
- 0 = Unconnected
- 1 = HostLookUp
- 2 = Connecting[br]
- 3 = Connected[br]
- 4 = Bound[br]
- 5 = Closing[br]
- 6 = Listening
+ 0 = Unconnected
+ 1 = HostLookUp
+ 2 = Connecting[br]
+ 3 = Connected[br]
+ 4 = Bound[br]
+ 5 = Closing[br]
+ 6 = Listening
[/pre]
!fn: $connect(<host>,<port>)
Attempts a connection to <host> on port <port>.[br]
<host> can be a numeric internet address (either IPv4 or IPv6 (if supported)) or a hostname.[br]
- If a hostname is used, a DNS lookup is performed (the socket enters the "DNS call" state).[br]
- This function returns 1 if the connect attempt can be successfully initiated,
- 0 otherwise.[br] In fact, this function returns 0 only if the supplied <port> parameter
+ If a hostname is used, a DNS lookup is performed (the socket enters the [i]DNS call[i/] state).[br]
+ This function returns [b]1[/b] if the connect attempt can be successfully initiated, and
+ [b]0[/b] otherwise.[br] In fact, this function returns [b]0[/b] only if the supplied <port> parameter
is invalid or the socket is in an incoherent state (already connected or listening):
for a newly created socket and with a valid <port> number you can safely ignore
the return value.[br]
@@ -124,56 +125,48 @@ const char * const sockerrors_tbl[] = {
the socket is [b]not[/b] connected: it has just initiated the connect attempt
and you will be notified of the attempt result by an asynchronous event call:
in case of failure, $connectFailedEvent() will be called, in case of
- succes, $connectEvent() will be called.
-
+ success, $connectEvent() will be called.
!fn: $listen([<port>[,<interface>[,<force_ipv6>]]])
Attempts to listen on the specified <port> and <interface>.[br]
- If <port> is not passed it is assumed to be 0, if <interface> is not passed, it is assumed to be
- "any interface" (INADDR_ANY).[br] Port 0 means that the kernel should choose a "random" port to listen on.[br]
+ If <port> is not passed it is assumed to be [b]0[/b], if <interface> is not passed, it is assumed to be
+ [i]any interface[/i] (INADDR_ANY).[br] Port 0 means that the kernel should choose a [i]random[/i] port to listen on.[br]
If the <interface> is recognized as IPv6 address, and IPv6 is supported, the socket listens
in IPv6 mode. If <interface> is an empty string and <force_ipv6> is 1 the socket listens
- on "any ipv6 interface".[br]
- This function returns '1' in case of success and '0' in case of failure.[br]
+ on [i]any IPv6 interface[/i].[br]
+ This function returns [b]1[/b] in case of success and [b]0[/b] in case of failure.[br]
On some systems listening in the IPv6 namespace allows to accept also IPv4 connections (this includes
Linux but not windows afaik).[br]
When an incoming connection will arrive, $incomingConnectionEvent() will be called.
-
!fn: $connectedEvent()
This function is called when a connection attempt has been successfully completed.
The socket is currently connected to [classfnc:socket]$remoteIp[/classfnc]() on
[classfnc:socket]$remotePort[/classfnc](). You can start
writing data and you may expect [classfnc:socket]$dataAvailableEvent[/classfnc]() to be
triggered.
-
!fn: $incomingConnectionEvent(<socket:h_object>)
This function is called when an incoming connection arrives over a socket in listening state.[br]
- You must return 1 if you to terminated this incoming connection call [classfnc:socket]$accept[/classfnc]() passing a newly created socket object
+ You must return [b]1[/b] if you to terminated this incoming connection call [classfnc:socket]$accept[/classfnc]() passing a newly created socket object
to accept and handle the connection.[br] If you don't call [classfnc:socket]$accept[/classfnc]()
the incoming connection will be automatically terminated.
-
!fn: $connectFailedEvent(<reason>)
This function is called when a connection attempt fails for some reason. <reason> contains
the error string.[br]
This function may be called only between a call to [classfnc:socket]$connect[/classfnc]() and
the [classfnc:socket]$connectEvent[/classfnc]().
-
!fn: $disconnectEvent([error])
This function is called when a connection is terminated either cleanly or because of an error.[br]
- [error] is an empty string in case of a "clean" termination (connection closed by the remote host)
+ [error] is an empty string in case of a [i]clean[/i] termination (connection closed by the remote host)
or is a message describing the socket error that caused the connection to be interrupted.
-
!fn: $dataAvailableEvent(<data_length>)
This function is called when some data is available to be read: the <data_length> parameter specifies
the length of the available data in bytes.[br]
You can use one of the $read* functions to obtain the data
-
!fn: $read(<length>[,<hobject>])
- Reads at most <length> bytes of data from the socket. If <length> is anything "outside" the
+ Reads at most <length> bytes of data from the socket. If <length> is anything [i]outside[/i] the
available data range (<length> < 0 or <length> > available_data_length), this function
returns all the available data.[br]
By default this function can deal ASCII data only: NULL characters are transformed to
ASCII characters 255. You can pass a [class]memorybuffer[/class] object to read binary data.
-
!fn: $write(<data, array,files or hobject>[,length])
Writes <data> to the socket.[br]
This function can deal with binary data passing a [class]memorybuffer[/class] object[br]
@@ -183,7 +176,6 @@ const char * const sockerrors_tbl[] = {
Using an array you can pass bytes or data string like this: @$write($array($(0xff),$(0xff),$(0xff),$(0xff),"This is an example"));
If you're going to [cmd]delete[/cmd] this object just after the $write call, you should
call [classfnc:socket]$close[/classfnc]() just before [cmd]delete[/cmd] to ensure the data delivery.
-
!fn: $close()
Resets this socket state: kills any pending or active connection. After a close() call
the socket may be used for a new connection.[br]
@@ -191,97 +183,91 @@ const char * const sockerrors_tbl[] = {
You don't need to call $close() if you [cmd]delete[/cmd] the socket: KVIrc will
reset the socket state automatically and free the memory. But if you want to ensure data delivery
after a $write call sequence and just before a [cmd]delete[/cmd], $close() is the only chance to do it.
-
!fn: $remoteIp()
Returns the IP address of the remote end of this socket.[br]
The return value is meaningful only if the socket is in connected or connecting state.
-
!fn: $setProtocol(<protocol>)
Let KVIrc use TCP or UDP protocol
-
!fn: $remotePort()
Returns the port of the remote end of this socket.[br]
The return value is meaningful only if the socket is in connected or connecting state.
-
!fn: $localIp()
Returns the IP address of the local end of this socket.[br]
The return value is meaningful only if the socket is in connected, listening or connecting state.
-
!fn: $localPort()
Returns the port of the local end of this socket.[br]
The return value is meaningful only if the socket is in connected, listening or connecting state.
-
@examples:
[example]
- // Server socket: listen 8080 port and answer to requests (multi-threaded)
- class("webserver","socket")
- {
- function incomingConnectionEvent()
+ [comment]# Server socket: listen 8080 port and answer to requests (multi-threaded)[/comment]
+ class("webserver","socket")
{
- // incoming connection socket passed by the framework
- %socket = $0
- debug "Webserver incoming Connection from: %socket->$remoteIp : %socket->$remotePort"
- %socket->$write("HTTP/1.0 200 OK\n\n<html><head></head><body><h1>KVIrc Webserver</h1></body></html>\n")
- // tells KVIrc no need this socket anymore
- return $true()
- }
- function constructor()
- {
- debug listen @$listen(8080, "127.0.0.1")
+ function incomingConnectionEvent()
+ {
+ [comment]# incoming connection socket passed by the framework[/comment]
+ %socket = $0
+ debug "Webserver incoming Connection from: %socket->$remoteIp : %socket->$remotePort"
+ %socket->$write("HTTP/1.0 200 OK\n\n<html><head></head><body><h1>KVIrc Webserver</h1></body></html>\n")
+ [comment]# tells KVIrc no need this socket anymore[/comment]
+ return $true()
+ }
+ function constructor()
+ {
+ debug listen @$listen(8080, "127.0.0.1")
+ }
}
- }
- // finally start webserver
- %WebS = $new(webserver)
+ [comment]# finally start webserver[/comment]
+ %WebS = $new(webserver)
[/example]
[example]
- // Client socket - go to google and grab request header[br]
- class("httprequest","socket")
- {
- function errorEvent()
- {
- // the connection to the server failed
- debug "Connection failed: "$0
- delete $$
- }
- function disconnectedEvent()
- {
- // connection has been closed
- debug "Connection is closed"
- delete $$
- }
- function destructor()
- {
- // if the socket is still open close it
- if(@$status() == "Connected") @$close()
- }
- function stateChangedEvent()
- {
- debug socket state $0
- }
- function dataAvailableEvent()
+ [comment]# Client socket - go to google and grab request header[/comment][br]
+ class("httprequest","socket")
{
- // reading the received data
- debug reading $0 bytes
- %newdata = @$read($0)
- debug data: %newdata
- // close and delete the socket
- @$close()
- delete $$
- }
- function constructor()
- {
- // connect to the server
- @$connect("www.google.com",80)
- }
- function connectedEvent()
- {
- // connection is complete
- // send a request to receive the headers only from http://www.google.com/
- debug connected
- debug written bytes @$write("HEAD / HTTP/1.1\r\nHost: www.google.de\r\nConnection: Close\r\nUser-Agent: KVIrc socket\r\n\r\n") on socket;
+ function errorEvent()
+ {
+ [comment]# the connection to the server failed[/comment]
+ debug "Connection failed: "$0
+ delete $$
+ }
+ function disconnectedEvent()
+ {
+ [comment]# connection has been closed[/comment]
+ debug "Connection is closed"
+ delete $$
+ }
+ function destructor()
+ {
+ [comment]# if the socket is still open close it[/comment]
+ if(@$status() == "Connected") @$close()
+ }
+ function stateChangedEvent()
+ {
+ debug socket state $0
+ }
+ function dataAvailableEvent()
+ {
+ [comment]# reading the received data[/comment]
+ debug reading $0 bytes
+ %newdata = @$read($0)
+ debug data: %newdata
+ [comment]# close and delete the socket[/comment]
+ @$close()
+ delete $$
+ }
+ function constructor()
+ {
+ [comment]# connect to the server[/comment]
+ @$connect("www.google.com",80)
+ }
+ function connectedEvent()
+ {
+ [comment]# connection is complete[/comment]
+ [comment]# send a request to receive the headers only from http://www.google.com/[/comment]
+ debug connected
+ debug written bytes @$write("HEAD / HTTP/1.1\r\nHost: www.google.de\r\nConnection: Close\r\nUser-Agent: KVIrc socket\r\n\r\n") on socket;
+ }
}
- }
- %Temp = $new(httprequest)
+ %Temp = $new(httprequest)
[/example]
*/
diff --git a/src/modules/objects/KvsObject_sql.cpp b/src/modules/objects/KvsObject_sql.cpp
index 5083a4f9f..722f1724b 100644
--- a/src/modules/objects/KvsObject_sql.cpp
+++ b/src/modules/objects/KvsObject_sql.cpp
@@ -40,78 +40,75 @@
c->error("No connection has been initialized!");\
return false;}
-
/*
- @doc: sql
- @keyterms:
- Sql database.
- @title:
- sql class
- @type:
- class
- @short:
- A SQL database interface.
- @inherits:
- [class]object[/class]
- @description:
- This class permits KVIrc to have an interface with a SQL database supported by Qt library drivers.
- @functions:
- !fn: <boolean> $setConnection(<database_name:string>,<connection_name:string>,[<user:string>,<host_name_string>,<password:string>,<database_driver:string>])
- Connects to the DBMS using the connection <connection_name> and selecting the database <database_name>.[br]
- If the optional parameter <database_driver> is passed, it will be used the corresponding driver (if present), otherwise Sqlite will be used.
- Returns true if the operation is successful, false otherwise.
- !fn:: <array or string> $connectionNames([<stringreturnflag>:'s'])
- Returns as array or, if the flag 's' is passed, as a comma separate string all the database active connection's names.
- !fn: <array> $tablesList(<connection_name:string>)
- Returns as array the database tables list.
- !fn: $transaction()
- Begin a transaction.
- !fn: $commit()
- Commit the transaction.
- !fn: $setCurrentQuery(<connection_name:string>)
- Sets the query for the database connection <connection_name>, which has to be already connected, as current query.
- !fn: <connection_name:string> $currentQuery()
- Returns the name of the database connection for the current query, or an empty string if there aren't any initialized queries.
- !fn: $closeConnection(<connection_name:string>)
- Closes the connection <connection_name>.
- !fn: <size:integer> $queryResultsSize()
- Returns the query size in rows or -1 if the query is empty or the database driver doesn't support the function.
- !fn: <error:string> $lastError(<more_details:boolean>)
- Returns last error occurred. Use the more_details flag for more info about the error.
- !fn: <ok:boolean> $queryExec([<query:string>])
- Execs the current query <query>. The string must follow the right syntax against the database in use.
- If there are no parameters, it will exec the query previously done.
- After the execution, the query will positioned on the first resulting record.
- Returns true if the operation is successful, false otherwise.
- See also [classfnc]$queryPrepare[/classfnc]()
- !fn: <ok:boolean> $queryPrepare(<query_string>)
- Prepare the query <query> to execute. The string must follow the right syntax against the database in use.
- It's possible to use the placeholders. It's supported either the identifier ':' and '?' but it's not possible to use them together.
- Returns true if the operation is successful, false otherwise.
- See also [classfnc]$queryExec[/classfnc]and[classfnc]$queryBindValue[/classfnc].
- !fn: $queryBindValue()
- Sets the placeholder <placeholder> to be bound to the value <val> in the prepared statement.
- Note that the placeholder mark (e.g :) must be included when specifying the placeholder name.
- !fn: <boolean> $queryPrevious()
- Sets the current query position to the previous resulting record.
- Returns true if the operation is successful, false otherwise.
- !fn: <boolean> $queryNext()
- Sets the current query position to the next resulting record.
- Returns true if the operation is successful, false otherwise.
- !fn: <boolean> $queryLast()
- Sets the current query position to the last resulting record.
- Returns true if the operation is successful, false otherwise.
- !fn: <boolean> $queryFirst()
- Sets the current query position to the first resulting record.
- Returns true if the operation is successful, false otherwise.
- !fn: <record:hash> $queryRecord()
- Returns a hash containing the current query's record fields.
- !fn: $queryFinish()
- Sets the current query to inactive.
+ @doc: sql
+ @keyterms:
+ Sql database.
+ @title:
+ sql class
+ @type:
+ class
+ @short:
+ A SQL database interface.
+ @inherits:
+ [class]object[/class]
+ @description:
+ This class permits KVIrc to have an interface with a SQL database supported by Qt library drivers.
+ @functions:
+ !fn: <boolean> $setConnection(<database_name:string>,<connection_name:string>,[<user:string>,<host_name_string>,<password:string>,<database_driver:string>])
+ Connects to the DBMS using the connection <connection_name> and selecting the database <database_name>.[br]
+ If the optional parameter <database_driver> is passed, it will be used the corresponding driver (if present), otherwise SQLite will be used.
+ Returns true if the operation is successful, false otherwise.
+ !fn:: <array or string> $connectionNames([<stringreturnflag>:'s'])
+ Returns as array or, if the flag '[b]s[/b] is passed, as a comma separate string all the database active connection's names.
+ !fn: <array> $tablesList(<connection_name:string>)
+ Returns as array the database tables list.
+ !fn: $transaction()
+ Begin a transaction.
+ !fn: $commit()
+ Commit the transaction.
+ !fn: $setCurrentQuery(<connection_name:string>)
+ Sets the query for the database connection <connection_name>, which has to be already connected, as current query.
+ !fn: <connection_name:string> $currentQuery()
+ Returns the name of the database connection for the current query, or an empty string if there aren't any initialized queries.
+ !fn: $closeConnection(<connection_name:string>)
+ Closes the connection <connection_name>.
+ !fn: <size:integer> $queryResultsSize()
+ Returns the query size in rows or -1 if the query is empty or the database driver doesn't support the function.
+ !fn: <error:string> $lastError(<more_details:boolean>)
+ Returns last error occurred. Use the more_details flag for more info about the error.
+ !fn: <ok:boolean> $queryExec([<query:string>])
+ Execs the current query <query>. The string must follow the right syntax against the database in use.
+ If there are no parameters, it will exec the query previously done.
+ After the execution, the query will positioned on the first resulting record.
+ Returns true if the operation is successful, false otherwise.
+ See also [classfnc]$queryPrepare[/classfnc]()
+ !fn: <ok:boolean> $queryPrepare(<query_string>)
+ Prepare the query <query> to execute. The string must follow the right syntax against the database in use.
+ It's possible to use the placeholders. It's supported either the identifier [b]:[/b] and [b]?[/b] but it's not possible to use them together.
+ Returns true if the operation is successful, false otherwise.
+ See also [classfnc]$queryExec[/classfnc]and[classfnc]$queryBindValue[/classfnc].
+ !fn: $queryBindValue()
+ Sets the placeholder <placeholder> to be bound to the value <val> in the prepared statement.
+ Note that the placeholder mark (e.g [b]:[/b]) must be included when specifying the placeholder name.
+ !fn: <boolean> $queryPrevious()
+ Sets the current query position to the previous resulting record.
+ Returns true if the operation is successful, false otherwise.
+ !fn: <boolean> $queryNext()
+ Sets the current query position to the next resulting record.
+ Returns true if the operation is successful, false otherwise.
+ !fn: <boolean> $queryLast()
+ Sets the current query position to the last resulting record.
+ Returns true if the operation is successful, false otherwise.
+ !fn: <boolean> $queryFirst()
+ Sets the current query position to the first resulting record.
+ Returns true if the operation is successful, false otherwise.
+ !fn: <record:hash> $queryRecord()
+ Returns a hash containing the current query's record fields.
+ !fn: $queryFinish()
+ Sets the current query to inactive.
*/
-
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_sql,"sql","object")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,queryLastInsertId)
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,commit)
diff --git a/src/modules/objects/KvsObject_tabWidget.cpp b/src/modules/objects/KvsObject_tabWidget.cpp
index 4eef1a790..69a9ea652 100644
--- a/src/modules/objects/KvsObject_tabWidget.cpp
+++ b/src/modules/objects/KvsObject_tabWidget.cpp
@@ -94,16 +94,16 @@
See also [classfnc]$setTabsClosable[/classfnc]().
@examples:
[example]
- [comment]// First we'll create the main tabWidget.[/comment]
+ [comment]# First we'll create the main tabWidget.[/comment]
%Tabwidget=$new(tabWidget)
%Tabwidget->$setToolTip("Example of TabWidget class")
%Tabwidget->$setTabPosition(Top)
%Tabwidget->$resize(300,200)
- [comment]// Now we'll create the new widgets and put they in to the main tabWidget.[/comment]
+ [comment]# Now we'll create the new widgets and put they in to the main tabWidget.[/comment]
%firsttab=$new(vbox)
%secondtab=$new(vbox)
- [comment]// Now we'll create the item to put in to tab's pages.[/comment]
- [comment]// First tab[/comment]
+ [comment]# Now we'll create the item to put in to tab's pages.[/comment]
+ [comment]# First tab[/comment]
%hbox=$new(hbox,%firsttab)
%labelbt=$new(label,%hbox)
%labelbt->$settext(Botton Tab)
@@ -114,11 +114,13 @@
%buttontb->$settext("To &Botton")
%buttontt=$new(button,%hbox)
%buttontt->$settext("To &Top")
- [comment]// Now we'll give a layout to all items.[/comment]
- [comment]// This also allows to use privateimpl without making buttons global variables[/comment]
- [comment]// Add the page to the main tab.[/comment]
+ [comment]
+ # Now we'll give a layout to all items.
+ # This also allows to use privateimpl without making buttons global variables
+ # Add the page to the main tab.
+ [/comment]
%Tabwidget->$addTab(%firsttab,Top&Button,33)
- [comment]// Implementing the action to do when the user click the buttons.[/comment]
+ [comment]# Implementing the action to do when the user click the buttons.[/comment]
privateimpl(%buttontb,mousepressevent)
{
%Tabwidget->$setTabPosition(Bottom)
@@ -127,7 +129,7 @@
{
%Tabwidget->$setTabPosition(Top)
}
- [comment]// We do the same work with the second tab's page.[/comment]
+ [comment]# We do the same work with the second tab's page.[/comment]
%labelwp=$new(label,%secondtab)
%labelwp->$settext("Enjoy the new Class provided by")
%labelwp->$setalignment("Center")
@@ -135,7 +137,7 @@
%labelgen->$settext(Grifisx \& Noldor)
%labelgen->$setalignment("Center")
%Tabwidget->$addTab(%secondtab,&About,50)
- [comment]// Let's show our example.[/comment]
+ [comment]# Let's show our example.[/comment]
%Tabwidget->$show()
[/example]
@signals:
diff --git a/src/modules/objects/KvsObject_tableWidget.cpp b/src/modules/objects/KvsObject_tableWidget.cpp
index 3289d3e99..7cf4b869e 100644
--- a/src/modules/objects/KvsObject_tableWidget.cpp
+++ b/src/modules/objects/KvsObject_tableWidget.cpp
@@ -127,7 +127,7 @@ const char * const itemflags_tbl[] = {
!fn: $setForegroundColor(<row:uinteger>,<col:uinteger>,<rgb(hex string)_array(red:integer,green:integer,blue_integer)_or_red_or_colorname>,[geen:integer],[blue:integer])
Sets the foreground of the cell at <row,<col> according to <colorname> <rgb_value>:valid values are:
- hex string: must be a string with 6 hexadecimal digits (like the ones used to
- specify colors in html pages). The first two digits specify
+ specify colors in HTML pages). The first two digits specify
the RED component, the third and fourth digit specify the GREEN component
and the last two specify the BLUE component.
For example "FFFF00" means full red, full green and no blue that gives
@@ -136,14 +136,14 @@ const char * const itemflags_tbl[] = {
These determine whether the cell can be selected or modified.
Supported flags are:
[pre]
- [br]- noitemflag : no flag sets;
- [br]- selectable : cell is selecatble;
- [br]- editable : cell is editable;
- [br]- dragEnabled : cell can dragged;
- [br]- dropEnabled : cell can used as drop target;
- [br]- userCheckable : cell is checkable;
- [br]- enabled :cell is enabled;
- [br]- tristate : cell is checkable with three separate states.
+ - noitemflag : no flag sets;
+ - selectable : cell is selectable;[br]
+ - editable : cell is editable;[br]
+ - dragEnabled : cell can dragged;[br]
+ - dropEnabled : cell can used as drop target;[br]
+ - userCheckable : cell is checkable;[br]
+ - enabled :cell is enabled;[br]
+ - tristate : cell is checkable with three separate states.
[/pre]
!fn: $setCellWidget(<row:uint>,<column:uint>,<widget:hobject>)
Sets the given widget to be displayed in the cell in the given row and column, passing the ownership of the widget to the table.
@@ -168,7 +168,7 @@ const char * const itemflags_tbl[] = {
This event is triggered whenever a cell in the table is double clicked.
!fn: $paintCellEvent(<painter:hobject>,<row,uint>,<col:uint>,<cell_width:uint>,<cell_height:uint>)
This event handler can be reimplemented to repaint cells.
- The framework will pass the row/col coordinates, cell's width and height, and, as parameter, a [class]painter[/class]object.
+ The framework will pass the row/col coordinates, cell's width and height as parameter, a [class]painter[/class]object.
You don't need to begin/end/delete the painter.
!fn: $sizeHintCellRequestEvent()
This event handler can be reimplemented to pass a custom size hint for this cell to the table layout
@@ -179,10 +179,8 @@ const char * const itemflags_tbl[] = {
@signals:
!sg: $clicked()
This signal is emitted by the default implementation of [classfnc]$clickEvent[/classfnc]().
-
*/
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_tableWidget,"tablewidget","widget")
// Horizontal Header
diff --git a/src/modules/objects/KvsObject_toolBar.cpp b/src/modules/objects/KvsObject_toolBar.cpp
index 263f1a5c6..861b51c79 100644
--- a/src/modules/objects/KvsObject_toolBar.cpp
+++ b/src/modules/objects/KvsObject_toolBar.cpp
@@ -52,15 +52,13 @@
!fn: $addSeparator()
Adds a separator to the right/bottom of the toolbar.
!fn: $setLabel(<text:string>)
- Sets the toolbar's label.
+ Sets the toolbars label.
!fn: <string> $label()
- Returns the toolbar's label.
+ Returns the toolbars label.
!fn: $clear()
- Deletes all the toolbar's child widgets.
-
+ Deletes all the toolbars child widgets.
*/
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_toolBar,"toolbar","widget")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolBar,addSeparator)
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolBar,setLabel)
diff --git a/src/modules/objects/KvsObject_trayIcon.cpp b/src/modules/objects/KvsObject_trayIcon.cpp
index b1aeb90b6..e5dc4a2e1 100644
--- a/src/modules/objects/KvsObject_trayIcon.cpp
+++ b/src/modules/objects/KvsObject_trayIcon.cpp
@@ -62,12 +62,14 @@
Returns '1' if the tray icon is currently visible.
!fn: showMessage(<title:string>,<message:string>,<message_icon:string>,<timeout:integer>)
Shows a balloon message for the entry with the given title, message and message_icon for the time specified in millisecondsTimeoutHint. title and message must be plain text strings.
- Message can be clicked by the user; the messageClickedEvent() will be triggered when this occurs.
+ Message can be clicked by the user; the messageClickedEvent() will be triggered when this occurs.[br]
Valid values for message_icon are:
- [br]- NoIcon : No icon is shown.
- [br]- Information : An information icon is shown.
- [br]- Warning : A standard warning icon is shown.
- [br]- Critical : A critical warning icon is shown.
+ [pre]
+ - NoIcon : No icon is shown.[br]
+ - Information : An information icon is shown.[br]
+ - Warning : A standard warning icon is shown.[br]
+ - Critical : A critical warning icon is shown.[br]
+ [/pre]
!fn: setContextMenu(<popupmenu:hobject>).
Associates the given <popupmenu> with the tray icon.
!fn: activatedEvent(<reason:string>)
@@ -75,11 +77,11 @@
If you reimplement this function the reason parameter will be passed as $0.
Values for reason are:[br]
[pre]
- [br]- Unknown : Unknown reason.
- [br]- Context : The context menu for the tray icon was requested.
- [br]- DoubleClick : The tray icon was double clicked.
- [br]- Trigger : The tray icon was clicked.
- [br]- MiddleClick : The tray icon was clicked with the middle mouse button.
+ - Unknown : Unknown reason.[br]
+ - Context : The context menu for the tray icon was requested.[br]
+ - DoubleClick : The tray icon was double clicked.[br]
+ - Trigger : The tray icon was clicked.[br]
+ - MiddleClick : The tray icon was clicked with the middle mouse button.[br]
[/pre]
The default implementation emits the [classfnc]$activated[/classfnc]() signal.
!fn: messageClickedEvent()
diff --git a/src/modules/objects/KvsObject_treeWidget.cpp b/src/modules/objects/KvsObject_treeWidget.cpp
index 498375288..cd62e31fc 100644
--- a/src/modules/objects/KvsObject_treeWidget.cpp
+++ b/src/modules/objects/KvsObject_treeWidget.cpp
@@ -57,7 +57,7 @@
Allocating a [class]listviewtitem[/class] item2 as a child of item1 will insert it to the same listview creating
a subtree of items spanning from item1. The subtree can be opened or closed by a simple click either
on the parent item or on the little plus sign on the side of it (when [classfnc:listview]$setRootIsDecorated[/classfnc]
- is set to $true. The listview can be in Single, Multi, Extended or NoSelection selection mode.
+ is set to $true. The listview can be in Single, Multi, Extended or NoSelection selection mode.[br][br]
In single selection mode there can be only one selected item at a time and the selected item is also
the current item (this mode is the default). In Multi and Extended selection mode there can be multiple selected items
and the current item is one of them. The difference between multi and extended is in the way
@@ -67,7 +67,7 @@
!fn: $addColumn(<text_label:string>,[<width:integer>])
Adds a width pixels wide column with the column header label to the list view.
!fn: $setSorting(<column:integer>,<sort_order:string>)
- Sets the list view to be sorted by column in ascending order if sort_order is "ascending" or descending order if it is "descending".
+ Sets the list view to be sorted by column in ascending order if sort_order is [i]ascending[/i] or descending order if it is [i]descending[/i].
!fn: $setSortingEnabled(<bEnabled:boolean>)
If <bEnabled> is true, user sorting is enabled for the tree. The default value is false.
In order to avoid performance issues, it is recommended that sorting is enabled after inserting the items into the tree.
@@ -76,13 +76,13 @@
!fn: $showListViewHeader()
Show the listview column header.
!fn: <boolean> $isListViewHeaderVisible()
- Returns '1' if the listview header is currently visible. Otherwise this function returns '0'.
+ Returns [b]1[/b] if the listview header is currently visible. Otherwise this function returns [b]0[/b].
!fn: $setAllColumnsShowFocus(<bAllColumnsShowFocus:boolean>)
When the argument is $true, causes the listview to display the focus and selection
by highlighting all the columns of the item. When the argument is $false then
only the first column is selected/highlighted.
!fn: $setSelectionMode(<mode:string>)
- Sets the selection mode for this listview. <mode> can be one of "Single","NoSelection","Multi" or "Extended".
+ Sets the selection mode for this listview. <mode> can be one of [i]Single[/i], [i]NoSelection[/i], [i]Multi[/i] or [i]Extended[/i].
!fn: <listviewitem> $selectedItems()
Returns the currently selected [class]listviewitem[/class] or $null if no items are selected.
This function works only if the list view is in single selection mode.
@@ -112,7 +112,7 @@
In its argument is the newly selected item or 0 if the change made no item current.[br]
The default implementation emits the [classfnc]$currentChanged[/classfnc]() signal.
!fn: $itemActivatedEvent(<item:object>)
- This s signal is emitted when the user activates an item by single- or double-clicking or pressing 'Enter'.[br]
+ This signal is emitted when the user activates an item by single- or double-clicking or pressing Enter.[br]
In its argument the current item.[br]
The default implementation emits the [classfnc]$itemActivated[/classfnc]() signal.
!fn: $spacePressedEvent(<item:object>)
@@ -154,10 +154,6 @@
This signal is emitted by the default implementation of [classfnc]$rightButtonClickedEvent[/classfnc]().
*/
-
-
-//---------------------------------------------------------------------------------
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_treeWidget,"listview","widget")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,setHeaderLabels)
diff --git a/src/modules/objects/KvsObject_treeWidgeteItem.cpp b/src/modules/objects/KvsObject_treeWidgeteItem.cpp
index 6cf0ad0d1..fb584a9e4 100644
--- a/src/modules/objects/KvsObject_treeWidgeteItem.cpp
+++ b/src/modules/objects/KvsObject_treeWidgeteItem.cpp
@@ -56,8 +56,6 @@ const char * const itemflags_tbl[] = {
#define itemflags_num (sizeof(itemflags_tbl) / sizeof(itemflags_tbl[0]))
-
-
/*
@doc: listviewitem
@keyterms:
@@ -116,20 +114,17 @@ const char * const itemflags_tbl[] = {
This is often used to disable an item.
Supported flags are:
[pre]
- [br]- noitemflag : no flag sets;
- [br]- selectable : item is selectable;
- [br]- editable : item is editable;
- [br]- dragEnabled : item can dragged;
- [br]- dropEnabled : item can used as drop target;
- [br]- userCheckable : item is checkable;
- [br]- enabled :item is enabled;
- [br]- tristate : item is checkable with three separate states.
+ - noitemflag : no flag sets;[br]
+ - selectable : item is selectable;[br]
+ - editable : item is editable;[br]
+ - dragEnabled : item can dragged;[br]
+ - dropEnabled : item can used as drop target;[br]
+ - userCheckable : item is checkable;[br]
+ - enabled :item is enabled;[br]
+ - tristate : item is checkable with three separate states.
[/pre]
*/
-
-//===========================================================================================
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_treeWidgetItem,"listviewitem","object")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setText)
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,text)
diff --git a/src/modules/objects/KvsObject_vBox.cpp b/src/modules/objects/KvsObject_vBox.cpp
index 0411cfe86..1f8067d44 100644
--- a/src/modules/objects/KvsObject_vBox.cpp
+++ b/src/modules/objects/KvsObject_vBox.cpp
@@ -59,6 +59,7 @@ const int align_cod[] = {
};
#define align_num (sizeof(align_tbl) / sizeof(align_tbl[0]))
+
/*
@doc: vbox
@keyterms:
@@ -83,11 +84,20 @@ const int align_cod[] = {
!fn: $addStretch(<stretch:integer>)
Adds a stretchable space with zero minimum size and stretch factor stretch to the end of this box layout.
!fn: $setAlignment(<flag1:string>, <flag2:string>, ...)
- Sets the alignment for widget w to flags, given as parameters.
- Valid flags are: Right, Left, Top, Bottom, HCenter, VCenter, Center, Justify
+ Sets the alignment for widget w to flags, given as parameters.[br]
+ Valid flags are:[br]
+ [pre]
+ Right[br]
+ Left[br]
+ Top[br]
+ Bottom[br]
+ HCenter[br]
+ VCenter[br]
+ Center[br]
+ Justify
+ [/pre]
*/
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_vBox,"vbox","widget")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_vBox,setMargin)
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_vBox,setSpacing)
diff --git a/src/modules/objects/KvsObject_webView.cpp b/src/modules/objects/KvsObject_webView.cpp
index f7d2b0168..da6f4b8fc 100644
--- a/src/modules/objects/KvsObject_webView.cpp
+++ b/src/modules/objects/KvsObject_webView.cpp
@@ -197,10 +197,10 @@ const char * const actions_tbl[] = {
Finds the specified string, in the page, using the given options.
Valid flags are:
[pre]
- FindBackward - Searches backwards instead of forwards;
- FindCaseSensitively - Changes the behaviour to a case sensitive find operation.
- FindWrapsAroundDocument - Restart from the beginning of the document if the end was reached and the text was not found.
- HighlightAllOccurrences - Highlights all existing occurrences.
+ FindBackward - Searches backwards instead of forwards;
+ FindCaseSensitively - Changes the behaviour to a case sensitive find operation.
+ FindWrapsAroundDocument - Restart from the beginning of the document if the end was reached and the text was not found.
+ HighlightAllOccurrences - Highlights all existing occurrences.
[/pre]
!fn: <array> $frames()
Returns an array containing the names of the document frames.
@@ -233,9 +233,9 @@ const char * const actions_tbl[] = {
Returns the value of the style with the given name using the specified strategy. If a style with name does not exist, an empty string is returned.
Possible value for <style_resolve_strategy> are:
[pre]
- CascadedStyle - the property's value is determined using the rules defined in the document's stylesheet. This is the default strategy.
- InlineStyle - the property's value is determined by element definition, without respecting CSS rules.
- ComputedStyle - the property's value is determined by the style property resolved from the environment.
+ CascadedStyle - the property's value is determined using the rules defined in the document's stylesheet. [b]This is the default strategy[/b].
+ InlineStyle - the property's value is determined by element definition, without respecting CSS rules.
+ ComputedStyle - the property's value is determined by the style property resolved from the environment.
[/pre]
!fn: pixmap $makePreview()
Returns a 212x142 thumbnail of the current webView constants.
@@ -305,7 +305,6 @@ const char * const actions_tbl[] = {
This signal is emitted by the default implementation of [classfnc:webview]downloadCompletedEvent[/classfnc]().
*/
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_webView,"webview","widget")
// page related
diff --git a/src/modules/objects/KvsObject_widget.cpp b/src/modules/objects/KvsObject_widget.cpp
index bee2b9fa5..79aeb42c1 100644
--- a/src/modules/objects/KvsObject_widget.cpp
+++ b/src/modules/objects/KvsObject_widget.cpp
@@ -176,6 +176,7 @@ const char * const widgettypes_tbl[] = {
#define QT_WIDGET_CLICKFOCUS Qt::ClickFocus
#define QT_WIDGET_STRONGFOCUS Qt::StrongFocus
#define QT_WIDGET_NOFOCUS Qt::NoFocus
+
/*
@doc: widget
@keyterms:
@@ -202,7 +203,8 @@ const char * const widgettypes_tbl[] = {
Repaints the widget directly by calling [classfnc]$paintEvent[/classfnc]() immediately.
!fn: $update([<x:ingeter>,<y:integer>,<width:integer>,<height:integer>])
Updates entirely the widget or a rectangle.
- This function does not cause an immediate [classfnc]$paintEvent[/classfnc](); instead it schedules a paint event for processing when KVIrc returns to the main event loop.
+ This function does not cause an immediate [classfnc]$paintEvent[/classfnc]();
+ instead it schedules a paint event for processing when KVIrc returns to the main event loop.
!fn: $x()
Returns the x coordinate of the upper-left corner
of this widget relative to the parent widget,
@@ -247,7 +249,7 @@ const char * const widgettypes_tbl[] = {
Changes the widget's width to <width> and height to <height>.
See also [classfnc]$setGeometry[/classfnc]().
!fn: $isEnabled()
- Returns '1' if the widget is enabled, '0' otherwise.
+ Returns [b]1[/b] if the widget is enabled, and [b]0[/b] otherwise.
See also [classfnc:widget]$setEnabled[/classfnc]().
!fn: $setEnabled(<bool>)
Sets the widget state to enabled or disabled if <bool> is 1 or 0 respectively.
@@ -260,13 +262,12 @@ const char * const widgettypes_tbl[] = {
!fn: $windowTitle()
Returns the title text of this widget.
!fn: $isTopLevel()
- Returns '1' if this widget is a toplevel (parentless) one,
- '0' otherwise.
+ Returns [b]1[/b] if this widget is a toplevel (parentless) one, and [b]0[/b] otherwise.
!fn: $isVisible()
- Returns '1' if this widget is currently visible (read: is managed
+ Returns [b]1[/b] if this widget is currently visible (read: is managed
by the window manager and displayed by the X server; the widget
may be hidden behind other widgets). If the widget is not visible
- this function returns '0'.
+ this function returns [b]0[/b].
See also [classfnc]$show[/classfnc]() and [classfnc]$hide[/classfnc]().
!fn: $raise()
Moves this widget to the top of the stack of the widgets relative
@@ -275,13 +276,13 @@ const char * const widgettypes_tbl[] = {
Moves this widget to the bottom of the stack of the widgets relative
to its parent. See also [classfnc]$raise[/classfnc]
!fn: $hasFocus()
- Returns '1' if this widget has the keyboard focus.
+ Returns [b]1[/b] if this widget has the keyboard focus.
See also [classfnc]$setFocus[/classfnc].
!fn: $setFocus()
Sets this widget to be the one that receives keyboard events.
See also [classfnc]$hasFocus[/classfnc]
!fn: $parentWidget()
- Returns the object ID of the parent widget, or '0' if this
+ Returns the object ID of the parent widget, or [b]0[/b] if this
widget is a toplevel one.
!fn: $backgroundColor()
Returns the background color of this widget in hexadecimal
@@ -317,33 +318,33 @@ const char * const widgettypes_tbl[] = {
HTML-like format.
See also [classfnc]$setForegroundColor[/classfnc].
!fn: $setMouseTracking(<bool>)
- Enables or disables the mouse tracking if <bool> is '1' or '0' respectively.
+ Enables or disables the mouse tracking if <bool> is [b]1[/b] or [b]0[/b] respectively.
When mouse tracking is enabled you will receive mouse move events
even if no button is pressed, otherwise you will receive it only
when a mouse button is being pressed (so after a mousePressEvent).
!fn: $mousePressEvent(<button>,<x>,<y>)
This function is called when a mouse button is pressed while
- the cursor is in this widget. <button> is 0 if the pressed button
- is the left one, 1 if the button is the right one and 2 if it is the middle one.
+ the cursor is in this widget. <button> is [b]0[/b] if the pressed button
+ is the left one, [b]1[/b] if the button is the right one and [b]2[/b] if it is the middle one.
The <x> and <y> coordinates are relative to this widget upper-left corner
and are expressed in pixels.
- If you call "[cmd]setreturn[/cmd] 1" you will stop the internal processing
+ If you call i][cmd]setreturn[/cmd] [b]1[/b][/i] you will stop the internal processing
of this event. The default implementation does nothing.
!fn: $mouseReleaseEvent(<button>,<x>,<y>)
This function is called when a mouse button is released while
- the cursor is in this widget. <button> is 0 if the released button
- is the left one, 1 if the button is the right one and 2 if it is the middle one.
+ the cursor is in this widget. <button> is [b]0[/b]if the released button
+ is the left one, [b]1[/b] if the button is the right one and [b]2[/b] if it is the middle one.
The <x> and <y> coordinates are relative to this widget upper-left corner
and are expressed in pixels.
- If you call "[cmd]setreturn[/cmd] 1" you will stop the internal processing
+ If you call [i][cmd]setreturn[/cmd] [b]1[/b][/i] you will stop the internal processing
of this event. The default implementation does nothing.
!fn: $mouseDoubleClickEvent(<button>,<x>,<y>)
This function is called when a mouse button is double clicked while
- the cursor is in this widget. <button> is 0 if the double clicked button
- is the left one, 1 if the button is the right one and 2 if it is the middle one.
+ the cursor is in this widget. <button> is [b]0[/b]if the double clicked button
+ is the left one, [b]1[/b] if the button is the right one and [b]2[/b] if it is the middle one.
The <x> and <y> coordinates are relative to this widget upper-left corner
and are expressed in pixels.
- If you call "[cmd]setreturn[/cmd] 1" you will stop the internal processing
+ If you call [i][cmd]setreturn[/cmd] [b]1[/b][/i] you will stop the internal processing
of this event. The default implementation does nothing.
!fn: $mouseMoveEvent(<x>,<y>)
This function is called when the mouse cursor moves inside this widget.
@@ -415,15 +416,15 @@ const char * const widgettypes_tbl[] = {
This function sets widget flags, given as parameters.
Valid flags are:
[pre]
- TopLevel - indicates that this widget is a top-level widget[br]
- Dialog - indicates that this widget is a top-level window that should be decorated as a dialog[br]
- Desktop - indicates that this widget is the desktop[br]
- Popup - indicates that this widget is a popup top-level window[br]
- Title - gives the window a title bar[br]
- StaysOnTop - window stays on top [br]
- SysMenu - add a windows system menu[br]
- Minimize - add a minimize button for the sysmenu style[br]
- Maximize - add a maximixe button for the sysmenu style[br]
+ TopLevel - indicates that this widget is a top-level widget[br]
+ Dialog - indicates that this widget is a top-level window that should be decorated as a dialog[br]
+ Desktop - indicates that this widget is the desktop[br]
+ Popup - indicates that this widget is a popup top-level window[br]
+ Title - gives the window a title bar[br]
+ StaysOnTop - window stays on top [br]
+ SysMenu - add a windows system menu[br]
+ Minimize - add a minimize button for the sysmenu style[br]
+ Maximize - add a maximize button for the sysmenu style[br]
[/pre]
!fn: $centerToScreen()
Centers the window on the screen (useful only for toplevel widgets).[br]
@@ -432,48 +433,48 @@ const char * const widgettypes_tbl[] = {
Sets the way the widget accepts keyboard focus.[br]
Valid parameters are:
[pre]
- - TabFocus; (widget accepts keyboard focus by tabbing)[br]
- - ClickFocus; (widget accepts keyboard focus by clicking)[br]
- - StrongFocus; (widget accepts both tabbing/clicking)[br]
- - No Focus; (widget does not accept focus at all; this is the default value)[br]
+ - TabFocus; (widget accepts keyboard focus by tabbing)[br]
+ - ClickFocus; (widget accepts keyboard focus by clicking)[br]
+ - StrongFocus; (widget accepts both tabbing/clicking)[br]
+ - No Focus; (widget does not accept focus at all; this is the default value)[br]
[/pre]
!fn: $keyPressEvent(<key>)
If widget accepts keyboard focus (see [classfnc]$setFocusPolicy[/classfnc] ) this function handles for keys;
In its argument the key pressed.[br]
Special keys are:
[pre]
- - Return [br]
- - Enter [br]
- - Down (cursor arrow down) [br]
- - Up (cursor arrow up) [br]
- - Left (cursor arrow left) [br]
- - Right (cursor arrow right) [br]
- - Shift [br]
- - Ctrl [br]
- - Alt [br]
- - CapsLock [br]
- - Backspace [br]
- - Del [br]
- - Esc [br]
- - 0 [br]
- - 1 [br]
- - 2 [br]
- - 3 [br]
- - 4 [br]
- - 5 [br]
- - 6 [br]
- - 7 [br]
- - 8 [br]
- - 9 [br]
- - + [br]
- - - [br]
- - * [br]
- - / [br]
- - ( [br]
- - ) [br]
- - = [br]
- - . [br]
- - ^ [br]
+ - Return [br]
+ - Enter [br]
+ - Down (cursor arrow down) [br]
+ - Up (cursor arrow up) [br]
+ - Left (cursor arrow left) [br]
+ - Right (cursor arrow right) [br]
+ - Shift [br]
+ - Ctrl [br]
+ - Alt [br]
+ - CapsLock [br]
+ - Backspace [br]
+ - Del [br]
+ - Esc [br]
+ - 0 [br]
+ - 1 [br]
+ - 2 [br]
+ - 3 [br]
+ - 4 [br]
+ - 5 [br]
+ - 6 [br]
+ - 7 [br]
+ - 8 [br]
+ - 9 [br]
+ - + [br]
+ - - [br]
+ - * [br]
+ - / [br]
+ - ( [br]
+ - ) [br]
+ - = [br]
+ - . [br]
+ - ^ [br]
[/pre]
!fn: $mapFromGlobal(<x>,<y>)
Translates the global screen coordinate pos to widget coordinates.
@@ -485,40 +486,42 @@ const char * const widgettypes_tbl[] = {
Return the y coordinate of the mo>use pointer global position.
!fn: <tip:string> $maybeTipEvent(<x_tip_pos:integer>,<y_tip_pos:integer>)
This event handler is called when an eventual tip is going to be show.
- You can be reimplement this event and set a dynamic tool tip by using "[cmd]return[/cmd] <tooltip_string>".
- If a tooltip has setted with [classfnc]$setTooltip[/classfnc] the dynamic tooltip will be ignored.
+ You can be reimplement this event and set a dynamic tool tip by using [i][cmd]return[/cmd] <tooltip_string>[/i].
+ If a tooltip was set with [classfnc]$setTooltip[/classfnc] the dynamic tooltip will be ignored.
The default implementation does nothing.
!fn: integer $setAttribute(<string>,<bool_flag>)
- Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.
- Valid attributes are:
- OpaquePaintEvent - Indicates that the widget paints all its pixels when it receives a paint event.
- NoSystemBackground - Indicates that the widget has no background, i.e. when the widget receives paint events, the background is not automatically repainted.
- PaintOnScreen - Indicates that the widget wants to draw directly onto the screen.
- NoMousePropagation - Prohibits mouse events from being propagated to the widget's parent.
+ Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.[br]
+ Valid attributes are:[br]
+ [pre]
+ OpaquePaintEvent - Indicates that the widget paints all its pixels when it receives a paint event.
+ NoSystemBackground - Indicates that the widget has no background, i.e. when the widget receives paint events, the background is not automatically repainted.
+ PaintOnScreen - Indicates that the widget wants to draw directly onto the screen.
+ NoMousePropagation - Prohibits mouse events from being propagated to the widget's parent.
+ [/pre]
!fn: $setStyleSheet(<string>)
Set a style sheet for this widget.
!fn: $customContextMenuRequestedEvent(<x_mouse_pos:integer>,<y_mouse_pos:integer>)
This event is triggered when the user has requested a context menu on the widget (i.e. right clicking on the widget).
The x,y coordinates are widget relative.
!fn: $array(<red:integer,green:integer,blue:integer) $colorPalette(<color_role:string><color_group:string>)
- Returns the color in color_group(disabled, active or inactive), used for color_role.
+ Returns the color in color_group(disabled, active or inactive), used for color_role.[br]
Valid color role are:
- Window - A general background color.
- WindowText - A general foreground color.
- Base - Used as the background color for text.
- Text - Used as foreground color for the text.
- Button - The general button background color.
- ButtonText - A foreground color used with the Button color.
- Highlight - A color to indicate a selected item or the current item.
- HighlightedText - A text color that contrasts with Highlight.
-
+ [pre]
+ Window - A general background color.
+ WindowText - A general foreground color.
+ Base - Used as the background color for text.
+ Text - Used as foreground color for the text.
+ Button - The general button background color.
+ ButtonText - A foreground color used with the Button color.
+ Highlight - A color to indicate a selected item or the current item.
+ HighlightedText - A text color that contrasts with Highlight.
+ [/pre]
!fn: <short_cut_id:integer> $setKeyShortCut(<key:char>)
Adds a shortcut with key. A [classfnc]$shortCutEvent[/classfnc] will be triggered when the user will press alt+key.
!fn: $shortCutEvent(<shortcut_id:integer>)
This function will be called when a shortcut key has been triggered.
You must reimplement this event to manage a shortcut system in a custom widget.
The default implementation does nothing.
-
!fn: $insertIntoStatusBar(<index:unsigned integer>)
Insert the widget into the statusbar at the given index.
If index is out of range, the widget is appended.
@@ -528,7 +531,7 @@ const char * const widgettypes_tbl[] = {
@examples:
[example]
%widget = $new(widget)
- # This is the main container for other elements.
+ [comment]# This is the main container for other elements.[/comment]
%widget->$setWindowTitle("This is the widget title")
@@ -572,9 +575,6 @@ const char * const widgettypes_tbl[] = {
[/example]
*/
-
-
-
//
// If you never call c->error(), c->warning() (your function never fails)
// and never call a function that can call c->error() or c->warning()
@@ -605,10 +605,6 @@ const char * const widgettypes_tbl[] = {
// return no errors and results that have to be assumed
// as invalid (this allows the minimum overhead: if widget()
-//=============================================================================================================
-
-
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_widget,"widget","object")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setParent)
// apparence
diff --git a/src/modules/objects/KvsObject_window.cpp b/src/modules/objects/KvsObject_window.cpp
index eb7fab173..2f45829b7 100644
--- a/src/modules/objects/KvsObject_window.cpp
+++ b/src/modules/objects/KvsObject_window.cpp
@@ -90,16 +90,15 @@ QPixmap * KviKvsScriptWindowWindow::myIconPtr()
@description:
This class represents a window in a KVIrc frame.
Regardless of the parent object passed, the window will be always
- a "physical" child of the frame window: you can't embed a window object
- inside a widget or another window. The parent object will just "own" this
+ a [i]physical[/i] child of the frame window: you can't embed a window object
+ inside a widget or another window. The parent object will just [i]own[/i] this
window object and eventually destroy it when it dies.
This class can manage only a single central child widget that must
be set with $setCentralWidget().
- The central widget MUST be set before you initially call show()
+ The central widget [b]must[/b] be set before you initially call show()
@functions:
*/
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_window,"window","widget")
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_window,setWindowTitle)
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_window,setIcon)
diff --git a/src/modules/objects/KvsObject_workspace.cpp b/src/modules/objects/KvsObject_workspace.cpp
index 52ece77fb..3ec7346fa 100644
--- a/src/modules/objects/KvsObject_workspace.cpp
+++ b/src/modules/objects/KvsObject_workspace.cpp
@@ -72,101 +72,99 @@
!fn: $activateNextWindow()
Activates the next window in the child window chain.
!fn: $activatePrevWindow()
- Activates the previous window in the child window chain.[br]
+ Activates the previous window in the child window chain.
@examples:
[example]
- [comment]
- //Let's start.
- //We start the main class creation, in the constructor we do the
- //widget's showing, to give a particular pop-up
- //creation appearance.
- [/comment]
- class (ws,widget)[br]
- {[br]
- constructor[br]
- {[br]
- $$->$setGeometry(%X,%Y,100,100)[br](KviKvsObjectFunctionCall *c
- $$->%label=$new(label,$$)[br]
- $$->%label->$settext("Another class by N\&G")[br]
- $$->%label->$setautoresize(1)[br]
- $$->$show()[br]
- }[br]
- }[br]
- [comment]//We create the new workspace, and we set a 640x480 size with widget $resize command[/comment][br]
- %Workspace=$new(workspace)[br]
- %Workspace->$resize(640,480)[br]
- [comment]
- //Now we make a cycling construction of the widgets(look at the class),
- //and give to the widgets a random X and Y coordinates.
- //It takes few seconds to show the effects, be patient.
- [/comment]
- %I=0[br]
- while (%I<100)[br]
- {[br]
- %X=$rand(500)[br]
- %Y=$rand(480)[br]
- %Widget=$new(ws,%Workspace)[br]
- %I++[br]
- }[br]
- [comment]//Let's show the fireworks! EnJoY![/comment]
- %Workspace->$show()[br]
+ [comment]# Let's start.
+ # We start the main class creation, in the constructor we do the
+ # widget's showing, to give a particular popup
+ # creation appearance.
+ [/comment]
+ class (ws,widget)
+ {
+ constructor
+ {
+ $$->$setGeometry(%X,%Y,100,100)[br](KviKvsObjectFunctionCall *c
+ $$->%label=$new(label,$$)
+ $$->%label->$settext("Another class by N\&G")
+ $$->%label->$setautoresize(1)
+ $$->$show()
+ }
+ }
+ [comment]# We create the new workspace, and we set a 640x480 size with widget $resize command[/comment]
+ %Workspace=$new(workspace)
+ %Workspace->$resize(640,480)
+ [comment]# Now we make a cycling construction of the widgets (look at the class),
+ # and give to the widgets a random X and Y coordinates.
+ # It takes few seconds to show the effects, be patient.
+ [/comment]
+ %I=0
+ while (%I<100)
+
+ %X=$rand(500)
+ %Y=$rand(480)
+ %Widget=$new(ws,%Workspace)
+ %I++
+ }
+ [comment]# Let's show the fireworks! EnJoY![/comment]
+ %Workspace->$show()
[/example]
+ [b]Example 2:[/b]
[example]
- [b]Example 2:[/b]
- [comment]//This is like the first example but it has a particular animation effect.[/comment]
- %Hex[]=$array(0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)[br]
- class (ws,widget)[br]
- {[br]
- constructor[br]
- {[br]
- $$->$setGeometry(%X,%Y,100,100)[br]
- $$->%lay=$new(layout,$$)[br]
- %i=0[br]
- while (%i<10)[br]
- {[br]
- $$->%label=$new(label,$$)[br]
- $$->%label->$settext("Another class by N\&G")[br]
- %color=%Hex[$rand(15)]%Hex[$rand(15)]%Hex[$rand(15)]%Hex[$rand(15)]%Hex[$rand(15)]%Hex[$rand(15)][br]
- $$->%label->$setforegroundcolor(%color)[br]
- $$->%label->$setautoresize(1)[br]
- $$->%lay->$addwidget($$->%label,%i,0)[br]
- %i++;[br]
- }[br]
- $$->$show()[br]
- }[br]
- mousepressevent[br]
- {[br]
- if ($istimer(cycle) == 1) killtimer cycle[br]
- }[br]
- }[br]
- %Workspace=$new(workspace)[br]
- %Workspace->$resize(640,480)[br]
- %Workspace->$setWindowTitle("Hit the mouse to stop cycling windows...")[br]
- %I=0[br]
- %Cycle=1[br]
- while (%I<20)[br]
- {[br]
- %X=$rand(500)[br]
- %Y=$rand(480)[br]
- %Widget=$new(ws,%Workspace)[br]
- %I++[br]
- }[br]
- %Workspace->$show[br]
- timer (cycle,3000)[br]
- {[br]
- if (%Cycle==1) %Workspace->$tile()[br]
- if (%Cycle==2)[br]
- {[br]
- %Workspace->$cascade()[br]
- %Cycle=1[br]
- return[br]
- }[br]
- %Cycle++[br]
- }[br]
- privateimpl(%Workspace,mousepressevent)[br]
- {[br]
- if ($istimer(cycle) == 1) killtimer cycle[br]
- }[br]
+ [comment]# This is like the first example but it has a particular animation effect.[/comment]
+ %Hex[]=$array(0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)
+ class (ws,widget)
+ {
+ constructor
+ {
+ $$->$setGeometry(%X,%Y,100,100)
+ $$->%lay=$new(layout,$$)
+ %i=0
+ while (%i<10)
+ {
+ $$->%label=$new(label,$$)
+ $$->%label->$settext("Another class by N\&G")
+ %color=%Hex[$rand(15)]%Hex[$rand(15)]%Hex[$rand(15)]%Hex[$rand(15)]%Hex[$rand(15)]%Hex[$rand(15)]
+ $$->%label->$setforegroundcolor(%color)
+ $$->%label->$setautoresize(1)
+ $$->%lay->$addwidget($$->%label,%i,0)
+ %i++;
+ }
+ $$->$show()
+ }
+ mousepressevent
+ {
+ if ($istimer(cycle) == 1) killtimer cycle
+ }
+ }
+ %Workspace=$new(workspace)
+ %Workspace->$resize(640,480)
+ %Workspace->$setWindowTitle("Hit the mouse to stop cycling windows...")
+ %I=0
+ %Cycle=1
+ while (%I<20)
+ {
+ %X=$rand(500)
+ %Y=$rand(480)
+ %Widget=$new(ws,%Workspace)
+ %I++
+ }
+ %Workspace->$show
+ timer (cycle,3000)
+ {
+ if (%Cycle==1) %Workspace->$tile()
+ if (%Cycle==2)
+ {
+ %Workspace->$cascade()
+ %Cycle=1
+ return
+ }
+ %Cycle++
+ }
+ privateimpl(%Workspace,mousepressevent)
+ {
+ if ($istimer(cycle) == 1) killtimer cycle
+ }
[/example]
*/
diff --git a/src/modules/objects/KvsObject_wrapper.cpp b/src/modules/objects/KvsObject_wrapper.cpp
index 0faaed22b..2e73a61a1 100644
--- a/src/modules/objects/KvsObject_wrapper.cpp
+++ b/src/modules/objects/KvsObject_wrapper.cpp
@@ -35,7 +35,6 @@
#include "KviApplication.h"
#include "KviMainWindow.h"
-
/*
@doc: wrapper
@keyterms:
@@ -50,144 +49,112 @@
[class]object[/class]
[class]widget[/class]
@description:
- [p]
This class "wraps" existing KVIrc widgets and allows using the [class]widget[/class]
class API to manipulate them. You can use it, for example, to set the geometry of the
- KVIrc main window or to apply some crazy graphical changes to the UI.
- [/p]
- [p]
+ KVIrc main window or to apply some crazy graphical changes to the UI.[br]
The KVIrc Qt widgets are arranged in trees (just as the objects). The difference is that there can be more than one
- toplevel widget and so more than one tree. You can use [fnc]$objects.dump()[/fnc] to take a look at the KVIrc Qt objects tree.
- [/p]
- [p]
+ toplevel widget and so more than one tree. You can use [fnc]$objects.dump()[/fnc] to take a look at the KVIrc Qt objects tree.[br]
Here is a part of the tree:
- [/p]
[example]
- Ptr 23786128: top level object: kvirc_frame, class KviMainWindow, visible, rect = 1678, -3, 1680, 1030
- >Ptr 23496976: object: qt_rubberband, class QRubberBand
- >Ptr 23536608: object: main_frame_splitter, class QSplitter
- >>Ptr 23795232: object: mdi_manager, class KviWindowStack
- >>>Ptr 23863200: object: qt_scrollarea_hcontainer, class QWidget
- >>>>Ptr 23418224: object: , class QScrollBar
- >>>Ptr 23864832: object: qt_scrollarea_vcontainer, class QWidget
- >>>>Ptr 22383424: object: , class QScrollBar
- >>Ptr 25750832: object: mdi_manager, class KviWindowStack
- >>>Ptr 26112928: object: , class QWidget
- >>>>Ptr 45381568: object: , class Oxygen::MdiWindowShadow
- >>>>Ptr 45952496: object: mdi_child_Azzurra_#kvirc, class KviMdiChild
- >>>>>Ptr 43714656: object: #kvirc, class KviChannelWindow
- >Ptr 18004432: object: , class KviStatusBar
- >>Ptr 18007408: object: msgstatuslabel, class QLabel
- >>>Ptr 24067088: object: , class Oxygen::TransitionWidget
- >Ptr 24503248: object: windowlist, class KviTreeWindowList
- >>Ptr 24459744: object: qt_dockwidget_floatbutton, class QDockWidgetTitleButton
- >>Ptr 24498560: object: qt_dockwidget_closebutton, class QDockWidgetTitleButton
- >>Ptr 23996288: object: tree_windowlist, class KviTreeWindowListTreeWidget
+ Ptr 23786128: top level object: kvirc_frame, class KviMainWindow, visible, rect = 1678, -3, 1680, 1030
+ >Ptr 23496976: object: qt_rubberband, class QRubberBand
+ >Ptr 23536608: object: main_frame_splitter, class QSplitter
+ >>Ptr 23795232: object: mdi_manager, class KviWindowStack
+ >>>Ptr 23863200: object: qt_scrollarea_hcontainer, class QWidget
+ >>>>Ptr 23418224: object: , class QScrollBar
+ >>>Ptr 23864832: object: qt_scrollarea_vcontainer, class QWidget
+ >>>>Ptr 22383424: object: , class QScrollBar
+ >>Ptr 25750832: object: mdi_manager, class KviWindowStack
+ >>>Ptr 26112928: object: , class QWidget
+ >>>>Ptr 45381568: object: , class Oxygen::MdiWindowShadow
+ >>>>Ptr 45952496: object: mdi_child_Azzurra_#kvirc, class KviMdiChild
+ >>>>>Ptr 43714656: object: #kvirc, class KviChannelWindow
+ >Ptr 18004432: object: , class KviStatusBar
+ >>Ptr 18007408: object: msgstatuslabel, class QLabel
+ >>>Ptr 24067088: object: , class Oxygen::TransitionWidget
+ >Ptr 24503248: object: windowlist, class KviTreeWindowList
+ >>Ptr 24459744: object: qt_dockwidget_floatbutton, class QDockWidgetTitleButton
+ >>Ptr 24498560: object: qt_dockwidget_closebutton, class QDockWidgetTitleButton
+ >>Ptr 23996288: object: tree_windowlist, class KviTreeWindowListTreeWidget
[/example]
- [p]
As you can see the objects are identified by their names (for example "mdi_manager") and
- by their class names (for example KviChannelWindow).
- To wrap a specific widget you must provide a path in the tree composed of search specifiers.
- Each search specifier can have one of the following forms:
- [/p]
+ 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]
[example]
- (1) <class>
- (2) <class>::<name>
- (3) ::<name>
- (4) !Window::<window_identifier>
- (5) !Parent::N
+ (1) <class>
+ (2) <class>::<name>
+ (3) ::<name>
+ (4) !Window::<window_identifier>
+ (5) !Parent::N
[/example]
- [p]
- The first three forms may be preceded by the prefix '*' which will tell KVS to perform
- a recursive search from this point. Let's see some examples.
- [/p]
- [p]
- The form (1) matches the first widget with the specified class name. For instance:
- [/p]
+ 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]
[example]
- %Frame = $new(wrapper,0,test,KviMainWindow)
+ %Frame = $new(wrapper,0,test,KviMainWindow)
[/example]
- [p]
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.
- [/p]
+ any [class]widget[/class] or [class]object[/class] methods on it.[br]
[example]
- %Frame = $new(wrapper,0,test,KviMainWindow)
- %Frame->$setGeometry(20,20,400,400);
+ %Frame = $new(wrapper,0,test,KviMainWindow)
+ %Frame->$setGeometry(20,20,400,400);
[/example]
- [p]
- If you want to wrap the KVIrc status bar you can use a composite path:
- [/p]
+ If you want to wrap the KVIrc status bar you can use a composite path:[br]
[example]
- %StatusBar = $new(wrapper,0,test,KviMainWindow,KviStatusBar)
- %StatusBar->$setProperty(autoFillBackground,1)
- %StatusBar->$setBackgroundColor(80,80,0)
+ %StatusBar = $new(wrapper,0,test,KviMainWindow,KviStatusBar)
+ %StatusBar->$setProperty(autoFillBackground,1)
+ %StatusBar->$setBackgroundColor(80,80,0)
[/example]
- [p]
The form (2) matches both the class and the widget name. In this way you can differentiate
- between children that have the same class. For instance:
- [/p]
+ between children that have the same class.[br]
+ For instance:[br]
[example]
- %VerticalScrollBar = $new(wrapper,0,test,KviMainWindow,QSplitter,KviWindowStack,QWidget::qt_scrollarea_vcontainer,QScrollBar)
- %VerticalScrollBar->$setProperty(invertedAppearance,1);
+ %VerticalScrollBar = $new(wrapper,0,test,KviMainWindow,QSplitter,KviWindowStack,QWidget::qt_scrollarea_vcontainer,QScrollBar)
+ %VerticalScrollBar->$setProperty(invertedAppearance,1);
[/example]
- [p]
In this way KVS was able to pick the vertical scrollbar instead of the horizontal one (which comes first in the list).
- (Now try to move a window out of the MDI area: the vertical scroll bar will be inverted!).
- [/p]
- [p]
- The form (3) matches only the name and ignores the class. In our sample tree the following example is equivalent to the previous one.
- [/p]
+ (Now try to move a window out of the MDI area: the vertical scroll bar will be inverted!).[br]
+ The form (3) matches only the name and ignores the class.[br]
+ In our sample tree the following example is equivalent to the previous one.
[example]
- %VerticalScrollBar = $new(wrapper,0,test,KviMainWindow,QSplitter,KviWindowStack,::qt_scrollarea_vcontainer,QScrollBar)
- %VerticalScrollBar->$setProperty(invertedAppearance,1);
+ %VerticalScrollBar = $new(wrapper,0,test,KviMainWindow,QSplitter,KviWindowStack,::qt_scrollarea_vcontainer,QScrollBar)
+ %VerticalScrollBar->$setProperty(invertedAppearance,1);
[/example]
- [p]
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.
- In our sample tree the following would match the first widget with class KviChannelWindow.
- [/p]
+ 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]
[example]
- %Chan = $new(wrapper,0,test,*KviChannelWindow)
- %Chan->$setBackgroundColor(80,0,0);
+ %Chan = $new(wrapper,0,test,*KviChannelWindow)
+ %Chan->$setBackgroundColor(80,0,0);
[/example]
- [p]
- The following would match the first widget with name #kvirc
- [/p]
+ The following would match the first widget with name #kvirc[br]
[example]
- %Chan = $new(wrapper,0,test,*::#kvirc)
- %Chan->$setBackgroundColor(80,0,0);
+ %Chan = $new(wrapper,0,test,*::#kvirc)
+ %Chan->$setBackgroundColor(80,0,0);
[/example]
- [p]
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.
- [/p]
+ specifying a part of the path and then searching recursively.[br]
[example]
- %Chan = $new(wrapper,0,test,KviMainWindow,*::#kvirc)
- %Chan->$setBackgroundColor(80,0,0);
+ %Chan = $new(wrapper,0,test,KviMainWindow,*::#kvirc)
+ %Chan->$setBackgroundColor(80,0,0);
[/example]
- [p]
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.
- [/p]
+ without the need of looking it up in the tree.[br]
[example]
- %Win = $new(wrapper,0,test,!Window::$window)
- %Win->$setBackgroundColor(80,0,0);
+ %Win = $new(wrapper,0,test,!Window::$window)
+ %Win->$setBackgroundColor(80,0,0);
[/example]
- [p]
- Finally the last form allows you to jump N levels up in the tree. If N is omitted it is assumed to be 1.
- [/p]
+ Finally the last form allows you to jump N levels up in the tree.[br]
+ If N is omitted it is assumed to be 1.
[example]
- %Win = $new(wrapper,0,test,!Window::$window,!Parent::3)
- %Win->$setGeometry(10,10,40,40)
+ %Win = $new(wrapper,0,test,!Window::$window,!Parent::3)
+ %Win->$setGeometry(10,10,40,40)
[/example]
- [p]
Experiment with it :)
- [/p]
*/
-
-
KVSO_BEGIN_REGISTERCLASS(KvsObject_wrapper,"wrapper","widget")
KVSO_END_REGISTERCLASS(KvsObject_wrapper)
diff --git a/src/modules/objects/libkviobjects.cpp b/src/modules/objects/libkviobjects.cpp
index c862eed37..caf3f8a04 100644
--- a/src/modules/objects/libkviobjects.cpp
+++ b/src/modules/objects/libkviobjects.cpp
@@ -624,32 +624,32 @@ static bool objects_kvs_cmd_disconnect(KviKvsModuleCommandCall * c)
static bool objects_kvs_fnc_listObjects(KviKvsModuleFunctionCall * cmd)
{
-/*
- @doc: objects.dump
- @type:
- function
- @title:
- $objects.dump
- @keyterms:
- dump objects
- @short:
- Dump the KVIrc widgets.
- @syntax:
- <array> $objects.dump(<print:boolean>)
- @description:
- This function return an array containing a representation of the widgets tree in KVIrc;[br]
- If the <print> flag is enabled, the array will be printed in the current window, too.
- @examples:
- [example]
- %A[]=$objects.dump(0)
- %i=0
- while (%i != %A[]#)
- {
- echo %A[%i]
- %i++
- }
- [/example]
-*/
+ /*
+ @doc: objects.dump
+ @type:
+ function
+ @title:
+ $objects.dump
+ @keyterms:
+ dump objects
+ @short:
+ Dump the KVIrc widgets.
+ @syntax:
+ <array> $objects.dump(<print:boolean>)
+ @description:
+ This function return an array containing a representation of the widgets tree in KVIrc;[br]
+ If the <print> flag is enabled, the array will be printed in the current window, too.
+ @examples:
+ [example]
+ %A[]=$objects.dump(0)
+ %i=0
+ while (%i != %A[]#)
+ {
+ echo %A[%i]
+ %i++
+ }
+ [/example]
+ */
bool bFlag;
diff --git a/src/modules/perl/libkviperl.cpp b/src/modules/perl/libkviperl.cpp
index 3e8f3c834..9048d72cc 100644
--- a/src/modules/perl/libkviperl.cpp
+++ b/src/modules/perl/libkviperl.cpp
@@ -253,11 +253,11 @@
Note also that you must either escape the $ at the beginning of KVIrc identifiers
or use single quotes to prevent Perl from interpreting the $ as the beginning of a variable.
[example]
- [comment]// This will not work as expected[/comment]
+ [comment]# This will not work as expected[/comment]
[cmd]perl.begin[/cmd]
KVIrc::echo(KVIrc::eval("return $window.caption"));
[cmd]perl.end[/cmd]
- [comment]// But these will do[/comment]
+ [comment]# But these will do[/comment]
[cmd]perl.begin[/cmd]
KVIrc::echo(KVIrc::eval("return \$window.caption"));
KVIrc::echo(KVIrc::eval('return $window.caption'));
@@ -304,7 +304,7 @@
eval %tmp;
}
perlexec "/home/pragma/myperlscript.pl" "param1" "param2" "param3"
- [comment]// or even[/comment]
+ [comment]# or even[/comment]
[cmd]echo[/cmd] $perlexec("/home/pragma/computeprimelargerthan.pl","10000")
[/example]
[br]
@@ -543,7 +543,6 @@ static bool perl_kvs_cmd_destroy(KviKvsModuleCommandCall * c)
return true;
}
-
/*
@doc: perl.isAvailable
@type:
@@ -555,7 +554,7 @@ static bool perl_kvs_cmd_destroy(KviKvsModuleCommandCall * c)
@syntax:
$perl.isAvailable
@description:
- Returns 1 if the Perl scripting support is available and 0 otherwise.
+ Returns [b]1[/b] if the Perl scripting support is available and [b]0[/b] otherwise.
*/
static bool perl_kvs_fnc_isAvailable(KviKvsModuleFunctionCall * c)
diff --git a/src/modules/proxydb/libkviproxydb.cpp b/src/modules/proxydb/libkviproxydb.cpp
index e4a9c79ae..b5fa60f55 100644
--- a/src/modules/proxydb/libkviproxydb.cpp
+++ b/src/modules/proxydb/libkviproxydb.cpp
@@ -41,13 +41,14 @@ extern KVIRC_API KviProxyDataBase * g_pProxyDataBase;
$proxydb.protocol
@short:
Returns the protocol
- @synthax:
+ @syntax:
<string> $proxydb.protocol(<string:proxy>)
@description:
Returns the protocol of the proxy <proxy>
@seealso:
[module:serverdb]ServerDB module documentation[/module]
*/
+
static bool proxydb_kvs_fnc_protocol(KviKvsModuleFunctionCall * c)
{
QString szProxy, szProtocol;
@@ -128,13 +129,14 @@ static bool proxydb_kvs_fnc_protocol(KviKvsModuleFunctionCall * c)
$proxydb.hostname
@short:
Returns the hostname
- @synthax:
+ @syntax:
<string> $proxydb.hostname(<string:proxy>)
@description:
Returns the hostname of the proxy <proxy>
@seealso:
[module:serverdb]ServerDB module documentation[/module]
*/
+
PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_hostname,hostName,setString)
/*
@@ -145,13 +147,14 @@ PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_hostname,hostName,setString)
$proxydb.ip
@short:
Returns the IP
- @synthax:
+ @syntax:
<string> $proxydb.ip(<string:proxy>)
@description:
Returns the IP of the proxy <proxy>
@seealso:
[module:serverdb]ServerDB module documentation[/module]
*/
+
PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_ip,ip,setString)
/*
@@ -162,13 +165,14 @@ PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_ip,ip,setString)
$proxydb.password
@short:
Returns the password
- @synthax:
+ @syntax:
<string> $proxydb.password(<string:proxy>)
@description:
Returns the password of the proxy <proxy>, if set
@seealso:
[module:serverdb]ServerDB module documentation[/module]
*/
+
PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_password,pass,setString)
/*
@@ -179,7 +183,7 @@ PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_password,pass,setString)
$proxydb.username
@short:
Returns the username
- @synthax:
+ @syntax:
<string> $proxydb.username(<string:proxy>)
@description:
Returns the username of the proxy <proxy>, if set
@@ -196,13 +200,14 @@ PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_username,user,setString)
$proxydb.isIPv6
@short:
Returns the isIPv6
- @synthax:
+ @syntax:
<bool> $proxydb.isIPv6(<string:proxy>)
@description:
Returns true if the proxy <proxy> uses IPv6 sockets
@seealso:
[module:serverdb]ServerDB module documentation[/module]
*/
+
PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_isIPv6,isIPv6,setBoolean)
/*
@@ -213,13 +218,14 @@ PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_isIPv6,isIPv6,setBoolean)
$proxydb.port
@short:
Returns the port
- @synthax:
+ @syntax:
<bool> $proxydb.port(<string:proxy>)
@description:
Returns the port number of the proxy <proxy>
@seealso:
[module:serverdb]ServerDB module documentation[/module]
*/
+
PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_port,port,setInteger)
/*
@@ -238,29 +244,25 @@ PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_port,port,setInteger)
@switches:
!sw: -i | --ipv6
Use IPv6 socket to connect to the proxy.[br]
-
!sw: -p=<port> | --port=<port>
Use the port <port> to connect to the proxy.[br]
-
!sw: -q | --quiet
Do not print errors if the proxy already exist.[br]
-
!sw: -r=<protocol> | --protocol=<protocol>
Use the protocol <protocol> to connect to the proxy.[br]
-
!sw: -u=<user> | --user=<user>
Use the username <user> to connect to the proxy.[br]
-
!sw: -w=<password> | --password=<password>
Use password <password> to connect to the proxy.
@examples:
[example]
- [comment]Adds the proxy test.com on port 8080 using IPv6 sockets[/comment][br]
- proxydb.addProxy -i -p=8080 test.com
+ [comment]Adds the proxy test.com on port 8080 using IPv6 sockets[/comment][br]
+ proxydb.addProxy -i -p=8080 test.com
[/example]
@seealso:
[module:serverdb]ServerDB module documentation[/module]
*/
+
static bool proxydb_kvs_cmd_addProxy(KviKvsModuleCommandCall * c)
{
QString szProxy;
@@ -335,8 +337,8 @@ static bool proxydb_kvs_cmd_addProxy(KviKvsModuleCommandCall * c)
Do not print errors if the proxy already exist.[br]
@examples:
[example]
- [comment]Sets the port 8080 for the proxy test.com[/comment][br]
- proxydb.setPort test.com 8080
+ [comment]Sets the port 8080 for the proxy test.com[/comment][br]
+ proxydb.setPort test.com 8080
[/example]
@seealso:
[module:serverdb]ServerDB module documentation[/module]
@@ -400,20 +402,21 @@ static bool proxydb_kvs_cmd_setPort(KviKvsModuleCommandCall * c)
Do not print errors if the proxy already exist.[br]
@examples:
[example]
- [comment]Sets the IPv4 (format a.b.c.d) for the proxy test.com[/comment][br]
- proxydb.setIp test.com 1.2.3.4[br]
- [comment]Sets the extended IPv6 (format a:b:c:d:e:f:g:h) for the proxy text.com[/comment][br]
- proxydb.setIp test.com 1:2:3:4:5:6:7:8[br]
- [comment]Sets the compressed IPv6 (format a:b:...::h) for the proxy text.com[/comment][br]
- proxydb.setIp test.com 1:2:3:4::8[br]
- [comment]Sets the IPv4 mapped IPv6 (format a:b:c:d:e:f:w.x.y.z) for the proxy text.com[/comment][br]
- proxydb.setIp test.com 1:2:3:4:5:6:9.8.7.6[br]
- [comment]Sets the compressed IPv4 mapped IPv6 (a::b:w.x.y.z) for the proxy text.com[/comment][br]
- proxydb.setIp test.com 1::6:9.8.7.6
+ [comment]Sets the IPv4 (format a.b.c.d) for the proxy test.com[/comment][br]
+ proxydb.setIp test.com 1.2.3.4[br]
+ [comment]Sets the extended IPv6 (format a:b:c:d:e:f:g:h) for the proxy text.com[/comment][br]
+ proxydb.setIp test.com 1:2:3:4:5:6:7:8[br]
+ [comment]Sets the compressed IPv6 (format a:b:...::h) for the proxy text.com[/comment][br]
+ proxydb.setIp test.com 1:2:3:4::8[br]
+ [comment]Sets the IPv4 mapped IPv6 (format a:b:c:d:e:f:w.x.y.z) for the proxy text.com[/comment][br]
+ proxydb.setIp test.com 1:2:3:4:5:6:9.8.7.6[br]
+ [comment]Sets the compressed IPv4 mapped IPv6 (a::b:w.x.y.z) for the proxy text.com[/comment][br]
+ proxydb.setIp test.com 1::6:9.8.7.6
[/example]
@seealso:
[module:serverdb]ServerDB module documentation[/module]
*/
+
static bool proxydb_kvs_cmd_setIp(KviKvsModuleCommandCall * c)
{
QString szProxy, szIp;
@@ -476,12 +479,13 @@ static bool proxydb_kvs_cmd_setIp(KviKvsModuleCommandCall * c)
Do not print errors if the proxy already exist.[br]
@examples:
[example]
- [comment]Sets the IPv6 sockets for the proxy test.com[/comment][br]
- proxydb.setIPv6 test.com $true
+ [comment]Sets the IPv6 sockets for the proxy test.com[/comment][br]
+ proxydb.setIPv6 test.com $true
[/example]
@seealso:
[module:serverdb]ServerDB module documentation[/module]
*/
+
static bool proxydb_kvs_cmd_setIPv6(KviKvsModuleCommandCall * c)
{
QString szProxy;
@@ -532,12 +536,13 @@ static bool proxydb_kvs_cmd_setIPv6(KviKvsModuleCommandCall * c)
Do not print errors if the proxy already exist.[br]
@examples:
[example]
- [comment]Sets the protocol Socks5 for the proxy test.com[/comment][br]
- proxydb.setProtocol test.com Socks5
+ [comment]Sets the protocol Socks5 for the proxy test.com[/comment][br]
+ proxydb.setProtocol test.com Socks5
[/example]
@seealso:
[module:serverdb]ServerDB module documentation[/module]
*/
+
static bool proxydb_kvs_cmd_setProtocol(KviKvsModuleCommandCall * c)
{
QString szProxy, szProtocol;
@@ -637,12 +642,13 @@ static bool proxydb_kvs_cmd_setProtocol(KviKvsModuleCommandCall * c)
Do not print errors if the proxy already exist.[br]
@examples:
[example]
- [comment]Sets the hostname test1.com for the proxy test.com[/comment][br]
- proxydb.setHostname test.com test1.com
+ [comment]Sets the hostname test1.com for the proxy test.com[/comment][br]
+ proxydb.setHostname test.com test1.com
[/example]
@seealso:
[module:serverdb]ServerDB module documentation[/module]
*/
+
PROXYDB_SET_PROPERTY(proxydb_kvs_cmd_setHostname,setHostname)
/*
@@ -662,12 +668,13 @@ PROXYDB_SET_PROPERTY(proxydb_kvs_cmd_setHostname,setHostname)
Do not print errors if the proxy already exist.[br]
@examples:
[example]
- [comment]Sets the password test for the proxy test.com[/comment][br]
- proxydb.setPass test.com test
+ [comment]Sets the password test for the proxy test.com[/comment][br]
+ proxydb.setPass test.com test
[/example]
@seealso:
[module:serverdb]ServerDB module documentation[/module]
*/
+
PROXYDB_SET_PROPERTY(proxydb_kvs_cmd_setPass,setPass)
/*
@@ -687,12 +694,13 @@ PROXYDB_SET_PROPERTY(proxydb_kvs_cmd_setPass,setPass)
Do not print errors if the proxy already exist.[br]
@examples:
[example]
- [comment]Sets the username kvirc for the proxy test.com[/comment][br]
- proxydb.setUser test.com kvirc
+ [comment]Sets the username KVIrc for the proxy test.com[/comment][br]
+ proxydb.setUser test.com kvirc
[/example]
@seealso:
[module:serverdb]ServerDB module documentation[/module]
*/
+
PROXYDB_SET_PROPERTY(proxydb_kvs_cmd_setUser,setUser)
static bool proxydb_module_init(KviModule * m)
diff --git a/src/modules/python/libkvipython.cpp b/src/modules/python/libkvipython.cpp
index f322cba00..7d99636d5 100644
--- a/src/modules/python/libkvipython.cpp
+++ b/src/modules/python/libkvipython.cpp
@@ -517,7 +517,7 @@ static bool python_kvs_cmd_destroy(KviKvsModuleCommandCall * c)
@syntax:
$python.isAvailable
@description:
- Returns 1 if the Python scripting support is available and 0 otherwise.
+ Returns [b]1[/b] if the Python scripting support is available and [b]0[/b] otherwise.
*/
static bool python_kvs_fnc_isAvailable(KviKvsModuleFunctionCall * c)
{
diff --git a/src/modules/regchan/libkviregchan.cpp b/src/modules/regchan/libkviregchan.cpp
index c8545cbc2..35d0bf529 100644
--- a/src/modules/regchan/libkviregchan.cpp
+++ b/src/modules/regchan/libkviregchan.cpp
@@ -346,7 +346,7 @@ static bool regchan_kvs_fnc_property(KviKvsModuleFunctionCall * c)
<boolean> $regchan.match(<channel_name:string>,<network:string>)
@description:
Returns 1 if <channel_name> and <network> match a registered channel entry
- and 0 otherwise.
+ and [b]0[/b] otherwise.
@examples:
[example]
echo $regchan.match(#kvirc,IRCNet)
@@ -380,8 +380,8 @@ static bool regchan_kvs_fnc_match(KviKvsModuleFunctionCall * c)
@syntax:
<boolean> $regchan.find(<channel_name:string>,<netmask:string>)
@description:
- Returns 1 if the channel identified by <channel_name> and <netmask>
- is registered and 0 otherwise. This function is similar to $regchan.match
+ Returns [b]1[/b] if the channel identified by <channel_name> and <netmask>
+ is registered and [b]0[/b] otherwise. This function is similar to $regchan.match
but for $regchan.find the second parameter is the exact netmask
of the registered channel entry.
@examples:
diff --git a/src/modules/serverdb/libkviserverdb.cpp b/src/modules/serverdb/libkviserverdb.cpp
index 3977bd03d..823c6df4d 100644
--- a/src/modules/serverdb/libkviserverdb.cpp
+++ b/src/modules/serverdb/libkviserverdb.cpp
@@ -109,7 +109,7 @@ extern KVIRC_API KviIrcServerDataBase * g_pServerDataBase;
<bool> $serverdb.networkExists(<network_name:string>)
@description:
Checks if the network already exists in the DB.[br]
- It returns 1 if the network exists, 0 otherwise.
+ It returns [b]1[/b] if the network exists, and [b]0[/b] otherwise.
@seealso:
[module:serverdb]ServerDB module documentation[/module]
*/
@@ -151,7 +151,7 @@ static bool serverdb_kvs_fnc_networkExists(KviKvsModuleFunctionCall * c)
@description:
Checks if the server already exists for a network in the DB.[br]
If no network name is provided, the check is made globally.[br]
- It returns 1 if the server exists, 0 otherwise
+ It returns 1 if the server exists, and [b]0[/b] otherwise
@seealso:
[module:serverdb]ServerDB module documentation[/module]
*/
@@ -434,7 +434,7 @@ SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkLoginCommand,onLoginComman
@doc: serverdb.networkName
@type:
function
- @title:
+ @title:
$serverdb.networkName
@short:
Returns the name
diff --git a/src/modules/str/libkvistr.cpp b/src/modules/str/libkvistr.cpp
index 2fe470df8..83bafc5d9 100644
--- a/src/modules/str/libkvistr.cpp
+++ b/src/modules/str/libkvistr.cpp
@@ -291,11 +291,11 @@ static bool str_kvs_fnc_localeupcase(KviKvsModuleFunctionCall * c)
@title:
$str.isnumber
@short:
- Returns 1 if the given string represents a number
+ Returns [b]1[/b] if the given string represents a number
@syntax:
<bool> $str.isnumber(<givenstring:string>)
@description:
- Returns 1 if the given string represents a number, 0 if not.
+ Returns [b]1[/b] if the given string represents a number, and [b]0[/b] otherwise.
*/
static bool str_kvs_fnc_isnumber(KviKvsModuleFunctionCall * c)
{
@@ -316,11 +316,11 @@ static bool str_kvs_fnc_isnumber(KviKvsModuleFunctionCall * c)
@title:
$str.isunsignednumber
@short:
- Returns 1 if the given string represents an unsigned number
+ Returns [b]1[/b] if the given string represents an unsigned number
@syntax:
<bool> $str.isunsignednumber(<givenstring:string>)
@description:
- Returns 1 if the given string represents an unsigned number, 0 if not.
+ Returns [b]1[/b] if the given string represents an unsigned number, and [b]0[/b] otherwise.
*/
static bool str_kvs_fnc_isunsignednumber(KviKvsModuleFunctionCall * c)
{
@@ -347,11 +347,11 @@ static bool str_kvs_fnc_isunsignednumber(KviKvsModuleFunctionCall * c)
@title:
$str.isempty
@short:
- Returns 1 if the given string don't have any character.
+ Returns [b]1[/b] if the given string don't have any character.
@syntax:
<string> $str.isEmpty(<givenstring:string>)
@description:
- Returns 1 if the given string don't have any character (that is, is empty).
+ Returns [b]1[/b] if the given string don't have any character (that is, is empty).
This function is almost useless since it is equivalent to the
comparison with an empty string...
*/
@@ -375,11 +375,11 @@ static bool str_kvs_fnc_isempty(KviKvsModuleFunctionCall * c)
@title:
$str.contains
@short:
- Returns 1 if the first parameter contains the second
+ Returns [b]1[/b] if the first parameter contains the second
@syntax:
<bool> $str.contains(<container:string>,<tofind:string>[,<case:bool>])
@description:
- Returns 1 if the first string parameter contains the second string parameter.
+ Returns [b]1[/b] if the first string parameter contains the second string parameter.
If the third parameter is set to true, then the search is case sensitive.
@seealso:
[fnc]$str.match[/fnc]()
@@ -405,11 +405,11 @@ static bool str_kvs_fnc_contains(KviKvsModuleFunctionCall * c)
@title:
$str.equal
@short:
- Returns 1 if the two string parameters are equal
+ Returns [b]1[/b] if the two string parameters are equal
@syntax:
<bool> $str.equal(<fromcompare:string>,<tocompare:string>[,<case:bool>])
@description:
- Returns 1 if the two string parameters are equal.
+ Returns [b]1[/b] if the two string parameters are equal.
If the third parameter is set to true, then the search is case sensitive.
@seealso:
[fnc]$str.match[/fnc]()
@@ -439,7 +439,7 @@ static bool str_kvs_fnc_equal(KviKvsModuleFunctionCall * c)
@syntax:
<bool> $str.cmp(<fromcompare:string>,<tocompare:string>[,<case:bool>])
@description:
- This function compares two strings alphabetically. If the first string is 'greater' than the second, it will return a positive number, a negative number is the second is greater and 0 if the two strings are equal.
+ This function compares two strings alphabetically. If the first string is [b]greater[/b] than the second, it will return a positive number, a negative number is the second is greater and 0 if the two strings are equal.
If the third parameter is set to true, then the search is case sensitive.
@seealso:
[fnc]$str.match[/fnc]()
@@ -1105,11 +1105,11 @@ static bool str_kvs_fnc_rightfromlast(KviKvsModuleFunctionCall * c)
@syntax:
<bool> $str.match(<expression:string>,<string:string>[,<flags:string>[,<case:bool>]])
@description:
- Returns 1 if the fixed <string> matches the <expression>, 0 otherwise.[br]
- If <flags> contains the flag 'r' then <expression> is treated as a full
+ Returns [b]1[/b] if the fixed <string> matches the <expression>, and [b]0[/b] otherwise.[br]
+ If <flags> contains the flag [b]r[/b] then <expression> is treated as a full
regular expression otherwise it is treated as a simple wildcard expression containing
- the classic wildcards '*' and '?'.[br]
- If <flags> contains the flag 'e' then only an exact match is considered (e.g. the full
+ the classic wildcards [b]*[/b] and [b]?[/b].[br]
+ If <flags> contains the flag [b]e[/b] then only an exact match is considered (e.g. the full
<string> is exactly matched by <expression>), otherwise partial matches are allowed too (e.g.
<expression> is found inside <string>).[br]
If the third parameter is set to true, then the match is case sensitive.[br]
@@ -1153,7 +1153,7 @@ static bool str_kvs_fnc_match(KviKvsModuleFunctionCall * c)
<string> $str.word(<n:int>,<string:string>)
@description:
Returns the nth word inside the <string> (with n starting from 0!)[br]
- A word is a substring not containing spaces (ASCII chars 32, carriage returns, tabs etc...).[br]
+ A word is a substring not containing spaces (ASCII chars 32, carriage returns, tabs etc.).[br]
If the string contains less than n+1 words then an empty string is returned.[br]
This function is faster than a call to [fnc]$str.split[/fnc]() and array indexing
if you need a single word to be extracted from a complex string.[br]
@@ -1441,7 +1441,7 @@ static bool str_kvs_fnc_digest(KviKvsModuleFunctionCall * c)
@description:
Joins all the string in the <data> array by using
the specified <separator> and returns the result.
- If <flags> contains the character "n" then empty strings in the <data>
+ If <flags> contains the character [b][i]n[/i][/b] then empty strings in the <data>
array are skipped.
*/
@@ -1511,13 +1511,13 @@ static bool str_kvs_fnc_join(KviKvsModuleFunctionCall * c)
<array> $str.grep(<match:string>,<strings:array>[,<flags:string>,<offset:integer>])
@description:
Returns an array with the elements of <strings> which match the string <match>.
- <flags> can be any combination of the characters 's','w' and 'r'.[br]
- If the flag 'w' is specified then <match> is assumed to be a wildcard regular
- expression (with * and ? wildcards). If the flag 'r' is specified
+ <flags> can be any combination of the characters [b]s[/b], [b]w[/b] and [b]r[/b].[br]
+ If the flag [b]w[/b] is specified then <match> is assumed to be a wildcard regular
+ expression (with [b]*[/b] and [b]?[/b] wildcards). If the flag [b]r[/b] is specified
then <match> is assumed to be a standard regular expression. If none of
- 'w' and 'r' is specified then <match> is treated as a simple string to be
- searched in each element of the <strings> array. 'r' takes precedence over 'w'.
- If the flag 's' is specified the matches are case sensitive.[br]
+ [b]w[/b] and [b]r[/b] is specified then <match> is treated as a simple string to be
+ searched in each element of the <strings> array. [b]r[/b] takes precedence over [b]w[/b].
+ If the flag [b]s[/b] is specified the matches are case sensitive.[br]
If the offset is specified attempts to find a match in from position offset in every array's item. [br]
If offset is -1, the search starts at the last character; if -2, at the next to last character; etc. [br]
Note that since almost any other variable type can be automatically cast
@@ -1641,15 +1641,15 @@ static bool str_kvs_fnc_grep(KviKvsModuleFunctionCall * c)
<array> $str.split(<separator:string>,<data:string>[,<flags:string>[,<maxfields:integer>]])
@description:
Splits the <data> string by <separator> and returns an array of substrings.[br]
- <flags> may be a combination of the characters 's', 'w', 'r' and 'n'.[br]
- If s is specified, <separator> matching is case sensitive, otherwise it is case insensitive.[br]
- If w is specified, <separator> is treated as a wildcard-type regular expression
- (with * and ? wildcards).[br]
+ <flags> may be a combination of the characters [b]s[/b], [b]w[/b], [b]r[/b] and [b]n[/b].[br]
+ If [b]s[/b] is specified, <separator> matching is case sensitive, otherwise it is case insensitive.[br]
+ If [b]w[/b] is specified, <separator> is treated as a wildcard-type regular expression
+ (with [b]*[/b] and [b]?[/b] wildcards).[br]
If r is specified, <separator> is treated as a extended-type regular expression
- (with character classes, special escapes etc..).[br]
- If both w and r are specified, w takes precedence.[br]
- If neither w and r are specified <separator> is treated as a simple string to be matched.[br]
- If 'n' is specified then any resulting empty fields are discarded.[br]
+ (with character classes, special escapes etc.).[br]
+ If both [b]w[/b] and [b]r[/b] are specified, [b]w[/b] takes precedence.[br]
+ If neither [b]w[/b] and [b]r[/b] are specified <separator> is treated as a simple string to be matched.[br]
+ If [b]n[/b] is specified then any resulting empty fields are discarded.[br]
If <maxfield> is specified, then at most <maxfields> items are returned in the array (i.e. the last
item may be not completely split).
@examples:
@@ -1798,7 +1798,7 @@ static bool str_kvs_fnc_split(KviKvsModuleFunctionCall * c)
a string formatted by following the specification in <format>
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 '?' instead.[br]
+ this function uses the question mark [b]?[/b] instead.[br]
The <format> string can contain the following escape sequences:[br]
[br]
[table]
diff --git a/src/modules/tmphighlight/libkvitmphighlight.cpp b/src/modules/tmphighlight/libkvitmphighlight.cpp
index 3d4117481..70c3fd3c4 100644
--- a/src/modules/tmphighlight/libkvitmphighlight.cpp
+++ b/src/modules/tmphighlight/libkvitmphighlight.cpp
@@ -218,7 +218,7 @@ static bool tmphighlight_kvs_cmd_removechannel(KviKvsModuleCommandCall * c)
@title:
$tmphighlight.isNickHighlighted
@short:
- Returns 1 if the user is highlighted on this channel, 0 otherwise
+ Returns [b]1[/b] if the user is highlighted on this channel, and [b]0[/b] otherwise
@syntax:
<boolean> $tmphighlight.isNickHighlighted <nick:string>
@description:
@@ -254,11 +254,11 @@ static bool tmphighlight_kvs_fnc_isnickhighlighted(KviKvsModuleFunctionCall * c)
@title:
$tmphighlight.isChannelHighlighted
@short:
- Returns 1 if the channel is highlighted on this IRC network, 0 otherwise
+ Returns [b]1[/b] if the channel is highlighted on this IRC network, and [b]0[/b] otherwise
@syntax:
<boolean> $tmphighlight.isChannelHighlighted[window_id:integer]
@description:
- This command returns 1 if the channel is highlighted on this IRC network, 0 otherwise.
+ This command returns 1 if the channel is highlighted on this IRC network, and [b]0[/b] otherwise.
@seealso:
[fnc]$tmphighlight.addChannel[/fnc]
[fnc]$tmphighlight.removeChannel[/fnc]
diff --git a/src/modules/toolbar/libkvitoolbar.cpp b/src/modules/toolbar/libkvitoolbar.cpp
index 07683170c..38ba32d30 100644
--- a/src/modules/toolbar/libkvitoolbar.cpp
+++ b/src/modules/toolbar/libkvitoolbar.cpp
@@ -291,7 +291,7 @@ static bool toolbar_kvs_cmd_hide(KviKvsModuleCommandCall * c)
@syntax:
<boolean> $toolbar.exists(<id:string>)
@description:
- Returns 1 if the toolbar with the specified <id> has been defined.[br]
+ Returns [b]1[/b] if the toolbar with the specified <id> has been defined.[br]
Note that this doesn't mean that the toolbar is visible!
@seealso:
[cmd]toolbar.create[/cmd]
@@ -320,7 +320,7 @@ static bool toolbar_kvs_fnc_exists(KviKvsModuleFunctionCall * c)
@syntax:
<boolean> $toolbar.isVisible(<id:string>)
@description:
- Returns 1 if the toolbar with the specified <id> is visible,
+ Returns [b]1[/b] if the toolbar with the specified <id> is visible,
or 0 when invisible or the given toolbar does not exist.
@seealso:
[cmd]toolbar.show[/cmd]
diff --git a/src/modules/trayicon/libkvitrayicon.cpp b/src/modules/trayicon/libkvitrayicon.cpp
index a61df08e8..a66f6864a 100644
--- a/src/modules/trayicon/libkvitrayicon.cpp
+++ b/src/modules/trayicon/libkvitrayicon.cpp
@@ -682,7 +682,7 @@ static bool trayicon_kvs_cmd_hidewindow(KviKvsModuleCommandCall *)
@syntax:
$reguser.isVisible()
@description:
- Returns 1 if the dock widget is actually visible, 0 otherwise.
+ Returns [b]1[/b] if the dock widget is actually visible, and [b]0[/b] otherwise.
@seealso:
[cmd]trayicon.show[/cmd]
*/
diff --git a/src/modules/window/libkviwindow.cpp b/src/modules/window/libkviwindow.cpp
index 7f23dfb71..1b9125d1f 100644
--- a/src/modules/window/libkviwindow.cpp
+++ b/src/modules/window/libkviwindow.cpp
@@ -370,7 +370,7 @@ static bool window_kvs_fnc_activityTemperature(KviKvsModuleFunctionCall * c)
$window.isDocked
$window.isDocked(<window_id>)
@description:
- Returns 1 if the window specified by <window_id> is currently docked and 0 otherwise.
+ Returns [b]1[/b] if the window specified by <window_id> is currently docked and [b]0[/b] otherwise.
The form with no parameters works on the current window. If the specified window
doesn't exist then 0 is returned.
@seealso:
@@ -400,7 +400,7 @@ static bool window_kvs_fnc_isDocked(KviKvsModuleFunctionCall * c)
$window.hasInput
$window.hasInput(<window_id>)
@description:
- Returns 1 if the window specified by <window_id> has an input field and 0 otherwise.
+ Returns [b]1[/b] if the window specified by <window_id> has an input field and [b]0[/b] otherwise.
The form with no parameters works on the current window. If the specified window
doesn't exist then 0 is returned.
@seealso:
@@ -430,8 +430,8 @@ static bool window_kvs_fnc_hasInput(KviKvsModuleFunctionCall * c)
$window.hasUserFocus
$window.hasUserFocus(<window_id>)
@description:
- Returns 1 if the window specified by <window_id> has
- currently the user focus and 0 otherwise.
+ Returns [b]1[/b] if the window specified by <window_id> has
+ currently the user focus and [b]0[/b] otherwise.
The form with no parameters works on the current window.
If the specified window doesn't exist then 0 is returned.
A window has the user focus if it is the KVIrc's active
@@ -493,7 +493,7 @@ static bool window_kvs_fnc_console(KviKvsModuleFunctionCall * c)
$window.hasOutput
$window.hasOutput(<window_id>)
@description:
- Returns 1 if the window specified by <window_id> has a text output widget and 0 otherwise.
+ Returns [b]1[/b] if the window specified by <window_id> has a text output widget and [b]0[/b] otherwise.
The form with no parameters works on the current window. If the specified window
doesn't exist then 0 is returned.
@seealso: